280 likes | 377 Views
BATCH ANALYSIS TOOL FOR E4 DATA. Peter de Looff Matthijs Noordzij (Radboud Universiteit/De Borg) (Universiteit Twente). E4 DATA – EMPATICA WEBSITE. ANOTHER EXAMPLE. WATCH OUT!.
E N D
BATCH ANALYSIS TOOL FOR E4 DATA Peter de Looff Matthijs Noordzij (Radboud Universiteit/De Borg) (Universiteit Twente)
THESE FIGURES SCALE ENORMOUSLY! (Youcannotavoiddoing proper signal analysis and parameter extractionyourselfsomehow!)
E4 DATA ANALYSIS OF DOWNLOADED .CSV FILES: • Fromthe Empatica website: “For systematic Skin Conductance analysis from our EDA files we recommend LEDALAB (for MatLab). You may need to adjust skin conductance response (SCR) thresholds to account for lower magnitudes in typical wrist data.For heart rate variability (HRV) analysis we recommend Kubios (also for MatLab). Kubios takes in instantaneous heart rate data and allows you to correct errant beats and conduct HRV analysis respectively. Kubios allows you to overlay our IBI files on the BVP data to assist in error correction.”
E4 DATA ANALYSIS - CONTINUED ‘If you prefer there are a number of signal processing toolkits available in the free software domain. Python's SciPy libraries have outstanding signal processing and data visualization capabilities.’ New option (in python and web-based): http://eda-explorer.media.mit.edu/
EDA EXPLORER Ifyouuseour tool, pleasecitethisarticleby Sara Taylor and Natasha Jacques. They are responsiblefor the artifact and peakdetection scripts in the tool. In addition, youcouldalsocite the authors of the RHRV package (later in thispresentation)
DRAWBACKS OF THE WEB OPTION • A lot of clicking – error prone – time intensive • Max 6.5 hours? • Ifyou want to change onelittlething (e.g. treshholdforSCR’s) you have to do everythingmanually • No HR data analysis • You are leftwith large Excel files whichrequire (tricky) furthercomputationsto get to a useful report.
NEXT STEPS • Allowfor batch processing of all data collectedbythe E4 • Batch means thatyoucan re-run your analysis basicallywithonecommand • Next to speed/ accuracyadvantagesthisalsocontributestoreproducible research. • We useonly open source software (no Matlabrequired): • Python and R • We rely on EDA-explorer (From MIT) and RHRV (anextensive HR analysis tool in R) • We have started out withoneuse case in mind.
USE CASE • One E4 file per dayfor a client. Youcouldalsousesessionsinstead of days. • You want a daily report on the data, wherethe data is interpretedrelativetothe “physiologicalpersonality” of thatclient. • This means you want to know (forexample) whether the physiologicalvalues of a particulardaycouldbecalledunusually high or low givenwhatyoualreadyknowaboutwhatthis person typically shows as physiologicalvalues.
RHRV • Batch-processing HRV is a bit tricky. • ECG is the gold-standard. • With the Empatica E4, we only have a ppg sensor. • The E4 does a good job at onlydetecting the ‘pure’ inter-beat-interval (IBI-files). • Itdoesn’tmean we can’tuseit, itmeansthat we have artefacts, and interpret the resultsaccordingly.
RHRV To getanindication of the amount of artefacts we made anHrplots file in the directory. With a standard ECG yougetreasonably clean data.
RHRV This is anexample of a fair amount of artefacts, itrepresents the time betweengooddetectedbeats. In an ‘ideal’ resting ECG situationwith a HR of 60, all beats wouldbeapproximately 1 second apart. As youcanseeherethere are a lot of wrongbeats. Up to 400 seconds in the firstminutes of the recording. Onthe nextslide is anexample of a bettermeasurewith the E4. In this case therewere more than 400 sec betweendetected beats. Thismeansthat the E4 was notable to getgood beat for more than 400 sec
RHRV Hereyouseethatthere are lessartefacts in comparisonwith the previousslide. To get a feelfor the amount of artefacts we made anhrv.art.indexvariable in the _datasummary file. The variablecontains the amount of beats detected/ the sessionduration in seconds. So, becarefulwithinterpretation of highervslowerheartrates. The IBI is shortertherebecause the HR is higher. For the first plot the hrv.art.index is .23, for the secondit is .84. So, more beats are detected in the second plot. In this plot the maximum nr of secondsbetweentwo beats is 13 seconds
RHRV • RHRV parameters are basedonthe good beats that are providedby the Empaticaalgorithm. So, there is variation in the amount of beats useddependingon the amount of artefacts.
IMPLEMENTATION – HOW DOES IT WORK? Youneed to adjust 2 files: batch_edaexplorer_template_v3 and defines_template All the scriptfiles youneed must be in one folder.
WHAT DO YOU NEED TO DO THIS YOURSELF? • Anaconda 2 • R / R studio • A number of tweaksadditionallibrariesrelated to Python (see document) and R: • install.packages("RHRV") • install.packages("plyr") • install.packages("zoo") • Aftertheintital set-up phaseyouonlyneedtoplacethe E4 zipfiles in the correct folder! • The initial set-up phase does requireyouto do a little Python and R (but Google/ stackoverflow are yourfriend ).
WHAT DO YOU NEED TO DO THIS YOURSELF? • Live demo • Show the file structure. Mentionwhat must go in what directory. • Explain the defines and batch files. All directories. • Explain the r script. • Mention the timezone. • pythonTroubleshooting Python/R collaboration.