Open Access
This article is

- freely available
- re-usable

*Sensors*
**2018**,
*18*(5),
1446;
https://doi.org/10.3390/s18051446

Article

Least Squares Neural Network-Based Wireless E-Nose System Using an SnO

_{2}Sensor ArrayDivision of Electronics and Electrical Engineering, Dongguk University-Seoul, Seoul 04620, Korea

^{*}

Author to whom correspondence should be addressed.

Received: 26 March 2018 / Accepted: 3 May 2018 / Published: 6 May 2018

## Abstract

**:**

Over the last few decades, the development of the electronic nose (E-nose) for detection and quantification of dangerous and odorless gases, such as methane (CH

_{4}) and carbon monoxide (CO), using an array of SnO_{2}gas sensors has attracted considerable attention. This paper addresses sensor cross sensitivity by developing a classifier and estimator using an artificial neural network (ANN) and least squares regression (LSR), respectively. Initially, the ANN was implemented using a feedforward pattern recognition algorithm to learn the collective behavior of an array as the signature of a particular gas. In the second phase, the classified gas was quantified by minimizing the mean square error using LSR. The combined approach produced 98.7% recognition probability, with 95.5 and 94.4% estimated gas concentration accuracies for CH_{4}and CO, respectively. The classifier and estimator parameters were deployed in a remote microcontroller for the actualization of a wireless E-nose system.Keywords:

gas sensor array; pattern recognition; artificial neural network; least squares; concentration estimation## 1. Introduction

The detection, recognition, and concentration estimation of toxic gases, such as methane (CH

_{4}) and carbon monoxide (CO), remain a significant problem for rapidly growing industrial states. The inflammability and carcinogenic nature of these odorless gases demands fast, efficient, and reliable safety measures because exposure beyond certain concentrations can cause diseases and even death. The danger levels of CH_{4}and CO, as per international standards, have been summarized in Tables S1 and S2, respectively. Therefore, the installment of wireless monitoring devices at vulnerable fields and places, such as in coal mines, food quality assessment, disease diagnosis, gas storage plants, and petroleum industries, has grown vital for environmental control and disaster prevention [1,2,3,4].Metal-oxide semiconductor-based gas sensors have been developed over the last few decades due to their high sensitivity, low power consumption, low cost, small size, and stability. Additional advantages include temperature controllability, on-chip integration facility, and the large number of gases these can detect [5]. Various oxides, including ZnO, Fe

_{2}O_{3}, SnO_{2}, Ga_{2}O_{3}, WO_{3}, and TiO_{2}, have shown responsivity to a range of gases such as H_{2}, O_{2}, NO, NH_{3}, H_{2}S, CO, CH_{4}, HCHO, C_{2}H_{5}OH, C_{2}H_{2}, CH_{3}SH, (CH_{3})_{3}N, and other volatile organic compounds [6,7,8,9]. Many companies such as City Technology, MicroChem, Nissha FIS, Inc., and SparkFun Electronics provide these sensors in various commercialized forms [10,11,12].The current paper utilizes SnO

_{2}-based commercial gas sensors for volatile combustible hydrocarbons, which change their electrical characteristics based on variations in atmospheric composition [13]. The design, applications, and material science of SnO_{2}sensors have been thoroughly investigated by many research groups [14,15,16]. Wang et al. discussed sensing mechanisms and influencing factors [17]. Although the sensors have high detection power, cross sensitivity requires a robust trained system that can classify target gases in a mixture with minimum ambiguity [18,19,20,21]. The SnO_{2}film also ages with time, humidity and temperature variations, and overexposure to target gases [22,23,24]. Thus, a self-adjustable scaling and calibration tool is required with a high precision concentration estimator.Many previous studies have already addressed the gas identification and concentration estimation problems, including implementation of fuzzy logic designs, multilayer perceptron, artificial neural networks (ANN), and principal component analysis [25,26,27,28,29,30,31]. Support vector machines (SVMs) have been recently employed for a least squares approach to estimate gas concentration [32,33,34,35]. Varun et al. presented a conjugate gradient neural network (CGNN) based manhole gas detection system [36]. Various pattern recognition tools have been used for classification of odorless gases [37]. Srivastava introduced a mean and variance-based method for data transformation [38]. To cater for the instability of gas sensors, noise measurements and optimization approaches have been investigated [39,40,41]. Linear least squares and nonlinear SVM classifiers have been previously compared using a single electrolytic gas sensor [42].

This study exploited sensor array characteristics and mean centering prior to the application of two principal techniques: ANN and least squares regression (LSR). After preprocessing the sensor signals, the ANN classifier was designed on MATLAB

^{®}, providing better identification performance than raw data acquired from the sensors. The quality assurance of ANN showed 98.7% classification accuracy, which is a hallmark with the usage of cheap, cross sensitive, and aging sensors. Subsequent LSR estimated gas concentrations had 95.5 and 94.4% minimum accuracies, which is superior to conventional linear, polynomial, or logarithmic regression.This paper is organized as follows. Section 2 describes the proposed electronic nose (E-nose) and experimental details. We provide a detailed overview of the data centering approach prior to ANN implementation for gas type classification, followed by the subsequent LSR to estimate the concentration. Section 3 discusses outcomes from this proposed approach. Finally, Section 4 summarizes the research findings and conclusions.

## 2. Materials and Methods

#### 2.1. Experimental Setup

#### 2.1.1. Gas Sensor Setup

We employed an array of SnO

_{2}gas sensors specialized for CH_{4}and CO detection. Variations in the metal-oxide semiconductor electrical properties arise from adsorption of gas molecules. Initially, oxygen from the air gets adsorbed onto the SnO_{2}surface and a transfer of electrons from SnO_{2}to oxygen takes place. This depletes electrons in the SnO_{2}surface region, increasing its resistance. In the presence of CH_{4}or CO, oxygen ions chemically react with injected gas particles, releasing electrons that transfer back to the near SnO_{2}surface. This decreases the material resistance and provides the sensor response [6,13,16].A single sensor is not highly selective in its response but detects a wide range of compounds. Therefore, an array of different sensors is commonly employed to detect and identify gases, generating recognizable patterns for different analytes [7]. In particular, we employed commercially available MQ-4 and MQ-7 sensors due to their relatively high sensitivity for volatile organic gases [18,19]. Since the gas sensor response is severely affected by environmental changes, an auxiliary DHT11 sensor was included to monitor temperature and humidity [43]. Table 1 shows the sensor specifications used in the proposed E-nose system.

The chemisorption ability of SnO

_{2}in the presence of detectable gases varies with respect to the type of analyte. The datasheets of MQ-4 and MQ-7 demonstrate the sensor resistance plot against the concentration of various gases [18,19]. It is clearly manifested that, in the presence of CH_{4}and CO, MQ-4 has higher sensitivity for CH_{4}whereas MQ-7 is more responsive to CO.#### 2.1.2. System Setup

Figure 1 shows the hardware setup of the proposed E-nose system. After providing electrical connections, three each MQ-4 and MQ-7 sensors were placed in an experimental chamber with 100 L internal volume, which was a slave node. A vacuum pump removed the remaining gaseous contents in the chamber before and after each experiment. A mass flow controller (MFC) with a graphical user interface (GUI) was attached to CH

_{4}, CO and N_{2}gas cylinders. A data acquisition (DAQ) device with plug-and-play connectivity via RS232 protocol was used to acquire and log data, with inputs for gas, temperature, and humidity sensors. The MFC and DAQ were connected to the master node, which was a computer featured with prototyping, algorithm development, and code generation tools for fast and efficient real-time signal processing.#### 2.2. Sample Preparation

The MFC operated on standard cubic centimeter per minute (sccm) and standard liter per minute (slm) flow units, with selected flow rates 30 sccm, 6 sccm, and 10 slm for CH

_{4}, CO, and N_{2}, respectively. Since the metal-oxide sensors require oxygen to function, ambient atmosphere was provided before injecting the target gases.Owing to a plethora of health and environmental hazards associated with these gases, as described in Tables S1 and S2, the experimental range was set to 0–1200 ppm and 0–200 ppm for CH

_{4}and CO, respectively. A total of 20 CH_{4}samples were tested for 24 concentrations ranging from 0 to 1200 ppm (50 ppm intervals), producing 480 data points; whereas 15 CO samples were tested for 20 concentrations ranging from 0 to 200 ppm (10 ppm intervals), producing 300 data points. Each data point constituted the analog outputs from all sensors in the array. An MFC GUI input control was used to automate the process. Both gases were injected in pure form, with equal time intervals and gas increments to analyze the sensor array collective response pattern. Temperature and humidity were maintained at 22 °C and 40% RH, respectively.#### 2.3. Data Acquisition and Preprocessing

A DAQ toolbox with a supporting GUI was employed to read, display, and log analog voltages from the six gas sensors and one auxiliary sensor. The sampling rate was set to one reading per second until the system was trained.

The raw experimental data were first analyzed and inspected visually. Each sensor had initial air resistance, R

_{0}, that decreased to R_{s}in the presence of the detectable gas. R_{0}and R_{s}were different for each sensor, producing different output voltages from similar sensors, hence producing similar waveforms but different offsets and means, as shown in Figure 2.Let X
and

_{i}be the feature matrix of raw data acquired from the k = 1, 2, …, 6 sensors for i samples, where
$$\mathrm{i}=\{\begin{array}{c}1,2,3,\dots \dots ,24\text{}\mathrm{for}\text{}{\mathrm{CH}}_{4}\text{}\mathrm{gas}\\ 1,2,3,\dots \dots ,20\mathrm{for}\mathrm{CO}\mathrm{gas}\end{array},$$

$${\mathrm{X}}_{\mathrm{i}}=\left[\begin{array}{cccccc}{\mathrm{X}}_{11}& {\mathrm{X}}_{12}& {\mathrm{X}}_{13}& {\mathrm{X}}_{14}& {\mathrm{X}}_{15}& {\mathrm{X}}_{16}\\ {\mathrm{X}}_{21}& {\mathrm{X}}_{22}& {\mathrm{X}}_{23}& {\mathrm{X}}_{24}& {\mathrm{X}}_{25}& {\mathrm{X}}_{26}\\ \dots & \dots & \dots & \dots & \dots & \dots \\ \dots & \dots & \dots & \dots & \dots & \dots \\ \dots & \dots & \dots & \dots & \dots & \dots \\ {\mathrm{X}}_{\mathrm{i}\mathrm{k}}& {\mathrm{X}}_{\mathrm{i}\mathrm{k}}& {\mathrm{X}}_{\mathrm{i}\mathrm{k}}& {\mathrm{X}}_{\mathrm{i}\mathrm{k}}& {\mathrm{X}}_{\mathrm{i}\mathrm{k}}& {\mathrm{X}}_{\mathrm{i}\mathrm{k}}\end{array}\right].$$

The sensors were scaled and centered around the same mean to increase E-nose accuracy. The standard deviation (S

_{d}) and mean (M) were calculated for six sensors. The raw data X_{ik}was normalized to get X_{nk}as per Equation (3):
X

_{nk}= (X_{ik}− M)/S_{d},This results in the formation of normalized data matrix, X

_{n}, given by Equation (4):
$${\mathrm{X}}_{\mathrm{n}}=\left[\begin{array}{cccccc}{\mathrm{X}}_{11}& {\mathrm{X}}_{12}& {\mathrm{X}}_{13}& {\mathrm{X}}_{14}& {\mathrm{X}}_{15}& {\mathrm{X}}_{16}\\ {\mathrm{X}}_{21}& {\mathrm{X}}_{22}& {\mathrm{X}}_{23}& {\mathrm{X}}_{24}& {\mathrm{X}}_{25}& {\mathrm{X}}_{26}\\ \dots & \dots & \dots & \dots & \dots & \dots \\ \dots & \dots & \dots & \dots & \dots & \dots \\ \dots & \dots & \dots & \dots & \dots & \dots \\ {\mathrm{X}}_{\mathrm{n}\mathrm{k}}& {\mathrm{X}}_{\mathrm{n}\mathrm{k}}& {\mathrm{X}}_{\mathrm{n}\mathrm{k}}& {\mathrm{X}}_{\mathrm{n}\mathrm{k}}& {\mathrm{X}}_{\mathrm{n}\mathrm{k}}& {\mathrm{X}}_{\mathrm{n}\mathrm{k}}\end{array}\right].$$

This global method for sensor normalization sets the mean at the origin and variance within the data to 1. The data was further range scaled to set dynamic range to [0, 1]. The preprocessed sensor data correspond to i samples taken at different gas concentration levels. Thus, the target output vector T, encompassing the actual gas concentration values, is

$$\mathrm{T}=\left[\begin{array}{c}{\mathrm{T}}_{1}\\ {\mathrm{T}}_{2}\\ \dots \\ \dots \\ \dots \\ {\mathrm{T}}_{\mathrm{i}}\end{array}\right].$$

#### 2.4. Artificial Neural Network for Classification

Inspired by the biological nervous systems, ANNs were designed to process raw data or information using a vast network of neurons or nodes where all nodes are interconnected, and the signal path is called a synapse. Typically, these signals are real numbers and the nodes calculate outputs using linear or non–linear functions. The operations are performed on raw data in different layers, including an input layer, hidden layer, and output layer [44].

Despite M and S

_{d}variations, each sensor type has selective behavior, high responsivity, and similar waveforms to one particular gas, which were exploited in gas recognition neural networks [29,38,45]. The normalized signals from the gas sensor array were input to a feedforward ANN designed in MATLAB^{®}with six input neurons corresponding to the sensor arrays, twelve neurons in the hidden layers, and two output neurons corresponding to the identification result of both gases, as shown in Figure 3.Considering the given data set as D = {(X

_{n}, T)}, where X_{n}is the normalized data for six sensors’ array and T is the target value, the input layer was fed with two data sets, one for each gas. A total of 500 data pairs from the experiments of each analyte were used. In these pairs, 300 belonged to CH_{4}experiments whereas 200 were from CO experiments. This data was divided randomly into training groups using 70% of the data, a validation group using 15% of the data, and a test group using 15% of the data. The six input neurons received X_{n}and transmitted it to hidden layer.The hidden layer was composed of twelve neurons. Inside these neurons, every data pair was assigned weight (w

_{k}) and bias (b_{k}) to input X_{nk}and then subjected to a function, g(X_{n}), which was a non-linear hyperbolic tangent sigmoid function such that g(X_{n}) approached T, as described in Equation (6):
$$\mathrm{g}\left({\mathrm{X}}_{\mathrm{n}}\right)={\sum}_{\mathrm{k}=1}^{6}\mathrm{f}\left[{\mathrm{w}}_{\mathrm{k}}\times \left({\mathrm{X}}_{\mathrm{nk}}\right)+{\mathrm{b}}_{\mathrm{k}}\right].$$

The network was trained iteratively to reassign w

_{k}and b_{k}in each signal to produce the desired output value, which was the gas type. The network performance was assessed using a loss or cost factor (C) which was the mean square error (MSE). It is the average of squared errors between the target output (T) and the calculated network output (g(X_{n})) for N number of outputs. This factor was calculated using Equation (7):
$$\mathrm{C}=\mathrm{MSE}=\frac{1}{\mathrm{N}}{\sum}_{1}^{\mathrm{N}}{\left(\mathrm{g}\left({\mathrm{X}}_{\mathrm{n}}\right)-\mathrm{T}\right)}^{2}.$$

The changes in updated values were dependent on the cost factor change with respect to previous w
where ∂C/∂w

_{k}and b_{k}values. A decreasing error produced a smaller change from preceding values and vice versa. If the desired accuracy was not achieved, the algorithm updated w_{k}values in the next iteration as:
w

_{k+1}= w_{k}+ ἠ ∂C/∂w_{k},_{k}is the gradient of error with respect to previous weights and ἠ is the learning rate that determines the amount of weight adjustment when the values are updated. A larger ἠ causes large changes in previous values and vice versa. The bias vector (b) followed the same upgradation criteria. The iteration count, in which all the vectors are used to update the w_{k}and b_{k}values, is called the epoch.The momentum factor (Mu) determines the network training speed, and the optimal value can be found by trial and error. Table 2 shows minimum assigned performance factor and gradient, and maximum epochs, Mu, and validation checks to enhance network convergence and limit iterations. Training was terminated when any of the conditions were met.

The output layer was a linear transfer function to generate signals for the two output neurons. Each neuron detected the presence of one of the gases as a digital signal (0 or 1). The first neuron, for example, was reserved for CH

_{4}detection and an output signal ~1 or ~0 meant the presence or absence of this gas, respectively. The final weights and biases for all neurons were stored in the network as w and b arrays, respectively, and exported to a microcontroller to provide a wireless and portable system.#### 2.5. Least Squares Regression to Estimate Concentrations

A concentration estimator was required after identifying the target gas for quantitative analysis of the analyte. However, the data was non-linear and, hence, unsuitable for simple mathematical models. Therefore, we used the Levenberg–Marquardt algorithm for the LSR of datum pairs [46,47,48]. An independent variable (X

_{n}), which was a preprocessed analog signal from sensors, and a dependent variable (T), which was a corresponding target gas concentration, constituted the LSR inputs. We devised an iterative procedure to produce a mathematical model using MATLAB^{®}fitting tools.The goal was to derive coefficients (p) of a non-linear function (f) for each sensor that minimized the sum of squares of deviations from the target value. The mathematical representation of the problem statement is expressed as:

argmin (∑ [T − f(X

_{n},p)]^{2}).Since no single function is applicable to the whole sensor array, separate parameter vectors were calculated for each sensor, producing a set of six functions with their respective parameters,
where f

$$\mathrm{f}({\mathrm{X}}_{\mathrm{n}},\mathrm{p})=\{\begin{array}{c}{\mathrm{f}}_{1}({\mathrm{X}}_{\mathrm{n}},{\mathrm{p}}_{1}),\text{}\mathrm{Sensor}\text{}1\\ {\mathrm{f}}_{2}({\mathrm{X}}_{\mathrm{n}},{\mathrm{p}}_{2}),\text{}\mathrm{Sensor}\text{}2\\ {\mathrm{f}}_{3}({\mathrm{X}}_{\mathrm{n}},{\mathrm{p}}_{3}),\text{}\mathrm{Sensor}\text{}3\\ {\mathrm{f}}_{4}({\mathrm{X}}_{\mathrm{n}},{\mathrm{p}}_{4}),\text{}\mathrm{Sensor}\text{}4\\ {\mathrm{f}}_{5}({\mathrm{X}}_{\mathrm{n}},{\mathrm{p}}_{5}),\text{}\mathrm{Sensor}\text{}5\\ {\mathrm{f}}_{6}({\mathrm{X}}_{\mathrm{n}},{\mathrm{p}}_{6}),\text{}\mathrm{Sensor}\text{}6\end{array},$$

_{k}was predefined, and the algorithm only calculated the parameters. As the sensor response pattern is unique for both gases therefore, two separate sets of functions and their parameters were devised. The type of model selected for LSR depended on the gas identified through ANN. The parameters were stored and used in the proposed wireless E-nose to estimate concentrations.#### 2.6. Emergency Alarm System

Arduino Mega, an ATmega2560-based microcontroller, was connected to the gas sensor array with common power and ground connections [49]. The microcontroller connected to the computer via a USB and was programmed using C for gas classification and concentration estimation. The vectors M, S

_{d}, w, b, and p were stored in the microcontroller to implement the wireless E-nose and emergency alarm system. An LCD and buzzer were attached to monitor system output. Figure 4 shows the proposed E-nose system schematic.The microcontroller reads all the stored vectors when initialized. The raw sensor data X

_{i}is acquired in real-time and normalized. Gas presence was identified using ANN gas classification and concentration was then estimated using the LSR estimator. The results were displayed on the LCD and could be used as alarm inputs if the concentration exceeded dangerous levels. Figure 5 shows the proposed wireless E-nose flowchart.## 3. Results and Discussion

#### 3.1. Normalizing and Mean Centering

The MQ-4 detection range starts from 300 ppm of CH

_{4}, whereas that of MQ-7 starts from 20 ppm of CO. This is the minimum detection limit of the proposed E-nose system. Although there is a wide range of detectable gases for both sensors, this study mainly focused on higher selectivity for CH_{4}(MQ-4) and CO (MQ-7), which can be made more noticeable through normalization.Figure 6 summarizes the normalized data (from Equation (3)), highlighting the similar and overlapping patterns generated by the sensors under the same conditions.

#### 3.2. Feature Extraction and Classification

The ANN consisted of an input layer that received normalized data from three MQ-4 and three MQ-7 sensors. The individual sensor patterns may not be selective, but the collective response of the whole array became predictable once the network was trained. The sensor array characteristic pattern in the presence of a particular gas is tantamount to a signature, which can be effectively learnt with sufficient training data.

To visually analyze the pattern, 0–1200 ppm CH

_{4}was injected in 50 ppm increments for each experiment. The recurrence of the same cycle each day for eight consecutive days generated a three-dimensional plot of sensor array behavior. Figure 7 shows the sensor array response plotted against gas concentration and the number of days when subjected to repetitive cycles of CH_{4}. Similarly, there is a unique collective pattern for CO identification. The sensor array was subjected to an iterative procedure of CO gas injections ranging from 0 to 200 ppm for six consecutive days. The three-dimensional plot of the sensor array’s response against the number of days and CO concentration values is shown in Figure 8. MQ-4 and MQ-7 sensors are sensitive to both gases, but the higher selectivity of MQ-4 for CH_{4}and MQ-7 for CO is evident through steepness of the plots in Figure 7 and Figure 8, respectively. It should be noted that these plots are raw sensor data before normalization and, therefore, the dynamic range of all sensors has prominent diversity. Although the waveforms cannot be defined by linear, polynomial, or exponential expressions, the group responses successfully trained the ANN to recognize gas types.#### 3.3. Quality Assurance/Quality Control

The testing and validation results showed that the ANN distinguished gas signatures with improved performance after each iteration. This is because the MSE for the validation subset decreased from 1.4477 to 0.18 and, finally, to 0.09 in three consecutive training procedures. The final MSE value, which is a promising factor in assuring the quality of the classifier, was attained at epoch 3, thereby successfully identifying the gas type. To further inspect the validity for quality control, a confusion matrix for the classifier was obtained using 43 CH

_{4}cases and 32 CO cases, as shown in Figure S1.The matrix rows correspond to the network output or predicted gas class 1 and 2 for CH

_{4}and CO, respectively, and the columns represent the target class or actual gas type. The first two diagonal cells show the number and percentage of correct classifications by the ANN, and the off-diagonal cells correspond to incorrectly classified gas types. The column on the far right shows the percentages of the classes which are classified correctly and incorrectly. Out of 43 CH_{4}cases, 42 (97.7%) were correctly predicted and only 1 (2.3%) was predicted as CO gas. Similarly, all 32 (100%) CO cases were correctly classified. The cell at the bottom right of the plot shows the overall accuracy of the classification as 98.7% with an error rate of 1.3%.#### 3.4. Estimated Gas Concentrations Using Least Squares Regression

The concentration was estimated after gas type classification using LSR. The dataset was split into training, validation, and test subsets using 70, 15 and 15% data respectively. A regression plot was created in MATLAB

^{®}which showed the relationship between outputs of LSR and the desired target value. Here, the calculated gas concentration was denoted by Y and the target gas concentration by T.Figure 9 and Figure 10 are regression plots which show CH

_{4}and CO concentration estimate accuracy, respectively, where the horizontal axis is the target concentration and the vertical axis is the LSR-based estimated concentration. Ideally, LSR estimated values would be identical to the target values (i.e., Y ≡ T), which would generate a unitary correlation coefficient (R = 1), as shown by the dotted line in the regression plots. However, the original data (circles) does not fit perfectly, with several significant deviations from the dotted line. Such outliers are defined by the output-target relationship mentioned along the vertical axis. For example, a relatively larger magnitude of error in the validation subset of CO gas in Figure 10 is described by the expression (Output~ = 0.96*Target + −2.4) with a scale factor of 0.96 and an offset of −2.4.Figure 9 shows that the CH

_{4}concentration estimate achieved R = 99.995%, 99.995%, and 99.989% fit for the training, validation, and test groups, respectively. Therefore, an average of 99.985% match in the target and network output was achieved. Figure 10 shows that the CO concentration estimate achieved R = 99.999%, 99.988%, and 99.855% fit for the training, validation, and test groups, respectively. Hence, an average of 99.901% match in the target and network outputs was attained.Table 3 shows the LSR-based concentration estimates for both gases. The minimum accuracy was 95.5 and 94.4% for CH

_{4}and CO, respectively. The statistical significance of these experimental results is also evident in Figures S2 and S3, with sum of squared errors (SSE), root mean square error (RMSE), and error bars representing the standard deviation and standard error. However, the accuracy was attained for constant ambient conditions, the same sensor set, and a very short time span. In practice, sensor aging will become significant after prolonged exposure to high gas concentrations, inevitably impacting long-term accuracy. Also, any new set of sensors has to be calibrated and normalized before use. In these cases, retraining the algorithm would be a promising factor in ensuring E-nose efficiency.The proposed E-nose system combines pattern recognition and LSR, delivering a high accuracy real-time monitoring system. Regression was greatly simplified by implementing the prior recognition procedure. The stored vectors as a result of classifier and estimator training were imported to the microcontroller and subjected to the same data sets. The real-time implementation means the proposed E-nose would be suitable for remote monitoring.

## 4. Conclusions

This study developed a wireless E-nose using an array of commercially available SnO

_{2}gas sensors. An ANN was designed and employed using pattern recognition techniques to independently classify the presence of two toxic analytes, CH_{4}and CO, with 98.7% accuracy. A least squares regressor, trained as a gas concentration estimator, was implemented using the Levenberg–Marquardt algorithm. The trained network a had high recognition probability for both gases, and the subsequent LSR estimator achieved 95.5% and 94.4% minimum accuracies for CH_{4}and CO, respectively. The achieved model has a potential to detect various gas combinations by inserting a third output node in ANN to categorize “mixtures”, which will be addressed in our future study. Also, the same sensors and model can be retrained for other detectable gases such as LPG, H_{2}, alcohol, and smoke. The derived ANN and LSR parameters were exported to a wireless microcontroller board. Hence, the proposition of two highly effective strategies to exploit the group behavior of the sensor array made it possible to actualize a real-time and precise wireless E-nose system.## Supplementary Materials

The following are available online at https://www.mdpi.com/1424-8220/18/5/1446/s1. Table S1: CH

_{4}concentration and safety level according to flammability risk, Table S2: CO concentration and associated health hazard according to international standards, Figure S1: Confusion matrix for ANN, Figure S2: Statistical evaluation of CH_{4}with SSE, RMSE, and error bars, Figure S3: Statistical evaluation of CO with SSE, RMSE, and error bars.## Author Contributions

A.S. and H.-S.K. conceived the research idea and developed the algorithm. A.S. and J.-H.C. conducted all the experiments and collected the data. A.u.H.S.R. analyzed the data and helped in writing up the manuscript. H.-S.K. planned and supervised the whole project. All authors contributed to discussing the results and writing the manuscript.

## Funding

This research was funded by Ministry of Trade, Industry and Energy (MOTIE, Korea) under the Technology Innovation Program (No. 10073122).

## Conflicts of Interest

The authors declare no competing financial interests.

## References

- Llobet, E.; Hines, E.L.; Gardner, J.W.; Franco, S. Non-destructive banana ripeness determination using a neural network-based electronic nose. Meas. Sci. Technol.
**1999**, 10, 538–548. [Google Scholar] [CrossRef] - Casalinuovo, I.; Pierro, D. Application of Electronic Noses for Disease Diagnosis and Food Spoilage Detection. Sensors
**2006**, 6, 1428–1439. [Google Scholar] [CrossRef] - Hanson, C.W., III. Method and System of Diagnosing Intrapulmonary Infection using an Electronic Nose. U.S. Patent 6,620,109, 19 September 2003. [Google Scholar]
- Turner, A.P.; Magan, N. Electronic noses and disease diagnostics. Nat. Rev. Microbiol.
**2004**, 2, 161–166. [Google Scholar] [CrossRef] [PubMed] - Hong, H.K.; Shin, H.W.; Park, H.S.; Yun, D.H.; Kwon, C.H.; Lee, K.; Kim, S.T.; Moriizumi, T. Gas identification using micro gas sensor array and neural-network pattern recognition. Sens. Actuators B Chem.
**1996**, 33, 68–71. [Google Scholar] [CrossRef] - Zakrzewska, K. Mixed oxides as gas sensors. Thin Solid Films
**2001**, 391, 229–238. [Google Scholar] [CrossRef] - Keith, F.E. Resolving combustible gas mixtures using gas sensitive resistors with arrays of electrodes. J. Chem. Soc. Faraday Trans.
**1996**, 92, 4497–4504. [Google Scholar] - Rana, A.S.; Kang, M.; Kim, H.S. Microwave-assisted facile and ultrafast growth of ZnO nanostructures and proposition of alternative microwave-assisted methods to address growth stoppage. Sci. Rep.
**2016**, 6, 24870. [Google Scholar] [CrossRef] [PubMed] - Bielanski, A.; Deren, J.; Haber, J. Electric conductivity and catalytic activity of semiconducting oxide catalysts. Nature
**1957**, 179, 668–669. [Google Scholar] [CrossRef] - Nissha FIS, Inc. Available online: http://www.fisinc.co.jp (accessed on 29 January 2018).
- City Technology Ltd. Global Leaders in Gas Sensor Technology. Available online: http://www.citytech.com (accessed on 29 January 2018).
- MicroChem: Innovative Chemical Solutions for MEMS and Microelectronics. Available online: http://www.microchem.com (accessed on 29 January 2018).
- Harrison, P.G.; Willett, M.J. The mechanism of operation of tin (IV) oxide carbon monoxide sensors. Nature
**1988**, 332, 337–339. [Google Scholar] [CrossRef] - Barsan, N.; Schweizer-Berberich, M.; Gopel, W. Fundamental and practical aspects in the design of nanoscaled SnO
_{2}gas sensors: A status report. Fresenius J. Anal. Chem.**1999**, 365, 287–304. [Google Scholar] [CrossRef] - Ihokura, K.; Watson, J. The Stannic Oxide Gas Sensor: Principles and Applications; CRC Press: Boca Raton, FL, USA, 1994; ISBN 0849326044. [Google Scholar]
- Batzill, M.; Diebold, U. The surface and materials science of tin oxide. Prog. Surf. Sci.
**2005**, 79, 47–154. [Google Scholar] [CrossRef] - Wang, C.; Yin, L.; Zhang, L.; Xiang, D.; Gao, R. Metal oxide gas sensors: Sensitivity and influencing factors. Sensors
**2010**, 10, 2088–2106. [Google Scholar] [CrossRef] [PubMed] - SparkFun Electronics. (Model:MQ-4). Available online: https://cdn.sparkfun.com/datasheets/Sensors/Biometric/MQ-4%20Ver1.3%20-%20Manual.pdf (accessed on 29 January 2018).
- SparkFun Electronics. (Model:MQ-7). Available online: https://cdn.sparkfun.com/datasheets/Sensors/Biometric/MQ-7%20Ver1.3%20-%20Manual.pdf (accessed on 29 January 2018).
- Pololu Robotics and Electronics. Available online: https://www.pololu.com/file/0J309/MQ2.pdf (accessed on 29 January 2018).
- MQ-9 Semiconductor Sensor for CO/Combustible GAS. Available online: http://www.haoyuelectronics.com/Attachment/MQ-9/MQ9.pdf (accessed on 29 January 2018).
- Suematsu, K.; Ma, N.; Watanabe, K.; Yuasa, M.; Kida, T.; Shimanoe, K. Effect of Humid Aging on the Oxygen Adsorption in SnO
_{2}Gas Sensors. Sensors**2018**, 18, 254. [Google Scholar] [CrossRef] [PubMed] - Yamazoe, N.; Fuchigami, J.; Kishikawa, M.; Seiyama, T. Interactions of tin oxide surface with O
_{2}, H_{2}O and H_{2}. Surf. Sci. Rep.**1979**, 86, 335–344. [Google Scholar] [CrossRef] - Tamaki, J.; Nagaishi, M.; Teraoka, Y.; Miura, N.; Yamazoe, N.; Moriya, K.; Nakamura, Y. Adsorption behavior of CO and interfering gases on SnO
_{2}. Surf. Sci. Rep.**1989**, 221, 183–196. [Google Scholar] [CrossRef] - Wei, C.H.; Fahn, C.S. The multisynapse neural network and its application to fuzzy clustering. IEEE Trans. Neural Netw.
**2002**, 13, 600–618. [Google Scholar] [PubMed] - Brezmes, J.; Cabre, P.; Rojo, S.; Llobet, E.; Vilanova, X.; Correig, X. Discrimination between different samples of olive oil using variable selection techniques and modified fuzzy artmap neural networks. IEEE Sens. J.
**2005**, 5, 463–470. [Google Scholar] [CrossRef] - Zhang, L.; Tian, F. Performance study of multilayer perceptrons in a low-cost electronic nose. IEEE Trans. Instrum. Meas.
**2014**, 63, 1670–1679. [Google Scholar] [CrossRef] - Pardo, M.; Sberveglieri, G. Remarks on the use of multilayer perceptrons for the analysis of chemical sensor array data. IEEE Sens. J.
**2004**, 4, 355–363. [Google Scholar] [CrossRef] - Aguilera, T.; Lozano, J.; Paredes, J.A.; Alvarez, F.J.; Suarez, J.I. Electronic nose based on independent component analysis combined with partial least squares and artificial neural networks for wine prediction. Sensors
**2012**, 12, 8055–8072. [Google Scholar] [CrossRef] [PubMed] - Buratti, S.; Benedetti, S.; Scampicchio, M.; Pangerod, E.C. Characterization and classification of Italian Barbera wines by using an electronic nose and an amperometric electronic tongue. Anal. Chim. Acta
**2004**, 525, 133–139. [Google Scholar] [CrossRef] - Cheng, H.; Qin, Z.H.; Guo, X.F.; Hu, X.S.; Wu, J.H. Geographical origin identification of propolis using GC–MS and electronic nose combined with principal component analysis. Food Res. Int.
**2013**, 51, 813–822. [Google Scholar] [CrossRef] - Pardo, M.; Sberveglieri, G. Classification of electronic nose data with support vector machines. Sens. Actuators B Chem.
**2005**, 107, 730–737. [Google Scholar] [CrossRef] - Suykens, J.A.; Vandewalle, J. Least squares support vector machine classifiers. Neural Process. Lett.
**1999**, 9, 293–300. [Google Scholar] [CrossRef] - Peng, S.; Xu, Q.; Ling, X.B.; Peng, X.; Du, W.; Chen, L. Molecular classification of cancer types from microarray data using the combination of genetic algorithms and support vector machines. FEBS Lett.
**2003**, 555, 358–362. [Google Scholar] [CrossRef] - Machado, R.F.; Laskowski, D.; Deffenderfer, O.; Burch, T.; Zheng, S.; Mazzone, P.J.; Mekhail, T.; Jennings, C.; Stoller, J.K.; Pyle, J.; et al. Detection of lung cancer by sensor array analyses of exhaled breath. Am. J. Respir. Crit. Care Med.
**2005**, 171, 1286–1291. [Google Scholar] [CrossRef] [PubMed] - Ojha, V.K.; Dutta, P.; Chaudhuri, A.; Saha, H. Study of various conjugate gradient based ann training methods for designing intelligent manhole gas detection system. In Proceedings of the IEEE 2013 International Symposium on Computational and Business Intelligence (ISCBI), New Delhi, India, 24–26 August 2013; pp. 83–87. [Google Scholar]
- Srivastava, A.K.; Srivastava, S.K.; Shukla, K.K. On the design issue of intelligent electronic nose system. In Proceedings of the IEEE International Conference on Industrial Technology 2000, Goa, India, 19–22 January 2000; pp. 243–248. [Google Scholar]
- Srivastava, A.K. Detection of Volatile Organic Compounds (VOCs) Using SnO
_{2}Gas-Sensor Array and Artificial Neural Network. Sens. Actuators B Chem.**2003**, 96, 24–37. [Google Scholar] [CrossRef] - Osowski, S.; Siwek, K.; Grzywacz, T.; Brudzewski, K. Differential electronic nose in on-line dynamic measurements. Metrol. Meas. Syst.
**2014**, 21, 649–662. [Google Scholar] [CrossRef] - Kotarski, M.; Smulko, J. Noise measurement set-ups for fluctuations-enhanced gas sensing. Metrol. Meas. Syst.
**2009**, 16, 457–464. [Google Scholar] - Korotcenkov, G.; Cho, B.K. Engineering approaches for the improvement of conductometric gas sensor parameters. Part 1. Improvement of sensor sensitivity and selectivity (short survey). Sens. Actuators B Chem.
**2013**, 188, 709–728. [Google Scholar] [CrossRef] - Kalinowski, P.; Wozniak, L.; Strzelczyk, A.; Jasinski, P.; Jasinski, G. Efficiency of linear and nonlinear classifiers for gas identification from electrocatalytic gas sensor. Metrol. Meas. Syst.
**2013**, 20, 501–512. [Google Scholar] [CrossRef] - Micropik. Available online: http://www.micropik.com/PDF/dht11.pdf (accessed on 12 March 2018).
- Hagan, M.T.; Demuth, H.B.; Beale, M.H. Neural Network Design; PWS Publishing Co: Boston, MA, USA, 1996; Volume 20, ISBN 0534943322. [Google Scholar]
- Kim, E.; Lee, S.; Kim, J.H.; Kim, C.; Byun, Y.T.; Kim, H.S.; Lee, T. Pattern recognition for selective odor detection with gas sensor arrays. Sensors
**2012**, 12, 16262–16273. [Google Scholar] [CrossRef] [PubMed] - Rodriguez-Quinonez, J.C.; Sergiyenko, O.; Gonzalez-Navarro, F.F.; Basaca-Preciado, L.; Tyrsa, V. Surface recognition improvement in 3D medical laser scanner using Levenberg–Marquardt method. Signal Process.
**2013**, 93, 378–386. [Google Scholar] [CrossRef] - Çelik, O.; Teke, A.; Yildirim, H.B. The optimized artificial neural network model with Levenberg–Marquardt algorithm for global solar radiation estimation in Eastern Mediterranean Region of Turkey. J. Clean Prod.
**2016**, 116, 1–12. [Google Scholar] [CrossRef] - Mukherjee, I.; Routroy, S. Comparing the performance of neural networks developed by using Levenberg–Marquardt and Quasi-Newton with the gradient descent algorithm for modelling a multiple response grinding process. Expert Syst. Appl.
**2012**, 39, 2397–2407. [Google Scholar] [CrossRef] - Arduino. Available online: https://www.arduino.cc/en/Main/ArduinoBoardMega2560?setlang=en (accessed on 29 January 2018).

Sensor | Sensor Model | Detecting Materials ^{1} | Range |
---|---|---|---|

CH_{4} | MQ-4 | CH_{4}, LPG, H_{2}, CO, Alcohol, smoke | 300–10,000 ppm CH_{4} |

CO | MQ-7 | CO, H_{2}, LPG, CH_{4}, Alcohol | 10–500 ppm CO |

Temperature and Humidity | DHT11 | Temperature, Humidity | 20–90% RH 0–50 °C |

^{1}In order of decreasing sensitivity.

Training Parameter | Assigned Value |
---|---|

Epochs | 1000 |

Performance (MSE) | 0.00 |

Gradient | 1.00 × 10^{−7} |

Mu | 1.00 × 10^{10} |

Validation Checks | 20 |

CH_{4} | CO | ||||
---|---|---|---|---|---|

Injected (ppm) | LSR Estimate (ppm) | Accuracy (%) | Injected (ppm) | LSR Estimate (ppm) | Accuracy (%) |

50 | 51.3 | 97.3 | 10 | 10.4 | 95.8 |

100 | 102.0 | 97.9 | 20 | 21.1 | 94.7 |

150 | 156.0 | 95.9 | 30 | 28.9 | 96.6 |

200 | 193.0 | 96.5 | 40 | 37.7 | 94.4 |

250 | 241.9 | 96.7 | 50 | 47.9 | 95.9 |

300 | 313.3 | 95.5 | 60 | 61.9 | 96.6 |

350 | 358.1 | 97.7 | 70 | 68.0 | 97.1 |

400 | 409.5 | 97.6 | 80 | 81.3 | 98.3 |

450 | 455.9 | 98.7 | 90 | 91.9 | 97.7 |

500 | 490.9 | 98.2 | 100 | 102.0 | 98.0 |

550 | 555.1 | 99.1 | 110 | 108.3 | 98.4 |

600 | 611.0 | 98.1 | 120 | 118.9 | 99.1 |

650 | 650.0 | 100.0 | 130 | 131.9 | 98.4 |

700 | 699.7 | 99.9 | 140 | 137.9 | 98.5 |

750 | 750.1 | 99.9 | 150 | 151.7 | 98.8 |

800 | 795.9 | 99.4 | 160 | 162.8 | 98.1 |

850 | 850.1 | 99.9 | 170 | 167.8 | 98.7 |

900 | 899.9 | 99.9 | 180 | 185.5 | 96.9 |

950 | 946.9 | 99.6 | 190 | 193.8 | 97.9 |

1000 | 1002.9 | 99.7 | 200 | 197.8 | 98.9 |

© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).