Gas identification and concentration prediction methods based on multi-task learning

By using a multi-task learning approach, combining Min-Max normalization, GRU units, and attention layers to optimize the weights of the loss function, a neural network for gas identification and concentration prediction is constructed. This solves the problems of gas sensor performance degradation and model convergence difficulty in traditional methods, achieving more accurate and robust gas identification and concentration prediction.

CN119849298BActive Publication Date: 2025-10-28DALIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411900712.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-10-28
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

Traditional methods suffer from performance degradation of gas sensors when processing large-scale and multi-class gas data, and multi-task learning models are prone to gradient vanishing or gradient explosion during training, making it difficult to converge to the optimal solution.

Method used

A multi-task learning approach is adopted, combining Min-Max normalization, GRU units, and attention layers. The loss function weights are optimized through particle swarm optimization to construct a gas identification and concentration prediction neural network. The network is trained using data from a gas sensor array, sharing data features and enhancing the model's ability to capture time series data.

Benefits of technology

It improves the accuracy and robustness of gas identification and concentration prediction, and achieves richer information sharing and better model performance through a multi-task learning framework.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119849298B_ABST
    Figure CN119849298B_ABST
Patent Text Reader

Abstract

This paper presents a gas identification and concentration prediction method based on multi-task learning, belonging to the field of artificial intelligence technology. This method enables simultaneous gas classification and concentration prediction from gas data using a multi-task learning approach. Since the gas data is time-series, GRU units are selected to extract gas data features, and an attention mechanism is added to assign weights to the GRU output, thereby enhancing feature focus on the gas data. Furthermore, the PSO algorithm is used to find the optimal combination of parameters in the network structure. Finally, the gas identification and concentration prediction subtasks are combined with a shared feature extraction layer and the network is trained. This method achieves good classification and concentration prediction results, providing technical support for the development and application of gas identification and concentration prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, specifically to a method for mixed gas identification and concentration prediction based on multi-task learning (MTL) and gated recurrent unit (GRU) neural networks. Background Technology

[0002] Electronic noses, as artificial olfactory systems based on gas sensing technology, have wide applications in gas detection and identification. This innovative system consists of multiple gas sensors, each designed to selectively respond to different gas molecules, effectively mimicking the human olfactory system's ability to perceive and identify odors. However, traditional methods often encounter performance degradation challenges when processing large-scale and multi-category gas data due to sensor drift over time and insufficient sensitivity. To address these limitations, researchers have begun incorporating machine learning methods into gas identification and concentration prediction tasks. Machine learning offers powerful pattern recognition and prediction capabilities, providing new possibilities for gas identification and concentration prediction.

[0003] The objective function of multi-task learning is usually a combination of loss functions for multiple tasks. Due to the mutual influence between these tasks, the model training process may encounter problems such as vanishing or exploding gradients, making it difficult for the model to converge to the optimal solution. Summary of the Invention

[0004] The purpose of this invention is to propose a gas identification and concentration prediction method based on multi-task learning, so as to improve the efficiency of identification and concentration prediction of mixed gases.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] A gas identification and concentration prediction method based on multi-task learning includes the following steps:

[0007] A gas identification and concentration prediction method based on multi-task learning includes the following steps:

[0008] Step 1. Obtain the response data set of the gas sensor array to the gas under the same temperature and humidity. The obtained sensor response data includes the response of the sensor array to binary mixed gases at various different concentration ratios.

[0009] Step 2. Perform equal-interval sampling and Min-Max normalization preprocessing on the sensor response data obtained in Step 1;

[0010] Step 2.1. Min-Max Normalization Formula:

[0011]

[0012] Among them, X norm X is the normalized value. min X is the minimum value in the data. max The maximum value in the data;

[0013] Step 2.2. Construct training, validation, and test sets from the obtained multi-channel gas response data;

[0014] Step 3. Input the training set data into the multi-task learning network for training. The loss functions of each sub-task are weighted and summed to obtain the total loss function. Save the model with the best performance.

[0015] Step 3.1. Process the data at each time step using a GRU unit to obtain the output data, capturing the temporal features and dependencies of the input sequence;

[0016] Step 3.2. Input the output of the GRU at each time step into the attention layer; enhance the model's ability to capture key information from the time series.

[0017] Step 3.3. Then, the feature vectors output by the attention layer are fed into the sub-networks of the gas identification task and the concentration prediction task for processing; the classification model and the regression model are trained; Step 3.4. The cross-entropy function is used as the loss function for the gas identification task, and the mean squared error (MSE) is used as the loss function for the concentration prediction task.

[0018] Step 3.5. Optimize the model by weighted summation of the loss functions of the subtasks and L2 regularization;

[0019] The total loss function is expressed as:

[0020]

[0021] Where L total Let w represent the total loss function. i and L i Let represent the weights and loss function of the i-th task, respectively;

[0022] Therefore, the final expression for the loss function is:

[0023] Loss=λ1L (r) +λ2L (c) +θ(||W (r) ||2+||W (c) ||2)

[0024] λ1 and λ2 represent the weights of the concentration prediction task and the gas classification task, respectively; θ is the weight of the regularization term, ||W (r) ||2 and||W(c) ||2 represents the norm;

[0025] Step 3.6. Use the particle swarm optimization algorithm to adjust the weights of each loss function during model training, thereby finding the optimal solution, improving training efficiency, and optimizing model performance;

[0026] Step 4. Load the optimal multi-task network model, input the gas data into the model to determine the gas characteristics and output the gas category and gas concentration.

[0027] Further, step 1 specifically includes:

[0028] Step 1.1. First, assemble n commercial MOX sensors into a gas sensor array; where n is the number of sensors;

[0029] Step 1.2. Use multiple PVC pipes and drill holes in them, with the hole diameter smaller than the diameter of the gas sensor; fix the gas sensor on the PVC pipes, and connect the gas source and exhaust channel to the two ends of the PVC pipes respectively;

[0030] Step 1.3. Using the MFC system, introduce mixed gases of different concentration ratios to measure the sensor array response dataset.

[0031] Furthermore, the standard temperature environment is a temperature environment of 22°C, and the standard humidity environment is a relative humidity environment of 50%RH.

[0032] Further, in step 2: after data preprocessing, four samples of the response fragment are extracted from each group of data with a sliding window size of 20, an overlap rate of 0.75, and a sliding window step size of 5. The whole set is divided into training set, validation set, and test set in a ratio of 7:1:2.

[0033] Furthermore, step 3.2 inputs the output of the GRU into the attention layer for each time step, enhancing the model's ability to capture key information from the time series; specifically:

[0034] Step 3.2.1. Extract the data for each time step X. i The i = 1, 2, 3... n are processed by the GRU unit to obtain the output h. i Let i = 1, 2, 3...n; the expression is as follows:

[0035] h i =GRU(X) i ,h i-1 )

[0036] The input data sequence is transformed into a series of hidden states, which capture the temporal features and dependencies of the input sequence.

[0037] Step 3.2.2. Receive the output h of the GRU for each time step. i Input attention layer. First, map the hidden state hi to a scalar, represented by a linear transformation:

[0038] a i =W·h i +b

[0039] Where W is the parameter matrix; b is the bias vector.

[0040] Step 3.2.3. Subsequently, calculate h according to the softmax formula. i The corresponding weight α i The formula is:

[0041]

[0042] In the formula α i for h i The attention weight is α; the value of j ranges from 1 to n, and exp is a normalization factor. Finally, based on the attention weight α... i The input vectors are weighted and summed to obtain the weighted feature vector z. i The calculation formula is:

[0043]

[0044] z i This is considered the final output of the shared layer and fed into the sub-networks of each task for processing. Further, in step 3.3, the formula for the regression model is as follows:

[0045] y (r) =W (r) z i +b (r)

[0046] Among them W (r) For the weight matrix of the regression task, b (r) This is the bias vector for the regression task;

[0047] The classification model has the following formula:

[0048] y (c) =Softmax(W (c) z i +b (c) )

[0049] In the formula, W (c) For the weight matrix of the classification task, b (c) This is the bias vector for the classification task.

[0050] Further, the mean square error (MSE) in step 3.4 is defined as follows:

[0051]

[0052] in and Let represent the actual value and the predicted value of the i-th concentration, respectively.

[0053] Furthermore, the loss function for each subtask in step 3.4 is expressed as follows:

[0054]

[0055] Where n is the number of samples, and k is the number of gas categories. If sample i is correctly classified... otherwise in, This represents the probability that sample i belongs to category j.

[0056] The beneficial effects of this invention are as follows: This method can simultaneously solve the problems of gas classification and concentration prediction using a multi-task learning neural network framework, enabling the data features to be shared across different tasks. By simultaneously learning multiple related tasks within the model, multi-task learning can provide richer and more comprehensive information, allowing the model to make more accurate predictions and exhibit better robustness compared to single-task models. Attached Figure Description

[0057] Figure 1 This is a flowchart of the gas identification and concentration prediction method based on multi-task learning according to the present invention.

[0058] Figure 2 This is a schematic diagram of the gas data acquisition platform.

[0059] Figure 3 This is a schematic diagram of the attention layer.

[0060] Figure 4 This is a schematic diagram of a neural network. Detailed Implementation

[0061] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0062] like Figure 1 As shown, the gas identification and concentration prediction method based on multi-task learning includes the following steps:

[0063] Step 1. Obtain the response data set of the gas sensor array for the gas to be measured under the same temperature and humidity. The obtained sensor response data includes the response of the sensor array to binary gas mixtures at various concentration ratios. Specifically:

[0064] Step 1.1. First, assemble n commercial MOX sensors into a gas sensor array; where n is the number of sensors.

[0065] Step 1.2. In a standard temperature environment of 22℃ and a standard humidity environment of 50%RH, use multiple PVC pipes and drill holes in them with a hole diameter smaller than the diameter of the gas sensor; fix the gas sensor on the PVC pipes, and connect the gas source and exhaust channel to the two ends of the PVC pipes respectively.

[0066] Step 1.3. As Figure 2 As shown, the sensor array response dataset was obtained by introducing mixed gases of different concentration ratios using the MFC system.

[0067] Step 2. Perform Min-Max normalization preprocessing and equal-interval sampling on the sensor response data obtained in Step 1.

[0068] Step 2.1. Min-Max Normalization Formula:

[0069]

[0070] Among them, X norm X is the normalized value. min X is the minimum value in the data. max This represents the maximum value in the data.

[0071] Step 2.2. Sample the obtained data at equal intervals to obtain multi-channel gas response data, and construct training, validation, and test sets. Specifically, after data preprocessing, extract four samples of each data set response segment with a sliding window size of 20, an overlap rate of 0.75, and a sliding window step size of 5. The data is then divided into training, validation, and test sets in a ratio of 7:1:2.

[0072] Step 3. Input the training set data into the multi-task learning network for training, and save the model with the best performance.

[0073] Step 3.1. Extract the X value for each time step in the data. i The i = 1, 2, 3... n are processed by the GRU unit to obtain the output h. i Let i = 1, 2, 3...n; the expression is as follows:

[0074] h i =GRU(X) i ,h i-1 )

[0075] The input data sequence is transformed into a series of hidden states, which capture the temporal features and dependencies of the input sequence.

[0076] Step 3.2. Receive the output h of the GRU for each time step. i Input attention layer. First, map the hidden state hi to a scalar, represented by a linear transformation:

[0077] a i =W·h i +b

[0078] Where W is the parameter matrix; b is the bias vector.

[0079] Step 3.3. Subsequently, as Figure 3 As shown, h is calculated according to the softmax formula. i The corresponding weight α i The formula is:

[0080]

[0081] In the formula α i for h i The attention weight is α; the value of j ranges from 1 to n, and exp is a normalization factor. Finally, based on the attention weight α... i The input vectors are weighted and summed to obtain the weighted feature vector z. i The calculation formula is:

[0082]

[0083] z i The final output of the shared layer is fed into the sub-networks for each task for processing. Each fully connected layer uses a ReLU activation function. The weighted feature vector from the attention layer and the output of the attention weights are simultaneously fed into the two sub-task networks (classification and regression) through the fully connected layer for training the classification and regression models.

[0084] Step 3.4. For the regression task of concentration prediction, the formula is as follows:

[0085] y (r) =W (r) z i +b (r)

[0086] Among them W (r) For the weight matrix of the regression task, b (r) This is the bias vector for the regression task.

[0087] Step 3.5. The output of the classification task uses the Softmax function to calculate the probability of each class, as shown in the following formula:

[0088] y (c) =Softmax(W (c)z i +b (c) )

[0089] In the formula, W (c) For the weight matrix of the classification task, b (c) This is the bias vector for the classification task.

[0090] Step 3.6. To evaluate the total error of quantitative identification, the mean squared error (MSE) is defined as follows:

[0091]

[0092] in and Let represent the actual value and the predicted value of the i-th concentration, respectively.

[0093] Choosing the cross-entropy function as the loss function in the classification task, its expression is:

[0094]

[0095] Where n is the number of samples, and k is the number of gas categories. If sample i is correctly classified... otherwise in, This represents the probability that sample i belongs to category j.

[0096] In multi-task learning, the loss function is implemented by weighted summation of the loss functions for each task. This is represented as:

[0097]

[0098] Where L total Let w represent the total loss function. i and L i Let represent the weights and loss function for the i-th task, respectively. The model is optimized by weighting the sub-task loss function and incorporating L2 regularization; therefore, the final expression for the loss function is:

[0099] Loss=λ1L (r) +λ2L (c) +θ(||W (r) ||2+||W (c) ||2)

[0100] λ1 and λ2 represent the weights of the concentration prediction task and the gas classification task, respectively. θ is the weight of the regularization term, ||W (r) ||2 and||W (c) ||2 represents the norm.

[0101] Step 3.7. Use the particle swarm optimization algorithm to find the optimal solution during model training, thereby adjusting the weights of each loss function, improving training efficiency, and optimizing model performance.

[0102] Step 4. Load the best classification model, input the gas data into the model to determine the gas characteristics and output the gas category and gas concentration.

[0103] Step 4.1 In this invention, four metrics are used to evaluate the model performance: accuracy, F1-score, RMSE, R... 2 The formulas are as follows:

[0104]

[0105]

[0106]

[0107]

[0108] Where precision is the accuracy rate; recall is the recall rate; the formula is:

[0109]

[0110]

[0111] Step 4.2 TP, TN, FP, and FN are respectively the positive samples predicted as positive by the model, the negative samples predicted as negative by the model, the positive samples predicted as negative by the model, and the negative samples predicted as positive by the model.

[0112] Table 1 Comparison of prediction performance between the method of this invention and the classical method

[0113]

[0114] Table 1 compares the experimental prediction results of the multi-task classification and prediction method proposed in this invention with common classical single-task methods, further demonstrating the superiority of this invention in multi-element gas classification.

[0115] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention.

[0116] Any equivalent substitutions or obvious modifications made by those skilled in the art under the guidance of this specification fall within the scope of this specification and should be protected by this invention.

Claims

1. A gas identification and concentration prediction method based on multi-task learning, characterized in that, Includes the following steps: Step 1. Obtain the response data set of the gas sensor array to the gas under the same temperature and humidity. The obtained sensor response data includes the response of the sensor array to binary mixed gases at various different concentration ratios. Step 2. Perform equal-interval sampling and Min-Max normalization preprocessing on the sensor response data obtained in Step 1; Step 2.

1. Min-Max Normalization Formula: Among them, X norm X is the normalized value. min X is the minimum value in the data. max The maximum value in the data; Step 2.

2. Construct training, validation, and test sets from the obtained multi-channel gas response data; Step 3. Input the training set data into the multi-task learning network for training. The loss functions of each sub-task are weighted and summed to obtain the total loss function. The model with the best performance is saved. Step 3.

1. Process the data at each time step using GRU units to obtain the output data and capture the temporal features and dependencies of the input sequence. Step 3.

2. Input the output of the GRU at each time step into the attention layer; enhance the model's ability to capture key information from the time series. Step 3.

3. Then, the feature vectors output by the attention layer are fed into the sub-networks of the gas identification task and the concentration prediction task for processing; the classification model and the regression model are trained; Step 3.

4. The cross-entropy function is used as the loss function for the gas identification task, and the mean squared error (MSE) is used as the loss function for the concentration prediction task. Step 3.

5. Optimize the model by weighted summation of the loss functions of the subtasks and L2 regularization; The total loss function is expressed as: Where L total Let w represent the total loss function. i and L i Let represent the weights and loss function for the i-th task, respectively; the final expression for the loss function is: Loss=λ1L (r) +λ2L (c) +θ(||W (r) ||2+||W (c) ||2) λ1 and λ2 represent the weights of the concentration prediction task and the gas classification task, respectively; θ is the weight of the regularization term, ||W (r) ||2 and||W (c) ||2 represents the norm; Step 3.

6. Use the particle swarm optimization algorithm to adjust the weights of each loss function during model training, thereby finding the optimal solution, improving training efficiency, and optimizing model performance; Step 4. Load the optimal multi-task network model, input the gas data into the model to determine the gas characteristics and output the gas category and gas concentration.

2. The gas identification and concentration prediction method based on multi-task learning according to claim 1, characterized in that, Step 1 specifically involves: Step 1.

1. First, assemble n commercial MOX sensors into a gas sensor array; where n is the number of sensors; Step 1.

2. Use multiple PVC pipes and drill holes in them, with the hole diameter smaller than the diameter of the gas sensor; fix the gas sensor on the PVC pipes, and connect the gas source and exhaust channel to the two ends of the PVC pipes respectively; Step 1.

3. Using the MFC system, introduce mixed gases of different concentration ratios to measure the sensor array response dataset.

3. The gas identification and concentration prediction method based on multi-task learning according to claim 2, characterized in that: In step 1.2, a standard environment is used, with a standard temperature environment of 22°C and a standard humidity environment of 50%RH.

4. The gas identification and concentration prediction method based on multi-task learning according to claim 1, characterized in that, In step 2: after data preprocessing, four samples of the response fragment are extracted from each group of data with a sliding window size of 20, an overlap rate of 0.75, and a sliding window step size of 5. The whole set is divided into training set, validation set, and test set in a ratio of 7:1:

2.

5. The gas identification and concentration prediction method based on multi-task learning according to claim 1, characterized in that, Step 3.2 involves inputting the output of the GRU into the attention layer at each time step to enhance the model's ability to capture key information from the time series; specifically: Step 3.2.

1. Extract the data for each time step X. i The i = 1, 2, 3... n are processed by the GRU unit to obtain the output h. i Let i = 1, 2, 3...n; the expression is as follows: h i =GRU(X i ,h i-1 ) The input data sequence is transformed into a series of hidden states, which capture the temporal features and dependencies of the input sequence. Step 3.2.

2. Receive the output h of the GRU for each time step. i Input attention layer. First, map the hidden state hi to a scalar, represented by a linear transformation: a i =W·h i +b Where W is the parameter matrix; b is the bias vector. Step 3.2.

3. Subsequently, calculate h according to the softmax formula. i The corresponding weight α i The formula is: In the formula α i for h i The attention weight is α; the value of j ranges from 1 to n, and exp is a normalization factor. Finally, based on the attention weight α... i The input vectors are weighted and summed to obtain the weighted feature vector z. i The calculation formula is: z i It is considered the final output of the shared layer and sent to the sub-networks of each task for processing.

6. The gas identification and concentration prediction method based on multi-task learning according to claim 1, characterized in that: In step 3.3, the formula for the regression model is as follows: y (r) =W (r) z i +b (r) Among them W (r) For the weight matrix of the regression task, b (r) This is the bias vector for the regression task; The classification model has the following formula: y (c) =Softmax(W (c) z i +b (c) ) In the formula, W (c) For the weight matrix of the classification task, b (c) This is the bias vector for the classification task.

7. The gas identification and concentration prediction method based on multi-task learning according to claim 1, characterized in that: The mean square error (MSE) in step 3.4 is defined as follows: in and Let represent the actual value and the predicted value of the i-th concentration, respectively.

8. The gas identification and concentration prediction method based on multi-task learning according to claim 1, characterized in that: The loss function for each subtask in step 3.5 is expressed as follows: Where n is the number of samples, and k is the number of gas categories. If sample i is correctly classified... otherwise in, This represents the probability that sample i belongs to category j.

Citation Information

Patent Citations

  • Method for predicting concentration of dissolved gas in transformer oil based on GRU-GCN

    CN113780420A

  • Multi-task learning method and device based on gas sensor

    CN116522199A