Using Recurrent Neural Network to Optimize Electronic Nose System with Dimensionality Reduction

: Electronic nose is an electronic olfactory system that simulates the biological olfactory mechanism, which mainly includes gas sensor, data pre-processing, and pattern recognition. In recent years, the proposals of electronic nose have been widely developed, which proves that electronic nose is a considerably important tool. However, the most recent studies concentrate on the applications of electronic nose, which gradually neglects the inherent technique improvement of electronic nose. Although there are some proposals on the technique improvement, they usually pay attention to the modiﬁcation of gas sensor module and barely consider the improvement of the last two modules. Therefore, this paper optimizes the electronic nose system from the perspective of data pre-processing and pattern recognition. Recurrent neural network (RNN) is used to do pattern recognition and guarantee accuracy rate and stability. Regarding the high-dimensional data pre-processing, the method of locally linear embedding (LLE) is used to do dimensionality reduction. The experiments are made based on the real sensor drift dataset, and the results show that the proposed optimization mechanism not only has higher accuracy rate and stability, but also has lower response time than the three baselines. In addition, regarding the usage of RNN model, the experimental results also show its efﬁciency in terms of recall ratio, precision ratio, and F1 value.


Introduction
Just as image processing originates from the sense of sight, electronic nose is inspired by the sense of smell. In fact, electronic nose (e.g., odor sensor, aroma sensor, mechanical nose, flavor sensor, multi-sensor array, artificial nose, odor sensing system, and electronic olfactometry) is an electronic olfactory system constructed to mimic the biological olfactory mechanism, which also belongs to the important scientific field of artificial intelligence (AI) [1,2]. The whole electronic nose system is usually composed of three modules: gas sensor, data pre-processing, and pattern recognition [3]. At present, the field of electronic nose has attracted worldwide attention, which proves that electronic nose has an important influence on the progress of human society [4]. However, currently, most studies concentrate on the applications of electronic nose such as quality inspection of agricultural and food products, dendrobium classification, classification and evaluation of quality grades of organic green teas, early detection of fish degradation, etc., irrespective of the inherent technique improvement of electronic nose. To the best of our knowledge, although there are some proposals to optimize the inherent technique, they usually focus on modifying the gas sensor module (doing measurements on cross-sensitivity of a variety of gases by sensor array) and barely pay attention to the improvement of data pre-processing and pattern recognition.
The research of electronic nose also belongs to AI field, which results from that data pre-processing and pattern recognition modules strongly rely on AI-related algorithms due to the natural ability is used to do pattern recognition, where GA is employed to adjust weight; and (3) based on the real sensor drift dataset of electronic nose, three metrics, i.e., accuracy rate, response time, and stability, are verified.
The remaining of this paper is organized as follows. Section 2 reviews the related research work from two perspectives. Section 3 introduces dimensionality reduction based on LLE. Section 4 presents RNN-based pattern recognition. Section 5 reports the experimental results. Section 6 concludes this paper.

Related Work
There have been a lot of studies on electronic nose, including the related applications and the inherent technologies.

The Related Applications
As the mentioned in Introduction, electronic nose shows the wide applications in all fields. For example, in [22], a model transfer learning framework with back-propagation neural network for win and Chinese liquor detection by electronic nose was proposed. In [23], a deep feature mining method of electronic nose sensor data for identifying beer olfactory information was proposed. References [22,23] indicated that electronic nose can be used to detect ethyl alcohol. In addition, as the classical applications, electronic nose can also be applied to do gas recognition. For example, in [24], a drift-compensating novel deep belief classification network was devised to improve gas recognition of electronic nose. In [25], a minimum distance inlier probability feature selection method was presented to improve gas classification for the electronic nose system. In [26], an efficient electronic nose system for odor analysis and assessment was designed, where the fault detection and alarming design could generate a high-reliability performance by constantly monitoring the working status. In addition, electronic nose has good detection performance on formalin. For example, in [27], formalin fresh noodles with electronic nose based on kernel principal component analysis was introduced. In [28], formalin on fresh tilapia via electronic nose and assessment of toxicity levels with reference to average adult Filipino weight was proposed.
Furthermore, electronic nose also has more advanced applications. For example, in [29], the authors made good optimization of extracted features for an explosive-detecting electronic nose by using GA. In [30], tofu shelf life was monitored by using electronic nose based on curve fitting method. In [31], the authors presented an overview of the most important contributions dealing with the quality control in microbial fermentation process by using electronic nose. In [32], an electronic nose-based assistive diagnostic prototype for lung cancer detection with conformal prediction was proposed. In [33], citrus tristeza virus in mandarin orange was detected by using a custom-developed electronic nose system. In [34], feature extraction of citrus juice during storage for electronic nose based on cellular neural network was developed. In [35], a novel quality evaluation method for magnolia bark was proposed by using electronic nose and colorimeter data with the multiple statistical algorithms. In [36], the authors made the comprehensive research on principles and recent advances in electronic nose for quality inspection of agricultural and food products. In [37], an optimized deep CNN for dendrobium classification based on electronic nose was proposed. In [38], on-line assessment of oil quality during deep frying was addressed by using an electronic nose and proton transfer reaction mass spectrometry. In [39], a novel method for rapid quantitative evaluating formaldehyde in squid based on electronic nose was devised. In [40], quality grades of organic green teas was classified and evaluated by using electronic nose based on machine learning algorithms. In [41], the authors made early detection of fish degradation by electronic nose.

The Inherent Technologies
Even though the above-reviewed applications show nice performance and obtain general acceptance, they usually neglect the inherent technique improvement of electronic nose. To this end, some solutions regarding this have been proposed. For example, in [42], a novel technique to solve shortages of low-concentration samples of electronic nose based on global and local features fusion was presented. In [43], a natural neural learning model inspired electronic nose system was devised. To be specific, a natural on-line training with only one sample, to extract both eigen-weights and eigen-bias, was built to elaborate a natural identifier neural model in a real work environment. The proposed model efficiently could reduce the maximum extent of traditional neural models complexities, namely generic work-laboratory, dimensional data learning, model adaptability complication, time-consuming, heavy experiment materials, and chemical products. In [44], the authors proposed a sensor drift correction method based on discriminative subspace projection to deal with the sensor drift problem. In [45], the authors employed manifold learning algorithms to improve the classification performance of electronic nose. In [46], multi-sensor electronic nose based on conformal sensor chamber was designed. In [47], the adaptive subspace learning was used to make drift compensation for electronic nose. In [48], drift compensation for electronic nose by multiple classifiers system with GA optimized feature subset was solved. In [49], fuzzy c-means clustering based novel threshold criteria for outlier detection in electronic nose was proposed. In [50], the joint distribution adaptation for drift correction in electronic nose type sensor array was presented. In [51], online drift compensation by the adaptive active learning on mixed kernel for electronic nose was proposed, which depended on an assumption that the calibration samples were gained online with uncertain amount. It redesigned a hybrid sample-evaluation kernel assessing samples comprehensively by introducing a ranking method to normalize the outputs of kernel. In [52], ANN was used to process electronic nose data. In [53], the authors discussed the training technique of electronic nose by using the labeled and unlabeled samples based on multi-kernel support vector machine (SVM). In [54], the rapid detection approach for enhancing the electronic nose system's performance was verified by using different deep learning models and SVMs, where three deep learning architecture implementations types were used for the classification tasks. Among them, the first deep learning model was implemented employing machine learning framework; the second architecture implementation type was to perform meta-learning, adjusting the connections between different computing cells by differentiable search to obtain the best graph configuration while training; the final model corresponded to a simple multilayer perceptron with the fully connected layers.
Without a doubt, although these technologies improve the performance of electronic nose system, they still have a great optimization space, such as accuracy rate, response time, and stability. Furthermore, different from the current studies, this paper optimizes the electronic nose system from the perspective of data pre-processing and pattern recognition. The mentioned two aspects motivate this paper.

LLE-Based Dimensionality Reduction
In terms of electronic nose system, the dimensionality reduction of data plays an important role to improve computation efficiency and guarantee computation accuracy. The dimensionality reduction of data is defined as follows.
is d-dimensional space and x i ∈ R d , and the feature vectors after dimensionality reduction are {y 1 , y 2 , · · · , y N } with m-dimensional space, satisfying y i ∈ R m and m d.
Compared with other dimensionality reduction methods, LLE has faster computation speed and more accurate computation result. Therefore, this paper employs LLE for dimensionality reduction, which usually includes three parts: graph construction, weight determination, and data mapping.

Graph Construction
This paper adopts K-nearest neighbor (KNN) algorithm [55] to construct the graph with respect to all feature vectors, that is to say, for ∀x i , its K nearest neighbors (i.e., data points) need to be found. The core idea is described as three steps. First, for ∀x i , the distance between it and each x j (i = j) is computed, i.e., N − 1 distance values are obtained. Then, these distance values are arranged in the descending order. Finally, the first K data points are regarded as the nearest neighbors of x i .
However, the determination of K is key but difficult. To be specific, if K is set as relatively small, it means that the whole model becomes complex and easily causes overfitting. On the contrary, if K is set as relatively large, it means that the whole modes becomes simple and dimensionality reduction cannot reach the satisfactory effect. With such consideration, this paper determines K according to the distribution of sample data points. Let d i,j denote the distance between x i and x j , and N − 1 distances can be obtained as follows: Regarding the N − 1 distances, the corresponding mean and variance can be defined as follows.
Suppose that the distance between sample data points and the current using data points follows the Gaussian distribution, and the improved K is defined as follows.
Among them, f (x) is the number of feature vectors where the distance is smaller than x, and ξ is a parameter. In particular, when ξ = 3, the coverage rate in the interval [µ − 3σ, µ + 3σ] can reach the maximum value, i.e., 99.73%.

Weight Determination
For all x i and K i , it is required to build a matrix with respect to the local weight values while guaranteeing the corresponding construction error reaches the minimal value. Let W and (W) denote such matrix and such construction error, and (W) is defined as follows.
where x j is a neighbor of x i and w i,j is the weight between x i and x j . In particular, ∑ K j=1 w i,j = 1 is satisfied. Furthermore, Equation (4) is converted as follows. (5), and Equation (5) is simplified as follows.
According to the Lagrange multiplication, a new equation is obtained as follows.
where, 1 d is a d-dimensional vector with all values for 1. The derivation operation is performed in terms of W, and then the derivative result is set as 0. The following equation is obtained.
Put W T i 1 d = 1 into Equation (8), and W i can be obtained as follows.
According to the above formula manipulation, the weight values can be obtained by minimizing the construction error, which has an important property: translation, rotation, and zoom operations have no influence on the weight determination.

Data Mapping
To guarantee the topology structure consistency of data points between high-dimensional space and low-dimensional space as much as possible, it is required to build a cost function while satisfying the minimal cost function value. Let Φ(Y) denote such cost function, y i denote the output result of x i , and Φ(Y) be defined as follows.
where y j is a neighbor of y i . In particular, the following two constraint conditions are satisfied.
where I is the unit matrix. Furthermore, Φ(Y) can be simplified as follows.
Similarly, according to the Lagrange multiplication, a new equation is obtained as follows.
where M is symmetric matrix for N × N. The derivation operation is performed in terms of Y, and then the derivative result is set as 0. The following equation is obtained.
On this basis, for the smallest m, feature values are computed, and their corresponding feature vectors y 1 , y 2 , · · · , y N are the final solution.

RNN-Based Pattern Recognition
In terms of the electronic nose system, the pattern recognition module is the most important part and has a direct influence on accuracy rate and stability. This paper uses RNN to realize the pattern recognition module, including RNN introduction and GA-based weight assignment for the involved parameters.

LSTM-Based RNN
As is known, there exists the vanishing gradient problem for the traditional RNN, and thus this paper employs long short-term memory (LSTM) [56] for RNN to address the vanishing gradient problem. Each LSTM unit has hidden state h t , memory unit c t , and three gates (i.e., input gate i t , forget gate f t , and output gate o t ). Besides, each gate is activated by the sigmoid function, generating the corresponding values between 0 and 1 as follows.
where s(·) denotes the sigmoid function; W and U are two kinds of weight matrixes; and b is the offset.
In particular, the time step length t, the collected attribute of electronic nose v t , the previous hidden state h t−1 , and the previous memory unit c t−1 are considered as the inputs of LSTM as follows.

GA-Based Weight Assignment
As can be seen from Equations (15)- (18), there are many parameters waiting for weight assignment in RNN. Considering that GA has the global optimization performance for these weight parameters, this paper uses GA to do the weight assignment [21]. Regarding this, the objective function can be written as follows.
The next is to solve Equation (23) via GA. In particular, GA is used to obtain the relatively optimal path and these nodes in the determinate path build a network topology with some designated weight values. Meanwhile, these weight values are considered as a weight assignment solution. GA usually consists of selection operator, crossover operator, variation operator, and fitness function. Different from the traditional GA, this paper presents an adaptive GA to do the automatic selection operator. To be specific, this paper designs an online adjustment method on selection pressure to make sure the tradeoff between fast convergence and population diversity. For the arbitrary individual i, let p i denote its selection probability. When the nonlinear relationship is considered, p i is defined as follows.
where γ is the coefficient of pressure control and r i is the rank of individual i. Furthermore, let M denote the initial population size, and the best individual's section probability and the worst individual's section probability are defined as follows.
It is obvious that the determination of γ is very important. Given that, this paper uses the standard deviation with respect to all individual fitness values to determine γ. First, the standard deviation sd is defined as follows.
where f it i is the fitness of individual i and f ave is the average value. Then, for the Tth iteration, its corresponding γ is defined as follows.
where thr 1 and thr 2 are two parameters. Especially when sd > thr 2 , it needs to adjust γ to be large so that the selection probability of individual can be increased.

Dataset Collection
The sensor drift dataset comes from [57]. In total, 1604 samples were collected by using the multiple E-nose devices with the same model. Besides, the dataset consists of three batches, i.e., batch master collected five years earlier than the batches slave 1 and slave 2. Meanwhile, there are six kinds of gases to be detected: ammonia, benzene, carbon monoxide, formaldehyde, nitrogen dioxide, and toluene. The detailed information of the dataset is shown in Table 1.

Experiment Method
The experiments included two parts. The first part was the performance analysis of RNN, testing recall ratio, precision ration, and F1 value. Then, the second part was the comparison analysis, testing accuracy rate, response time, and stability. Meanwhile, three benchmarks were selected from the latest research achievements [43,51,54]. Ref. [43] presented a natural neural learning model inspired electronic nose system, called NNL; ref. [51] proposed an online drift compensation by the adaptive active learning on mixed kernel for electronic nose, called AAL; and ref. [54] used different deep learning models and SVMs to enhance the electronic nose system's performance, called DLS. In addition, the involved parameters were set as follows: M = 100, α = 0.45, β = 0.55, and the number of simulation times was 10. In particular, the feature extraction was performed for each sensor resulting in a six-dimensional feature vector for each sample.

RNN Performance Analysis
The average recall ratios regarding six kinds of gases are shown in Table 2. The average precision ratios regarding six kinds of gases are shown in Table 3. The average F1 values regarding six kinds of gases are shown in Table 4. In Tables 1-3, we observe that the used LSTM-based RNN shows good recall ratio, precision ratio, and F1 value, as all related values could reach 95%. It also indicates that using RNN to realize pattern recognition module is feasible.

Comparison Analysis
The average accuracy rates of the proposed method, NNL, AAL, and DLS, under different groups of experiments are shown in Figure 1. The average response times of the proposed method, NNL, AAL, and DLS, under different groups of experiments, are shown in Figure 2.
We found that our method presents the highest accuracy rate and the lowest response time. This indicates that LLE-based dimensionality reduction and RNN-based pattern recognition can greatly improve the electronic nose system, while obtaining the accurate detection results with low response time.  Furthermore, the standard deviation was used to measure the stability. For two metrics, i.e., accuracy rate and response time, the corresponding standard deviation values in terms of 10 different experiments were computed by Equation (26). A smaller standard deviation value means a higher stability. The experimental results are shown in Figure 3. It is obvious that the method proposed in this paper has the smallest standard deviation values in terms of both accuracy rate and response time, which further indicates that it has the highest stability.

Discussion
Since the experimental results are based on the phase of virtual simulation rather than the implemented product, the validation carried out has some threats. For intrinsic reasons, there are three aspects. First, the weight assignment based on GA has different influences in terms of different datasets, i.e. the fixed weight assignment does not mean that the proposed optimization method in this paper can obtain the optimal solution for all datasets. Second, the building of RNN structure can be dynamic and it may be unstable during the process of data training. Third, the written code is probably unstable and even redundancy exists, which has an important influence on the computational efficiency. For the extrinsic reasons, they include two aspects. On the one hand, the adopted datasets lack diversity, and the current experimental results can only demonstrate that the proposed optimization method is efficient within a certain range but cannot guarantee that it is forever efficient, after all it is not a mass-produced product. On the other hand, different coding styles also have a considerable influence on the experimental results. For example, RNN is coded in C++ language and the electronic nose system is implemented in C language.

Conclusions
The whole electronic nose system usually includes gas sensor, data pre-processing, and pattern recognition modules. Currently, most studies pay attention to the applications of electronic nose irrespective of the inherent technique improvement of electronic nose. Although there are some proposals to optimize the inherent technique, they usually focus on modifying the gas sensor module and barely pay attention to the improvement of data pre-processing module and pattern recognition module, which are addressed in this paper. First, LLE is employed for dimensionality reduction, including graph construction, weight determination, and data mapping. Then, RNN is used for realizing the pattern recognition module. In particular, LSTM is adopted to improve RNN and GA is leveraged to do the weight assignment for the involved parameters. The experiments are implemented based on the real sensor drift dataset, which include two parts: RNN performance analysis and comparison analysis. The first part tested recall ratio, precision ration, and F1 value, which can reach 95%. The second part tested accuracy rate, response time, and stability. It was found that this method has the best optimization performance on the electronic nose system.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: