- 1Saitama Institute of Technology, Saitama, Japan
- 2RIKEN Center for Advanced Intelligence Project (AIP), Tokyo, Japan
In real-time electroencephalography (EEG) analysis, the problem of observing dynamic changes and the problem of binary classification is a promising direction. EEG energy and complexity are important evaluation metrics in brain death determination in the field of EEG analysis. We developed two algorithms, dynamic turning tangent empirical mode decomposition to compute EEG energy and dynamic approximate entropy to compute EEG complexity for brain death determination. The developed algorithm is applied to analyze 50 EEG data of coma patients and 50 EEG data of brain death patients. The validity of the dynamic analysis is confirmed by the accuracy rate derived from the comparison with turning tangent empirical mode decomposition and approximate entropy algorithms. We evaluated the EEG data of three patients using the built diagnostic system. The experimental results visually showed that the EEG energy ratio was higher in a coma state than that in brain death, while the complexity was lower than that in brain death.
1 Introduction
Brain death is strictly defined as the complete, irreversible, and permanent loss of brain and brainstem function (Beecher, 1969). Previous research on the determination of brain death has focused on the field of clinical medicine. However, the clinical practice of brain death determination requires specialized physicians to perform a large number of rigorous compliance tests, including tests related to apnea tests that require the removal of the ventilator; there are certain risks in it and even cases of death have occurred (Marks and Zisfein, 1990). Therefore, it is crucial to use advanced signal-processing methods for electroencephalography (EEG) to provide reliable and objective scientific criteria that can support the clinical judgment in brain death determination.
Among the methods used to determine brain death from EEG signals, energy and complexity metrics are effective for EEG characterization and have shown excellent results in EEG signal classification, such as brain death determination (Shi et al., 2011) (Cao and Chen, 2008) and epilepsy detection (Sharma et al., 2018). To address these issues, empirical mode decomposition (EMD) (Huang et al., 1998), multivariate empirical mode decomposition (MEMD) (Rehman and Mandic, 2010) (Zahra et al., 2017), and turning tangent empirical mode decomposition (2TEMD) (Fleureau et al., 2010) of the intrinsic mode function (IMF) have been shown to be useful for extracting statistical features of EEG (Djemili et al., 2016). Some methods for analyzing complex signals have also been proposed for EEG analysis, complex empirical mode decomposition (CEMD) (Tanaka and Mandic, 2007), and improved eigenvalue decomposition of Hankel matrix–Hilbert transform (IEVDHM-HT) (Sharma and Pachori, 2018). 2TEMD shows the best overall performance among EMD, MEMD, and 2TEMD in processing EEG (Miao and Cao, 2017) and was more suitable for brain death determination. Complexity is a measure of the stochasticity of a time series. A higher complexity indicates greater randomness in the sequence. Approximate entropy (ApEn) (Pincus, 1991) is a stochastic complexity measure that describes the self-similarity of a time series in terms of patterns. It has been applied to EEG analyses, such as the analysis of sleep EEG data (Pincus, 1991). However, 2TEMD and ApEn cannot observe the changing process of EEG analysis. To address this limitation, dynamic 2TEMD and ApEn concepts are proposed (Miao and Cao, 2018).
In this paper, we have developed two algorithms, namely, D-2TEMD and D-ApEn, for the dynamic analysis of EEG signals. Comparing these algorithms with 2TEMD and ApEn algorithms, we have identified three key advantages: 1) Dynamic analysis can reduce noise and other effects, thereby improving the accuracy and reliability of the results. 2) Dynamic EEG analysis can help doctors observe changes in brain activity and assess and predict patients’ vital signs. 3) Real-time diagnosis systems based on dynamic algorithms can perform calculations while collecting EEG data, thereby saving time and reducing risk in patients. Based on D-2TEMD and D-ApEn algorithms, we have developed a real-time diagnostic aid system. We have demonstrated the efficacy of our system by performing binary classification of patients’ EEG as coma or brain death. Our analysis of EEG signals of a single patient involved analyzing the complexity and energy principles of EEG. We then applied the proposed system to analyze the EEG data of three patients obtained from the hospital. The patients comprised two typical cases in coma and brain death states and one special case from coma to brain death. Experimental results show that the overall trend in the distribution of EEG energy and complexity is evident in all three patients; although noise and other disturbances are present at a certain time point, it validated the effectiveness of the system and algorithm. Future studies can further validate the effectiveness of our system on a larger sample size. Additionally, there is a possibility of applying the system to other medical conditions.
2 D-2TEMD and D-ApEn algorithms
2.1 Developed D-2TEMD algorithm
The 2TEMD algorithm is a signal decomposition method that improves upon EMD. It extracts intrinsic mode functions by redefining the average trend of the signal and calculating the average envelope through interpolation between local extremal points. The IMF is then extracted using tangent line iteration. This specific process is shown in Figure 1.
The signal s is decomposed into a finite set of IMFs
We developed the D-2TEMD algorithm, which is the extended form of 2TEMD by introducing a time window, Δt, which serves as a computation step in 2TEMD. For each Δt, we computed IMFs and empirically removed the first four high-frequency residual signals (Miao et al., 2017). The remaining IMFs were then used to analyze the EEG data and obtain a dynamic distribution of EEG energy. EEG energy was defined as the product of the power specification value in the frequency band and the corresponding recording time. For a multivariate signal
1) Constructing an auxiliary function: We initialize the number of iterations j = 1, the number of IMFs i = 1, and the number of time steps k = 0.
2) Identifying local extrema: We compute the barycenter
3) Calculation of the mean envelope: The average signal trend is obtained by interpolating between the centers of oscillation of
4) Extracting IMFs: We subtract
Otherwise, the iteration steps from (2) to (4)are repeated.
5) Iterating to extract IMFs: We define
Otherwise, we repeat the iteration steps from (2) to (5).
6) We determine whether the elapsed time k ⋅Δt exceeds the end time T2; if it does, then the process moves toward the end, and the final decomposition result is as follows:
If it does not, we move the time window and repeat the steps from step 2 to step 6.
2.2 Developed D-ApEn algorithm
Complexity measures based on approximate entropy have shown good performance in the statistical characterization of EEG signals. High intensity and the absence of spontaneous brain activity from quasi-brain-death EEG can be obtained by power spectral pattern analysis. It appears to have potential applications in a wide variety of physiological and clinical time series data. ApEn is a measure of the regularity or predictability of a time series. The ApEn statistics of a time series measure the logarithmic probability that runs on patterns of length m that are close to each other and will also remain close in the next incremental comparison m + 1 (Pincus and Goldberger, 1994). A higher probability of remaining close (with high regularity) results in a lower ApEn value and vice versa. Approximate entropy analysis is only carried out for a segment of the data and does not reflect the approximate entropy change process for the entire measurement time.
We consider a sequence A(1,2 … ,N), for computing the ApEn (A, m, and r) (A: N-m+1, m: length of the vector series, and r: tolerance parameter) of that sequence, and let D (i, j) denote the distance between two vectors v(i) and v(j) (i and j ≤ N-m+1), which is defined as the maximum difference in scalar components of v(i) and v(j).
We define Cm,r(i), which is the probability of finding a vector that differs from v(i) by less than distance r. Also, ϕm,r, the natural logarithmic average over all the vectors of the Cm,r(i) probability is as follows:
For m + 1, we repeat the aforementioned steps and compute ϕm+1,r. The ApEn statistics is given by the following:
ApEn is only evaluated for a specific segment of the signal and does not reflect the process of approximate entropy change. ApEn is susceptible to high-frequency electron interference present in real recorded EEG signals. Therefore, to ensure the accuracy and reliability of ApEn in full-frequency EEG signals, the D-ApEn algorithm is used, which is an extension of the existing ApEn algorithm by introducing a time variable Δt, which extends the existing ApEn analysis method on the time axis to obtain the dynamic approximate entropy algorithm (Shi et al., 2010). It can reflect the dynamic complexity changes throughout the recording time and avoid the loss of detailed information. This specific algorithm is as follows:
For a time series A(Δt) of time length T, (Δt = 1, - - -, N) unit in seconds, in order to compute ApEn(A(Δt), m, and ɛ),
For this sequence, a vector sequence of length m, vΔt(i) and vΔt(j), is first constructed from the signal sample A (Δt).
We let
For a given threshold ɛ and vector vΔt(i), when j ≤ N − m + 1, the number of vectors vΔt(i) whose distance from vΔt(j) is less than ɛ is calculated, and then,
Repeating the aforementioned steps for m + 1 and computing ϕm+1 (ɛ, Δt), D-ApEn is given as follows:
2.3 EEG energy and complexity based on D-2TEMD and D-ApEn
The D-2TEMD algorithm introduces a time window of length Δt, where Δt is a controllable parameter, shown in Figure 2. In this experiment, Δt is 1 s (i.e., 1000 sampling rate). For this time, we have designed a loop where one EEG with one Δt step is processed and stored. Also, as the time window and time step were sliding, EEG data were analyzed by applying D-2TEMD and D-ApEn algorithms to obtain the dynamic EEG energy distribution and dynamic complexity distribution in the time domain.
We compared brain death determination algorithms based on EEG energy and complexity. In the comparison, we randomly selected 140 EEG datasets from 36 cases to ensure data uniformity. These included 70 coma patients and 70 brain death patients, as diagnosed by medical professionals. We randomly selected 20 EEG datasets as a standard and used the remaining 100 EEG datasets to calculate energy and complexity using 2TEMD, ApEn, D-2TEMD, and D-ApEn methods to derive accuracy measures. The EEG data were collected at a hospital in Shanghai, China, between June 2004 and March 2006, with the permission of the patients’ families. A portable EEG system (NeuroScan ESI) was used and a total of nine electrodes were selected for the examination, six exploratory electrodes (Fp1, Fp2, F3, F4, F7, and F8) were placed on the forehead, and two electrodes (A1 and A2) were placed on the earlobes as a reference, as shown in Figure 3. The EEG sampling rate was 1000 Hz, and the electrode resistance was set to less than 8 kΩ. The EEG data were supervised by a neurologist and performed by medical personnel.
FIGURE 3. International 10–20 standard system electrode position distribution map (red-colored ones are the channels used in this experiment).
The 2TEMD algorithm calculates the average energy per second. m and r of the ApEn algorithm are 1000 and 1, respectively. Δt for the dynamic analysis is 1 s. We analyzed the EEG data of 20 coma patients and found the EEG energy per second ranging from 1.8 × 104 ∼ 1.8 × 105, with a complexity of about 0.3. We also analyzed the EEG data of 20 patients in a quasi-brain-dead state and found the EEG energy per second ranging from 6.2 × 103 ∼ 8 × 103, with a complexity of about 1.1. We calculated the accuracy of the remaining 100 data points using the following criteria, as shown in Table 1.
TABLE 1. Comparison of four EEG brain death determination methods: 2TEMD, ApEn, D-2TEMD, and D-ApEn.
Energy calculation using the 2TEMD algorithm, due to its reliance on a significant number of matrix operations, exhibits computational inefficiencies when processing longer time series data. Specifically, the processing time required to analyze 120 s of EEG data using the 2TEMD algorithm that exceeds 800 s, while the D-2TEMD algorithm requires a comparatively shorter processing time of approximately 500 s.
3 Implementation of the real-time diagnosis system
3.1 Hardware structure
The system we designed consists of an EEG data acquisition device and a laptop computer. The system connections are shown in Figure 4. For the determination of brain death, the accuracy of EEG extraction is of utmost importance and the accuracy of EEG extraction is of paramount importance. Therefore, we use g.Nautilus as the experimental device. It has international standard electrode caps, more channels for us to choose from, and relatively higher measurement accuracy. Data acquisition and processing are performed in a laptop computer connected to the g.Nautilus electrode cap through the g.Nautilus unlimited-communication device.
3.2 System software design
The GUI we designed for this diagnostic system is shown in Figure 5; the top right corner can define the subject’s name and time of this acquisition, the “Recording” button is used to open the system framework and start the acquisition of EEG, and we click the “Analysis” button to start the analysis and display of the EEG data. The upper axial plot shows the raw EEG signal for each channel. The middle plot dynamically displays the average energy of all channels based on the results of D-2TEMD calculations. Each point represents the average energy per unit time Δt. The energy baselines for coma and brain death are set based on reference values calculated separately from the EEG data of 20 coma patients and 20 brain death ones, each obtained from the hospital. Finally, the axial plot at the bottom shows the average complexity of all channels, with each point representing the average complexity of Δt.
4 Experiment results
The EEG data used to calculate the criteria for coma and brain death groups, with 20 patients each, showed an average energy analysis of 1.8 × 104 and 4.96 × 103 per second, respectively, for six channels, represented as two straight lines through the GUI window. The patients were divided into coma, brain death, and from coma to brain death groups. Each point of energy and complexity in the GUI represents the average energy and complexity of the EEG data for the six channels in 1 s. We considered the average energy converging to 1.8 × 104 and the average complexity converging to 0.3 in the coma group, and the average energy converges to 4.96 × 103 and the average complexity converges to 1.1 in the brain death group. The results of the three sets of experiments are as follows.
The results of EEG analysis calculated by the diagnostic system are shown in Figure 6. GUI shows the original EEG data, the calculated EEG energy after D-2TEMD, and the distribution of EEG complexity calculated by D-ApEn, which shows the characteristics of EEG from all aspects and determines the EEG state. The top coordinate system is the original six-channel EEG signal, and the other two coordinate systems are the six-channel average energy and six-channel average complexity after classification by the binary classification method. The results of the analysis showed that the dynamic energy range of EEG of coma patients was 1.8 × 104 ∼ 3 × 104 and the complexity ranged from 0 to 0.5. This is consistent with our rules for determining the characteristics of the coma state. Figure 7 shows the results of the EEG analysis of a brain death patient. This result shows that the overall dynamic EEG energy in the brain death state is close to 4.96 × 103, and the complexity distribution is between 1 and 1.5. This is consistent with our rules for determining the characteristics of the brain death state. Figure 8 shows the results of a particular EEG analysis. A few days earlier, the dynamic energy range of EEG of coma patients was 1.8 × 104 ∼ 3 × 104 and the complexity distribution was between 0 and 0.5. A few days later, the overall dynamic EEG energy in the brain death state is close to 4.96 × 103 and the complexity distribution was between 1 and 1.5. This is consistent with the rules we used to determine the characteristics of the coma and brain death state. It is worth noting that the results of the analysis during brain death occasionally fluctuated based on finding cases where it was known that drug resuscitation was used at that time.
Experimental results show that the more pronounced the brain activity, the higher the EEG energy. Also, the lower the complexity, the lower the probability that the sequence will generate new patterns and it has a certain regularity and predictability. Therefore, it can be inferred that there was brain activity in the coma group, while there was almost no brain activity in the brain death group because the dynamic EEG energy distribution was significantly higher in the coma group than that in the brain death group. Furthermore, it can be inferred that brain activity rhythms were present in the EEG of the coma group, while almost disordered noise was present in the EEG of the brain death group because the complexity distribution was lower in the coma group than that in the brain death group. In addition, dynamic distribution can provide more accurate and reliable results compared to 2TEMD and ApEn. The dynamic analysis of the diagnostic system also provides a reference point for physicians by showing the process of changes in a patient’s physical characteristics. The diagnostic system may be less friendly to physicians who are not specialized in EEG signal processing, and we hope to generate a clearer and more understandable index to help physicians determine brain death in future studies.
5 Conclusion
In this paper, we develop new algorithms, D-2TEMD and D-ApEn, for the real-time EEG analysis, which can achieve EEG dynamic analyses by introducing time windows. Using the accuracy metric, they are shown to have a high degree of validity and robustness in calculating the energy and complexity changes of EEG. Our results show that D-2TEMD can easily discriminate coma and brain death patients based on the significant differences in EEG energy values. D-ApEn has an extremely high regularity and predictability, with a strong periodicity of intracerebral activity in coma patients and a complexity close to 0, a weak intracerebral activity in coma patients, mainly due to noise superposition, and a complexity close to 1 in brain-dead EEG. Our experiments further validate the effectiveness of D-2TEMD and D-ApEn algorithms, even if the results are affected by noise, etc., but the overall trend is clear. The system also includes the ability to classify other EEG signals, such as healthy subjects, sleep, and anesthesia, when sufficient sample data are available. The metrics of this system may be more complex for physicians who are not familiar with the EEG analysis. In the future, we will provide a simpler and more understandable index to assist physicians in determining brain death.
Data availability statement
The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.
Ethics statement
The studies involving human participants were reviewed and approved by the Human Ethics Committee of Saitama Institute of Technology. The patients/participants provided their written informed consent to participate in this study.
Author contributions
All authors listed have made a substantial, direct, and intellectual contribution to the work and approved it for publication.
Funding
This work was supported by JSPS KAKENHI (Grant Nos. 18K04178 and 20H04249).
Conflict of interest
The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
Publisher’s note
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors, and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.
References
Beecher, H. K. (1969). After the definition of irreversible coma. New Engl. J. Med. 281, 1070–1071. [Dataset]. doi:10.1056/NEJM196911062811909
Cao, J., and Chen, Z. (2008). Advanced EEG signal processing in brain death diagnosis. Boston, MA: Springer US.
Djemili, R., Bourouba, H., and Korba, M. A. (2016). Application of empirical mode decomposition and artificial neural network for the classification of normal and epileptic eeg signals. Biocybern. Biomed. Eng. 36, 285–291. doi:10.1016/j.bbe.2015.10.006
Fleureau, J., Nunes, J.-C., Kachenoura, A., Albera, L., and Senhadji, L. (2010). Turning tangent empirical mode decomposition: A framework for mono-and multivariate signals. IEEE Trans. signal Process. 59, 1309–1316. doi:10.1109/TSP.2010.2097254
Huang, N. E., Shen, Z., Long, S. R., Wu, M. C., Shih, H. H., Zheng, Q., et al. (1998). The empirical mode decomposition and the hilbert spectrum for nonlinear and non-stationary time series analysis. Proc. R. Soc. Lond. Ser. A Math. Phys. Eng. Sci. 454, 903–995. doi:10.1098/rspa.1998.0193
Marks, S. J., and Zisfein, J. (1990). Apneic oxygenation in apnea tests for brain death a controlled trial. Archives neurology 47, 1066–1068. doi:10.1001/archneur.1990.00530100028009
Miao, Y., and Cao, J. (2017). “Comparison of emd, memd and 2t-emd by analyzing standard artificial signals and eeg,” in Proceeding of the 2017 International Joint Conference on Neural Networks (IJCNN), Anchorage, AK, USA, May 2017 (IEEE), 1367–1371.
Miao, Y., and Cao, J. (2018). “Patients’ eeg analysis based on multi-indicator dynamic analysis measure for supporting brain death determination,” in Proceeding of the Advances in Neural Networks–ISNN 2018: 15th International Symposium on Neural Networks, ISNN 2018, Minsk, Belarus, June 25–28, 2018 (Springer), 824–833. Proceedings 15.
Miao, Y., Wang, D., Cui, G., Zhu, L., and Cao, J. (2017). Analyzing patients’ eeg energy for brain death determination based on dynamic 2t-emd. Int. J. 16, 7573–7580. doi:10.24297/ijct.v16i1.5934
Pincus, S. M. (1991). Approximate entropy as a measure of system complexity. Proc. Natl. Acad. Sci. 88, 2297–2301. doi:10.1073/pnas.88.6.2297
Pincus, S. M., and Goldberger, A. L. (1994). Physiological time-series analysis: What does regularity quantify? Am. J. Physiology-Heart Circulatory Physiology 266, H1643–H1656. doi:10.1152/ajpheart.1994.266.4.H1643
Rehman, N., and Mandic, D. P. (2010). Multivariate empirical mode decomposition. Proc. R. Soc. A Math. Phys. Eng. Sci. 466, 1291–1302. doi:10.1098/rspa.2009.0502
Sharma, R. R., and Pachori, R. B. (2018). Eigenvalue decomposition of hankel matrix-based time-frequency representation for complex signals. Circuits, Syst. Signal Process. 37, 3313–3329. doi:10.1007/s00034-018-0834-4
Sharma, R. R., Varshney, P., Pachori, R. B., and Vishvakarma, S. K. (2018). Automated system for epileptic eeg detection using iterative filtering. IEEE Sensors Lett. 2, 1–4. doi:10.1109/lsens.2018.2882622
Shi, Q., Cao, J., Zhou, W., Tanaka, T., and Wang, R. (2010). “Dynamic extension of approximate entropy measure for brain-death eeg,” in International symposium on neural networks (Springer), 353–359.
Shi, Q., Yang, J., Cao, J., Tanaka, T., Wang, R., and Zhu, H. (2011). Eeg data analysis based on emd for coma and quasi-brain-death patients. J. Exp. Theor. Artif. Intell. 23, 97–110. doi:10.1080/0952813x.2010.506289
Tanaka, T., and Mandic, D. P. (2007). Complex empirical mode decomposition. IEEE Signal Process. Lett. 14, 101–104. doi:10.1109/lsp.2006.882107
Keywords: EEG data analysis, dynamic, 2TEMD, ApEn, real time, diagnostic system
Citation: Zhang R, Sui L, Gong J and Cao J (2023) EEG-based real-time diagnostic system with developed dynamic 2TEMD and dynamic ApEn algorithms. Front. Physiol. 14:1165450. doi: 10.3389/fphys.2023.1165450
Received: 14 February 2023; Accepted: 26 April 2023;
Published: 11 May 2023.
Edited by:
Ming Huang, Nara Institute of Science and Technology (NAIST), JapanReviewed by:
Rishi Raj Sharma, Defence Institute of Advanced Technology (DIAT), IndiaRajesh Kumar Tripathy, Birla Institute of Technology and Science, India
Copyright © 2023 Zhang, Sui, Gong and Cao. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.
*Correspondence: Jianting Cao, cao@sit.ac.jp