Introduction

One of the major problems in surgery is appropriate condition of anesthesia in patients [1]. The anesthesiologists should keep the patients in proper levels of anesthesia during the surgical interventions and also should prevent from giving excessive or low doses of anesthetics to patients. Excessive doses of anesthetics -deep anesthesia- can cause cardio-vascular problem and prolong the awakening times, but on the opposite, low doses of anesthetics -light anesthesia- is harder to detect and according to the patients point of view is frightening [2]. Nowadays clinical indices like blood pressure, heart rate, sweating and limb movements are used to assess the depth of anesthesia. However, these indices can change from one patient to another depending on the type of the surgery. Also, some drugs such as muscle relaxants and vasodilators can make the analysis of those indices hard and unreliable [3].

Many studies are focused on finding reliable non-invasive ways to monitor the depth of anesthesia for the past several decades [3]. Years of research has revealed that EEG signal is the best parameter because anesthetic drugs mostly affect the central nervous system [4]. Since EEG signal has valuable information for determining the depth of anesthesia, it has been used as a useful data to distinguish between awake and anesthetized states in clinical surgeries.

During the last two decades, several methods based on EEG signal such as frequency measures [5, 6], fractal dimension [7], recurrence quantification analysis [8] and entropy [9] have been proposed to evaluate the level of consciousness in anesthesia. Entropy monitoring is obtained from processing raw EEG signals using the entropy algorithm. The signal entropy decreases when the patient falls asleep and raises again when the patient wakes up [9]. Bispectral index (BIS; Aspect Medical Systems, Newton, MA, USA) is one of the most common EEG monitors used in hospitals [5]. For BIS computation, numbers of variables are derived from both EEG time domain (e.g. burst suppression analysis) and frequency domain (e.g. power spectrum and bispectrum) and these variables are synthesized into an index to show the level of consciousness. The BIS monitor displays a dimensionless number between 0 to 100 in which 100 illustrates normal cortical electrical activity (awake state) and 0 indicates cortical electrical silence (burst suppression state). Using BIS monitor can decrease the consumption of anesthetic agents so it can help to prevent the patients from excessive expenses [10].

In this study, 14 features including statistical, frequency and entropy measures are extracted from EEG signal. The input features named as follows: power in different bands (delta, theta, alpha, beta and gamma), total power, two power fractions, variance, skewness, kurtosis, spindle score, permutation entropy and embedded entropy. These features are straightforward theoretically and can be computed efficiently.

Features extracted from EEG signal define a high-dimensional data set which is not appropriate for classification approach. We hypothesized that dimensionality reduction methods may better distinguish between awareness and unconsciousness in patients. Recent studies also have shown that dimensionality reduction methods such as Isomap and Locally Linear Embedding (LLE) algorithms can be used to assess the depth of anesthesia or sleep states [11, 12].

In this research, first, we extracted the 14 linear and non-linear mentioned features from the EEG signals. Then, the extracted features are used as the input to the LLE algorithm. By dimensionality reduction to three dimensions, we can visualize that our algorithm could classify EEG signals into awake and unconsciousness states. Finally, we have used a quadratic discriminant analysis (QDA) classifier to distinguish between the two anesthetized states.

Materials and methods

Subjects and data acquisition

We studied 25 patients (15 men and 10 women, age 22–75 yr., weight 47–120 kg, American Society of Anesthesiologists (ASA) physical status III) scheduled for cardiac surgery requiring cardiopulmonary bypass (CPB). All patients were given written informed consent and the protocol used in this study was approved by the institutional review board and ethics committee, Department of Anesthesiology, Faculty of Medicine, Shahid Beheshti University of Medical sciences, Tehran, Iran.

The EEG signal from frontal lobe of cortex was recorded by BIS monitoring device (Aspect Medical Systems) with sampling rate of 256 Hz and within the frequency range of 0.2 to 70 Hz. This device also recorded depth of anesthesia with BIS Index at sampling rate of 0.1 per second.

Patient hemodynamic signals and parameters were recorded with vital sign monitor (AlborzB9 monitor, Saadat Co., Tehran, Iran) continuously via an RS232 interface into a PC for later analysis. Sampling rate of ECG signal was 400 Hz.

Anesthetic protocol

Generally, we can divide stages of anesthesia into three sections: drug induction, maintenance and recovery from anesthesia. Data record of recovery section was not possible because patients were transferred to the post-anesthesia care unit at the end of the surgery.

Before patients were entered the operation room, they were injected with Morphine (0.1 mg/kg) and Promethazine (0.5 mg/kg). Anesthesia was induced by Thiopental sodium (5 mg/kg), Fentanyl (5 μg/kg), Lidocaine (1.5 mg/kg) and Cisatracurium (0.1 mg/kg). The patients were reached to a state of unconsciousness after an average of 30 s. Loss of consciousness (LOC) was assessed by loss of response to verbal command of the anesthetist.

The second stage of anesthesia was maintenance. In cardiac surgery, the three sections of maintenance are before the Heart-Lung pump usage, during Heart-Lung bypass and after disconnecting the pump. First, Isoflurane was given at 1 MAC with 100 % oxygen and N2O to the patients. Also, induction of Morphine (0.2 mg/kg) and Cisatracurium (100 μg/kg/h) were continued until bypass phase. In bypass phase, anesthesia continued by induction of drugs like Propofol (50–150 μg/kg/min), Atracurium and Morphine by using infusion pump and undergoing mild hypothermia (31–33 °C). After bypass phase, Isoflurane was given at 1 MAC with oxygen (100 %) and N2O to the patient. After tracheal extubation, patients were taken to the post-anesthesia care unit.

The EEG and ECG recordings were started before induction of anesthesia and continued till patients were taken to the post-anesthesia care unit.

Feature extraction

EEG features

In this study, we extract 14 features from EEG signal. It can be done by dividing the signal into non-overlapping windows and calculating statistical and frequency based features for each window. Hence each window becomes a high-dimensional data point. The window length is 10-s non-overlapping epochs. These 14 features are as follows:

  • The power in different frequency bands: These features include total power in the delta (up to 4 Hz), theta (4–7.5 Hz), alpha (7.5-12 Hz), beta (12-26 Hz) and gamma ranges (above 26 Hz).

  • Total power: This feature is extracted by summing the power in all five frequency bands in the EEG signal.

  • The power fractions: We can obtain the low power fraction by summing the power in the delta and theta ranges and dividing by total power. Similarly, the high power fraction also can be obtained by summing the power in the beta and gamma ranges and dividing it by total power.

  • Statistical measures: These features consist of variance, skewness and kurtosis. The variance indicates the dispersion of the data and it is always non-negative. Skewness is the amount of the asymmetry around its mean, for example, positive skewness indicates that more data points lie above the mean than below it. Kurtosis is a measure of the “peakedness” [13], high kurtosis means that the signal has large deviations from its mean.

  • Spindle score: The spindle detector finds those segments of the EEG signal where the signal changes from positive to negative and vice versa five times in a row. Spindle waveforms during anesthesia is about 10 Hz [14]. Therefore, episodic 10 Hz activity and episodes of burst suppression usually happen during anesthesia. The MATLAB code we used for this purpose can be found in McKay et al. [14].

  • Permutation entropy: The permutation entropy (PE) quantifies the value of regularity in the EEG signal. It can be calculated by mapping the time series into symbolic sequences in order to quantify the probability of the different symbols [15]. In other words, it is an indicator of the “flatness” of the signal. The largest and smallest values of PE are one and zero. PE is conceptually simple, computationally efficient and it resists against artifact. It has also found that the PE is a good measure of anesthetic depth. The MATLAB code for this function can be found in Olofsen et al. [15].

  • Embedded entropy: It calculates the probability that the closely related sequences in a data set remain closely related, in a segment. It is a proper method to predict a dynamical system. Embedded entropy works very good in anesthesia especially at high doses of anesthetics [16].

ECG features

The seven features extracted from ECG data are as follows: total power, statistical measures (variance, skewness and kurtosis), spindle score, permutation entropy and embedded entropy.

ECG and ECG-EEG features

The features extracted from EEG-ECG signals are the combination of each signal features. Therefore there are 21 features extracted from the EEG-ECG signals.

Dimensionality reduction method with Locally Linear Embedding (LLE)

In the last section, we extracted some features from EEG and ECG signals in high-dimensional space which the number of dimensions is equal to the number of features. We hypothesized that dimensionality reduction methods may better distinguish between awareness and unconsciousness in patients. Locally Linear Embedding (LLE) is a dimensionality reduction method that was introduced by Roweis and Saul [17]. This method visualizes high-dimensional inputs into a low-dimensional space, and it can often reveal relationships and patterns that are covered by the complexity of the original data set. It is used to distinguish between normal and pre-seizure EEG measurements [18], to characterize between sleep stages [10] and computation of left ventricular volume change from Echocardiography images [19].

The algorithm

N data samples of X data set with dimensionality D is transformed into a new dataset Y including of N points with dimensionality d (where d < D) with LLE algorithm. It should be noted that the geometry of the data and the local configurations of nearest neighbors is retained as much as possible.

$$ {x}_1,{x}_2,\ldots,{x}_n\in {R}^D\overset{f}{\to }{y}_1,{y}_2,\ldots,{y}_n\in {R}^d $$
(1)

The algorithm can be divided into three different steps (Fig. 1). First, the K nearest neighbors for each data sample is determined as measured by Euclidean distance.

Fig. 1
figure 1

Diagram of the LLE algorithm. The three main steps are: (1) define the neighborhood for each point, (2) solve for the reconstruction weights, and (3) learn embedding which preserves the reconstruction weights. Image obtained from [20]

Second, every data point from its nearest neighbors is reconstructed. This can be explained in minimizing the cost function (2):

$$ E(w)={{\displaystyle \sum_{i=1}^N\left|{\overrightarrow{x}}_i-{\displaystyle \sum_{j=1}^k{w}_{ij}{\overrightarrow{x}}_j}\right|}}^2 $$
(2)

Where x j is one of the nearest neighbor points, x i denotes the current data point and w ij is the corresponding reconstruction weight between x i and x j . To discover the weights, the E(w) in Equation (2) is minimized regarding to sparseness constraint and an invariance constraint (It should be noted that that w ij  = 0 if x j is not in the neighborhood of x i ). The sparseness constraint indicates that any data point x i is rebuilt solely from its neighbors. The invariance constraint is fulfilled if sum of each row of the weight matrix is equal one (\( \sum_j{w}_{ij}=1 \)). Regarding to these constraints, the LLE obtains the least squares solution to w.

Finally, each output y i with low dimension is mapped by an input x i with high dimension. This can be possible by selecting the d dimensional coordinates of each output y i to minimize the following cost function:

$$ \phi (y)={{\displaystyle \sum_{i=1}^N\left|{\overrightarrow{y}}_i-{\displaystyle \sum_{j=1}^k{w}_{ij}{\overrightarrow{y}}_j}\right|}}^2 $$
(3)

This function, similar to the one in equation (2), is founded on locally linear reconstruction errors. There are just two differences here that w ij are fixed and output y i are optimized. It should be noted that original inputs x i are not involved in this step. Accordingly, geometric information in w ij establishes the embedding entirely. Consequently, the plan is to discover outputs y i with low dimension, equally that high dimensional inputs x i are reconstructed by w ij weights. By rewriting equation (3) as the quadratic form:

$$ \begin{array}{l}\phi (y)={{\displaystyle \sum_i\left|{\overrightarrow{y}}_i-{\displaystyle \sum_j{w}_{ij}{\overrightarrow{y}}_j}\right|}}^2\\ {}={\displaystyle \sum_{ij}{M}_{ij}\left({\overrightarrow{y}}_i.{\overrightarrow{y}}_j\right)}={y}^T My\end{array} $$
(4)

The dimension of matrix M is N × N and is equal to:

$$ {M}_{ij}={\delta}_{ij}-{w}_{ij}-{w}_{ji}+{\displaystyle \sum_k{w}_{ki}{w}_{kj}={\left(I-W\right)}^T\left(I-W\right)} $$
(5)

The embedding cost function (4) can be optimized by solving eigenvalue problem of cost matrix M [20].

More description and examples for the algorithm can be found in Saul et al. [20, 21]. Also, a MATLAB code for LLE is available on the authors' website [22].

Classification

Statistical techniques and neural networks are used for classification widely in biomedical applications [23]. One of the statistical classifiers is quadratic discriminant analyzer (QDA). Discriminant analysis captures the relationship between multiple independent variables and a categorical dependent variable in the usual multivariate way, by forming a composite of the independent variables. QDA is a supervised classification; first it should be trained with some observations and then tested with other observations in order to calculate the accuracy. It is a simple method and its computational time is very low [24]. Numbers of pattern recognition problems and EEG processing researches such as motor imagery based Brain-Computer interface and P300 Speller have used this classifier [25]. The QDA classifier is implemented by using MATLAB software version 7.1.

Leave-one-out cross-validation

Leave-one-out cross-validation is an approach for assessing how the results of a statistical analysis will generalize to an independent data set. This technique involves using all observations from one patient as the test data, and the remaining observations from other patients as the training data. This is repeated in such a way that observations from all patients are used once as the test data.

Statistical analysis

The evaluation of the proposed method was determined by computing the classification accuracy. The definition of this parameter is as follows:

  • Classification accuracy: Number of correctly detected anesthetic levels as a fraction of the total number of applied anesthetic levels.

Results

Our method applied to different data sets

In this section, the results of applying our algorithm to classifying between awake and anesthetized states are shown for all data sets (EEG, ECG and EEG-ECG). We used a 10-s non-overlapping window for different vital signals.

Based on the Loss of consciousness (LOC) time, drug delivery protocol and anesthesiologist’s assessment, the patient is considered to be in one of two different levels of anesthesia, namely, awake and general anesthesia; then the corresponding EEG and ECG signals are selected.

Our method applied to EEG data set

In this study, at first, we extract 14 features from EEG signal discussed in section 2.3.1. It can be done by dividing the signal into non-overlapping windows and calculating statistical and frequency based features for each window. Hence each window becomes a high-dimensional data point. After describing the EEG data set by these measures, now we apply the LLE algorithm. In other word, the features extracted from each 10-s EEG segment are applied into a LLE algorithm to visualize that our algorithm could classify EEG signals into awake and unconsciousness states. Therefore, input dimension to LLE method is 14 and the output dimension is 3.

Figure 2 demonstrates an example of using LLE on features extracted from EEG signal. In this figure, the 3D result for 12 nearest neighbors (k = 12) is displayed. Every point in this figure represents a 10-s window of EEG data and the color and symbol represent the two anesthetized states. Red circles are used to show awake (conscious) state and blue stars are used to show unconscious state. In this example, we see a general attitude of increasing anesthetized depth as we move to the center of the space.

Fig. 2
figure 2

An example of using our method on EEG signal

Our method applied to ECG data set

At first, we extract 7 features from ECG signal discussed in section 2.3.2. Then, we applied LLE algorithm to these features. In other word, we use these features as the High-dimensional input to the LLE algorithm. Hence, the number of input dimension for LLE was 7 and the output number was 3. The 3D result for 6 nearest neighbors (k = 6) is displayed in Fig. 3. Every point in this figure represents a 10-s window of ECG data and the color and symbol represent the two anesthetized states. Here we see a good separation between the Conscious points (red circles) and Unconscious points (blue stars).

Fig. 3
figure 3

An example of using our method on ECG signal

Our method applied to both EEG and ECG data sets

In this section, we use both EEG and ECG signals as input to the LLE algorithm. The features extracted for EEG and ECG signal were discussed in section 2.3.3. We use these features as the High-dimensional input to the LLE algorithm. Input dimension is 21(14 for EEG and 7 for ECG) and output dimension is 3. The 3D result for 20 nearest neighbors (k = 20) is displayed in Fig. 4. Every point in this figure represents a 10-s window of EEG-ECG data and the color and symbol represent the two anesthetized states. As we can see, Conscious points (red circles) are scattered in the space whereas Unconscious points (blue stars) have remained close together.

Fig. 4
figure 4

An example of using our method on both EEG and ECG signal

Classification accuracy

Table 1 shows the classification accuracy achieved among the patients with our method between EEG, ECG and EEG-ECG in different states during cardiac surgery for all patients (n = 25). The average classification accuracy of 88.4 % across the subjects with a standard deviation of 3.6 % in discriminating the awake from anesthesia state is obtained with our method applied on EEG signal.

Table 1 Classification accuracy using EEG, ECG and EEG-ECG signals during cardiac surgery for all patients (n = 25)

It is also found from the experimental results that our method applied on ECG signal give an overall classification accuracy of 83.4 % between the patients with a standard deviation of 4.5 % in detecting two anesthetized states.

Finally, our method applied on the combination of EEG and ECG signal achieves 76.6 % overall classification accuracy among the patients with a standard deviation of 6.7 % in detecting two anesthetized states.

In order to compare our method with BIS index, we differentiate awake and unconscious states via BIS index (BIS number 80–100 is considered as Awake and BIS number below 80 is considered as Unconscious). It is found from the results that BIS index give an overall classification accuracy of 84.2 % between the patients with a standard deviation of 3.9 % in detecting two anesthetized states.

Discussion

In this work, a new method based on LLE algorithm is proposed to classifying between awareness and unconsciousness (or in other words, depth of anesthesia) in clinical applicants. We evaluated the proposed method before and during anesthesia in 25 patients (15 women and 10 men, ages were in the range of 16 to 81). EEG signal were taken from patients and anesthesiologist’s assessment was the reference (golden standard) for classifying between awareness and unconsciousness state.

Variety of features applied on EEG signal to extract all information in this signal. Each feature shows a dimension. LLE as a dimensionality reduction method is used to reduce high-dimensional input data into a low-dimensional output space. The dimensionality of the feature data with LLE method is reduced to achieve a three-dimensional embedding representing this manifold. The manifold demonstrates the continuum of neurophysiological alternations during anesthesia.

Our method was applied on EEG, ECG and combination of EEG and ECG signals. The number of features for mentioned signals was 14, 7 and 21 respectively and the output dimension for all signals was 3. Classification accuracy for EEG, ECG and EEG-ECG signals were 88.4 %, 83.4 % and 76.6 % respectively. Due to above results, we can say that EEG signal in solitary results in determining the depth of anesthesia best. But EEG signal cannot be used in some surgeries such as head and neck surgery because of the high noise. Therefore, at some points, ECG signal or combination of EEG and ECG signal can be used to determine the anesthetized states.

If we compare our method via BIS index, we will find that our method has better results than those of the BIS index. Also BIS value computation is so complex and needs more time [26]. In addition, the removal of artifacts (low frequency blinks, eye movement, baseline drift and nonlinear distortion of the amplitude) in BIS is too complicated and time consuming [27]. Moreover, researchers in recent years proved that BIS index has several problems: it causes paradoxical outcomes during burst suppression pattern [28], it is not responsive to some anesthetic agents [29], it is sensitive to artifact [27] so it cannot be used in head surgeries, it cannot regain its baseline value after recovery [30] and also has large time delays [31].

In order to effectively characterize the transition from awake to anesthesia using EEG, a suitable set of features is necessary. The results showed that the nonlinear combination of features can be derived that can be shown by three new combinational features to explain most of the variance. It is because EEG changes during induction of anesthesia are extremely nonlinear and require to be anticipated with a nonlinear method such as LLE algorithm.

In conclusion, a new method based on EEG features extraction and dimensionality reduction is proposed to distinguish between awake and anesthetized states. The method is validated with data recorded from 25 patients during the cardiac surgery requiring CPB. Anesthesiologist’s assessment was used as a reference for separation between two anesthetized states. We can say that our method could classify awareness and unconsciousness in a good manner. We also acknowledge that this paper is largely a proof-of-principle; and we have used a small data set as an example to compare our method with BIS index. The real clinical significance during course of surgery or increase/decrease of drug concentration over time will only be determined with future larger trials of the two methods of analysis.