Drift-gated and output-consistent continual learning for eeg seizure prediction
Abstract
Long-term electroencephalography (EEG) seizure prediction on wearable hardware requires models that are small enough for local inference, responsive to patient-specific distribution shifts, and robust to catastrophic forgetting. We present a code-faithful continual-learning extension of SlimSeiz that targets the latter two requirements while keeping the compact base predictor frozen. The implemented six-channel network contains 22K parameters and combines multi-scale one-dimensional convolutions with a selective state-space (Mamba) block. Continual adaptation adds identity-initialized patient adapters and rank-one low-rank adaptation branches, resulting in 22,726 total parameters and 452 trainable parameters for one active patient. Adaptation is controlled by two mechanisms. First, a drift-aware update gate combines standardized feature displacement, predictive uncertainty, and a consecutive-window persistence rule to decide whether a patient stream warrants training. Second, output-consistent replay stores historical logits with selected replay samples and constrains later predictions through temperature-scaled distillation, optionally combined with elastic weight consolidation or memory-aware synapses. Twelve available CHB-MIT training logs, each containing ten stratified segment-level folds, yielded macro-average accuracy, sensitivity, and specificity of 94.93%, 95.84%, and 94.12%, respectively, for the static base network. Unit tests, gradient-flow checks, and end-to-end synthetic tests verified the software behaviour of the continual-learning modules. Because the available artifact set does not contain completed multi-patient real-data ablations, we do not report unsupported reductions in forgetting or update cost. Instead, we define a leakage-aware ablation and feature-visualization protocol for prospective evaluation. This separation of verified evidence from pending experiments keeps the framework reproducible while avoiding the misrepresentation of implementation tests as clinical validation.