EE Senior Project Presentation (2)

43
EpiCap EE Senior Project Seizure A mobile real-time epileptic seizure detector using only a MCU and a lot of Machine Learning Hector D. Villarreal Jose Galindo

Transcript of EE Senior Project Presentation (2)

Page 1: EE Senior Project Presentation (2)

EpiCap

EE Senior Project

SeizureA mobile real-time epileptic seizure

detector using only a MCU and a lot of Machine

Learning

Hector D. VillarrealJose Galindo

Page 2: EE Senior Project Presentation (2)

What is Epilepsy?Epilepsy is the 4th most common neurological disease in the world.

It is a chronic disease that produces seizures that affect control of the body motor functions.

In a third of patients with epilepsy the disorder becomes refractory and randomly subjects patients to seizures.

Page 3: EE Senior Project Presentation (2)

In simple terms...

Build a real-time wearable non-invasive epileptic seizure detector that runs on a

MCU powered by a reasonably small battery.

Page 4: EE Senior Project Presentation (2)

>15kNumber of papers published on the subject

of epileptic seizure detection.

Page 5: EE Senior Project Presentation (2)

90.4%

68.2%

We achieved...

Sensitivity

Specificity

Page 6: EE Senior Project Presentation (2)

Pre-ictal Ictal Post-ictal

It seems simple...

Page 7: EE Senior Project Presentation (2)

Still an open research question...What is the problem with

the published approaches?

Causality

Diagnosis tool (CAD)

Clinical environme

nt

MATLAB (Non-RT)

Page 8: EE Senior Project Presentation (2)

We propose...

FilteringNotch +

Bandpass

MCU

Feature Calculation8 simple features x

channel

SVM Classificatio

nJust a dot product.

EpiCap

Ch A

Ch B

Ch C

3 chs51 feats

Decision>0? epileptic:normal

Page 9: EE Senior Project Presentation (2)

FilteringMulti-stage filtering for acquiring the most accurate EEG signals.

Common noise sources include:• 60Hz from AC power• Ambient background noise• Amplification stage noise

Page 10: EE Senior Project Presentation (2)

Filtering

60Hz notch filter to be used

as first stage of amplification

to immediately cut off this spike in noise from

the source.

Page 11: EE Senior Project Presentation (2)

FilteringSecond stage of amplification and noise reduction to be

usedis digitally using an FIR low-pass filter with a cutoff

frequencyof 2.5 kHz.

Page 12: EE Senior Project Presentation (2)
Page 13: EE Senior Project Presentation (2)

Building the classifier

Page 14: EE Senior Project Presentation (2)

One task, two architectures

● Data selection (16 bits)

● Digital filtering● Epoch segmentation● Feature extraction● Majority class

reduction● Classifier training● Classification ● Performance tuning

Python

Intel i7 2.2 GHz, 64 bit, 8 GB RAM

● Feature Extraction● Classification

TI MCU (TM4C123X)

ARM Based 80 MHz, 32 bit, 256KB FlashADC 12 bits

Page 15: EE Senior Project Presentation (2)

Python: Preparing data for classificationData selection

Labeled EEG data was provided by the HifoCap Research Group (EE).

One patient,

115 hours

22 seizures

21 channels

256 S/s (Hz)

Raw 16 bit interleaved

Digital filtering

FIR Low pass

Fpass= 55 Hz

Fstop= 60Hz

65 taps

Epoch creation

Epilepsy is already diagnosed, we know the parts of the brain were the seizure originates.

3 channels

CZ, F3, C3

1s windows

256 samples per window, per channel

Page 16: EE Senior Project Presentation (2)

Feature extraction...

O(n )

2

We are limited to features with a maximum complexity of n^2, in order to maintain real-time operation and low

power consumption.

Energy RMS Line-length

Mean RhythmicityStandard deviation

Specialized Features

Amplitude Features

Total power

Power per band

Peak frequency

Power Features

Page 17: EE Senior Project Presentation (2)

Feature extraction: Mathematical formulationsFor a discrete-time signal:

Energy:

Line-length:

Rhythmicity:

Modified power:

Page 18: EE Senior Project Presentation (2)

0.00117Ratio of positive (epileptogenic) samples to negative

(normal) samples. In this problem, there is a significant class unbalance.

Page 19: EE Senior Project Presentation (2)

An SVM… the ideal case

Page 20: EE Senior Project Presentation (2)
Page 21: EE Senior Project Presentation (2)
Page 22: EE Senior Project Presentation (2)

An SVM… the real case

Page 23: EE Senior Project Presentation (2)
Page 24: EE Senior Project Presentation (2)
Page 25: EE Senior Project Presentation (2)
Page 26: EE Senior Project Presentation (2)
Page 27: EE Senior Project Presentation (2)

Undersampling data

Page 28: EE Senior Project Presentation (2)
Page 29: EE Senior Project Presentation (2)
Page 30: EE Senior Project Presentation (2)
Page 31: EE Senior Project Presentation (2)
Page 32: EE Senior Project Presentation (2)
Page 33: EE Senior Project Presentation (2)
Page 34: EE Senior Project Presentation (2)

C=1e-7, kernel=linear

The best kernel and C hyperparameter were found using an exhaustive Grid Search algorithm. Polynomial and RBF

kernels, generated only marginal improvements.

Page 35: EE Senior Project Presentation (2)

Support Vector Machine

● If D(x) > 0, the sample contains an epileptic seizure.

● If D(x) < 0, the sample is not a seizure.● D(x) = 0 is impossible.

Page 36: EE Senior Project Presentation (2)
Page 37: EE Senior Project Presentation (2)

PCB and Demo

Page 38: EE Senior Project Presentation (2)
Page 39: EE Senior Project Presentation (2)
Page 40: EE Senior Project Presentation (2)
Page 42: EE Senior Project Presentation (2)

Bill of Materials

1x TI TIVA MCU = $12.99

1x Capacitor = $2.00

1x PCB = $81.98

Total = $103.33

5x Resistor = $1.00

1x INA128 Op Amp = $5.36

Page 43: EE Senior Project Presentation (2)

Thank you!Any questions?