БИОФИЗИКА И МЕДИЦИНСКАЯ ФИЗИКА
Известия Саратовского университета. Новая серия. Серия: Физика. 2024. Т. 24, вып. 3. С. 209-215
Izvestiya of Saratov University. Physics, 2024, vol. 24, iss. 3, pp. 209-215
https://fizika.sgu.ru https://doi.org/10.18500/1817-3020-2024-24-3-209-215, EDN: HKYBMM
Article
Application of machine learning and statistics to anaesthesia detection from EEG data
T. R. Bogatenko0, K. S. Sergeev, G. I. Strelkova
Saratov State University, 83 Astrakhanskaya St., Saratov 410012, Russia
Tatiana R. Bogatenko, [email protected], https://orcid.org/0000-0002-4007-7649 Konstantin S. Sergeev, [email protected], https://orcid.org/0000-0002-5605-5700 Galina I. Strelkova, [email protected], https://orcid.org/0000-0002-8667-2742
Abstract. Background and Objectives: The purpose of the research is to establish whether it is possible to determine the degree of anaesthesia that a laboratory animal is experiencing noninvasive^. For this objective the usage of such methods of electroencephalogram (EEG) signal analysis as fast Fourier transform, K-Means machine learning method and statistical analysis is discussed. Models and Methods: The EEG data was obtained through an experiment where two groups of laboratory rats received different types of anaesthetic agent. The EEG data was normalised, then the power spectra were computed usingfast Fourier transform. Next, the K-Means method was applied to classify the data in accordance with the anaesthesia degree. Statistical analysis was also conducted to describe prominent characteristics of each stage. Results: It has been shown that the proposed data analysis methods allow to distinguish between normal state, anaesthesia, and death with increasing anaesthesia dosages in laboratory animals. Keywords: EEG signal, data analysis, statistical analysis, machine learning Acknowledgements: The research was supported by IDEAS Research Centre scholarship (No. АСП-09-2021/I). The research was partially conducted within the Megagrant (project No. 075-152022 (075-15-2019-1885)).
For citation: Bogatenko T. R., Sergeev K. S., Strelkova G. I. Application of machine learning and statistics to anaesthesia detection from EEG data. Izvestiya of Saratov University. Physics, 2024, vol. 24, iss. 3, pp. 209-215. https://doi.org/10.18500/1817-3020-2024-24-3-209-215, EDN: HKYBMM
This is an open access article distributed under the terms of Creative Commons Attribution 4.0 International License (CC-BY 4.0)
Научная статья УДК 577.35
Применение методов машинного обучения и статистических методов для выявления стадии анестезии по данным ЭЭГ
Т. Р. Богатенко0, К. С. Сергеев, Г. И. Стрелкова
Саратовский национальный исследовательский государственный университет имени Н. Г. Чернышевского, Россия, 410012, г. Саратов, ул. Астраханская, д. 83
Богатенко Татьяна Романовна, инженер и аспирант кафедры радиофизики и нелинейной динамики, [email protected], https://orcid.org/0000-0002-4007-7649 Сергеев Константин Сергеевич, кандидат физико-математических наук, доцент кафедры радиофизики и нелинейной динамики, [email protected], https://orcid.org/0000-0002-5605-5700
Стрелкова Галина Ивановна, доктор физико-математических наук, доцент, заведующий кафедрой радиофизики и нелинейной динамики, [email protected], https://orcid.org/0000-0002-8667-2742
НАУЧНЫЙ ОТДЕЛ
Аннотация. Объект исследования, цель: Целью исследования является установление возможности неинвазивного определения степени анестезии, которой подвергается лабораторное животное. Для достижения этой цели предлагается использование таких методов анализа сигналов электроэнцефалограммы (ЭЭГ), как быстрое преобразование Фурье, метод машинного обучения K-Means и расчёт статистических характеристик. Модель и методы: Данные ЭЭГ были получены в результате эксперимента, в котором две группы лабораторных крыс получали два различных вида анестетика. Данные ЭЭГ были нормированы, после чего при помощи метода БПФ были вычислены спектры мощности сигналов. Далее для классификации данных и определения стадии анестезии применялся метод машинного обучения K-Means. Также были рассчитаны статистические характеристики для выявления характерных особенностей сигналов на каждой стадии анестезии. Результаты: Показано, что предложенные методы анализа данных позволяют различить нормальное состояние, анестезирование и летальный исход при повышении дозировки анестезии у лабораторных животных. Ключевые слова: ЭЭГ сигнал, анализ данных, статистический анализ, машинное обучение
Благодарности: Исследование выполнено при финансовой поддержке фонда Идея (проект № АСП-09-2021/1). Исследование частично проведено в рамках Мегагранта (проект № 075-15-2022 (075-15-2019-1885).
Для цитирования: Bogatenko T. R., Sergeev K. S., Strelkova G. I. Application of machine learning and statistics to anaesthesia detection from EEG data [Богатенко Т. Р., Сергеев К. С., Стрелкова Г. И. Применение методов машинного обучения и статистических методов для выявления стадии анестезии по данным ЭЭГ] // Известия Саратовского университета. Новая серия. Серия: Физика. 2024. Т. 24, вып. 3. С. 209-215. https://doi.org/10.18500/1817-3020-2024-24-3-209-215, EDN: HKYBMM
Статья опубликована на условиях лицензии Creative Commons Attribution 4.0 International (CC-BY4.0)
Introduction
Anaesthesia has been an intrinsic element of surgeries since 1840s when diethyl ether was first used to induce general anaesthesia for a patient who was going through a neck tumour removal [1]. The use of anaesthesia results in electric and biochemical changes in the nervous system which are manifested in con-tollable pain relief, loss of consciousness and reflexes of autonomic nervous system. However, there has been evidence of potential dangers of anaesthesia. Numerous studies report of potential risks for infants [2], neuroinflammation [3], and other functional brain changes [4, 5]. Having these facts in mind, being able to track a patient's condition during anaesthesia is crucial for keeping their health and body parameters in a satisfactory condition. For this reason, scientific groups from many countries have been proposing novel methods for keeping track of various parameters during anaesthesia [6, 7].
Meanwhile, the modern world offers a wide range of cutting-edge technologies for use in medicine, one of them being artificial intelligence (AI). Nowadays AI has received multiple applications in medicine and health care, ranging from mere managing medical data and providing digital consultation to assisting in drug development and medical treatment [8]. So, it seems reasonable to seek helpful methods of controlling anaesthesia degree among approaches of machine learning and artificial intelligence [9, 10].
Thus, the main purpose of this work is to establish if it is possible to use a simple K-Means machine learning method to classify electroencephalogram (EEG) data in accordance with the state of anaesthesia a laboratory animal is experiencing. In the work we also use statistical characteristics to determine the properties of EEG signals for each of the various states.
Subject and Methods
In the paper we propose a non-invasive approach for determining different stages of anaesthesia in laboratory rats. The research is based on the electroencephalogram (EEG) data from two groups of laboratory rats. During the experiment, for each animal two-channel cortical EEG were recorded; each record is approximately 3 hour long. The design of the experiment is carefully described in the paper [9].
We consider two-channel 200 Hz EEG data from two groups of adult male Wistar rats consisting of 7 animals each. Animals of one group experienced drug anaesthesia, and the animals of another group underwent the influence of gas anaesthesia (isoflurane). Each animal underwent three stages consecutively: 1) normal state with no anaesthetic agent; 2) anaesthesia with general concentration of isoflurane (1%) or drug; 3) anaesthesia with lethal dose of isoflurane (4%) or drug. The initial data are represented as time series.
Each record was normalised as follows:
Xi X a (x) '
(1)
where xnorm is a normalised time series, Xj is an individual element of the initial time series array, X is a mean value of the array, and a(x) is a standard deviation of the array. Next, each normalised record was divided into a set of M much shorter records 120 seconds each, so each short part x120, j was an array of 24000 elements, j = 1,...,M. For each x120, j power spectra Fj were computed using the Fast Fourier Transform (FFT) method with Octave's built-in function. Thus, a set of resulting spectra Fj is the outcome of computing FFT of the xnorm series with a square window of 120 seconds (the size of the window was chosen empirically). Next, in each spectrum
x
Fj, five frequency ranges for five brain waves were identified: theta (0-4 Hz), delta (4-8 Hz), alpha (814 Hz), beta (14-40 Hz) and gamma (40-100 Hz). Then for each range r = 0,8, a, Y dimensionless energy Wr,j was computed by summing all the power spectrum values within a range:
jrN
Wrj = £ Fj, (2)
j=jrc
where jr0 and jrN correspond to numbers of first and last numbers of harmonics which belong to the frequency range r in an array Fj. This way we obtain five numbers Wrj for each x120, j, j = 1,---,M, for each EEG recording. The dependence of Wr,j on j = = 1, . . . , M can be interpreted as time series of each wave's during the experiment. This approach allows to trace each wave's behaviour at each stage of the experiment and see the changes in their dynamics easily.
The calculations were conducted with the use of Octave software, including Octave's built-in functions for computing mean values, standard deviation and FFT [11-12]. The figures were plotted with graphic means of Octave software.
K-Means Classification
K-Means algorithm is an unsupervised machine learning method which is used to divide a set of multiple observations into several clusters in accordance with the features inherent in the clusters. In the beginning cluster's centres (centroids) are defined randomly, and the observations are assigned to the centroids randomly. Then, at each step variance between observations and centroids is computed, and the algorithm is aimed at minimizing this variance, ending in finding the prominent clusters and assigning the closest observations to them.
In this paper the K-Means algorithm was fed with the processed EEG data, namely time series of di-mensionless energy, and it was expected to partition the data into three clusters which would represent the three states: "a rat in normal state", "a rat under normal anaesthesia", and "a rat under lethal anaesthesia". In order to evaluate how successful the algorithm is in partitioning the data, the clustering error was computed as follows:
E = ltrec -tKM 1 • 100%, (3)
where trec, sec, is an actual recorded time point of anaesthetic introduction, tKM, sec, is such time point defined by the K-Means algorithm, and T, sec, is the time series length. Clustering cases with an error E
of less than 5% of the signal length were regarded as successful, and cases with an error E of more than 5% were treated as failed ones. The results obtained are depicted in Fig. 1 and Fig 2.
In the Figs. 1 and 2, the data points are shown in three different colours which depict the state of anaesthesia: green represents normal state, yellow stands for normal anaesthesia, and red depicts lethal anaesthesia. Time stamps of anaesthetic introduction are shown with vertical lines, solid lines show actual time points of anaesthetic introduction in the experiment, while dashed ones show the time points defined by the K-Means algorithm.
Figure 1 shows some of the most remarkable and fine cases of clustering. In these the time stamps when the anaesthetic was introduced are close (E < 5%) to the time stamps that the K-Means algorithm defined as the borders of the clusters. Figures 1, a, 1, b, and 1, c show the results for clustering in drug anaesthesia records. While for both these cases the error was less than 5%, one can see from the figures that the solid and vertical lines, which essentially represent the cluster borders, are close to each other. For gas anaesthesia (Fig. 1, d) the results are generally slightly worse, however, they still satisfy the condition of the error.
Failed cases are illustrated in Fig. 2. In these the error was more than 5%, and this can be visible from the figures as well (Fig. 2, a). This kind of inaccuracies might be explained by the individual reaction to the anaesthetic agent: in some records brain wave energy values change instantly at the anaesthetic introduction, while for others there is a delay in the response (see below). Figure 2, b also shows a poor case of clustering since there is an area where data points from two clusters are mixed and it is hard to certainly define the borders of these clusters. Generally, in this research there were more failed cases for EEG signals from the group which received gas anaesthesia than from the group which received drug anaesthesia. This might be connected with the quality of the EEG records and with the fact that it might have been harder to control the animals' behaviour during the experiment.
Still, in the end, we can state that the proposed approach of using the K-Means method works for determining the stage of anaesthesia in the experiment.
Statistical Analysis
The abovementioned approach to data processing allows to identify the frequency changes in spectra of the signals as the concentration of the anaesthetic agent changes. This part of research was
Time, sec
c
d
Fig. 1. Examples of successful cases (with E < 5%) of clustering of data for drug (a-c) and for gas anaesthesia (d). Colour code: green dots - normal state, yellow dots - normal anaesthesia, red dots - lethal anaesthesia. Solid vertical lines represent actual time points of anaesthetic introduction, dashed vertical lines show such time points defined by the algorithm (color online)
1 1 1 1 т 1 1 1 1 1 ■ 1 1 1
■•л-.— 1
- ■*""' f • ' i .V ° | i 1 1 i
i j
V* ... 1
4000 6000
Time, sec
"300000
i i i i i i i i i , i i i _ i . ' i *i
*' s ; • l ■ •j . ■ T •
i ■ t-v >:;..,
■ . i " ■•ва»»'
'*!■.....................
2000 4000 6000
Time, sec
b
Fig. 2. Examples of failed cases (E > 5%) of clustering of data for drug (a) and for gas anaesthesia (b). Colour code: green dots - normal state, yellow dots - normal anaesthesia, red dots - lethal anaesthesia. Solid vertical lines represent actual time points of anaesthetic introduction, dashed vertical lines show such time points defined by the algorithm (color online)
a
conducted for the drug anaesthesia group only due to the quality of the EEG data provided.
For time series of each dimensionless brain wave energy mean values and standard deviation were computed with the use of Octave's built-in functions.
Figure 3 shows the results for three chosen EEG records. The time series of brain wave energies for three chosen records are shown in the first row, while the comparisons of mean values and standard deviation are placed in the second and third rows respectively. Vertical lines in Fig. 3, a-c show the time stamps of the anaesthetic introduction. From the figures the following observations can be made.
Firstly, the delta and beta waves have the greatest intensity throughout the entire experiment, and the beta wave is more intense than the delta wave during the first stage with no anaesthesia. But with
the introduction of a dose of an anaesthetic agent the picture changes qualitatively: the intensity of the beta wave becomes less than the intensity of the delta wave. Besides, one can notice bursts of wave intensity in the vicinity of time stamps when doses of anaesthetic agent were introduced. It is noteworthy that these bursts are most noticeable for gamma, delta, and beta waves.
The findings correspond with what is known about the brain waves. Beta rhythm is associated with waking consciousness [13], while delta waves are usually connected with a deep stage of NREM sleep [14].
It is also worth noting that in the Record 1 the energy values change immediately at the anaesthetic introduction, while for Records 2 and 3 the response of the nervous system occurs with a small delay. The response seems to be highly individual, and it may
Record 1
Record 2
Record 3
g
Fig. 3. Brain wave energies of three different EEG records (first row) and comparison of power spectra mean values (second row) and standard deviations (third row) for each brain wave for the three records. In the realisations of brain wave energy, colour represents a type of brain wave: delta (blue), theta (orange), alpha (yellow), beta (purple), and gamma (green). In the mean value diagrams, colour stands for anaesthesia stage: light (green), deep (blue), and lethal (orange). Likewise, in the STD diagrams: light anaesthesia (green), deep anaesthesia (orange), and lethal anaesthesia (purple) (color online)
be the reason why the K-Means algorithm failed at defining the cluster borders in some of the data sets.
For alpha and theta waves similar gradual changes can be seen throughout the experiment, although they are not the most pronounced. The reason for this may lie in the function of the waves: alpha waves are seen in waking consciousness and dreaming [15, 16], and theta waves are considered to be active in the process of memory formation [17, 18].
The gamma wave has the lowest intensity throughout the entire experiment for all records, as expected due to the wave's function [19, 20]. It is curious to notice that the intensity of gamma waves experiences sudden peaks at the very end of some records (Fig. 3, c). Several studies have discussed a similar behaviour of gamma waves in the moments preceding death in mammals [21, 22].
Figure 3, d-i illustrate the comparison of mean values and standard deviation of waves' energy values for the three records, which generally confirm the abovementioned conclusions about the waves' behaviour. For example, mean values (Fig. 3, d-f) are coherent throughout the records: delta wave energy peaks at normal anaesthesia stage, while other waves' energy declines as the anaesthetic concentration grows. However, the data also show some differences in response across the records, which is clearly seen in standard deviation dependencies (Fig. 3, g-i).
Figure 4 shows comparison of mean values across all the records of the experiment for each of the five brain waves. In all, delta and beta waves remain the most informative waves and sensitive to the anaesthetic concentration. It is important to note that the obtained data are qualitatively consistent across most of the records, however, there are several
I light anaesthesia I deep anaesthesia I Д lethal anaesthesia
n>i_
delta theta alpha beta gamma
Brain Wave
Fig. 4. Comparison of power spectra mean values for each brain wave across all the EEG records (color online)
records that vary due to the individual reactions of animals, and the results may differ for other records in other experiments.
Discussion and Conclusion
In the paper we have proposed a machine learning based approach for determining the state of anaesthesia using the EEG data. We found that the unsupervised machine learning algorithm K-Means is able to partition the EEG data provided into the three clusters according to the following stages: normal state, mild anaesthesia and lethal anaesthesia. Using statistical analysis, we have also shown that the proposed data analysis method allows to expose consistency in the features of all the EEG records considered. Besides, it was shown that such simple method as the K-Means algorithm is sufficient for solving the task and determining the state of anaesthesia by the EEG data. It was also shown that computing such statistical characteristics as mean value and standard deviation on the obtained data set is effective and helpful in determining key characteristics and the behaviour of brain waves on each step of the experiment.
To conclude, we believe it is possible to use the discussed methods for human EEG analysis. The results obtained have a potential to be valuable for bio-medical purposes of determining the anaesthesia stage in scientific experiments or during medical procedures. In addition, the results may be valuable for assisting in cortical brain death detection.
References
1. Keech B. M., Lazerta R. Anaesthesia secrets. 6th ed. Elsevier, 2020. ISBN: 9780323640152
2. Weller R. O., Galea I., Carare R. O., Minagar A. Pathophysiology of the lymphatic drainage of the central nervous system: Implications for pathogenesis and therapy of multiple sclerosis. Pathophysiology, 2010, vol. 17, pp. 295-306. https://doi.org/10.1016/j. pathophys.2009.10.007
3. Ahn J. H., Cho H., Kim J.-H., Kim S. H., Ham J.-S., Park I., Suh S. H., Hong S. P., Song J.-H., Hong Y.-K., Jeong Y., Park S.-H., Koh G. Y. Meningeal lymphatic vessels at the skull base drain cerebrospinal fluid. Nature, 2019, vol. 572, pp. 62-66. https://doi.org/10.1038/ s41586-019-1419-5
4. Chen J., Wang L., Xu H., Xing L., Zhuang Z., Zheng Y., Li X., Wang C., Chen S., Guo Z., Liang Q., Wang Y. Meningeal lymphatics clear erythrocytes that arise from subarachnoid hemorrhage. Nat. Commun., 2020, vol. 11, article no. 3159. https://doi.org/10.1038/s41467-020-16851-z
5. Semyachkina-Glushkovskaya O., Penzel T., Blokhina I., Khorovodov A., Fedosov I., Yu T., Karandin G., Ev-sukova A., Elovenko D., Adushkina V., Shirokov A.,
Dubrovskii A., Terskov A., Navolokin N., Tzoy M., Ageev V., Agranovich I., Telnova V., Tsven A., Kurths J. Night Photostimulation of Clearance of Beta-Amyloid from Mouse Brain: New Strategies in Preventing Alzheimer's Disease. Cells, 2021, vol. 10, iss. 12, article no. 3289. https://doi.org/10.3390/cells10123289
6. Musizza B., Ribaric S. Monitoring the Depth of Anaesthesia. Sensors, 2010, vol. 10, iss. 12, pp. 10896-10935. https://doi.org/10.3390/s101210896
7. Buhre W., Rossaint R. Perioperative management and monitoring in anaesthesia. Lancet, 2003, vol. 362, iss. 9398, pp. 1893-1846. https://doi.org/10.1016/S0140-6736(03)14905-7
8. Malik P., Pathania M., Rathaur V. K. Overview of artificial intelligence in medicine. J. Family. Med. Prim. Care, 2019, vol. 8, iss. 7, pp. 2328-2331. https://doi.org/ 10.4103/jfmpc.jfmpc_440_19
9. Semyachkina-Glushkovskaya O. V., Karavaev A. S., Prokhorov M. D., Runnova A. E., Borovkova E. I., Ish-bulatov Yu. M., Hramkov A. N., Kulminskiy D. D., Semenova N. I., Sergeev K. S., Slepnev A. V., Sit-nikova E. Yu., Zhuravlev M. O., Fedosov I. V., Shirokov A. A., Blokhina I. A., Dubrovski A. I., Terskov A. V., Khorovodov A. P., Ageev V. B., Elovenko D. A., Evsukova A. S., Adushkina V. V., Tel-nova V. V., Postnov D. E., Penzel T. U., Kurths J. G. EEG biomarkers of activation of the lymphatic drainage system of the brain during sleep and opening of the blood-brain barrier. Computational and Structural Biotechnology Journal, 2023, vol. 21, pp. 758-768. https://doi.org/10.1016/jj.csbj.2022.12.019
10. Sergeev K., Runnova A., Zhuravlev M., Sitnikova E., Rutskova E., Smirnov K., Slepnev A., Semenova N. Simple method for detecting sleep episodes in rats ECoG using machine learning. Chaos, Solitons & Fractals, 2023, vol. 173, article no. 113608. https://doi.org/10. 1016/j.chaos.2023.113608
11. Descriptive statistics (GNU Octave (version 9.1.0)). Available at: https://docs.octave.org/v9.1.0/Descriptive-Statistics.html (accessed March 17, 2024).
12. GNU Octave: libinterp/corefcn/fft.cc File Reference. Available at: https://docs.octave.org/doxygen/3.8/d6/ d67/fft_8cc.html (accessed March 17, 2024).
13. Baumeister J., Barthel T., Geiss K. R., Weiss M. Influence of phosphatidylserine on cognitive performance and
cortical activity after induced stress. Nutritional Neuroscience, 2008, vol. 11, iss. 3, pp. 103-110. https://doi. org/10.1179/147683008X301478
14. De Gennaro L., Ferrara M., Bertini M. The spontaneous K-complex during stage 2 sleep: Is it the 'forerunner' of delta waves? Neuroscience Letters, 2000, vol. 291, iss. 1, pp. 41-43. https://doi.org/10.1016/S0304-3940(00) 01366-5
15. Jensen O., Mazaheri A. Shaping functional architecture by oscillatory alpha activity: Gating by inhibition. Front. Hum. Neurosci., 2010, vol. 4, article no. 186. https://doi. org/10.3389/fnhum.2010.00186
16. Lomas T., Ivtzan I., Cynthia H. Y. Fu. A systematic review of the neurophysiology of mindfulness on EEG oscillations. Neuroscience & Biobehavioral Reviews, 2015, vol. 57, pp. 401-410. https://doi.org/10.1016/j. neubiorev.2015.09.018
17. Lega B. C., Jacobs J. Human hippocampal theta oscillations and the formation of episodic memories. Hippocampus, 2012, vol. 22, iss. 4, pp. 748-761. https:// doi.org/10.1002/hipo.20937
18. Tesche C. D., Karhu J. Theta oscillations index human hippocampal activation during a working memory task. Proc. Natl. Acad. Sci. USA, 2000, vol. 97, iss. 2, pp. 919-924. https://doi.org/10.1073/pnas.97.2.919
19. Llinas R., Ribary U. Coherent 40-Hz oscillation characterizes dream state in humans. Proc. Natl. Acad. Sci., 1993, vol. 90, iss. 5, pp. 2078-2081. https://doi.org/10. 1073/pnas.90.5.2078
20. Baldauf D., Desimone R. Neural Mechanisms of Object-Based Attention. Science, 2014, vol. 344, iss. 6182, pp. 424-427. https://doi.org/10.1126/science.1247003
21. Borjigin J., Lee U. C., Liu T., Pal D., Huff S., Klarr D., Sloboda J., Hernandez J., Wang M. M., Mashourc G. A. Surge of neurophysiological coherence and connectivity in the dying brain. Proc Natl Acad Sci., 2013, vol. 110, iss. 35, pp. 14432-14437. https://doi.org/10.1073/pnas. 1308285110
22. Li D., Mabrouk O. S., Liu T., Tian F., Xu G., Rengifo S., Choi S. J., Mathur A., Crooks C. P., Kennedy R. T., Wang M. M., Ghanbari H., Borjigin J. Asphyxia-activated corticocardiac signaling accelerates onset of cardiac arrest. Proc Natl Acad Sci., 2015, vol. 112, iss. 16, pp. 2073-2082. https://doi.org/10.1073/pnas. 1423936112
Поступила в редакцию 17.05.2024; одобрена после рецензирования 07.06.2024; принята к публикации 15.06.2024 The article was submitted 17.05.2024; approved after reviewing 07.06.2024; accepted for publication 15.06.2024