FEMBA在边缘:一种生理感知的预训练、量化和在超低功耗微控制器上部署双向Mamba EEG基础模型
FEMBA on the Edge: Physiologically-Aware Pre-Training, Quantization, and Deployment of a Bidirectional Mamba EEG Foundation Model on an Ultra-low Power Microcontroller
AI总结:
本文提出FEMBA,通过生理感知预训练、量化和部署,实现基于Mamba的EEG基础模型在超低功耗微控制器上的高效应用,提升长期神经监测性能。
摘要:
目标:通过克服基于Transformer的EEG基础模型的计算瓶颈和状态空间模型(SSMs)固有的量化挑战,实现可穿戴设备上的连续长期神经监测。方法:我们提出了FEMBA,一种在超过21000小时EEG数据上预训练的双向Mamba架构。我们引入了一种新的生理感知预训练目标,包括低通滤波的重建,以优先考虑神经振荡而非高频伪影。为解决SSMs中常见的激活异常,我们采用量化感知训练(QAT)将模型压缩到2位权重。该框架在并行超低功耗RISC-V微控制器(GAP9)上使用自定义的双缓冲内存流方案进行部署。结果:所提出的低通预训练将下游AUROC在TUAB上的表现从0.863提高到0.893,AUPR从0.862提高到0.898,相比最佳对比基线。QAT成功将权重压缩,性能损失可忽略不计,而标准后训练量化会导致精度下降约30%。嵌入式实现实现了确定性的实时推断(每5秒窗口1.70秒)并减少了内存占用74%(降至约2MB),在FLOPs上比Transformer基准少27倍,同时保持竞争性的准确性。结论:FEMBA表明基于Mamba的基础模型可以有效地进行量化和部署在极端边缘硬件上,而不会牺牲用于稳健临床分析所需的表示质量。意义:这项工作建立了首个完整的全栈框架,用于在超低功耗可穿戴设备上部署大规模EEG基础模型,促进癫痫和睡眠障碍的连续、基于SSM的监测。
英文摘要:
Objective: To enable continuous, long-term neuro-monitoring on wearable devices by overcoming the computational bottlenecks of Transformer-based Electroencephalography (EEG) foundation models and the quantization challenges inherent to State-Space Models (SSMs). Methods: We present FEMBA, a bidirectional Mamba architecture pre-trained on over 21,000 hours of EEG. We introduce a novel Physiologically-Aware pre-training objective, consisting of a reconstruction with low-pass filtering, to prioritize neural oscillations over high-frequency artifacts. To address the activation outliers common in SSMs, we employ Quantization-Aware Training (QAT) to compress the model to 2-bit weights. The framework is deployed on a parallel ultra-low-power RISC-V microcontroller (GAP9) using a custom double-buffered memory streaming scheme. Results: The proposed low-pass pre-training improves downstream AUROC on TUAB from 0.863 to 0.893 and AUPR from 0.862 to 0.898 compared to the best contrastive baseline. QAT successfully compresses weights with negligible performance loss, whereas standard post-training quantization degrades accuracy by approximately \textbf{30\%}. The embedded implementation achieves deterministic real-time inference (\textbf{1.70~s} per 5~s window) and reduces the memory footprint by \textbf{74\%} (to $\approx$2~MB), achieving competitive accuracy with up to \textbf{27$\times$} fewer FLOPs than Transformer benchmarks. Conclusion: FEMBA demonstrates that Mamba-based foundation models can be effectively quantized and deployed on extreme-edge hardware without sacrificing the representation quality required for robust clinical analysis. Significance: This work establishes the first full-stack framework for deploying large-scale EEG foundation models on ultra-low-power wearables, facilitating continuous, SSM based monitoring for epilepsy and sleep disorders.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。