//cerebro //fall_16
Summary The primary objectives to upgrading Cerebro this semester were: Expanding the data analysis to run in a more generalized way, i.e., the ability to work with data not sorted in a specific way. Initializing a headset prototype (prototyping both the design and the electronics) in order to accurately obtain biosignals. Updating the app in order to make it user friendly and provide versatility in emergency response options.
3-D Printing Team
Initial Approach Create a design that will practical, functional, moderately aesthetic, and noninvasive Compare and contrast different materials Considerations included durability, flexibility, strength Examples: ABS, Polyjet, NinjaFlex and Tango 3D printing Research Types of printers available on campus, materials available EEG biosensors wearable electronics in the market
Design Specifications Initial design was developed using SolidWorks software Advantages: Allows for placement of electrodes to be moved to necessary spots Thinner piece around ears for comfort Comfortable, thin headband
First Prototype Used 3-D printer: EDEN260 V with dimensional accuracy of 7 microns and a building time of g^3 per 8.2 min Material: Tango, a rubber-like material
Spring 2017 - Goals House electronics inside the prototype Create adjustable mechanism for different head sizes Improve design: Combine materials to provide a headset structure Design spring mechanism for housing of dry electrodes Incorporate a battery with a useful life of at least 5 hrs
Electronics
Overview of the Semester Figuring out conventionally placed electronics Discerning the Necessary Electronics to be Housed Exploration of Types of Electrodes Researching Capacitive Electrodes Initiating the Prototype
Electronics in Conventional Headsets Electrode with Noise Reduction Module Application Specific Integrated Circuit Analog-Digital Converter Bluetooth Module
What Parts are Needed? Rephrasing the Question: What parts does the algorithm take care of? Algorithm takes care of Application Specific IC, therefore no Signal Processing required in Electronics. What must be covered in Electronics: Electrode Noise Reduction Analog Digital Converter Serial Transfer to Device (Bluetooth)
The Quest for the Ideal Electrode Ideal Electrode: Capacitive Electrode
The Quest for the Ideal Electrode The Capacitive Electrode is Ideal because: Relatively new technology, scope for an additional claim in patent Doesn t require direct contact More comfortable Eliminates the effects of artefacts Downsides Relatively new technology, no commercial electrodes available to play with Very nuanced and precise construction (Layered Electrode Surface)
The Quest for the Ideal Electrode
Initializing the Prototype Capacitive Electrodes require more time, so we decided to model the prototype based on dry or wet electrodes Start with a basic model and upgrade in Phases Using Wet Electrode Using data acquisition electronics based on Dr. Vu s EKG system
Other Prototype Initiatives Serial Protocol Output (via USB) Using Teensy Microcontrolling Unit Using standard 9600 baud Transferring 16-bit data at 256 Hz sampling rate Figure: An apparatus to utilize Teensy ADC converter using an Oscilloscope.
Plans for Spring 2017 Upgrade prototype from conventional electrodes to Capacitive Electrode Better Integration with Hardware (electronic housing, ergonomic factor) Integration with Smartphone Application
Data Analytics
Executive Summary Gained understanding of random forest models & machine learning Gained understanding of relevant features (Relative Phase/Phase Synchronization, Snowball PSD, Snowball PSD Phase Angle) Trained & Tested Algorithm on single patient (Tested patient 1 - Trained on files 10-24 and tested on files 1-5 for patient) Automated patient input in order to train and test on more than one patient at a time Automated annotation creation in order to allow for patients to be selected in a random order
Background Data pulled from PhysioBank ATM via physionet.org Close to 1000 hours of EEG data from 24 patients at the Children s Hospital of Boston (data collected by MIT) Analyze T7-FT9 & P8-O2 voltage potential differences Critical features for algorithm are relative phase, snowball of power spectral density (PSD), and snowball of PSD phase angle. Training data structure: 1 row per second-25 columns (1 for annotation class label, 8 for each of the 3 feature types)
Our Process ALGORITHM PROCESS ALGORITHM PROCESS
Random Forest Ensemble machine learning for event classification The algorithm is a forest because it utilizes a large number of decision trees The algorithm is random because each tree is trained on a random subset of the training data. Also, each binary node split selects a random set of predictor features. Each tree gives a binary yes/no classification, and the average of all tree classifications can be used to predict an event
Our Random Forest Utilizes Matlab TreeBagger() Function 400 decision trees used If greater than 80 trees (20%) predict a seizure, the model predicts a seizure
Power Spectral Density (PSD) A method of representing power as a function of frequency Used in both Snowball of PSD, and Snowball of PSD Phase Angle features
Snowball Making small changes currently can lead to large changes in the future (causing an event) Changes that have occurred in the features are added up
Snowball of PSD & Snowball of PSD Phase Angle Benefit of Snowball Effects: Analyzes 1 channel (T7-FT9) instead of two as seen in the RP features Phase Synchronization for Snowball of PSD Phase Angle: Utilize Hilbert transform to break PSD signal down into real and imaginary parts. Extract phase angle.
Relative Phase Feature (RP) Also uses Hilbert transform Unlike the snowball effects, this feature captures the differences between two signals (channels T7- FT9 & P8-O2) According to NBT, m & n equal 1 for the relative phase equation, but moving forward we should test this hypothesis to confirm optimal values
Training & Testing Code on Patient 1 Understand how the algorithms were implemented by previous team Analyzed Patient 1 First the algorithm was run to create a set of Train and Testing data Next, annotations were input based on provided information. Finally, RandomForest algorithm was run to for sezuire predciton Accuracy: 0.9645 Precision: 0.1051 Sensitivity: 0.0342 Specificity: 0.9915
Patient Input Automation Allow for growth of number of Patient Files to be selected when running algorithm Code allows for developer to select which random Patients wanted to be analyzed The algorithm will then stitch together all of the files inside each of the Patient Files This data can then be run through feature extraction
Annotation Automation In addition to stitching together patient files, annotations times needed to be automated.csv files containing Patient, Files, Start and Stop Times Using loop indexed the files to the appropriate start and stop time of each seizure Accounted for the previous time elapsed from each file
Plotted Results (Patients 3 & 23) The plot to the right demonstrates our fully automated code correctly plotting the times of the 9 seizures between patients 3 and 23 (plotted to demonstrate new capabilities of both multiple patient input automation & annotation creation automation) Total of 9 in both patients 3 and 23 data
Spring 2017 Have received access to the ADA Supercomputer Can t train algorithm on all patients without supercomputer; data too large for commercial computers as Matlab crashes Create Test and Train data with greater number of patients Run RandomForest fully with 400 trees Integrate with App Team for access on Server, and configure code to work with live data
App Squad
Overall App Goal To create a user interface that provides a connection between the live ECG data collected and the seizure detection algorithm that will notify the patient of an oncoming seizure
Semester App Progress Improved user interface from last semester Visual appeal, better organization Created template to receive bluetooth data from EEG device in progress Gained understanding of java, app development, and android studio Explored communication between android and online servers
Features- Alarm tab (Home Screen) This will show any active seizure predictions (after user receives initial alert) This will show all previous alarms Provides advice on what to do during a seizure (next slide) Allows user to set alarm preferences (next slide) 5 bottom tabs used for navigation between features
Features- Alarm tab Prepare Provides user with information on how to prepare for a seizure Will automatically appear with an alert Begin button provides information for somebody (besides user) to provide assistance during a seizure Manage Allows user to specify how far in advance they want to receive an alarm
Features Tracker & Contacts Tracker Where user can go back and log in activities they recall before their seizure, immediately after their seizure has ceased. Contacts Where emergency contact info can be inputted to be notified in case of seizure
Future Features- Brainwaves tab When device is complete, this will show the patient s live EEG signal being received via bluetooth Personal Info tab This will have patient s personal info (for example, medication) that can be used in case of emergency App Deletion Notification Emergency contacts are immediately notified if app is deleted off patient s phone.
App Goals- Spring 2017 Create online server and connect to app Used for logging into specific user accounts Will analyze EEG data and send back to app to display to user Once device is complete, configure app to receive data from device via Bluetooth, and send to server