2021
[2,3,5]Xing Lin [1,3,5]Qionghai Dai
1]Department of Automation, Tsinghua University, Beijing 100084, China 2]Department of Electronic Engineering, Tsinghua University, Beijing 100084, China 3]Institute for Brain and Cognitive Sciences, Tsinghua University, Beijing 100084, China 4]School of Electronic Science and Engineering, Nanjing University, Nanjing 210023, China 5]Beijing National Research Center for Information Science and Technology, Tsinghua University, Beijing 100084, China
EEG Opto-processor: epileptic seizure detection using diffractive photonic computing units
Abstract
Electroencephalography (EEG) analysis extracts critical information from brain signals, which has provided fundamental support for various applications, including brain-disease diagnosis and brain-computer interface. However, the real-time processing of large-scale EEG signals at high energy efficiency has placed great challenges for electronic processors on edge computing devices. Here, we propose the EEG opto-processor based on diffractive photonic computing units (DPUs) to effectively process the extracranial and intracranial EEG signals and perform epileptic seizure detection. The signals of EEG channels within a second-time window are optically encoded as inputs to the constructed diffractive neural networks for classification, which monitors the brain state to determine whether it’s the symptom of an epileptic seizure or not. We developed both the free-space and integrated DPUs as edge computing systems and demonstrated their applications for real-time epileptic seizure detection with the benchmark datasets, i.e., the CHB-MIT extracranial EEG dataset and Epilepsy-iEEG-Multicenter intracranial EEG dataset, at high computing performance. Along with the channel selection mechanism, both the numerical evaluations and experimental results validated the sufficient high classification accuracies of the proposed opto-processors for supervising the clinical diagnosis. Our work opens up a new research direction of utilizing photonic computing techniques for processing large-scale EEG signals in promoting its broader applications.
keywords:
epileptic seizure detection, EEG analysis, diffractive photonic computing unit1 Introduction
Electroencephalography (EEG) monitors the brain’s neural activities by measuring the electrical fields with electrons, where the extracranial EEG places electrodes outside the skull and intracranial EEG, i.e., iEEG, implants the electrodes directly on the cerebral cortex. The complexity of EEG signals requires advanced signal processing and analysis methods for correct interpretation. Recently, deep learning lecun2015deep has shown significant advantages in analyzing EEG signals by learning the feature representation and data abstraction to facilitate different applications, e.g., epilepsy, brain-computer interface, sleep, and cognitive monitoring craik2019deep ; gao2021complex ; schirrmeister2017deep . The deep learning architectures based on artificial neural networks (ANNs) are generally implemented on electronic computing platforms using central processor units (CPUs), graphics processing units (GPUs), field-programmable gate arrays (FPGAs), and application-specific integrated circuits (ASICs) yao2020fully . With the continuously increasing EEG signal channels and data scale, processing the EEG signals using deep learning on electronic computing platforms are power-intensive and time-consuming. Therefore, it’s challenging to deploy the models on edge devices for portable and wearable applications due to power supply constraints and limited computing speed. Besides, electronic computing confronts unsustainable performance growth as electronic transistors approach their physical limits waldrop2016chips .
Photonic computing has been considered a promising solution for future computing systems due to its significant advantages of high energy efficiency and light-speed parallel processing capabilities caulfield2010future . Using photonic computing, research on photonic neural networks (PNNs) and photonic integrated circuits have flourished vigorously in recent years wetzstein2020inference ; shastri2021photonics , which enable ultra-fast and low-power artificial intelligence (AI) inference and provide critical support for high-performance computing in scenarios with strict limits on energy consumption. Various effective architectures of PNNs have been demonstrated, including spike neural networks feldmann2019all , convolutional neural networks chang2018hybrid ; miscuglio2020massively , reinforcement learning bueno2018reinforcement , and reservoir computing antonik2019human . The linear weighted interconnection of PNNs could be implemented via a mesh of Mach–Zehnder interferometers (MZIs) shen2017deep , diffractive surfaces lin2018all ; yan2019fourier ; rahman2021ensemble ; kulce2021all ; veli2021terahertz ; zhou2021large ; doi:10.1126/sciadv.abn7630 , and tunable attenuators connected with waveguides tait2017neuromorphic ; feldmann2019all , etc. The nonlinear activation function of PNNs could be realized by laser-cooled atoms with electro-magnetically induced transparency zuo2019all , cavity-loaded interferometers jha2020reconfigurable , and photodetector-driven MZIs williamson2019reprogrammable , etc. Currently, photonic accelerators enable massive parallel computing at speeds of trillions of multiply-accumulate operations per second feldmann2021parallel ; xu202111 . But most existing PNNs only support simple neural network architectures with limited numbers of neurons and have limited performance in complex tasks compared to state-of-the-art electronic artificial neural networks (ANNs). Diffractive photonic computing lin2018all ; zhou2021large ; kulce2021all supports millions of neurons and arbitrary linear transformation, which can be utilized to construct more advanced architecture to perform complex AI tasks. We demonstrate the use of diffractive photonic computing to construct diffractive PNN architectures and perform the EEG analysis for epileptic seizure detection.
Epilepsy is a serious chronic neurological disorder that is repetitive and sudden. It has been proved that approximately one-third of the patients are intractable with medications litt2002prediction . They are at high risk of serious physical injury or even death if suffering accidental seizures. Therefore, performing the EEG analysis to achieve automated and portable seizure detection devices are critical to alert caregivers and protect the lives of patients. Many seizure detection methods based on statistical features and machine learning classifiers have been proposed shoeb2010application ; siddiqui2020review , where the ANN-based methods zhou2018epileptic ; daoud2019efficient have achieved state-of-the-art detection performance. Instead of executing ANNs energy intensively on traditional electronic edge devices with limited computing power, PNNs can overcome the limitations of electronics zhang2019artificial and provide promising opportunities to design portable and power-saving seizure detection devices, which has not been demonstrated.
Here, we propose the EEG opto-processor based on diffractive photonic computing units (DPUs) and construct the PNN architecture to perform the epileptic seizure detection with EEG and iEEG measurements (Fig. 1). We develop the 3D free-space DPU with a highly compact optical system, where a high data-throughput spatial light modulator (SLM) is used to implement the input data encoding and the diffractive modulation simultaneously. The diffractive deep neural networks () are constructed with DPU by implementing the computational operations of diffractive weighted interconnections optically, using photoelectric conversion for nonlinearity activation, and controlling the dataflow electronically. Furthermore, we design a 2D integrated DPU with a metaline-based multi-layer structure doi:10.1126/sciadv.abn7630 ; wang2022integrated ; wang2019chip on a silicon photonics platform to achieve higher integration density and lower power consumption towards wearable devices. In this design, we further introduce an optical bias block and validate its effectiveness in unbalanced classification tasks in this work. We demonstrate that the DPU-based successfully processes the multi-channel EEG and iEEG signals and detects the epileptic seizure with high performance. Besides, channel selection using random forest is developed to select the most important channels. The results show that the selected single-channel signal can be used for the detection with sufficient detection accuracy. We conduct the evaluations theoretically and experimentally, providing the possibility to collect EEG and iEEG signals with only one electrode for each patient and making the system more economical, efficient, and comfortable for personalized medicine.
2 Results
2.1 Epileptic seizure detection with the free-space DPU
We utilize photonic computing to analyze and detect the epileptic seizures from the recorded electroencephalogram (EEG) signals (see Fig. 1a). EEG is one of the most used methods for monitoring brain activity and is considered the best indicator for epilepsy diagnosis and analysis french2008initial . The extracranial EEG measures the voltage difference between scalp-mounted electrodes caused by the ionic flowing in the brain neurons, while the intracranial electroencephalogram (iEEG) is the neuroelectrophysiologic signal obtained from implanted electrodes. Different channels from the electrodes at the corresponding positions reflect the spatial and temporal information of brain activity. The epileptiform EEG or iEEG patterns, such as spikes and sharp waves, contribute to the seizure diagnosis. The effectiveness of the proposed EEG opto-processor is validated on both EEG and iEEG modalities.
We develop a 3D free-space DPU to execute the task by pre-processing the EEG signals into 2D images to be analyzed with the constructed large-scale architecture zhou2021large , as shown in Fig. 1b. The main components are the large-scale reconfigurable SLM and the optoelectronic detector that can be programmed to support millions of diffractive neurons. The input data are encoded on the phase of the optical field to the input nodes and modulated by the diffractive layer parameters that can be trained according to specific AI tasks. The input nodes are connected to output neurons via optical diffraction, and the trainable synaptic weights are generated by the diffractive modulation. The nonlinear activation function occurs in the photoelectronic conversion of the diffractive computation results by measuring the intensity of complex fields and intensity-to-phase conversion at the next input layer. The dataflow is controlled electronically for building the multi-layer PNN architecture that performs video-rate epileptic seizure detection. Different from zhou2021large , both the input data encoding and phase modulation are implemented with SLM, which eliminates the additional input data encoding module and the related relay optics for significantly reducing the system complexity. The experimental setup of the free-space DPU is depicted in Supplementary Fig. 1. We construct a 2-layer with the modeling and training process detailed in Materials and Methods. For each input signal sequence, two target regions, representing the seizure and non-seizure states, are configured at the network output plane, where the target region with higher optical intensity indicates the epileptic seizure detection result. After the training to learn the diffractive modulation coefficients, the performs light-speed inference, offering video-rate and energy-efficient epileptic seizure detection for patients.
We first validate the effectiveness of the proposed optical epileptic seizure detection approach using EEG signals of the CHB-MIT dataset shoeb2009application ; goldberger2000physiobank from Children Hospital Boston, Massachusetts Institute of Technology. It contains hours of seizure and non-seizure EEG recordings of 23 patients obtained through the 10-20 International system of EEG electrode placement. The CHB-MIT dataset is widely used as a benchmark for epileptic seizure detection birjandtalab2017automated ; zhou2018epileptic ; daoud2019efficient ; siddiqui2020review . Similar to daoud2019efficient , we selected the EEG recordings of 8 patients with sufficient seizure time (more than 400 seconds) to generate the training and testing dataset for the (see Methods, and Supplementary Table 1). The EEG signals were pre-processed and transformed into images to match the input format of the . Besides, since the epileptic EEG signals are nonstationary and multi-component, extracting meaningful statistical features from raw 1D timing signals is critical for the detection. We adopted the short-time Fourier transform (STFT) to pre-process the raw signals and extract effective 2D features containing both time and frequency characteristics tzallas2009epileptic ; boonyakitanont2020review . STFT can be easily implemented in wearable devices based on digital electronics, and optical solutions have also been demonstrated to achieve higher speed and bandwidths li2011all ; xie2020stft . Epileptic seizures will cause changes in certain frequency bands, such as (0.4–4 Hz), (4–8 Hz), (8–12 Hz), (12–30 Hz), and (30–70 Hz) bands tzallas2009epileptic ; tatum2014ellen . And the energy of the EEG signals is mainly concentrated in low-frequency bands, so we set the frequency range of STFT to 0-50 Hz. For each time window of EEG signals, the signals of different channels were transformed into STFT spectra, stitched together into one image, and fed to a to detect epilepsy seizures.
Selecting informative EEG channels is critical for building wearable healthcare devices and achieving personalized medicine in epileptic seizure detection. Generalized epileptic seizures involving the whole brain can be seen in every channel of the EEG recordings, while partial seizures can be seen only in a few channels whose corresponding electrodes are near the lesion. Full-channel EEG monitoring confronts great challenges in wearable devices because it is expensive, time-consuming, computationally intensive, and uncomfortable. Moreover, invalid channels add noise to the signals and increase detection difficulties. Channel selection can be achieved by medically diagnosing the location of the lesion or with statistical methods birjandtalab2017automated ; alotaiby2015review . This process only needs to be completed in the preliminary analysis but not repeated in the subsequent epilepsy monitoring.
We apply a random forest-based channel selection method birjandtalab2017automated to analyze the performance of the for EEG analysis on the CHB-MIT dataset under different channel numbers (see Fig. 2). The pipeline of channel selection is shown in Fig. 2a, where the EEG signals are first divided into sub-sequences with an equivalent time interval of 1-second. Next, the power spectral density of each EEG channel at each window is calculated, representing different bands, i.e., , , , , and . The signals of each time window are utilized as a sample with 115 attributes (23 channels and 5 bands). A random forest breiman2001random containing 1000 decision trees is used to learn the features of each sample and detect the epileptic seizures, which has been proven to be robust in learning irrelevant features kursa2014robustness . During the process of updating the random forest, i.e., minimizing the sum of the impurities, redundant features will not be selected for node splitting, and informative features will appear in those trees more frequently. Therefore, the feature contribution percentage can be obtained by investigating the normalized total reduction of the impurities in the random forest brought by that feature, which is also known as the Gini importance. And the channel contribution percentage is the sum of five feature contribution percentages. For example, the rightmost subgraph of Fig. 2a illustrates the contribution percentage of 23 channels for the patient chb01 (see Supplementary Table 1), and the most important channel is 17. The channels with the highest contribution percentage are selected for seizure detection with . In addition, the random forest is also an effective machine learning classifier for epileptic seizure detection siddiqui2020review and serves as a performance reference for the -based approach.
With the channel selection, we evaluate the performance of on the CHB-MIT dataset. The statistical evaluations, including accuracy, sensitivity, specificity, and score, are used for evaluating the binary classification performance. In the medical domain, the score, with typically , is a weighted harmonic mean of the precision and recall that is more useful than accuracy, especially when the dataset is imbalanced powers2020evaluation . We adopt the F2 score, i.e., , to allow the recall to have a larger weight, considering the identification of disease episodes with only a minority of time devarriya2020unbalanced . We explore the performance of under different layer numbers with the 1-channel signals selected by random forest (see Supplementary Fig. 2). With 0.16 million diffractive neurons in each layer, the average accuracy, sensitivity, specificity, and F2 score are 97.89%, 91.92%, 98.13%, and 0.8553, respectively, for the 2-layer , which are comparable to the 3-layer model. Further increasing the layer number has a little performance improvement. Besides, the 1-layer does not converge during training and is not competent for this task. The same conclusion was obtained for larger channel numbers. Therefore, the 2-layer model is adopted in the numerical evaluations and experiments.
The accuracy and F2 score of the numerical model under different channel numbers are visualized with the box diagram in Fig. 2b and Fig. 2c, respectively. Rand-, RF-, and RF-RF denote selecting channels randomly and classifying with a , selecting channels with a random forest and classifying with a , and selecting channels and classifying simultaneously with a random forest, respectively. Both the accuracy and F2 score of RF- outperform Rand- and RF-RF obviously when using a few channels, demonstrating the effectiveness of the channel selection method using random forest. The performances of all models improve with the increase of the channel number, especially for the Rand- and RF-RF models. The RF- model achieves sufficient high performance using 1-channel EEG signals with an average accuracy of 97.89% and an F2 score of 0.8553, which are close to the full-channel RF- model with an average accuracy of 98.96% and an F2 score of 0.9161. Notice that the full-channel RF-RF achieves an average accuracy of 98.88% and an F2 score of 0.9335. Besides, the 1-channel RF- performs relatively stable on different patients, i.e., the accuracy varies from 95.43% to 99.31%, and the F2 score varies from 0.7351 to 0.9261. The same conclusion was obtained from the sensitivity and specificity metrics (see Supplementary Fig. 3). The simulation results verify that the with random forest for channel selection has the sufficient ability to make full use of the information of 1-channel signals to perform high-quality epileptic seizure detection.
We conduct experiments using the 2-layer model and single-channel EEG signals to facilitate more efficient computing and convenient signal acquisition. The results are presented in Fig. 3. In order to eliminate the systematic errors, the modulation coefficients of the second layer are fine-tuned via adaptive training with the experimental results of the first layer (see Methods). Fig. 3b illustrates the pre-trained parameters of the 2-layer and the fine-tuned parameters of the second layer. Additionally, the intensities of the two target detection regions are multiplied by two factors, one for each region, to reduce the impact of uneven illumination and improve detection accuracy (see Methods). Fig. 3a illustrates the experimental results of the on the patient chb01 using 1-channel EEG signals. As expected, the successfully distinguish the seizure and non-seizure samples and concentrate the light into predefined regions. And the image characteristics of the experimental results are very close to the simulation results. Fig. 3c demonstrates the normalized intensity of 2 detector regions for 200 seizures and 200 non-seizures. The distinct difference makes the system robust for small noise disturbances. Furthermore, we evaluate the numerical and experimental performances of the 1-channel model on all the patients. As shown in Fig. 3d, the average accuracy, sensitivity, specificity, and F2 score are 96.84%, 92.81%, 96.98%, and 0.8174, respectively, in the experiments, which are comparable with the simulation. Detailed results for each patient are shown in Supplementary Table 2, verifying the correctness and effectiveness of the 1-channel approach and the experimental setup.
In addition to the EEG modality, we further utilize the DPU-constructed to detect epileptic seizures with iEEG signals. The performance is evaluated on electrocorticography (ECoG) recordings from 6 patients selected from the Epilepsy-iEEG-Multicenter-Dataset ds003029:1.0.3 (see Methods, Supplementary Table 1 and Table 2). Each iEEG signal sequence of these patients has a time duration of a few minutes near an epileptic seizure with large numbers of seizure signals, resulting in more difficulties for the detection compared with the CHB-MIT dataset that contains a long duration of non-seizure periods. We adopt the same feature exaction, channel selection method, and model as in EEG signals, and the performance under different channel numbers is shown in Fig. 4a. With the channel number settings of 1, 5, 10, and 30, the average accuracy is 90.93%, 94.35%, 94.31%, and 94.49%, respectively, and the average sensitivity is 92.50%, 93.32%, 93.51%, and 94.03%, respectively; the average specificity is 90.38%, 96.06%, 96.53%, and 95.68%, respectively, and the average F2 score is 0.9132, 0.9341, 0.9351, and 0.9395, respectively. The model’s generalization ability on different patients is further demonstrated in Supplementary Fig. 4. Similar to detecting epileptic seizure with EEG signals, we adopt the single-channel iEEG signals after channel selection for the experiments, as shown in Fig. 4b. The average accuracy, sensitivity, specificity, and F2 score are 87.51%, 89.00%, 87.35%, and 0.8755, respectively, in the experiments.
2.2 Epileptic seizure detection with the integrated DPU
We propose to design a 2D integrated DPU based on metamaterials doi:10.1126/sciadv.abn7630 ; wang2022integrated and on-chip optical devices for further reducing the system size and improving the computational efficiency towards the wearable EEG analysis, as shown in Fig. 1c. Specifically, the coherent light from an on-chip laser zhou2015chip is split into different single-mode waveguides with an array of multi-mode interferometers (MMIs) or Y-couplers. The 1D features of EEG signals are encoded on the light amplitude in the waveguides with on-chip modulators, such as Mach-Zehnder interferometers (MZIs). The weighted interconnections between the complex optical field of input and output waveguides are achieved with a diffractive computing block comprising the multi-layer metalines, which are passive optical structures for high energy efficiency computations. Each metaline is a 1D etched rectangle silica slot (meta-atom) array in the silicon membrane of the silicon-on-insulator (SOI) substrate. Both amplitude and phase modulation coefficients of a meta-atom are learnable and can be programmed by adjusting the width and length of the slot, where we train only the width in this work (see Supplementary Fig. 5). The diffractive computing block can be expanded vertically to receive higher dimensional input features and horizontally to increase diffractive parameters and learning capacities. In addition to the weighted interconnection block, we introduce an optical bias block to enhance the model capability. The bias coefficients are modulated at a different wavelength and coupled into two output waveguides of the diffractive computing block. The incoherent summation of optical energy is collected with photodetectors (PD) to indicate the epileptic seizure detection results. The bias modules enable the adjustment of output thresholds, which is especially effective in imbalanced data, such as epileptic seizure signals used in this work zhou2005training .
We apply the integrated DPU for epileptic seizure detection on EEG signals from the CHB-MIT dataset. To reduce the input port numbers of DPU, the time and frequency resolution of STFT is reduced during the pre-processing and only one channel selected by random forest is utilized to generate a 16-dimensional feature for each time window (see Methods). Since the modulation coefficients of each meta-atom are calculated with the periodic boundary condition by finite-difference time-domain (FDTD) simulations, we use binary modulation and combine three identical meta-atoms as one diffractive modulation neuron to facilitate the fabrication and improve the model accuracy. We trained the integrated DPU with 16 input waveguides and a metaline with 600 diffractive neurons considering the module size. Fig. 5a illustrates the optical field propagation details simulated with FDTD. The sufficient matched modulation profiles between the analytical model and FDTD are demonstrated in Supplementary Fig. 6. We numerically evaluate the integrated DPU with an optical bias block in Fig. 5b and Supplementary Table 3. The average accuracy, sensitivity, specificity, and F2 score are 97.68%, 88.92%, 98.01%, and 0.8385, respectively, but reduced to 89.11%, 76.61%, 89.61%, and 0.5173, respectively, without the optical bias block. Besides, the performance fluctuates greatly in different patients without the optical bias block. Notice that the average accuracy, sensitivity, specificity, and F2 score of an electronic fully connected neural network (ENN) with the same number of parameters are 98.54%, 83.49%, 99.17%, and 0.8292, respectively. The results demonstrate the effectiveness of the optical bias block for integrated DPU and the success of its application for epileptic seizure detection.
Similarly, the results on iEEG signals from the Epilepsy-iEEG-Multicenter-Dataset are shown in Fig. 5c and Supplementary Table 3. The average accuracy, sensitivity, specificity, and F2 score are 86.07%, 82.82%, 86.90%, and 0.8328, respectively, but reduced to 80.60%, 76.45%, 84.70%, and 0.7665, respectively, without the optical bias block. Compared to the CHB-MIT dataset, there is less performance degradation because the duration of seizure and non-seizure periods are similar in this dataset. The ENN with the same number of parameters achieves an average accuracy, sensitivity, specificity, and F2 score of 84.66%, 79.54%, 88.72%, and 0.8051, respectively, also close to the integrated DPU with an optical bias block.
3 Discussion
Computing speed and energy efficiency
We evaluate the computing performance of the free-space DPU with the constructed 2-layer . Each layer of generates a feature map with the element numbers of from an input image with the same size, which performs operations in the optical domain. Since the diffractive optical computations are operated at the speed of light, the computing speed is determined by the refresh rate of the SLM (30 Hz) and the acquisition frame rate of the CMOS optoelectronic detector (60 Hz). Considering a 30 Hz system frame rate, the computing speed of free-space DPU is operations per second (1.536 TOPS). Furthermore, the free-space DPU system supports diffractive neurons determined by the SLM. As a result, the maximum diffractive computation speed is 293.53 TOPS, which is better than the state-of-the-art edge-computing device of Nvidia Jetson AGX Xavier with a computing speed of 32 TOPS.
The integrated DPU in Fig. 5a executes a weight matrix with passive metalines in a region of . Considering the typical light source power of 10 mW with a modulation and photodetection rate of 30 GHz based on the existing silicon photonic foundry, the computing speed, computing density, and energy efficiency are 1.92 TOPS, 17.778 TOPS per square millimeter and 192 TOPS per watt, respectively. Notice that the computing density and energy efficiency of the state-of-the-art GPU Tesla V100 are 0.037 TOPS per square millimeter and 0.1 TOPS per watt, respectively yao2020fully . The integrated DPU achieves more than two orders of magnitude improvements in computing density and more than three orders of magnitude improvements in energy efficiency.
Limitations and future works
We have demonstrated the DPU-based opto-processor for effectively processing large-scale EEG signals, which can facilitate its applications in different areas. For example, in the brain-computer interface even2020power , the iEEG signal channel numbers are increasing from thousands to hundreds of thousand, placing high demand for high-performance computing processors. Furthermore, we have validated that the 1-channel EEG signals with the channel selection method have sufficiently high performance for epileptic seizure detection, i.e., only one electrode attached to the scalp is required for the acquisition system, facilitating its applications in wearable healthcare and personalized medicine. The volume of the free-space DPU can be smaller by designing the application-specific integrated circuits for EEG signal acquisition and dataflow control.
The reconfigurable free-space DPU includes millions of diffractive neurons, which can construct more complex neural networks architectures, such as the diffractive recurrent neural network zhou2021large for better performance in processing time series signals and different health monitoring tasks. The integrated implementation can be fabricated with deep ultraviolet lithography, which is highly compatible with the electronic integrated circuits. Reconfigurable non-volatile materials, such as phase change materials (PCM) feldmann2021parallel ; wu2021programmable , can be used to design the metalines with programmable network parameters and increase the flexibility. Although the 1-channel model is mainly considered in this article, more channels may be necessary for more complex tasks. The data throughput of the proposed EEG opto-processor can be further expanded based on wavelength division multiplexing (WDM) feldmann2021parallel ; xu202111 , and the optical processing of different channels can be accomplished at individual wavelengths.
In summary, we have demonstrated the successful use of DPU to construct photonic neural networks for EEG analysis and apply it for the epileptic seizure detection of EEG and iEEG signals with high performance. This work will inspire promising advances in using photonic computing for developing various healthcare devices.
4 Methods
Data preprocessing
The EEG recordings of 8 patients, each with sufficient length of seizure time duration (more than 400 seconds) and uniformly recording of 23 channels, were selected from the CHB-MIT dataset. The signals of seizures and randomly selected 2-hour non-seizures were used for evaluations. All the EEG signals were segmented into 1-second windows and randomly arranged. Half of the seizures and the non-seizures with the same duration were used for training, while the remaining data were used for testing. The channels of EEG signals were selected according to the random forest-based method, and the STFT was adopted to extract time-frequency-domain features for each time window. For the evaluation of free-space DPU, the frequency range of the STFT was set to 0-50 Hz, and the sliding window width was set to 51 samples. The spectral energy was normalized, and the 2D features were resized to pixels as the input of . For the evaluation of integrated DPU, each time window of 1-second signals was divided into four parts, and the energy of four spectral bands (0-6 Hz, 6-14 Hz, 14-22 Hz, 22-30 Hz) in each part were calculated to form a 1D feature with 16 attributes.
Similarly, the iEEG recordings of 6 patients with sufficient length of seizure time duration and clear onset and offset labels were selected from the Epilepsy-iEEG-Multicenter-Dataset. They were segmented using 5-second sliding windows with an overlap of 4 seconds and were further randomly arranged. The training and testing sets were divided in the same way as the EEG recordings. For the evaluation of free-space DPU, the frequency range of the STFT was set to 0-100 Hz due to the higher sampling frequency of the iEEG signals, and the sliding window width was set to half of the sampling frequency. For the evaluation of integrated DPU, each time window of 5-second signals was divided into five parts and four spectral bands, and a 1D feature with 20 attributes was generated.
Experimental system of the free-space DPU
The experimental system is shown in Fig. 1b and Supplementary Fig. 1. A compact green LED (CPS532, Thorlabs) coherent light source at the wavelength of 532 nm was used to generate the input optical field. The light beam is collimated and expanded by two lenses (AC050-008 and AC254-100, Thorlabs), polarized with a polarizer (LPVISA050, Thorlabs), and split with a beam splitter (CCM1-BS013, Thorlabs). An SLM (P1920-400-800, Meadowlark) modulates the phase of the wavefront according to the input information and the trained parameters of the . The optical field is captured and photoelectrically converted with a complementary metal–oxide–semiconductor (CMOS) sensor (GS3-U3-41C6M-C, Point Grey) after diffraction propagation of 10 cm. This process is multiplexed and programmed to construct an N-layer .
Modeling of the free-space DPU
The diffractive computing process can be represented as , where , , F, and denote the input, the trainable modulation coefficients, the transmission matrix of the free-space diffractive propagation, and the output of the -th layer of the , respectively. is fed to the SLM to modulate the phase of the light wavefront and is the light intensity acquired by the CMOS sensor. is the 2D feature map scaled to [0, 2] of the EEG or iEEG signals and is obtained from for via a nonlinear activation function, given as , where and are two trainable parameters. Finally, represents the output plane of the , and the target region with higher optical intensity indicates the epileptic seizure detection result. Supplementary Fig. 1 demonstrates the diffractive computing process of a 2-layer . The network diffractive modulation coefficients are trained with the pre-collected and labeled data. The mean squared error (MSE) between and the ground truth, i.e., 1 for the target detection region and 0 for the other, is defined as the loss function. The forward model of the is simulated based on angular spectrum propagation methods, and the errors are backpropagated to minimize the loss function via optimizing , , and by stochastic gradient descent algorithms.
Adaptive training process for the free-space DPU
To deal with the systematic errors, in the experiments of 2-layer , we first deploy the network parameters of the first layer with the pre-trained model and capture the experimental outputs. Then the modulation coefficients of the second layer are re-trained with the first layer’s experimental outputs to correct the first layer’s systematic errors. To address the systematic errors of the second layer, for two intensities of the detection regions obtained from the output plane of the after the experiments of the second layer, the intensity of first detector region was multiplied with a factor c within [0.9, 1.1]. was optimized to maximize the score on the training dataset, which was fixed in the inference process. This factor especially contributes to the errors caused by uneven light illumination.
Integrated DPU settings
The integrated DPU comprises a 1-layer metaline at the working wavelength of 1550 nm for the on-chip epileptic seizure detection. The height of the meta-atom is fixed at 400 nm and the slot period is 300 nm. The slot width is chosen from 0 or 100 nm to implement binary modulation, and the corresponding phase modulation coefficients are 0 or -1.55 rad (see Supplementary Fig. 5 and Fig. 6). There are 1800 meta-atoms for processing EEG or iEEG signals, and DPU width is 540 . The distance between the input plane and output plane is 200 , and the metaline is placed at the center. The input waveguides are placed with an interval of 15 , and the interval of two output waveguides is 270 .
Training details
All the simulation models were numerically implemented with Python (v3.6.13) and TensorFlow (v1.11.0) running on a desktop computer (Nvidia TITAN XP GPU, AMD Ryzen Threadripper 2990WX CPU with 32 cores, 128 GB of RAM, and the Microsoft Windows 10 operating system). The modulation coefficients of the diffractive layers were optimized via stochastic gradient descent and error backpropagation. The Adam optimizer kingma2014adam and a learning rate of 0.01 were used with the loss functions of mean squared error or cross-entropy. Each was trained with the epoch number of 1000. The training time of the free-space was 4 h, and that for the integrated model was 1 h.
Data, materials, and code availability All data needed to evaluate the conclusions are present in the article and/or the Supplementary Information.
Acknowledgments This work is supported by the National Key Research and Development Program of China (No. 2021ZD0109902 and No. 2020AA0105500), the National Natural Science Foundation of China (No. 62088102 and No. 62275139), and the Tsinghua University Initiative Scientific Research Program.
Authors’ contributions Q.D. and X.L. initiated and supervised the project. X.L. and T.Y. conceived the research. T.Y., X.L., M.Z., and X.C. designed the simulations and conducted the experiments. T.Y., X.L., M.Z., S.W., K.S., and H.Z. processed the data and analyzed the results. All authors prepared the manuscript and discussed the research.





References
- \bibcommenthead
- (1) Caulfield, H.J., Dolev, S.: Why future supercomputing requires optics. Nature Photonics 4(5), 261–263 (2010)
- (2) Craik, A., He, Y., Contreras-Vidal, J.L.: Deep learning for electroencephalogram (eeg) classification tasks: a review. Journal of neural engineering 16(3), 031001 (2019)
- (3) Schirrmeister, R.T., Springenberg, J.T., Fiederer, L.D.J., Glasstetter, M., Eggensperger, K., Tangermann, M., Hutter, F., Burgard, W., Ball, T.: Deep learning with convolutional neural networks for eeg decoding and visualization. Human brain mapping 38(11), 5391–5420 (2017)
- (4) Gao, Z., Dang, W., Wang, X., Hong, X., Hou, L., Ma, K., Perc, M.: Complex networks and deep learning for eeg signal analysis. Cognitive Neurodynamics 15(3), 369–388 (2021)
- (5) Shastri, B.J., Tait, A.N., de Lima, T.F., Pernice, W.H., Bhaskaran, H., Wright, C.D., Prucnal, P.R.: Photonics for artificial intelligence and neuromorphic computing. Nature Photonics 15(2), 102–114 (2021)
- (6) Wetzstein, G., Ozcan, A., Gigan, S., Fan, S., Englund, D., Soljačić, M., Denz, C., Miller, D.A., Psaltis, D.: Inference in artificial intelligence with deep optics and photonics. Nature 588(7836), 39–47 (2020)
- (7) Xu, X., Tan, M., Corcoran, B., Wu, J., Boes, A., Nguyen, T.G., Chu, S.T., Little, B.E., Hicks, D.G., Morandotti, R., et al.: 11 TOPS photonic convolutional accelerator for optical neural networks. Nature 589(7840), 44–51 (2021)
- (8) Even-Chen, N., Muratore, D.G., Stavisky, S.D., Hochberg, L.R., Henderson, J.M., Murmann, B., Shenoy, K.V.: Power-saving design opportunities for wireless intracortical brain–computer interfaces. Nature Biomedical Engineering 4(10), 984–996 (2020)
- (9) Wu, C., Yu, H., Lee, S., Peng, R., Takeuchi, I., Li, M.: Programmable phase-change metasurfaces on waveguides for multimode photonic convolutional neural network. Nature Communications 12(1), 1–8 (2021)
- (10) Feldmann, J., Youngblood, N., Karpov, M., Gehring, H., Li, X., Stappers, M., Le Gallo, M., Fu, X., Lukashchuk, A., Raja, A.S., et al.: Parallel convolutional processing using an integrated photonic tensor core. Nature 589(7840), 52–58 (2021)
- (11) Kulce, O., Mengu, D., Rivenson, Y., Ozcan, A.: All-optical synthesis of an arbitrary linear transformation using diffractive surfaces. Light: Science & Applications 10(1), 1–21 (2021)
- (12) Shen, Y., Harris, N.C., Skirlo, S., Prabhu, M., Baehr-Jones, T., Hochberg, M., Sun, X., Zhao, S., Larochelle, H., Englund, D., et al.: Deep learning with coherent nanophotonic circuits. Nature Photonics 11(7), 441–446 (2017)
- (13) Lin, X., Rivenson, Y., Yardimci, N.T., Veli, M., Luo, Y., Jarrahi, M., Ozcan, A.: All-optical machine learning using diffractive deep neural networks. Science 361(6406), 1004–1008 (2018)
- (14) Yan, T., Wu, J., Zhou, T., Xie, H., Xu, F., Fan, J., Fang, L., Lin, X., Dai, Q.: Fourier-space diffractive deep neural network. Physical Review Letters 123(2), 023901 (2019)
- (15) Zhou, T., Lin, X., Wu, J., Chen, Y., Xie, H., Li, Y., Fan, J., Wu, H., Fang, L., Dai, Q.: Large-scale neuromorphic optoelectronic computing with a reconfigurable diffractive processing unit. Nature Photonics 15(5), 367–373 (2021)
- (16) Antonik, P., Marsal, N., Brunner, D., Rontani, D.: Human action recognition with a large-scale brain-inspired photonic computer. Nature Machine Intelligence 1(11), 530–537 (2019)
- (17) Feldmann, J., Youngblood, N., Wright, C.D., Bhaskaran, H., Pernice, W.H.: All-optical spiking neurosynaptic networks with self-learning capabilities. Nature 569(7755), 208–214 (2019)
- (18) Bueno, J., Maktoobi, S., Froehly, L., Fischer, I., Jacquot, M., Larger, L., Brunner, D.: Reinforcement learning in a large-scale photonic recurrent neural network. Optica 5(6), 756–760 (2018)
- (19) Miscuglio, M., Hu, Z., Li, S., George, J.K., Capanna, R., Dalir, H., Bardet, P.M., Gupta, P., Sorger, V.J.: Massively parallel amplitude-only fourier neural network. Optica 7(12), 1812–1819 (2020)
- (20) Chang, J., Sitzmann, V., Dun, X., Heidrich, W., Wetzstein, G.: Hybrid optical-electronic convolutional neural networks with optimized diffractive optics for image classification. Scientific Reports 8(1), 1–10 (2018)
- (21) Tait, A.N., De Lima, T.F., Zhou, E., Wu, A.X., Nahmias, M.A., Shastri, B.J., Prucnal, P.R.: Neuromorphic photonic networks using silicon photonic weight banks. Scientific reports 7(1), 1–10 (2017)
- (22) Zuo, Y., Li, B., Zhao, Y., Jiang, Y., Chen, Y.-C., Chen, P., Jo, G.-B., Liu, J., Du, S.: All-optical neural network with nonlinear activation functions. Optica 6(9), 1132–1137 (2019)
- (23) LeCun, Y., Bengio, Y., Hinton, G.: Deep learning. Nature 521(7553), 436–444 (2015)
- (24) Williamson, I.A., Hughes, T.W., Minkov, M., Bartlett, B., Pai, S., Fan, S.: Reprogrammable electro-optic nonlinear activation functions for optical neural networks. IEEE Journal of Selected Topics in Quantum Electronics 26(1), 1–12 (2019)
- (25) Jha, A., Huang, C., Prucnal, P.R.: Reconfigurable all-optical nonlinear activation functions for neuromorphic photonics. Optics Letters 45(17), 4819–4822 (2020)
- (26) Yao, P., Wu, H., Gao, B., Tang, J., Zhang, Q., Zhang, W., Yang, J.J., Qian, H.: Fully hardware-implemented memristor convolutional neural network. Nature 577(7792), 641–646 (2020)
- (27) Waldrop, M.M.: The chips are down for moore’s law. Nature News 530(7589), 144 (2016)
- (28) Litt, B., Echauz, J.: Prediction of epileptic seizures. The Lancet Neurology 1(1), 22–30 (2002)
- (29) Siddiqui, M.K., Morales-Menendez, R., Huang, X., Hussain, N.: A review of epileptic seizure detection using machine learning classifiers. Brain Informatics 7, 1–18 (2020)
- (30) Daoud, H., Bayoumi, M.A.: Efficient epileptic seizure prediction based on deep learning. IEEE transactions on biomedical circuits and systems 13(5), 804–813 (2019)
- (31) Zhou, M., Tian, C., Cao, R., Wang, B., Niu, Y., Hu, T., Guo, H., Xiang, J.: Epileptic seizure detection based on eeg signals and cnn. Frontiers in neuroinformatics 12, 95 (2018)
- (32) Shoeb, A.H., Guttag, J.V.: Application of machine learning to epileptic seizure detection. In: ICML (2010)
- (33) Birjandtalab, J., Pouyan, M.B., Cogan, D., Nourani, M., Harvey, J.: Automated seizure detection using limited-channel EEG and non-linear dimension reduction. Computers in Biology and Medicine 82, 49–58 (2017)
- (34) French, J.A., Pedley, T.A.: Initial management of epilepsy. New England Journal of Medicine 359(2), 166–176 (2008)
- (35) Rahman, M.S.S., Li, J., Mengu, D., Rivenson, Y., Ozcan, A.: Ensemble learning of diffractive optical networks. Light: Science & Applications 10(1), 1–13 (2021)
- (36) Veli, M., Mengu, D., Yardimci, N.T., Luo, Y., Li, J., Rivenson, Y., Jarrahi, M., Ozcan, A.: Terahertz pulse shaping using diffractive surfaces. Nature Communications 12(1), 1–13 (2021)
- (37) Boonyakitanont, P., Lek-Uthai, A., Chomtho, K., Songsiri, J.: A review of feature extraction and performance evaluation in epileptic seizure detection using eeg. Biomedical Signal Processing and Control 57, 101702 (2020)
- (38) Li, M., Yao, J.: All-optical short-time fourier transform based on a temporal pulse-shaping system incorporating an array of cascaded linearly chirped fiber bragg gratings. IEEE Photonics Technology Letters 23(20), 1439–1441 (2011)
- (39) Xie, X., Li, J., Yin, F., Xu, K., Dai, Y.: STFT based on bandwidth-scaled microwave photonics. Journal of Lightwave Technology 39(6), 1680–1687 (2020)
- (40) Zhou, Z.-H., Liu, X.-Y.: Training cost-sensitive neural networks with methods addressing the class imbalance problem. IEEE Transactions on Knowledge and Data Engineering 18(1), 63–77 (2005)
- (41) Tzallas, A.T., Tsipouras, M.G., Fotiadis, D.I.: Epileptic seizure detection in eegs using time–frequency analysis. IEEE transactions on information technology in biomedicine 13(5), 703–710 (2009)
- (42) Tatum, W.O.: Ellen r. grass lecture: Extraordinary eeg. The Neurodiagnostic Journal 54(1), 3–21 (2014)
- (43) Goldberger, A.L., Amaral, L.A., Glass, L., Hausdorff, J.M., Ivanov, P.C., Mark, R.G., Mietus, J.E., Moody, G.B., Peng, C.-K., Stanley, H.E.: Physiobank, physiotoolkit, and physionet: components of a new research resource for complex physiologic signals. Circulation 101(23), 215–220 (2000)
- (44) Shoeb, A.H.: Application of machine learning to epileptic seizure onset detection and treatment. PhD thesis, Massachusetts Institute of Technology (2009)
- (45) Alotaiby, T., Abd El-Samie, F.E., Alshebeili, S.A., Ahmad, I.: A review of channel selection algorithms for eeg signal processing. EURASIP Journal on Advances in Signal Processing 2015(1), 1–21 (2015)
- (46) Breiman, L.: Random forests. Machine Learning 45(1), 5–32 (2001)
- (47) Kursa, M.B.: Robustness of random forest-based gene selection methods. BMC Bioinformatics 15(1), 1–8 (2014)
- (48) Powers, D.M.: Evaluation: from precision, recall and f-measure to roc, informedness, markedness and correlation. arXiv preprint arXiv:2010.16061 (2020)
- (49) Devarriya, D., Gulati, C., Mansharamani, V., Sakalle, A., Bhardwaj, A.: Unbalanced breast cancer data classification using novel fitness functions in genetic programming. Expert Systems with Applications 140, 112866 (2020)
- (50) Zhou, Z., Yin, B., Michel, J.: On-chip light sources for silicon photonics. Light: Science & Applications 4(11), 358–358 (2015)
- (51) Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014)
- (52) Li, A., Inati, S., Zaghloul, K., Crone, N., Anderson, W., Johnson, E., Cajigas, I., Brusko, D., Jagid, J., Claudio, A., Kanner, A., Hopp, J., Chen, S., Haagensen, J., Sarma, S.: ”Epilepsy-iEEG-Multicenter-Dataset”. https://doi.org/10.18112/openneuro.ds003029.v1.0.3
- (53) Zhang, Q., Yu, H., Barbiero, M., Wang, B., Gu, M.: Artificial neural networks enabled by nanophotonics. Light: Science & Applications 8(1), 1–14 (2019)
- (54) Yan, T., Yang, R., Zheng, Z., Lin, X., Xiong, H., Dai, Q.: All-optical graph representation learning using integrated diffractive photonic computing units. Science Advances 8(24), 7630 (2022) https://www.science.org/doi/pdf/10.1126/sciadv.abn7630. https://doi.org/10.1126/sciadv.abn7630
- (55) Wang, Z., Li, T., Soman, A., Mao, D., Kananen, T., Gu, T.: On-chip wavefront shaping with dielectric metasurface. Nature Communications 10(1), 1–7 (2019)
- (56) Wang, Z., Chang, L., Wang, F., Li, T., Gu, T.: Integrated photonic metasystem for image classifications at telecommunication wavelength. Nature Communications 13(1), 1–8 (2022)