Limit learning machine based joint domain adaption gas sensor drift compensation method
Patent Information
- Application Number
- CN202411380471.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2044-09-30
AI Technical Summary
而这些伪标签通常是不准确的,这会影响模型的训练,这使得模型更容易记忆数据而不是理解数据
[0078] Where, β T It is the transpose of the characteristic projection matrix β.
Smart Images

Figure CN119089291B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic nose signal processing, and more specifically, to a joint domain adaptive gas sensor drift compensation method based on extreme learning machine. Background Technology
[0002] Drift, a persistent bottleneck in electronic nose applications, has been a major obstacle to their development. Because electronic nose drift is influenced by various factors, including sensor aging, early usage conditions, and environmental influences, it is difficult to measure directly. In general, drift causes inconsistencies in sensor distribution. Domain-adaptive methods, by reducing distribution discrepancies, have mitigated drift and have achieved considerable success in addressing electronic nose drift issues.
[0003] Among domain adaptation methods, the most commonly used are feature matching-based techniques, such as domain-regularized principal component analysis, cross-domain discriminative subspace learning, and local discriminant subspace projection. The purpose of feature adaptation methods is to reduce the distribution differences between different domains by learning a common feature representation.
[0004] Shortcomings of existing technology:
[0005] 1. Most existing domain adaptation methods only minimize marginal distribution differences and do not make full use of the label information of the source domain.
[0006] 2. In methods that consider conditional distribution alignment, pseudo-labels from the target domain are typically used. However, these pseudo-labels are usually inaccurate, which can affect model training, making the model more likely to memorize data rather than understand it. Summary of the Invention
[0007] This invention is a joint domain adaptive gas sensor drift compensation method based on extreme learning machine, which better solves the distribution difference problem to alleviate drift, improves classification accuracy and enhances the robustness of the model.
[0008] To achieve the above objectives, a joint domain adaptive gas sensor drift compensation method based on extreme learning machine is proposed, comprising the following steps:
[0009] S1: Obtain drift-free samples X from the source domain S The target domain has drifting samples X T Source domain label space data Y S ;
[0010] S2: Map the source domain drift-free sample XS to the hidden layer of ELM to obtain the source domain hidden layer data HS;
[0011] The drifting samples XT in the target domain are mapped to the hidden layer of the Extreme Learning Machine (ELM) to obtain the hidden layer data HT of the target domain.
[0012] S3: Apply the feature projection matrix β to the source domain hidden layer data H S Alignment of the feature spaces yields the source domain feature projection space data H. S β;
[0013] The hidden layer data H in the target domain is obtained by using the feature projection matrix β. T Alignment of the feature spaces yields the target domain feature projection space data H. T β;
[0014] Target domain feature projection spatial data H T β is classified by an SVM classifier to obtain the target domain label space data.
[0015] S4: Project the source domain label space data Y using the label projection matrix P. S Align the label space to obtain the source domain label projection space data Y. S P;
[0016] The target domain label space data is obtained through the label projection matrix P. Perform label space alignment to obtain the target domain label projection space data.
[0017] S5: The relationship between the enhanced feature projection space and the label projection space is measured by maximizing the Hilbert-Schmidt Independence Criterion (HSIC);
[0018] S6: Alternately optimize the feature projection matrix β and the label projection matrix P through joint domain adaptation;
[0019] S7: After alternating optimization, the target domain feature projection space data H T β represents the optimal projection data after drift compensation.
[0020] Using ELM nonlinear projection enables broader spatial learning and improves generalization ability; by preserving the drift-free information of the source domain samples and then using projection, the distribution difference between drifted target domain samples and drift-free source domain samples is reduced, thereby improving classification accuracy and enhancing the robustness of the model.
[0021] By aligning source and target domain data in the feature and label spaces, feature-level and label-level domain adaptation is achieved, thus better addressing the distribution discrepancy problem and mitigating drift. Label-level domain adaptation enables the target domain labels to be actively updated, allowing the model to focus on understanding the data rather than memorizing it. Simultaneously, minimizing marginal and conditional distribution discrepancies improves classification accuracy and enhances model robustness. Maximizing the HSIC metric strengthens the dependency between source samples and relevant labels and establishes a relationship between the feature projection space and the label projection space, allowing the model to fully learn both the feature and label spaces without weakening the correspondence between features and labels in the mapping.
[0022] By combining domain adaptation, feature-level and label-level domain adaptation is achieved, thereby better addressing the distribution difference problem and mitigating electronic nose drift.
[0023] Furthermore, the source domain hidden layer data H S =h(X) S )=g(W T X S +b);
[0024] The target domain hidden layer data H T =h(X) T )=g(W T X T +b);
[0025] Where h is the mapping function to the hidden layer of ELM, and W T W represents the hidden layer weights, b represents the hidden layer bias, and g represents the hidden layer activation function. T b is generated randomly.
[0026] X, the source region drift-free sample S The target domain has drifting samples X T Mapping to the hidden layer of ELM, and then operating with the feature projection matrix β, forms the basic ELM framework;
[0027] The constraints for the reconstruction loss of the basic ELM are:
[0028]
[0029] Where st represents the constraint condition. To find the minimum value of the formula after the symbol is given under constraints, β is the value corresponding to β, where β represents the eigenprojection matrix, x i The i-th input data of the basic ELM, y i The i-th output data of the basic ELM, ξ iLet λ represent the training error, λ be the penalty parameter, N be the number of input samples, and h be the mapping function to the hidden layer of the ELM, specifically... W T denoted as , b is the hidden layer weight, and g is the hidden layer bias.
[0030] Furthermore, in steps S2 and S3, the source domain drift-free sample X S After mapping to the hidden layers of ELM and aligning them in the feature space, the constraint condition for its source domain sample reconstruction loss is:
[0031]
[0032] Where st represents the constraint condition. To find the minimum value of the formula after the symbol is given under the constraints, β is the value corresponding to the minimum value, where β represents the characteristic projection matrix. For the i-th source domain drift-free sample, Let λ be the error of the i-th drift-free sample from the source domain before and after feature space mapping and alignment, λ be the penalty parameter, and Ns be the drift-free sample X from the source domain. S The number of elements, where h is the mapping function to the hidden layers of the ELM, specifically... W T denoted as , b is the hidden layer weight, and g is the hidden layer bias.
[0033] The expected output y of the constraint terms in the basic ELM. i Change input data x i s At that time, the output of ELM approximates the input data; by changing the composition and constraints of the basic ELM, dynamic alignment of the feature layer and the label layer can be achieved while preserving the source domain data information, thereby better solving the distribution difference problem and alleviating drift.
[0034] Furthermore, the feature space alignment in step S3 adopts the feature space joint distribution MMD method, which includes feature space marginal distribution MMD and feature space conditional distribution MMD.
[0035] The formula for the marginal distribution of feature space (MMD) is:
[0036]
[0037] in, For the marginal distribution of the characteristic space MMD, N S For source domain drift-free sample X S The number of samples X in the target domain that have drifted. T Quantity, For the i-th source domain drift-free sample, Let A0 be the adaptive matrix under the marginal distribution, tr be the trace of the matrix, and β be the drift sample in the j-th target domain. T H is the transpose of the characteristic projection matrix β, where H = [H S H T ], H T This is the transpose of matrix H;
[0038] h is the mapping function to the hidden layer of ELM, specifically... W T Here, b is the hidden layer weight, g is the hidden layer bias, and g is the hidden layer activation function.
[0039] The formula for the adaptive matrix A0 under the marginal distribution is:
[0040]
[0041] In Formula 4, Ns+Nt is determined as the total number of rows of the adaptive matrix A0 under the marginal distribution, where m is an integer from 1 to Ns+Nt, and Ns+Nt is determined as the total number of columns of the adaptive matrix A0 under the marginal distribution, where n is an integer from 1 to Ns+Nt.
[0042] The formula for the Feature Space Conditional Distribution (MMD) is:
[0043]
[0044] in, For the feature space conditional distribution MMD, c represents the label space category of the target domain, i.e., MMD constraints are performed under the condition of the same category; h i For the i-th source domain hidden layer data belonging to category c, h j For the hidden layer data of the j-th target domain belonging to category c, This represents the source domain hidden layer data belonging to category c. Ns represents the hidden layer data of the target domain belonging to category c. (c) Nt represents the number of source domain samples belonging to category c. (c) Indicates the number of target domain samples belonging to category c; A c The adaptive matrix under the conditional distribution;
[0045] Adaptive matrix A under conditional distribution c The formula is:
[0046]
[0047] In Formula 6, Ns+Nt is determined as the adaptive matrix A under the marginal distribution. cThe total number of rows, where m is an integer from 1 to Ns+Nt, and Ns+Nt is determined as the adaptive matrix A under the marginal distribution. c The total number of columns, where n is an integer from 1 to Ns+Nt;
[0048] For the m-th source domain label space data, For the nth source domain label space data, For the m-Ns-th target domain label space data, The n-Nsth target domain label space data;
[0049] The formula for the joint distribution MMD of the feature space is:
[0050]
[0051] in, For the joint distribution of the feature space MMD, The adaptive matrix under the marginal distribution. Let A be the adaptive matrix under the conditional distribution, and let A be the joint distribution adaptive matrix.
[0052] The formula for the joint distribution fitness matrix A is:
[0053]
[0054] Where c = 0 represents any category.
[0055] By finding an excellent projection, an adaptive discriminant subspace is learned, thereby reducing the domain distribution difference; therefore, MMD is used as a measure of the difference in the distribution of two domains in the projected feature space.
[0056] Simply reducing marginal distribution differences does not guarantee the consistency of data distribution between two domains. However, the joint distribution MMD of this invention not only achieves marginal distribution alignment and reduces marginal distribution differences, but also achieves conditional distribution alignment, further reducing the conditional distribution differences between the two domains. It is more effective in reducing distribution differences and can thus better solve the electronic nose drift problem.
[0057] Furthermore, in step S4, the source domain label space data Y is projected onto the label projection matrix P. S and target domain label space data Tag space alignment is performed using the tag space joint distribution MMD method. The tag space joint distribution MMD formula is as follows:
[0058]
[0059] in, For label space joint distribution MMD, A is the joint distribution fitness matrix, tr is the trace of the matrix, and P T Y is the transpose of the label projection matrix P. T This is the transpose of matrix Y;
[0060] Ns represents the drift-free sample X from the source region. S The number of samples X in the target domain that have drifted. T Quantity, The i-th source domain label space data, The j-th target domain label space data;
[0061] c represents the label space category of the target domain, y i For the i-th source domain label space data belonging to category c, For the j-th target domain label space data belonging to category c, This represents the source domain label space data belonging to category c. Ns represents the target domain label space data belonging to category c. (c) Nt represents the number of source domain samples belonging to category c. (c) This represents the number of target domain samples belonging to category c.
[0062] In feature-level domain adaptation, feature alignment is used to reduce domain distribution differences. However, due to the limitations of the initial classifier performance, the pseudo-labels generated in the target domain in the initial stage are often unreliable. Therefore, pseudo-labels are actively corrected by introducing label space alignment, which aligns the output prediction space and makes the final prediction results more accurate.
[0063] Marginal and conditional distribution alignment are still achieved in the label space. At the same time, the alignment in the label space enables the target domain labels to be actively updated, allowing the model to focus on understanding the data rather than memorizing it. This is an active approach to improve the adaptability of the label space.
[0064] Furthermore, in step S5, the formula for maximizing HSIC is:
[0065]
[0066] in, Represents the central matrix, I Ns Let Ns be the identity matrix. Multiply each element of the identity matrix by Ns represents the drift-free sample X from the source region. S The number of elements, tr is the trace of the matrix, β T Let P be the transpose of the label projection matrix P. T Let P be the transpose of the label projection matrix. For source domain hidden layer data H S transpose, For source domain label space data Y S The transpose of .
[0067] By maximizing the HSIC metric, the relationship between features and labels can be strengthened, enabling the model to learn more effectively.
[0068] Furthermore, in step S6, the joint domain adaptive formula is:
[0069]
[0070] in, Let MMD be the joint distribution of the feature space, and Ns be the drift-free sample X from the source domain. S Quantity, For the i-th drift-free sample X from the source domain S The error before and after feature space mapping alignment. Let MMD be the joint distribution of the label space, where I is the identity matrix, and HSIC(H S β,Y S P) is to maximize HSIC, λ 1, λ 2, λ 3, λ 4, λ5 represents the scaling factor of the regularization term, where the fifth term is the regularization term that controls the distortion of the output space during the projection process.
[0071] Joint domain adaptation simultaneously achieves marginal and conditional distribution alignment in the feature space, marginal and conditional distribution alignment in the label space, and maximizes HSIC. It also includes data reconstruction loss constraints and joint constraints of the feature projection matrix β and the label projection matrix P, which can minimize the distribution difference between the source and target domains and reduce the drift of the electronic nose.
[0072] Furthermore, in step S6, the joint domain adaptation adopts an alternating optimization strategy, that is, fixing other free variables to optimize a single variable, and optimizing the feature projection matrix β and the label projection matrix P.
[0073] The formula for the feature projection matrix β is:
[0074]
[0075] in, Ns represents the drift-free sample X from the source region. S The number of drift samples X in the target domain, Nt. T The quantity, H = [H S H T ], H TLet H be the transpose of matrix H, A be the joint distribution fitness matrix, and I be the identity matrix. For source domain hidden layer data H S The transpose of Q S Represents the central matrix, P T Let P be the transpose of the label projection matrix. For source domain label space data Y S transpose;
[0076] The formula for the label projection matrix P is:
[0077]
[0078] Where, β T It is the transpose of the characteristic projection matrix β.
[0079] By substituting the constraint terms into the objective function, the optimization problem is transformed into an unconstrained form, and the formulas for the feature projection matrix β and the label projection matrix P are finally obtained. An alternating optimization strategy is adopted to optimize the feature projection matrix β and the label projection matrix P, thereby achieving joint domain adaptation.
[0080] The benefits of this invention are as follows: By aligning source and target domain data in the feature and label spaces, feature-level and label-level domain adaptation is achieved, thereby better addressing the distribution difference problem and mitigating drift; label-level domain adaptation enables the target domain labels to be actively updated, allowing the model to focus on understanding the data rather than memorizing it; simultaneously, minimizing marginal and conditional distribution differences improves classification accuracy and enhances model robustness; maximizing the HSIC metric strengthens the dependency between source samples and relevant labels and establishes a relationship between the feature projection space and the label projection space, allowing the model to fully learn both the feature and label spaces without weakening the correspondence between features and labels in the mapping. Attached Figure Description
[0081] Figure 1 This is a schematic diagram of the principle of the present invention. Detailed Implementation
[0082] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments:
[0083] Example 1
[0084] like Figure 1 As shown, the joint domain adaptive gas sensor drift compensation method based on extreme learning machine includes the following steps:
[0085] S1: Obtain source domain drift-free samples X of reliable gas samples. SAnd a target gas sample with reference value, the target domain has a drift sample X T Source domain label space data Y S As the initial training foundation for the gas sensor, subsequent training directly uses the actual gas data collected by the gas sensor as the target domain for drifting samples X. T Conduct training.
[0086] S2: Transfer the drift-free sample X from the source domain S The target domain has drifting samples X T Mapping to the hidden layers of ELM, we obtain the source domain hidden layer data H. S and target domain hidden layer data H T ;
[0087] S3: Apply the feature projection matrix β to the source domain hidden layer data H S and target domain hidden layer data H T Alignment of the feature spaces yields source domain feature projection space data H. S β and target domain feature projection space data H T β, Target domain feature projection space data H T β is classified by an SVM classifier to obtain the target domain label space data.
[0088] Joint adaptation aims to obtain optimal projection data, thereby better training the SVM classifier to achieve higher accuracy. This invention does not change the classification principle of the SVM classifier. SVM is a mature and common classifier.
[0089] S4: Project the source domain label space data Y using the label projection matrix P. S and target domain label space data Align the label spaces to obtain the source domain label projection space data Y. S P and target domain label projection space data
[0090] S5: Measuring the relationship between the enhanced feature projection space and the label projection space by maximizing HSIC;
[0091] S6: The feature projection matrix β and the label projection matrix P are alternately optimized through joint domain adaptation to optimize the five penalty parameters λ1, λ2, λ3, λ4, and λ5 in the final optimization expression;
[0092] S7: After alternating optimization, the target domain feature projection space data H T β represents the optimal projection data after drift compensation.
[0093] Using ELM nonlinear projection enables broader spatial learning and improves generalization ability; by preserving the drift-free information of the source domain samples and then using projection, the distribution difference between drifted target domain samples and drift-free source domain samples is reduced, thereby improving classification accuracy and enhancing the robustness of the model.
[0094] By aligning source and target domain data in the feature and label spaces, feature-level and label-level domain adaptation is achieved, thus better addressing the distribution discrepancy problem and mitigating drift. Label-level domain adaptation enables the target domain labels to be actively updated, allowing the model to focus on understanding the data rather than memorizing it. Simultaneously, minimizing marginal and conditional distribution discrepancies improves classification accuracy and enhances model robustness. Maximizing the HSIC metric strengthens the dependency between source samples and relevant labels and establishes a relationship between the feature projection space and the label projection space, allowing the model to fully learn both the feature and label spaces without weakening the correspondence between features and labels in the mapping.
[0095] By combining domain adaptation, feature-level and label-level domain adaptation is achieved, thereby better addressing the distribution difference problem and mitigating electronic nose drift.
[0096] Furthermore, the source domain hidden layer data H S =h(X) S )=g(W T X S +b);
[0097] The target domain hidden layer data H T =h(X) T )=g(W T X T +b);
[0098] Where h is the mapping function to the hidden layer of ELM, and W T W represents the hidden layer weights, b represents the hidden layer bias, and g represents the hidden layer activation function. T b is generated randomly.
[0099] X, the source region drift-free sample S The target domain has drifting samples X T Mapping to the hidden layer of ELM, and then operating with the feature projection matrix β, forms the basic ELM framework;
[0100] The constraints for the reconstruction loss of the basic ELM are:
[0101]
[0102] Where st represents the constraint condition. To find the minimum value of the formula after the symbol is given under constraints, β is the value corresponding to β, where β represents the eigenprojection matrix, x i The i-th input data of the basic ELM, y i The i-th output data of the basic ELM, ξ i Let λ represent the training error, λ be the penalty parameter, N be the number of input samples, and h be the mapping function to the hidden layer of the ELM, specifically... W T denoted as , b is the hidden layer weight, and g is the hidden layer bias.
[0103] Furthermore, in steps S2 and S3, the source domain drift-free sample X S After mapping to the hidden layers of ELM and aligning them in the feature space, the constraint condition for its source domain sample reconstruction loss is:
[0104]
[0105] Where st represents the constraint condition. To find the minimum value of the formula after the symbol is given under the constraints, β is the value corresponding to the minimum value, where β represents the characteristic projection matrix. For the i-th source domain drift-free sample, Let λ be the error of the i-th drift-free sample from the source domain before and after feature space mapping and alignment, λ be the penalty parameter, and Ns be the drift-free sample X from the source domain. S The number of elements, where h is the mapping function to the hidden layers of the ELM, specifically... W T denoted as , b is the hidden layer weight, and g is the hidden layer bias.
[0106] The expected output y of the constraint terms in the basic ELM. i Change input data x i s At that time, the output of ELM approximates the input data; by changing the composition and constraints of the basic ELM, dynamic alignment of the feature layer and the label layer can be achieved while preserving the source domain data information, thereby better solving the distribution difference problem and alleviating drift.
[0107] Furthermore, the feature space alignment in step S3 adopts the feature space joint distribution MMD method, which includes feature space marginal distribution MMD and feature space conditional distribution MMD.
[0108] The formula for the marginal distribution of feature space (MMD) is:
[0109]
[0110] in, For the marginal distribution of the characteristic space MMD, N S For source domain drift-free sample X S The number of samples X in the target domain that have drifted. T Quantity, For the i-th source domain drift-free sample, Let A0 be the adaptive matrix under the marginal distribution, tr be the trace of the matrix, and β be the drift sample in the j-th target domain. T H is the transpose of the characteristic projection matrix β, where H = [H S H T ], H T This is the transpose of matrix H;
[0111] h is the mapping function to the hidden layer of ELM, specifically... W T Here, b is the hidden layer weight, g is the hidden layer bias, and g is the hidden layer activation function.
[0112] The formula for the adaptive matrix A0 under the marginal distribution is:
[0113]
[0114] In Formula 4, Ns+Nt is determined as the total number of rows of the adaptive matrix A0 under the marginal distribution, where m is an integer from 1 to Ns+Nt, and Ns+Nt is determined as the total number of columns of the adaptive matrix A0 under the marginal distribution, where n is an integer from 1 to Ns+Nt.
[0115] The formula for the Feature Space Conditional Distribution (MMD) is:
[0116]
[0117] in, For the feature space conditional distribution MMD, c represents the label space category of the target domain, i.e., MMD constraints are performed under the condition of the same category; h i For the i-th source domain hidden layer data belonging to category c, h j For the hidden layer data of the j-th target domain belonging to category c, This represents the source domain hidden layer data belonging to category c. Ns represents the hidden layer data of the target domain belonging to category c. (c) Nt represents the number of source domain samples belonging to category c. (c) Indicates the number of target domain samples belonging to category c; A c The adaptive matrix under the conditional distribution;
[0118] Adaptive matrix A under conditional distribution c The formula is:
[0119]
[0120] In Formula 6, Ns+Nt is determined as the adaptive matrix A under the marginal distribution. c The total number of rows, where m is an integer from 1 to Ns+Nt, and Ns+Nt is determined as the adaptive matrix A under the marginal distribution. c The total number of columns, where n is an integer from 1 to Ns+Nt;
[0121] For the m-th source domain label space data, For the nth source domain label space data, For the m-Ns-th target domain label space data, The n-Nsth target domain label space data;
[0122] The formula for the joint distribution MMD of the feature space is:
[0123]
[0124] in, For the joint distribution of the feature space MMD, The adaptive matrix under the marginal distribution. Let A be the adaptive matrix under the conditional distribution, and let A be the joint distribution adaptive matrix.
[0125] The formula for the joint distribution fitness matrix A is:
[0126]
[0127] Where c = 0 represents any category.
[0128] By finding an excellent projection, an adaptive discriminant subspace is learned, thereby reducing the domain distribution difference; therefore, MMD is used as a measure of the difference in the distribution of two domains in the projected feature space.
[0129] Simply reducing marginal distribution differences does not guarantee the consistency of data distribution between two domains. Joint distribution MMD not only achieves marginal distribution alignment and reduces marginal distribution differences, but also achieves conditional distribution alignment, further reducing the conditional distribution differences between the two domains. It is more effective in reducing distribution differences and can thus better solve the electronic nose drift problem.
[0130] Furthermore, in step S4, the source domain label space data Y is projected onto the label projection matrix P. S and target domain label space data Tag space alignment is performed using the tag space joint distribution MMD method. The tag space joint distribution MMD formula is as follows:
[0131]
[0132] in, For label space joint distribution MMD, A is the joint distribution fitness matrix, tr is the trace of the matrix, and P T Y is the transpose of the label projection matrix P. T This is the transpose of matrix Y;
[0133] Ns represents the drift-free sample X from the source region. S The number of samples X in the target domain that have drifted. T Quantity, The i-th source domain label space data, The j-th target domain label space data;
[0134] c represents the label space category of the target domain, y i For the i-th source domain label space data belonging to category c, For the j-th target domain label space data belonging to category c, This represents the source domain label space data belonging to category c. Ns represents the target domain label space data belonging to category c. (c) Nt represents the number of source domain samples belonging to category c. (c) This represents the number of target domain samples belonging to category c.
[0135] In feature-level domain adaptation, feature alignment is used to reduce domain distribution differences. However, due to the limitations of the initial classifier performance, the pseudo-labels generated in the target domain in the initial stage are often unreliable. Therefore, pseudo-labels are actively corrected by introducing label space alignment, which aligns the output prediction space and makes the final prediction results more accurate.
[0136] Marginal and conditional distribution alignment are still achieved in the label space. At the same time, the alignment in the label space enables the target domain labels to be actively updated, allowing the model to focus on understanding the data rather than memorizing it. This is an active approach to improve the adaptability of the label space.
[0137] Furthermore, in step S5, the formula for maximizing HSIC is:
[0138]
[0139] in, Represents the central matrix, I Ns Let Ns be the identity matrix. Multiply each element of the identity matrix by Ns represents the drift-free sample X from the source region. S The number of elements, tr is the trace of the matrix, β T Let P be the transpose of the label projection matrix P. T Let P be the transpose of the label projection matrix. For source domain hidden layer data H S transpose, For source domain label space data Y S The transpose of .
[0140] By maximizing the HSIC metric, the relationship between features and labels can be strengthened, enabling the model to learn more effectively.
[0141] Furthermore, in step S6, the joint domain adaptive formula is:
[0142]
[0143] in, Let MMD be the joint distribution of the feature space, and Ns be the drift-free sample X from the source domain. S Quantity, For the i-th drift-free sample X from the source domain S The error before and after feature space mapping alignment. Let MMD be the joint distribution of the label space, where I is the identity matrix, and HSIC(H S β,Y S P) is to maximize HSIC, where λ1, λ2, λ3, λ4, and λ5 represent the scaling factors of the regularization terms. The fifth term is a regularization term that controls the distortion of the output space during the projection process.
[0144] Joint domain adaptation simultaneously achieves marginal and conditional distribution alignment in the feature space, marginal and conditional distribution alignment in the label space, and maximizes HSIC. It also includes data reconstruction loss constraints and joint constraints of the feature projection matrix β and the label projection matrix P, which can minimize the distribution difference between the source and target domains and reduce the drift of the electronic nose.
[0145] In step S6, the joint domain adaptation adopts an alternating optimization strategy, that is, fixing other free variables to optimize a single variable, and optimizing the feature projection matrix β and the label projection matrix P.
[0146] The derivation formulas for the feature projection matrix β and the label projection matrix P are as follows:
[0147] First, by substituting the constraint terms into the objective function, the above optimization problem is transformed into an unconstrained form:
[0148]
[0149] For ease of derivation, let Meanwhile, substituting formulas (7), (9), and (10) into formula (12) yields formula (13):
[0150]
[0151] First, fix P = I to optimize β, then we can obtain the formula:
[0152]
[0153] Based on the properties of trace operation, formula (15) holds true:
[0154]
[0155] Substituting into formula (14), taking the partial derivative of β with respect to formula (14) and setting it to 0, we get:
[0156]
[0157] The solution to equation (16) yields the characteristic projection matrix β:
[0158]
[0159] in, Ns represents the drift-free sample X from the source region. S The number of drift samples X in the target domain, Nt. T The quantity, H = [H S H T ], H T Let H be the transpose of matrix H, A be the joint distribution fitness matrix, and I be the identity matrix. For source domain hidden layer data H S The transpose of Q S Represents the central matrix, P T Let P be the transpose of the label projection matrix. For source domain label space data Y S transpose;
[0160] Subsequently, fixing the value of β obtained from formula (17), we calculate the partial derivative of formula (13) with respect to P and set it to 0, thus obtaining:
[0161]
[0162] The solution to formula (18) yields the label projection matrix P:
[0163]
[0164] Wherein, βT It is the transpose of the characteristic projection matrix β.
[0165] The feature projection matrix β and the label projection matrix P are jointly learned. By substituting the constraint terms into the objective function, the optimization problem is transformed into an unconstrained form, and the formulas for the feature projection matrix β and the label projection matrix P are finally obtained. An alternating optimization strategy is adopted, that is, fixing other free variables to optimize a single variable, and optimizing the feature projection matrix β and the label projection matrix P, thereby achieving joint domain adaptation.
[0166] Specific experimental verification:
[0167] 1. UCSD Benchmark Sensor Drift Dataset
[0168] Based on a sensor drift dataset collected by Vergara over three years—between January 2008 and February 2011—the data was collected via a gas platform. These records were sampled using an electronic nose system with a 16MOS gas sensor array exposed to six gases, including varying concentrations of ammonia, acetaldehyde, acetone, ethylene, ethanol, and toluene. Eight features were extracted for each sensor, resulting in a 128-dimensional feature vector for each sample. The data is divided into 10 batches based on time, as detailed in the table below.
[0169]
[0170]
[0171] 2. Results of the UCSD benchmark sensor drift dataset
[0172] There are two settings:
[0173] 1) Fixed batch 1 as the source domain, K as the target domain (K = 2, 3, ..., 10);
[0174] 2) Train sequentially on batch K-1 and test on batch K (K = 2, 3, ..., 10). The training results for setting 1 are as follows:
[0175]
[0176]
[0177] The training results for setting 2 are as follows:
[0178]
[0179]
[0180] The results obtained by JDAELM are based on the joint domain adaptive gas sensor drift compensation method of extreme learning machine. The average accuracy of setting 1 is 88.30 and the average accuracy of setting 2 is 87.21. Compared with other methods, the average accuracy is better, which can better solve the distribution difference problem to alleviate drift, improve classification accuracy and enhance the robustness of the model.
[0181] The main principles of this invention are as follows: By aligning source and target domain data in the feature and label spaces, feature-level and label-level domain adaptation is achieved, thereby better addressing the distribution difference problem and mitigating drift. Label-level domain adaptation enables the target domain labels to be actively updated, allowing the model to focus on understanding the data rather than memorizing it. Simultaneously, minimizing marginal and conditional distribution differences improves classification accuracy and enhances model robustness. Maximizing the HSIC index strengthens the dependency between source samples and relevant labels and establishes a relationship between the feature projection space and the label projection space, allowing the model to fully learn both the feature and label spaces without weakening the correspondence between features and labels in the mapping.
[0182] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention. Those skilled in the art, under the guidance of the present invention, can make various similar representations without departing from the spirit and claims of the present invention, and such modifications all fall within the protection scope of the present invention.
Claims
1. A joint domain adaptive gas sensor drift compensation method based on extreme learning machine, characterized in that: Includes the following steps: S1: Obtain drift-free samples X from the source domain S The target domain has drifting samples X T Source domain label space data Y S ; S2: Transfer the drift-free sample X from the source domain S Mapping to the hidden layer of ELM, we obtain the source domain hidden layer data H. S ; The target domain has drifting samples X T Mapping to the hidden layer of ELM, we obtain the hidden layer data H of the target domain. T ; S3: Apply the feature projection matrix β to the source domain hidden layer data H S Alignment of the feature spaces yields the source domain feature projection space data H. S β; The hidden layer data H in the target domain is obtained by using the feature projection matrix β. T Alignment of the feature spaces yields the target domain feature projection space data H. T β; Target domain feature projection spatial data H T β is classified by an SVM classifier to obtain the target domain label space data. S4: Project the source domain label space data Y using the label projection matrix P. S Align the label space to obtain the source domain label projection space data Y. S P; The target domain label space data is obtained through the label projection matrix P. Perform label space alignment to obtain the target domain label projection space data. S5: Measuring the relationship between the enhanced feature projection space and the label projection space by maximizing HSIC; S6: Alternately optimize the feature projection matrix β and the label projection matrix P through joint domain adaptation; S7: After alternating optimization, the target domain feature projection space data H T β represents the optimal projection data after drift compensation.
2. The joint domain adaptive gas sensor drift compensation method based on extreme learning machine according to claim 1, characterized in that, In step S2: The source domain hidden layer data H S =h(X) S )=g(W T X S +b); The target domain hidden layer data H T =h(X) T )=g(W T X T +b); Where h is the mapping function to the hidden layer of ELM, and W T W represents the hidden layer weights, b represents the hidden layer bias, and g represents the hidden layer activation function. T b is generated randomly.
3. The joint domain adaptive gas sensor drift compensation method based on extreme learning machine according to claim 1, characterized in that: In steps S2 and S3, the source domain drift-free sample X S After mapping to the hidden layer of ELM and aligning the feature space, the constraint condition for its source domain sample reconstruction loss is: Where st represents the constraint condition. To find the minimum value of the formula after the symbol is given under the constraints, β is the value corresponding to the minimum value, where β represents the characteristic projection matrix. For the i-th source domain drift-free sample, Let λ be the error of the i-th drift-free sample from the source domain before and after feature space mapping and alignment, λ be the penalty parameter, and Ns be the drift-free sample X from the source domain. S The number of elements, where h is the mapping function to the hidden layers of the ELM, specifically... W T denoted as , b is the hidden layer weight, and g is the hidden layer bias.
4. The joint domain adaptive gas sensor drift compensation method based on extreme learning machine according to claim 1, characterized in that, In step S3: The alignment of the feature space is achieved using the joint feature space distribution MMD method, which includes feature space marginal distribution MMD and feature space conditional distribution MMD. The formula for the marginal distribution of feature space (MMD) is: in, For the marginal distribution of the characteristic space MMD, N S For source domain drift-free sample X S The number of samples X in the target domain that have drifted. T Quantity, For the i-th source domain drift-free sample, Let A0 be the adaptive matrix under the marginal distribution, tr be the trace of the matrix, and β be the drift sample in the j-th target domain. T H is the transpose of the characteristic projection matrix β, where H = [H S H T ], H T This is the transpose of matrix H; h is the mapping function to the hidden layer of ELM, specifically... W T Here, b is the hidden layer weight, g is the hidden layer bias, and g is the hidden layer activation function. The formula for the adaptive matrix A0 under the marginal distribution is: In Formula 4, Ns+Nt is determined as the total number of rows of the adaptive matrix A0 under the marginal distribution, where m is an integer from 1 to Ns+Nt, and Ns+Nt is determined as the total number of columns of the adaptive matrix A0 under the marginal distribution, where n is an integer from 1 to Ns+Nt. The formula for the Feature Space Conditional Distribution (MMD) is: in, For the feature space conditional distribution MMD, c represents the label space category of the target domain, i.e., MMD constraints are performed under the condition of the same category; h i For the i-th source domain hidden layer data belonging to category c, h j For the hidden layer data of the j-th target domain belonging to category c, This represents the source domain hidden layer data belonging to category c. Ns represents the hidden layer data of the target domain belonging to category c. (c) Nt represents the number of source domain samples belonging to category c. (c) Indicates the number of target domain samples belonging to category c; A c The adaptive matrix under the conditional distribution; Adaptive matrix A under conditional distribution c The formula is: In Formula 6, Ns+Nt is determined as the adaptive matrix A under the marginal distribution. c The total number of rows, where m is an integer from 1 to Ns+Nt, and Ns+Nt is determined as the adaptive matrix A under the marginal distribution. c The total number of columns, where n is an integer from 1 to Ns+Nt; For the m-th source domain label space data, For the nth source domain label space data, For the m-Ns-th target domain label space data, The n-Nsth target domain label space data; The formula for the joint distribution MMD of the feature space is: in, For the joint distribution of the feature space MMD, The adaptive matrix under the marginal distribution. Let A be the adaptive matrix under the conditional distribution, and let A be the joint distribution adaptive matrix. The formula for the joint distribution fitness matrix A is: Where c = 0 represents any category.
5. The joint domain adaptive gas sensor drift compensation method based on extreme learning machine according to claim 1, characterized in that: In step S4, the source domain label space data Y is projected onto the label projection matrix P. S and target domain label space data Tag space alignment is performed using the tag space joint distribution MMD method. The tag space joint distribution MMD formula is as follows: in, For label space joint distribution MMD, A is the joint distribution fitness matrix, tr is the trace of the matrix, and P T Y is the transpose of the label projection matrix P. T This is the transpose of matrix Y; Ns represents the drift-free sample X from the source region. S The number of samples X in the target domain that have drifted. T Quantity, The i-th source domain label space data, The j-th target domain label space data; c represents the label space category of the target domain, y i For the i-th source domain label space data belonging to category c, For the j-th target domain label space data belonging to category c, This represents the source domain label space data belonging to category c. Ns represents the target domain label space data belonging to category c. (c) Nt represents the number of source domain samples belonging to category c. (c) This represents the number of target domain samples belonging to category c.
6. The joint domain adaptive gas sensor drift compensation method based on extreme learning machine according to claim 1, characterized in that: In step S5, the formula for maximizing HSIC is: in, Represents the central matrix, I Ns Let Ns be the identity matrix. Multiply each element of the identity matrix by Ns represents the drift-free sample X from the source region. S The number of elements, tr is the trace of the matrix, β T Let P be the transpose of the label projection matrix P. T Let P be the transpose of the label projection matrix. For source domain hidden layer data H S transpose, For source domain label space data Y S The transpose of .
7. The joint domain adaptive gas sensor drift compensation method based on extreme learning machine according to claim 2, characterized in that: In step S6, the joint domain adaptive formula is: in, Let MMD be the joint distribution of the feature space, and Ns be the drift-free sample X from the source domain. S Quantity, For the i-th drift-free sample X from the source domain S The error before and after feature space mapping alignment. Let MMD be the joint distribution of the label space, where I is the identity matrix, and HSIC(H S β,Y S P) is to maximize HSIC, where λ1, λ2, λ3, λ4, and λ5 represent the scaling factors of the regularization terms. The fifth term is a regularization term that controls the distortion of the output space during the projection process.
8. The joint domain adaptive gas sensor drift compensation method based on extreme learning machine according to claim 7, characterized in that: In step S6, the joint domain adaptation adopts an alternating optimization strategy, that is, fixing other free variables to optimize a single variable, and optimizing the feature projection matrix β and the label projection matrix P. The formula for the feature projection matrix β is: in, Ns represents the drift-free sample X from the source region. S The number of drift samples X in the target domain, Nt. T The quantity, H = [H S H T ], H T Let H be the transpose of matrix H, A be the joint distribution fitness matrix, and I be the identity matrix. For source domain hidden layer data H S The transpose of Q S Represents the central matrix, P T Let P be the transpose of the label projection matrix. For source domain label space data Y S transpose; The formula for the label projection matrix P is: Where, β T It is the transpose of the characteristic projection matrix β.