A Novel Channel-attention-based Dense Network for Gas Recognition in Complex Airflow Environments

An electronic nose is a commonly used technology for gas detection. However, due to the complex diffusion mechanism of gaseous chemical analytes in the natural environment, the gas often exhibits irregular turbulent flow patterns. This variability results in different responses to the same gas in the e-nose, which presents significant challenges in the gas identification tasks. In this study, we propose an efficient method for gas recognition by combining a Dense Convolutional Network (DenseNet) with an Efficient Channel Attention Network (ECANet), which uses one-dimensional convolutional neural networks to improve the capability of extracting sequence signals. We evaluate the proposed method using an open-source dataset and observe that it outperforms the best current methods available, including the ResNet, Long Short-term Memory Network (LSTM) networks, and Gate Recurrent Unit (GRU) networks, with a classification accuracy of 99.8%.


Introduction
The electronic nose has wide applications in many fields, as many abnormal conditions often accompany specific gases.For example, when there is partial discharge in air switchgear, air decomposition products such as nitrogen monoxide, carbon monoxide, and nitrogen dioxide will be produced [1], the ethylene gas will be released when fruits ripen [2], and the detection of harmful pollutants in buildings can be achieved through the detection of formaldehyde [3].
For the electronic nose system, the classifier architecture is one of the most important factors affecting its classification accuracy.Some researchers are devoted to optimizing traditional gas identification machine learning algorithms, including the K-Nearest Neighbour, Support Vector Machine (SVM), and Gradient Boosting Decision Tree (GBDT), etc. [4][5][6].Deep neural networks are capable of automatically extracting useful deep and shallow features from raw and unprocessed data, making them increasingly favored by researchers in gas classification tasks.For example, Xiong et al. used a pulse neural network to establish a model to predict food shelf life [7].Gas identification based on Artificial Neural Networks (ANN) has been proven to be more effective in electronic nose pattern recognition [8].
However, as the depth of deep neural networks increases, the problem of gradient disappearance becomes more and more serious.Based on this, Huang et al. proposed Dense Convolutional Network (DenseNet) [9], as a dense connection network, which can ensure the maximum information flow between layers by directly connecting all layers pairwise.In recent years, DenseNet has been used for various gas classification tasks and achieved good results.
Traditional neural networks have other issues, namely information loss during training and difficulties in handling long-distance dependencies.Attention mechanisms can address these problems by adaptively focusing on and extracting information from different parts of the input sequence through weighting.This study adopts an Efficient Channel Attention (ECA) module and adjusts the network structure to better suit one-dimensional gas data.The module contains only a few parameters while significantly improving performance.The main contributions of this paper are summarized as follows.
1. We propose a One-dimensional DenseNet with ECA (1D-DNE) model for gas data classification.A dense connection network is used to combine shallow and deep features of gas data, so that the network can retain more information.
2. We use one-dimensional convolutional networks instead of two-dimensional convolutional networks to separate gas data between different sensors and obtain better classification results.
3. An ECA module is used to effectively capture inter-channel interactions, allowing the network to achieve higher accuracy.

Data Description
In this study, we utilized an open-source gas dataset published on the UCI Machine Learning Repository by Alexander Vergara et al. [10], which collects data from a system consisting of 9 arrays.To better replicate the patterns of gases in complex airflow environments, the collection system is placed in a 2.5 m × 1.2 m × 0.4 m wind tunnel research test facility at the BioCircuits Institute of the University of California, San Diego.Array 1 and 9 correspond to positions near the wall, while array 5 is located on the main line orthogonal to the gas turbulence.Each array is composed of 8 different metal oxide gas sensors.
A total of 18, 000 time series measurement records were obtained from the collection system, measuring ten high-priority chemical gases.The sampling system measures the conductivity of the MOS sensor-sensitive layer at a sampling rate of 100 Hz, and the data contains the complete gas reaction process.Due to the experimental settings, the data has a large number of deep and shallow features, which increases the requirement for classification algorithms to extract hidden features while retaining low-level features.

Dataset Processing
Each entry in the dataset has dimensions of 72 × 2600, which is too high and can affect data processing speed.To preserve the features of the data as much as possible, we use average pooling as the dimension reduction method, which can be calculated by Equation (1).
where  represents the input 1D data,  represents the pooled 1D data,  represents the index in the output data, and  represents the size of the pooling window.Figure 1 shows the waveform of the data reduced to 260 dimensions in the time dimension.Compared with the original waveform, the data after dimensionality reduction has almost no loss of information.

Method
The model of 1D-DNE is inspired by the design of DenseNet.However, there are some key differences in our proposed 1D-DNE.We introduced one-dimensional convolution in DenseNet to better handle the one-dimensional gas data.In addition, 1D-DNE employs a local cross-channel interaction strategy to incorporate global context into local features, enabling the network to pay attention to the more important channels.

The architecture of 1D-DNE
Figure 2 outlines the structure of our proposed 1D-DNE.Primarily, the architecture comprises three dense blocks, each consisting of numerous one-dimensional convolutional neural network layers tasked with extracting sequence signals.Posterior to each dense block is a transition layer module, employed to control feature map sizes and encode the feature maps derived from the preceding dense block, thereby enhancing the computational efficiency and learning capacity of the model.Each transition layer is coupled with an ECA module.By introducing the ECA module, the model can obtain a larger receptive field, thereby improving the accuracy of the classification results.Dense connectivity is implemented within a dense block by directly linking each layer to all subsequent layers.This direct connectivity ensures the maximum flow of information between layers in the network.Figure 2 illustrates the schematic diagram of the dense block.The  layer receives all the feature maps  ,  , ⋯ ,  from preceding layers as input, as depicted in Equation ( 2).   ,  , ⋯ , where  ,  , ⋯ ,  denotes the concatenation of the feature maps generated in layers 0 to  1.The direct connections between each layer within a dense block enhance the diversity of inputs for each layer, thereby improving efficiency [11].Subsequently,  • executes a series of consecutive transformations: batch normalization (BN), followed by a rectified linear unit (ReLU), and finally onedimensional convolution.The transition layer is used in the 1D-DNE to connect feature maps with different sizes.The transition layer, as shown in Figure 2, consists of a BN layer, a convolution layer, and an average pooling layer.The convolution layer typically has a kernel size of 1 1 , which is used to reduce the number of channels in the input feature maps.The one-dimensional average pooling layer is employed to reduce the size of the feature maps.The transition layer transforms feature maps with larger sizes and multiple channels into feature maps with smaller sizes and lower channels.These transformed feature maps are then fed into the ECA module for attention-weighted processing.

ECA module
Studies have indicated that past attention mechanisms incorporating dimensionality reduction operations might negatively influence the prediction of channel attention and inadequately capture dependencies.Building upon this insight, our study employs an ECA module, custom-designed for one-dimensional convolutional neural networks.This module is optimized specifically for handling one-dimensional data.A schematic representation of the ECA module is depicted in Figure 2.
One-dimensional data with  channels first undergo a global average pooling operation to reduce the dimensionality to 1 1 .The attention mechanism is implemented through a one-dimensional convolution with a kernel size of t, where  represents the coverage range of local cross-channel interactions.A mapping relationship, denoted by ϕ, is established between the kernel size  and the channel dimension .To imbue this mapping with greater generality, we hypothesize it as a non-linear function.More specifically, we designate it as an exponential function with a base of 2, as depicted in Equation ( 3 Given a channel dimension C, we can uniquely determine a convolutional kernel size k, as shown in Equation ( 4): where the notation | • | odd represents the rounding function for odd numbers.This is used to maintain the symmetry of the convolutional network and simplify boundary handling.The values of  and  can be chosen based on empirical observations.Here, we take  as 2 and  as 1.After onedimensional convolution, for an aggregated feature  ℝ without dimension reduction, the ECA module can learn channel attention weights  according to Equation (5).

𝜔 𝜎 Wy
To implement this functionality using a one-dimensional convolutional network, we can use Equations ( 6) and (7).
1  (7) where Ω represents the set of  adjacent channels to  .1 represents a one-dimensional convolution.

Result and Analysis
In this investigation, we utilized a CPU (Intel i9 12700k) and a GPU (GeForce RTX 3090 Ti) as the hardware development environment, with the 1D-DNE model being implemented in PyTorch 1.12.1.To avoid any bias caused by chance, all experimental results are obtained using ten-fold cross-validation.The dataset incorporates ten distinct gas types, but there are two different concentrations of CO gas (CO 1000ppm and CO 4000ppm), which allows for the prediction to be bifurcated into either the 10-class or the 11-class classification task (with CO 1000ppm and CO 4000ppm being treated as two separate gases).

Comparison with Other Models
To corroborate the effectiveness of our proposed model, we contrast the performance of our 1D-DNE with a variety of established networks.These include recurrent networks such as the Long Short-term Memory Network (LSTM) networks and Gated Recurrent Unit (GRU) networks, CNN networks with attention mechanisms, and ResNet with residual structures.The classification results are depicted in Table 1, while the accuracy curve for the validation set is illustrated in Figure 4.As evidenced by Table 1, both our proposed 1D-DNE and the ResNet network exhibit commendable classification performance.This is attributable to the presence of residual structures that preserve the shallow features of the gas data.Similarly, GRU and LSTM display robust classification performance owing to their adept handling of sequential data.Conversely, the performance of CNN-A is somewhat lackluster.
Figure 4 delineates the accuracy curves of our 1D-DNE and other comparative networks on the validation set.It is noteworthy that our proposed 1D-DNE attains extraordinarily swift convergence, requiring only 60 epochs.Other networks necessitate training for 150 epochs to achieve comparable convergence.The performance of the proposed 1D-DNE network surpasses that of the other network architectures in terms of both convergence speed and final accuracy.

Ablation experiments
In order to assess the efficacy of the employed ECA module, this section undertakes ablation experiments.The network will be divided into two distinct architectures: one with the ECA module and one without the ECA module.Subsequently, ten-fold cross-validation will be executed on both configurations to facilitate a comparative performance analysis.The ECA module enhances channel features in the input feature maps, which can improve the convergence speed and achieve higher accuracy for the network.Figure 5 illustrates the changes in validation accuracy for two different configurations in ten-fold cross-validation.From the curves, it can be observed that the accuracy curve shows an overall upward trend.It is noticeable that the architecture with the ECA module consistently exhibits higher accuracy in most instances.

Conclusion
In this work, we present a novel approach for gas data recognition.Initially, acknowledging the dependency of deep and shallow features on gas recognition, we employ a DenseNet architecture that proficiently conserves features across varying depths.Next, to overcome the limitations of 2D convolutional networks in capturing sequence signals, we adapt the DenseNet to utilize 1D convolutional networks.This modification facilitates the separation of signals among diverse sensors and strengthens the generalization capacity of the model.Finally, we incorporate the ECA module into the network, which learns weights by concentrating on dependencies and cross-channel interactions, thereby yielding superior accuracy.
The experimental results demonstrate that our proposed method outperforms traditional networks across various performance metrics.With the inclusion of the ECA module, the network can capture more complex channel correlations, leading to improved classification accuracy.This method provides valuable insights for future gas data processing and can serve as a reference for further studies in this field.
The training curves for the 1D-DNE model, employing two different classification strategies, are represented in Fig.3.Observably, in comparison to the 10-class classification, the 11-class classification exhibits diminished accuracy and augmented loss across most training intervals.To evaluate the performance of the proposed algorithm, future experiments will be conducted using the 11-class classification as the default experimental setting.(A) (B) Fig. 3 Evaluation criteria trends for the 10-class and the 11-class classification strategies.(A) Comparison of validation set accuracy, (B) Comparison of validation set loss.

Figure 4 .
Figure 4. Validation accuracy curves of 1D-DNE and the compared networks on the turbulent gas dataset.The upper x-axis and lower x-axis represent the validating epochs of the 1D-DNE model and the other networks, respectively.

Figure 5 .
Figure 5.The variations of validation accuracy with the number of training epochs for the settings (A) with and (B) without the ECA module in the ten-fold cross-validation.

Table 1 .
Comparison of various data metrics between 1D-DNE and compared network architectures on the turbulent gas dataset