Introduction

General anesthesia, which is known as the blackout of the consciousness and insensibility, is especially used in surgical intervention. Anesthetic agent can be given to the patient by the way of injection or respiratory tract. Nevertheless in a surgical intervention, respiratory tract is more preferred [1]. Anesthesia of respiration is done from the respiratory tract by a mask or help of a tube which is fixed to throttle [2].

Effect of the applied anesthesia on a patient is known depth of anesthesia. Depth of the anesthesia can change according to the anesthetic agent and characteristic of the patient (age, weight, etc.) [1]. During the operation, the depth of the anesthesia of a patient is determined by the experience of the anesthetist. An anesthetic dose level which is applied to the patient must be measured sensitively in surgeries. A calibration defect that may be occur in vaporizer, may carry the anesthesia process to a critical condition. Therefore, the level of the anesthetic gas which is regulated manually and is given to a patient must be measured continuously, for checking whether the anesthetic dose level applied to patient is correct or not. In recent years, many researches have been done by using the blood pressure and heart rate parameters of an anesthesia applied to a patient for determining the dose level and the depth of an anesthesia [36].

Mixed gases applied to the patient during the operation, contain O2, N2O and anesthetic agent. Anesthetic agents which have different characteristics are used in anesthesia of respiration. In this study, sevoflurane anesthetic agent was chosen because of its widely usage.

The QCM sensor is a quartz resonator with its electrodes coated with a sensing film. The resonance frequency is changed by the change of mass on its electrodes due to the gas sorption [7]. The QCM sensor has been found in a wide range of applications in the areas of food, environmental and clinical analyses, due to their inherent ability to monitor analyses in real time [8].

Artificial Neural Networks (ANN) are analog computer systems which are inspired by studies on the human brain. Feed forward multilayer perceptrons have been successfully used by replacing conventional pattern recognition methods for identification of chemical gas/odor. An implementation of ANN for analyzing the responses of gas sensor array offers several advantages over conventional signal processing in terms of adaptability, noise tolerance, etc. [911].

In this study, an E-Nose system, containing phthalocyanine coated QCM sensor array was realized to determine the sevoflurane anesthetic dose levels given to the patients in surgeries. Usually, the steady state responses of the sensors are used for concentration estimations of the gases [911]. A data set consisted of the steady state sensor responses from the sensor array were used for the training of the neural network. The data processing was performed using (MLNN) structure.

The back-propagation (BP) algorithm [12, 13] is widely recognized as a powerful tool for training Feed Forward Neural Networks (FFNNs). However, it utilizes the steepest descent method to update the weights, it suffers from a slow convergence rate and often yields suboptimal solutions [1214]. A variety of related algorithms has been introduced to address that problem. A number of researchers has carried out comparative studies of FFNN training algorithms [10, 1214]. The Levenberg–Marquardt training algorithm [13] used in this study are these type of algorithms.

The performance and the suitability of the realized system was discussed and compared based on the experimental results.

General anesthesia

General anesthesia is the most common type of anesthetic performed at hospitals. There are several different ways to start the anesthetic, a process referred to as “induction of anesthesia”. One of the most common types of anesthetic induction used at hospitals is an inhalation induction. This simply means that the patient breathes himself to sleep. The patient will accompany the anesthesiologist to the operation room. There, after attaching monitors, the anesthesiologist will help hold a clear plastic mask over the patient’s nose and mouth. The mask is attached to the anesthesia machine which delivers oxygen and anesthetic gases. [1517]

General anesthesia involves the control of the triad of unconsciousness, analgesia and muscle relaxation. While muscle relaxation can be controlled via numerical algorithmic methods [18], the others cannot be modeled or measured easily or precisely. Anesthetic drugs affect the central nervous system, cardiovascular system, respiratory system and muscles of the body [19]. The effect on all these systems and on other clinical signs can provide a monitoring system for the safe use of the anesthetic drugs. Monitoring of clinical signs such as systolic arterial pressure (SAP), mean arterial pressure (MAP), heart rate (HR), respiration rate (RR), pupil size, and patient movement are used by anesthetists to determine the depth of anesthesia and to decide the correct dosage of anesthetic agent [6].

One of the main tasks of anesthetist during surgery is to control the depth of anesthesia. The depth of the anesthesia is controlled by using a mixture of drugs which are injected intravenously or inhaled as gases. Most of these agents decrease MAP. Among the inhaled gases, sevoflurane is widely used, most often in a mixture of 0–4% by volume of sevoflurane in oxygen and/or nitrous oxide. The sevoflurane concentration in the inspired air is adjusted by the anesthetist depending on the patient’s physiological condition, the type of surgery, MAP and other clinically relevant parameters [20].

Gas amount that is going to be given to a patient is calculated based on patient’s estimated lung volume. For example; assuming that a normal adult patient has 500 ml lung volume, and inhales 12 times per minute, and then 6,000 ml gas mixture (3 l of O2 and 3 l of N2O) should be given to this patient and assuming a child patient has 250-ml lung volume, inhales 16 times per minute. So 4,000 ml gas mixture (2 l of O2 and 2 l of N2O) should be given [1, 2]. As a result, it could be said that applied gas volume could be changed according to the patient’s physiological conditions.

Electronic nose system

An electronic nose mimics the mammalian nose’s ability to identify and quantify a wide range of volatile chemicals. Electronic noses commonly consist of a small number of sensors each with a distinct but broad and overlapping sensitivity to a range of chemicals. When an odor is presented to the electronic nose, most if not all sensors will respond to some extent. However, some will respond far more strongly than others. This pattern of varied responses from the sensor array is a characteristic of the applied chemical. The output of the odor sensors is typically amplified, filtered, and converted to a digital form by an interface electronics. When an unknown odor is presented to the electronic nose, a pattern recognition process is performed to compare the pattern of sensor responses with stored templates. The best match is used to classify the unknown odor in terms of the stored templates [21].

An electronic nose is a device that identifies the specific components of an odor and analyzes its chemical makeup to identify it. An electronic nose consists of a mechanism for chemical detection, such as an array of electronic sensors, and a mechanism for pattern recognition, such as a neural network. Electronic noses are originally used for quality control applications in the food, beverage and cosmetics industries and also used in aerospace researches, in military and in health applications too [22].

QCM sensors

The quartz crystal microbalance (QCM) is an ultra sensitive weighing device that utilizes the mechanical resonance of piezoelectric single crystalline quartz. This, originally discovered by Pierre and Jacques Curie in 1880, is characterized by the ability of an external electric field to induce a mechanical strain in a material, where the direction of the induced strain can be controlled via the orientation of the cut in the crystal with respect to the crystal lattice [7]. QCM sensor structure is shown in Fig. 1.

Fig. 1
figure 1

Quartz crystal microbalances (QCM) sensor

The QCM is useful acoustic sensor devices. The principle of the QCM sensors is based on changes Δf in the fundamental oscillation frequency to upon ad/absorption of molecules from the gas phase. To a first approximation, the frequency change Δf results from increase in the oscillating mass Δm [7];

$$ \Delta f = - \frac{{C_{f} .f_{0} ^{2} }} {A}.\Delta m $$
(1)

Where,

Δm(g):

Mass changes

Δf(Hz):

The frequency change

A(cm2):

The area of the sensitive layers

f0(Hz):

Fundamental resonance frequency of the quartz crystal

C f :

The mass sensitivity constant (2.26) of the quartz crystals

The piezoelectric crystals used were AT-Cut, 10.000 MHz quartz crystals (ICM International Crystal Manufacturers Co., Oklahoma, USA) with gold plated electrodes (diameter Φ = 3 mm) on both sides mounted in a HC6/U holder. In this study, the both sides of piezoelectric crystals were coated with the phthalocyanine. The instrumentation utilized consists of a standard laboratory oscillator circuit, a power supply and frequency counters. The frequency changes of vibrating crystals were monitored directly by a frequency counter. The sensors and frequency counters are altogether called Standard Sensor Cell (SSC), shown in Fig. 2. The SSC is equipped with a pump, a microcontroller and a QCM sensor array.

Fig. 2
figure 2

Standard sensor cell (SSC)

It is well known that the sensor performance such as sensitivity, selectivity and time response is largely influenced by the properties of the sensing films. QCM is highly sensitive to mass changes in the presence of a coating that interacts with the target gas [911]. The characteristics of QCM gas sensors depend on the kinds of sensing films coated on their electrodes. A number of materials [24] has been successfully employed in the coating of QCM sensors such as zeolites, fullerene C60, chiral materials, polypyrrole, carbon graphites, ITO films and oligonucleotides. In this study, seven different phthalocyanine coated QCM sensors are used for detecting sevoflurane anesthetic dose levels [23].

Experimental setup

The experimental setup is shown in Fig. 3. It includes gas tanks for life support: O2 and N2O, mixture of these gases are also used as carrier to the anesthetic agent. A vaporizer evaporates the anesthetic agent to add it to the carrier. There is a CO2 absorber in the back way of breath circulation path and a ventilator to enforce circulation. There are valves in the loop to ensure flow direction of incoming and outgoing gases. E-Nose system is located next to the anesthetic equipments to measure the anesthetic agent amount.

Fig. 3
figure 3

The measurement system flow and signal diagram during anesthesia

The gases used in the surgical operations are O2, N2O and anesthetic agent which is sevoflurane throughout in this work. O2 and N2O are mixed with certain ratio and this mixture goes to the anesthesia equipment [1]. The anesthetic agent then is added to this mixture in an evaporation unit, and a new mixture is obtained which is called the anesthetic gas. This gas mixture is delivered to the patient. The anesthetic level adjustment is controlled by a valve over the evaporation unit. The exhaled gas that comes out of patient mask ventilated with a valve to alter which absorbs CO2 and recycles the other gas mix. The experimental setup is shown in Fig. 3.

A sample of the gas was taken from the output of an anesthesia device was given to QCM sensor cell with a pump with a constant flow. An E-Nose connection is performed via a balloon assuming patient lungs. QCM sensor receptor circuit is occurred with 10 MHz oscillator circuits and frequency difference receptor (Δf). Δf frequency difference is given to PC with RS232 serial port. Δf data is taken by PC that is recorded against time with a programme [23, 24]. E- nose’s connection with the anesthesia device for taking data is given at Fig. 3.

Data preparation

There are eight dose levels in sevoflurane anesthesia. O2 and N2O values are amount of volume which is given to the patient in liter per minute in anesthesia. Mixture of O2 and N2O gases is used as carrier of anesthetic agents and this carrier gas could be adjusted according to the patient’s physical conditions (age, weight, etc.). For example, the applied carrier gas shows different concentrations from babies and adults. For that reason, extensive data is required for studies of determining sevoflurane anesthetic dose levels.

Sevoflurane anesthetic dose level data (from 1 to 8) for different concentration of O2 and N2O was obtained from 72 different measurements. Each of the measurement was lasted 10 min and sensors were not cleaned between the anesthetic dose levels [23, 24]. In this study, data samples are collected and forwarded to the computer by the E-Nose system. The E-Nose system collects data samples in 5-s intervals and forwards them to the computer. After that, the data is analyzed. The research protocol was given at Table 1. The sample sensor responses are shown in Fig. 4.

Table 1 Measurement protocol (values of O2 and N2O indicate liter amounts in a minute [l/min] and SADL indicates the sevoflurane anesthetic dose levels [% u] applied to the patient)
Fig. 4
figure 4

Sample sensor responses for QCM sensor-3 of 1-1-1, 2, 3, 4, 5, 6, 7, 8 measurements (L1, L2 , L3, L4, L5, L6, L7 and L8; the sevoflurane anesthetic dose levels)

The anesthetic dose level prediction using neural networks

A multi-layer feed-forward NN represents a nonlinear mapping between input vector and output vector through a system of simple interconnected neurons. It is fully connected to every node in the next and previous layer. The output of a neuron is scaled by the connecting weight and feed forward to become an input through a nonlinear activation function to the neurons in the next layer of the network [1214].

A MLNN is used for the anesthetic dose level prediction. The feed forward neural network structure used for this purpose is shown in Fig. 5. This network is a multilayer network (input layer, two hidden layers, and output layer). The hidden layer neurons and the output layer neurons use nonlinear sigmoid activation functions. In this system, seven inputs, frequency changes of the sensors, and one output, anesthetic dose level were used. Six different numbers of hidden layer neurons were used to find an optimum number of the neurons for the hidden layers.

Fig. 5
figure 5

Multilayer neural network structures for quantitative classification

The back propagation (BP) method known as gradient descent is widely used as a teaching method for a NN [12, 13]. The BP algorithm with momentum gives the change \( \Delta {\overrightarrow{W}} {\left( k \right)} \) in the weight vector of the connection between layers at iteration k as,

$$ \Delta {\overrightarrow{W}} {\left( k \right)} = - \alpha {\overrightarrow{g}} {\left( k \right)} + \mu \Delta {\overrightarrow{W}} {\left( {k - 1} \right)},{\text{where}}{\overrightarrow{g}} {\left( k \right)} = \frac{{\partial E{\left( {{\overrightarrow{W}} } \right)}}} {{\partial {\overrightarrow{W}} {\left( k \right)}}} $$
(2)

where α is called the learning coefficient, μ; the momentum coefficient, \( E{\overrightarrow{W}} \) is the mean squared error function, and \( \Delta {\overrightarrow{W}} {\left( {k - 1} \right)} \); the weight vector change in the preceding iteration.

A back propagation (BP) method is widely used as a teaching method for an ANN. The main advantage of the BP method is that the teaching performance is highly improved by the introduction of a hidden layer [12, 13].

Since the BP algorithm applies the steepest descent method to update the weights, it suffers from a slow convergence rate and often yields suboptimal solutions [1214]. A variety of related algorithms have been introduced to address that problem. A number of researchers have carried out comparative studies of NN training algorithms [10, 1214]. The Levenberg–Marquardt (LM) algorithm [13] used in this study is one of these type algorithms. In this section, some brief information about this training algorithm is given. More details about these training algorithms and their parameters can be found in [10, 13, 25].

Quasi-Newton (QN) is an advanced method of training multilayer perceptrons. The Newton algorithm is computed according to the following:

$$\begin{aligned} {\overrightarrow{W}} {\left( k \right)} = {\overrightarrow{W}} {\left( {k - 1} \right)} - {\overrightarrow{H}} {\left( k \right)}^{{ - 1}} {\overrightarrow{g}} {\left( k \right)} \\{\overrightarrow{H}} {\left( k \right)} = \frac{{\partial ^{2} E{\left( {{\overrightarrow{W}} } \right)}}}{{\partial ^{2} {\overrightarrow{W}} {\left( k \right)}}} \\ \end{aligned} $$
(3)

where, Hessian matrix \( {\overrightarrow{H}} {\left( k \right)} \) is the second derivative of the mean squared error \( E{\left( {{\overrightarrow{W}} } \right)} \) at the current values of the weights and biases.

Newton’s method converges faster than conjugate gradient methods. However, it is complex and thus expensive to compute \( {\overrightarrow{H}} {\left( k \right)} \) for feed forward network. The Quasi-Newton algorithm does not require the computation of the second derivatives. This algorithm approximates a \( {\overrightarrow{H}} {\left( k \right)} \) value at the each iteration of the algorithm. This approximation is computed as a function of the gradient.

The Levenberg–Marquardt method is an approximation to Newton’s method. The algorithm uses the second order derivatives of the mean squared error \( E{\left( {{\overrightarrow{W}} } \right)} \), so that better convergence behaviour is observed. LM implements the Levenberg–Marquardt algorithm, which is computed according to the following:

$$ {\overrightarrow{W}} {\left( k \right)} = {\overrightarrow{W}} {\left( {k - 1} \right)} - {\left( {{\overrightarrow{H}} {\left( k \right)} + \mu {\overrightarrow{l}} } \right)}^{{ - 1}} {\overrightarrow{g}} {\left( k \right)} $$
(4)

where, \( {\overrightarrow{H}} {\left( k \right)} \) is Hessian and \( {\overrightarrow{g}} {\left( k \right)} \) is the gradient of the mean squared error, μ is a scalar value and \( {\overrightarrow{I}} \) is a unit matrix.

When the scalar μ is zero, LM algorithm is just QN method, using the approximate Hessian matrix. When it is large, this becomes gradient descent with a small step size. QN method is faster and more accurate nearby the minimum error, so that the aim is to shift towards QN method as quickly as possible [12, 13]. An adaptive change in the μ parameter is performed similar to the modification of the adaptive learning rate in the BP algorithm. When a step would result in an increased performance function, μ is multiplied by a constant μ inc >1 to drive the algorithm towards the gradient descent algorithm and thus obtain more stability. On the other hand, when a step would result in a decreased performance function, μ is multiplied by \( \mu _{{{\text{inc}}}} = \raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {\mu _{{{\text{inc}}}} }}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{${\mu _{{{\text{inc}}}} }$} \) to drive the algorithm towards the QN method [13, 24]. In this study, μ inc parameter was taken as ten.

The global statistical performance evaluation criteria such as mean squared error (MSE) and correlation coefficient (R 2) were employed in this study. But these global statistics don’t provide information about distribution of the errors alone [10]. Therefore, in order to test robustness and appropriateness of the neural network structures, it is important to test the neural network structures using other performance evaluation criteria such as mean relative absolute error (E(RAE)) [911].

$$ E{\left( {RAE} \right)} = \frac{1} {{n_{{{\text{test}}}} }}{\sum\limits_{{\text{tetset}}} {{\left( {{\left| {\frac{{{\left( {SADL_{{{\text{predicted}}}} - SADL_{{{\text{true}}}} } \right)}}} {{SADL_{{{\text{true}}}} }}} \right|}} \right)}} }{\text{ }}\forall SADL_{{{\text{true}}}} \ne {\text{0}} $$
(5)

where, SADL predicted is the estimated sevoflurane anesthetic dose level, SADL true the real sevoflurane anesthetic dose level and n test is the number of test set data.

The MLNN structures were formed according to determined input and target data, and the MLNN performance was checked by the input and target data which were not used for training. The input and target data set which are necessary for MLNN was obtained according to protocol at Table 1. 87.5% of these data was used for training and 12.5% was used for testing. The data processing system is shown in Fig. 6. Sevoflurane anesthetic agent was used in this study.

Fig. 6
figure 6

Data processing system

The calculated frequency shifts Δf’s, recorded from seven QCM sensor responses were used as inputs and anesthetic dose level values were targets for ANN. Data was normalized before training. Maximum frequency value was found as 9,107 Hz from input values. Therefore, input values were divided by 500 for the normalization. Target values were between 1 and 8 (sevoflurane anesthetic dose levels). These values were normalized between 0.35 and 0.7. 441 of data was used for training and 63 of data was used for testing in this study.

Results and discussions

In this study, an E-Nose system was realized for the prediction of an anesthetic dose level which is applied to a patient. At the first step, a measurement and data preparation and flow control system described above was set up. The frequency shift data were obtained according to the measurement protocol. These data were prepared as training and test data for the MLNN structures.

At the first step of the study, one hidden layer used for the neural network structures, but the mean relative absolute error was high (about 12%). So, the numbers of the hidden layers were increased to two. To find an optimum number of the neurons for the hidden layers, six different numbers of hidden layer neurons were used. The MLNN performances were similar as seen at Table 2. The MLNN 1 structure’s performance was the best. And this MLNN has an acceptable [13, 23, 24] mean relative absolute error (5.00%) for the patient’s health in surgeries. So, we have used this MLNN for testing.

Table 2 The performances of the MLNN structures

The applied and predicted anesthetic dose levels for MLNN 1 structure can be seen at Fig. 7 and Table 3. The mean relative absolute error of the MLNN 1 was 5.00% for the test set. This mean relative absolute error is acceptable for the patient’s health in the surgeries. Some deviations seen in Fig. 7 were because of the manual adjustment of the anesthetic dose levels during the measurement. So, the performance of the ANN could be a bit better.

Fig. 7
figure 7

Comparison of applied and predicted anesthetic dose levels

Table 3 Applied and predicted average anesthetic dose levels for testing

Because these mean relative absolute error levels is negligibly small and would not posses a threat for the patient’s health, the used neural network structure can be used for the anesthetic dose level prediction in the surgeries.

In this study, it is easily seen that an acceptable estimation results can be achieved for the prediction of the anesthetic dose level which is applied to a patient using realised E-Nose system. In addition to the neural network based anesthetic dose level estimation, the E-Nose system performs the data acquisition and user interface tasks. The E-Nose system can easily be used for the prediction of the anesthetic dose level applied to a patient in the surgeries with a success rate of 95%.