Analyzing the EEG Signals in Order to Estimate the Depth of Anesthesia Using Wavelet and Fuzzy Neural Networks

— Estimating depth of Anesthesia in patients with the objective to administer the right dosage of drug has always attracted the attention of specialists. To study Anesthesia, researchers analyze brain waves since this is the place which is directly affected by the drug. This study aimed to estimate the depth of Anesthesia using electroencephalogram (EGG) signals, wavelet transform, and adaptive Neuro Fuzzy inference system (ANFIS). ANFIS can estimate the depth of Anesthesia with high accuracy. A set of EEG signals regarding consciousness, moderate Anesthesia, deep Anesthesia, and iso-electric point were collected from the American Society of Anesthesiologists (ASA) and PhysioNet. First, the extracted features were combined using wavelet and spectral analysis after which the target features were selected. Later, the features were classified into four categories. The results obtained revealed that the accuracy of the proposed method was 98.45%. Since the visual analysis of EEG signals is difficult, the proposed method can significantly help anesthesiologists estimate the depth of Anesthesia. Further, the results showed that ANFIS could significantly increase the accuracy of Anesthesia depth estimation. Finally, the system was deemed to be advantageous since it was also capable of updating in real-time situations as well.


I. InTRoducTIon
A nesThesIA results from administration of anesthetic drugs, through injection, and is characterized by sleepiness and loss of feeling of pain.Today, depth of Anesthesia is expressed as a consistent decrease in the performance of Central Nervous System (CNS) as well as decreased response to stimuli [1,2].Injecting an appropriate level of anesthetic drugs has always been a great concern to anesthesiologists.They seek ways to ensure patients' blood circulation and, at the same time, increase the depth of Anesthesiato ensures patients' recovery in a shorter period of time.Since the most important causes of Anesthesia lie in the brain, researchers mostly focus on analyzing the Electroencephalogram(EEG) [2,3] They are used widely and quite efficiently in investigations targeting different biological and non-biological phenomena [6,7].
Adaptive Neuro Fuzzy Inference System (ANFIS) exploits neural network and fuzzy logic algorithms to formulate a non-linear mapping between the input and the output space.Having the linguistic strength of a fuzzy system and the numerical strength of a neural network, ANFIS has proven to be particularly efficient in modeling complex processes [6,7,8].Accordingly, the present study aimed at proposing an intelligent model to estimate depth of Anesthesia using features extracted from EEG signals.Sample features obtained from wavelet coefficients as well as the spectral analysis of EEG signals were used as parameters in this study.

II. MATeRIAl And MeThods
To undertake the present study, use was made of EEG signals -  Wavelet analysis is one of the most useful methods in analyzing bio-signals, such as EEG ones [9].For this reason Discrete Wavelet Transform (DWT) was used to extract statistical features.Wavelet transform is particularly used in extracting non-stop signals with various frequency characteristics [10].In fact, it decomposes signals into a set of basic functions.These continuous basic functions are calculated from the application of delays, contractions, and transmissions on a unique function called wavelet model [11].Using a Daubechies 4 (D4) wavelet transform, the collected signals are decomposed into 4 subbands.The frequency range was taken to be within 0 to 60 Hz and frequencies higher than 60 Hz were dismissed as noises.As shown in Figure 1c, the original signal is first passed through a High Pass Filter (HPF) and a Low Pass Filter (LPF).
Having removed other samples, the signals are decomposed into two simpler signal types.Each stage comprises two digital filters and two down-sampler filters.The output of the first HPF and LPF results in D1 component and A1 approximation.Then, the first calculated approximation, A1, is decomposed further which produces component D2 and approximation A2.In all, this procedure is repeated four times in this study.As shown in Figure 1d, D1, D2, D3, D4, and A4 are gamma sub-band, beta sub-band, alpha sub-band, theta sub-band, and delta sub-band, respectively.
Since sub-bands contain more accurate information compared to the mother signal, decomposition was carried out using wavelet.Having completed this stage, the desired and optimized information and features were extracted from the sub-bands.Figures 1e and 1f show examples of decomposed signals in various levels, including consciousness and Anesthesia.
The target statistical features in this study included the maximum and minimum of wavelet coefficients as well as the mean and the standard deviation of each set of signals.All these features were extracted from each sub-band.Moreover, all the spectral features intended were also extracted.The calculated features included alpha and beta ratios (Eq.2.1 & 2.2) as well as theta ratio (Eq.2.3) denoting the depth of    Anesthesia, consciousness, and a state between alpha and beta and between moderate Anesthesia and other states, respectively [12]. (2-1) Further, four features were extracted from the set of statistical and spectral features as indicated in Table 1.

Beta ratio (MIN) Beta ratio
Theta ratio (STD) Theta ratio STD Mean Gamma ratio These features were used as input for the designed Fuzzy Inference System (FIS) [13].In the proposed FIS, the first input, as shown in Figure 1g, comprises factors that draw a clear cut distinction between Anesthesia and the other states.Similarly, the second input, Figure 1h, represents consciousness and the other states.In the same vein, the third input, as illustrated in Figure 1i, represents moderate Anesthesia, Anesthesia, and consciousness.Finally, Figure 1j distinguishes coma from other states.In all, 24 fuzzy rules were composed regarding the four features of the input space.For the selected features and the defined target classes, an IF-THEN fuzzy rule was formulated, for each fuzzy sub-set, as follows [14,15]: (2)(3)(4) The last phase of the study dealt with designing the ANFIS that is responsible for classifying the signals into four states of consciousness, moderate Anesthesia, deep Anesthesia, and coma.Compared to other fuzzy logic-based systems, one of the advantages of ANFIS is that no conversion of certain data into fuzzy data is required [6,16].Moreover, parameters do not need to be initialized.In fact, first the fuzzy system is designed after which its membership functions are improved and tested using ANFIS.Finally, the trained network is used to distinguish different states of Anesthesia.All the membership functions drawn on in this system are Gaussian.

III. ResulTs
As stated in Section 2, the final ANFIS comprised four variables which had two, two, three, and two Gaussian membership functions, respectively.Accordingly, the total number of fuzzy rules amounted to 24.In this study, 80% of the data collected was used for training and the remaining 20% was used for testing purposes.The assignment of data to train or test datasets was undertaken through simple randomization.An interesting finding in the present study was that the error rate of the model would decrease with an increase in the number of iterations.
The sensitivity rate of the proposed system was found to be 96.6%, which simply means that it can recognize the Anesthesia states in 96.6% of the cases.Further, it was observed that the system could always (100%) recognize Anesthesia accurately.Moreover, the accuracy rate of the proposed system was reported to be 98.45%.

IV. conclusIon
The system proposed in this study is an appropriate means of extracting useful EEG signals.Wavelet analysis was used here to describe EEG signals since it facilitates the decomposition of EEG signals into sub-bands.Further, the fact that each Anesthesia state has its own specific frequency bands enables the researcher to estimate the depth of Anesthesia in each state by finding the relationship between these frequency bands.To sum up, it appears that by combining the extracted statistical features from the wavelet coefficients of EEG signals and spectral analysis, it is possible to design a system which can accurately estimate the depth of Anesthesia.The proposed system can be of great help to anesthesiologists since it can recognize the Anesthesia states with high accuracy at a lower cost.The comparison of the statistical results from ANFIS to those from the previous studies -including neural networks, linear discernment, and even fuzzy models -reveals that the proposed fuzzy-neural system is advantageous for two reasons: First, it can estimate the depth of consciousness with high accuracy, and second, it has improved the deficiencies of the previous systems.This was facilitated through an optimized extraction of features using wavelet transform and formulating appropriate fuzzy rules.The low error rate of RMSE calculated for the system confirms the reliability of the results.
.Recently, methods basing on EEG signals -these signals express the electrical activity of the brain and are dynamic, random, non-stop, and non-linear [4,5] -have increased the accuracy of Anesthesia depth estimation.These methods are particularly efficient for separating nonstop signals with their impedance and Anesthesia.An expert needs to visually analyze a large amount of EEG signals to extract the required information.The computer analysis of EEG signals aims at making such data extraction fast, effortless, and automatic.Mathematical models, i.e. artificial neural networks and fuzzy systems, have an array of applications in clinical medicine -extraction of features and diagnosis of illness being only few examples.Fuzzy systems are modeling methods with wide applications in various scientific fields.
obtained from American Society of Anesthesiologists(ASA) -and the Sleep-EDF database of PhysioNet.The signals used included four categories namely consciousness, moderate Anesthesia, deep Anesthesia, and coma.The signals collected were in BDF, EDF, ASCII, and TEXT formats.To extract features, MATLAB R2009a, EDFBrowser, and EEGLAB applications were drawn on.Figures 1a to 1b illustrate examples of EEG signals belonging to each category respectively.

Fig. 1 a
Fig. 1 a.A sample of the EEG signals in consciousness mode.

Fig.
Fig. 1c.A sample of the EEG signal in a state of deep anesthesia.

Fig. 1f .
Fig. 1f.EEG signal levels in Anesthesia state to the db 4with level 4.

Fig. 2 .
Fig.2.The error rate of the system is negatively correlated with the number of iterations.