A lightweight transformer with uncertainty handling for zero-shot epileptic seizure detection on TinyML edge devices
摘要
Epileptic seizure detection from EEG recordings is a fundamental requirement for neurological patient monitoring and for enabling next-generation wearable healthcare systems. However, reliable seizure detection remains challenging due to the non-stationary nature of EEG signals, strong inter-patient variability, class imbalance, and the difficulty of deploying accurate models on resource-constrained Internet of Medical Things devices. In this paper, we propose an uncertainty-aware lightweight transformer for zero-shot epileptic seizure detection on TinyML-enabled edge devices. The proposed framework transforms pre-processed multichannel EEG windows into compact temporal tokens, processes them using shallow transformer encoder blocks, and produces a seizure probability through a lightweight classification head. To improve patient-independent generalization, a strict patient-wise zero-shot protocol is adopted, where test patients are completely excluded from training, validation, threshold selection, and model adaptation. In addition, an entropy-based uncertainty quantification module is integrated to identify ambiguous EEG windows and support reliability-aware decision-making. To enable embedded deployment, the model is compressed using a progressive pipeline composed of