On-chip seizure detectors that learn on their own

Figure 1. Proposed seizure detection

Adelson Chua and Rikky Muller

Department of Electrical Engineering and Computer Sciences at the University of California, Berkeley

Epilepsy affects about 50 million people worldwide and is characterized by recurring seizures that can lead to involuntary movements, loss of consciousness, and even death. Several technology-based solutions for monitoring and treating epilepsy have emerged in recent years involving wearable and implantable technologies that can autonomously detect seizures, providing alerts or triggering neurostimulation. These systems use scalp-based or intracranial electroencephalogram (EEG or iEEG) recordings and use machine learning based classifiers to identify distinct seizure patterns in brain activity. Integrating the machine learning together with the recording electronics enables low-latency detections resulting in fast and therapeutically relevant response times.  Performing seizure detection on application-specific integrated circuits (ASICs) has shown promising results [1-6], however, achieving high accuracy over long periods of time can be challenging. One often overlooked aspect is that seizure patterns can change over time [7-9], requiring offline classifier retraining. The main difficulty in retraining traditional seizure detection classifiers is that they rely on labeled data, therefore a trained clinician must be involved in labeling the dataset in a lengthy and costly process.

Our work addresses two main challenges in developing a high-accuracy seizure detection system for wearable or implantable devices. First, we have eliminated the need for offline retraining by augmenting a traditional classifier to perform unsupervised online learning. This means that the classifier is able to continuously improve its model over time without requiring any labeled data. By incorporating stochastic gradient descent (SGD) on a logistic regression classifier, we have developed an algorithm called SOUL (Stochastic-gradient-descent-based Online Unsupervised Logistic regression classifier) [10], shown in Figure 1. SOUL is able to adapt dynamically to changes in neural signal patterns over time, maintaining high detection accuracy without any external intervention. Since logistic regression classifiers output a probability, SOUL knows when high confidence decisions are being made and updates its model weights every time it makes a known good decision, eliminating the need for labels. Second, our implementation is extremely low power making it suitable for implantable applications. The entire 8-channel classifier consumes only 1.5 W, a fraction of the power required by the neural recording analog and digitizing circuits. By choosing a classifier and algorithm that achieve a computationally simple implementation, and performing hardware optimization, we have minimized the required hardware and eliminated the need for large amounts of on-chip memory. As a result, SOUL is significantly (>24x) more energy-efficient than state-of-the-art seizure detection systems that do not perform online learning.

Figure 1. Proposed seizure detection

Figure 1. Proposed seizure detection system incorporating an unsupervised online learning framework to adapt to varying seizure patterns over time. Figure is adapted from [10].

Figure 1 shows the basic architecture of a seizure detection system utilizing SOUL. SOUL utilizes logistic regression, which is a statistical method used to model the probability of a binary outcome, such as whether a seizure is occurring or not. The algorithm uses a linear combination of input features that describe the time and frequency domain characteristics of the EEG signal, and feature weights that the model acquires after training. In this work, we extracted two feature classes: line length, which captures the time domain characteristics of seizures, and spectral band powers, which capture frequency-dependent patterns on three EEG frequency bands (8-16Hz, 16-32Hz, 32-96Hz). For many patients, these input features, with weights trained offline, are sufficient to achieve high-accuracy seizure detection. However, patients with drifting seizure patterns require updated feature weights to maintain high accuracies over time.

To enable dynamic changes to the feature weights on-chip, this work employs a stochastic gradient descent (SGD) – based optimization algorithm. This algorithm is particularly useful for online retraining as it can update the model’s parameters in real-time as new data becomes available. SGD iteratively updates the model’s parameters to minimize the difference between predicted and actual values. Rather than calculating the gradient of the entire training dataset, which can be computationally expensive, SGD approximates the operation using only the incoming input data. By incorporating SGD into logistic regression, a computationally simple formula is achieved, enabling low hardware overhead. Figure 2 (left) illustrates the SGD algorithm and how the probability curve shifts towards a new optimal point as a new set of feature weights is calculated. Unsupervised online learning is achieved by using the classifier’s own output probability as the new training label, creating positive feedback, as shown in the figure. However, this approach depends on the classifier not making any misclassifications; otherwise, the SGD algorithm will retrain the classifier in the wrong direction. To make this retraining process robust, weights are only updated once a specified confidence threshold is reached by the logistic probability output, for a consecutive number of times within a specific confidence window. Both the threshold and the confidence window are tuned during the offline training phase on a patient-specific basis.

As seizure patterns change over time, SOUL can maintain high accuracies relative to offline-only-trained classifiers for all subjects

Figure 2. (Top left) Online learning is achieved through weight updates using stochastic gradient descent (SGD). Unsupervised learning is enabled by using the classifier’s own output for retraining. (Bottom left) SGD retraining shifts the classifier probability curve towards a new optimal point after getting a new training point. (Right) Cumulative classification accuracies on 3 human subjects vs. time. As seizure patterns change over time, SOUL can maintain high accuracies relative to offline-only-trained classifiers for all subjects. Figure is adapted from [10].

The performance of the classifier was evaluated using a human intracranial EEG (iEEG) dataset [7,9], which contains recordings of more than 100 hours from each of three patients. The long continuous recording times were crucial since it can capture possible seizure pattern drifts that are not observed on much shorter (~1 hour) recordings. SOUL performance is compared against a base logistic regression without online retraining and against a representative SVM, which is the most common implementation for seizure classifiers in the literature. Incorporating online learning, SOUL achieves an average seizure detection rate of 97.9%, which is a 6.5% improvement compared to the other classifiers. This also had a minimal impact on the false alarm rate with less than 1% difference compared to that of other classifiers. This testing demonstrates how online learning performs over a long period of time, and the results highlight the efficacy of the SOUL system compared to other state-of-the-art seizure detection systems.

The classifier was implemented on-chip with a footprint of only 0.1 mm2, which is 10 times smaller than state-of-the-art seizure detectors. Using logistic regression as the base classifier allowed for a memory requirement that is 300 times smaller compared to conventional SVM-based systems [1-6]. The combination of the proposed algorithmic approach and architectural optimizations resulted in an energy efficiency of 1.5 nanoJoule/classification, which is at least 24 times better than state-of-the-art implementations.

Our work proposes a novel approach for seizure detection in implantable systems, leveraging the benefits of unsupervised online learning and architectural optimizations. The proposed SOUL algorithm, based on logistic regression with stochastic gradient descent, can dynamically adapt to changes in neural signal patterns over time and maintain high detection accuracy without external intervention. The optimized hardware design allows for a small area footprint and significant energy efficiency. Through extensive evaluation on real long-term patient data, SOUL outperforms conventional classifiers in terms of sensitivity and achieves comparable specificity, while being significantly more energy efficient. Overall, this work demonstrates the potential of online learning for improving the performance and energy efficiency of neural signal classification systems. SOUL can be extended to seizure prediction systems when trained on pre-seizure data, utilizing the detection probability to accurately predict incoming seizures minutes before. This work also paves the way for highly accurate, low-power classifiers that can be applied towards other expanded applications in neuroscience and health.

We acknowledge our co-author and collaborator Prof. Michael I. Jordan. This work was made possible by the sponsors of the Berkeley Wireless Research Center, the NSF CAREER Award, and TSMC for chip fabrication. Human iEEG data were provided by Dr. Mark Cook and Dr. Dean Freestone [7,9].

[1] J. Yoo, et al., “An 8-Channel Scalable EEG Acquisition SoC With Patient-Specific Seizure Classification and Recording Processor,” in IEEE Journal of Solid-State Circuits, vol. 48, no. 1, pp. 214-228, Jan. 2013, DOI: 10.1109/JSSC.2012.2221220.

[2] C. Zhang, et al., “Design and Implementation of an On-Chip Patient-Specific Closed-Loop Seizure Onset and Termination Detection System,” in IEEE Journal of Biomedical and Health Informatics, vol. 20, no. 4, pp. 996-1007, July 2016, DOI: 10.1109/JBHI.2016.2553368.

[3] G. O’Leary et al., “A recursive-memory brain-state classifier with 32-channel track-and-zoom Δ2Σ ADCs and Charge-Balanced Programmable Waveform Neurostimulators,” 2018 IEEE International Solid-State Circuits Conference – (ISSCC), 2018, pp. 296-298, DOI: 10.1109/ISSCC.2018.8310301.

[4] Y. Wang, et al., “A Closed-Loop Neuromodulation Chipset With 2-Level Classification Achieving 1.5-Vpp CM Interference Tolerance, 35-dB Stimulation Artifact Rejection in 0.5ms and 97.8%-Sensitivity Seizure Detection,” in IEEE Transactions on Biomedical Circuits and Systems, vol. 15, no. 4, pp. 802-819, Aug. 2021, DOI: 10.1109/TBCAS.2021.3102261.

[5] S. Huang, et al., “A 1.9-mW SVM Processor with On-Chip Active Learning for Epileptic Seizure Control,” in IEEE Journal of Solid-State Circuits, vol. 55, no. 2, pp. 452-464, Feb. 2020, DOI: 10.1109/JSSC.2019.2954775.

[6] M. Zhang et al., “A Patient-Specific Closed-Loop Epilepsy Management SoC with One-Shot Learning and Online Tuning,” in IEEE Journal of Solid-State Circuits, vol. 57, no. 4, pp. 1049-1060, April 2022, DOI: 10.1109/JSSC.2022.3144460.

[7] M. Cook, “Prediction of seizure likelihood with a long-term, implanted seizure advisory system in patients with drug-resistant epilepsy: a first-in-man study.,” Lancet Neurology, vol. 12, pp. 563–71, June 2013, DOI: 10.1016/S1474-4422(13)70075-9.

[8] P. J. Karoly, et al., “The circadian profile of epilepsy improves seizure forecasting”, Brain, Vol. 140,8, Aug 2017, pp. 2169–2182, DOI: 10.1093/brain/awx173.

[9] Kuhlmann L, et al., “Epilepsyecosystem.org: crowd-sourcing reproducible seizure prediction with long-term human intracranial EEG”, Brain. 2018 Sep 1;141(9):2619-2630. DOI: 10.1093/brain/awy210.

[10] A. Chua, et al., “SOUL: An Energy-Efficient Unsupervised Online Learning Seizure Detection Classifier,” in IEEE Journal of Solid-State Circuits, vol. 57, no. 8, pp. 2532-2544, Aug. 2022, DOI: 10.1109/JSSC.2022.3172231.

 

Adelson Chua Adelson Chua (Student Member, IEEE) received his B.S in Computer Engineering and M.S. in Electrical Engineering from the University of the Philippines, Diliman, in 2012 and 2014, respectively. He is a member of the microelectronics faculty in the Electrical and Electronics Engineering Institute at the same university. Currently, he is on study leave and is working toward his Ph.D. degree in the Department of Electrical Engineering and Computer Sciences at the University of California, Berkeley, focusing on integrated circuits, computer architecture, and machine learning. He is a graduate student affiliate of the Berkeley Wireless Research Center (BWRC).

 

 

 

Rikky Muller, PhD Rikky Muller, PhD (Senior Member, IEEE) is an Associate Professor of Electrical Engineering and Computer Sciences at UC Berkeley where she holds the S. Shankar Sastry Professorship in Emerging Technologies. She received her BS and Meng degrees from MIT and her PhD from UC Berkeley. She is currently Co-director of the Berkeley Wireless Research Center (BWRC), a Core Member of the Center for Neural Engineering and Prostheses (CNEP) and an Investigator at the Chan-Zuckerberg Biohub. Her research group focuses on emerging implantable and wearable medical devices and in developing low-power, wireless microelectronic and integrated systems for neurological applications.