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

By adopting a multi-task learning method in electronic nose, combining GRU and attention layer, and optimizing model performance using particle swarm algorithm, the problem of performance degradation in traditional electronic noses when processing large-scale and multi-category gas data is solved, achieving more accurate and robust gas recognition and concentration prediction effects.

CN119849298AActive Publication Date: 2025-04-18DALIAN UNIV OF TECH

Patent Information

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

AI Technical Summary

Technical Problem

Traditional electronic noses have a problem of performance degradation when processing large-scale and multi-category gas data, and multi-task learning models are prone to gradient disappearance or gradient explosion during training, making it difficult to converge to optimal solution.

Method used

Using a multi-task learning-based approach, combining gated neural units (GRUs) and attention layer, gas recognition and concentration prediction tasks are simultaneously processed through a multi-task learning network, and the weight of the loss function is adjusted using the particle swarm algorithm to optimize model performance.

Benefits of technology

This method can improve the efficiency of gas data identification and concentration prediction, achieve more accurate predictions in different tasks by sharing data characteristics, and show better robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119849298A_ABST
    Figure CN119849298A_ABST
Patent Text Reader

Abstract

The invention discloses a gas identification and concentration prediction method based on multi-task learning, and belongs to the technical field of artificial intelligence. According to the method, gas classification and concentration prediction can be simultaneously performed on gas data through a multi-task learning method, and as the gas data is a time sequence, a GRU unit is selected to extract gas data features, and an attention mechanism is increased to allocate weights for GRU output, so that feature focusing of the gas data is enhanced. In addition, an optimal combination of parameters in a network structure is searched by using a PSO algorithm, finally two subtasks of gas identification and concentration prediction are combined with a shared feature extraction layer, and network training is performed. According to the method, good classification identification and concentration prediction effects are achieved, and technical guarantee is provided for development and application related to gas identification and concentration prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a mixed gas recognition and concentration prediction method based on multi-task learning (MTL) and gated recurrent unit (GRU) neural network. Background Art

[0002] As an artificial olfactory system based on gas sensing technology, the electronic nose has a wide range of applications in the field of gas detection and identification. This innovative system consists of multiple gas sensors, each of which is designed to selectively respond to different gas molecules, effectively mimicking the ability of the human olfactory system to perceive and identify odors. Due to sensor drift over time and insufficient sensitivity, traditional methods often encounter challenges with performance degradation when processing large-scale and multi-category gas data. In response to these limitations, researchers have begun to incorporate machine learning methods into gas identification and concentration prediction tasks. Machine learning provides powerful pattern recognition and prediction capabilities, opening up new possibilities for gas identification and concentration prediction.

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

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

[0005] In order to achieve the above object, the present invention adopts the following technical scheme:

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

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

[0008] Step 1. Obtain a data set of responses of the gas sensor array to the gas to be tested at the same temperature and humidity, wherein the acquired sensor response data includes responses of the sensor array to binary mixed gases at multiple different ratios and concentrations;

[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 is the normalized value, X min is the minimum value in the data, X max is the maximum value in the data;

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

[0014] Step 3. Input the training set data into the multi-task learning network for training, perform weighted summation of the loss function of each subtask as the total loss function, and save the model with the best effect;

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

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

[0017] Step 3.3. Then, the feature vector output by the attention layer is sent to 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 square error MSE is used as the loss function for the concentration prediction task;

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

[0019] The total loss function is expressed as:

[0020]

[0021] Where L total represents the total loss function, w i and L i Represent the weight and loss function of the i-th task respectively;

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

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

[0024] λ 1and λ 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 algorithm to adjust the weights of each loss function during the model training process to find the optimal solution, improve training efficiency, and optimize model performance;

[0026] Step 4. Load the best multi-task network model, pass the gas data into the model to determine the characteristic information of the gas and output the gas category and gas concentration.

[0027] Furthermore, the step 1 is specifically as follows:

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

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

[0030] Step 1.3. Use the MFC system to introduce mixed gases with different concentration ratios to measure the sensor array response data set.

[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] Furthermore, in step 2: after preprocessing the data, each set of data is cut into a sliding window size of 20, an overlap rate of 0.75, a sliding step of the sliding window of 5 response fragments of 4 samples, and the overall data is divided into training set, validation set, and test set according to 7:1:2.

[0033] Furthermore, in step 3.2, the output of each time step is input into the attention layer through the GRU to enhance the model's capture of key information of the time series; specifically:

[0034] Step 3.2.1. For each time step X in the data i , i=1,2,3...n is processed by GRU unit to get the output h i , 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 converted into a series of hidden states, which capture the temporal characteristics and dependencies of the input sequence.

[0037] Step 3.2.2. Transform each time step through the GRU output h i Enter the attention layer. First, the hidden state hi is mapped 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. Then, calculate h according to the softmax formula i The corresponding weight α i ; The formula is:

[0041]

[0042] Where α i h i The attention weight of j ranges from 1 to n, and exp is a normalization factor. Finally, according to the attention weight α i Perform weighted summation on the input vector to obtain the weighted feature vector z i , the calculation formula is:

[0043]

[0044] z i It is regarded as the final output of the shared layer and sent to the sub-network of each task for processing. Further, in step 3.3, the formula of the regression model is as follows:

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

[0046] Where W (r) is the weight matrix of the regression task, b (r) is the bias vector of the regression task;

[0047] The classification model is formulated as follows:

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

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

[0050] Furthermore, the mean square error MSE in step 3.4 is defined as:

[0051]

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

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

[0054]

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

[0056] The beneficial effects of the present invention are as follows: the method can solve the gas classification and concentration prediction problems simultaneously through the neural network framework of multi-task learning of gas data, so that the features of the data can be shared in different tasks. By simultaneously learning multiple related tasks in the model, multi-task learning can provide richer and more comprehensive information, enabling the model to make more accurate predictions and show better robustness compared to single-task models. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0059] Figure 3 Schematic diagram of the attention layer.

[0060] Figure 4 A neural network diagram. DETAILED DESCRIPTION

[0061] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation modes.

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

[0063] Step 1. Obtain a data set of responses of the gas sensor array to the gas to be tested at the same temperature and humidity. The acquired sensor response data includes the responses of the sensor array to binary mixed gases at multiple different concentration ratios. Specifically:

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

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

[0066] Step 1.3. Figure 2 As shown, using the MFC system, mixed gases with different concentration ratios are introduced to measure the sensor array response data set.

[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 is the normalized value, X min is the minimum value in the data, X max is 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 sets, validation sets, and test sets. Specifically, after preprocessing the data, each set of data is intercepted with a sliding window size of 20, an overlap rate of 0.75, and a sliding step of 5 response fragments. The overall data is divided into training set, validation set, and test set according to 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 effect.

[0073] Step 3.1. Transform each time step X in the data i , i=1,2,3...n is processed by GRU unit to get the output h i , 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 converted into a series of hidden states, which capture the temporal characteristics and dependencies of the input sequence.

[0076] Step 3.2. Transform each time step through the GRU output h i Enter the attention layer. First, the hidden state hi is mapped 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. Then, Figure 3 As shown, h is calculated according to the softmax formula i The corresponding weight α i The formula is:

[0080]

[0081] Where α i h i The attention weight of j ranges from 1 to n, and exp is a normalization factor. Finally, according to the attention weight α i Perform weighted summation on the input vector to obtain the weighted feature vector z i , the calculation formula is:

[0082]

[0083] z i The final output of the shared layer is considered as the final output of the shared layer and is sent to the sub-network of each task for processing. Each fully connected layer uses a ReLU activation function. The weighted feature vector of the attention layer and the output of the attention weight are simultaneously input into the two sub-task networks, namely the classification task and regression task, through the fully connected layer, and the classification model and regression model are trained.

[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] Where W (r) is the weight matrix of the regression task, b (r) 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 category appearing. The formula is as follows:

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

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

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

[0091]

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

[0093] The cross entropy function is selected as the loss function in the classification task, and its expression is:

[0094]

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

[0096] The loss function used in multi-task learning is implemented by weighted summing the loss functions of each task. It is expressed as:

[0097]

[0098] Where L total represents the total loss function, w i and L i Represent the weight and loss function of the ith task respectively. The model is optimized by weighting the subtask loss function and adding L2 regularization, so the final expression of the loss function is:

[0099] Loss = λ 1 L (r) +λ 2 L (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 algorithm to find the optimal solution during the model training process, thereby adjusting the weights of each loss function, improving training efficiency, and optimizing model performance.

[0102] Step 4. Load the best classification model, pass the gas data into the model to determine the characteristic information of the gas and output the gas category and gas concentration.

[0103] Step 4.1 Four indicators are used to evaluate the model performance in this invention, namely accuracy, F1-score, RMSE, R 2 ; The formulas are:

[0104]

[0105]

[0106]

[0107]

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

[0109]

[0110]

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

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

[0113]

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

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

[0116] All equivalent substitutions and obvious modifications made by any technician familiar with the art under the guidance of this specification fall within the substantive scope of this specification and should be protected by the present invention.

Claims

1. A gas identification and concentration prediction method based on multi-task learning, characterized in that: The steps include: Step 1. Obtain a data set of responses of the gas sensor array to the gas to be tested at the same temperature and humidity, wherein the acquired sensor response data includes responses of the sensor array to binary mixed gases at multiple different ratios and concentrations; 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 is the normalized value, X min is the minimum value in the data, X max is the maximum value in the data; Step 2.

2. Construct a training set, a validation set and a test set using the obtained multi-channel gas response data; Step 3. Input the training set data into the multi-task learning network for training, perform weighted summation of the loss function of each subtask as the total loss function, and save the model with the best effect; Step 3.

1. Process each time step in the data using the GRU unit to obtain output data, capturing the temporal characteristics and dependencies of the input sequence; Step 3.

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

3. Then, the feature vector output by the attention layer is sent to 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 square error MSE is used as the loss function for the concentration prediction task; Step 3.

5. Optimize the model using the weighted summation of the loss functions of the subtasks and the L2 regularization method; The total loss function is expressed as: Where L total represents the total loss function, w i and L i Represent the weight and loss function of the i-th task respectively; the final expression of 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 algorithm to adjust the weights of each loss function during the model training process to find the optimal solution, improve training efficiency, and optimize model performance; Step 4. Load the best multi-task network model, pass the gas data into the model to determine the characteristic information of the gas 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 is characterized in that: The step 1 is specifically as follows: Step 1.

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

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

3. Use the MFC system to introduce mixed gases with different concentration ratios to measure the sensor array response data set.

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

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

2.

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

1. For each time step X in the data i , i=1,2,3...n is processed by GRU unit to get the output h i , i=1,2,3...n; the expression is as follows: h i =GRU(X i ,h i-1 ) The input data sequence is converted into a series of hidden states, which capture the temporal characteristics and dependencies of the input sequence. Step 3.2.

2. Transform each time step through the GRU output h i Enter the attention layer. First, the hidden state hi is mapped 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. Then, calculate h according to the softmax formula i The corresponding weight α i ; The formula is: Where α i h i The attention weight of j ranges from 1 to n, and exp is a normalization factor. Finally, according to the attention weight α i Perform weighted summation on the input vector to obtain the weighted feature vector z i , the calculation formula is: z i It is regarded as the final output of the shared layer and sent to the sub-network of each task for processing.

6. The gas identification and concentration prediction method based on multi-task learning according to claim 1 is characterized in that: In step 3.3, the formula of the regression model is as follows: y (r) =W (r) z i +b (r) Where W (r) is the weight matrix of the regression task, b (r) is the bias vector of the regression task; The classification model is formulated as follows: y (c) =Softmax(W (c) z i +b (c) ) Where W (c) is the weight matrix of the classification task, b (c) 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 is characterized in that: The mean square error MSE in step 3.4 is defined as: in and represent the true value and 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 is characterized in that: The loss function of each subtask in step 3.5 is expressed as: Where n is the number of samples, k is the number of gas categories, if sample i is classified correctly, otherwise in, It 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

  • Gas concentration prediction method and system for intelligent gas sensing

    CN117079736A

  • Ammonia concentration prediction method of post-processing system based on radial basis function neural network

    CN118211619A

  • Element concentration analyzing system in metal

    JP1996114585A

Cited By

  • Lightweight mixed gas type and concentration detection method and system and storage medium

    CN120600286A

  • Method, system and storage medium for detecting light-weight mixed gas type and concentration

    CN120600286B

  • Gas identification method and intelligent gas identification method based on gas sensor array

    CN122193294A