A gas sensor drift compensation method

The DAAN network model is used to fuse the local features and temporal features of gas sensor signals and perform distribution alignment at the class level, which solves the problem of degraded classification performance of traditional gas classification models in drift scenarios and improves the accuracy of gas classification.

CN116559359BActive Publication Date: 2025-10-03HARBIN INST OF TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310312626.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-28
Publication Date
2025-10-03
Estimated Expiration
2043-03-28

AI Technical Summary

Technical Problem

Traditional gas classification models cannot accurately handle the abnormal responses of gas sensors in drift scenarios, resulting in a decrease in classification performance. Existing drift compensation methods cannot effectively reduce the impact of feature distribution overlap between different classes.

Method used

The DAAN network model is adopted to realize the fusion of local features and temporal features of gas sensor signals through data input network, deep feature extraction network, gas classification network and domain discrimination network. The maximum mean difference and domain adversarial thinking at the class level are used to perform feature alignment and domain-invariant feature learning, thereby narrowing the intra-class distance and improving the gas classification accuracy.

Benefits of technology

Without any preprocessing, the classification accuracy of the gas sensor in drift scenarios is improved, the interference caused by distribution differences is reduced, and the technical effect of the gas sensor signal is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116559359B_ABST
    Figure CN116559359B_ABST
Patent Text Reader

Abstract

This invention provides a gas sensor drift compensation method that determines target domain data and source domain data; establishes and trains a DAAN network model; inputs labeled source domain data and unchanged target domain data into the established DAAN network and trains it; establishes a gas classification model with drift compensation; and uses the trained gas classification model to detect the target domain data and achieve gas classification. This invention improves gas classification accuracy in drift scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of pattern recognition, and in particular relates to a gas sensor drift compensation method. Background Art

[0002] Gas sensors convert target gas concentrations into electrical signals. Combined with machine learning or deep learning methods, they can detect gas. However, when exposed to changes in ambient temperature or humidity, or interference from VOC (volatile organic compound) gases, the sensor's response characteristics can change, a phenomenon known as gas sensor drift. In these situations, gas classification models built using traditional methods are unable to accurately handle abnormal gas sensor responses.

[0003] Essentially, the reason traditional gas classification models degrade in performance in drift scenarios is that the distribution of gas sensor output responses differs before and after drift. To mitigate the impact of this distribution difference, existing drift compensation methods typically use clean data as the source domain and drift data as the target domain. Domain adaptation methods are then used to align the source and target domain data in a certain space, mitigating the negative impact of this distribution difference. However, when distribution alignment is achieved at the domain level but significant overlap in feature distributions between different classes persists, this drift compensation technique will produce a negative transfer effect, failing to achieve its true purpose. Summary of the Invention

[0004] The present invention provides a gas sensor drift compensation method to solve the above problems and improve the gas classification accuracy in drift scenarios.

[0005] The present invention is achieved through the following technical solutions:

[0006] A gas sensor drift compensation method, comprising:

[0007] Determine the target domain data and source domain data;

[0008] Establish and train the DAAN network model;

[0009] Input the labeled source domain and unchanged target domain data into the DAAN network and train it; establish a gas classification model with drift compensation function;

[0010] The trained gas classification model is used to detect the target domain data to achieve gas classification.

[0011] Furthermore, the DAAN network includes a data input network, a deep feature extraction network, a gas classification network, and a domain discrimination network;

[0012] The data input network only needs to input source domain data or target domain data, and no preprocessing is required for the data;

[0013] The deep feature extraction network includes local feature extraction, temporal feature extraction, and maximum mean difference at the class level. It uses a one-dimensional convolutional network and a long short-term memory network with an attention mechanism to extract local features and temporal features of gas sensor signals respectively. On this basis, the local features and temporal features are combined to achieve information fusion at the feature level.

[0014] The gas classification network performs gas classification and outputs gas categories;

[0015] The domain discrimination network interferes with the distribution differences between the source domain and the target domain on the output gas categories.

[0016] Furthermore, the data input network is specifically:

[0017] Given a source domain with a label in and Represents the source domain D S The i-th instance and the corresponding label in ;

[0018] Assume that the target domain is defined as in represents the jth instance of the target domain.

[0019] Furthermore, the local feature extraction is specifically as follows:

[0020] Based on a one-dimensional convolutional neural network, the local feature extraction module consists of five units connected in series, and the structure of each unit is exactly the same; each unit adopts a convolution layer + a convolution layer + a maximum pooling layer. 5. According to the gas sensor drift compensation method of claim 2, the time series feature extraction is specifically:

[0021] The temporal feature extraction module uses LSTM to extract the temporal representation of the response signal; on this basis, the attention mechanism is introduced to make full use of useful features, suppress invalid features, and realize feature screening.

[0022] Furthermore, the maximum mean difference at the class level is specifically:

[0023] Related but similarly distributed data get the same prediction results; the probability distribution output by the DAAN network is used to achieve class-level distribution alignment; the calculation formula is as follows:

[0024]

[0025] Where c∈{1,2,...,C} represents the class labels of the source domain and the target domain; and Represent the output of the source domain sample and the target domain sample in the DFEN network respectively; H and k(·,·) represent the reproducing kernel Hilbert space and the corresponding kernel respectively; φ(·) represents the mapping from the original feature to the RKHS; and Respectively and The weight is calculated as follows:

[0026]

[0027] Among them, DAAN network is i The predicted result is y i , which is a vector with C dimensions and sum to 1; It is y i In this way, class-level domain alignment is achieved without using true labels; where DFS and DFT represent the outputs of the source domain and target domain in the DFEN network, respectively.

[0028] Furthermore, the network framework of the gas classification network is specifically as follows:

[0029] The gas classification network is connected to the back of the DFEN network and outputs the probability distribution of gas categories. The network consists of three fully connected layers, and ReLU is used as the activation function after the first two fully connected layers, and Softmax is used after the last fully connected layer. Among them, FC represents the fully connected layer, DFS and DFT represent the output of the source domain and target domain on the DFEN network respectively, and y S and y T Represent the probability distribution of the source domain and the target domain in the FDN output, t S is the true label of the source domain.

[0030] Furthermore, the strategy for reducing the intra-class distance based on the gas classification network is specifically as follows:

[0031] Centre loss is introduced into the FDN network to make the feature distribution of samples of the same category more compact. The calculation formula is as follows:

[0032]

[0033] Among them, q c Indicates that the c-class sample is at the center of the FC2 layer; combining Centre loss and CMMD can achieve class alignment between the target domain and the source domain, while reducing the intra-class distance, thereby suppressing drift interference and improving the gas classification accuracy and recognition rate;

[0034] The classification loss of the strategy of reducing the intra-class distance based on the gas classification network is specifically:

[0035] During model training, the classification error LC can be optimized by using labeled source domain data. The FDN network and DTEN network can be optimized by minimizing LC. The calculation formula is as follows:

[0036]

[0037] Where J(·,·) represents the cross entropy loss function; Indicates FDN pair Output prediction results; for The true label.

[0038] Furthermore, the domain discrimination network is specifically:

[0039] The DDN network is connected behind the DTEN, taking the learned deep features as input and outputting predicted domain labels. The architecture of the DDN network is the same as that of the FDN. During model training, the domain discrimination network's ability to correctly identify domain labels becomes increasingly stronger. At the same time, the DTEN uses a gradient reversal strategy to confuse the source and target domains. With the help of this adversarial approach, the deep features output by the DTEN will have domain-invariant properties, thereby reducing the interference caused by the distribution differences between the source and target domains due to drift. The calculation formula is as follows:

[0040]

[0041]

[0042]

[0043] in, Indicates DDN network pair The output prediction results are: for The ground-truth domain label of Indicates DDN network pair The output prediction results are: for The true domain label of , where FC represents the fully connected layer, DFS and DFT represent the output of the source domain and target domain on the DFEN network respectively, z S and z T Denote the probability distribution of the source domain and the target domain in the FDN output, d S and d T are the true domain labels of the source and target domains.

[0044] Furthermore, the DAAN network also includes parameter optimization, and the parameter optimization is specifically:

[0045] The optimization objectives of the DAAN network include four parts: 1) class-level distribution alignment loss: LCMMD, 2) Centre loss: LCen, 3) Classification loss: LC, 4) Domain loss: LD; the calculation formula is as follows:

[0046] L=L C +βL CMMD +γL Cen +λL D (8)

[0047] Among them, β, γ and λ represent L CMMD 、L Cen 、L D The penalty factor;

[0048] Assume that θ1, θ2, and θ3 represent the parameters of the DFEN network, the FDN network, and the DDN network, respectively; these parameters are optimized based on the SGD algorithm in each training iteration:

[0049]

[0050] The beneficial effects of the present invention are:

[0051] The DAAN of the present invention does not require any pre-processing or manual feature extraction steps for the original signal, and only needs to input the collected original signal into the data input network. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 Schematic diagram of the DAAN framework of the present invention.

[0053] Figure 2 Schematic diagram of the CMMD of the present invention

[0054] Figure 3 The structure of the FDN network of the present invention is

[0055] Figure 4 The DDN network structure of the present invention

[0056] Figure 5 It is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0057] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0058] The purpose of this invention is to provide a method for compensating for gas sensor drift. This method fuses local and temporal features at the feature level, achieves class-level feature alignment, and simultaneously learns domain-invariant features using domain adversarial learning, narrowing intra-class distances and thereby improving gas classification accuracy in drift scenarios.

[0059] During the DAAN training phase, source domain data and target domain data are collected, where the source domain is the clean gas sensor response signal, and the target domain is the gas sensor response signal under drift interference. Then, the labeled source domain data and the unlabeled target domain data are directly input into the DAAN for training without any processing. The SGD algorithm is used to optimize the model parameters to obtain the optimal DAAN. During the testing phase, the trained DAAN is used to classify the target domain data and output the gas category. The flowchart of the gas sensor drift compensation method proposed in this invention is shown in Figure 2. Figure 5 The main process is as follows:

[0060] A gas sensor drift compensation method, comprising:

[0061] Determine the target domain data and source domain data;

[0062] Establish and train the DAAN network model;

[0063] Input the labeled source domain and unchanged target domain data into the DAAN network and train it; establish a gas classification model with drift compensation function;

[0064] The trained gas classification model is used to detect the target domain data to achieve gas classification.

[0065] Furthermore, the DAAN network includes a data input network, a deep feature extraction network, a gas classification network, and a domain discrimination network;

[0066] The data input network only needs to input source domain data or target domain data, and no preprocessing is required for the data;

[0067] The deep feature extraction network includes local feature extraction, temporal feature extraction and maximum mean difference at the class level; the response signal of the gas sensor has the characteristics of non-stationarity and periodicity. Therefore, different positions of the response signal may contain features that can characterize gas category information, and it is also extremely important to explore the intrinsic connection of the response signal in the time dimension. Therefore, the present invention designs a deep feature extraction network (DFEN), which uses a one-dimensional convolutional network (1DCNN) and a long short-term memory network (LSTM) with an attention mechanism to respectively extract local features and temporal features of the vibration signal; on this basis, the local features and temporal features are combined together to realize information fusion at the feature level;

[0068] The gas classification network performs gas classification and outputs gas categories;

[0069] The domain discrimination network interferes with the distribution differences between the source domain and the target domain on the output gas categories.

[0070] Furthermore, the data input network is specifically:

[0071] Given a source domain with a label in and Represents the source domain D S The i-th instance and the corresponding label in ;

[0072] Assume that the target domain is defined as in Denotes the jth instance in the target domain. Both source and target domain data are directly input into DAAN for drift compensation and gas detection without any preprocessing steps.

[0073] Furthermore, the local feature extraction is specifically as follows:

[0074] Based on a one-dimensional convolutional neural network, the local feature extraction module consists of five units connected in series, each with an identical structure. Unlike the traditional convolutional layer + pooling layer structure, each unit uses a convolutional layer + convolutional layer + max pooling layer. This structure reduces model parameters while increasing model depth, thereby improving prediction accuracy.

[0075] Furthermore, the time series feature extraction is specifically as follows:

[0076] LSTM can capture the long-term dependencies of response signals and has a strong ability to mine temporal information. Therefore, the temporal feature extraction module uses LSTM to extract the temporal representation of the response signal. On this basis, the attention mechanism is introduced to fully utilize useful features, suppress invalid features, and achieve feature screening.

[0077] Furthermore, the maximum mean difference at the class level is specifically:

[0078] Traditional domain adaptation methods focus on aligning the distributions of the source and target domains. However, related data with similar distributions yield the same prediction results. In fact, it is more important to align the feature distributions of data of the same category in the source and target domains, and to achieve class-level distribution alignment. Therefore, the CMMD method was designed. This achieves class-level distribution alignment using the probability distribution output by the DAAN network. The calculation formula is as follows:

[0079]

[0080] Where c∈{1,2,...,C} represents the class labels of the source domain and the target domain; and denote the output of the source domain sample and the target domain sample in the DFEN network respectively; H and k(·,·) denote the reproducing kernel Hilbert space (RKHS) and the corresponding kernel respectively; φ(·) denotes the mapping from the original feature to the RKHS; and Respectively and The weight is calculated as follows:

[0081]

[0082] Among them, DAAN network is i The predicted result is y i , which is a C-dimensional vector summing to 1 (probability distribution); It is y i In this way, class-level domain alignment is achieved without using true labels. The schematic diagram of CMMD is shown in Figure 2 As shown in Figure 2, DFS and DFT represent the outputs of the source domain and target domain in the DFEN network, respectively.

[0083] Furthermore, the network framework of the gas classification network is specifically as follows:

[0084] The gas classification network (FDN) is connected to the back of the DFEN network and outputs the probability distribution of gas categories. The network consists of three fully connected layers, and the first two fully connected layers use ReLU as the activation function, and the last fully connected layer uses Softmax. The architecture of FDN is as follows: Figure 3 As shown. Among them, FC represents the fully connected layer, DFS and DFT represent the output of the source domain and target domain on the DFEN network respectively, and y S and y T Represent the probability distribution of the source domain and the target domain in the FDN output, tS is the true label of the source domain.

[0085] Furthermore, the strategy for reducing the intra-class distance based on the gas classification network is specifically as follows:

[0086] Centre loss is introduced in the FDN network to make the feature distribution of samples of the same category more compact; the calculation formula is as follows:

[0087]

[0088] Among them, q c Indicates that the c-class sample is at the center of the FC2 layer; combining Centre loss and CMMD can achieve class alignment between the target domain and the source domain, while reducing the intra-class distance, thereby suppressing drift interference and improving the gas classification accuracy and recognition rate;

[0089] The classification loss of the strategy of reducing the intra-class distance based on the gas classification network is specifically:

[0090] During model training, the classification error LC can be optimized by using labeled source domain data. The FDN network and DTEN network can be optimized by minimizing LC. The calculation formula is as follows:

[0091]

[0092] Where J(·,·) represents the cross entropy loss function; Indicates FDN pair Output prediction results; for The true label.

[0093] Furthermore, the domain discrimination network is specifically:

[0094] The DDN network is connected behind the DTEN, taking the learned deep features as input and outputting predicted domain labels. The architecture of the DDN network is the same as that of the FDN. During model training, the domain discrimination network's ability to correctly identify domain labels becomes increasingly stronger. At the same time, the DTEN uses a gradient reversal strategy to confuse the source and target domains. With the help of this adversarial approach, the deep features output by the DTEN will have domain-invariant properties, thereby reducing the interference caused by the distribution differences between the source and target domains due to drift. The calculation formula is as follows:

[0095]

[0096]

[0097]

[0098] in, Indicates DDN network pair The output prediction results are: for The ground-truth domain label of Indicates DDN network pair The output prediction results are: for The real domain label, the network structure of DDN is as follows Figure 4 As shown in the figure; FC represents the fully connected layer, DFS and DFT represent the output of the source domain and target domain on the DFEN network respectively, S and z T Denote the probability distribution of the source domain and the target domain in the FDN output, d S and d T are the true domain labels of the source and target domains.

[0099] Furthermore, the DAAN network also includes parameter optimization, and the parameter optimization is specifically:

[0100] The optimization objectives of the DAAN network include four parts: 1) class-level distribution alignment loss: LCMMD, 2) Centre loss: LCen, 3) Classification loss: LC, 4) Domain loss: LD; the calculation formula is as follows:

[0101] L=L C +βL CMMD +γL Cen +λL D (8)

[0102] Among them, β, γ and λ represent L CMMD 、L Cen 、L D The penalty factor;

[0103] Assume that θ1, θ2, and θ3 represent the parameters of the DFEN network, the FDN network, and the DDN network, respectively; these parameters are optimized based on the SGD algorithm in each training iteration:

[0104]

[0105] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A gas sensor drift compensation method, characterized in that: include Determine the target domain data and source domain data; Establish and train the DAAN network model; Input the labeled source domain and unchanged target domain data into the DAAN network and train it; establish a gas classification model with drift compensation function; Use the trained gas classification model to detect the target domain data and achieve gas classification; The DAAN network includes a data input network, a deep feature extraction network, a gas classification network, and a domain discrimination network; The data input network only needs to input source domain data or target domain data, and no preprocessing is required for the data; The deep feature extraction network includes local feature extraction, temporal feature extraction, and maximum mean difference at the class level. It uses a one-dimensional convolutional network and a long short-term memory network with an attention mechanism to extract local features and temporal features of gas sensor signals respectively. On this basis, the local features and temporal features are combined to achieve information fusion at the feature level. The gas classification network performs gas classification and outputs gas categories; The domain discrimination network interferes with the distribution differences between the source domain and the target domain on the output gas categories.

2. A gas sensor drift compensation method according to claim 1, characterized in that: The data input network is specifically: Given a source domain with a label ,in and Represents the source domain The i-th instance and the corresponding label in ; Assume that the target domain is defined as ,in represents the jth instance of the target domain.

3. A gas sensor drift compensation method according to claim 1, characterized in that: The local feature extraction is specifically as follows: Based on a one-dimensional convolutional neural network, the local feature extraction module is composed of 5 units connected in series, and the structure of each unit is exactly the same; each unit adopts a convolution layer + a convolution layer + a maximum pooling layer.

4. A gas sensor drift compensation method according to claim 1, characterized in that: The temporal feature extraction is specifically as follows: The temporal feature extraction module uses LSTM to extract the temporal representation of the response signal; on this basis, the attention mechanism is introduced to make full use of useful features, suppress invalid features, and realize feature screening.

5. A gas sensor drift compensation method according to claim 1, characterized in that: The maximum mean difference at the class level is specifically, Related but similarly distributed data get the same prediction results; the probability distribution output by the DAAN network is used to achieve class-level distribution alignment; the calculation formula is as follows: (1) in, Represents the distribution difference between the source domain and the target domain at the class level; Represents the class labels of the source domain and the target domain; and Respectively represent the output of the source domain sample and the target domain sample in the DFEN network; H and denote the reproducing kernel Hilbert space and the corresponding kernel respectively; Represents the mapping from original features to RKHS; and Respectively and The weight of and Represent the source domain samples and target domain samples The weight of The source domain samples; The target domain The calculation formula is as follows: (2) Among them, DAAN network The prediction result is , which is a vector with C dimensions and sum to 1; yes In this way, class-level domain alignment is achieved without using true labels; where DFS and DFT represent the outputs of the source domain and target domain in the DFEN network, respectively.

6. A gas sensor drift compensation method according to claim 1, characterized in that: The network framework of the gas classification network FDN is specifically as follows: The gas classification network is connected to the back of the DFEN network and outputs the probability distribution of gas categories. The network consists of three fully connected layers, and ReLU is used as the activation function after the first two fully connected layers, and Softmax is used after the last fully connected layer.

7. A gas sensor drift compensation method according to claim 6, characterized in that: The strategy for reducing the intra-class distance based on the gas classification network is specifically: Centre loss is introduced into the FDN network to make the feature distribution of samples of the same category more compact. The calculation formula is as follows: (3) in, Represents the output of the FC2 layer; The source domain samples; Indicates the center of the c-type sample in the FC2 layer; express The distance between the output of the FC2 layer and the center of the C-class sample; combining Centre loss and CMMD can achieve class alignment between the target domain and the source domain, while reducing the intra-class distance, thereby suppressing drift interference and improving the gas classification accuracy and recognition rate.

8. A gas sensor drift compensation method according to claim 7, characterized in that: The classification loss of the strategy of reducing the intra-class distance based on the gas classification network is specifically: During model training, the classification error LC can be optimized by using labeled source domain data. The FDN network and DTEN network can be optimized by minimizing LC. The calculation formula is as follows: (4) in, represents the cross entropy loss function; Indicates FDN pair Output prediction results; for The true label.

9. A gas sensor drift compensation method according to claim 8, characterized in that: The domain discrimination network is specifically: The DDN network is connected behind the DTEN, taking the learned deep features as input and outputting predicted domain labels. The architecture of the DDN network is the same as that of the FDN. During model training, the domain discrimination network's ability to correctly identify domain labels becomes increasingly stronger. At the same time, the DTEN uses a gradient reversal strategy to confuse the source and target domains. With the help of this adversarial approach, the deep features output by the DTEN will have domain-invariant properties, thereby reducing the interference caused by the distribution differences between the source and target domains due to drift. The calculation formula is as follows: (5) (6) (7) in, Indicates DDN network pair The output prediction results are: for The ground-truth domain label of Indicates DDN network pair The output prediction results are: for The true domain label of , where FC represents the fully connected layer, DFS and DFT represent the output of the source domain and target domain on the DFEN network respectively, and Represent the probability distribution of the source domain and target domain in the FDN output, and are the true domain labels of the source domain and the target domain, Represents source domain samples The domain loss, Represents the target domain sample domain loss.

10. A gas sensor drift compensation method according to claim 9, characterized in that: The DAAN network also includes parameter optimization, and the parameter optimization is specifically: The optimization objectives of the DAAN network include four parts: 1) class-level distribution alignment loss: LCMMD, 2) Centre loss: LCen, 3) Classification loss: LC, and 4) Domain loss: LD. The calculation formula is as follows: (8) in, 、 and Respectively 、 、 The penalty factor; Assumptions 、 and Represent the parameters of the DFEN network, FDN network, and DDN network respectively; these parameters are optimized based on the SGD algorithm in each training iteration: (9)。

Citation Information

Patent Citations

  • CNN (convolutional neural network) based method for identifying communication interference signals at large dynamic SNR (signal to noise ratio)

    CN107203782A

  • Self-adaptive video classification method and system based on attention mechanism

    CN112084887A