thumbs-up wearable sensing device for detecting hand-to ... · wearable sensing device for...

12
Thumbs-Up Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1 , Brian Mayton 1 and Joseph Paradiso 1 1 Media Lab, Massachusetts Institute of Technology, 75 Amherst st, Cambridge, MA, USA {azaria, bmayton, joep}@media.mit.edu Keywords: Biomedical Computing, Bioimpedance, Sensor Applications, Artificial Intelligence, Wearable Computers Abstract: Thumbs-Up explores a novel sensing method for detection of hand-to-mouth compulsive habits. Using elec- trical bio-impedance spectroscopy and inertial measurement units, a prototype system was implemented. The system can easily be worn around the arm and may perhaps be integrated into future wearable devices. It recognises occurrences of the habits in real-time, allowing monitoring and immediate interventions. These have so far been very limited, impeding behavioural studies and the development of therapeutic treatments. Throughout this paper the method’s feasibility is demonstrated and aspects of its performance are explored. We present an approach to process the bio-impedance signals and associate them with possible body postures. A positioning strategy optimises the device’s sensitivity and increases its efficacy. Machine learning algo- rithms are leveraged to infer the hand-to-mouth detection. We achieve 92% detection accuracy for recurrent usage and 90% accuracy for users that have not been previously encountered. 1 INTRODUCTION Hand-to-mouth compulsive habits, such as thumb sucking and nail biting, are surprisingly common. Studies found that 28-33% of children, 44% of ado- lescents, and 19-29% of young adults engage in nail biting alone (Tanaka et al., 2008). These compulsive behaviours expose those who exhibit them to multi- ple health risks. Threats range from expedited trans- mission of diseases, to dental malocclusion and even abnormal facial development (Baydas ¸ et al., 2007). Studies into the roots of these habits and their consequences have so far been limited to either sub- jective reports or lab settings. Treatment has been constrained to retrospective correction, relying on self awareness and manual monitoring (Azrin and Nunn, 1973). A wearable device, detecting hand-to- mouth habits in real-time, would mitigate these im- pediments, advancing therapeutic interventions and personal health monitoring. With aetiologies includ- ing anxiety, loneliness, frustration, and more, such a device could even serve as a diagnostic tool to reflect on quality of life impairments (Pacan et al., 2014). This work presents a wearable hand-to-mouth classification system, consisting of an inertial mea- surement unit (IMU) and an electrical bio-impedance spectrometer. It can easily be worn around the arm. The device tracks the arm’s orientation and electri- cally excites it, discovering changes in its impedance properties. These are leveraged to infer hand-to- mouth behaviours in real-time. To the best of our knowledge, this is the first sys- tem to demonstrate automated detection of hand-to- mouth habits. Furthermore, it is innovative in util- ising bio-impedance spectroscopy for this goal. A related detection scheme is described in US Patent 6762687 B2. Rather than sensing physical contact, this scheme senses proximity between tagged body parts. Bio-impedance has been widely studied in the medical context for estimating biophysical quantities such as body composition, metabolic functioning, and cardiac activity. Recent research has demonstrated integrating bio-impedance measurements into wear- able devices – monitoring biophysical markers (Sepp¨ a et al., 2007) and even estimating users’ biometrics (Martinsen et al., 2007). None, however, leveraged bio-impedance technology for behaviour recognition, as our system uniquely does. 2 THEORY OF OPERATION 2.1 Electrical Properties of Biomaterials Electrical bio-impedance (EBI) describes the electri- cal properties biological materials exhibit as current

Upload: others

Post on 23-Jul-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Thumbs-Up Wearable Sensing Device for Detecting Hand-to ... · Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1, ... on quality of life impairments

Thumbs-UpWearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits

Asaph Azaria1, Brian Mayton1 and Joseph Paradiso1

1 Media Lab, Massachusetts Institute of Technology, 75 Amherst st, Cambridge, MA, USA{azaria, bmayton, joep}@media.mit.edu

Keywords: Biomedical Computing, Bioimpedance, Sensor Applications, Artificial Intelligence, Wearable Computers

Abstract: Thumbs-Up explores a novel sensing method for detection of hand-to-mouth compulsive habits. Using elec-trical bio-impedance spectroscopy and inertial measurement units, a prototype system was implemented. Thesystem can easily be worn around the arm and may perhaps be integrated into future wearable devices. Itrecognises occurrences of the habits in real-time, allowing monitoring and immediate interventions. Thesehave so far been very limited, impeding behavioural studies and the development of therapeutic treatments.Throughout this paper the method’s feasibility is demonstrated and aspects of its performance are explored.We present an approach to process the bio-impedance signals and associate them with possible body postures.A positioning strategy optimises the device’s sensitivity and increases its efficacy. Machine learning algo-rithms are leveraged to infer the hand-to-mouth detection. We achieve 92% detection accuracy for recurrentusage and 90% accuracy for users that have not been previously encountered.

1 INTRODUCTION

Hand-to-mouth compulsive habits, such as thumbsucking and nail biting, are surprisingly common.Studies found that 28-33% of children, 44% of ado-lescents, and 19-29% of young adults engage in nailbiting alone (Tanaka et al., 2008). These compulsivebehaviours expose those who exhibit them to multi-ple health risks. Threats range from expedited trans-mission of diseases, to dental malocclusion and evenabnormal facial development (Baydas et al., 2007).

Studies into the roots of these habits and theirconsequences have so far been limited to either sub-jective reports or lab settings. Treatment has beenconstrained to retrospective correction, relying onself awareness and manual monitoring (Azrin andNunn, 1973). A wearable device, detecting hand-to-mouth habits in real-time, would mitigate these im-pediments, advancing therapeutic interventions andpersonal health monitoring. With aetiologies includ-ing anxiety, loneliness, frustration, and more, such adevice could even serve as a diagnostic tool to reflecton quality of life impairments (Pacan et al., 2014).

This work presents a wearable hand-to-mouthclassification system, consisting of an inertial mea-surement unit (IMU) and an electrical bio-impedancespectrometer. It can easily be worn around the arm.The device tracks the arm’s orientation and electri-

cally excites it, discovering changes in its impedanceproperties. These are leveraged to infer hand-to-mouth behaviours in real-time.

To the best of our knowledge, this is the first sys-tem to demonstrate automated detection of hand-to-mouth habits. Furthermore, it is innovative in util-ising bio-impedance spectroscopy for this goal. Arelated detection scheme is described in US Patent6762687 B2. Rather than sensing physical contact,this scheme senses proximity between tagged bodyparts. Bio-impedance has been widely studied in themedical context for estimating biophysical quantitiessuch as body composition, metabolic functioning, andcardiac activity. Recent research has demonstratedintegrating bio-impedance measurements into wear-able devices – monitoring biophysical markers (Seppaet al., 2007) and even estimating users’ biometrics(Martinsen et al., 2007). None, however, leveragedbio-impedance technology for behaviour recognition,as our system uniquely does.

2 THEORY OF OPERATION

2.1 Electrical Properties of Biomaterials

Electrical bio-impedance (EBI) describes the electri-cal properties biological materials exhibit as current

Page 2: Thumbs-Up Wearable Sensing Device for Detecting Hand-to ... · Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1, ... on quality of life impairments

flows through them. It is commonly measured byinjecting a small sinusoidal alternating current (AC)into the tissue under study. The injected current in-duces an electrical field within the tissue and resultsin a measurable voltage drop across it. The AC ver-sion of Ohm’s Law (Equation 1) relates the material’selectrical bio-impedance Z to the ratio between themeasured voltage V and the injected current I.

Z =VI

(1)

It is a complex quantity, since biomaterials not onlyoppose current flow, but also store electrical charge,phase-shifting the voltage with respect to the currentin the time-domain.

When current flows through a tissue, it passesthrough extracellular and intracellular fluids. Thesefluids are highly conductive as they contain salt ionsthat can easily be displaced by a potential difference.Conversely, the cells’ lipid membranes are insulators.They act like capacitive plates, which prevent electri-cal charges from flowing through. Accordingly, thetissue’s impedance reflects its chemical composition,membrane structures, and fluids distribution. For sim-ilar reasons, the specific cell types (blood, adipose,muscle, bone, etc.), the anatomic configuration (i.e.,bone or muscle orientation and quantity), and the stateof the cells (normal or osteoporotic bone, oedematousvs. normally hydrated tissue, etc.) greatly affect mea-sured impedance quantities (Gabriel et al., 1996).

Most tissues display dispersive characteristics, i.e.their impedance varies with the frequency of the ap-plied current. A typical dispersion curve is illus-trated in Figure 1. It is displayed as a Cole-Cole plotwhich superimposes impedance measurements froma range of frequencies on the complex plane. At lowfrequencies, the cells’ membranes block the current.Thus, the impedance corresponds only to the extracel-lular resistance. As frequency increases, more currentpasses through the intracellular capacitive path, andthe phase angle accumulates. At high frequencies,the intracellular capacitance becomes negligible. Theimpedance is once again purely resistive, dominatedby the intracellular and extracellular fluid resistancesconnected in parallel. The frequency at which the tis-sue’s reactance reaches a peak is known as the centrefrequency ( fc).

2.2 The Cole-Cole Equivalent CircuitModel

The simplest electrical circuit that can be used tomodel EBI response is presented in Figure 2. Ri andCm represent the intracellular current branch and Re

Figure 1: Typical Cole-Cole plot of biological tissue.

Figure 2: Simple circuit model for biological tissues.

represents the extra cellular one. This model resultsin a perfect semicircle in a Cole-Cole plot, with thecentre of the circle on the resistance axis.

In real tissue, however, the cells’ membrane is animperfect capacitor. Moreover, the large variation incell type, structure, and size causes a distribution ofthe cells’ capacitive time constants (Cornish et al.,1993). Cole and Cole showed that when capacitivetime constant distribution is added to the aforemen-tioned circuit model, the impedance is related to thefrequency by (Cole and Cole, 1941):

Z = R• +R0 �R•

1+( jwt)1�a (2)

where,R0 = Re (3)

R• = Ri||Re (4)

t = (Re +Ri)Cm (5)

This model preserves the circular shape in a Cole-Cole plot, but depresses the circle’s centre below theresistance axis. a has a value between 0 and 1, and isproportional to the angle to the depressed centre.

Page 3: Thumbs-Up Wearable Sensing Device for Detecting Hand-to ... · Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1, ... on quality of life impairments

2.3 Electrode Sensitivity Field andConfiguration

Two types of electrode systems are commonly usedto obtain EBI measurements. A 2-electrode systemuses the same pair of electrodes to inject current (IC)and pick up (PU) the tissue’s response. A 4-electrodesystem uses different pairs for excitement and pick up.The type of electrodes in use (needle or skin surface,gel or dry, etc.), and their configuration around thetissue affect the sensed impedance almost as much asthe electrical properties of the tissue.

The electrode type determines how the electricalconductor in the measurement leads interfaces withthe ionic conductor in the biological tissue. As currentflows, substance concentration may change near theelectrodes’ interface, adding bias impedance calledelectrode polarisation. The skin-electrode contact in-troduces an additional resistive bias. The 4-electrodesystem is a robust setup that reduces the influence ofthese factors (Seoane et al., 2008). When voltage pickup is implemented with high-impedance differentialamplifiers, such artefacts can be neglected.

The electrode configuration sets boundary valueson the electrical fields that develop inside the tissue.Thus, it governs the fields’ propagation and in effect,the relative contribution of internal tissue regions tothe measured mutual impedance. Geselowitz formu-lated this idea for a 4-electrode system (Geselowitz,1971). He established that the measured impedanceZ resulting from the variable conductivity s within avolume conductor can be evaluated by:

Z =Z

V

1s

Sdv (6)

Sensitivity S is a scalar field, determining the con-tribution of a local conductivity change (Ds) to theoverall potential. It can be calculated from the dotproduct of two current density fields:

S = ~JIC · ~JPU (7)~JIC represents the current density field generated by aunit current applied through the IC electrodes. ~JPU isthe reciprocal current density field that would havebeen generated had the same current been injectedthrough the PU electrodes.

Depending on the angle of the two fields, therecan be regions where the sensitivity is zero, posi-tive, or negative. Hence, the tissue regions, in whichimpedance changes are measured, can effectively bemanipulated by the electrode configuration. Note thatthe measured mutual impedance is indifferent to in-terchanges between the IC and PU electrodes. In thiscontext, this phenomenon is commonly referred to asthe Reciprocity Theorem.

Figure 3: Images of the prototype system (From top: IMUwristband, EBI spectrometer, and PC Interface).

3 SYSTEM DESCRIPTION

Inspired by how pervasively electrical fields propa-gate inside biological tissues, we set out to examineif EBI spectroscopy can be applied to sense hand-to-mouth behaviours. We hypothesised that placing thehand inside the mouth will form different paths forthe current to traverse inside the body, resulting indistinct impedance spectra. We presumed these canbe analysed, detecting the placement of the hand in-side the mouth. In light of the multiple factors thatmanifest in an EBI spectrum, we explored machine-learning techniques for making such distinctions. Asimilar technique, learning from capacitive signals,has previously been used to classify simple gesturesfor human-computer interfaces, suggesting promiseto this approach (Sato et al., 2012).

To test this hypothesis and assess its validity,we built a prototype system. Images of the sys-tem are presented in Figure 3. We present the sys-tem’s design in detail throughout the following sec-tion. When necessary, we discuss alternative imple-mentation schemes and possible improvements.

3.1 Hardware

The hardware consists of an EBI spectrometer andan IMU, wired to a nearby personal computer viaUSB. The bio-impedance spectrometer was imple-mented on a printed circuit board (PCB) and wasbased on Analog Devices’ AD5933 on-chip network

Page 4: Thumbs-Up Wearable Sensing Device for Detecting Hand-to ... · Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1, ... on quality of life impairments

analyser. The analyser contains a frequency generatorcapable of outputting a sinusoidal excitation voltage.The response signal is picked up by the analyser andprocessed by an on-chip Discrete Fourier Transform.Real and imaginary 16-bit data words, proportional tothe measured impedance, are returned for each outputfrequency. A frequency range between 1 to 100 kHzis supported, with a 0.1 Hz resolution.

We interfaced the AD5933 with the analoguefront-end presented in (Seoane et al., 2008). Thisfront-end, illustrated in Figure 4, converts theAD5933 from a 2-electrode to a 4-electrode measure-ment system. Hence, it cancels impedance contribu-tions from electrode polarisation and skin-electrodecoupling. An instrumentation amplifier, voltage fol-lower, and a hardwired 20 kW resistor construct a volt-age controlled current source (VCCS), which mod-ifies the AD5933 excitation from being voltage tocurrent driven. An auxiliary high-pass-filter (HPF)blocks DC voltage from flowing into the tissues. Thisway, current is controlled and regulated well be-low hazardous levels. Frequencies are limited above3.5 kHz to fully comply with IEC-60601 safety guide-lines. AC current of 174 µA (RMS) was confirmed byan independent measurement in our system.

An ATmega328P micro-controller controls theAD5933, via I2C, and obtains the impedance mea-surements. It is used to execute parts of our algo-rithms, assessing their performance on an embeddedplatform. We followed the layout by (Blomqvist et al.,2012) to power the board and communicate with themicro-controller over USB.

This layout does not restrict power consumptionand requires 0.5W for its operation. It is directlywired to a PC, and so requires inefficient power andcommunication isolation, that will not be necessary ina battery powered wearable device. The basic compo-nents in use, however, are well suited for low-powerapplications. Typical power consumption of the AT-Mega328P and the AD5933 are 33mW and 20mW,respectively. Likewise, the analogue front-end can beadjusted to require minimal power. Future versionscould easily revise power and communication to fitthe requirements of a wearable device.

We used 1” adhesive gel electrodes (CovidienH124SG), commonly used in ECG and EMG, forour experiments. These surface electrodes allow non-invasive and precise fixture of the electrodes to thearm. The contact electrolyte gel is of less impor-tance to our application. It is designed to mitigatethe high impedance of the skin at lower frequencies,typically under 1 kHz. By removing the DC compo-nent from the excitation signal and alternating to a4-electrode configuration, the polarisation character-

Figure 4: Block diagram of the analogue front-end de-scribed by Seoane et al.

istics of the particular electrodes in use can also beneglected (Seoane et al., 2008).

We therefore expect that a future change to dryelectrodes – relying on sweat as the electrolytic so-lution – will not significantly affect our results. Dryelectrodes will lower our system’s cost and improveits unobtrusiveness and reusability. It will, however,have to assume the continuous natural perspiration ofthe skin. Otherwise, the sweat electrolytes, carryingour system’s current, can be depleted over time.

The IMU is attached to a wristband-like strapand worn on the user’s forearm. It streams mea-surements of the forearm’s orientation and displace-ment. We used an MPU9150, which comprises a 3-axis accelerometer, a gyroscope, and a magnetometerin a single chip. The chip was placed on a breakoutboard and connected to an off-the-shelf Arduino withan identical ATMega328P micro-controller. In futureversions, the IMU can easily be connected to the spec-trometer’s I2C bus, embedding all sensors on a singleboard.

3.2 Software

3.2.1 Calibration

The impedance measurements – real and imaginary16-bit data words for each exciting frequency – arefirst scaled and calibrated. The calibration accountsfor the complex impedance introduced by our sys-tem’s various electronic components – between theAD5933 and the studied tissues.

A system gain factor scales the magnitude of eachimpedance measurement. Such scaling can be formu-lated as:

|Ztissue(w)|=Magnitude

Gain Factor=

pR (w)2 + I (w)2

G(w)(8)

We used a 2R-1C circuit with known impedance, likein Figure 2, to derive the frequency-dependent gainfactor of our system. Similarly, the system phase off-set is derived from a circuit with pure resistance. It

Page 5: Thumbs-Up Wearable Sensing Device for Detecting Hand-to ... · Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1, ... on quality of life impairments

factors in as a frequency dependent bias when cali-brating the impedance measurements:

\ Ztissue(w) = tan�1(I (w)R (w)

)�\ system(w) (9)

The IMU allows programmable full-scale rangesto each of its components. Based on the arm’s char-acteristic motion, we set these ranges to ±250 dps,±2 g, and ±1200 µT for the gyroscopes, accelerom-eter, and magnetometer respectively. We measuredoffsets in the angular velocity and linear accelerationwith a simple gimbal. Each of the 9 measurementswere scaled and corrected accordingly.

3.2.2 Feature Extraction

Features for hand-to-mouth detection are extractedfrom calibrated EBI and IMU measurements. Thesefeatures are listed in Table 1.

Table 1: List of extracted features.

EBI features IMU featuresCircle centre (Xc) Quaternion orient. (q0)Circle centre (Yc) Quaternion orient. (q1)Circle radius (R) Quaternion orient. (q2)Infinity impedance (R•) Quaternion orient. (q3)Static impedance (R0)Depression angle (a)Centre frequency ( fc)Fit accuracy (Var{Rn})

EBI FeaturesWe chose the Cole-Cole model to compactly repre-sent the EBI data, using its parameters as features. Tocalculate them, the calibrated impedance samples aremapped to the impedance plane in a Cole-Cole plot.Such mapping was exemplified in Figure 1. Each datapoint on the plane corresponds to the resistance andreactance measured at a single frequency. We seek tofit these points to the Cole equation – a perfect semi-circle with the centre depressed below the resistanceaxis.

We leverage the circular shape to estimate the pa-rameters of the Cole-Cole model. Instead of solvingdirectly for the model parameters (R•, R0, t, a andfc), we estimate the circular curve that best representsour data. We do so by finding a point (Xc,Yc) thatminimises the variance in the distances Rn, measuredfrom it to the N impedance data points.

min Var{R2n}= min Var{|(Xc,Yc)�Zn|2} (10)

This point will be the Cole-Cole model circle cen-tre. A closed form solution for such a minimisation

is obtained by differentiating Equation 10. The Cole-Cole model parameters, R•, R0 and a, can then besolved geometrically from the circle centre. A de-tailed derivation is found in (Ayllon et al., 2009).

The centre frequency fc is determined as pre-sented in the work of (Cornish et al., 1993). Lengthsof cords ui and vi, which respectively join eachimpedance data point i with R• and R0, are calcu-lated. The impedance points are then projected to alog(ui/vi) vs. log(wi) plane, where they yield a linewith slope (1�a). The x-axis intercept of this linedetermines the centre frequency.

We calculate the variance in R2n and affix it as an

additional parameter to our EBI data representation.It serves as an indicator of how accurately our datafits to a circular curve. Later, it will be utilisedwhen performing real-time classification, to identifymovement artefacts and discard them.

IMU FeaturesWe used an AHRS (Attitude and Heading ReferenceSystem) sensor-fusion algorithm to handle the IMUmeasurements. The algorithm produces a four-vectorquaternion representation of the device’s orientationin 3D. Rather than using computationally expen-sive Kalman-Filter implementations, we chose thesensor fusion algorithm developed by Madgwick(Madgwick et al., 2011). This algorithm derivessimple gradient descent steps to conduct fusion andestimations iteratively, allowing it to operate oncomputationally constrained platforms compatiblewith wearable devices.

ExecutionThe extraction algorithms were designed to executein real time. The orientation state is updated con-tinuously, processing IMU measurements at a 400 Hzsampling rate. The EBI feature extraction algorithmprocesses a frequency sweep at a 0.64 Hz rate. Weconfigured the frequency sweep to obtain 50 samplesequally spaced between 4 kHz and 100 kHz. The fre-quency resolution can be modified to boost the sweep-ing rate at the expense of the fit accuracy. The sweep-ing rate determines the rate at which the feature vec-tors are generated. The EBI features are first extractedand then extended with the current four-vector quater-nion orientation.

The feature extraction algorithms were imple-mented both for a personal computer and for the AT-mega328P micro-controllers. We experimented withexecuting them on both. Running on the micro-controller reduces dramatically (factor 18) the data tobe communicated to the next stage. It does so, how-ever, at the cost of an increased computational load.

Page 6: Thumbs-Up Wearable Sensing Device for Detecting Hand-to ... · Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1, ... on quality of life impairments

We experienced no performance issues executing thealgorithms on the ATmega328P, when the samplingrates were set as previously mentioned. We leave thedecision between the execution alternatives open forfuture applications.

3.2.3 Hand-to-Mouth Detection

The final stage of our software allows three modes ofoperation: Collection mode logs real-time collecteddata and extracted features into a local file for lateranalysis. A human observer labels the data pointswith a binary label. Positive and negative labels cor-respond to situations when the hand is inside and out-side the mouth. Enrolment mode accepts previouslycollected labeled data either from a specific user or agroup of users. It optimises a set of machine-learningalgorithms and chooses the one which is most likelyto perform best. Prediction mode makes real-timepredictions on the hand’s situation. It uses the opti-mal classifier from the previous mode to predict oneach feature vector as it is produced. The predictions,as well as the arm’s orientation, are visualised to theuser as feedback.

Our system allows learning via any binary-classification model, as long as it implements a sim-ple f it, score and predict interface. We embeddedthe Scikit � learn implementation of five classifica-tion models in our system: Random Forests (RF),Support Vector Machines (SVM), AdaBoost (AB), K-Nearest Neighbours (KNN) and Logistic Regression(LR) (Pedregosa et al., 2011). The models were cho-sen to intentionally differ in their underlying statis-tical assumptions and algorithmic implementations.Hence, they differ not only in the accuracy they mayachieve, but also in the computational complexitytheir training or prediction involve.

We optimise the unique parameters of the classi-fication models, by searching a grid of possible val-ues. A classifier instance is trained for each parametercombination. How well it generalises is assessed us-ing 3-iteration random subsampling cross-validation(Murphy, 2012). Once the optimal parameters perclassification model are set, we choose among themodels by their mean validation accuracy.

Prediction mode introduces two additional mech-anisms to facilitate the real-time prediction and feed-back. First, it discards data points whose Cole-Colecircular fit accuracy is below a threshold (i.e. highVar{R2

n}). These were observed during natural move-ment, in singular cases – when by the time a fre-quency sweep is over, the user has already changedbetween postures with different EBI spectra. Clearly,fitting to the inconsistent measurements does nottruthfully represent the electrical path taken by the

current. Discarding them, therefore, prevents unnec-essary prediction errors. Second, a moving averagewindow on the predicted labels was implemented,smoothing the visual feedback presented to the user.

4 EVALUATION

In this section we demonstrate the system’s feasibil-ity by evaluating various aspects of its performance.Note that the prototype system leaves many degreesof freedom in its application – from configuring theelectrodes on the forearm, to when it is worn andby whom. We therefore tackle this challenginglybroad space by breaking the evaluation into threestages. First, we present an approach to process thebio-impedance signals and verify they carry informa-tion about hand-to-mouth behaviours. We associatethem with possible body postures, narrowing downthe scope of movement for our experiments. Second,an electrode positioning strategy is proposed, optimis-ing the system’s sensitivity to conductivity changesaround the fingers. Finally, the system’s detection ac-curacy is assessed, analysing how it performs in twopossible use cases with multiple subjects.

4.1 EBI of Hand-to-Mouth Behaviours

4.1.1 Method

The first stage explored how a wearer’s hand-to-mouth behaviours manifest in the measured EBI spec-tra. To this end, we have conducted an experimentwith a single subject in an indoor working environ-ment. The subject wore the device for 5 consecutivehours, and data were recorded as he naturally movedin this everyday setting. Periodically, the subject wasasked to place any of his 5 fingers in his mouth. Anexternal observer annotated the recorded data withthe subject’s activity and body postures. Throughoutthis experiment, the electrodes were placed in a singleconfiguration on the subject’s forearm, marked (10,1)as will later be detailed in Section 4.2.

We utilised the recorded data to narrow down thescope of movement for the next stages of this work.This satisfies experimental control and reproducibil-ity. The subject’s imitation of natural movement cap-tures most possible orientations of the forearm, aswell as the variance of bioelectrical measurements.Special attention was paid to ensure that the datasetalso included situations where different body partscome in contact with the subject’s fingers. These areimportant as they create different paths through which

Page 7: Thumbs-Up Wearable Sensing Device for Detecting Hand-to ... · Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1, ... on quality of life impairments

Figure 5: Sample EBI spectra generated by different body postures.

current can traverse, hence changing the characteris-tics of the EBI spectrum.

4.1.2 Results and Discussion

The EBI recordings supported our detection hypoth-esis. Noticeable differences were observed betweensituations where the subject’s hand was inside or out-side the mouth. These manifest not only for spe-cific exciting frequencies, but indeed throughout theentire spectrum. Fitting the spectra to a Cole-Colemodel, we observe satisfactory differences in manyof the model’s parameters. For example, the staticimpedance R0 demonstrated a mean decrease of 32%when juxtaposing sitting with placing the thumb in-side the mouth.

As mentioned, we were particularly interested inpostures where different parts of the body come incontact with the fingers. We experimented with anassortment of these, in an attempt to identify oneswhich create unique EBI spectra. Our experimen-tation was limited to contact with body parts whichwere exposed wearing full clothing. We exemplifythree such postures – crossing the arms, clasping thehands, and leaning the head on the hand – in Figure5. EBI spectra from sitting, standing and placing anyof the 5 fingers inside the mouth are overlaid for com-parison.

Note that the EBI spectrum generated by clasp-ing the hands resembles the ones generated by plac-ing any finger inside the mouth. In some instances,

we noticed a circular spectrum almost identical to onefrom a hand-to-mouth posture. Our design trusts dif-ferences in the orientation components to settle theseambiguities.

Supporting this assumption, we analysed differ-ences in the system’s detection accuracy, restrictingit to rely only on a subset of components from the ex-tracted features. Classification models were trained,as indicated in Section 3.2.3, for three cases: includ-ing only the orientation components, only the EBIcomponents, or all available components. We thencompared the models by their prediction accuracies,classifying an independent test set. This set was col-lected by repeating the aforementioned experimentwith the same subject on a different day. Detectionaccuracies of 74.39%, 90.74% and 95.76% were ob-tained for each of the cases respectively. They implythe suitability of the different sensors for our detec-tion task, and bolster our decision to combine them.

Finally, we studied the measured EBI spectra toselect 10 representative body postures. The first fivewere tied with the placement of each of the wearer’s5 fingers inside the mouth. The remaining postureswere selected to generate the highest diversity in theircorresponding EBI spectra. Crossing the arms, clasp-ing the hands, and leaning the head on the hand werechosen by this criterion. Sitting still and standingwere chosen due to their high rate of occurrence in thedataset. The last two represent EBI spectra similar towalking and typing which were the most frequentlyobserved postures.

Page 8: Thumbs-Up Wearable Sensing Device for Detecting Hand-to ... · Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1, ... on quality of life impairments

Figure 6: Electrode Instrumentation on a subject’s forearmused to evaluate an optimal positioning.

4.2 Positioning Optimisation

The second stage examined possible positioning ofthe electrodes on the arm. We limited the electrodes’arrangements to the forearm, as only such arrange-ments would make practical sense for wearing orwiring in future applications.

4.2.1 Instrumentation

Figure 6 illustrates how a single subject was instru-mented with 20 electrodes. In accord with the muscu-lar anatomy of the forearm, the electrodes were linedin two bands. Electrodes following the posterior andanterior fascial compartments were marked with Land R respectively. Within each band, the electrodeswere indexed from 1 to 10 starting from the elbow.The mean distance between the centre of consecutiveelectrodes was 2.66 cm.

Though each pair of electrodes is interchangeableup to a sign, and the PU and IC electrodes are in-terchangeable by the Reciprocity Theorem, it is stillinfeasible to exhaustively evaluate each of the 19,380possible electrodes’ combinations. Therefore, we in-troduced a constraint that the PU and the IC electrodesare configured in a crossed alignment, in which thecurrent density fields are intersecting with each other.Figure 7 illustrates such an arrangement. The IC (+)electrode and the PU (-) electrode were always as-signed to the R band. Correspondingly, the IC (-)electrode and the PU (+) electrode were always as-signed to the L band. Forming an intersection, the (+)pair and the (-) pair were restricted each to maintainthe same index along the forearm. We use the elec-

Figure 7: Schematic illustration of a crossed alignment ofthe electrodes. The propagation lines are a coarse approxi-mation of the induced current density fields.

trodes’ indices to denote their configuration. Config-uration (10,1), for example, marks an electrode con-figuration where that the (+) and (-) electrodes are inindices 10 and 1 respectively.

The assumption that the electrodes should becrossed is not verified within the scope of this work.However, it builds on our intuition of the current den-sity fields ( ~JPU and ~JIC) induced by the electrode sys-tem. A coarse approximation of these is visualisedin Figure 7. Unlike most cases where conductiv-ity changes are circumscribed by the electrodes, wewould like to sense changes further away – in regionswhich are electrically coupled by the touch of the fin-gers. The crossed alignment, therefore, attempts tonullify the sensitivity field (dot product) inside theforearm by creating antiparallel components betweenthe current density fields. On the other hand, it at-tempts to increase the sensitivity as we go furtheraway – where the fields become more parallel.

4.2.2 Method

Our experiment varied the distance between the (+)and (-) electrodes, as well as their position along theforearm. Starting with configuration (10,1), we de-creased the distance in three different ways, evaluat-ing each configuration we encounter:• Moving the (+) pair towards the elbow – from

Page 9: Thumbs-Up Wearable Sensing Device for Detecting Hand-to ... · Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1, ... on quality of life impairments

configuration (10,1) to (2,1).• Moving the (-) pair towards the wrist – from con-

figuration (10,1) to (10,9).• Symmetrically moving both pairs towards each

other – from configuration (10,1) to (6,5).Each electrode configuration was evaluated by twoseparate metrics.

First, we compared the electrode configurationsby their sensitivity to changes around the fingers. Wecalculated fluctuations in the measured impedance, aswe alternated the body tissues that the fingers touch.By proxy, the more intense the fluctuations were, themore conductivity changes around the fingers con-tributed to the overall impedance. We used the 10body postures to represent a fixed set of body tissuesthat come in contact with the fingers. For each elec-trode configuration, an identical number of sampleswere recorded in every posture. Fluctuations werethen calculated by determining the coefficient of vari-ation for the impedance magnitude in the recording:

Coefficient of variation =std{|Z|}

mean{|Z|} (11)

Second, we assessed the electrode configurationsby their predictive power. We held a second record-ing session with the same subject on a different dayand re-instrumented his arm with the electrodes. TheEBI spectra, generated by the various postures in thissession, served as an independent test set. In thisexperiment, we only used the EBI features, discard-ing the orientation components. This way, our resultsonly reflect the electrical dissimilarities between theelectrode configurations. A classification model wastrained and its optimal parameters were selected, us-ing data only from the first recording session. Theelectrode configurations were compared with theirprediction accuracy on the test set.

4.2.3 Results and Discussion

Figure 8 presents the coefficient of variation in theimpedance magnitude obtained for each of the eval-uated configurations. The presented results were de-rived from the impedance sampled with a single ex-citation frequency 52 kHz. Similar trends were ob-served measuring with other excitation frequencieswithin the system’s range.

It is evident that the coefficient of variation gradu-ally increases as the electrodes in the pairs go furtherfrom each other. This finding is consistent with thetheoretical sensitivity field model that was previouslyreviewed. The further the electrodes are, the vaster thecurrent density fields spread inside the tissue, grant-ing distant regions, such as around the fingers, higher

Figure 8: Coefficient of variation of the electrode configu-rations. The overlaid Indices pairs mark specific configura-tions of interest.

Figure 9: Predictive power of the electrode configurations.

relative contribution to the overall impedance. Theregion circumscribed by the electrodes also appearsto have an effect on the coefficient of variation. Thiscan be identified by studying the three graphs of Fig-ure 8 against each other. Notice how the coefficient ishigher when the circumscribed region is closer to thewrist rather than the elbow.

A second assessment was based on the configura-tions’ predictive power. Figure 9 plots the prediction

Page 10: Thumbs-Up Wearable Sensing Device for Detecting Hand-to ... · Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1, ... on quality of life impairments

accuracies achieved by the optimal classification al-gorithms after selecting their parameters. Configura-tion (10,1) yields powerful accuracy results as antici-pated by its coefficient of variation. Nonetheless, thebest accuracy results (up to 97.6%) are encouraginglyproduced by configuration (6,5). As it is geometri-cally concentrated, such configuration can greatly fa-cilitate a wearable design for practical applications.

We chose to proceed to the next stage of the eval-uation with two electrode configurations: (10,1) dueto its high coefficient of variation, and (6,5) due toits highest prediction accuracy. Detection accuraciesfrom both are presented in the next section. We havealso conducted experiments in which the IC and PUelectrodes were not constrained to move symmetri-cally or together. These are not included here, sincethey revealed neither an observable trend nor highersensitivity or accuracy.

4.3 Detection Accuracies

The final stage analysed aspects of our system’s ro-bustness, using data collected from multiple subjectson multiple days. Within the scope of this work, weexplored two probable use cases – recurrent usage bythe same user and encountering previously unseenusers for the first time.

Recurrent UsageFirst, we investigated situations when the same userwears the system on separate days. This capturesplausible imprecisions from recurrent usage of thesystem, like inconsistent placement of the electrodesor misalignment of the IMU. Additionally, it accountsfor transient changes in bioelectrical properties of thewearer’s forearm. These may introduce perturbationsof over 8% in an EBI spectrum (Gabriel et al., 1996).They are likely to stem from temporal variations influid volumes, blood pressure, body temperature,nervous activity, hydration, electro-dermal activity,etc. (Schwan, 1956)

Previously unseen UsersNext, we examined how well the system generalises,performing on new subjects that have not been pre-viously seen. This tests the system’s tolerance toperson-to-person differences, including differences inadipose, muscle and vasculature ratios, bone anatomy,sub-dermal water content and skin thickness. Suchgeneralisation is of crucial importance for future de-sign of practical applications. It involves implicationson the system’s capability to scale, deploying to abroad user base without a need to first collect theirdata and customise per individual.

4.3.1 Method

We recruited 15 subjects, 8 females and 7 males, toparticipate in a pilot user study. The study was ap-proved by IRB protocol #1504007088. All subjectswere between the ages 21 and 33 (mean=26.5; s =3.6). Their forearm length was measured and rangedbetween 22 cm and 27.5 cm (mean=24.8; s = 1.7).They were asked for their weight, which varied be-tween 47 kg and 77 kg (mean=58.3; s = 9.4), andtheir height which varied between 155 cm and 185 cm(mean=169; s = 8.9).

The subjects were invited twice to identical ses-sions on two separate days over the course of a sin-gle month. At the beginning of each session, theywere instrumented with the electrode configurationsselected in Section 4.2, on their left forearm. The sub-jects’ forearm length was measured, and the place-ment of each electrode within the combination wasscaled accordingly. Data were then recorded as thesubjects were asked to pose in the postures from Sec-tion 4.1. Positive and negative labels were respec-tively assigned to postures when the subjects’ handwas inside or outside their mouth.

An additional subtlety was introduced for posturesin which the hand was placed inside the mouth. Foreach finger, measurements were taken both when thefinger was fully sucked (up to the middle phalanx)and when its tip was only lightly touching the innerlip. This extension intends to simulate dissimilaritiesbetween thumb sucking and nail biting, and verifiesthe system’s ability to detect both.

We framed the evaluation as a binary-classification problem, and report the system’sdetection performance in terms of classificationaccuracy. According to the evaluated use case, thedataset was partitioned for training, validation andtesting purposes. Prior to any analysis, all data pointswere scaled using feature standardisation (Murphy,2012). In total, we have collected 10,483 data points;Each of which is a Cole-Cole representation of anEBI spectrum, comprising 50 complex impedancemeasurements, and a corresponding orientation.6,348 of the data points had a positive label and 4,134had a negative one.

4.3.2 Results and discussion

Recurrent UsageFirst, we established how the system generaliseswhen the same individual recurrently wears it. We didso by tailoring a classifier per user. The first recordingsession is randomly partitioned into training and val-idation datasets; Data recorded in the second session

Page 11: Thumbs-Up Wearable Sensing Device for Detecting Hand-to ... · Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1, ... on quality of life impairments

Table 2: Detection accuracies for recurrent usage by thesame user. Baseline accuracies were generated by a strat-ified dummy classifier.

Config. Classifier Test accuraciesMedian Mean (s)

(10,1) Optimal 92.95% 90.98% (6.3)KNN 92.15% 88.31% (6.5)

Baseline 53.42% 53.4% (3.3)(6,5) Optimal 91.6% 90.96% (7.1)

RF 91.6% 85.47% (9.2)Baseline 53.83% 52.9% (3.2)

was held-out as a test set. We searched the param-eter space of each classification model, as indicatedin Section 3.2.3. The combination of algorithm andparameters, which optimised the performance on thevalidation set, was selected as the subject’s personalclassifier.

Table 2 reports the median, average and standarddeviation of the test accuracy scores obtained by thepersonal classifiers. It determines that when recur-rently worn by a user, our system is expected to ac-complish a median accuracy of up to 92.95%, detect-ing hand-to-mouth behaviours. Encouragingly, elec-trode configuration (6,5) performed equally well asconfiguration (10,1). We regard the median statisticas the most relevant one for our evaluation, as it is themost robust to subjects which are potentially outliersin our user base.

We also examined a condition when the personalclassifiers were constrained to train only with a spe-cific classification model. In this case, only themodel’s parameters were optimised per user. For con-figuration (10,1), similar median accuracies were ob-tained when using only KNN classifiers and when op-timising with all possible models. The same emergesfor configuration (6,5), constraining its training onlyto RF classifiers. This finding implies, that a singleclassification model may be used to generalise forrecurrent usage. Relevant accuracy scores of theseconstrained cases are also presented in Table 2. Westate, however, that a larger user base, which yields asmaller distance between the median and mean statis-tics, should be analysed to confirm such observations.

We highlight that these accuracies were obtainedfrom training with a single usage. An alternativeapproach may suggest training with multiple usagesto potentially increase detection accuracies. Despiteits rigour, we chose the former, trusting that futureapplications would greatly benefit from requiring notmore than a single usage for training. Otherwise, theusers’ enrolment procedure can become cumbersomeand impractical.

Previously unseen UsersNext, we assessed the system’s performance when en-countering subjects it has not previously seen. Wepartitioned our dataset, holding-out data points from3 subjects (20%) for testing purposes. The remainingsubjects were used for training and validation. Persubject, we included data points from the two record-ing sessions, diversifying the datasets with multipleusages. As in Section 3.2.3, the optimal combinationof model and parameters was selected by its valida-tion accuracy. Its test accuracy was derived from mak-ing predictions on the previously unseen test subjects.

Due to the relatively small number of subjects, theparticular assignment of test subjects is likely to af-fect the resulting accuracy. Therefore, instead of ran-domly selecting an assignment, we chose to exhaus-tively search through all possible ones. This approachgains a more credible insight into the system’s capa-bility to generalise person-to-person differences. Itprotects from arbitrary bias that may mislead our eval-uation. In Table 3 we report the median, average andstandard deviation of the test accuracies obtained bythe optimal classifiers as they predicted for their cor-responding assignments.

Our results suggest that our system is likely to pro-duce an accuracy of 87.5%, predicting hand-to-mouthbehaviours for subjects it has never before seen. Re-grettably, these high accuracy results were only pro-duced for electrode configuration (10,1). Configu-ration (6,5), performed significantly worse, yieldingmedian accuracy of only 79.69%. For two thirds ofthe subjects’ assignments, RF was selected as the op-timal model regardless of the electrode configuration.This indicates that the RF model may be the fittest onefor this kind of task.

We continued our analysis, exploring the possi-bility of adjusting the classifiers by the users’ phys-icality. We clustered our subjects into two groups,based on their gender, age, weight, height and fore-arm length. A 2-component Gaussian Mixture Modelclustering technique was used, utilising ExpectationMinimisation (EM) to fit the subjects’ physicalitymeasurements. Except for a single subject, the re-sulting clusters overlapped with the subjects’ genders.We mark the clusters F and M respectively, accordingto the majority of females and males in their popula-tion.

We repeated the previous analysis for each of theclusters separately. To preserve the ratio from the for-mer analysis, a single subject was held-out for test-ing from the M cluster, and a pair were held-out fromcluster F. The median, mean and standard deviationsof the test accuracies are also presented in Table 3 forcomparison.

Page 12: Thumbs-Up Wearable Sensing Device for Detecting Hand-to ... · Wearable Sensing Device for Detecting Hand-to-Mouth Compulsive Habits Asaph Azaria 1, ... on quality of life impairments

Table 3: Detection accuracies predicting for users that havenot been previously seen.

Config. Dataset Test accuraciesMedian Mean (s)

(10,1) All 87.5% 87.21% (5.1)Cluster F 90.52% 87.96% (6.3)Cluster M 90.72% 88.14% (6.1)

(6,5) All 79.69% 79.81% (5.5)Cluster F 83.25% 84.7% (7.9)Cluster M 82.09% 82.82% (4.4)

Successful improvements of up to 3% in the me-dian accuracies were observed employing this ap-proach. They suggest that person-to-person differ-ences can be ameliorated by an a priori query of theuser’s physicality. It could be possible for future ap-plications to optimise multiple classifiers based onphysical typecasts. A mixture of those can then beemployed for unseen users, consequently improvingexpected accuracy. The mixture should be weightedby the users’ similarity to the physical typecasts pro-duced while training. Future work should further ex-plore this possibility with a larger user base.

5 CONCLUSION

This work has presented a wearable system detectinghand-to-mouth behaviours in real time. It demon-strated a novel sensing method, associating bio-impedance spectra with the wearer’s behaviour. Therelationship between the system’s sensitivity and itselectrode configuration has been investigated, opti-mising the latter to potentially increase detection ef-ficacy. The system’s performance has been evalu-ated, examining use cases where it is recurrently wornand where it encounters a user for the first time. Itachieved a median detection accuracy of 92% and90%, respectively. These, we aspire, may be sufficientto guide new directions in the treatment and monitor-ing of compulsive hand-to-mouth habits.

REFERENCES

Ayllon, D. et al. (2009). Cole equation and parame-ter estimation from elect. bioimpedance spectroscopymeasurements-a comparative study. In Eng. inMedicine and Biology Soc., 2009. EMBC 2009. Ann.Int. Conf. of the IEEE, pages 3779–3782. IEEE.

Azrin, N. and Nunn, R. (1973). Habit-reversal: A methodof eliminating nervous habits and tics. Behaviour re-search and therapy, 11(4):619–628.

Baydas, B. et al. (2007). Effect of a chronic nail-biting habiton the oral carriage of enterobacteriaceae. Oral micro-biology and immunology, 22(1):1–4.

Blomqvist, K. et al. (2012). An open-source hardware forelect. bioimpedance measurement. In Electron. Conf.(BEC), 2012 13th Biennial Baltic, pages 199–202.IEEE.

Cole, K. S. and Cole, R. H. (1941). Dispersion and absorp-tion in dielectrics i. alternating current characteristics.The J. of Chemical Physics, 9(4):341–351.

Cornish, B. et al. (1993). Improved prediction of extracel-lular and total body water using impedance loci gener-ated by multiple frequency bioelect. impedance anal-ysis. Physics in medicine and biology, 38(3):337.

Falk, G. and Fatt, P. (1964). Linear elect. properties ofstriated muscle fibres observed with intracellular elec-trodes. Proc. of the Royal Soc. of London B: Biologi-cal Sci., 160(978):69–123.

Gabriel, S. et al. (1996). The dielectric properties of biolog-ical tissues: Ii. measurements in the frequency range10 hz to 20 ghz. Physics in medicine and biology,41(11):2251.

Geselowitz, D. B. (1971). An application of electrocardio-graphic lead theory to impedance plethysmography.Biomedical Eng., IEEE Trans. on, (1):38–41.

Madgwick, S. O. et al. (2011). Estimation of imu and margorientation using a gradient descent algorithm. In Re-habilitation Robotics (ICORR), 2011 IEEE Int. Conf.on, pages 1–7. IEEE.

Martinsen, O. G. et al. (2007). Utilizing characteristic elect.properties of the epidermal skin layers to detect fakefingers in biometric fingerprint systems - a pilot study.Biomedical Eng., IEEE Trans. on, 54(5):891–894.

Murphy, K. P. (2012). Machine learning: a probabilisticperspective. MIT press.

Pacan, P. et al. (2014). Onychophagia is associatedwith impairment of quality of life. Acta dermato-venereologica, 94(6):703–706.

Pedregosa, F. et al. (2011). Scikit-learn: Machine learn-ing in Python. J. of Machine Learning Research,12:2825–2830.

Sato, M. et al. (2012). Touche: enhancing touch interactionon humans, screens, liquids, and everyday objects. InProc. of the SIGCHI Conf. on Human Factors in Com-puting Systems, pages 483–492. ACM.

Schwan, H. P. (1956). Elect. properties of tissue and cellsuspensions. Advances in biological and medicalphysics, 5:147–209.

Seoane, F. et al. (2008). An analog front-end enables elect.impedance spectroscopy system on-chip for biomedi-cal applicat. Physiological measurement, 29(6):S267.

Seppa, V. et al. (2007). Measuring respirational parame-ters with a wearable bioimpedance device. In 13thInt. Conf. on Elect. Bioimpedance and the 8th Conf.on Elect. Impedance Tomography, pages 663–666.Springer.

Tanaka, O. M. et al. (2008). Nailbiting, or onychophagia: aspecial habit. American J. of Orthodontics and Dento-facial Orthopedics, 134(2):305–308.