Developing AI System for EEG Analysis
EEG analysis — labor-intensive task: experienced neurophysiologist watches hours of recording to detect epileptic discharges. AI automates routine and increases sensitivity for rare pattern detection.
Clinical Tasks
Epileptic Discharge Detection
Epileptic spikes, sharp waves, spike-wave complexes. Task: detecting epileptiform activity in 30-minute and 24-hour (ambulatory) EEG.
Real neurologist workflow: reviewing 30-minute recording — 20–45 minutes. With AI: automatic suspicious epoch markup, neurologist reviews only flagged segments → 5–10 minutes.
CNN+LSTM on EEG epoch time series. Sensitivity 92–96%, specificity 86–91% on benchmark datasets (CHB-MIT Scalp EEG, TUH EEG Seizure Corpus).
Sleep Stage Classification (Automatic Sleep Staging)
AASM standard: N1, N2, N3 (deep sleep), REM, Wake — 5 classes per 30-second epochs. Manual polysomnography scoring: 2–4 hours per night recording.
AI Sleep Staging (U-Sleep, YASA): Cohen's Kappa 0.77–0.81 vs. expert, comparable to inter-rater agreement between specialists.
Anesthesia/Sedation Depth Monitoring
Bispectral Index (BIS) — commercial product based on EEG. Custom ML models for specific anesthetics (propofol vs. isoflurane → different EEG patterns).
Brain-Computer Interface (BCI)
Motor imagery (imagining movement) → decoding intention from EEG for controlling prosthetics or computer. SSVEP (steady-state visual evoked potentials) → spellers.
Cognitive Load and Stress
Neurofeedback applications, operator monitoring (aviation, nuclear plants): detecting fatigue, attention decline via EEG biomarkers.
EEG Signal Features for ML
Multi-Channel and Reference
10–19 channels in clinical EEG. Spatial information important: epileptic activity focal — specific region. Approaches:
- Processing all channels independently + fusion
- CNN on spatial maps (electrode map → 2D image)
- GNN with electrode topology
Temporal Structure
EEG — non-stationary signal with patterns at different frequencies:
- Delta (0.5–4 Hz): deep sleep, coma
- Theta (4–8 Hz): drowsiness, meditation
- Alpha (8–13 Hz): relaxed wakefulness
- Beta (13–30 Hz): active thinking
- Gamma (30–100 Hz): cognitive processes
Wavelet transform / STFT → time-frequency representation → 2D CNN. Or raw signal → 1D CNN/Transformer.
Artifacts
Eye movement (EOG), muscle artifacts (EMG), cardiac artifacts (ECG). Independent Component Analysis (ICA) — artifact removal standard. ML artifact classifiers for automatic detection.
Architecture
# EEGNet — compact CNN specifically for EEG
class EEGNet(nn.Module):
def __init__(self, n_classes, channels=64, samples=128):
super().__init__()
self.temporal_conv = nn.Conv2d(1, 8, (1, 64), padding=(0, 32), bias=False)
self.bn1 = nn.BatchNorm2d(8)
self.depthwise = nn.Conv2d(8, 16, (channels, 1), groups=8, bias=False)
self.bn2 = nn.BatchNorm2d(16)
self.separable = nn.Conv2d(16, 16, (1, 16), padding=(0, 8), bias=False)
self.bn3 = nn.BatchNorm2d(16)
self.dropout = nn.Dropout(0.5)
self.fc = nn.Linear(16 * (samples//4), n_classes)
Foundation Models for EEG
LaBraM (Large Brain Model) — pretraining on thousands of hours EEG (TUEG, other public corpora) → fine-tuning on specific task. Transfer learning reduces labeled data needs.
Datasets: TUH EEG (25,000+ EEGs), CHB-MIT (seizure), ISRUC (sleep), BCI Competition datasets.
Deployment: edge inference on device (ARM cortex for ambulatory monitors, 2–5MB model). Cloud inference for archived recording processing. Latency for seizure detection: <500ms for real-time alarms.







