40
//cerebro //fall_16

cerebro - engineering.tamu.edu · App Goals-2017 app ts er device via r . Title: Cerebro-ACFall2016.pdf Created Date: 3/29/2017 8:45:30 PM

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

//cerebro

//fall_16

Summ

ary

The primary objectives to upgrading Cerebro this sem

ester were:

Expanding the data analysis to run in a more generalized w

ay, i.e., the ability to w

ork with data not sorted in a specific w

ay.

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, m

oderately aesthetic, and non-invasive

Compare and contrast different m

aterials

Considerations included durability, flexibility, strength

Examples: ABS, Polyjet, N

injaFlex and Tango

3D printing Research

Types of printers available on campus, m

aterials available

EEG biosensors w

earable electronics in the market

Design Specifications

Initial design was developed using SolidW

orks software

Advantages:

Allows for placem

ent of electrodes to be moved to necessary spots

Thinner piece around ears for comfort

Comfortable, thin headband

First Prototype

●Used 3-D printer:

○EDEN

260 V with dim

ensional accuracy of 7 microns and a building

time of g^3 per 8.2 m

in

●M

aterial: Tango, a rubber-like material

Spring 2017 -Goals

●H

ouse electronics inside the prototype

●Create adjustable m

echanism for different head sizes

●Im

prove design:

○Com

bine materials to provide a headset structure

○Design spring m

echanism for housing of dry electrodes

○Incorporate a battery w

ith a useful life of at least 5 hrs

Electronics

Overview

of the Semester

Figuring out conventionally placed electronics

Discerning the Necessary Electronics to be H

oused

Exploration of Types of Electrodes

Researching Capacitive Electrodes

Initiating the Prototype

Electronics in Conventional Headsets

Electrode with N

oise Reduction Module

Application Specific Integrated Circuit

Analog-Digital Converter

Bluetooth Module

What Parts are N

eeded?

Rephrasing the Question: W

hat parts does the algorithm take care of?

Algorithm takes care of Application Specific IC, therefore no Signal Processing

required in Electronics.

What m

ust 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 com

fortable

Eliminates the effects of artefacts

Downsides

Relatively new technology, no com

mercial electrodes available to play w

ith

Very nuanced and precise construction (Layered Electrode Surface)

The Quest for the Ideal Electrode

Initializing the Prototype

Capacitive Electrodes require more tim

e, so we decided to m

odel the prototype based on dry or w

et electrodes

Start with a basic m

odel 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 sam

pling rate

Figure: An apparatus to utilize

Teensy AD

C converter using an

Oscilloscope.

Plans for Spring 2017

Upgrade prototype from conventional electrodes to Capacitive Electrode

Better Integration with H

ardware (electronic housing, ergonom

ic factor)

Integration with Sm

artphone Application

Data A

nalytics

Executive Summ

aryG

ained understanding of random forest m

odels & m

achine learning

Gained understanding of relevant features (R

elative Phase/P

hase Synchronization,

Snow

ball PS

D, S

nowball P

SD

Phase A

ngle)

Trained & Tested A

lgorithm on single patient (Tested patient 1 -Trained on files 10-

24 and tested on files 1-5 for patient)

Autom

ated patient input in order to train and test on more than one patient at a tim

e

Autom

ated annotation creation in order to allow for patients to be selected in a

random order

BackgroundData pulled from

PhysioBank ATM via

physionet.org

Close to 1000 hours of EEG data from

24 patients at the Children’s H

ospital of Boston (data collected by M

IT)

Analyze T7-FT9 & P8-O2 voltage potential

differences

Critical features for algorithm are relative phase,

snowball of pow

er spectral density (PSD), and snow

ball of PSD phase angle.

Training data structure: 1 row per second-25 colum

ns (1 for annotation class label, 8 for each of the 3 feature types)

Our Process

ALG

OR

ITHM

PR

OC

ES

SALG

OR

ITHM

PRO

CESS

ALGO

RITH

M PR

OC

ESS

Random

Forest

Ensemble m

achine learning for event classification

The algorithm is a forest because it utilizes a large num

ber 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 R

andom 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 D

ensity (PSD)

A method of representing pow

er as a function of frequency

Used in both Snowball of PSD, and

Snowball of PSD Phase Angle

features

Snowball

Making sm

all 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 im

aginary parts. Extract phase angle.

Relative Phase Feature (R

P)

Also uses Hilbert transform

Unlike the snowball effects, this

feature captures the differences betw

een two

signals (channels T7-FT9 & P8-O

2)

According to NBT, m

& n equal 1 for the relative phase equation, but m

oving forward w

e should test this hypothesis to confirm

optimal

values

Training & Testing Code on Patient 1Understand how

the algorithms w

ere implem

ented by previous team

Analyzed Patient 1

First the algorithm w

as run to create a set of Train and Testing data

Next, annotations w

ere input based on provided information. Finally, Random

Forest algorithm

was run to for sezuire predciton

Accuracy: 0.9645

Precision: 0.1051

Sensitivity: 0.0342

Specificity: 0.9915

Patient Input Autom

ation

Allow for grow

th of number of Patient Files to be selected w

hen running algorithm

Code allows for developer to select w

hich random Patients w

anted to be analyzed

The algorithm w

ill then stitch together all of the files inside each of the Patient Files

This data can then be run through feature extraction

Annotation A

utomation

In addition to stitching together patient files, annotations times needed to be autom

ated

.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 m

ultiple patient input autom

ation & annotation creation autom

ation)

Total of 9 in both patients 3 and 23 data

Spring 2017

Have received access to the ADA Supercom

puter

Can’t train algorithm on all patients w

ithout supercom

puter; data too large for comm

ercial com

puters as Matlab crashes

Create Test and Train data with greater num

ber of patients

Run RandomForest fully w

ith 400 trees

Integrate with App Team

for access on Server, and configure code to w

ork with live data

App Squad

Overall A

pp 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 A

pp 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 developm

ent, and android studio

Explored comm

unication between android and online servers

Features-“Alarm

” tab (Hom

e Screen)

5 bottom tabs used for navigation betw

een features

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)

Features-“Alarm

” tab

“Prepare”●

Provides user with

information on how

to prepare for a seizure

○W

ill autom

atically appear w

ith an alert

●“B

egin” button provides inform

ation for som

ebody (besides user) to provide assistance during a seizure

“Manage”●

Allows user to

specify how far

in advance they w

ant to receive an alarm

Features “Tracker” & “Contacts”

“Tracker”●

Where user can go

back and log in activities they recall before their seizure, im

mediately after

their seizure has ceased.

“Contacts”●

Where em

ergency contact info can be inputted to be notified in case of seizure

Future Features-

“Brainwaves” tab

●W

hen device is complete, this w

ill show the patient’s live EEG

signal being received via bluetooth

“Personal Info” tab●

This will have patient’s personal info (for exam

ple, medication) that can

be used in case of emergency

App D

eletion Notification

●E

mergency contacts are im

mediately notified if app is deleted off

patient’s phone.

App G

oals-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 com

plete, configure app to receive data from device via

Bluetooth, and send to server