Second-year engineering project, ENIT, in a pair · 2025

Epileptic seizure detection from EEG signals

One Random Forest model per patient, on the public CHB-MIT database. Signal filtering, time, frequency and dynamic features, channel selection with Boruta, and a decision threshold tuned so that seizures are not missed.

Recall
95.3%
Precision
99.5%
Seizures detected
31 / 32
  • Python
  • MNE
  • scikit-learn
  • imbalanced-learn
  • Random Forest
  • Boruta
  • wavelets

The problem

Automatically spot epileptic seizures in 23-channel EEG recordings. Missing a seizure costs more than a false alarm, so recall matters more than precision alone.

My approach

  1. Filtering50 Hz notch, 0.5 to 30 Hz band-pass, common average reference
  2. Windows4 s with a 1 s step, labelled seizure if over 60% overlaps a seizure
  3. FeaturesTime, frequency, wavelets and non-linear dynamics
  4. ChannelsBoruta keeps the useful channels for each patient
  5. ModelRandom Forest per patient, threshold tuned for recall
  • Time features: variance, kurtosis, interquartile range, line length, Hjorth mobility.
  • Frequency features: band power, discrete (db4) and continuous (Morlet) wavelets.
  • Signal dynamics: Shannon and permutation entropy, Hurst exponent, correlation dimension.
  • One model per patient, because what a seizure looks like varies a lot from one person to another.

Results

Precision
99.5%
Recall
95.3%
F1 score
97.5%
Accuracy
96.63%
Mean latency
1.85 s
False detections
2.29%
Seizures detected
31 / 32
Patients
24

Averages over the 24 patients. Of the 32 seizures in the test set, only one was missed (patient 15). Latency is the time between the start of the seizure and its detection.

Precision per patient
Precision per patient
Recall per patient
Recall per patient
F1 score per patient
F1 score per patient
Seizures tested and detected per patient
Seizures tested and detected per patient
Mean detection latency per patient
Mean detection latency per patient, in seconds
True positives before and after channel selection
True positives before and after channel selection

The chart labels are in French, the language of the original project.

Limits

One model per patient, evaluated on files that contain seizures: the results do not carry over as-is to a continuous recording or to a new patient.

The test set holds few seizures per patient (1 to 4): recall therefore rests on a small number of events.

False detections vary across patients: up to 9.5% for patient 13.