You are on page 1of 10

3342 IEEE SENSORS JOURNAL, VOL. 23, NO.

4, 15 FEBRUARY 2023

E-Nose System Based on Fourier Series for


Gases Identification and Concentration
Estimation From Food Spoilage
Jie Luo , Zehao Zhu, Wen Lv, Jian Wu, Jianhua Yang , Min Zeng , Nantao Hu,
Yanjie Su, Ruili Liu, and Zhi Yang

Abstract —This work presents an electronic nose


(EN)-based gas identification and concentration estimation
method for the detection of food spoilage. The response data
of sensors were acquired through a commercial gas sensor
array and data acquisition circuit board and transformed into
pictures with the form of the Fourier series. A convolutional
neural network (CNN) model was used to identify the pictures
from the conversion of sensor data, thus achieving the
purpose of identifying the gases (C2 H5 OH, NH3 , and H2 S).
In order to solve the problem of sample imbalance and to
improve the generalization performance of classification
models, the synthetic minority oversampling technique
(SMOTE) and dropout technique were employed. Fivefold
cross-validation was used to evaluate the performance of the
model, of which the gas identification accuracy rate reached
96.67%. Moreover, a gas concentration regression model with
the advantages of simplicity and strong interpretability was
further proposed to estimate the concentrations of C2 H5 OH,
NH3 , and H2 S. The mean absolute errors and coefficients of determination for the concentration estimation of C2 H5 OH,
NH3 , and H2 S are (3.71 ppm, 0.968), (0.50 ppm, 0.968), and (0.13 ppm, 0.99), respectively. Furthermore, we used our model
to evaluate the freshness of kiwifruit, pork, and beef, and it showed satisfactory predictive performance. The method
proposed in this work realizes high-precision detection of gases from food spoilage and has a good application prospect
in the rapid judgment of food freshness on the EN system.
Index Terms — Convolutional neural network (CNN), electronic nose (EN), food spoilage, gas sensor array, synthetic
minority oversampling technique (SMOTE).

Manuscript received 15 November 2022; revised 18 December 2022; I. I NTRODUCTION


accepted 1 January 2023. Date of publication 10 January 2023; date
of current version 13 February 2023. This work was supported in part
by the Science and Technology Commission of Shanghai Municipal-
ity under Grant 20JC1415500; in part by the National Key Research
F OOD safety has become a problem that modern fami-
lies have to face, the most common one of which is
microbial contamination. It can cause great harm to peo-
and Development Program of China under Grant 2022YFB3205500 ple’s health if they eat food contaminated with bacteria or
and Grant 2022YFC3104700; in part by the National Natural Science
Foundation of China under Grant 61971284 and Grant 62101329; in fungus [1]. In this regard, the rapid and effective detection
part by the Open Research Fund Program of Zhoushan Field Scientific of spoiled food is of great significance to people’s health.
Observation and Research Station for Marine Geo-Hazards, China
Geological Survey, under Grant ZSORS-22-08; in part by the Oceanic The contaminated high-protein food by microorganisms (such
Interdisciplinary Program of Shanghai Jiao Tong University under Grant as eggs, pork, beef, shrimp, fish, etc.) can release NH3 and
SL2020ZD203, Grant SL2021MS006, and Grant SL2020MS031; in part H2 S, and most rotten fruits (such as kiwi, apples, oranges,
by the Scientific Research Fund of the Second Institute of Oceanography,
Ministry of Natural Resources, China, under Grant SL2003; in part by etc.) will produce C2 H5 OH [2], [3]. Therefore, monitoring
the Shanghai Sailing Program under Grant 21YF1421400; and in part these gases can help to quickly figure out the safety of
by the Startup Fund for Youngman Research at Shanghai Jiao Tong the food.
University. The associate editor coordinating the review of this article and
approving it for publication was Dr. Xiaojin Zhao. (Corresponding authors: The most convenient and accurate way of classification
Jianhua Yang; Zhi Yang.) and concentration estimation of gases is gas chromatography
The authors are with the Key Laboratory of Thin Film and Microfab- at present, but it is bulky, expensive, and time-consuming
rication, Ministry of Education, Department of Micro/Nano Electronics,
Institute of Marine Equipment, School of Electronic Information and [4], which is unsuitable and unacceptable for family use.
Electrical Engineering, Shanghai Jiao Tong University, Shanghai 200240, In addition, gas detection methods based on acoustic and
China (e-mail: yangjh08@sjtu.edu.cn; zhiyang@sjtu.edu.cn). optical principles are used because of their high sensitivity
This article has supplementary downloadable material available at
https://doi.org/10.1109/JSEN.2023.3234194, provided by the authors. and selectivity, but they are still limited by their complicated
Digital Object Identifier 10.1109/JSEN.2023.3234194 operations and high costs [5]. They often require professional
1558-1748 © 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.
See https://www.ieee.org/publications/rights/index.html for more information.
Authorized licensed use limited to: Universiti Tunku Abdul Rahman. Downloaded on June 21,2023 at 05:32:27 UTC from IEEE Xplore. Restrictions apply.
LUO et al.: E-NOSE SYSTEM BASED ON FOURIER SERIES 3343

personnel. In contrast, electronic gas sensors with the merits


of low cost, high sensitivity, and small volume based on chem-
ical reaction principles have recently attracted the interest of
researchers [6]. These advantages of electronic gas sensors can
be integrated with the form of an array to obtain the capability
of portable and real-time detection of gases. Electrical gas
sensors include electrochemical gas sensors, catalytic combus-
tion gas sensors, and metal–oxide–semiconductor (MOS) gas
sensors. Electrochemical gas sensors have the characteristics
of high accuracy and low cost, whereas it is unstable and
of short service life [7]. Catalytic combustion gas sensors,
due to their working principle, have a special dependence on
oxygen [8]. In particular, MOS gas sensors balance well in
sensitivity, cost, stability, and service life, which are widely
used in the detection of industrial gases and air pollution [9],
[10]. MOS as sensitive materials can adsorb oxygen ions with
different valences (O2− , O− , and O− 2 ) from the air at different
work temperatures. The active oxygen species react with gas
Fig. 1. Gas classification and concentration estimation system. (a) Model
molecules, thus inducing a change in the resistance of sensors building. (b) Classification and concentration estimation.
[11], [12].
Electronic nose (EN), an artificial olfactory system that naive Bayes, and k-nearest neighbor (k-NN). Wang et al. [27]
simulates the way the mammalian olfactory system processes used the multilayer perceptron neural network (MLPNN) as
olfactory signals, has recently attracted people’s attention. base learners via co-training to monitor natural gas.
An EN mainly includes two parts, a gas sensor array and a The emergence of convolutional neural networks (CNNs)
pattern recognition algorithm, which are used to process sensor has brought the performance of the EN system to a higher
data [13], [14]. Studies have shown that the performance of level. Many CNN models, such as residual neural net-
the EN is not only affected by the performance of the gas work (ResNet) and visual geometry group (VGG) network,
sensor itself but also closely related to the pattern recognition have been employed to identify gas categories and to estimate
algorithm it uses [15]. gas concentrations [28], [29], [30]. While CNN improves
One of the key challenges of gas sensing based on gas the accuracy of gas classification, it also comes across some
sensors is the cross-sensitivity. For target gases with simi- important challenges. First, in terms of structure, the complex-
lar chemical properties, the gas sensors often show similar ity of the models is far more than that of the traditional models,
responses, which to a large extent limits the selectivity of the which significantly increases the cost of model construction
gas sensors. To improve the accuracy of gas identification, and training. In addition, in terms of data preprocessing of
tremendous efforts have been devoted to the modification some exiting models, the methods of converting sensors’
and exploration of sensitive materials with a better sensing response vectors to pictures are either short of attention to
performance [16], [17], [18], [19], [20], [21]. Although the details in pictures or directly filling the data of each point
reported studies in the view of sensing materials can improve on the response curve into the image matrix, which greatly
the sensitivity and the response performance of the gas sensors, increases the workload of data preprocessing and introduces
the cross selectivity has still been a grand challenge. Pattern some unnecessary interfering factors.
recognition algorithm plays an important role in overcoming To evaluate the freshness of food, we proposed a CNN
the cross-sensitivity of gas sensors. The response from the model to identify the single and binary mixtures of C2 H5 OH,
gas sensor array carries the information of gas category and NH3 , and H2 S. The proposed model, with a simple structure
concentration, which is called “gas fingerprint” [22]. Despite and efficient training process, can improve the gas identifi-
the simple models in early EN systems can efficiently avoid cation ability of the EN. A new data preprocessing method
overfitting, they are hard to accomplish complex classification. based on the Fourier series was proposed, which overcomes
With the development of machine learning algorithms and the shortcomings of the existing methods, not only fully
deep learning models, the algorithm in EN has become more excavates data information but also controls the scale of
and more complex, endowing the system with greatly strong data processing and avoids the introduction of interference
fitting performance [23]. Ma et al. [24] realized the quantifica- factors. According to the classification results of the classifier
tion of multiple indoor air contaminants with the utilization of and the sensing principle, we proposed a simple and highly
extreme learning machines (ELMs). Chen et al. [25] proposed interpretable mathematical model to estimate the gas concen-
a model based on decision tree (DT) and back-propagation tration, which achieves a high-precision prediction of the gas
neural network (BPNN) to estimate the concentration of four concentration.
mixed volatile organic compounds (VOCs) and achieved an
error within 2 ppm. Khan et al. [26] built a gas sensor array II. E XPERIMENT AND DATA
to identify NO2 , C2 H5 OH, SO2 , and H2 by using principal Fig. 1(a) shows the process of model building. It exchanges
component analysis (PCA), support vector machines (SVMs), the extracted features from gas sensor array response into color

Authorized licensed use limited to: Universiti Tunku Abdul Rahman. Downloaded on June 21,2023 at 05:32:27 UTC from IEEE Xplore. Restrictions apply.
3344 IEEE SENSORS JOURNAL, VOL. 23, NO. 4, 15 FEBRUARY 2023

TABLE II
S AMPLE G AS C ONCENTRATION R ANGE AND Q UANTITY

Fig. 2. Experimental device and data acquisition process.

TABLE I
S ENSOR M ODEL , S ENSING P RINCIPLE , AND TARGET G ASES

pictures and put them into a CNN model to determine the


category of the sample. After classification, a corresponding
regression model based on the relationship between gas con-
centration and sensor response will be used to estimate gas
concentration. Fig. 1(b) shows the process for classification
and concentration estimation.
To demonstrate our proposed model for classifying and
estimating the concentration of gases from food spoilage,
we developed an EN system and a complete set of experi- Fig. 3. Resistance and response curves of the MOS sensors. (a) Resis-
tance curves of TGS2620 in C2 H5 OH at concentrations of 2.0, 4.0, 10.2,
mental equipment (see Fig. 2). The configuration of the EN 20.4, 40.7, and 81.4 ppm, respectively. (b) Response curves of MQ136,
includes a gas sensor array with four MOS gas sensors MQ137, TGS2620, and TGS2602 in NH3 at 12.3 ppm.
(TGS2602, TGS2620, MQ136, and MQ137), a data acquisi-
tion module, and a wireless transceiver module. The specific
information of sensors is shown in Table I. TGS2620, MQ136,
where C presents the concentration of C2 H5 OH injected into
MQ137, and TGS2602 are, respectively, sensitive to C2 H5 OH,
the chamber in ppm. v presents the volume of the injected
H2 S, NH3 , and all of the three gases. The resistance value
C2 H5 OH in μL. ρ presents the density of anhydrous ethanol
of sensors can be recorded in real time via computer by
in mg/μL. V is the volume of the chamber in L. M is the
Bluetooth. In order to simulate a real food spoilage environ-
relative molecular weight of C2 H5 OH. T is the environment
ment, we have diluted and mixed 1000-ppm H2 S standard gas,
temperature in ◦ C. P is the atmospheric pressure in Pa.
5000-ppm NH3 standard gas, and anhydrous ethanol together
Table II shows the specific gas combinations and concen-
in a sealed chamber. Under the control of the flowmeter, H2 S,
tration ranges in our work. We measured six types of gases
NH3 , and air are mixed in a specific ratio and injected into
including single H2 S, single NH3 , single C2 H5 OH, and their
the chamber lasting long enough (5 min in our work) to make
respective binary mixtures. Among the three kinds of single
sure that the gas concentration in the chamber is the desired
gas, the concentration ranges of H2 S, NH3 , and C2 H5 OH are
value. Anhydrous ethanol was injected into the chamber via
between 0 and 30 ppm with 19 samples, 0 and 250 ppm with
a microsyringe. According to the mixing ratio of NH3 , H2 S,
20 samples, and 0 and 1000 ppm with 19 samples, respectively.
and air, we can get concentrations of H2 S and NH3 dilution
For binary gas mixtures, we took eight concentrations of every
gas from the formula as follows:
single gas to get 64 combined samples.
vρ 22.4 273.15 + T 101325 Fig. 3(a) shows the resistance change of sensor TGS2620
C= −3
× × × (1)
V × 10 M 273.15 P at the concentration of C2 H5 OH of 2.0, 4.0, 10.2, 20.4, 40.7,

Authorized licensed use limited to: Universiti Tunku Abdul Rahman. Downloaded on June 21,2023 at 05:32:27 UTC from IEEE Xplore. Restrictions apply.
LUO et al.: E-NOSE SYSTEM BASED ON FOURIER SERIES 3345

and 81.4 ppm. The higher the concentration, the lower the
resistance of the sensor is, accompanied by the response time
of the sensor increasing. The response of each sensor is given
by
Rair − Rgas
Res = (2)
Rair
where Res is the response value of the gas sensor, and Rair and
Rgas are the resistance of gas sensors in air and a concentration
of measured gas, respectively.
As the response curve of the sensor contains the information
on category and the concentration of the ambient gas, it is
of great significance to extract features from the response
curve of the sensor. In order to avoid the influence of noise,
we filtered the response curve by window sliding technique
before extracting features. Fig. 3(b) shows the response curves
of the sensors MQ136, TGS2620, MQ137, and TGS2602
to 12.3-ppm NH3 . The responses of the MQ series sensors
produce spikes affected by airflow disturbance, which does
not affect the calculation of the response value. The selection
of the sensor response features is flexible. In other words, the
steady-state value of response, differential value of response,
integral value of response, and response time, and so on are
all good choices [31]. In this work, we take the steady-state
response value of the sensors as the feature of the samples.
After obtaining all samples, we normalized the sample data.
Fig. 4(a) shows the distribution of all the samples in 3-D space
upon dimensionality reduction via PCA.
After the model was established and trained, in order
to exclude the influence of interfering gases and test the
practicability of our model, we measured the gas sensing data
of kiwi, pork, and beef over a period of time. Considering
that the gas concentration of food spoilage is related to the Fig. 4. Sample distribution. (a) Original samples. (b) Samples by
SMOTE.
volume of the chamber, the quality of the sample, and the
degree of spoilage, we controlled for these three variables.
The chamber volume is the same as in Fig. 2 (20.57 L), and convert each sample, a 4-D vector, to a three channels color
the mass of each sample is 25 g. In order to exclude the picture based on the form of the Fourier series. The formula
influence of accidental factors, the number of samples of kiwi, of the Fourier series is as follows:
pork, and beef was all 10. The samples were placed in an N     
environment with a temperature of 25 ◦ C and a humidity of a0  2πnx 2πnx
f (x) = + an cos + bn sin (3)
58%. We sampled the sensor data at time points, such as 0, 4, 2 P P
n=1
8, 12, 16, 20, 44, and 48 h, obtaining eight sets of data in total
where P is the period of f (x), and N presents the situation,
for each kind of tested food. In order to obtain the standard
in which we take the first N items of the Fourier series.
reference of food freshness, we combined the two methods of
According to (3), we let P be N − 1 and get the Fourier
sensory evaluation and pH testing. Studies have shown that the
series matrix in Fig. 5. The first column of the matrix (a, b,
spoilage of meat is closely related to its pH [32], [33], [34].
c, and d) represents the response values of the four sensors
Usually, the pH of fresh pork is 5.61–6.7, and the pH of fresh
in each sample. We reshaped each column of the matrix
beef is 5.55–6.35. Based on this, we correlated the freshness
into a 2 × 2 matrix and then scaled each element of
of the tested samples with the gas concentrations predicted
the 2 × 2 matrix to an integer between 0 and 255 to fill
by our proposed model and obtain thresholds for each gas.
it into a channel of the pixel matrix in turn. Pixel values are
When the gas concentration estimated by our model is greater
given by the formula as follows:
than the corresponding threshold, we make a recommendation  
against consumption. (x + 1)
Pv = × 255 (4)
2
III. M ETHODOLOGY where Pv presents the pixel values of the pictures, and x is
A. Conversion of Input Vector the element of the Fourier series matrix.
The classifier we employed in this work is a CNN model, The pixel values of the three channels of the image matrix
which needs a picture as an input. We proposed a method to are exactly the same. After the above treatment, we get the

Authorized licensed use limited to: Universiti Tunku Abdul Rahman. Downloaded on June 21,2023 at 05:32:27 UTC from IEEE Xplore. Restrictions apply.
3346 IEEE SENSORS JOURNAL, VOL. 23, NO. 4, 15 FEBRUARY 2023

Fig. 7. CNN model structure for classification.

C. Synthetic Minority Oversampling Technique (SMOTE)


Samples imbalance is a common issue in classification,
which often plays a negative role in classification tasks.
Samples imbalance may lead to the bias of the classification
Fig. 5. Schematic showing the converting process from Fourier series
matrix to picture. results toward the categories that occupy a larger proportion
in the training set, which seriously damages the performance
of the classifier. Moreover, this problem also exists in our
work since the ratio of single gas samples to binary mixed
gases samples is approximately 1:3, which causes the model’s
predictions for samples to tend to the classes related to binary
gas mixture in the actual classification task.
The SMOTE can address the problem of sample imbalance
[36]. SMOTE is a method to enrich samples artificially based
on the existing samples rather than simply copy or duplicate.
It uses the nearest neighbor algorithm to select a couple
of samples that are nearest to the current sample and then
increases the number of samples by linear interpolation. In our
work, we resampled by SMOTE at a ratio of 200%, so that
the number of samples of a single gas class and the number of
samples of a binary mixed gases class roughly reached a ratio
Fig. 6. Images transformed from samples of different categories. of 1:1. Fig. 4(b) shows the samples resampled by SMOTE in
(a) C2 H5 OH. (b) NH3 . (c) C2 H5 OH and NH3 . (d) H2 S. (e) C2 H5 OH 3-D space after dimensionality reduction via PCA.
and H2 S. (f) NH3 and H2 S.

D. Least Squares Regression


picture shown in Fig. 6. We found that the pictures obtained
Due to the cross-sensitivity of the sensors, different gases
from different classes of samples have clear differences in
may cause the sensors to respond similarly, which makes it
pattern properties and textures. It indicates that our proposed
extremely difficult to estimate the gas concentrations for all
method of converting vectors to pictures can effectively pre-
classes of samples by using a unified regression model. There-
serve the differences between different classes of samples.
fore, we adopted a strategy of the first classification and then
concentration estimation. For each category of samples, there
B. CNN Classifier is a corresponding regression model with different parameters.
The CNN model proposed in this work contains three Previous research [37] has shown that the response value of
convolutional-pooling layers and three fully connected layers. the sensor is related to the gas concentration as follows:
The input size is fixed at 60 × 60 × 3 and the output size is set  
R
as 1 × 6 corresponding to six classes of samples. The kernel −α· Rgas
Cgas = ke air +m (5)
size of each convolution layer is 5, and the kernel sizes of the
pooling layers are 2, 2, and 3, respectively. The dimensions where k, α, and m are the constants to be determined.
of the three fully connected layers are 1600, 1000, and 100. As the target gases of sensors in the sensor array are
We choose the rectified linear units (ReLUs) as the activation different, we proposed the following strategies to estimate
function to improve the training speed. In order to enhance the gas concentrations through (5). For the two cases of
the generalization ability of our model and to avoid possible single gas and binary mixed gases, we proposed different
overfitting, we used dropout algorithm as reported in 2012 forms of regression models. For single gas, two sensors of the
[35]. The complete schematic of the CNN model is shown in sensor array are selected to participate in the gas concentration
Fig. 7. We took the fivefold cross-validation and repeated it estimation. One of the sensors is selected from TGS2620,
five times to evaluate the performance of the classifier. MQ136, and MQ137, whose target gas corresponds to the gas

Authorized licensed use limited to: Universiti Tunku Abdul Rahman. Downloaded on June 21,2023 at 05:32:27 UTC from IEEE Xplore. Restrictions apply.
LUO et al.: E-NOSE SYSTEM BASED ON FOURIER SERIES 3347

to be measured. Another sensor is TGS2602, which has a high


response to all three measured gases. The regression model for
single gas is as follows:

Cgas = α1 ek1 (res1 −1) + α2 ek2 (res2 −1) + m
(6)
s.t. α1 , α2 > 0 and α1 + α2 = 1
where α1 and α2 present contribution factors for each sensor,
k1 and k2 are the scaling factors, and m is a constant correction
term.
For binary gases mixtures, we directly selected two sensors
from TGS2620, MQ136, and MQ137, whose target gases
corresponding to the two gases are applied to be calculated.
The regression model for binary gases mixture is as follows: Fig. 8. Classification accuracy using different image sizes.

Cgas1 = α1 ek11 res1 +k12 res2 +k13 res1 res2 + m 1
2 2

(7)
Cgas2 = α2 ek21 res1 +k22 res2 +k23 res1 res2 + m 2
2 2

where α1 and α2 present the amplitude factors, k11 , k12 , k13,


k21 , k22 , and k23 are the scaling factors, and m 1 and m 2 are
the constant correction terms.
Ultimately, our optimization goal for (6) and (7) is expressed
as follows:
⎧ 

⎪ (yi − f W (x i ))2
⎨ min
X

⎪ X = (x 1 , x 2 , . . . , x N ) (8)

⎩ W = (w , w, . . . , w )
1 M

where X presents samples set with N elements, f W is the


regression model, and W is the parameter vector of the
regression model with M dimensions.
In the classification task, we set the concentration range of
each class of gas to be large enough to satisfy the robustness
of the classifier, which greatly exceeds the concentration range
of characteristic gases produced by various food spoilage in Fig. 9. Curves of accuracy on the training set and test set and the curve
of loss on the training set during model training (a) with SMOTE and
real life. Therefore, we paid more attention to the estimation (b) without SMOTE.
of low concentrations in the regression task. We controlled
the concentration range of C2 H5 OH, NH3 , and H2 S to 0–50,
0–20, and 0–5 ppm, respectively. To evaluate the accu- than 60 contain more information, the effective information is
racy of our proposed regression model, we introduced two still less because of the information loss due to the scaling of
metrics, mean squared error (MAE), and coefficient of the images. Therefore, the size of the image in our work was
determination (R 2 ). determined to be 60.
We used SMOTE to reduce the impact of sample imbalance
IV. R ESULT AND A NALYSIS on classification tasks. To determine whether SMOTE worked
After completing the data acquisition, we transformed each as we expected, we conducted a set of control experiments.
sample into images of different sizes to research the effect The training set and the test set are randomly divided into
of image size on the accuracy of the classifier. The sizes subgroups with a ratio of 4:1, and we recorded the prediction
of the images are set to be 12 × 12 × 3, 24 × 24 × 3, accuracy and loss value of the model during the training
36 × 36 × 3, 48 × 48 × 3, 60 × 60 × 3, 72 × 72 × 3, process with and without SMOTE. Fig. 9(a) and (b) shows
84 × 84 × 3, 96 × 96 × 3, 108 × 108 × 3, and 120 × the prediction accuracy and loss curve of the model in the
120 × 3, respectively. Because of the limitation in the input two cases, respectively. The introduction of SMOTE reduces
size of the classifier, all images of different sizes were scaled the vibration of the model during training, which makes
to 60 × 60 × 3. Fig. 8 shows the accuracy of the classifier the accuracy and loss curves smoother. At the same time,
for different sizes of images in a split with the ratio of the when the epoch is greater than 120, the difference between
training set to the test set ratio of 4:1. We can find that the the average accuracy of the model in the training set and
classifier has the highest accuracy when the input image size the test set is reduced from 14.62% to 5.71%. Moreover, the
is 60 × 60 × 3, so the value of N in (3) is 112. It is reasonable average prediction accuracy of the test set is increased from
because images with sizes smaller than 60 must contain less 83.89% to 93.70%, indicating that the introduction of SMOTE
information than larger images. Although the images larger has significantly improved the prediction and generalization

Authorized licensed use limited to: Universiti Tunku Abdul Rahman. Downloaded on June 21,2023 at 05:32:27 UTC from IEEE Xplore. Restrictions apply.
3348 IEEE SENSORS JOURNAL, VOL. 23, NO. 4, 15 FEBRUARY 2023

TABLE IV
R EGRESSION R ESULTS OF MAE AND R2 FOR D IFFERENT C LASSES

Fig. 10. Effects of SMOTE and dropout on accuracy. TABLE V


MAE AND R2 OF THE T HREE G ASES

TABLE III
C LASSIFICATION ACCURACY OF D IFFERENT M ODELS

TABLE VI
E VALUATION M ETHODS AND TARGET G AS
C ONCENTRATION T HRESHOLDS

performance of the classifier. We also conducted a series of


control experiments to verify the impact of the use of dropout
techniques on classification. We used fivefold cross-validation
and repeated it five times, and Fig. 10 is a box plot of the
25 classification results. It is clear that the dropout technique
improves the average accuracy rate by 1.78%. To demonstrate
the performance advantages of the proposed classification
model, we compared the model with traditional classification
models. We used SVM, DT, k-NN, MLPNN, and the model
proposed in this work to train and predict on the same
training and test sets, respectively. The confusion matrices gases of C2 H5 OH, NH3 , and H2 S. To further evaluate the
of prediction are shown in Fig. S1 in support information. performance of our model, MAE and R 2 values of the three
The average accuracy of each model is presented in Table III. gases, C2 H5 OH, NH3 , and H2 S, on the test set are shown in
The experimental results show that the classification accuracy Table IV. The MAEs and R 2 s of the single gas are lower
of the proposed model in this work, reaching 96.67%, is the compared to the binary gas mixture. The MAEs and R 2 s
best. of C2 H5 OH in single C2 H5 OH, mixture of C2 H5 OH and
In the regression task, we did not make any transformation NH3 , and mixture of C2 H5 OH and H2 S are (0.82 ppm, 1),
of the samples. The sensor response value of the original (2.28 ppm, 0.963), and (2.95 ppm, 0.982), respectively. The
sample is used as the input of the regression model. Consid- MAEs and R 2 s of NH3 in single NH3 , mixture of C2 H5 OH
ering the actual environment of food spoilage and the linear and NH3 , and mixture of NH3 and H2 S are (0.30 ppm, 1),
response region of the sensors, we selected the estimated gas (0.99 ppm, 0.990), and (1.16 ppm, 0.953), respectively. The
concentration at a low range. The concentrations of C2 H5 OH, MAEs and R 2 s of H2 S in single H2 S, mixture of C2 H5 OH
NH3 , and H2 S ranged from 0 to 80, 0 to 25, and 0 to 5 ppm, and H2 S, and mixture of NH3 and H2 S are (0.03 ppm, 1),
respectively. Therefore, the total number of samples is reduced (0.21 ppm, 0.993), and (0.11 ppm, 0.992), respectively. More-
from 249 to 150. We still used 20% of the samples as the test over, in Table V combined with all classes, the MAEs and R 2 s
set and 80% of the ones as the training set. Fig. 11 shows of C2 H5 OH, NH3 , and H2 S overall are (3.71 ppm, 0.968),
the results of concentration estimation for C2 H5 OH, NH3 , (0.50 ppm, 0.968), and (0.13 ppm, 0.99), respectively. The
and H2 S in the six regression models. The horizontal axis in result shows that the proposed regression model has a high
Fig. 11 represents the actual concentration of each sample. accuracy in the concentration estimation of C2 H5 OH, NH3 ,
The vertical axis represents the predicted concentration of and H2 S in the low concentration range, and the model has a
each sample by the regression model. As shown in Fig. 11, significant value for practical applications.
we can find that the predicted value of the model has a small We provided the pictures of the samples of beef, pork, and
dispersion range and is highly close to the true concentration kiwifruit in the support information. In support information,
value of the sample on the training set and test set about Fig. S2 is the samples of kiwifruit, Fig. S3 is the samples of

Authorized licensed use limited to: Universiti Tunku Abdul Rahman. Downloaded on June 21,2023 at 05:32:27 UTC from IEEE Xplore. Restrictions apply.
LUO et al.: E-NOSE SYSTEM BASED ON FOURIER SERIES 3349

Fig. 11. Concentration estimation scatter plot. (a) Concentrations of C2 H5 OH in single C2 H5 OH, mixture of C2 H5 OH and H2 S, and mixture of
C2 H5 OH and NH3 on training set. (b) Concentrations of NH3 in single NH3 , mixture of NH3 and C2 H5 OH, and mixture of NH3 and H2 S on training
set. (c) Concentrations of H2 S in single H2 S, mixture of H2 S and C2 H5 OH, and mixture of H2 S and NH3 on training set. (d) Concentrations of
C2 H5 OH in single C2 H5 OH, mixture of C2 H5 OH and H2 S, and mixture of C2 H5 OH and NH3 on test set. (e) Concentrations of NH3 in single NH3 ,
mixture of NH3 and C2 H5 OH, and mixture of NH3 and H2 S on test set. (f) Concentrations of H2 S in single H2 S, mixture of H2 S and C2 H5 OH, and
mixture of H2 S and NH3 on test set.

Fig. 12. Practical application in real food spoilage environments. Estimated concentrations of NH3 and H2 S and pH value from samples of (a) beef
and (b) pork. (c) Estimated concentrations of C2 H5 OH from samples of kiwifruit.

beef, and Fig. S4 is the samples of pork. We acquired sensory Fig. 12(b) shows the estimated concentrations of NH3 and
data for ten samples of each food at different time points, then H2 S released from pork samples and the pH values of the
classified each sample, and estimated the gas concentrations samples as a function of time. At 20 h, we tested a pork
they released. We finally took the mean of the ten samples sample with a pH of 6.81 and had a judgment of stale from
as the final prediction concentration. Fig. 12(a) shows the sensory evaluation The experimental results showed that the
estimated concentrations of NH3 and H2 S released from beef pork became stale at 20 h with the concentrations of NH3 and
and the pH of beef as a function of time. At 16 h, we tested a H2 S being 0.25 and 0.06 ppm, respectively. Fig. 12(c) shows
beef sample with a pH of 6.43, the first time we measured a the estimated concentration curve of C2 H5 OH released from
pH higher than the fresh pH threshold. Moreover, we observed kiwifruit. We got a spoiled judgment at 12 h because of the
a change in color of the beef sample from bright red to dark change in color and smell with the concentration of C2 H5 OH
red and a slight off-flavor. The experimental results showed being 0.44 ppm. The freshness evaluation methods of the three
that the beef became stale at 16 h with the concentrations foods and their target gas concentration thresholds are shown
of NH3 and H2 S being 0.74 and 0.12 ppm, respectively. in Table VI.

Authorized licensed use limited to: Universiti Tunku Abdul Rahman. Downloaded on June 21,2023 at 05:32:27 UTC from IEEE Xplore. Restrictions apply.
3350 IEEE SENSORS JOURNAL, VOL. 23, NO. 4, 15 FEBRUARY 2023

V. C ONCLUSION [11] C. Fan et al., “Fast and recoverable NO2 detection achieved by
assembling ZnO on Ti3 C2 T x MXene nanosheets under UV illumina-
A sensor array-based gas identification and concentration tion at room temperature,” Nanoscale, vol. 14, no. 9, pp. 3441–3451,
estimation system with the assistance of machine learning Mar. 2022.
algorithms was designed for gas detection of food spoilage. [12] C. Wang, L. Yin, L. Zhang, D. Xiang, and R. Gao, “Metal oxide gas
This system is composed of four commercial gas sensors, sensors: sensitivity and influencing factors,” Sensors, vol. 10, no. 3,
pp. 2088–2160, Mar. 2010.
data acquisition circuit boards, and corresponding artificial [13] R. P. Arasaradnam et al., “Insights into ’fermentonomics’: Evaluation
intelligence algorithms, which can identify and predict the of volatile organic compounds (VOCs) in human disease using an elec-
concentration of C2 H5 OH, NH3 , and H2 S released by spoiled tronic ’e-nose,”’ J. Med. Eng. Technol., vol. 35, no. 2, pp. 1113–1122,
Jan. 2011.
food. The collected gas sample data are converted into pictures [14] Y.-Q. Jing, Q.-H. Meng, P.-F. Qi, M.-L. Cao, M. Zeng, and S.-G. Ma,
by the Fourier series, and the classification accuracy rate of our “A bioinspired neural network for data processing in an electronic nose,”
CNN model with dropout technology reaches 91.9%. Under IEEE Trans. Instrum. Meas., vol. 65, no. 10, pp. 2369–2380, Oct. 2016.
[15] W. Zhang et al., “A novel gas recognition and concentration estimation
the support of SMOTE, we further improved the generaliza- model for an artificial olfactory system with a gas sensor array,” IEEE
tion performance of the classification model, in which the Sensors J., vol. 21, no. 17, pp. 18459–18468, Sep. 2021.
accuracy rate reached 96.67%. Further comparisons with the [16] C. Liu et al., “Highly sensitive and recoverable room-temperature
typical algorithms, such as SVM, DT, MLPNN, and k-NN, NO2 gas detection realized by 2D/0D MoS2 /ZnS heterostructures with
synergistic effects,” Sens. Actuators B, Chem., vol. 347, Nov. 2021,
demonstrated that our proposed model has the best over- Art. no. 130608.
all performance. The gas concentration estimation has been [17] S. Tohidi, M. Parhizkar, H. Bidadi, and R. Mohamad-Rezaei, “Elec-
achieved by a proposed mathematical model. In contrast to the trodeposition of polyaniline/three-dimensional reduced graphene oxide
hybrid films for detection of ammonia gas at room temperature,” IEEE
concentration estimation through machine learning, our model Sensors J., vol. 20, no. 17, pp. 9660–9667, Sep. 2020.
has the advantages of simplicity and strong interpretability. For [18] T. Liang, Z. Dai, Y. Liu, X. Zhang, and H. Zeng, “Suppression of Sn2+
C2 H5 OH, NH3 , and H2 S, the MAEs and R 2 s are (3.71 ppm, and Lewis acidity in SnS2 /black phosphorus heterostructure for ppb-
level room temperature NO2 gas sensor,” Sci. Bull., vol. 66, no. 24,
0.968), (0.5 ppm, 0.968), and (0.13 ppm, 0.99), respectively. pp. 2471–2478, Dec. 2021.
In addition, an experiment is used to verify the practical appli- [19] J. Zhou et al., “Highly sensitive NO2 response and abnormal P-N sensing
cation performance of the proposed model. The experiment transition with ultrathin Mo-doped SnS2 nanosheets,” Chem. Eng. J.,
demonstrated good freshness assessment ability for beef, pork, vol. 420, Sep. 2021, Art. no. 127572.
[20] S. M. Aghaei, A. Aasi, and B. Panchapakesan, “Experimental and
and kiwifruit. theoretical advances in MXene-based gas sensors,” ACS Omega, vol. 6,
no. 4, pp. 2450–2461, Feb. 2021.
[21] X. Chen et al., “A novel artificial neuron like gas sensor constructed
ACKNOWLEDGMENT from CuS quantum dots/Bi2 S3 Nanosheets,” Nano-Micro Lett., vol. 14,
The authors acknowledge analysis support from the Instru- p. 8, Dec. 2022.
mental Analysis Center and the Center for Advanced Elec- [22] E. L. Hines, E. Llobet, and J. W. Gardner, “Electronic noses: A review
of signal processing techniques,” IEE Proc.-Circuits, Devices Syst.,
tronic Materials and Devices, Shanghai Jiao Tong University, vol. 146, no. 6, pp. 297–310, Dec. 1999.
Shanghai, China. [23] T. Wang et al., “Type discrimination and concentration prediction
towards ethanol using a machine learning–enhanced gas sensor array
with different morphology-tuning characteristics,” Phys. Chem. Chem.
R EFERENCES Phys., vol. 23, no. 41, pp. 23933–23944, Oct. 2021.
[24] H. Ma et al., “A low-cost and efficient electronic nose system for
[1] A. Borchers, S. S. Teuber, C. L. Keen, and M. E. Gershwin, “Food quantification of multiple indoor air contaminants utilizing HC and
safety,” Clin. Rev. Allergy, vol. 39, no. 2, pp. 95–141, Oct. 2010.
PLSR,” Sens. Actuators B, Chem., vol. 350, Jan. 2022, Art. no. 130768.
[2] K. Liu and C. Zhang, “Volatile organic compounds gas sensor based
[25] Z. Chen, Y. Zheng, K. Chen, H. Li, and J. Jian, “Concentration estimator
on quartz crystal microbalance for fruit freshness detection: A review,”
of mixed VOC gases using sensor array with neural networks and
Food Chem., vol. 334, Jan. 2021, Art. no. 127615.
decision tree learning,” IEEE Sensors J., vol. 17, no. 6, pp. 1884–1892,
[3] S. Matindoust, A. Farzi, M. B. Nejad, M. H. S. Abadi, Z. Zou, and
Mar. 2017.
L.-R. Zheng, “Ammonia gas sensor based on flexible polyaniline films
for rapid detection of spoilage in protein-rich foods,” J. Mater. Sci., [26] M. A. H. Khan, B. Thomson, R. Debnath, A. Motayed, and M. V. Rao,
Mater. Electron., vol. 28, no. 11, pp. 7760–7768, Feb. 2017. “Nanowire-based sensor array for detection of cross-sensitive gases
[4] Y. Luo et al., “Role of cobalt in co-ZnO nanoflower gas sensors for using PCA and machine learning algorithms,” IEEE Sensors J., vol. 20,
the detection of low concentration of VOCs,” Sens. Actuators B, Chem., no. 11, pp. 6020–6028, Jun. 2020.
vol. 360, Jun. 2022, Art. no. 131674. [27] J. Wang, S. Lian, B. Lei, B. Li, and S. Lei, “Co-training neural network-
[5] D. Ma, J. Gao, Z. Zhang, and H. Zhao, “Gas recognition method based infrared sensor array for natural gas monitoring,” Sens. Actuators
based on the deep learning model of sensor array response map,” Sens. A, Phys., vol. 335, Mar. 2022, Art. no. 113392.
Actuators B, Chem., vol. 330, Mar. 2021, Art. no. 129349. [28] V. Pareek, S. Chaudhury, and S. Singh, “Hybrid 3DCNN-RBM network
[6] D. Kwak, Y. Lei, and R. Maric, “Ammonia gas sensors: A comprehensive for gas mixture concentration estimation with sensor array,” IEEE
review,” Talanta, vol. 204, pp. 713–730, Nov. 2019. Sensors J., vol. 21, no. 21, pp. 24263–24273, Nov. 2021.
[7] H. Nazemi, A. Joseph, J. Park, and A. Emadi, “Advanced micro- and [29] T. Wang et al., “Target discrimination, concentration prediction, and
nano-gas sensor technology: A review,” Sensors, vol. 19, no. 6, p. 1285, status judgment of electronic nose system based on large-scale measure-
Mar. 2019. ment and multi-task deep learning,” Sens. Actuators B, Chem., vol. 351,
[8] C.-H. Han, D.-W. Hong, S.-D. Han, J. Gwak, and K. C. Singh, “Catalytic Jan. 2022, Art. no. 130915.
combustion type hydrogen gas sensor using TiO2 and UV-LED,” Sens. [30] P. Peng, X. Zhao, X. Pan, and W. Ye, “Gas classification using
Actuators B, Chem., vol. 125, no. 1, pp. 224–228, Jul. 2007. deep convolutional neural networks,” Sensors, vol. 18, no. 2, p. 157,
[9] L. Fraiwan, K. Lweesy, A. Bani-Salma, and N. Mani, “A wireless home Jan. 2018.
safety gas leakage detection system,” in Proc. 1st Middle East Conf. [31] S.-H. Wang, T.-I. Chou, S.-W. Chiu, and K.-T. Tang, “Using a hybrid
Biomed. Eng., Feb. 2011, pp. 11–14. deep neural network for gas classification,” IEEE Sensors J., vol. 21,
[10] Z. Yang et al., “Construction, application and verification of a no. 5, pp. 6401–6407, Mar. 2021.
novel formaldehyde gas sensor system based on Ni-doped SnO2 [32] M. A. Bridges and M. R. Mattice, “Over two thousand estimations of the
nanoparticles,” IEEE Sensors J., vol. 21, no. 9, pp. 11023–11030, pH of representative foods,” Amer. J. Digestive Diseases, vol. 6, no. 7,
May 2021. pp. 440–449, Jul. 1939.

Authorized licensed use limited to: Universiti Tunku Abdul Rahman. Downloaded on June 21,2023 at 05:32:27 UTC from IEEE Xplore. Restrictions apply.
LUO et al.: E-NOSE SYSTEM BASED ON FOURIER SERIES 3351

[33] T. W. Kim, C. W. Kim, M. R. Yang, G. R. No, S. W. Kim, and I.-S. Kim, Jianhua Yang is currently an Assistant Professor with Shanghai Jiao
“Pork quality traits according to postmortem pH and temperature in Tong University, Shanghai, China. His research interests include new
berkshire,” Korean J. Food Sci. Animal Resour., vol. 36, no. 1, pp. 29–36, wearable devices, microelectromechanical systems (MEMS), and the
Feb. 2016. design of measurement and control circuit.
[34] H. Korkeala, O. Mäki-Petäys, T. Alanko, and O. Sorvettula, “Determi-
nation of pH in meat,” Meat Sci., vol. 18, no. 2, pp. 121–132, Jan. 1986.
[35] G. E. Hinton, N. Srivastava, A. Krizhevsky, I. Sutskever, and
R. R. Salakhutdinov, “Improving neural networks by preventing co-
adaptation of feature detectors,” 2012, arXiv:1207.0580.
[36] A. Fernández, S. Garcia, F. Herrera, and N. V. Chawla, “SMOTE for Min Zeng is currently an Associate Professor with Shanghai Jiao Tong
learning from imbalanced data: Progress and challenges, marking the 15- University, Shanghai, China. His research interests include synthesis of
year anniversary,” J. Artif. Intell. Res., vol. 61, pp. 863–905, Apr. 2018. nanomaterials and their applications in nanodevices.
[37] M. Yan et al., “Humidity compensation based on power-law response for
MOS sensors to VOCs,” Sens. Actuators B, Chem., vol. 334, May 2021,
Art. no. 129601.

Nantao Hu is currently an Associate Professor with Shanghai Jiao Tong


University, Shanghai, China. His research interests include synthesis of
Jie Luo is currently pursuing the master’s degree with Shanghai Jiao nanomaterials and their applications in nanodevices.
Tong University, Shanghai, China.
His research focus includes machine learning and algorithms for
sensor array.

Yanjie Su is currently an Associate Professor with Shanghai Jiao Tong


University, Shanghai, China. His research interests include synthesis of
Zehao Zhu is currently pursuing the master’s degree with Shanghai Jiao
nanomaterials and their applications in nanodevices.
Tong University, Shanghai, China.
His research focus includes machine learning and algorithms for
sensor array.

Ruili Liu is currently an Associate Professor with Shanghai Jiao Tong


Wen Lv is currently pursuing the Ph.D. degree with Shanghai Jiao Tong University, Shanghai, China. Her research interests include soft robots
University, Shanghai, China. and actuators.
His research focus includes wireless gas sensor.

Jian Wu is currently pursuing the Ph.D. degree with Shanghai Jiao Tong Zhi Yang is currently a Professor with Shanghai Jiao Tong University,
University, Shanghai, China. Shanghai, China. His research interests include synthesis of nanomate-
His research focus includes nanoelectronic materials and devices. rials and their applications in nanodevices.

Authorized licensed use limited to: Universiti Tunku Abdul Rahman. Downloaded on June 21,2023 at 05:32:27 UTC from IEEE Xplore. Restrictions apply.

You might also like