Method and system for constructing drift-compensated electronic nose gas recognition model

By employing latent space consistency regularization and dynamic pseudo-label cleanup mechanisms, combined with local and global alignment, the problem of decreased recognition performance caused by electronic nose sensor drift was solved, achieving higher recognition accuracy and stability.

CN121919641APending Publication Date: 2026-04-24NANJING XIAOZHUANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING XIAOZHUANG UNIV
Filing Date
2025-12-10
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing electronic noses suffer from decreased recognition performance due to sensor drift during long-term stable deployment. Existing deep learning methods suffer from problems such as pseudo-label screening relying on static thresholds, feature alignment disrupting the category discrimination structure, and pseudo-label noise and adversarial training interference, resulting in insufficient compensation accuracy and robustness of the model in real-world scenarios.

Method used

Latent space consistency regularization is used to stabilize the feature representation of the target domain. A dynamic pseudo-label purification mechanism is combined to filter high-quality pseudo-labels. A fine alignment between the source domain and the target domain in the feature space is achieved through a local alignment and global alignment collaborative alignment mechanism, and a drift compensation model is constructed.

Benefits of technology

It significantly improves the accuracy and robustness of the model in semi-supervised scenarios, and provides a reliable solution for the long-term deployment of electronic noses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121919641A_ABST
    Figure CN121919641A_ABST
Patent Text Reader

Abstract

The invention discloses a construction method and system of a drift-compensated electronic nose gas recognition model, and relates to the technical field of electronic nose signal processing and artificial intelligence. According to the method, gas sample data of a source domain and a target domain before and after drifting are obtained and preprocessed, then a neural network model containing a feature extractor, a classifier and a domain discriminator is constructed, the feature extractor is trained through data enhancement and hidden space consistency loss regularization constraint to obtain robust feature representation, and the robust feature representation is obtained. The method comprises the following steps: generating a pseudo label for a target domain unlabeled sample, purifying based on a dynamic weighting mechanism of consistency evaluation and confidence, synchronously executing category-based local semantic alignment and adversarial training-based global distribution alignment by using the purified pseudo label, and finally, performing classification-based local semantic alignment and adversarial training-based global distribution alignment. Through a multi-objective function joint optimization model fusing classification loss, consistency loss and two kinds of alignment loss, effective sensor drift compensation is realized, and the accuracy and robustness of the model in a semi-supervised scene are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and system for constructing a drift-compensated electronic nose gas recognition model, belonging to the fields of electronic nose signal processing and artificial intelligence technology. Background Technology

[0002] Sensor drift is a core challenge for the long-term stable deployment of electronic noses. In recent years, domain adaptation methods based on deep learning have become a research hotspot for solving this problem. Through in-depth analysis of existing technologies, the current mainstream technical approaches still have the following shortcomings: the long-term stable deployment of electronic noses is limited by the sensor drift problem, that is, the sensor response characteristics change over time, leading to a decline in recognition performance. In existing technologies, the semi-supervised adversarial domain adaptation (SAD-CNN) method based on deep learning compensates for drift through pseudo-label generation and feature alignment, but it still has three bottlenecks: pseudo-label selection relies on static thresholds, which cannot effectively suppress high-confidence erroneous samples; feature alignment is based on global distribution matching, which destroys the class discrimination structure; and the mutual interference between pseudo-label noise and adversarial training leads to instability and poor convergence in the training process. These defects are coupled with each other, restricting the compensation accuracy and robustness of electronic noses in real-world scenarios. Summary of the Invention

[0003] The purpose of this invention is to provide a method and system for constructing a drift-compensated electronic nose gas recognition model. By using latent space consistency regularization technology to improve the stability of the feature representation of the target domain samples, and combining a dynamic pseudo-label purification mechanism to screen high-quality pseudo-labels, the invention also utilizes a local alignment and global alignment collaborative alignment mechanism to achieve fine alignment between the source domain and the target domain in the feature space, thereby significantly improving the accuracy and robustness of the model in semi-supervised scenarios.

[0004] To achieve the above objectives, the present invention is implemented using the following technical solution.

[0005] On one hand, the present invention provides a method for constructing a drift-compensated electronic nose gas recognition model, comprising the following steps:

[0006] Step S1: Obtain the labeled source domain samples before drift and the target domain samples after drift whose number of labeled samples is less than that of the source domain, collected by the electronic nose, and standardize the time-series signals of all samples.

[0007] Step S2: Construct and initialize a gas recognition neural network model that includes a feature extractor and a classifier;

[0008] Step S3: Perform data augmentation on the unlabeled samples in the target domain, calculate the difference between the latent space features obtained by the feature extractor from the original sample and the augmented sample, and optimize the feature extractor by applying latent space consistency regularization constraints to the feature extractor.

[0009] Step S4: Based on the optimized feature extractor, generate initial pseudo-labels for unlabeled samples in the target domain, and filter out noisy pseudo-labels through consistency loss and confidence weighting mechanism to obtain purified target domain pseudo-labels.

[0010] Step S5: Based on the labeled source domain samples and the target domain samples with cleaned target domain pseudo-labels, perform local semantic alignment and global distribution alignment simultaneously.

[0011] Step S6: Construct a multi-objective loss function and jointly optimize the constructed model through the backpropagation algorithm until the model converges, and output the drift-compensated gas recognition model.

[0012] Optionally, the gas recognition neural network model may further include a domain discriminator.

[0013] Optionally, in step S3, the data augmentation includes at least one of adding Gaussian noise and amplitude scaling;

[0014] The variance of the Gaussian noise addition is adaptively determined based on the variance of the original sample signal, and the scaling factor for amplitude scaling is randomly selected within a preset range.

[0015] Optionally, in step S3, a latent space consistency regularization constraint is applied to the feature extractor, including constructing and minimizing the latent space consistency loss, expressed as:

[0016] ;

[0017] in, This represents the i-th target domain sample. yes The sample obtained after data augmentation Represents target domain samples Through feature extractor The latent space features obtained afterwards. It is an enhanced sample via feature extractor The latent space features obtained afterwards. It is a hyperparameter used to adjust the weights of the latent space consistency regularization constraint. It is the total number of samples in the target domain. This represents the square of the Euclidean norm.

[0018] Optionally, in step S4, the filtering of noisy false labels through the consistency loss and confidence weighting mechanism includes:

[0019] Calculate the confidence weight of the initial pseudo-label, where the confidence weight is the probability value of the model predicting the class of the sample; perform multiple different data augmentations on unlabeled samples in the same target domain, and calculate the consistency weight based on the latent space features of all augmented versions; determine the final reliability weight of the pseudo-label of the sample based on the product of the confidence weight and the consistency weight.

[0020] If the final reliability weight is greater than a preset threshold, the pseudo-label is retained and used for subsequent training; otherwise, it is discarded.

[0021] Optionally, the consistency weight is obtained in the following way:

[0022] Calculate the consistency loss between the latent space features of all augmented versions of unlabeled samples in the same target domain and their feature mean;

[0023] The consistency weight is obtained by multiplying the consistency loss by a scaling factor and then taking the negative exponential mapping value.

[0024] Optionally, in step S5, the local semantic alignment is achieved by minimizing the local maximum mean difference loss. The calculation formula for achieving this is as follows:

[0025] ;

[0026] in Indicates the first in the source domain The feature mean vector of the class samples, Indicates the first in the target domain The feature mean vector of the class samples, where K is the total number of classes.

[0027] Optionally, in step S5, global distribution alignment is achieved through adversarial training, including:

[0028] The latent space features are determined to originate from the source or target domain by a domain discriminator; a gradient inversion layer is set between the feature extractor and the domain discriminator.

[0029] Through synchronous optimization, the feature extractor is trained to generate domain-invariant features that can confuse the domain discriminator, while the domain discriminator is trained to accurately distinguish the source of the features.

[0030] Optionally, in step S6, the multi-objective loss function is a weighted sum of classification loss, latent space consistency loss, local semantic alignment loss, and global distribution adversarial loss.

[0031] Secondly, the present invention provides a system for constructing a drift-compensated electronic nose gas recognition model, comprising:

[0032] A memory, wherein the memory stores a computer program;

[0033] A processor, which, when executing a computer program, implements a method for constructing an electronic nose gas recognition model with drift compensation as described in the first aspect.

[0034] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:

[0035] This invention achieves closed-loop design and collaborative optimization through latent space consistency regularization, pseudo-label cleanup mechanism, and collaborative cross-domain alignment, fundamentally solving the bottleneck of existing electronic nose drift compensation technology. Specifically, latent space consistency is introduced as an internal evaluation criterion, combined with confidence to form dynamic cleanup weights, reducing feature shift caused by drift at the source. This invention proposes category-level local alignment based on cleaned pseudo-labels. By bringing cross-domain feature centers closer together, it reduces inter-domain differences while preserving the semantic structure required for classification to the greatest extent. This method, combined with Global Adversarial Training (GAN), forms a two-layer alignment mechanism of global and local collaboration. Compared with traditional single global alignment methods, it can more accurately compensate for drift, ensuring feature consistency between the source and target domains at the category level. Simultaneously, through a collaborative optimization framework of multi-objective loss functions, it combines classification, robustness, local alignment, and global adversarial training, significantly improving the model's accuracy and robustness in semi-supervised scenarios, providing a reliable solution for the long-term deployment of electronic noses. Attached Figure Description

[0036] Figure 1 This is a flowchart illustrating the method for constructing a drift-compensated electronic nose gas recognition model according to an embodiment of the present invention. Detailed Implementation

[0037] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.

[0038] It should be noted that the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0039] Example 1

[0040] This embodiment uses a publicly available electronic nose dataset—the UCI Gas Sensor Array Drift Dataset—as a benchmark for illustration. This dataset contains an array of 16 metal oxide semiconductor gas sensors that measure six common volatile organic compounds (ethanol, acetone, benzene, formaldehyde, methanol, and toluene). It is a classic dataset for studying long-term sensor drift problems.

[0041] This embodiment introduces a method for constructing a drift-compensated electronic nose gas recognition model. The core of this method lies in stabilizing the feature representation of the target domain through latent space consistency regularization technology, thereby improving the quality of pseudo-labels and the domain alignment effect. Figure 1 As shown, the specific steps include:

[0042] S1. Data Acquisition and Preprocessing:

[0043] Source domain data The first batch of Batch1 data, which was collected earliest in the dataset and was considered to be drift-free, was selected as the source domain data. This batch of data includes the above 6 types of gases, with 50 samples collected at each of the 3 concentrations, for a total of 6×3×50=900 samples. All samples have accurate gas category labels, representing the ideal state of the initial calibration of the model.

[0044] Target domain data The 10th batch of data collected later was selected as the target domain, representing a scenario where the sensor has experienced significant drift after long-term use. This batch also included 6 types of gases, totaling 900 samples. To simulate a semi-supervised scenario where only a small number of labels can be obtained in real-world applications, this embodiment assumes that only 5% of the samples (i.e., 45 samples, approximately 7-8 per gas type) have real labels, while the remaining 855 samples are used as unlabeled data for model training. 150 samples were reserved from the target domain data as an independent test set for final evaluation.

[0045] All source and destination domain data have been processed. Standardization involves subtracting the mean of all samples in the domain from each sensor channel and dividing by its standard deviation to eliminate differences in baseline response and signal scale between different sensors.

[0046] S2. Model Construction and Initialization:

[0047] Construct an end-to-end trainable neural network model, including:

[0048] Feature extractor f: A 5-layer one-dimensional convolutional neural network (1D-CNN) is used as the feature extractor to process the sensor time-series signals. The specific structure is as follows:

[0049] Convolutional layer 1: Input channels = 16 (number of sensors), output channels = 32, kernel size = 7, stride = 1, padding = 3, followed by ReLU activation function and max pooling (pooling kernel = 2).

[0050] Convolutional layer 2: Input channels = 32, output channels = 64, kernel size = 5, stride = 1, padding = 2, followed by ReLU and max pooling (pooling kernel = 2).

[0051] Convolutional layer 3: Input channels = 64, output channels = 128, kernel size = 3, stride = 1, padding = 1, followed by ReLU and global average pooling.

[0052] Flattening layer and fully connected layer: The features after global average pooling are mapped to a 256-dimensional latent space vector. Here, the latent space refers to the high-dimensional abstract feature representation space learned by the feature extractor, which is the core carrier for drift compensation related operations (such as consistency regularization and distribution alignment) in this method.

[0053] The weights are initialized using the He normal initialization method.

[0054] Classifier C: A classifier is connected after the latent space features. It consists of a fully connected layer (256-dimensional input, 6-dimensional output, corresponding to 6 types of gases) and a Softmax function. The weights of this layer are uniformly initialized using Xavier.

[0055] Domain Discriminator D: It is a 3-layer fully connected network used to generate global alignments for adversarial networks (GANs). Its specific structure includes:

[0056] Input layer: 256 dimensions (latent space feature dimension).

[0057] Hidden layer: 128 dimensions, followed by .

[0058] Output layer: 1-dimensional, followed by the Sigmoid function.

[0059] All weights are initialized using a normal distribution with a standard deviation of 0.02.

[0060] Optimizer and Hyperparameters: The model was trained using the Adam optimizer with a batch size of 32, an initial learning rate of 1e-4, and a total of 200 training epochs. The overall loss function was... The hyperparameters are set as follows: classification loss weight is 1, latent space consistency regularization loss weight is... =0.5, local alignment loss weight =0.1, global adversarial loss weight =0.01 to balance various losses. In the pseudo-label cleanup parameters, the number of enhanced views M is set to 4, and the consistency weight scaling factor is set to 0.01. Set to 1.0.

[0061] S3, Latent Space Consistency Regularization Training;

[0062] In each training iteration, perform the following operations on unlabeled samples in the target domain:

[0063] S31, Data Augmentation:

[0064] For each unlabeled sample in the target domain Generate an enhanced view ,include:

[0065] Add Gaussian noise: for unlabeled samples in the target domain Add Gaussian noise To simulate random interference and noise variance during signal acquisition. Randomly select from [0, 0.01 × (signal variance)].

[0066] Amplitude scaling: Randomly scaling the overall amplitude of the signal to simulate changes in sensor sensitivity or gas concentration; scaling factor. Select uniformly and randomly from [0.9, 1.1].

[0067] S32. Loss Calculation and Optimization:

[0068] The consistency difference between the original sample and its augmented sample in latent space features is calculated and used as a regularization term to guide the optimization of the feature extractor.

[0069] ;

[0070] Represents target domain samples Through feature extractor The latent space features obtained afterward; It is an enhanced sample via feature extractor The latent space features obtained afterward; It is the hyperparameter set in step S2 (with a value of 0.5), used to control the weight of consistency loss; It is the total number of samples in the target domain; This represents the square of the Euclidean distance.

[0071] This loss function drives the feature extractor through gradient descent and backpropagation algorithms. The parameter updates and optimization process forced By learning to map different enhanced versions of samples from the same target domain to similar locations in the latent space, noise related to sensor drift can be filtered out from the source of feature learning, and more stable and essential feature representations can be learned.

[0072] The target domain samples, along with the enhanced target domain samples and source domain samples, are input into the feature extractor. In the middle, feature extractor (Typically 1D-CNN) extracts high-level abstract features from these inputs to generate latent space features of the source domain samples. Latent space features of target domain samples and their enhanced versions , etc., for use in subsequent training.

[0073] S4. Pseudo-tag generation and cleanup

[0074] To address the issue of insufficient target domain data annotation, this embodiment proposes a pseudo-label generation and purification mechanism based on dynamic adaptive threshold and consistency regularization. This mechanism reduces the dependence on target domain annotation data and effectively improves the quality of pseudo-labels by generating and purifying pseudo-labels, thereby enhancing the model's generalization ability in semi-supervised learning environments.

[0075] S41. Generate pseudo-tags:

[0076] For samples with no label in the target domain The input is fed into the trained feature extractor. In this process, the corresponding feature representation is obtained. .

[0077] Input the feature representation into The function obtains the probability distribution of the categories, and selects the category with the highest probability as the pseudo-label for the target domain sample, as shown in the following formula:

[0078] ;

[0079] S42. Clean up counterfeit labels:

[0080] To improve the quality of pseudo-tags, their reliability is evaluated using the following two-layer weighted mechanism:

[0081] Confidence assessment: That is, the maximum predicted probability is selected as the confidence weight.

[0082] Consistency assessment: for unlabeled samples in the target domain Perform M=4 different data augmentations to obtain the augmented sample set. Subsequently, all enhanced samples are processed through a feature extractor. The corresponding latent space feature set is obtained. And calculate the mean of these features. Finally, the consistency loss of this sample. This is the mean square error of all enhanced features and the mean feature:

[0083] ;

[0084] The smaller the loss, the more stable the model's prediction of the sample is under different disturbances. The consistency weight is calculated as follows:

[0085] ,in This is the scaling factor. The larger the value, the heavier the penalty for samples with poor consistency, and the faster the weight of the corresponding sample decays.

[0086] Fusion and Filtering: Final Weighting In this embodiment, an empirical threshold of 0.9 is set. This threshold can be adjusted according to the characteristics of the actual dataset. For high-quality samples with w > 0.9, their pseudo-labels along with their weights w are retained for subsequent local alignment loss calculations. For samples with w ≤ 0.9, their pseudo-labels are removed in this iteration.

[0087] S5, Adversarial Training and Loss Calculation;

[0088] S51. Calculate classification loss :

[0089] The standard cross-entropy loss is calculated on the fully labeled data in the source domain and 5% of the labeled data in the target domain to ensure the basic classification ability of the model.

[0090] S52, Local Alignment Loss:

[0091] Using the true labels from the source domain and the high-quality pseudo labels selected from the target domain, the eigenvalues ​​of the source domain samples for each of the six gas classes are calculated. and the mean of the features of the target domain samples

[0092] The local mean differences of the population are obtained by summing the mean differences of all categories k.

[0093] ;

[0094] This step achieves fine-grained feature distribution alignment at the category level, forcing similar gases to cluster at similar centers in the feature spaces of the source and target domains.

[0095] S53. Calculate global adversarial loss :

[0096] The latent space features of all samples from the source and target domains are input into the domain discriminator D. The discriminator aims to correctly distinguish whether the features originate from the source or target domain. The feature extractor f is followed by a gradient inversion layer, whose objective is the opposite of the discriminator: to generate domain-invariant features that the discriminator cannot distinguish. The loss follows the standard GAN formula:

[0097] ;

[0098] in, The discriminator is expected to correctly identify source domain samples as real samples. The goal is for the discriminator to classify the generated samples as fake samples, thereby prompting the generator to produce samples that are closer to the target domain samples.

[0099] S6, Comprehensive Optimization:

[0100] Calculate total loss The parameters of the feature extractor f, classifier C, and domain discriminator D are jointly optimized through the backpropagation algorithm.

[0101] Global adversarial alignment provides the foundation for overall distribution alignment of the model, while local class alignment refines this foundation. The two work together to achieve more accurate drift compensation.

[0102] Results and Analysis:

[0103] To evaluate the effectiveness of this invention (LCR-SAN), performance comparisons were performed on an independent test set (150 samples) reserved from the target domain (Batch 10). The comparison methods included:

[0104] No adaptation: The basic 1D-CNN classification model is trained only on the source domain Batch1 data and then directly applied to the target domain for testing.

[0105] Traditional Adversarial Domain Adaptation (DANN): A method that uses only generative adversarial networks for global alignment.

[0106] SAD-CNN: Existing technology, a method for global alignment and pseudo-labels using MMD.

[0107] LCR-SAN (Ablation A): Remove the latent space consistency regularization module (i.e., set the hyperparameter α=0).

[0108] LCR-SAN (Ablation B): Replaces the dynamic pseudo-label cleanup mechanism with a fixed threshold (confidence > 0.95) method.

[0109] The average classification accuracy of each method on the target domain test set is compared in Table 1.

[0110] Table 1. Average classification accuracy of different methods on the target domain test set.

[0111]

[0112] Both ablation experimental variants of this invention outperform SAD-CNN, demonstrating the value of latent space consistency regularization (comparison ablation A) and the dynamic cleanup mechanism (comparison ablation B). This invention significantly outperforms all comparative methods, indicating that the synergistic effect of the proposed latent space consistency regularization, dynamic pseudo-label cleanup, and the adversarial training mechanism of global and local co-alignment most effectively compensates for sensor drift, achieving robust and accurate gas identification in semi-supervised scenarios.

[0113] Example 2

[0114] Based on the same inventive concept as Embodiment 1, this embodiment introduces a system for constructing a drift-compensated electronic nose gas recognition model, comprising:

[0115] A memory, wherein the memory stores a computer program;

[0116] A processor that, when executing a computer program, implements the method for constructing the drift-compensated electronic nose gas recognition model as described in any one of Embodiments 1.

[0117] In summary, this invention improves the stability of the feature representation of the target domain samples by using latent space consistency regularization technology, combines a dynamic pseudo-label purification mechanism to screen high-quality pseudo-labels, and utilizes a local alignment and global alignment collaborative alignment mechanism to achieve fine alignment between the source domain and the target domain in the feature space, significantly improving the accuracy and robustness of the model in semi-supervised scenarios.

[0118] 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.

[0119] 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 the invention. 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.

[0120] 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.

[0121] 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.

[0122] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A method for constructing a drift-compensated electronic nose gas recognition model, characterized in that, Includes the following steps: Step S1: Obtain the labeled source domain samples before drift and the target domain samples after drift whose number of labeled samples is less than that of the source domain, collected by the electronic nose, and standardize the time-series signals of all samples. Step S2: Construct and initialize a gas recognition neural network model that includes a feature extractor and a classifier; Step S3: Perform data augmentation on the unlabeled samples in the target domain, calculate the difference between the latent space features obtained by the feature extractor from the original sample and the augmented sample, and optimize the feature extractor by applying latent space consistency regularization constraints to the feature extractor. Step S4: Based on the optimized feature extractor, generate initial pseudo-labels for unlabeled samples in the target domain, and filter out noisy pseudo-labels through consistency loss and confidence weighting mechanism to obtain purified target domain pseudo-labels. Step S5: Based on the labeled source domain samples and the target domain samples with cleaned target domain pseudo-labels, perform local semantic alignment and global distribution alignment simultaneously. Step S6: Construct a multi-objective loss function and jointly optimize the constructed model through the backpropagation algorithm until the model converges, and output the drift-compensated gas recognition model.

2. The method for constructing the drift-compensated electronic nose gas recognition model according to claim 1, characterized in that, The gas recognition neural network model also includes a domain discriminator.

3. The method for constructing the drift-compensated electronic nose gas recognition model according to claim 1, characterized in that, In step S3, the data augmentation includes at least one of adding Gaussian noise and amplitude scaling; The variance of the Gaussian noise addition is adaptively determined based on the variance of the original sample signal, and the scaling factor for amplitude scaling is randomly selected within a preset range.

4. The method for constructing the drift-compensated electronic nose gas recognition model according to claim 1, characterized in that, In step S3, a latent space consistency regularization constraint is applied to the feature extractor, including constructing and minimizing the latent space consistency loss, as follows: ; in, This represents the i-th target domain sample. yes The sample obtained after data augmentation Represents target domain samples Through feature extractor The latent space features obtained afterwards. It is an enhanced sample via feature extractor The latent space features obtained afterwards. It is a hyperparameter used to adjust the weights of the latent space consistency regularization constraint. It is the total number of samples in the target domain. This represents the square of the Euclidean norm.

5. The method for constructing the drift-compensated electronic nose gas recognition model according to claim 1, characterized in that, In step S4, the filtering of noisy false labels through the consistency loss and confidence weighting mechanism includes: Calculate the confidence weight of the initial pseudo-label, where the confidence weight is the probability value of the model predicting the category of the sample; Perform multiple different data augmentations on unlabeled samples of the same target domain, and calculate the consistency weight based on the latent space features of all augmented versions. The final reliability weight of the sample pseudo-label is determined by multiplying the confidence weight and the consistency weight. If the final reliability weight is greater than a preset threshold, the pseudo-label is retained and used for subsequent training; otherwise, it is discarded.

6. The method for constructing the drift-compensated electronic nose gas recognition model according to claim 5, characterized in that, The consistency weight is obtained in the following way: Calculate the consistency loss between the latent space features of all augmented versions of unlabeled samples in the same target domain and their feature mean; The consistency weight is obtained by multiplying the consistency loss by a scaling factor and then taking the negative exponential mapping value.

7. The method for constructing the drift-compensated electronic nose gas recognition model according to claim 1, characterized in that, In step S5, the local semantic alignment is achieved by minimizing the local maximum mean difference loss. The calculation formula for achieving this is as follows: ; in Indicates the first in the source domain The feature mean vector of the class samples, Indicates the first in the target domain The feature mean vector of the sample class, where K is the total number of classes.

8. The method for constructing the drift-compensated electronic nose gas recognition model according to claim 2, characterized in that, In step S5, global distribution alignment is achieved through adversarial training, including: The latent space features are determined to originate from the source or target domain by a domain discriminator; a gradient inversion layer is set between the feature extractor and the domain discriminator. Through synchronous optimization, the feature extractor is trained to generate domain-invariant features that can confuse the domain discriminator, while the domain discriminator is trained to accurately distinguish the source of the features.

9. The method for constructing the drift-compensated electronic nose gas recognition model according to claim 1, characterized in that, In step S6, the multi-objective loss function is a weighted sum of classification loss, latent space consistency loss, local semantic alignment loss, and global distribution adversarial loss.

10. A system for constructing a drift-compensated electronic nose gas recognition model, characterized in that, include: A memory, wherein the memory stores a computer program; A processor that, when executing a computer program, implements a method for constructing an electronic nose gas recognition model with drift compensation as described in any one of claims 1 to 9.