<p>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 <InlineEquation ID="IEq1"><EquationSource Format="TEX">\(30\%\)</EquationSource></InlineEquation> structured pruning, fine-tuning, quantization-aware training, and final INT8 conversion. Experimental results on the CHB-MIT dataset show that the full-precision model achieves <InlineEquation ID="IEq2"><EquationSource Format="TEX">\(97.74\%\)</EquationSource></InlineEquation> accuracy, <InlineEquation ID="IEq3"><EquationSource Format="TEX">\(97.74\%\)</EquationSource></InlineEquation> F1-score, and <InlineEquation ID="IEq4"><EquationSource Format="TEX">\(95.91\%\)</EquationSource></InlineEquation> AUC-ROC, while the final compressed model maintains competitive performance with <InlineEquation ID="IEq5"><EquationSource Format="TEX">\(93.86\%\)</EquationSource></InlineEquation> accuracy, <InlineEquation ID="IEq6"><EquationSource Format="TEX">\(93.88\%\)</EquationSource></InlineEquation> F1-score, and <InlineEquation ID="IEq7"><EquationSource Format="TEX">\(90.51\%\)</EquationSource></InlineEquation> AUC-ROC. The final TinyML model reduces the memory footprint from <InlineEquation ID="IEq8"><EquationSource Format="TEX">\(194.6\)</EquationSource></InlineEquation> KB to <InlineEquation ID="IEq9"><EquationSource Format="TEX">\(30.6\)</EquationSource></InlineEquation> and decreases inference time from <InlineEquation ID="IEq10"><EquationSource Format="TEX">\(12.8\)</EquationSource></InlineEquation> to <InlineEquation ID="IEq11"><EquationSource Format="TEX">\(3.7\)</EquationSource></InlineEquation> ms, requiring only <InlineEquation ID="IEq12"><EquationSource Format="TEX">\(2.99\%\)</EquationSource></InlineEquation> of a 1 MB Flash budget. These results demonstrate that the proposed framework offers an effective trade-off between seizure detection performance, uncertainty-aware reliability, cross-patient generalization, and embedded deployment efficiency.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

A lightweight transformer with uncertainty handling for zero-shot epileptic seizure detection on TinyML edge devices

  • Chaymae Yahyati,
  • Ismail Lamaakal,
  • Khalid El Makkaoui,
  • Ibrahim Ouahbi

摘要

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 \(30\%\) structured pruning, fine-tuning, quantization-aware training, and final INT8 conversion. Experimental results on the CHB-MIT dataset show that the full-precision model achieves \(97.74\%\) accuracy, \(97.74\%\) F1-score, and \(95.91\%\) AUC-ROC, while the final compressed model maintains competitive performance with \(93.86\%\) accuracy, \(93.88\%\) F1-score, and \(90.51\%\) AUC-ROC. The final TinyML model reduces the memory footprint from \(194.6\) KB to \(30.6\) and decreases inference time from \(12.8\) to \(3.7\) ms, requiring only \(2.99\%\) of a 1 MB Flash budget. These results demonstrate that the proposed framework offers an effective trade-off between seizure detection performance, uncertainty-aware reliability, cross-patient generalization, and embedded deployment efficiency.