A gas recognition method based on sparse feature selection and spectrum enhancement network
By employing sparse feature selection and spectral enhancement network methods, the cross-response problem of gas sensor arrays in the detection of complex gas mixtures is solved, achieving efficient and accurate gas identification and concentration prediction, and improving the system's adaptability and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TIANJIN UNIVERSITY OF TECHNOLOGY
- Filing Date
- 2025-07-17
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, gas sensor arrays suffer from cross-response problems in the detection of complex gas mixtures, resulting in large errors in the identification results. Traditional machine learning and deep learning methods lack effective feature extraction and fusion capabilities when dealing with sensor cross-response, making it difficult to improve identification accuracy and robustness.
By employing a sparse feature selection and spectrum enhancement network approach, and through collaborative optimization of feature engineering and network models, core features of gas sensor array data are extracted. A spectrum enhancement multi-scale Fourier network is then constructed to dynamically enhance spectral domain feature information, reduce computational resource consumption, and improve recognition performance.
It significantly improves the accuracy and robustness of gas identification, reduces computational resource consumption, adapts to complex mixed gas environments, and improves the system's response speed and processing efficiency in practical application scenarios.
Smart Images

Figure CN121034444B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of deep learning and intelligent gas sensor detection technology, and in particular to a gas identification method based on sparse feature selection and spectrum enhancement network. Background Technology
[0002] Artificial olfaction systems typically consist of two main parts: a gas sensor array and a pattern recognition algorithm. The sensors in the array may exhibit cross-responses to multiple gases, meaning that the response signals of a single sensor to various different gases can be similar. This cross-response phenomenon significantly reduces the selectivity and accuracy of traditional gas sensors in detecting complex gas mixtures. Specifically, the sensor's response to a particular gas is affected not only by the gas itself but also by interference from other gases, leading to errors in the identification results. This problem severely limits the effectiveness of artificial olfaction systems in multi-gas environments.
[0003] To overcome the cross-sensitivity of gas sensors and improve the performance of artificial olfactory systems, researchers have made significant efforts in the development and innovation of decision-making systems. In particular, with the continuous development of artificial intelligence technology, many studies have begun to explore how to utilize machine learning and deep learning methods to improve gas detection. However, while these methods have achieved some progress in certain applications, they still face challenges, especially in the detection of complex gas mixtures. Effectively handling the cross-response problem of sensors remains a crucial issue that urgently needs to be addressed.
[0004] Traditional machine learning pattern recognition algorithms, such as Support Vector Machines (SVM), k-Nearest Neighbors (k-NN), and Random Forest, perform well in single-gas identification tasks, but often fail to fully realize their advantages in detecting complex gas mixtures. Because these algorithms typically rely on extensive prior knowledge and hand-designed feature engineering, they lack effective feature extraction and fusion capabilities when faced with the cross-sensitivities of gas sensors, thus limiting their selectivity and accuracy in complex gas environments.
[0005] Deep learning algorithms, especially convolutional neural networks (CNNs) and recurrent neural networks (RNNs), have achieved remarkable results in the field of gas detection due to their automatic feature extraction and powerful pattern recognition capabilities. However, most of these deep learning models rely on data features from a single modality and lack effective feature engineering methods to handle the cross-responses between sensors. Therefore, when dealing with complex gas mixtures, they are easily affected by redundant features, making it difficult to effectively extract key features and thus impacting the system's detection performance.
[0006] Therefore, there is an urgent need for a gas identification method based on sparse feature selection and spectral enhancement networks to address the shortcomings of existing technologies. Summary of the Invention
[0007] The purpose of this invention is to propose a gas identification method based on sparse feature selection and spectrum enhancement network. It aims to deeply mine the core features of gas sensor array data through feature engineering and network model co-optimization, overcome the cross sensitivity of gas sensors when facing complex mixed gases, improve the performance of deep learning models when detecting complex mixed gases, and has the characteristics of low computational cost and strong robustness.
[0008] To achieve the above objectives, this invention provides a gas identification method based on sparse feature selection and spectral enhancement networks, comprising the following steps:
[0009] S1. Preprocess the gas sensor array dataset to obtain the preprocessed gas sensor array data.
[0010] S2. Perform sparse feature selection on the preprocessed gas sensor array data to obtain gas sensor array data with variable density sparse feature selection and target labels.
[0011] S3. Construct a spectrum enhancement network model;
[0012] S4. Based on the gas sensor array data selected according to the variable density sparse features and the target label, the gas identification result is obtained using the spectrum enhancement network model.
[0013] Optionally, data preprocessing can be performed using the gas sensor array dataset to obtain preprocessed gas sensor array data, including:
[0014] S1-1. Obtain the sensor array data of the mixed gas and the corresponding gas concentration and type labels as the gas sensor array dataset;
[0015] S1-2. Normalization and linear interpolation are performed sequentially on the gas sensor array dataset to obtain the preprocessed gas sensor array data.
[0016] Optionally, sparse feature selection is performed on the preprocessed gas sensor array data to obtain variable-density sparse feature selected gas sensor array data and target labels, including:
[0017] S2-1. Based on the preprocessed gas sensor array data, perform partitioning processing using the Monte Carlo cross-validation method to obtain partitioning data of the preprocessed gas sensor array data.
[0018] S2-2. Using the partitioned data of the preprocessed gas sensor array data, obtain the instantaneous energy distribution characteristics of the gas in the gas sensor array data;
[0019] S2-3. Perform sparse feature selection on the instantaneous energy distribution characteristics of the gas in the gas sensor array data to obtain gas sensor array data with variable density sparse feature selection and target label.
[0020] Optionally, using the partitioned data of the preprocessed gas sensor array data, obtaining the instantaneous energy distribution characteristics of the gas in the gas sensor array data includes:
[0021] S2-2-1. Perform complete set empirical mode decomposition on the preprocessed gas sensor array data to obtain the set of gas intrinsic mode functions.
[0022] S2-2-2. Perform Hilbert transform based on the set of gas intrinsic mode functions to obtain the instantaneous energy distribution characteristics of the gas sensor array data.
[0023] Optionally, sparse feature selection is performed on the instantaneous energy distribution characteristics of the gas in the gas sensor array data to obtain variable density sparse feature selected gas sensor array data and target labels, including:
[0024] S2-3-1. Utilize the instantaneous energy distribution characteristics of the gas in the gas sensor array data to obtain the sparse selection probability distribution guided by the characteristic energy.
[0025] S2-3-2. Construct a variable-density sparse feature selection matrix based on the sparse selection probability distribution guided by the feature energy.
[0026] S2-3-3. The variable density sparse feature selection matrix is used to perform variable density sparse feature selection and enhancement on the preprocessed gas sensor array data to obtain gas sensor array data with variable density sparse feature selection.
[0027] S2-3-4. Based on the gas sensor array data selected according to the variable density sparse characteristics, obtain the corresponding label as the target label.
[0028] Optionally, the spectrum enhancement network model consists of a spectrum enhancement multi-scale TCN feature extraction layer, a linear projection layer, and N... FFT It consists of a stack of Fourier coding layers and a feature decoding layer with a dual-branch structure;
[0029] The spectrum-enhanced multi-scale TCN feature extraction layer consists of M TCN It consists of a temporal convolutional network and a spectral enhancement layer;
[0030] The Fourier coding layer includes a fast Fourier transform layer, layer normalization, residual connection layer, and feedforward neural network;
[0031] The feature decoding layer of the dual-branch structure includes several fully connected layers and Dropout layers, and is configured with the SiLU activation function;
[0032] Where, N FFT To control the hyperparameters of the number of layers in a Fourier encoder, M TCN To control the number of temporal convolutional networks with different kernel sizes, each temporal convolutional network includes a causal convolutional layer and a dilated causal convolutional layer, and is equipped with a batch normalization layer and a ReLU activation function. Furthermore, each temporal convolutional network is interpolated with several spectral enhancement layers.
[0033] Optionally, constructing the spectrum enhancement layer includes:
[0034] An adaptive average pooling operation is performed using the one-dimensional feature sequence of the gas sensor array to obtain a feature sequence of uniform length.
[0035] Obtain the frequency index set based on the frequency index set corresponding to the uniform sequence length;
[0036] A one-dimensional discrete cosine transform is performed on the feature sequence of the unified sequence length to obtain frequency domain feature values.
[0037] By using learnable weight parameters in the spectral domain to adaptively weight the frequency domain feature values based on the frequency index set, adaptive weighted fused spectral features are obtained.
[0038] Based on the feature sequence of the unified sequence length and the spectral features of the adaptive weighted fusion, feature enhancement is performed using a fully connected layer and activation function to obtain a spectral enhancement feature representation, and then a spectral enhancement layer is constructed.
[0039] Among them, the one-dimensional feature sequence of the gas sensor array is the one-dimensional feature sequence of the gas sensor array extracted by the causal convolutional layer or dilated causal convolutional layer of the temporal convolutional network.
[0040] Optionally, the gas sensor array data selected based on the variable density sparse features and the target label are used to obtain gas identification results using the spectral enhancement network model, including:
[0041] S4-1. The spectrum enhancement network model is trained using the gas sensor array data selected by the variable density sparse feature and the target label to obtain the trained spectrum enhancement network model.
[0042] S4-2. Input the gas sensor array data selected by the variable density sparse feature into the trained spectrum enhancement network model to obtain the predicted features used to characterize the gas type and concentration as the gas identification result.
[0043] Compared with the closest existing technology, the present invention has the following advantages:
[0044] This invention first guides variable-density sparse measurements based on the instantaneous energy distribution characteristics of a gas sensor array to effectively extract and enhance the core information of the data. Then, the extracted core features are input into a constructed spectral-enhanced multi-scale Fourier network for gas species identification and concentration prediction. Compared with traditional methods, this invention demonstrates the following significant advantages in data processing, feature extraction, and network model design:
[0045] (1) The feature engineering method employed in this invention can effectively screen and extract the most recognizable core features from gas sensor array data, greatly reducing data redundancy. Specifically, through a feature energy-guided variable density sparse feature selection mechanism, using only about one percent (1 / 100) of the original data sampling points, the recognition and prediction performance surpasses that of end-to-end methods that directly input the original data. This strategy not only effectively removes irrelevant features and improves pattern recognition performance, but also reduces the consumption of computing resources, significantly improving the system's response speed and processing efficiency in practical application scenarios.
[0046] (2) The spectrum enhancement network proposed in this invention can effectively mine and dynamically enhance the spectral domain feature information of gas sensor array data. Specifically, firstly, a spectrum enhancement multi-scale temporal convolutional network (TCN) is constructed to capture the features of gas data at multiple time scales; then, a dynamic spectrum enhancement mechanism based on instantaneous energy distribution is introduced on the feature sequences at each scale, that is, using discrete cosine transform (DCT) and dynamic frequency component selection method, key frequency components are adaptively selected in the frequency domain and learned frequency weights are applied to them to highlight the core spectral features in the data; further, the spectral domain deep encoding and fusion of features are realized through Fourier encoder to enhance the network's ability to represent feature information; finally, the high-dimensional features after spectrum enhancement are accurately mapped to the output space of the gas type classification task and the gas concentration regression task through the decoding module, thereby significantly improving the network's recognition performance and concentration prediction accuracy for complex mixed gases. Compared with traditional single-scale or shallow feature extraction methods, the spectrum enhancement network proposed in this invention not only has a stronger multi-scale feature expression capability, but also can dynamically and data-drivenly enhance key features in the spectrum domain, making it more adaptable to the high dynamics and cross-sensitivity problems in complex mixed gas environments, and improving the overall recognition accuracy and prediction robustness of the system.
[0047] (3) This invention deeply integrates feature engineering and network model design for collaborative optimization, effectively combining core feature extraction with model training. The powerful core feature extraction capability of the feature engineering stage ensures that the most representative and identifiable core information in the data is effectively preserved; while the spectrum enhancement network model, through dynamic frequency component selection mechanism and Fourier coding mechanism, further effectively solves the feature redundancy and interference problems caused by the cross-sensitivity of gas sensors. This collaborative optimization strategy significantly improves the adaptability, stability and robustness of the system in complex gas environments, exhibiting characteristics that are significantly superior to traditional methods, especially in application environments with complex and frequently changing gas compositions, demonstrating higher generalization ability and prediction accuracy. Attached Figure Description
[0048] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0049] Figure 1 This is a flowchart of a gas identification method based on sparse feature selection and spectrum enhancement network according to an embodiment of the present invention;
[0050] Figure 2 This is a schematic diagram of the method for extracting the instantaneous energy distribution characteristics of gas according to an embodiment of the present invention;
[0051] Figure 3 This is a schematic diagram of sparse feature selection based on gas feature energy guided by an embodiment of the present invention;
[0052] Figure 4 This is a structural diagram of the spectrum enhancement network model proposed in an embodiment of the present invention;
[0053] Figure 5 This is a diagram of the spectral enhancement multi-scale TCN feature extraction layer structure proposed in an embodiment of the present invention;
[0054] Figure 6 This is a diagram of the spectrum enhancement layer structure proposed in an embodiment of the present invention. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0056] The terminology used in the embodiments section of this invention is for the purpose of explaining specific embodiments of the invention only, and is not intended to limit the invention.
[0057] Artificial olfactory systems have wide-ranging applications and significant social importance in modern society, covering areas such as environmental monitoring, industrial safety, food quality control, and medical diagnosis. For example, in environmental monitoring, artificial olfactory systems can detect the concentration of harmful gases in the air in real time, providing early warning information; in industrial production, the system can be used to detect gas leaks, ensuring production safety; in the food industry, the system can be used to detect the freshness and preservation effectiveness of food; and in the medical field, by analyzing volatile organic compounds (VOCs) in patients' breath, artificial olfactory systems can assist in the early diagnosis of diseases. These applications not only improve the efficiency and safety of various industries but also play a vital role in public health and environmental protection.
[0058] Artificial olfaction systems typically consist of two main parts: a gas sensor array and a pattern recognition algorithm—a data acquisition system and a decision-making system. The gas sensor array comprises multiple sensors, each capable of responding to different types of gases. The pattern recognition algorithm processes and analyzes the data collected by the sensor array to accurately identify the gas type and concentration. Currently, common gas sensors include metal-oxide-semiconductor (MOS), electrochemical sensors, and optical sensors, each with different characteristics and applications. Pattern recognition algorithms include traditional machine learning algorithms (such as support vector machines and decision trees) and modern deep learning algorithms (such as convolutional neural networks and recurrent neural networks).
[0059] In gas sensor arrays, individual sensors may exhibit cross-responses to multiple gases. This cross-response phenomenon significantly reduces the selectivity and accuracy of traditional gas sensors in detecting complex gas mixtures, severely limiting the application of artificial olfaction systems in multi-gas environments. To overcome the cross-sensitivity of gas sensors and improve the performance of artificial olfaction systems, many studies have begun to explore how to utilize machine learning and deep learning methods to improve gas detection. However, while these methods have achieved some progress in certain applications, they still face challenges, especially in the detection of complex gas mixtures. Effectively handling the sensor cross-response problem remains a crucial issue that urgently needs to be addressed.
[0060] Traditional machine learning pattern recognition algorithms, while performing well in single-gas identification tasks, often fail to fully leverage their advantages in detecting complex gas mixtures. Because these algorithms typically rely on extensive prior knowledge and manually designed feature engineering, they lack effective feature extraction and fusion capabilities when dealing with the cross-sensitivities of gas sensors, limiting their selectivity and accuracy in complex gas environments. Deep learning algorithms, especially convolutional neural networks (CNNs) and recurrent neural networks (RNNs), have achieved significant results in gas detection due to their automatic feature extraction and powerful pattern recognition capabilities. However, these deep learning models mostly rely on single-modal data features and lack effective feature engineering methods to handle the cross-responses between sensors. Therefore, when dealing with complex gas mixtures, they are susceptible to interference from redundant features, making it difficult to effectively extract key features and thus affecting the system's detection performance.
[0061] Therefore, the key to improving the performance of artificial olfaction systems lies in the collaborative innovation of feature engineering and network models. This involves designing effective feature engineering methods to extract the most critical features from gas sensor array data, reducing data redundancy, removing features irrelevant to gas identification, and extracting highly recognizable core features. Then, combining this with advanced deep learning models further mines and learns complex patterns and potential relationships within these core features, collaboratively optimizing pattern recognition algorithms to address the challenges posed by cross-sensitivity of gas sensors and achieve high accuracy and robustness in gas type and concentration detection. This invention addresses these issues by proposing a gas identification method based on sparse feature selection and spectral enhancement networks. It extracts core features from gas sensors based on sparse feature selection and utilizes a high-performance deep learning model to overcome the cross-sensitivity of gas sensors during mixed gas detection, thereby improving the performance of artificial olfaction systems.
[0062] like Figure 1 As shown, this embodiment of the invention provides a gas identification method based on sparse feature selection and spectrum enhancement networks, including the following steps:
[0063] S1. Preprocess the gas sensor array dataset to obtain the preprocessed gas sensor array data.
[0064] S2. Perform sparse feature selection on the preprocessed gas sensor array data to obtain gas sensor array data with variable density sparse feature selection and target labels.
[0065] S3. Construct a spectrum enhancement network model;
[0066] S4. Based on the gas sensor array data selected according to the variable density sparse features and the target label, the gas identification result is obtained using the spectrum enhancement network model.
[0067] S1 specifically includes:
[0068] S1-1. Obtain the sensor array data of the mixed gas and the corresponding gas concentration and type labels as the gas sensor array dataset;
[0069] S1-2. Normalization and linear interpolation are performed sequentially on the gas sensor array dataset to obtain the preprocessed gas sensor array data.
[0070] This embodiment acquires sensor array data of mixed gases, along with corresponding gas concentration and type labels, as a gas sensor array dataset. The gas sensor array dataset is then preprocessed, specifically:
[0071] The dataset used in this embodiment is the Gas Sensor Array Underdynamic Gas Mixtures (Dataset 2). The sensor array in this dataset contains 16 chemical sensors of 4 types, with each type including 4 sensors: TGS-2600, TGS-2602, TGS-2610, and TGS-2620.
[0072] The data acquisition process is as follows: the sensor array is placed in a gas measurement chamber with a volume of 60 ml, the gas mixture to be tested is injected at a constant flow rate of 300 ml / min, and the electrical signal response data of the sensor array is continuously recorded at a sampling frequency of 100 Hz.
[0073] The dataset includes ethylene and carbon monoxide, both of which exhibited random concentration variations during the measurements. Ethylene concentrations ranged from 0 to 20 ppm, and carbon monoxide concentrations ranged from 0 to 600 ppm. Each measurement was performed by continuously recording data sequences from 16 sensor arrays, with each sequence recording for 12 hours. The gas was injected at a constant flow rate of 300 mL / min throughout the data sampling process. The sensor arrays acquired gas response signals in real-time at a sampling frequency of 100 Hz. During the experiment, all possible concentration variation patterns (including increases, decreases, and zero concentrations of a single gas, as well as constant and varying concentrations in mixed gas conditions) were comprehensively covered, resulting in diverse and complex multivariate sensor response data.
[0074] Because the sensor array used is highly sensitive to ethylene and carbon monoxide gases at low concentrations, and the response amplitudes of the sensors to different gases vary little, the task of identifying and predicting the concentration of mixed gases from gas sensor datasets presents a significant challenge. This embodiment, based on the gas sensor dataset, removes obviously faulty or severely drifting data segments, retaining only the desorption signals from the sensor array data for subsequent training and evaluation of the network model.
[0075] After the data preparation is complete, each data point is preprocessed, namely, normalization and linear interpolation. The calculation formulas for normalization and linear interpolation are as follows:
[0076]
[0077] Among them, D interp (p,q) represents the preprocessed gas sensor array data of the q-th gas sensor at time index p, D(p,q) represents the raw response value of the q-th gas sensor at time index p, D(u,q) represents the raw response value of the q-th gas sensor at time index u, L is the original sequence length of the single gas sensor array response data after unfolding along the time index dimension before normalization and interpolation, S is the total number of gas sensors, and Interp(.) represents the interpolation operation, specifically cubic spline interpolation, to improve the temporal resolution of the gas sensor array data and increase the speed of subsequent operations.
[0078] In this embodiment, each data set contains readings from 16 gas sensors with varying numbers of sampling points. After preprocessing, the number of sampling points for all data sets is interpolated to 20,000.
[0079] S2 specifically includes:
[0080] S2-1. Based on the preprocessed gas sensor array data, perform partitioning processing using the Monte Carlo cross-validation method to obtain partitioning data of the preprocessed gas sensor array data.
[0081] S2-2. Using the partitioned data of the preprocessed gas sensor array data, obtain the instantaneous energy distribution characteristics of the gas in the gas sensor array data;
[0082] S2-3. Perform sparse feature selection on the instantaneous energy distribution characteristics of the gas in the gas sensor array data to obtain gas sensor array data with variable density sparse feature selection and target label.
[0083] S2-2 specifically includes:
[0084] S2-2-1. Perform complete set empirical mode decomposition on the preprocessed gas sensor array data to obtain the set of gas intrinsic mode functions.
[0085] S2-2-2. Perform Hilbert transform based on the set of gas intrinsic mode functions to obtain the instantaneous energy distribution characteristics of the gas sensor array data.
[0086] S2-3 specifically includes:
[0087] S2-3-1. Utilize the instantaneous energy distribution characteristics of the gas in the gas sensor array data to obtain the sparse selection probability distribution guided by the characteristic energy.
[0088] S2-3-2. Construct a variable-density sparse feature selection matrix based on the sparse selection probability distribution guided by the feature energy.
[0089] S2-3-3. The variable density sparse feature selection matrix is used to perform variable density sparse feature selection and enhancement on the preprocessed gas sensor array data to obtain gas sensor array data with variable density sparse feature selection.
[0090] S2-3-4. Based on the gas sensor array data selected according to the variable density sparse characteristics, obtain the corresponding label as the target label.
[0091] This embodiment extracts the instantaneous energy distribution features of the gas from the preprocessed gas sensor array data, constructs a variable density sparse feature selection matrix, and performs sparse feature selection and enhancement on the preprocessed gas sensor array data to obtain variable density sparse feature selected gas sensor array data and corresponding labels. Specifically, the variable density sparse feature selected gas sensor array data is obtained by selecting features from the preprocessed data based on the sparse feature selection matrix to extract features from data points with different density distributions.
[0092] Monte Carlo cross-validation is used to partition the preprocessed gas sensor array data. For each channel of the partitioned data, adaptive noise-based complete ensemble empirical mode decomposition (CEEMDAN) and Hilbert transform are performed to extract the instantaneous gas energy distribution features. Based on these instantaneous gas energy distribution features, a feature energy-guided sparse selection probability distribution is constructed. A variable-density sparse feature selection matrix is then constructed based on this probability distribution. Finally, the variable-density sparse feature selection matrix is used to perform sparse feature selection and enhancement on the preprocessed gas sensor array partitioned data.
[0093] To ensure the comprehensiveness and generalization ability of the model performance evaluation, this embodiment uses the Monte Carlo cross-validation method to partition the preprocessed gas sensor array data, obtaining the partitioned data D of the preprocessed gas sensor array data. divide The mathematical expression for the data generation process is as follows:
[0094]
[0095] MonteCarloSplit(.) represents the operation of randomly partitioning the data based on the Monte Carlo cross-validation method. D represents the preprocessed subset of gas sensor array data generated by the i-th Monte Carlo cross-validation partition. intrep This represents the preprocessed data from the gas sensor array;
[0096] The specific process of the Monte Carlo cross-validation method is as follows:
[0097] A1. The preprocessed gas sensor array data is randomly divided into 10 non-overlapping subsets;
[0098] A2. For each iteration, randomly select 6 subsets as the training set and the remaining 4 subsets as the validation set;
[0099] A3. Save the training set generated after each partition. and verification set As the data for the i-th group;
[0100] A4. Repeat the above random partitioning and saving process 10 times to finally obtain 10 sets of training and validation data partitions, which will be used for subsequent sparse feature selection and model training.
[0101] like Figure 2 As shown, in this embodiment, the preprocessed gas sensor array data is divided into data D. divide Performing complete ensemble empirical mode decomposition with adaptive noise (CEEMDAN) and Hilbert transform to extract the instantaneous gas energy distribution characteristics E from the gas sensor array data. norm (k), the specific steps are as follows:
[0102] B1. Division of preprocessed gas sensor array data D divide The CEEMDAN decomposition is performed using the following formula:
[0103]
[0104] Among them, D ceemdan (k) represents the set of gas intrinsic mode functions (IMFs) obtained by full set empirical mode decomposition of the preprocessed gas sensor array data, CEEMDAN(.) represents the full set empirical mode decomposition, and A represents the total number of IMFs obtained by CEEMDAN decomposition. a (k) represents the specific value of the a-th IMF at time index k.
[0105] In this embodiment, the specific value of A is 10.
[0106] B2. Obtaining the instantaneous energy distribution characteristics of gas from gas sensor array data based on the Hilbert transform using the set of gas intrinsic mode functions. norm (k), the calculation formula is as follows:
[0107]
[0108] Where S represents the total number of gas sensors, B r H(.) represents the total number of IMFs obtained after the r-th gas sensor is decomposed by CEEMDAN, and H(.) represents the Hilbert transform. b,r (k) represents the value of the b-th IMF corresponding to the r-th gas sensor at time index k, where IMF b,r(z) represents the value of the intrinsic mode function of the b-th gas corresponding to the r-th gas sensor at the auxiliary time index z, where z is the auxiliary time index used to find the global maximum value of the instantaneous energy of the gas, and ε is a small constant to prevent the denominator from being zero.
[0109] In this embodiment, a feature energy-guided sparse selection probability distribution is constructed based on the instantaneous energy distribution characteristics of the gas sensor array data. Variable density sparse feature selection and enhancement are then applied to the preprocessed gas sensor array data. Figure 3 As shown, the specific steps are as follows:
[0110] C1. Instantaneous energy distribution characteristics of gas based on gas sensor array data E norm (k), construct the sparse selection probability distribution P(k) guided by feature energy, and calculate it as follows:
[0111]
[0112] Where α is the nonlinear amplification hyperparameter used to enhance the selection probability of high-energy regions, x represents the auxiliary variable in the normalized denominator used to traverse the entire time series index, and E norm (x) represents the instantaneous energy distribution characteristic value of the gas at point x, obtained by normalization after the gas sensor array data is processed by CEEMDAN decomposition and Hilbert transform. It is used to reflect the local energy intensity of the gas response data at that time point.
[0113] In this implementation, α is set to 2.
[0114] C2. Based on the sparse selection probability distribution P(k) guided by feature energy, from the time index set {1,2,…,L} of the data sequence... s Sampling N in} s Using 1 independent index point, construct a variable-density sparse feature selection matrix M. u The calculation formula is as follows:
[0115] M u ={k1,k2,…,k N}k i ~P(k)i=1,2,…,N s
[0116] Where, k i M represents the i-th time index point randomly selected based on the sparse selection probability distribution P(k) guided by feature energy. u Contains N s A separate time index.
[0117] To minimize data redundancy and facilitate feature extraction in subsequent network models, this embodiment expects N sparse feature selection points.s Set to 16, the same as the number of sensors.
[0118] In this embodiment, for training data, a large batch of variable-density sparse feature selection matrices are generated based on the feature energy-guided sparse selection probability distribution for sparse feature selection and enhancement of the training data; for validation data, a single variable-density sparse feature selection matrix is generated based on the feature energy-guided sparse selection probability distribution for feature selection.
[0119] For the training data, the process of constructing the variable density sparse feature selection matrix described in step C2 is repeated multiple times based on the feature energy-guided sparse selection probability distribution P(k), each time constructing an independent variable density sparse feature selection matrix M. u This approach generates a large number of different variable-density sparse feature selection matrices for the same original data. The selected feature index position is dynamically determined based on the distribution of data feature energy each time, ensuring that the enhanced data fully represents the core features of the original data. Randomness is also introduced to improve data diversity and generalization performance during model training. In this embodiment, step C216384 is repeated for the training data, generating 16384 variable-density sparse feature selection matrices.
[0120] C3. Using a variable density sparse feature selection matrix, perform sparse feature selection and enhancement on the preprocessed gas sensor array data to obtain gas sensor array data with variable density sparse feature selection. Feauture (f,g), the calculation formula is as follows:
[0121] D Feauture (f,g)=D divide (k f ,g)k f ∈M u f = 1, 2, ..., N s g = 1, 2, ..., S
[0122] Where f represents the new data time index after sparse selection, g represents the channel index of the gas sensor, and k f Choose matrix M for variable density sparse features u The f-th time index point in the sequence corresponds to the position D in the original data sequence. divide (k f (g) indicates that in the original partitioned data D divide In the middle, located at time index k f And the original preprocessed feature value at channel index g.
[0123] C4. Label the gas sensor array data with variable density sparse features. The label formats used in this embodiment for classification and regression tasks are shown in Table 1.
[0124] Table 1
[0125]
[0126] This embodiment employs an extremely unbalanced training and validation set ratio, using only 40% of the data as the training set. It verifies the ability of feature energy-guided variable density sparse feature selection to extract and enhance the core features of gas sensor array data, as well as the feature extraction and fusion capabilities of the spectrum enhancement network, in the case of feature loss.
[0127] Furthermore, the spectrum enhancement network model consists of a spectrum enhancement multi-scale TCN feature extraction layer, a linear projection layer, and N... FFT It consists of a stack of Fourier coding layers and a feature decoding layer with a dual-branch structure;
[0128] The spectrum-enhanced multi-scale TCN feature extraction layer consists of M TCN It consists of a temporal convolutional network and a spectral enhancement layer;
[0129] The Fourier coding layer includes a fast Fourier transform layer, layer normalization, residual connection layer, and feedforward neural network;
[0130] The feature decoding layer of the dual-branch structure includes several fully connected layers and Dropout layers, and is configured with the SiLU activation function;
[0131] Where, N FFT To control the hyperparameters of the number of layers in a Fourier encoder, M TCN To control the number of temporal convolutional networks with different kernel sizes, each temporal convolutional network includes a causal convolutional layer and a dilated causal convolutional layer, and is equipped with a batch normalization layer and a ReLU activation function. Furthermore, each temporal convolutional network is interpolated with several spectral enhancement layers.
[0132] Furthermore, constructing the spectrum enhancement layer includes:
[0133] An adaptive average pooling operation is performed using the one-dimensional feature sequence of the gas sensor array to obtain a feature sequence of uniform length.
[0134] Obtain the frequency index set based on the frequency index set corresponding to the uniform sequence length;
[0135] A one-dimensional discrete cosine transform is performed on the feature sequence of the unified sequence length to obtain frequency domain feature values.
[0136] By using learnable weight parameters in the spectral domain to adaptively weight the frequency domain feature values based on the frequency index set, adaptive weighted fused spectral features are obtained.
[0137] Based on the feature sequence of the unified sequence length and the spectral features of the adaptive weighted fusion, feature enhancement is performed using a fully connected layer and activation function to obtain a spectral enhancement feature representation, and then a spectral enhancement layer is constructed.
[0138] Among them, the one-dimensional feature sequence of the gas sensor array is the one-dimensional feature sequence of the gas sensor array extracted by the causal convolutional layer or dilated causal convolutional layer of the temporal convolutional network.
[0139] This embodiment constructs a spectrum enhancement network model, specifically:
[0140] First, a spectrally enhanced multi-scale TCN feature extraction layer is constructed based on temporal convolutional networks (TCNs) with different kernel sizes and a spectral enhancement layer to extract feature information from gas sensor array data at different scales, and then multi-scale fusion is performed. Second, feature encoding and reconstruction are performed through a Fourier encoder. Finally, the feature information is mapped to the output space of the gas type classification task and the gas concentration regression task respectively for feature decoding.
[0141] like Figure 4 As shown, the spectrum enhancement network model used in this embodiment is used to enhance and encode / decode the input features in the spectrum domain. From top to bottom, it consists of a spectrum enhancement multi-scale TCN feature extraction layer, a linear projection layer, and an N... FFT The system consists of stacked Fourier coding layers and dual-branch feature decoding layers. The dual-branch feature decoding layer includes a classification branch and a regression branch. FFT To control the hyperparameter of the number of Fourier encoder layers, in this embodiment, N FFT Set to 4. The spectrum enhancement network model specifically includes the following:
[0142] D1, Spectrum Enhancement Multi-Scale TCN Feature Extraction Layer: (e.g.) Figure 5 As shown, M is constructed based on different convolution kernel sizes. TCN A parallel temporal convolutional network (TCN), where M TCN To control the number of TCNs with different kernel sizes, a hyperparameter is used. Each TCN contains two causal convolutional layers, two dilated causal convolutional layers, and is equipped with a batch normalization (BN) layer and a ReLU activation function for feature extraction. Each TCN is interpolated with several spectral enhancement layers to effectively utilize the spectral features of the data to enhance the information. Finally, the output features of TCNs with different kernel sizes are fused at multiple scales along the channel dimension to achieve time-frequency feature fusion at different scales.
[0143] D2, Linear Projection Layer: The fused features output from the spectral enhancement multi-scale TCN feature extraction layer are input into the linear projection layer. Based on the fully connected layer, the feature dimension is unified to meet the feature input requirements of the subsequent Fourier coding layer, thereby improving the network's expressive power and feature stability.
[0144] D3. Fourier Coding Layer: In each Fourier coding layer, the Fast Fourier Transform (FFT) is used to replace the multi-head attention mechanism in the traditional Transformer, realizing the conversion of gas data from the time domain to the frequency domain. Specifically, this includes:
[0145] First, the sequence data input to the FFT layer is subjected to FFT transformation to complete the frequency connection of gas features, thereby capturing the global correlation information of gas features in the frequency domain.
[0146] Secondly, by using layer normalization (abbreviated as Normalize in the figure) and introducing residual connection layers (abbreviated as add in the figure), the stability of the training process is ensured. Then, a feedforward neural network is used to further extract relevant features of the gas sensor data, thereby capturing the dynamic pattern of gas data changing over time.
[0147] Finally, layer normalization and residual connections are performed again to enhance the expressive power of features, achieve efficient fusion of gas dynamic temporal features and frequency domain features, improve the model's ability to identify gas types and concentrations, and enhance the accuracy of the network in gas type identification and concentration prediction.
[0148] D4. Feature Decoding Layer with Dual Branch Structure: A feature decoding structure is constructed using K fully connected layers (abbreviated as Full-connect in the diagram), a Dropout layer, and a SiLU activation function. This structure maps the high-dimensional features after Fourier encoding to the output spaces of the gas type classification task and the gas concentration regression task, respectively, achieving effective decoding and accurate prediction of the input data. Here, K is a hyperparameter controlling the number of fully connected layers; in this embodiment, K is set to 2.
[0149] like Figure 6 As shown, the construction of the spectrum enhancement layer specifically includes the following steps:
[0150] E1, the one-dimensional feature sequence X of the gas sensor array extracted through the TCN intermediate layer. tcn Adaptive average pooling is performed to unify the sequence length, ensuring consistency in the network input dimension, and thus obtaining a feature sequence X of uniform length. pool (c,t):
[0151] X pool(c,t)=AdaptivePool(X tcn (c,d)),t=1,2,…,T
[0152] Among them, X tcn (c,d) represents the one-dimensional feature sequence of the gas sensor array at the original time index d for the c-th sensor channel output by the TCN intermediate layer. AdaptivePool(.) represents the adaptive average pooling operation, where c is the channel index of the gas sensor array and t is the unified time index after adaptive average pooling.
[0153] E2. In this embodiment, considering that the TCN network structure has a strong response to high-frequency components during feature modeling, but is somewhat lacking in capturing low-frequency slow-changing trends, in order to improve the model's ability to perceive slowly changing gas signals, the preset frequency selection strategy is set to prioritize the selection of low-frequency components.
[0154] Specifically, based on the frequency index set {1,2,…,T} corresponding to the unified sequence length T, the first K frequency indices are selected sequentially in ascending order of frequency to form the frequency index set F. sel The calculation formula is as follows:
[0155] F sel ={f1,f2,…,f K},f i ∈{1,2,…,T},i=1,2,…,K
[0156] Among them, f i This indicates the i-th frequency index selected, and K represents the total number of frequency components ultimately selected.
[0157] E3, for characteristic sequences X of uniform sequence length pool (c,t) is subjected to a one-dimensional discrete cosine transform (DCT) to obtain the frequency domain eigenvalues X. dct The calculation formula is as follows:
[0158] X dct (c,f)=DCT(X pool (c,t)),f=1,2,…,T
[0159] Among them, X dct (c,f) represents the frequency domain feature value of the c-th channel at the frequency index f after DCT transformation. DCT(.) represents one-dimensional discrete cosine transform.
[0160] E4. Utilizing learnable weight parameters w in the frequency domain f The selected frequency components are adaptively weighted to obtain the adaptively weighted fused spectral features X.freq The calculation formula is as follows:
[0161]
[0162] Among them, X freq (c) represents the spectral characteristics of the adaptive weighted fusion of the c-th channel. In this embodiment, the first four low-frequency components are selected for adaptive weighting.
[0163] E5, Spectral Features X Based on Adaptive Weighted Fusion freq Dynamic weights along the channel dimension are generated through a fully connected layer (FC) and a sigmoid activation function to dynamically enhance feature information. The generated dynamic weights are then multiplied element-wise with the original input feature sequence to obtain the feature representation after dynamic frequency component selection and adaptive enhancement, i.e., the feature-enhanced feature representation. The calculation formula is as follows:
[0164] X enhanced (c,t)=X pool (c,t)·Sigmoid(FC(X freq (c)))
[0165] Among them, X enhanced (c,t) represents the spectral enhancement feature, and Sigmoid(.) represents the activation function.
[0166] S4 specifically includes:
[0167] S4-1. The spectrum enhancement network model is trained using the gas sensor array data selected by the variable density sparse feature and the target label to obtain the trained spectrum enhancement network model.
[0168] S4-2. Input the gas sensor array data selected by the variable density sparse feature into the trained spectrum enhancement network model to obtain the predicted features used to characterize the gas type and concentration as the gas identification result.
[0169] In this embodiment, the data of the gas sensor array with variable density sparse feature selection and the corresponding labels are input into the constructed spectrum enhancement network model. The model is optimized by adjusting relevant parameters and the network model is fully converged through training iterations. Finally, the validation data of the single sparse feature selection completed in the S2 stage is input into the trained network model to predict the gas type and concentration. The prediction effect of the model is evaluated by relevant quantitative evaluation indicators.
[0170] The relevant quantitative evaluation indicators used in this embodiment specifically include the following:
[0171] Define success rate, precision, recall, Kappa coefficient, mean absolute error (MAE), and coefficient of determination (R²). 2 As performance evaluation metrics for classification and regression tasks, the number of parameters (params) and floating-point operations per second (FLOPS) are used as evaluation metrics for model size and computational requirements. The formulas for these evaluation metrics are as follows:
[0172]
[0173]
[0174] Where n represents the total number of samples involved in the calculation, i represents the index number of the current sample, and y true It is the true value, y pred P is the predicted value, P0 is the observed consistency, and P... e It is based on the expected consistency under random prediction, and y'true is the average of the true values.
[0175] Based on the above, the specific steps for evaluating the model in this embodiment are as follows:
[0176] F1: Adjust relevant parameters and use training optimization and gradient descent algorithms to reduce the network model loss and increase relevant indicators until the network fully converges.
[0177] F2. The validation set data is preprocessed and variable density sparse feature selection is performed. The data is then input into the trained network model and the gas type and concentration are predicted through forward computation. The output is two tensors representing the predicted features of the gas type and concentration as the gas identification result.
[0178] F3. Calculate Accuracy, Precision, Recall, Kappa, MAE, and R. 2 Evaluation metrics such as Params and FLOPS.
[0179] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0180] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0181] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0182] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A gas identification method based on sparse feature selection and spectral enhancement networks, characterized in that, Specifically, the following steps are included: S1. Preprocess the gas sensor array dataset to obtain the preprocessed gas sensor array data. S2. Perform sparse feature selection on the preprocessed gas sensor array data to obtain variable density sparse feature selected gas sensor array data and target labels, including: S2-1. Based on the preprocessed gas sensor array data, perform partitioning processing using the Monte Carlo cross-validation method to obtain partitioning data of the preprocessed gas sensor array data. S2-2. Using the partitioned data of the preprocessed gas sensor array data, obtain the instantaneous energy distribution characteristics of the gas in the gas sensor array data; S2-3. Perform sparse feature selection on the instantaneous energy distribution characteristics of the gas in the gas sensor array data to obtain gas sensor array data with variable density sparse feature selection and target label; S3. Construct a spectrum enhancement network model; The spectrum enhancement network model consists of a spectrum enhancement multi-scale TCN feature extraction layer, a linear projection layer, and N... FFT It consists of a stack of Fourier coding layers and a feature decoding layer with a dual-branch structure; The spectrum-enhanced multi-scale TCN feature extraction layer consists of M TCN It consists of a temporal convolutional network and a spectral enhancement layer; The Fourier coding layer includes a fast Fourier transform layer, layer normalization, residual connection layer, and feedforward neural network; The feature decoding layer of the dual-branch structure includes several fully connected layers and Dropout layers, and is configured with the SiLU activation function; Where, N FFT To control the hyperparameters of the number of layers in a Fourier encoder, M TCN To control the number of temporal convolutional networks with different kernel sizes, each temporal convolutional network includes a causal convolutional layer and a dilated causal convolutional layer, and is equipped with a batch normalization layer and a ReLU activation function. Furthermore, each temporal convolutional network is interpolated with several spectral enhancement layers. S4. Based on the gas sensor array data selected according to the variable density sparse features and the target label, the gas identification result is obtained using the spectrum enhancement network model.
2. The gas recognition method based on sparse feature selection and spectral enhancement network according to claim 1, characterized in that, Data preprocessing was performed using the gas sensor array dataset to obtain the preprocessed gas sensor array data, including: S1-1. Obtain the sensor array data of the mixed gas and the corresponding gas concentration and type labels as the gas sensor array dataset; S1-2. Normalization and linear interpolation are performed sequentially on the gas sensor array dataset to obtain the preprocessed gas sensor array data.
3. The gas recognition method based on sparse feature selection and spectral enhancement network according to claim 1, characterized in that, Using the preprocessed gas sensor array data, the instantaneous energy distribution characteristics of the gas in the gas sensor array data are obtained, including: S2-2-1. Perform complete set empirical mode decomposition on the preprocessed gas sensor array data to obtain the set of gas intrinsic mode functions. S2-2-2. Perform Hilbert transform based on the set of gas intrinsic mode functions to obtain the instantaneous energy distribution characteristics of the gas sensor array data.
4. The gas recognition method based on sparse feature selection and spectral enhancement network according to claim 2, characterized in that, Sparse feature selection is performed on the instantaneous energy distribution characteristics of the gas in the gas sensor array data to obtain variable density sparse feature selected gas sensor array data and target labels, including: S2-3-1. Utilize the instantaneous energy distribution characteristics of the gas in the gas sensor array data to obtain the sparse selection probability distribution guided by the characteristic energy. S2-3-2. Construct a variable-density sparse feature selection matrix based on the sparse selection probability distribution guided by the feature energy. S2-3-3. The variable density sparse feature selection matrix is used to perform variable density sparse feature selection and enhancement on the preprocessed gas sensor array data to obtain gas sensor array data with variable density sparse feature selection. S2-3-4. Based on the gas sensor array data selected according to the variable density sparse characteristics, obtain the corresponding label as the target label.
5. The gas recognition method based on sparse feature selection and spectral enhancement network according to claim 1, characterized in that, Constructing the spectrum enhancement layer includes: An adaptive average pooling operation is performed using the one-dimensional feature sequence of the gas sensor array to obtain a feature sequence of uniform length. Obtain the frequency index set based on the frequency index set corresponding to the uniform sequence length; A one-dimensional discrete cosine transform is performed on the feature sequence of the unified sequence length to obtain frequency domain feature values. By using learnable weight parameters in the spectral domain to adaptively weight the frequency domain feature values based on the frequency index set, adaptive weighted fused spectral features are obtained. Based on the feature sequence of the unified sequence length and the spectral features of the adaptive weighted fusion, feature enhancement is performed using a fully connected layer and activation function to obtain a spectral enhancement feature representation, and then a spectral enhancement layer is constructed. Among them, the one-dimensional feature sequence of the gas sensor array is the one-dimensional feature sequence of the gas sensor array extracted by the causal convolutional layer or dilated causal convolutional layer of the temporal convolutional network.
6. The gas recognition method based on sparse feature selection and spectral enhancement network according to claim 1, characterized in that, Based on the gas sensor array data selected according to the variable density sparse features and the target label, the gas identification results are obtained using the spectrum enhancement network model, including: S4-1. The spectrum enhancement network model is trained using the gas sensor array data selected by the variable density sparse feature and the target label to obtain the trained spectrum enhancement network model. S4-2. Input the gas sensor array data selected by the variable density sparse feature into the trained spectrum enhancement network model to obtain the predicted features used to characterize the gas type and concentration as the gas identification result.