Interictal discharge detection on routine scalp EEG
A pipeline that reads a routine 10–20 scalp EEG and drafts the sentence a neurologist would write: whether interictal epileptiform discharges are present, where they project, and whether sleep brings them out.
Read this firstWhat this is not
The output is a draft description for a neurologist to validate: never a diagnosis, and never a reason to withhold one. This is not seizure detection: the target is the interictal abnormality, the finding between seizures that a less experienced reader might miss.
Phase 1 ran entirely on public research corpora. No hospital data has been used, and nothing here is deployed in a clinical setting.
ProblemWhy this question
A routine EEG is roughly twenty minutes of ongoing rhythm in which a handful of sub-second events may or may not appear. The clinically decisive ones are interictal epileptiform discharges (spikes, sharp waves, spike-and-wave, polyspikes) and whether they are there changes what happens to the patient. They are also easy to miss and, worse, easy to over-read: normal sharp transients look a great deal like the real thing.
So the tool has two jobs. Detection: does this recording contain discharges at all. Description: for the discharges found, their spatial projection, their morphology, and whether sleep activates them, assembled into a sentence such as “interictal epileptiform abnormalities present: sharp-and-slow-wave complexes with left temporal projection, activated during sleep.”
PipelineHow it works
- Stage 1, detection. Gradient boosting over 58 interpretable signal features. Sharpness features dominate the ranking, which is what a neurologist would predict: a spike is defined by how abruptly it rises, not by how big it is.
- Stage 1b, hard-negative discriminator. A second filter answering only the hard question: given something that already looks like a discharge, is it real? Trained on 32,433 expert-voted events with vote-weighted soft targets.
- Stage 2, localization and state. Spatial class over five regions, plus wake/sleep.
- Stage 3, draft description. Template-based and traceable to the events that triggered it, so a reader can audit any sentence back to the epochs behind it.
Interpretable by choice. A reader has to be able to see why a flag was raised, and a gradient-boosted feature model can show that where a black box cannot.
ResultsDetection, internal
5-fold subject-level cross-validation, out-of-fold over all 84 recordings. Per-recording, the question a clinician actually asks:
On the pediatric subset (32 patients, age ≤ 18) every measure improves: ROC-AUC 0.923 against 0.865 for the full cohort, PR-AUC 0.726 against 0.581. That is the encouraging finding for a pediatric deployment, with the caveat that the subset holds only 10 discharge-free recordings, too few to calibrate a recording-level threshold on.
The tradeoff that decides usability
A single operating point hides the shape of the curve, and the shape is what determines whether anyone would tolerate the alarms:
| Constraint | Result |
|---|---|
| FPR ≤ 0.05 | sensitivity 0.550 |
| FPR ≤ 0.10 | sensitivity 0.642 ← configured operating point |
| sensitivity ≥ 0.90 | costs FPR 0.432 |
Reaching 0.90 sensitivity costs a 43% false-positive rate. A reader rejecting nearly half of all flags stops trusting the tool, so the pipeline fixes the ceiling at FPR 0.10 and states the shortfall against the target rather than quietly relaxing it.
ResultsExternal validation, the number that matters
Trained on all of the internal corpus, tested on 100 segments from a different country, hospital and recording system, against a reference standard of video-EEG of habitual events. Every negative in that set is itself a sharp transient, a clinical lookalike, selected precisely because such waveforms cause EEG over-reading.
| ROC-AUC | Accuracy | |
|---|---|---|
| Stage 1 alone | 0.663 | 0.630 |
| Stage 1 + 1b | 0.790 | 0.740 |
| Human experts, same 100 cases | — | 0.920 |
The model is still clearly worse than a human here, and that gap is the honest headline. The hard-negative stage moved external ROC-AUC from 0.663 to 0.790 and accuracy from 0.630 to 0.740; expert scoring on the same cases is 0.920. This narrows the deficit. It does not close it.
The internal and external numbers are not in conflict: they ask different questions. Internally most negatives are ordinary background, and separating a spike from resting rhythm is the easy problem. Externally every negative already looks like a discharge, and separating those is the hard one. The consequence is stated plainly in the project: the current model is not ready to pre-screen unselected recordings, and the priority is more hard negatives, not more architecture.
On the in-domain held-out set the same pattern shows up honestly: 0.913 ROC-AUC on clear-cut events, 0.695 on the borderline ones where the expert panel itself disagreed. Those cases are genuinely hard, not merely unlearned.
ResultsDescription and localization
Draft descriptions are scored by structured-field agreement against expert annotation, not by text-overlap metrics: a sentence can score well on BLEU while naming the wrong lobe.
State is solid; localization is the weakest part of the pipeline. Spatial class is essentially a per-patient property (33 of 52 discharge-positive recordings carry exactly one class) so the effective sample size is patients, not epochs. The centro-parietal class rests on four patients. The honest conclusion is that this corpus is too small to learn five-way localization reliably, whatever the epoch counts suggest.
DemoSee it run
An exported, self-contained page: pick one of three held-out recordings, watch detection, localization and description run, and see where the pipeline looked. Every figure on it is real output from the committed code.
Open the interactive demoOpens as its own page: it is the pipeline’s own export, served unmodified rather than re-skinned.
NextWhere this goes
Phase 2 is the pediatric hospital setting the whole project is aimed at, and it does not start until the lookalike problem is under control: a tool meeting routine EEGs will meet sharp mimics constantly, because that is what routine EEG is full of.
One finding from phase 1 is worth carrying forward on its own: an amplitude-normalization bug once made external performance worse than baseline, because per-corpus scaling let outlier events shrink new recordings 28-fold. Acquisition systems differ in absolute microvolts, so any model that depends on them will not transfer. It is pinned by a test now.
Talk to us about this work