SlideShare a Scribd company logo
1 of 43
EpiCap
EE Senior Project
SeizureA mobile real-time epileptic
seizure detector using only a
MCU and a lot of Machine
Learning
Hector D. Villarreal
Jose Galindo
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.
In simple terms...
Build a real-time wearable non-invasive
epileptic seizure detector that runs on a MCU
powered by a reasonably small battery.
>15k
Number of papers published on the subject of
epileptic seizure detection.
90.4% 68.2%
We achieved...
Sensitivity Specificity
Pre-ictal Ictal Post-ictal
It seems simple...
Still an open research question...
What is the problem with the
published approaches?
Causality
Diagnosis
tool (CAD)
Clinical
environment
MATLAB
(Non-RT)
We propose...
Filtering
Notch + Bandpass
MCU
Feature
Calculation
8 simple features x
channel
SVM
Classification
Just a dot product.
EpiCap
Ch A
Ch B
Ch C
3 chs
51 feats
Decision>0? epileptic:normal
Filtering
Multi-stage filtering for acquiring the most accurate EEG
signals.
Common noise sources include:
• 60Hz from AC power
• Ambient background noise
• Amplification stage noise
Filtering
60Hz notch filter to be used
as first stage of amplification
to immediately cut off this
spike in noise from the
source.
Filtering
Second stage of amplification and noise reduction to be used
is digitally using an FIR low-pass filter with a cutoff frequency
of 2.5 kHz.
Building the classifier
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 Flash
ADC 12 bits
Python: Preparing data for classification
Data selection
Labeled EEG data was
provided by the HifoCap
Research Group (EE).
One patient,
115 hours
22 seizures
21 channels
256 S/s (Hz)
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
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 Rhythmicity
Standard
deviation
Specialized Features
Amplitude Features
Total
power
Power per bandPeak frequency
Power Features
Feature extraction: Mathematical formulations
For a discrete-time signal:
Energy:
Line-length:
Rhythmicity:
Modified power:
0.00117
Ratio of positive (epileptogenic) samples to negative
(normal) samples. In this problem, there is a significant class
unbalance.
An SVM… the ideal case
An SVM… the real case
Undersampling data
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.
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.
PCB and Demo
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
Thank you!
Any questions?

More Related Content

Similar to EE Senior Project Presentation (2)

Matthew Gray Summer 2015 Presentation
Matthew Gray Summer 2015 PresentationMatthew Gray Summer 2015 Presentation
Matthew Gray Summer 2015 PresentationMatthew Gray
 
RECENT ADVANCES IN BRAIN-COMPUTER INTERFACES
RECENT ADVANCES IN BRAIN-COMPUTER INTERFACES RECENT ADVANCES IN BRAIN-COMPUTER INTERFACES
RECENT ADVANCES IN BRAIN-COMPUTER INTERFACES Touradj Ebrahimi
 
Brain computer interface
Brain computer interfaceBrain computer interface
Brain computer interfaceAlwin Poulose
 
Monitoring Motor Patterns of Epileptic Seziures using Wearable Sensor Technol...
Monitoring Motor Patterns of Epileptic Seziures using Wearable Sensor Technol...Monitoring Motor Patterns of Epileptic Seziures using Wearable Sensor Technol...
Monitoring Motor Patterns of Epileptic Seziures using Wearable Sensor Technol...AnthonyDalton
 
The second seminar
The second seminarThe second seminar
The second seminarAhmedMahany
 
[Research] Detection of MCI using EEG Relative Power + DNN
[Research] Detection of MCI using EEG Relative Power + DNN[Research] Detection of MCI using EEG Relative Power + DNN
[Research] Detection of MCI using EEG Relative Power + DNNDonghyeon Kim
 
Brain Machine Interfacenew
Brain Machine InterfacenewBrain Machine Interfacenew
Brain Machine InterfacenewTuhin_Das
 
Senior Project Student's Presentation on Design of EMG Signal Recording System
Senior Project Student's Presentation on Design of EMG Signal Recording SystemSenior Project Student's Presentation on Design of EMG Signal Recording System
Senior Project Student's Presentation on Design of EMG Signal Recording SystemMd Kafiul Islam
 
Non-Invasive point of care ECG signal detection and analytics for cardiac dis...
Non-Invasive point of care ECG signal detection and analytics for cardiac dis...Non-Invasive point of care ECG signal detection and analytics for cardiac dis...
Non-Invasive point of care ECG signal detection and analytics for cardiac dis...gptshubham
 
Ffeature extraction of epilepsy eeg using discrete wavelet transform
Ffeature extraction of epilepsy eeg  using discrete wavelet transformFfeature extraction of epilepsy eeg  using discrete wavelet transform
Ffeature extraction of epilepsy eeg using discrete wavelet transformAboul Ella Hassanien
 
Electrophysiological imaging for advanced pharmacological screening
Electrophysiological imaging for advanced pharmacological screeningElectrophysiological imaging for advanced pharmacological screening
Electrophysiological imaging for advanced pharmacological screening3Brain AG
 
Final thesis presentation on bci
Final thesis presentation on bciFinal thesis presentation on bci
Final thesis presentation on bciRedwan Islam
 
ESAI-CEU-UCH solution for American Epilepsy Society Seizure Prediction Challenge
ESAI-CEU-UCH solution for American Epilepsy Society Seizure Prediction ChallengeESAI-CEU-UCH solution for American Epilepsy Society Seizure Prediction Challenge
ESAI-CEU-UCH solution for American Epilepsy Society Seizure Prediction ChallengeFrancisco Zamora-Martinez
 
nwang_aerospace13.ppt
nwang_aerospace13.pptnwang_aerospace13.ppt
nwang_aerospace13.pptssuser23a4a4
 
⭐⭐⭐⭐⭐ EMG Signal Processing with Clustering Algorithms for Motor Gesture Tasks
⭐⭐⭐⭐⭐ EMG Signal Processing with Clustering Algorithms for Motor Gesture Tasks⭐⭐⭐⭐⭐ EMG Signal Processing with Clustering Algorithms for Motor Gesture Tasks
⭐⭐⭐⭐⭐ EMG Signal Processing with Clustering Algorithms for Motor Gesture TasksVictor Asanza
 
Development of a low cost pc-based single-channel eeg monitoring system
Development of a low cost pc-based single-channel eeg monitoring systemDevelopment of a low cost pc-based single-channel eeg monitoring system
Development of a low cost pc-based single-channel eeg monitoring systemMd Kafiul Islam
 

Similar to EE Senior Project Presentation (2) (20)

FYP-2
FYP-2FYP-2
FYP-2
 
Matthew Gray Summer 2015 Presentation
Matthew Gray Summer 2015 PresentationMatthew Gray Summer 2015 Presentation
Matthew Gray Summer 2015 Presentation
 
Diagnostic Ecg
Diagnostic EcgDiagnostic Ecg
Diagnostic Ecg
 
RECENT ADVANCES IN BRAIN-COMPUTER INTERFACES
RECENT ADVANCES IN BRAIN-COMPUTER INTERFACES RECENT ADVANCES IN BRAIN-COMPUTER INTERFACES
RECENT ADVANCES IN BRAIN-COMPUTER INTERFACES
 
Brain computer interface
Brain computer interfaceBrain computer interface
Brain computer interface
 
Monitoring Motor Patterns of Epileptic Seziures using Wearable Sensor Technol...
Monitoring Motor Patterns of Epileptic Seziures using Wearable Sensor Technol...Monitoring Motor Patterns of Epileptic Seziures using Wearable Sensor Technol...
Monitoring Motor Patterns of Epileptic Seziures using Wearable Sensor Technol...
 
The second seminar
The second seminarThe second seminar
The second seminar
 
[Research] Detection of MCI using EEG Relative Power + DNN
[Research] Detection of MCI using EEG Relative Power + DNN[Research] Detection of MCI using EEG Relative Power + DNN
[Research] Detection of MCI using EEG Relative Power + DNN
 
Brain Machine Interfacenew
Brain Machine InterfacenewBrain Machine Interfacenew
Brain Machine Interfacenew
 
Senior Project Student's Presentation on Design of EMG Signal Recording System
Senior Project Student's Presentation on Design of EMG Signal Recording SystemSenior Project Student's Presentation on Design of EMG Signal Recording System
Senior Project Student's Presentation on Design of EMG Signal Recording System
 
Emotiv epoc final
Emotiv epoc  finalEmotiv epoc  final
Emotiv epoc final
 
Non-Invasive point of care ECG signal detection and analytics for cardiac dis...
Non-Invasive point of care ECG signal detection and analytics for cardiac dis...Non-Invasive point of care ECG signal detection and analytics for cardiac dis...
Non-Invasive point of care ECG signal detection and analytics for cardiac dis...
 
Ffeature extraction of epilepsy eeg using discrete wavelet transform
Ffeature extraction of epilepsy eeg  using discrete wavelet transformFfeature extraction of epilepsy eeg  using discrete wavelet transform
Ffeature extraction of epilepsy eeg using discrete wavelet transform
 
Electrophysiological imaging for advanced pharmacological screening
Electrophysiological imaging for advanced pharmacological screeningElectrophysiological imaging for advanced pharmacological screening
Electrophysiological imaging for advanced pharmacological screening
 
Final thesis presentation on bci
Final thesis presentation on bciFinal thesis presentation on bci
Final thesis presentation on bci
 
ESAI-CEU-UCH solution for American Epilepsy Society Seizure Prediction Challenge
ESAI-CEU-UCH solution for American Epilepsy Society Seizure Prediction ChallengeESAI-CEU-UCH solution for American Epilepsy Society Seizure Prediction Challenge
ESAI-CEU-UCH solution for American Epilepsy Society Seizure Prediction Challenge
 
nwang_aerospace13.ppt
nwang_aerospace13.pptnwang_aerospace13.ppt
nwang_aerospace13.ppt
 
⭐⭐⭐⭐⭐ EMG Signal Processing with Clustering Algorithms for Motor Gesture Tasks
⭐⭐⭐⭐⭐ EMG Signal Processing with Clustering Algorithms for Motor Gesture Tasks⭐⭐⭐⭐⭐ EMG Signal Processing with Clustering Algorithms for Motor Gesture Tasks
⭐⭐⭐⭐⭐ EMG Signal Processing with Clustering Algorithms for Motor Gesture Tasks
 
E44082429
E44082429E44082429
E44082429
 
Development of a low cost pc-based single-channel eeg monitoring system
Development of a low cost pc-based single-channel eeg monitoring systemDevelopment of a low cost pc-based single-channel eeg monitoring system
Development of a low cost pc-based single-channel eeg monitoring system
 

EE Senior Project Presentation (2)

  • 1. EpiCap EE Senior Project SeizureA mobile real-time epileptic seizure detector using only a MCU and a lot of Machine Learning Hector D. Villarreal Jose Galindo
  • 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.
  • 3. In simple terms... Build a real-time wearable non-invasive epileptic seizure detector that runs on a MCU powered by a reasonably small battery.
  • 4. >15k Number of papers published on the subject of epileptic seizure detection.
  • 7. Still an open research question... What is the problem with the published approaches? Causality Diagnosis tool (CAD) Clinical environment MATLAB (Non-RT)
  • 8. We propose... Filtering Notch + Bandpass MCU Feature Calculation 8 simple features x channel SVM Classification Just a dot product. EpiCap Ch A Ch B Ch C 3 chs 51 feats Decision>0? epileptic:normal
  • 9. Filtering Multi-stage filtering for acquiring the most accurate EEG signals. Common noise sources include: • 60Hz from AC power • Ambient background noise • Amplification stage noise
  • 10. Filtering 60Hz notch filter to be used as first stage of amplification to immediately cut off this spike in noise from the source.
  • 11. Filtering Second stage of amplification and noise reduction to be used is digitally using an FIR low-pass filter with a cutoff frequency of 2.5 kHz.
  • 12.
  • 14. 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 Flash ADC 12 bits
  • 15. Python: Preparing data for classification Data selection Labeled EEG data was provided by the HifoCap Research Group (EE). One patient, 115 hours 22 seizures 21 channels 256 S/s (Hz) 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
  • 16. 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 Rhythmicity Standard deviation Specialized Features Amplitude Features Total power Power per bandPeak frequency Power Features
  • 17. Feature extraction: Mathematical formulations For a discrete-time signal: Energy: Line-length: Rhythmicity: Modified power:
  • 18. 0.00117 Ratio of positive (epileptogenic) samples to negative (normal) samples. In this problem, there is a significant class unbalance.
  • 19. An SVM… the ideal case
  • 20.
  • 21.
  • 22. An SVM… the real case
  • 23.
  • 24.
  • 25.
  • 26.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. 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.
  • 35. 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.
  • 36.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. 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