Department of Electrical and Systems Engineering, University of Pennsylvania, Philadelphia, PA, United States of America.
Department of Neurosurgery, University of Pennsylvania, Philadelphia, PA, United States of America.
J Neural Eng. 2021 Apr 26;18(4). doi: 10.1088/1741-2552/abf473.
Implanted devices providing real-time neural activity classification and control are increasingly used to treat neurological disorders, such as epilepsy and Parkinson's disease. Classification performance is critical to identifying brain states appropriate for the therapeutic action (e.g. neural stimulation). However, advanced algorithms that have shown promise in offline studies, in particular deep learning (DL) methods, have not been deployed on resource-restrained neural implants. Here, we designed and optimized three DL models or edge deployment and evaluated their inference performance in a case study of seizure detection.A deep neural network (DNN), a convolutional neural network (CNN), and a long short-term memory (LSTM) network were designed and trained with TensorFlow to classify ictal, preictal, and interictal phases from the CHB-MIT scalp EEG database. A sliding window based weighted majority voting algorithm was developed to detect seizure events based on each DL model's classification results. After iterative model compression and coefficient quantization, the algorithms were deployed on a general-purpose, off-the-shelf microcontroller for real-time testing. Inference sensitivity, false positive rate (FPR), execution time, memory size, and power consumption were quantified.For seizure event detection, the sensitivity and FPR for the DNN, CNN, and LSTM models were 87.36%/0.169 h, 96.70%/0.102 h, and 97.61%/0.071 h, respectively. Predicting seizures for early warnings was also feasible. The LSTM model achieved the best overall performance at the expense of the highest power. The DNN model achieved the shortest execution time. The CNN model showed advantages in balanced performance and power with minimum memory requirement. The implemented model compression and quantization achieved a significant saving of power and memory with an accuracy degradation of less than 0.5%.Inference with embedded DL models achieved performance comparable to many prior implementations that had no time or computational resource limitations. Generic microcontrollers can provide the required memory and computational resources, while model designs can be migrated to application-specific integrated circuits for further optimization and power saving. The results suggest that edge DL inference is a feasible option for future neural implants to improve classification performance and therapeutic outcomes.
植入式设备可实时进行神经活动分类和控制,从而越来越多地用于治疗神经疾病,如癫痫和帕金森病。分类性能对于识别适合治疗作用的脑状态至关重要(例如,神经刺激)。然而,在离线研究中表现出前景的先进算法,特别是深度学习(DL)方法,尚未在资源受限的神经植入物上部署。在这里,我们设计并优化了三种用于边缘部署的 DL 模型,并在癫痫发作检测的案例研究中评估了它们的推理性能。
使用 TensorFlow 设计并训练了深度神经网络(DNN)、卷积神经网络(CNN)和长短时记忆(LSTM)网络,以从 CHB-MIT 头皮 EEG 数据库中分类发作期、发作前期和发作间期。开发了基于滑动窗口的加权多数投票算法,根据每个 DL 模型的分类结果检测癫痫发作事件。经过迭代模型压缩和系数量化后,算法部署在通用的现成微控制器上进行实时测试。
推理灵敏度、假阳性率(FPR)、执行时间、内存大小和功耗进行了量化。
对于癫痫发作事件检测,DNN、CNN 和 LSTM 模型的灵敏度和 FPR 分别为 87.36%/0.169 h、96.70%/0.102 h 和 97.61%/0.071 h。对于早期预警的预测癫痫发作也是可行的。LSTM 模型以牺牲最高功率为代价实现了最佳整体性能。DNN 模型实现了最短的执行时间。CNN 模型在需要最小内存的情况下具有平衡的性能和功率优势。所实现的模型压缩和量化实现了显著的功耗和内存节省,而精度下降小于 0.5%。
具有嵌入式 DL 模型的推理达到了许多先前实现的性能,这些实现没有时间或计算资源限制。通用微控制器可以提供所需的内存和计算资源,而模型设计可以迁移到专用集成电路(ASIC)以进一步优化和节省功耗。结果表明,边缘 DL 推理是未来神经植入物提高分类性能和治疗效果的可行选择。