Self-adaptive compensation method based on baseline drift of gas sensor
By adopting an adaptive compensation method with a distribution adaptation model and particle swarm optimization method in the gas sensor, the problem of unstable response caused by baseline drift in the open environment is solved, and the stability and accuracy are significantly improved.
Patent Information
- Application Number
- CN202510174223.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-03-18
AI Technical Summary
The prior art is difficult to effectively solve the problem of unstable response caused by baseline drift in open environments, especially under complex and variable gas concentrations and ambient conditions.
Adaptive compensation method based on the distribution adaptation model is adopted, by obtaining sensor data sets where drifts and drifts occur, the source domain and target domain are constructed, and the weight balance factor of marginal distribution and conditional distribution is adjusted using the equilibrium distribution adaptation model, and the weight balance factor is optimized by the particle swarm optimization method to achieve the best drift compensation effect.
The stability and accuracy of the gas sensor in the case of baseline drift is significantly improved. By adjusting the data distribution differences, adaptive compensation for the drift sensor data is achieved, and the robustness and accuracy of the model are enhanced.
Smart Images

Figure CN119643803A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of gas sensors, and in particular relates to an adaptive compensation method based on baseline drift of a gas sensor. Background Art
[0002] Gas sensors are widely used in environmental monitoring, industrial safety, medical and other fields. Their core function is to detect the concentration of specific gases and output signals. According to different working principles and materials, gas sensors can be divided into electrochemical sensors, metal oxide (MOX) sensors, semiconductor sensors, etc.
[0003] Baseline drift refers to the phenomenon that the output signal of the sensor changes slowly over time or with environmental changes when there is no target gas. This drift may be caused by factors such as temperature, humidity, and pollutants, and is a major challenge in the field of gas sensors. In response to the baseline drift problem, researchers have proposed a variety of solutions: Hardware improvement: Suppress drift by optimizing materials (such as doping with metal impurities) or improving sensor structure Signal processing algorithm: Preprocess the signal using methods such as differential method, proportional method, and wavelet transform to reduce the impact of drift. Dynamic compensation technology: Use an online dynamic calibration model to adjust the sensor response in real time to improve stability. In some special application scenarios, such as the electronic nose (eNose) system carried by drones, baseline drift and sensitivity changes can significantly affect the accuracy of gas detection. In addition, sensors in open environments also face baseline drift problems because external conditions are uncontrollable, resulting in unstable sensor responses.
[0004] Although there are many methods for suppressing baseline drift, their effectiveness is still limited. For example, in an open environment, where sensors are exposed to complex and changing gas concentrations and environmental conditions, the baseline drift problem is still difficult to completely solve.
[0005] Temperature and humidity are the main environmental factors that affect the performance of gas sensors. For example, MOX sensors are very sensitive to humidity. High humidity increases the resistance of the sensing layer and interferes with the reaction sites, resulting in response drift. In addition, temperature changes can also cause sensor zero drift. Current algorithms for baseline drift compensation usually require complex calculation processes such as multivariate signal correction, principal component analysis (PCA), etc. Although these methods are effective, they increase the computational burden and power consumption of the system, limiting their application in portable devices. Long-term reliability issues.
[0006] During long-term operation, the performance of gas sensors will gradually decline due to material aging, surface contamination, etc. For example, when a MOX sensor is operated for a long time at moderate temperatures, it will cause baseline drift due to the slow annealing of non-equilibrium oxygen vacancy donors. Gas sensors are often interfered by other gas components, and this cross-sensitivity can cause baseline drift to increase. For example, the response of some sensors to oxygen or other contaminants will affect their detection accuracy of the target gas.
[0007] Although dynamic compensation technology can adjust sensor response in real time, its compensation effect is limited by the real-time data acquisition frequency and algorithm accuracy. In addition, under extreme conditions (such as high humidity or strong pollution environment), dynamic compensation may not be able to fully restore sensor performance. Summary of the invention
[0008] In order to solve the above problems existing in the prior art, the present invention provides an adaptive compensation method based on gas sensor baseline drift; The purpose of the present invention can be achieved through the following technical solutions: An adaptive compensation method based on gas sensor baseline drift comprises: obtaining a sensor data set without drift and a sensor data set with drift, and constructing corresponding source domains and target domains; establishing a distribution adaptation model between the source domain and the target domain, and adjusting the weight balance factor of the marginal distribution and conditional distribution between the source domain and the target domain by using the balanced distribution adaptation model; the source domain is the sensor data set without drift, and the target domain is the sensor data set with drift; quantifying the distribution difference between the source domain and the target domain by the maximum mean difference, and minimizing the distribution difference by optimizing the weight balance factor.
[0009] Specifically, the value range of the weight balancing factor is [0, 1], and the specific expression is: when the weight balancing factor is close to 0, it means that the difference between the source domain and the target domain is large, and the adjustment of the marginal distribution is more important; when the weight balancing factor is close to 1, it means that the data similarity between the two domains is high, and the adjustment of the conditional distribution is more important.
[0010] Specifically, the weight balance factor is optimized by a particle swarm optimization method to obtain the best drift compensation effect. The particle swarm is initialized, the fitness value of each particle is calculated, and the position and speed of the particle are iteratively optimized to finally find the optimal weight balance factor.
[0011] Specifically, the distribution adaptation model processing step includes: S401: normalizing the data of the source domain and the target domain to eliminate the influence of different feature value ranges on the distance calculation; S402: extracting features from the normalized data, and minimizing the distribution difference between the source domain and the target domain by adjusting the weight balancing factor; S403: Optimizing the weight balance factor using a particle swarm optimization algorithm to obtain the best drift compensation effect; S404: Use the optimized weight balancing factor to train the distribution adaptation model to achieve accurate classification and recognition of target domain data.
[0012] Specifically, the distribution adaptation model adjusts the distribution difference between the source domain and the target domain by minimizing the objective function, and the objective function expression is: , Among them, Ds and Dt represent the data distribution of the source domain and the target domain, and represent the samples in the source domain and the target domain, respectively. n and m represent the number of samples in the source domain and the target domain, respectively. C represents the total number of categories. nc and mc represent the number of samples belonging to category c in the source domain and the target domain, respectively. ‖•‖H represents the norm of the reproducing kernel Hilbert space.
[0013] Specifically, the particle swarm optimization method comprises the following steps: Initialize the particle swarm, including the position and velocity of the particles; Calculating the fitness value of each particle, where the fitness value is measured by the classification accuracy of the distribution adaptation model; Update the position and velocity of each particle, and perform iterative optimization based on the individual optimal solution and the global optimal solution; Repeat the above steps until the preset number of iterations is reached or the fitness value converges, and finally the optimal weight balance factor is obtained.
[0014] Specifically, the distribution adaptation model also includes pseudo-label processing of the target domain data by training a nearest neighbor classifier on the source domain data and using the nearest neighbor classifier to generate pseudo-labels for the target domain data so as to calculate the conditional probability distribution of the target domain data.
[0015] Specifically, the distribution adaptation model also includes a process of dynamically updating pseudo labels, and optimizing the accuracy of pseudo labels through multiple iterations.
[0016] Specifically, the distribution adaptation model is applicable to gas sensor array data, including metal oxide semiconductor gas sensor arrays.
[0017] Specifically, the sensor data set is data after fault detection and isolation, and fault isolation and data recovery are performed on abnormal signals in the sensor data through data reconstruction and confidence interval prediction methods.
[0018] The beneficial effects of the present invention are: The method proposed in the present invention can significantly improve the stability and accuracy of gas sensors in the case of baseline drift. Specifically, the method uses a distribution adaptation model to effectively adjust the data distribution differences between the source domain and the target domain, and realizes adaptive compensation for drift sensor data by balancing the weight balance factor of the marginal distribution and the conditional distribution. In addition, the weight balance factor is optimized by a particle swarm optimization algorithm, which further improves the compensation effect and ensures the robustness and accuracy of the model when processing complex gas sensor data. By processing and dynamically updating the pseudo-labels of the target domain data, the method of the present invention can continuously iterate and optimize the accuracy of the pseudo-labels, thereby improving the classification and recognition capabilities of the target domain data.
[0019] In general, the present invention provides an effective solution to the baseline drift problem of gas sensors, which is not only applicable to single sensors, but also to gas sensor array data, such as metal oxide semiconductor gas sensor arrays. The application of this method will help improve the detection accuracy and stability of gas sensors in the fields of environmental monitoring, industrial safety and medical treatment, and has broad application prospects and important practical value. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.
[0021] Figure 1 The figure is a flow chart of an adaptive compensation method based on gas sensor baseline drift according to the present invention. DETAILED DESCRIPTION
[0022] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0023] See also Figure 1 , an adaptive compensation method based on gas sensor baseline drift, comprising: obtaining a sensor data set without drift and a sensor data set with drift, and constructing corresponding source domains and target domains; by establishing a distribution adaptation model between the source domain and the target domain, using a balanced distribution adaptation model to adjust the weight balance factor of the marginal distribution and conditional distribution between the source domain and the target domain; the source domain is a sensor data set without drift, and the target domain is a sensor data set with drift; quantifying the distribution difference between the source domain and the target domain by the maximum mean difference, and minimizing the distribution difference by optimizing the weight balance factor.
[0024] Specifically, the value range of the weight balancing factor is [0, 1], and the specific expression is: when the weight balancing factor is close to 0, it means that the difference between the source domain and the target domain is large, and the adjustment of the marginal distribution is more important; when the weight balancing factor is close to 1, it means that the data similarity between the two domains is high, and the adjustment of the conditional distribution is more important.
[0025] Specifically, the weight balance factor is optimized by a particle swarm optimization method to obtain the best drift compensation effect. The particle swarm is initialized, the fitness value of each particle is calculated, and the position and speed of the particle are iteratively optimized to finally find the optimal weight balance factor.
[0026] Specifically, the distribution adaptation model processing step includes: S401: normalizing the data of the source domain and the target domain to eliminate the influence of different feature value ranges on the distance calculation; S402: extracting features from the normalized data, and minimizing the distribution difference between the source domain and the target domain by adjusting the weight balancing factor; S403: Optimizing the weight balance factor using a particle swarm optimization algorithm to obtain the best drift compensation effect; S404: Use the optimized weight balancing factor to train the distribution adaptation model to achieve accurate classification and recognition of target domain data.
[0027] Specifically, the distribution adaptation model adjusts the distribution difference between the source domain and the target domain by minimizing the objective function, and the objective function expression is: , Among them, Ds and Dt represent the data distribution of the source domain and the target domain, and represent the samples in the source domain and the target domain, respectively. n and m represent the number of samples in the source domain and the target domain, respectively. C represents the total number of categories. nc and mc represent the number of samples belonging to category c in the source domain and the target domain, respectively. ‖•‖H represents the norm of the reproducing kernel Hilbert space.
[0028] Specifically, the particle swarm optimization method comprises the following steps: Initialize the particle swarm, including the position and velocity of the particles; Calculating the fitness value of each particle, where the fitness value is measured by the classification accuracy of the distribution adaptation model; Update the position and velocity of each particle, and perform iterative optimization based on the individual optimal solution and the global optimal solution; Repeat the above steps until the preset number of iterations is reached or the fitness value converges, and finally the optimal weight balance factor is obtained.
[0029] Specifically, the distribution adaptation model also includes pseudo-label processing of the target domain data by training a nearest neighbor classifier on the source domain data and using the nearest neighbor classifier to generate pseudo-labels for the target domain data so as to calculate the conditional probability distribution of the target domain data.
[0030] Specifically, the distribution adaptation model also includes a process of dynamically updating pseudo labels, and optimizing the accuracy of pseudo labels through multiple iterations.
[0031] Specifically, the distribution adaptation model is applicable to gas sensor array data, including metal oxide semiconductor gas sensor arrays.
[0032] Specifically, the sensor data set is data after fault detection and isolation, and fault isolation and data recovery are performed on abnormal signals in the sensor data through data reconstruction and confidence interval prediction methods.
[0033] In this embodiment, a MOS gas sensor array is used to collect gas response data under different environments, including data under normal working conditions and data after drift. The collected data is normalized to eliminate the influence of different eigenvalue ranges on distance calculation. The data under normal working conditions is used as the source domain, and the data after drift is used as the target domain.
[0034] Initialize the particle swarm, including the position and velocity of the particles. The position of each particle represents a possible value of the weight balance factor, and the initial position is randomly generated.
[0035] For the weight balancing factor (μ) of each particle, the distribution difference between the source domain and the target domain is calculated using the distribution adaptation model, and the classification accuracy of the model on the target domain is evaluated.
[0036] The fitness function is defined as: , Among them, Fit(μ) represents the fitness corresponding to the weight balance factor of each particle, C is the classification accuracy, and D t represents the target domain data distribution, C(D t , μ) represents the classification accuracy of the distribution adaptation model trained with the weight balancing factor μ on the target domain data. The higher the fitness value, the more effectively the weight balancing factor can reduce the distribution difference between the source domain and the target domain, and improve the classification performance of the model.
[0037] Use the PSO algorithm to update the position and velocity of each particle: , , Among them, V id is the velocity of the ith particle in the dth dimension, Xid is the position of the ith particle in the dth dimension, ω is the inertia factor, which controls the weight of the particle to maintain its original speed, C1 and C2 are learning factors, which control the speed at which the particle moves to the individual optimal solution and the global optimal solution; P id is the individual optimal solution of the ith particle in the dth dimension, P gd is the global optimal solution. rand(0,1) is a random number between 0 and 1, which is used to introduce randomness to avoid falling into the local optimal solution.
[0038] Update the individual optimal solution and the global optimal solution: Each particle records the position with the highest fitness value in each iteration, that is, the individual optimal solution P id Among all particles, the position with the highest fitness value is selected as the global optimal solution P gd The fitness value is calculated and the particle position and velocity are updated repeatedly until the preset number of iterations is reached or the fitness value converges. In each iteration, the particle position and velocity are continuously updated, the fitness value is continuously optimized, and finally the optimal weight balance factor is found.
[0039] In each iteration, the position and velocity of the particle are continuously updated, and the fitness value is continuously optimized, and finally the optimal weight balance factor is found.
[0040] After multiple iterations, the PSO algorithm converges to an optimal weight balance factor (μ), which can minimize the distribution difference between the source domain and the target domain and improve the classification accuracy of the model.
[0041] The distribution adaptation model is trained using the optimized weight balancing factor to achieve accurate classification and recognition of the target domain data. The model improves the accuracy of gas recognition by minimizing the distribution difference between the source domain and the target domain, and has good robustness.
[0042] Dynamic drift compensation is performed on sensor data, the baseline response in the current environment is updated through a dynamic baseline matrix, and differential processing is performed on the current data to compensate for baseline drift.
[0043] The PCA-SPE model is used to detect abnormal signals in sensor data, and fault isolation and data recovery are performed through data reconstruction and confidence interval prediction methods to ensure the accuracy and reliability of sensor data.
[0044] A public gas sensor drift dataset is used for validation and the performance of different methods is compared, including the distribution adaptation method, the joint distribution adaptation (JDA) method, and the k-nearest neighbor (kNN) method.
[0045] Experimental results show that the proposed method is significantly superior to the JDA and KNN methods in classification accuracy.
[0046] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
[0047] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0048] The program code included on the computer readable medium can be transmitted with any appropriate medium, including but not limited to wireless, electric wire, optical cable, RF, etc., or any suitable combination of the above. The computer program code for performing the operation of the present invention can be written in one or more programming languages or their combinations, and the programming language includes object-oriented programming languages-such as Java, Smalltalk, C++, and also includes conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0049] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. An adaptive compensation method based on gas sensor baseline drift, characterized in that: include: Obtain sensor data sets without drift and sensor data sets with drift, and construct corresponding source domains and target domains; A distribution adaptation model between the source domain and the target domain is established, and the weight balance factor of the marginal distribution and conditional distribution between the source domain and the target domain is adjusted by using the balanced distribution adaptation model; the source domain is a sensor data set without drift, and the target domain is a sensor data set with drift; the distribution difference between the source domain and the target domain is quantified by the maximum mean difference, and the distribution difference is minimized by optimizing the weight balance factor.
2. The method according to claim 1, characterized in that The value range of the weight balancing factor is [0, 1]. Specifically, when the weight balancing factor is close to 0, it means that the difference between the source domain and the target domain is large, and the adjustment of the marginal distribution is more important; when the weight balancing factor is close to 1, it means that the data similarity between the two domains is high, and the adjustment of the conditional distribution is more important.
3. The method according to claim 1, characterized in that: The weight balance factor is optimized by a particle swarm optimization method to obtain the best drift compensation effect. The particle swarm is initialized, the fitness value of each particle is calculated, and the position and speed of the particle are iteratively optimized to finally find the optimal weight balance factor.
4. The method according to claim 1, characterized in that The processing steps of the distribution adaptation model include: S401: normalizing the data of the source domain and the target domain to eliminate the influence of different feature value ranges on the distance calculation; S402: extracting features from the normalized data, and minimizing the distribution difference between the source domain and the target domain by adjusting the weight balancing factor; S403: Optimizing the weight balance factor using a particle swarm optimization algorithm to obtain the best drift compensation effect; S404: Use the optimized weight balancing factor to train the distribution adaptation model to achieve accurate classification and recognition of target domain data.
5. The method according to claim 4, characterized in that The distribution adaptation model adjusts the distribution difference between the source domain and the target domain by minimizing the objective function, and the objective function expression is: , Among them, D s and D t Represent the data distribution of the source domain and the target domain respectively, and Represent the samples in the source domain and the target domain respectively, n and m represent the number of samples in the source domain and the target domain respectively, C represents the total number of categories, n c and m c denotes the number of samples belonging to category c in the source domain and the target domain, respectively, ‖•‖ H represents the norm of the reproducing kernel Hilbert space.
6. The method according to claim 4, characterized in that The particle swarm optimization method comprises the following steps: S601: Initialize the particle swarm, including the position and velocity of the particles; S602: Calculate the fitness value of each particle, where the fitness value is measured by the classification accuracy of the distribution adaptation model; S603: Update the position and velocity of each particle, and perform iterative optimization based on the individual optimal solution and the global optimal solution; S604: Repeat S602-S603 until a preset number of iterations is reached or the fitness value converges, and finally the optimal weight balance factor is obtained.
7. The method according to claim 1, characterized in that The distribution adaptation model also includes pseudo-label processing of the target domain data by training a nearest neighbor classifier on the source domain data and using the nearest neighbor classifier to generate pseudo-labels for the target domain data so as to calculate the conditional probability distribution of the target domain data.
8. The method according to claim 1, characterized in that: The distribution adaptation model also includes a process of dynamically updating pseudo labels to optimize the accuracy of pseudo labels through multiple iterations.
9. The method according to claim 1, characterized in that: The distribution adaptation model is applicable to gas sensor array data, including metal oxide semiconductor gas sensor arrays.
10. The method according to claim 1, characterized in that The sensor data set is data after fault detection and isolation. Fault isolation and data recovery are performed on abnormal signals in the sensor data through data reconstruction and confidence interval prediction methods.
Citation Information
Patent Citations
Baseline shift adaptive compensation detecting method used for combustible gas detector
CN101482531A
Gas detection method based on self-adaption of semi-supervised domain
CN103412003A
Gas sensor system with resistance to temperature and baseline drift and using method thereof
CN109444225A
Gas sensor drift compensation method
CN113030197A
Gas sensor drift compensation method based on subspace learning and cross-domain adaptive extreme learning machine
CN114925762A
Cited By
Cross-device gas recognition method and device based on feature decoupling and multi-source domain adaptation
CN121705848A