Next Article in Journal
Development and Evaluation of a Full-Waveform Resistance Training Monitoring System Based on a Linear Position Transducer
Next Article in Special Issue
Kinetics of Chemisorption on the Surface of Nanodispersed SnO2–PdOx and Selective Determination of CO and H2 in Air
Previous Article in Journal
Fully Integrated Line Array Angular Displacement Sensing Chip
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Bio-Inspired Spiking Neural Network with Few-Shot Class-Incremental Learning for Gas Recognition

1
School of Integrated Circuits, Tsinghua University, Beijing 100084, China
2
Suzhou Huiwen Nanotechnology Co., Ltd., Suzhou 215004, China
3
State Key Laboratory of Transducer Technology, Shanghai Institute of Microsystem and Information Technology, Chinese Academy of Sciences, Shanghai 200050, China
*
Author to whom correspondence should be addressed.
Sensors 2023, 23(5), 2433; https://doi.org/10.3390/s23052433
Submission received: 8 February 2023 / Revised: 17 February 2023 / Accepted: 20 February 2023 / Published: 22 February 2023
(This article belongs to the Special Issue Gas Sensors: Materials, Mechanism and Applications)

Abstract

:
The sensitivity and selectivity profiles of gas sensors are always changed by sensor drifting, sensor aging, and the surroundings (e.g., temperature and humidity changes), which lead to a serious decline in gas recognition accuracy or even invalidation. To address this issue, the practical solution is to retrain the network to maintain performance, leveraging its rapid, incremental online learning capacity. In this paper, we develop a bio-inspired spiking neural network (SNN) to recognize nine types of flammable and toxic gases, which supports few-shot class-incremental learning, and can be retrained quickly with a new gas at a low accuracy cost. Compared with gas recognition approaches such as support vector machine (SVM), k-nearest neighbor (KNN), principal component analysis (PCA) +SVM, PCA+KNN, and artificial neural network (ANN), our network achieves the highest accuracy of 98.75% in five-fold cross-validation for identifying nine types of gases, each with five different concentrations. In particular, the proposed network has a 5.09% higher accuracy than that of other gas recognition algorithms, which validates its robustness and effectiveness for real-life fire scenarios.

1. Introduction

With the development of artificial intelligence and sensing technology, the electronic nose (E-nose) is becoming increasingly intelligent. As a bionic detection technique that mimics the mammal’s olfaction system well [1], the E-nose has been developed for nearly 40 years [2] and is remarkably successful in many applications including food safety [3,4,5], environment monitoring [6], agriculture [7], industry [8], public safety [9,10] and so on.
Generally, the E-nose is composed of two parts (shown in Figure 1): a gas sensing system and an information processing system [11,12]. The “gas sensing system” obtains gas data from the gas sensor array, and the “interface readout circuit” converts the sensor signals into electrical signals. Finally, the “gas recognition circuit” outputs the final recognition results with gas recognition algorithms. In the E-nose system, gas recognition algorithms play an important role as they determine the decision-making result of the system. As reported in [13], for E-nose systems it is vital to improve the gas qualitative recognition accuracy; if the gas type is recognized incorrectly, gas concentration quantitative estimation is meaningless. As said in [14], the reasonable improvement of the gas recognition algorithms is an important support for the development of the E-nose system.
Many gas recognition algorithms have been proposed, including k-nearest neighbor (KNN) [15,16], support vector machine (SVM) [17,18], decision tree (DT) [19], and naive Bayesian model (NBM) [20]. However, these algorithms are able to identify less than five kinds of gases as reported, which is not applicable for real-time multi-gas recognition tasks. As we know, in fire various toxic gases will be generated before and after the explosion of flammable and explosive gases, which requires identifying a wide range of gases, including flammable, explosive, and toxic gases. Unfortunately, there are no distinct examples to offer evidence that these common gas recognition algorithms are able to identify multiple gases [21].
On the other hand, with the rapid development of the artificial neural network (ANN), it is proved that an increasing number of ANNs including the back propagation neural network (BPNN) [22], convolutional neural network (CNN) [23], and radial basis function neural network (RBFNN) [24] perform well in gas recognition. In 2021, D. Ma et al. [25] proposed a 15-layer CNN to recognize 10 different VOCs (volatile organic compounds) with 92% accuracy. Additionally, the spiking neural network (SNN) has also been developed for gas recognition in recent years. In 2020, Imam Nabil and Cleland T.A [26] presented an SNN with one-shot learning and identification of odorant samples. The two-layer network with 72 channels reached 92% accuracy for 10 kinds of gas recognitions under 40% noise. However, this work needs high-dimensional gas sensor data, which are difficult to implement in the wild.
One fundamentally ill-posed problem that needs to urgently be addressed is sensor drift, with which the sensitivity and selectivity profiles of gas sensors gradually change over the time of use or disuse [27]. Fortunately, SNNs have a good anti-noise ability [28], and are robust to the gas data easily affected by surroundings like temperature and humidity. In addition, SNN-based biological plausible learning methods, like STDP, perform well in online learning [26,27], which is meaningful for gas recognition. Moreover, in [27] the SNN exhibits 94.93% classification accuracy after few-shot learning without catastrophic forgetting, which is a challenge for most ANNs [29].
In this paper, we propose a novel bio-inspired SNN with few-shot class-incremental learning for gas recognition from 24 sensors. The network is able to recognize over nine types of gases commonly found in fires with five different concentrations. Meanwhile, it achieves at least 98.75% classification accuracy with only five training samples per gas, and retrains the network with new gases with little accuracy loss. Additionally, due to the characteristics of SNNs, a lot of multiplication is avoided. Sparse synapse connections further reduce the calculation cost.
The rest of the paper is organized as follows: In Section 2, we introduce the gas data acquisition experiments. The proposed SNN is presented in Section 3, and the experimental results are discussed in detail in Section 4. Section 5 concludes the paper.

2. Experiments

We collected gas data through an E-nose gas sampling system from Suzhou Huiwen Nanotechnology Co., Ltd. (Suzhou, China) The system consists of 24 gas sensors, each of which is sensitive to different gases. With the fire station’s recommendation, we chose nine types of flammable and toxic gases common in fires: formaldehyde, ethanol, propane, methanol, methane, carbon monoxide, acetone, hydrogen sulfide, and ammonia, as illustrated in Table 1. Each type of gas was tested 25 times for five different concentrations, thereby 225 samples were obtained of nine categories.
The gas sample collecting process of the E-nose system has four steps: (1) preparation step: the E-nose system works at a supply voltage of 3.3 V and the sampling frequency is set to 1 Hz. In the test environment, the temperature is set in the range of 25.6~27.9 °C and the relative humidity is between 40~50%. (2) baseline test step: it takes 15~30 min for the system to fill with pure air until all 24 gas sensors reach their steady value V s t e a d y 0 , , V s t e a d y 24 . (3) target gas test step: Continuously injecting the target gas into the E-nose sample system and waiting for about 5 min until all 24 sensors reach their steady response value V r e s p o n s e 0 , , V r e s p o n s e 24 . (4) baseline recovery step: injecting clean air to extract the target gas from the system and waiting for about 10~15 min until all 24 gas sensors return to the original baseline value V s t e a d y 0 , , V s t e a d y 24 .
If we take 2000 ppm methane (CH4) as an example, its response curves of the 24 gas sensors are represented in Figure 2, from which we can see that in the baseline test step and the response curves V s t e a d y 0 , , V s t e a d y 24 t are stable. When we continuously inject the target gas (2000 ppm methane), the response voltages ( V r e s p o n s e t ) of the 24 sensors are different, as shown in the middle of the response curve in Figure 2. Finally, when we inject the clean air, the response voltages return to the baseline value. According to the study [30], we use the differential method to process the sensor data and reduce the fixed external interference δ caused by noise and drift as described in Formula (1), where i = 1 , 2 , , 24 .
  V o u t p u t x t = V r e s p o n s e x t + δ V s t e a d y x t + δ = V r e s p o n s e x t V s t e a d y x t

3. Methods

3.1. Signal Preprocessing

As the gas data collected by the E-nose system are inevitably interfered by the environment and sensor drift, to ensure reliable classification performance, the gas data are pre-processed to alleviate the interference. We propose a novel preprocessing algorithm to normalize the gas sensor data to match the proposed SNN.
First, we adopt the variant of Minimum-Maximum Normalization (MMN) for gas data scaling to compensate for the heterogeneity of the 24 different gas sensors. The maximum and minimum response of each sensor can be easily found from the gas dataset collected by the E-nose system. Let G 1 ,   G 2 ,   ,   G n be the responses of n sensors to a given gas, and M 1 ,   M 2 ,   ,   M n and S 1 ,   S 2 ,   ,   S n be the maximum and minimum response values of the n sensors, respectively. Next, the set S : ρ G 1 S 1 M 1 S 1 , ρ G 2 S 2 M 2 S 2 ,   ,   ρ G n S n M n S n are deemed as the sensor-scaled values, and we keep γ maximum elements among the set S where ρ and γ are the scaling factor and cutoff factor, respectively. With this we aim to eliminate the interference caused by the insensitivity of the sensors to a given gas. It is proven that this step could improve the recognition performance significantly (Section 3.4).

3.2. Neuron Model

In order to model neuron dynamics, we adopt the integrate-and-fire (IF) model to simulate the basic functions of biological neurons, which are described in Equation (2):
τ d V t d t = ( V r e s t V t ) + τ e x c V i n t τ i n h V i n t  
where V t is the membrane voltage, V r e s t is the resting membrane voltage, V i n t is the changing voltage caused by input spikes, τ e x c and τ i n h are conductance constants of excitatory and inhibitory synapses, respectively, and τ is the timing constant. When the spike S e x c from excitatory synapses arrives at the neuron model, τ e x c V i n t causes an increase in the membrane voltage V t . On the contrary, when S i n h from inhibitory synapses arrives, V t decreases. Once V t reaches a membrane threshold V t h , the neuron model fires and V t   is set to V r e s t immediately. Then, the neuron model is in a refractory period, in which it cannot receive any spikes from any neurons or itself spike.

3.3. Network Architecture

The proposed network consists of the two layers shown in Figure 3. The first layer is the excitatory layer containing 24 neurons, where each is connected to one gas sensor. The second layer is the inhibitory layer including 120 neurons, where every 5 neurons correspond to one excitatory neuron. Each excitatory neuron and its corresponding five inhibitory neurons are regarded as a group called a glomerulus, hence there are 24 glomeruli in this model. Each glomerulus aims to increase the spiking levels of its own excitatory neuron inside and decrease the spiking levels of excitatory neurons from the other glomeruli.
We adopt a spike precedence coding method [31] for the excitatory neurons in the first layer, which is timing-based. With the method, the stronger input of sensor, the earlier spike phase. As described in [26], this spike timing-based coding offers considerable speed and efficiency advantages. After signal preprocessing, the gas data are transformed into spikes with spike precedence coding, and the number of spikes is proportional to the V o u t p u t x t of the gas sensor.
The connection between the excitatory and inhibitory neurons in the same glomerulus is called excitatory synapses, the connection probability is chosen to be 0.80 based on experiments in our work. The inhibitory neurons are randomly connected to the other excitatory neurons in different glomeruli with a connection probability of 0.25, in our case, and the connections are called inhibitory synapses. The excitatory and inhibitory synapses are adjusted by the conductance constants τ e x c and τ i n h , respectively.
The inhibitory synaptic connection causes lateral inhibition and competition among the excitatory neurons. To ensure the lateral inhibition is neither too weak, which means it does not have any influence on the weight update in the training stage, nor too strong, which leads to an imbalance between the winner and loser neurons, we set a ratio φ = τ e x c τ i n h between the excitatory and inhibitory synapse to adjust the connection strength.

3.4. Learning Rule

Spike-Timing-Dependent Plasticity (STDP) is adopted as the learning rule for both excitatory synapses and inhibitory synapses. STDP is a local learning method, where the synaptic plasticity is sensitive to the spiking time of the pre- and post- neurons. We have adopted the exponential variant STDP in (3) to update the weights of synapses through the spike-timing difference between the postsynaptic inhibitory and the presynaptic excitatory neurons. When the spike time t 1 of the post-neuron is earlier than the spike time t 2 of the pre-neuron ( t 1 < t 2 ), the weight w will increase by w . Otherwise, the weight w will decrease by w . The variable w is described below:
  w = η e x c e t 2 t 1 ε e x c   t 1 < t 2 η i n h e t 2 t 1 ε i n h   t 2 < t 1  
where η e x c and η i n h are learning rates of excitatory and inhibitory synapses, respectively, and ε e x c and ε i n h are used to measure the balance between the excitation degree caused by excitatory synapses and the inhibition degree caused by inhibitory synapses, respectively.
Here, we apply the STDP rules with lateral inhibition in the training stage between excitatory and inhibitory layers. The weight of the excitatory neuron E N i in the excitatory layer and the inhibitory neuron I N j in the inhibitory layer are as follows:
  W E N i t = W E N i t + j P s E N i w E N i j t s p i k e t j  
  W I N j t = W I N j t + w I N j j t s p i k e t i
where the set P s E N i includes all inhibitory neurons I N s that have inhibitory synaptic connections to the excitatory neuron E N i . The s p i k e t j is a spike function, whose value is 1 when the neuron I N j spikes with timestamp t , otherwise its value is 0.
If the input stimulus is strong enough to enable the neuron E N i to spike, the membrane voltage will rise for all I N j neurons that have excitatory synaptic connections in the same glomerulus (as shown in Figure 3). When the neuron I N j spikes (as described in Formula (5)), the weight of other excitatory neurons in different glomeruli in the form of inhibitory synapses will be updated according to Formulas (3) and (4). After several epochs, we find the excitatory neurons with a strong input stimulus become more active, and others relatively inactive, which is similar to the winners-take-all mechanism. As a result, the relatively active excitatory neurons are prominent so as to obtain good classification results.

3.5. Training and Output Classifier

To train the proposed network, we collected 9 types of gases. Each type of gas has 5 different concentrations, and each gas was tested five times with each concentration. Therefore, we obtained 225 gas samples. Generally, the ratio between the training and test sets is 0.8. As the proposed algorithm supports few-shot learning, we set the ratio to be 0.2. Each sample for the training set is calculated by 100 iterations. For comparison, the spiking times of the ENs in the excitatory layer are inputs to the classifier for sample classification according to a Manhattan distance metric. We measure the classification performance by computing the similarity between the output of the training sample ( V t r a i n ) and test sample ( V t e s t ). The test samples are classified according to the identity of the training samples that are most similar to them.
We adopt a Pearson correlation coefficient (PCC) to assess the degree of correlation between the training and test output vectors, V t r a i n and V t e s t . For n gas sensors, V t r a i n and V t e s t are n-dimensional vectors. We define the PCC as follows (6)–(11):
P C C = P x y P x P y  
P x y = 1 n 1 i = 1 n x i x ¯ y i y ¯  
  P x = 1 n 1 i = 1 n x i x ¯ 2  
  P y = 1 n 1 i = 1 n y i y ¯ 2  
x ¯ = 1 n   i = 1 n x i  
y ¯ = 1 n   i = 1 n y i  
where n is the number of gas sensors, and x i and y i are the ith elements of the vector V t r a i n and V t e s t , respectively. The value of PCC varies from 0 to 1. For k n-dimensional trained vectors, we will obtain k PCCs and k corresponding n-dimensional test vectors. We then choose the biggest PCC and take their corresponding ID as the recognition result.

4. Discussion

We have trained the proposed SNN including 24 excitatory neurons with 45 samples of the gas training dataset, including nine types of gases, and each gas has five different concentrations. Five gas samples were randomly selected for learning. The rest of the 180 samples were used for testing. For each excitatory neuron, the gas data are scaled down and selected using data pre-processing as described in Section 3.1, and then are transformed into continuous spikes using the spike precedence coding approach in Section 3.3. To verify the data pre-processing method, we trained our SNN with the raw data for comparison. The comparison results are shown in Figure 4, from which we find that with different numbers of training samples of each gas, an improvement of more than 19.29% in the overall accuracy rate is obtained when using the pre-processed data.
To obtain an optimal network, we studied the impact of network sizes on gas test accuracy based on the pre-processing method. First, we try to find the test accuracy with different numbers of inhibitory neurons (INs) per excitatory neuron through experiments. From Figure 5a, it is observed that as the number of INs increases, so does the test accuracy. The highest accuracy of 96.25% is obtained with five INs per excitatory neuron (ENs) (i.e., the total neuron number is 24@120 neurons). We then needed to find the accuracies with different numbers of synapses, including excitatory and inhibitory synapses of the network with five INs per EN. We changed the connection probability between the excitatory and the inhibitory layers, and the simulation results are illustrated in Figure 5b,c, from which we found that when the connection probabilities of ENs-INs and INs-ENs are 0.8 and 0.25 respectively, the highest test accuracy of 98.75% is achieved.
Although most artificial neural networks suffer from catastrophic forgetting [32], which means they have worse performance after they learn a new type of gas, our network exhibits an online incremental learning ability, and only a small loss of accuracy is seen for the trained gas after a new type of gas is learned. To verify the performance, we built a SNN with 24 ENs, five INs for each EN, about 96 excitatory synapses with the 0.8 connection probability of ENs-INs, and about 690 inhibitory synapses with the 0.25 connection probability of INs-ENs.
We randomly selected a sample for each gas as the training set, and trained the proposed network with one-shot learning gas one by one. After a new gas was learned, we tested the accuracy for the new trained gas, and the results are shown as illustrated in Figure 6. For contrast, we trained the proposed network with one-shot learning on the same training set, and tested the accuracy of each trained gas. The results are shown in Figure 7. By comparing Figure 6 and Figure 7, we find that before training the fifth gas, there is no accuracy loss for all the trained gases: methane, carbon monoxide, hydrogen sulfide, and acetone. For the sixth to ninth trained gas, the accuracy losses are 1.9%, 0.7%, 4.9%, and 1.1%, respectively. Although the recognition accuracies of methanol and ethanol are as low as 33.33% and 34.61%, respectively, there is only a 0.95% overall test accuracy decline after training the gases one by one, compared with training all nine gases with one-shot learning. The optimistic experimental results show that even with one-shot learning, the proposed network can effectively overcome the challenge of catastrophic forgetting which leads to a significant drop in accuracy after learning a new gas.
To further avoid the decrease in accuracy after learning a new gas, we increased the training samples for each gas instead of using one-shot learning. We trained the network with seven other few-shot learning schemes: two-shot, three-shot, and up to eight-shot. First, we needed to find out the relationship between the accuracy loss of all the trained gases after training a new one, and the number of training samples for each gas. As illustrated in Table 2, we found that there is no loss for few-shot learning schemes. This is meaningful because no accuracy loss when learning a new gas proves that our network is able to overcome the sensor drift and aging issues [27]. Once the response of the gas sensors to a specific gas varies greatly, the network will be retrained to keep the accuracy with an incremental learning ability to avoid catastrophic forgetting.
In addition, to improve the overall accuracy of the test set, we retrained the network with different learning schemes. The simulation results are shown in Table 3, from which we can see that with the increase in training samples, the accuracies for all gases rapidly rise and then increase slowly, eventually reaching and maintaining a constant value after training five samples for each gas. In other words, the five-shot learning scheme is the best with the highest accuracy of 98.75%. Moreover, the scheme had a 100% accuracy for methane, carbon monoxide, hydrogen sulfide, ammonia, formaldehyde, and propane. It can be concluded that the proposed network does not underfit or overfit during the testing process.
For further analysis, we collected the correct and incorrect samples and drew a normalized confusion matrix for the accuracies of the nine types of gases in Figure 8; where the horizontal coordinate represents the true class of the gas and the vertical coordinate stands for the predicted type of the gas. As shown in Figure 6, the correct recognition is achieved for most test samples, only a few samples are recognized as another gas: one methanol sample is identified as carbon monoxide and two ethanol samples are recognized as methanol.
Furthermore, we found that our network could identify different types of gases with the same or similar concentrations, but when the test gases have different concentrations, misidentification may happen. For example, the methanol sample at 10 ppm is recognized as carbon monoxide at 300 ppm. Consequently, when some gas sensors are affected by external surroundings, such as the temperature and humidity, small changes in the gas data may lead to changes in concentration, which makes it possible of the network to identify the gas as another gas. The solution to these issues is to enlarge the sensor array. As more sensors means more dimensional characteristics of the gas data, when some sensors are disturbed or even down, other undisturbed dimensions of data characteristics will have a positive effect on the recognition.
We compared the proposed SNN using five-shot learning with six other gas recognition methods: SVM, KNN, DT, PCA + KNN, PCA + SVM, and ANN. We use the radial basis function (RBF) as the kernel function of the SVM model, set K = 9 for the KNN model, and designed the single binary tree with 24 depths according to the differences in response values for each gas sensor, for each gas. The PCA approach is adopted for feature extraction, which reduces the dimensionality of the data by half and then combines it with KNN and SVM classifiers, respectively. Finally, we developed a three-layer artificial neural network using backpropagation with 24 input neurons, 12 hidden neurons, and nine output neurons.
We randomly selected five samples of each gas as a group. Then we adopted the five-fold cross-validation method, that is, one of five groups was taken as the training set in turn, and the others were used as a test set. The accuracy simulation results are shown in Figure 9, from which we can see that compared with SVM, KNN, and DT, better recognition results are obtained with PCA + SVM, PCA + KNN, and ANN. However, PCA + SVM and PCA + KNN performed poorly in the recognition of methane with 76% and 78% accuracy rates, respectively, methanol with 67% and 62%, respectively, formaldehyde with 66% and 73%, respectively, and ethanol with 73% and 73%, respectively, and the ANN model recognized ethanol with an accuracy of 83%. However, as shown in Figure 8, the proposed SNN had a 92% accuracy rate in the recognition of ethanol, which is 9% higher than that of ANN. Furthermore, our work had a 100% accuracy rate in the gas recognition of methane, carbon monoxide, hydrogen sulfide, acetone, ammonia, formaldehyde, and propane. Other methods such as PCA+SVM could only identify less than three gases with a 100% accuracy.
The overall accuracy for comparison between the proposed network and other methods is shown in Figure 10, from which we found that the proposed network has the highest accuracy of 98.75%, better than the SVM model with a 56.33% accuracy, the KNN model with 62.22%, the DT with 51.00%, the PCA + SVM with 83.11%, the PCA + KNN with 84.55%, and the ANN with 93.66%. Compared with the common (SVM, KNN, DT, PCA, and ANN) gas recognition algorithms, our work achieved an accuracy improvement of up to 5.09%. The proposed network had a better classification performance on cross-concentration gas recognition with the gas dataset for nine types of gases. Furthermore, the proposed network with the five-shot learning scheme had no accuracy loss when learning a new gas, thereby presenting incremental online learning ability.
To better present and validate the performance of the model, we built a deep learning ANN model using eight layers and a CNN model using 10 layers, by experimentally tuning the network size and parameters. The experimental results show that the deep learning models cannot obtain satisfactory accuracy results (85.7% with the 8-layer ANN and 89.3% with the 10-layer CNN). The reason many be that in the case of limited gas sensors (24 gas sensor in our work), the low-dimensional input data make the synaptic weights undergo gradient vanishing or gradient exploding during the weight update iterations, making the deep network over fit or under fit, resulting in a low recognition accuracy.
To further verify the performance of the proposed SNN, we tested our algorithm on the publicly available UCSD gas sensor drift dataset [32,33], which contains 13,910 gas samples from an array of 16 chemo sensors (eight features per sensor), exposed to six types of gas (ammonia, acetaldehyde, acetone, ethylene, ethanol, and toluene), and distributed across 10 batches that were sampled over three years to emphasize the challenge of sensor drift over time. For every batch of the UCSD gas sensor drift dataset, we randomly split the gas samples into a training set and a test set in a 4:1 ratio. The test accuracy results are shown in Table 4, from which we find the proposed network has the best average accuracy of 99.26% on the UCSD gas sensor drift dataset, which has a 4.33% average accuracy improvement to that of [32]. The optimistic results reveal that the proposed network has a competitive gas recognition performance.

5. Conclusions

In this work, a bio-inspired spiking neural network inspired by biological olfaction is proposed to recognize various types of flammable and toxic gases. We adopt a variety of min-max normalizations for data preprocessing method for feature extraction and interference resistance. Based on STDP, we innovatively designed an SNN with the inhibitory mechanism to further highlight the spike-phase relationship of gas data in different channels to achieve the winner-takes-all effect. The comparison with other algorithms showed that our network achieved the highest accuracy of 98.75% in a five-fold cross-validation for the identification of nine gases, each with five different concentrations. In addition, our network supports incremental learning, which is helpful to address sensor drifting and aging. The experimental results show that there is no accuracy loss for all trained gases after training a new one. To summarize, the proposed network with few-shot class-incremental learning is a feasible approach for fast detection and noise resistance, which is meaningful in real-life fire scenarios. In the future, we will apply the proposed network to more applications as well as E-noses to access its versatility further. We envisage that this can provide a universal gas recognition method. Our objective is also to improve the structure of the neural network by, for example, adding additional classifiers, which will enable the network to perform better recognition.

Author Contributions

Conceptualization, D.H.; methodology, D.H.; software, D.H.; validation, D.H., J.Z. and X.D.; formal analysis, D.H.; investigation, D.H.; resources, P.Z., S.Z., X.Y., J.W., M.L. and X.S.; data curation, P.Z., S.Z., X.Y., J.W., M.L. and X.S.; writing—original draft preparation, D.H.; writing—review and editing, H.C.; visualization, D.H.; supervision, H.C.; project administration, H.C.; funding acquisition, H.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Science and Technology Major Project from Minister of Science and Technology, China (Grant No. 2018AAA0103100) and National Natural Science Foundation of China (No. 92164110 and U19B2041), partly supported by Beijing Engineering Research Center (No. BG0149).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Wen, Z.; Ye, W.; Zhao, X.; Pan, X. A Novel 1D Deep Convolutional Neural Network Based Algorithm for Mixture Gases Recognition. In Proceedings of the 2018 IEEE 61st International Midwest Symposium on Circuits and Systems (MWSCAS), Windsor, ON, Canada, 5–8 August 2018; pp. 893–896. [Google Scholar]
  2. Persaud, K.; Dodd, G. Analysis of discrimination mechanisms in the mammalian olfactory system using a model nose. Nature 1982, 299, 352–355. [Google Scholar] [CrossRef] [PubMed]
  3. Concina, I.; Falasconi, M.; Sberveglieri, V. Electronic Noses as Flexible Tools to Assess Food Quality and Safety: Should We Trust Them? IEEE Sens. J. 2012, 12, 3232–3237. [Google Scholar] [CrossRef]
  4. Berna, A. Metal Oxide Sensors for Electronic Noses and Their Application to Food Analysis. Sensors 2010, 10, 3882–3910. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  5. Di Natale, C.; Macagnano, A.; Martinelli, E.; Paolesse, R.; Proietti, E.; D’Amico, A. The evaluation of quality of post-harvest oranges and apples by means of an electronic nose. Sens. Actuators B Chem. 2001, 78, 26–31. [Google Scholar] [CrossRef]
  6. Yao, D. A gas sensing system for indoor air quality control and polluted environmental monitoring. In Proceedings of the 2009 9th IEEE Conference on Nanotechnology (IEEE-NANO), Genoa, Italy, 26–30 July 2009; pp. 806–811. [Google Scholar]
  7. Jansen, R.; Hofstee, J.W.; Bouwmeester, H.; van Henten, E. Automated Signal Processing Applied to Volatile-Based Inspection of Greenhouse Crops. Sensors 2010, 10, 7122–7133. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  8. Morvan, M.; Talou, T.; Gaset, A.; Beziau, J. Electronic-nose systems for control quality applications in automotive industry. Sens. Actuators B Chem. 2000, 69, 384–388. [Google Scholar] [CrossRef]
  9. Wilson, A.D.; Baietto, M. Advances in Electronic-Nose Technologies Developed for Biomedical Applications. Sensors 2011, 11, 1105–1176. [Google Scholar] [CrossRef]
  10. Xu, Y.; Zhao, X.; Chen, Y.; Yang, Z. Research on a Mixed Gas Classification Algorithm Based on Extreme Random Tree. Appl. Sci. 2019, 9, 1728. [Google Scholar] [CrossRef] [Green Version]
  11. Tang, K.-T.; Goodman, R.M. Electronic olfaction System on a chip. In Proceedings of the SCI2001/ISAS2001 International Conference on Information Systems, Analysis and Synthesis, Orlando, FL, USA, 22–25 July 2001; Volume 15, p. 534. [Google Scholar]
  12. De Cesare, F.; Pantalei, S.; Zampetti, E.; Macagnano, A. Electronic nose and SPME techniques to monitor phenanthrene biodegradation in soil. Sens. Actuators B Chem. 2008, 131, 63–70. [Google Scholar] [CrossRef] [Green Version]
  13. Craven, M.A.; Gardner, J.W.; Bartlett, P.N. Electronic noses—Development and future prospects. Trends Anal. Chem. 1996, 15, 486–493. [Google Scholar] [CrossRef]
  14. Harsono, W.; Sarno, R.; Sabilla, S.I. Recognition of Original Arabica Civet Coffee Based on Odor Using Electronic Nose and Machine Learning. In Proceedings of the 2020 International Seminar on Application for Technology of Information and Communication (iSemantic), Semarang, Indonesia, 19–20 September 2020; pp. 333–339. [Google Scholar]
  15. Mirzaee-Ghaleh, E.; Taheri-Garavand, A.; Ayari, F.; Lozano, J. Identification of Fresh-Chilled and Frozen-Thawed Chicken Meat and Estimation of their Shelf Life Using an E-Nose Machine Coupled Fuzzy KNN. Food Anal. Methods 2020, 13, 678–689. [Google Scholar] [CrossRef]
  16. Qiu, S.; Wang, J. The prediction of food additives in the fruit juice based on electronic nose with chemometrics. Food Chem. 2017, 230, 208–214. [Google Scholar] [CrossRef] [PubMed]
  17. Chen, L.-Y.; Wu, C.-C.; Chou, T.-I.; Chiu, S.-W.; Tang, K.-T. Development of a Dual MOS Electronic Nose/Camera System for Improving Fruit Ripeness Classification. Sensors 2018, 18, 3256. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  18. Schroeder, V.; Evans, E.D.; Wu, Y.-C.M.; Voll, C.-C.A.; McDonald, B.R.; Savagatrup, S.; Swager, T.M. Chemiresistive Sensor Array and Machine Learning Classification of Food. ACS Sens. 2019, 4, 2101–2108. [Google Scholar] [CrossRef] [PubMed]
  19. Wijaya, D.R.; Sarno, R.; Daiva, A.F. Electronic nose for classifying beef and pork using Naïve Bayes. In Proceedings of the 2017 International Seminar on Sensors, Instrumentation, Measurement and Metrology (ISSIMM), Surabaya, Indonesia, 25–26 August 2017; pp. 104–108. [Google Scholar]
  20. Timsorn, K.; Thoopboochagorn, T.; Lertwattanasakul, N.; Wongchoosuk, C. Evaluation of bacterial population on chicken meats using a briefcase electronic nose. Biosyst. Eng. 2016, 151, 116–125. [Google Scholar] [CrossRef]
  21. Chen, H.; Huo, D.; Zhang, J. Gas Recognition in E-Nose System: A Review. IEEE Trans. Biomed. Circuits Syst. 2022, 16, 169–184. [Google Scholar] [CrossRef]
  22. Gu, S.; Wang, J.; Wang, Y. Early discrimination and growth tracking of Aspergillus spp. contamination in rice kernels using electronic nose. Food Chem. 2019, 292, 325–335. [Google Scholar] [CrossRef]
  23. Wang, Y.; Diao, J.; Wang, Z.; Zhan, X.; Zhang, B.; Li, N.; Li, G. An optimized deep convolutional neural network for dendrobium classification based on electronic nose. Sens. Actuators A Phys. 2020, 307, 111874. [Google Scholar] [CrossRef]
  24. Thazin, Y.; Pobkrut, T.; Kerdcharoen, T. Prediction of acidity levels of fresh roasted coffees using e-nose and artificial neural network. In Proceedings of the 2018 10th International Conference on Knowledge and Smart Technology (KST), Chiang Mai, Thailand, 31 January–3 February 2018. [Google Scholar]
  25. Ma, D.; Gao, J.; Zhang, Z.; Zhao, H. Gas recognition method based on the deep learning model of sensor array response map. Sens. Actuators B Chem. 2021, 330, 129349. [Google Scholar] [CrossRef]
  26. Imam, N.; Cleland, T.A. Rapid online learning and robust recall in a neuromorphic olfactory circuit. Nat. Mach. Intell. 2020, 2, 181–191. [Google Scholar] [CrossRef] [Green Version]
  27. Borthakur, A.; Cleland, T.A. A Spike Time-Dependent Online Learning Algorithm Derived from Biological Olfaction. Front. Neurosci. 2019, 13, 656. [Google Scholar] [CrossRef] [PubMed]
  28. Liang, L.; Hu, X.; Deng, L.; Wu, Y.; Li, G.; Ding, Y.; Li, P.; Xie, Y. Exploring Adversarial Attack in Spiking Neural Networks with Spike-Compatible Gradient. IEEE Trans. Neural Netw. Learn. Syst. 2021, 1–15, in press. [Google Scholar] [CrossRef] [PubMed]
  29. Parisi, G.I.; Kemker, R.; Part, J.L.; Kanan, C.; Wermter, S. Continual lifelong learning with neural networks: A review. Neural Netw. 2019, 113, 54–71. [Google Scholar] [CrossRef] [PubMed]
  30. Arshak, K.; Moore, E.; Lyons, G.M.; Harris, J.; Clifford, S. A review of gas sensors employed in electronic nose applications. Sens. Rev. 2004, 24, 181–198. [Google Scholar] [CrossRef] [Green Version]
  31. Panzeri, S.; Brunel, N.; Logothetis, N.K.; Kayser, C. Sensory neural codes using multiplexed temporal scales. Trends Neurosci. 2010, 33, 111–120. [Google Scholar] [CrossRef] [PubMed]
  32. Vergara, A.; Vembu, S.; Ayhan, T.; Ryan, M.A.; Homer, M.L.; Huerta, R. Chemical gas sensor drift compensation using classifier ensembles. Sens. Actuators B Chem. 2012, 166, 320–329. [Google Scholar] [CrossRef]
  33. Rodriguez-Lujan, I.; Fonollosa, J.; Vergara, A.; Homer, M.; Huerta, R. On the calibration of sensor arrays for pattern recognition using the minimal number of experiments. Chemom. Intell. Lab. Syst. 2014, 130, 123–134. [Google Scholar] [CrossRef]
  34. Gangopadhyay, A.; Chakrabartty, S. A Sparsity-Driven Backpropagation-Less Learning Framework Using Populations of Spiking Growth Transform Neurons. Front. Neurosci. 2021, 15, 904. [Google Scholar] [CrossRef]
Figure 1. E-nose system framework.
Figure 1. E-nose system framework.
Sensors 23 02433 g001
Figure 2. The response curve of 24 gas sensors with 2000 ppm CH4. (a) Response curves of the first twelve chemical gas sensors; (b) Response curves of the last twelve chemical gas sensors.
Figure 2. The response curve of 24 gas sensors with 2000 ppm CH4. (a) Response curves of the first twelve chemical gas sensors; (b) Response curves of the last twelve chemical gas sensors.
Sensors 23 02433 g002
Figure 3. Schematic model of the proposed spiking neural network.
Figure 3. Schematic model of the proposed spiking neural network.
Sensors 23 02433 g003
Figure 4. The average accuracy for all 9 types of gas with different numbers of training samples for each gas.
Figure 4. The average accuracy for all 9 types of gas with different numbers of training samples for each gas.
Sensors 23 02433 g004
Figure 5. (a) The overall accuracy for various numbers of INs (Inhibitory Neurons) for each EN (Excitatory Neuron); (b) The overall accuracy for different connection probabilities for ENs-INs; (c) The overall accuracy for the different connection probabilities for INs-ENs.
Figure 5. (a) The overall accuracy for various numbers of INs (Inhibitory Neurons) for each EN (Excitatory Neuron); (b) The overall accuracy for different connection probabilities for ENs-INs; (c) The overall accuracy for the different connection probabilities for INs-ENs.
Sensors 23 02433 g005
Figure 6. The test accuracy after one-shot learning the gases one by one.
Figure 6. The test accuracy after one-shot learning the gases one by one.
Sensors 23 02433 g006
Figure 7. The overall test accuracy after one-shot learning gases with all 9 gases.
Figure 7. The overall test accuracy after one-shot learning gases with all 9 gases.
Sensors 23 02433 g007
Figure 8. The confusion matrix for the accuracy of nine types of gases with the five-shot learning scheme.
Figure 8. The confusion matrix for the accuracy of nine types of gases with the five-shot learning scheme.
Sensors 23 02433 g008
Figure 9. The confusion matrix for the accuracies of (a) SVM; (b) KNN; (c) DT; (d) PCA+SVM; (e) PCA + KNN; (f) ANN.
Figure 9. The confusion matrix for the accuracies of (a) SVM; (b) KNN; (c) DT; (d) PCA+SVM; (e) PCA + KNN; (f) ANN.
Sensors 23 02433 g009
Figure 10. The overall accuracy of all the gas recognition methods for comparison.
Figure 10. The overall accuracy of all the gas recognition methods for comparison.
Sensors 23 02433 g010
Table 1. Analyses and their concentration used in this work.
Table 1. Analyses and their concentration used in this work.
AnalysesConcentration Levels (ppm)FlammabilityToxicity
Formaldehyde0.10, 0.15, 0.30, 0.50, 0.70LowModerate
Ethanol50, 100, 200, 500, 1000LowLow
Propane200, 500, 800, 1000, 1500LowLow
Methanol10, 20, 50, 80, 100ModerateModerate
Methane1000, 2000, 3000, 5000, 8000LowHigh
Carbon monoxide100, 150, 200, 250, 300ModerateModerate
Acetone10, 20, 50, 80, 100LowLow
Hydrogen sulfide0.20, 0.50, 0.80, 1.00, 1.50LowHigh
Ammonia5.0, 10.0, 20.0, 50.0, 80.0ModerateModerate
Table 2. The test accuracy of the proposed SNN with two different learning methods.
Table 2. The test accuracy of the proposed SNN with two different learning methods.
Overall Test AccuracyOne-ShotTwo-ShotThree-ShotFour-ShotFive-ShotSix-ShotSeven-ShotEight-Shot
Learning all 9 gases (%)74.34 ± 1.678.97 ± 1.393.99 ± 0.594.42 ± 0.398.75 ± 0.198.75 ± 0.198.75 ± 0.198.75 ± 0.1
Learning gases one by one (%)73.39 ± 2.178.97 ± 1.293.99 ± 0.994.42 ± 0.598.75 ± 0.198.75 ± 0.198.75 ± 0.198.75 ± 0.1
Accuracy loss (%)0.950.000.000.000.000.000.000.00
Table 3. The test accuracy for different gases based on the proposed SNN with different few-shot learning methods.
Table 3. The test accuracy for different gases based on the proposed SNN with different few-shot learning methods.
Accuracy (%)One-ShotTwo-ShotThree-ShotFour-ShotFive-ShotSix-ShotSeven-ShotEight-Shot
Methane100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0
Carbon monoxide100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0
Hydrogen sulfide96.42 ± 1.3100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0
Acetone84.00 ± 3.276.00 ± 1.992.00 ± 1.6100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0
Methanol33.33 ± 5.174.07 ± 1.592.59 ± 1.381.48 ± 1.296.29 ± 0.196.29 ± 0.196.29 ± 0.196.29 ± 0.1
Ammonia59.25 ± 2.166.67 ± 2.192.59 ± 1.3100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0
Formaldehyde87.50 ± 1.962.50 ± 1.5100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0
Propane65.38 ± 2.284.62 ± 1.6100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0100 ± 0.0
Ethanol34.61 ± 3.146.15 ± 2.869.23 ± 3.969.23 ± 3.392.31 ± 0.892.31 ± 0.892.31 ± 0.892.31 ± 0.8
Average73.39 ± 2.178.97 ± 1.293.99 ± 0.994.42 ± 0.598.75 ± 0.198.75 ± 0.198.75 ± 0.198.75 ± 0.1
Table 4. The test accuracy comparisons of the publicly available UCSD gas sensor drift dataset.
Table 4. The test accuracy comparisons of the publicly available UCSD gas sensor drift dataset.
Accuracy (%)Batch1Batch2Batch3Batch4Batch5Batch6Batch7Batch8Batch9Batch10Average
SNN’2019 [32]99.3992.4494.9597.7398.2294.5589.7492.3099.4890.4694.93
MLP’2021 [34]95.6395.4294.5399.5699.2090.2789.9696.5098.1180.8194.00
This work98.88 ± 0.399.80 ± 0.099.89 ± 0.0100 ± 0.0100 ± 0.098.91 ± 0.199.38 ± 0.198.31 ± 0.098.94 ± 0.098.47 ± 0.099.26 ± 0.0
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Huo, D.; Zhang, J.; Dai, X.; Zhang, P.; Zhang, S.; Yang, X.; Wang, J.; Liu, M.; Sun, X.; Chen, H. A Bio-Inspired Spiking Neural Network with Few-Shot Class-Incremental Learning for Gas Recognition. Sensors 2023, 23, 2433. https://doi.org/10.3390/s23052433

AMA Style

Huo D, Zhang J, Dai X, Zhang P, Zhang S, Yang X, Wang J, Liu M, Sun X, Chen H. A Bio-Inspired Spiking Neural Network with Few-Shot Class-Incremental Learning for Gas Recognition. Sensors. 2023; 23(5):2433. https://doi.org/10.3390/s23052433

Chicago/Turabian Style

Huo, Dexuan, Jilin Zhang, Xinyu Dai, Pingping Zhang, Shumin Zhang, Xiao Yang, Jiachuang Wang, Mengwei Liu, Xuhui Sun, and Hong Chen. 2023. "A Bio-Inspired Spiking Neural Network with Few-Shot Class-Incremental Learning for Gas Recognition" Sensors 23, no. 5: 2433. https://doi.org/10.3390/s23052433

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop