Small sample self-adaptive mixed gas sensor dynamic response modeling method
By constructing a gas sensor array and GRU network, the problem of test redundancy in the dynamic response modeling of multi-component mixed gases is solved, and high-precision sensor dynamic response modeling is achieved, which adapts to the performance differences of different sensors, reduces test pressure, and improves recognition accuracy.
Patent Information
- Application Number
- CN202510691288.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-05-27
AI Technical Summary
Existing technologies find it difficult to effectively handle the dynamic response of multi-component mixed gases. Traditional modeling methods ignore the transient characteristics of gas diffusion and chemical reactions, resulting in insufficient model accuracy, cumbersome and arduous testing schemes, large test volumes, and difficulty in adapting to the performance differences of different sensors.
A small sample adaptive mixed gas sensor dynamic response modeling method is adopted. By constructing a gas sensor array, a short time series sample set is generated. The GRU network and transfer learning are used to construct a gas sensor dynamic response model to achieve high-precision modeling of the sensor dynamic response.
With limited data and resources, it can quickly adapt to environmental changes, reduce test pressure, improve the model's adaptability and recognition accuracy, simplify the test plan, reduce the test volume, and improve the accuracy of mixed gas component identification.
Smart Images

Figure CN120609969A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of gas sensors, and in particular relates to a small sample adaptive dynamic response modeling method for a mixed gas sensor. Background Art
[0002] In the fields of industrial process monitoring and environmental pollutant detection, there is a growing demand for resistive gas sensors to dynamically detect multi-component mixed gases. Resistive sensors, dominated by surface chemical adsorption, achieve detection through the combined action of the adsorption-desorption process of gas molecules on the surface of sensitive materials and carrier migration behavior. When multiple gas components coexist, the competitive adsorption of different gas molecules on surface active sites and differences in adsorption energy lead to a dynamic equilibrium of coverage, resulting in a strongly nonlinear sensor response and significantly increasing the complexity of identifying the components of the mixed gas.
[0003] Traditional static calibration and modeling methods simplify the dynamics of gas diffusion and surface adsorption into discrete equilibrium concentration-response mappings. These methods use the stable response values of gas sensors as features to train models, predicting the gas concentration of unknown samples with good accuracy. Static response data can simplify the complex dynamics of gas diffusion and surface adsorption, enabling the quantification of gas sensor responses in mixed gases. However, these methods fail to characterize the transient characteristics of gas molecular diffusion layer formation and the dynamic evolution of chemical adsorption during sudden concentration changes. They also ignore the complex chemical reactions between gas mixture components, making it difficult to discern the effects of heterogeneous gases on carrier mobility in sensitive materials. Consequently, the cross-effects of different gases on sensor performance cannot be effectively modeled. Existing dynamic modeling techniques are not designed specifically for sensors. While time series analysis is incorporated, these models ignore the number of hidden states and nonlinear characteristics of sensor responses. Empirical equation models are limited by the complex parameter calibration of multi-component reaction pathways. This disconnect between the mechanistic and data models leads to biased predictions of dynamic characteristics such as adsorption-induced carrier mobility changes and desorption hysteresis.
[0004] On the other hand, existing testing schemes generally use gradient testing and orthogonal testing methods. The gradient testing method uses a certain concentration gradient to traverse multiple levels of concentration values within the working range of the sensor. This processing method causes a sharp increase in the test volume due to the increase in the number of mixed gases, which puts a lot of pressure on the test. The orthogonal testing method uses an orthogonal table to formulate gas concentrations within a certain range. However, the data obtained by this method contains a very high proportion of edge data in multidimensional space, and the data distribution pattern is difficult to train, and the actual concentration cannot be well inferred based on the sensor response. In the preprocessing process, both of the above methods discretize the continuous gas adsorption kinetics process into finite static working points. Although the data can be enhanced through interpolation and extrapolation methods, the complex dynamic relationship between adsorption, surface chemical reactions, and carrier mobility evolution between each concentration gradient is ignored, resulting in a cumbersome and tedious test scheme. The modeling process is extremely sensitive to the number of test samples, which affects the accuracy of the model.
[0005] Therefore, it is necessary to seek an adaptive small sample sensor dynamic response modeling method with low testing requirements, simple model structure and accurate description. Summary of the Invention
[0006] In response to the technical problems existing in the above-mentioned prior art, the present invention provides a small-sample adaptive mixed gas sensor dynamic response modeling method. By simulating the complex dynamic response of the gas sensor, data sample enhancement in a mixed gas environment is completed, reducing the difficulty of using small samples to train the mixed gas component identification model, enabling the model to quickly adapt to environmental changes and performance differences of different sensors under limited data and resources, and providing reliable and effective data enhancement support for mixed gas component identification.
[0007] The technical solutions adopted in the present invention are as follows:
[0008] A small sample adaptive mixed gas sensor dynamic response modeling method includes the following steps:
[0009] Step 1: Testing a mixed gas using a gas sensor array. The number of sensors in the gas sensor array and the number of gas types in the mixed gas are both N, and the sensors and gas types correspond one to one. Each sensor outputs a response curve with a time length of L. The gas sensor array then outputs an N-dimensional response curve group, which serves as a sample. M samples are obtained by testing mixed gases with M different component concentrations.
[0010] Step 2: For M mixed gases with different component concentrations, a pulse of the nth gas, n=1, 2, ..., N, is generated suddenly at the moment of introduction of each mixed gas, thereby obtaining an nth gas pulse signal C containing M pulses. n(t), n = 1, 2, ..., N, its amplitude is the concentration of the component gas, which is used to characterize the sudden change of gas concentration;
[0011] The response curves corresponding to the nth gas in the M samples are spliced according to the time of introduction of each mixed gas to obtain the response curves corresponding to C n (t) The nth gas sensor response signal R aligned with the timestamp n (t),n=1,2,...,N;
[0012] Then construct an initial sample set D = {R1(t), R2(t), ..., R N (t),C1(t),C2(t),...,C N (t)};
[0013] Step 3: For the initial sample set D, truncate and separate them for a certain time length L from the time step before each response rising point, and obtain M short time series segments. The mth, m=1, 2, ..., M short time series segments are recorded as in, R n The mth sub-response signal is truncated and separated in (t), C n (t) The mth sub-pulse signal is truncated and separated;
[0014] Step 4: Collection The starting position at time t (m) ,m=1,2,...,M (i.e. the signal amplitude (i.e. sensor state value) corresponding to the time step before the response rising point) is used as the starting state value The starting state value Duration length L, generates the mth starting state signal of the nth gas sensor Then obtain the mth total starting state signal
[0015] B m and S m Merge as the mth independent short time series sample S m '=(S m ,B m ), m = 1, 2, ..., M, and then construct a short time series segment sample set D' consisting of M independent short time series samples;
[0016] Step 5: Through the random sampling strategy without replacement, W independent short time series samples are extracted from the short time series fragment sample set D', and spliced together according to the time dimension to generate an enhanced long sequence to simulate long-term multiple gas detection scenarios; during the extraction process, if all M independent short time series samples are extracted, all independent short time series samples are completed and the extraction is continued to generate Q enhanced long sequences to form the enhanced data set D aug ;
[0017] Step 6: Enhance the dataset D aug Normalization processing to obtain the normalized enhanced data set D aug_norm , as the training set;
[0018] Step 7. Construct a gas sensor dynamic response model based on the timing prediction network, using all normalized sub-pulse signals and normalized starting state signals in the training set as input and the normalized sub-response signals corresponding to different gas sensors as output. Train the gas sensor dynamic response models separately to obtain trained gas sensor dynamic response models corresponding to different gas sensors.
[0019] Furthermore, the specific process of the normalization processing in step 6 is:
[0020] To D aug All sub-response signals, all sub-pulse signals and all starting state signals are processed by the maximum and minimum value normalization method respectively; among which, when processing all starting state signals, the maximum value of the sub-response signal is taken as the maximum value of the starting state signal, and the minimum value of the sub-response signal is taken as the minimum value of the starting state signal.
[0021] Furthermore, the gas sensor dynamic response model includes two parts: a pre-training model and a fine-tuning model; the pre-training model uses a GRU model as a temporal feature encoder, including an input layer, a GRU encoding layer and a fully connected output layer; the fine-tuning model includes a GRU encoding layer and a fully connected output layer.
[0022] Furthermore, during the training process of the gas sensor dynamic response model, the pre-trained model is first trained with all normalized sub-pulse signals and normalized starting state signals in the training set as input and the normalized sub-response signals corresponding to different gas sensors as output to obtain the trained pre-trained models corresponding to different gas sensors; then, the GRU encoding layer in the trained pre-trained model is directly used as the GRU encoding layer of the fine-tuning model, and all normalized sub-pulse signals and normalized starting state signals in the training set are used as input and the normalized sub-response signals of the gas sensor type corresponding to the trained pre-trained model are output to train the fine-tuning model, freezing the GRU encoding layer parameters during the training process to obtain the trained fine-tuning model of the corresponding gas sensor type; and the trained fine-tuning model is used as the trained gas sensor dynamic response model of the corresponding gas sensor type.
[0023] Furthermore, the parameters of the last P nodes of the GRU encoding layer in the pre-trained model after training are intercepted and frozen as the GRU encoding layer parameters of the fine-tuning model, and the time series hidden states encoded by the last P nodes are used as effective features and input into the fully connected output layer of the fine-tuning model; where P is the hidden state variable dimension.
[0024] Furthermore, the calculation process of the hidden state variable dimension P includes the following steps:
[0025] Step A: extracting the response steady-state value of each sample in step 1, and obtaining N-dimensional standardized response data points after normalization processing;
[0026] Among them, the standardization process is specifically removing the mean and scaling, and the formula is:
[0027]
[0028] Where, X is the steady-state value of the response; X std is the standardized response data point; μ is the mean of all samples; σ is the standard deviation of all samples;
[0029] Step B: Use the RBF (Radial Basis Function) kernel to map the standardized response data points of all samples to a higher-dimensional feature space to obtain an M×M-dimensional kernel matrix K. After centralization, the centralized kernel matrix K is obtained. centered ;
[0030] Among them, the mapping formula of RBF kernel is:
[0031]
[0032] Where x i is the standardized response data point of the i-th sample; x j is the standardized response data point of the jth sample;
[0033] K(x i ,x j ) represents the RBF kernel between the i-th sample and the j-th sample; γ is the kernel bandwidth parameter, which is used to control the influence range of a single sample on the surrounding samples.
[0034] The formula for centralized processing is:
[0035] K centered =K-1 M K-K1 M +1 M K1 M
[0036] Where, 1 M Indicates that all elements are An M×M dimensional matrix;
[0037] Step C: Calculate the centralized kernel matrix K centered The eigenvalues and eigenvectors of are used to determine the number of principal components P using the cumulative variance explanation rate as the dimension of the hidden state variable.
[0038] Furthermore, a transfer learning method is used to train the dynamic response model of the gas sensor. Specifically, the normalized sub-pulse signals and normalized starting state signals of all gas components in the training set are used as input, and the normalized sub-response signal corresponding to a gas sensor is used as output to train the pre-trained model to obtain a trained pre-trained model; then, the GRU encoding layer in the trained pre-trained model is directly used as the GRU encoding layer of the fine-tuning model, and all normalized sub-pulse signals and normalized starting state signals in the training set are used as input, and the normalized sub-response signal of the gas sensor type corresponding to the trained pre-trained model is used as output to train the fine-tuning model. During the training process, the GRU encoding layer parameters are frozen to obtain a trained fine-tuning model of the corresponding gas sensor type; and the trained fine-tuning model is used as the trained gas sensor dynamic response model of the corresponding gas sensor type.
[0039] Furthermore, M, L, N, W and Q are all positive integers.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] 1. This paper proposes a small-sample adaptive mixed gas sensor dynamic response modeling method, which successfully solves the problem of complex and cumbersome test schemes in mixed gas component identification models. By accurately inverting the sensor dynamic response through concentration, the data volume is effectively expanded. The model has a simple structure and good self-adaptation capabilities. With limited data and resources, it can quickly adapt to environmental changes and performance differences between different sensors, providing reliable and effective data enhancement support for subsequent mixed gas component identification tasks.
[0042] 2. The present invention adopts a dynamic extraction and splicing method. By randomly extracting multiple independent short time series samples without replacement and splicing them in the time dimension, the enhanced long sequence training samples are constructed, which makes the data volume exceed the upper limit of the small sample original data. This method can avoid the problem of a large increase in test volume caused by the increase in gas types in traditional testing methods, and significantly reduce the test pressure.
[0043] 3. Preferably, the present invention constructs a gas sensor dynamic response model based on a GRU encoder and a fully connected layer, introduces a GRU network to capture the transient dynamic characteristics of the gas adsorption-desorption process, and constructs a temporal association between the concentration pulse signal and the sensor's initial state value; by extracting and setting the gas component concentration pulse signal and the initial state value position, feature extraction is achieved in the encoder, and finally, a fine-tuning model consisting of a GRU encoder connected to a fully connected layer is used to perform more detailed learning of the gas concentration features. The model structure is simple, the number of hidden layers is small, and high-precision modeling of the dynamic response of a small sample sensor under mixed gas conditions can be achieved;
[0044] 4. Preferably, the present invention introduces multidimensional hidden state variables and obtains the hidden state dimensions required to retain the amount of information about the gas sensor response through the kernel principal component analysis method. This allows the nonlinear dynamic characteristics such as the effect of foreign gases on carrier migration in sensitive materials and desorption hysteresis to be retained in the model, thereby improving the accuracy of the dynamic response of the gas sensor.
[0045] 5. Preferably, the present invention adopts the method of transfer learning to complete the modeling of different sensors. The GRU layer in the pre-trained model extracts common temporal features, and after fixing the GRU parameters, the output layer of the local encoding connection is fine-tuned to prevent overfitting; the fine-tuning model can further process the impulse response brought by the concentration signal, so that the final result is closer to the actual dynamic response process. When using a new gas sensor, it is only necessary to retrain the fine-tuning model with a new fully connected output layer to complete the dynamic response modeling of the new sensor. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 Schematic diagram of the response signal of the mixed gas in Example 2;
[0047] Figure 2Schematic diagram of the pulse signal of the mixed gas in Example 2;
[0048] Figure 3 Schematic diagram of the total initial state signal of the mixed gas in Example 2;
[0049] Figure 4 Schematic diagram of the structure of the gas sensor dynamic response model used in Example 2;
[0050] Figure 5 Schematic diagram of the structure of the GRU encoding layer used in Example 2;
[0051] Figure 6 is the MSE mean square error loss function curve of the fine-tuning model in Example 2;
[0052] Figure 7 3σ distribution histogram of the relative error of the dynamic response model of the gas sensor in Example 2. DETAILED DESCRIPTION
[0053] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with examples and drawings. The exemplary embodiments of the present invention and their descriptions are only used to explain the present invention and are not intended to limit the present invention.
[0054] Example 1
[0055] This embodiment proposes a small sample adaptive mixed gas sensor dynamic response modeling method, including the following steps:
[0056] Step 1: Testing a mixed gas using a gas sensor array. The number of sensors in the gas sensor array and the number of gas types in the mixed gas are both N, and the sensors and gas types correspond one to one. Each sensor outputs a response curve with a time length of L. The gas sensor array then outputs an N-dimensional response curve group, which serves as a sample. M samples are obtained by testing mixed gases with M different component concentrations.
[0057] Step 2: For M mixed gases with different component concentrations, a pulse of the nth gas, n=1, 2, ..., N, is generated suddenly at the moment of introduction of each mixed gas, thereby obtaining an nth gas pulse signal C containing M pulses. n (t), n = 1, 2, ..., N, its amplitude is the concentration of the component gas, which is used to characterize the sudden change of gas concentration;
[0058] The response curves corresponding to the nth gas in the M samples are spliced according to the time of introduction of each mixed gas to obtain the response curves corresponding to C n (t) The nth gas sensor response signal R aligned with the timestamp n(t),n=1,2,...,N;
[0059] Then construct an initial sample set D = {R1(t), R2(t), ..., R N (t),C1(t),C2(t),...,C N (t)};
[0060] Step 3: For the initial sample set D, truncate and separate them for a certain time length L from the time step before each response rising point, and obtain M short time series segments. The mth, m=1, 2, ..., M short time series segments are recorded as in, R n The mth sub-response signal is truncated and separated in (t), C n (t) The mth sub-pulse signal is truncated and separated;
[0061] Step 4: Collection The starting position at time t (m) ,m=1,2,...,M (i.e. the signal amplitude (i.e. sensor state value) corresponding to the time step before the response rising point) is used as the starting state value The starting state value Duration length L, generates the mth starting state signal of the nth gas sensor Then obtain the mth total starting state signal
[0062] B m and S m Merge as the mth independent short time series sample S m '=(S m ,B m ), m = 1, 2, ..., M, and then construct a short time series segment sample set D' consisting of M independent short time series samples;
[0063] Step 5: Through the random sampling strategy without replacement, W independent short time series samples are extracted from the short time series fragment sample set D', and spliced together according to the time dimension to generate an enhanced long sequence to simulate long-term multiple gas detection scenarios; during the extraction process, if all M independent short time series samples are extracted, all independent short time series samples are completed and the extraction is continued to generate Q enhanced long sequences to form the enhanced data set D aug ;
[0064] Step 6: Enhance the dataset D augNormalization processing, specifically, all sub-response signals, all sub-pulse signals and all starting state signals are processed by maximum and minimum value normalization method respectively to obtain the normalized enhanced data set D aug_norm , as the training set; wherein, when processing all the starting state signals, the maximum value of the sub-response signal is taken as the maximum value of the starting state signal, and the minimum value of the sub-response signal is taken as the minimum value of the starting state signal;
[0065] Step 7. Construct a gas sensor dynamic response model based on the timing prediction network, using all normalized sub-pulse signals and normalized starting state signals in the training set as input and the normalized sub-response signals corresponding to different gas sensors as output. Train the gas sensor dynamic response models separately to obtain trained gas sensor dynamic response models corresponding to different gas sensors.
[0066] Example 2
[0067] This embodiment proposes a small sample adaptive mixed gas sensor dynamic response modeling method, including the following steps:
[0068] Step 1: Test the mixed gas through the gas sensor array. The number of sensors in the gas sensor array and the number of gas types in the mixed gas are both N=3, and the sensors and gas types correspond one to one. The components of the mixed gas include hydrogen, ammonia and nitrogen dioxide. Each sensor outputs a response curve with a time length of L=600. The gas sensor array outputs an N-dimensional response curve group as a sample, such as Figure 1 As shown; M samples are obtained by testing M=69 mixed gases with different component concentrations;
[0069] In this embodiment, the gas concentrations of the preset hydrogen component are 8000ppm, 16000ppm, 24000ppm, and 32000ppm, respectively; the gas concentrations of the ammonia component are 10ppm, 20ppm, 30ppm, 40ppm, and 50ppm, respectively; and the gas concentrations of the nitrogen dioxide component are 2ppm, 4ppm, 6ppm, 8ppm, and 10ppm, respectively;
[0070] Step 2: extract the response steady-state value of each sample in step 1, and obtain N-dimensional standardized response data points after normalization;
[0071] Among them, the standardization process is specifically removing the mean and scaling, and the formula is:
[0072]
[0073] Where, X is the steady-state value of the response; X std is the standardized response data point; μ is the mean of all samples; σ is the standard deviation of all samples;
[0074] Step 3: Use the RBF kernel to map the standardized response data points of all samples to a higher-dimensional feature space to obtain an M×M-dimensional kernel matrix K. After centralization, the centralized kernel matrix K is obtained. centered ;
[0075] Among them, the mapping formula of RBF kernel is:
[0076]
[0077] Where x i is the standardized response data point of the i-th sample; x j is the standardized response data point of the jth sample;
[0078] K(x i ,x j ) represents the RBF kernel between the i-th sample and the j-th sample; γ is the kernel bandwidth parameter, which is used to control the influence range of a single sample on the surrounding samples.
[0079] The formula for centralized processing is:
[0080] K centered =K-1 M K-K1 M +1 M K1 M
[0081] Where, 1 M Indicates that all elements are An M×M dimensional matrix;
[0082] Step 4: Calculate the centralized kernel matrix K centered The eigenvalues and eigenvectors of are used to determine the number of principal components P using the cumulative variance explanation rate as the dimension of the hidden state variable;
[0083] Specifically, the variance explanation rate is used to evaluate the amount of original data information retained by each principal component, that is, the proportion of the variance of the corresponding principal component in the high-dimensional space after mapping to the total variance;
[0084] The cumulative variance explained rate represents the sum of the variance explained rates of the first P principal components. The optimal dimension P that satisfies the target cumulative variance is found. The target cumulative variance is set to 95%, indicating that only P dimensions are needed to retain and express up to 95% of the original information. In this embodiment, P = 13;
[0085] Step 5: For the mixed gases of M different component concentrations in step 1, pulses of the nth, n=1, 2, ..., Nth gas are suddenly generated at the moment of introduction of each mixed gas, thereby obtaining the nth gas pulse signal C containing M pulses.n (t),n=1,2,..N, such as Figure 2 As shown, its amplitude is the concentration of component gas, which is used to characterize the sudden change characteristics of gas concentration;
[0086] The response curves corresponding to the nth gas in the M samples are spliced according to the time of introduction of each mixed gas to obtain the response curves corresponding to C n (t) The nth gas sensor response signal R aligned with the timestamp n (t),n=1,2,...,N;
[0087] Then construct an initial sample set D = {R1(t), R2(t), ..., R N (t),C1(t),C2(t),...,C N (t)};
[0088] Step 6: For the initial sample set D, truncate and separate the sample set D from the time step before each response rising point with the same time length L, and obtain M short time series segments. The mth, m=1, 2, ..., M short time series segments are recorded as in, R n The mth sub-response signal is truncated and separated in (t), C n (t) The mth sub-pulse signal is truncated and separated;
[0089] Step 7: Collection The starting position at time t (m) ,m=1,2,...,M (i.e. the signal amplitude (i.e. sensor state value) corresponding to the time step before the response rising point) is used as the starting state value The starting state value Duration length L, generates the mth starting state signal of the nth gas sensor Then obtain the mth total starting state signal like Figure 3 As shown;
[0090] B m and S m Merge as the mth independent short time series sample S m '=(S m ,B m ), m=1,2,...,M, including sub-response signals, sub-pulse signals and start state signals, totaling 3×N dimensions, and then constructing a short time series segment sample set D' consisting of M independent short time series samples;
[0091] Step 8: Using the random sampling strategy without replacement, extract W = 30 independent short time series samples from the short time series fragment sample set D', and splice them according to the time dimension to generate an enhanced long sequence to simulate a long-term multiple gas detection scenario; during the extraction process, if all M independent short time series samples are extracted, then all independent short time series samples are completed, and the random sampling strategy without replacement is continued to generate Q = 2000 enhanced long sequences to form the enhanced data set D aug ;
[0092] Step 9: Enhance the dataset D aug Normalization processing, specifically, all sub-response signals, all sub-pulse signals and all starting state signals are processed by maximum and minimum value normalization method respectively to obtain the normalized enhanced data set D aug_norm , as the training set; wherein, when processing all the starting state signals, the maximum value of the sub-response signal is taken as the maximum value of the starting state signal, and the minimum value of the sub-response signal is taken as the minimum value of the starting state signal;
[0093] The normalized enhanced dataset D aug_norm The set is randomly selected in a ratio of 7:1.5:1.5 and divided into training set, validation set and test set;
[0094] Step 10: Construct a dynamic response model of the gas sensor based on the time series prediction network, such as Figure 4 As shown, it includes two parts: pre-training model and fine-tuning model;
[0095] The pre-training model uses the GRU model as the temporal feature encoder, including an input layer, a GRU encoding layer and a fully connected output layer; wherein the structure of the GRU encoding layer is as follows Figure 5 As shown in the figure, the input passes through the input layer to the GRU encoding layer to extract features, and the Dropout module is inserted between layers with a dropout rate of 0.2. The input is then input to a linear fully connected output layer, and the Sigmoid activation function is passed before output. The final output is a gas sensor modeling sequence; the number of neurons in the input layer is 4, the number of neurons in the GRU encoding layer is 20, and the number of neurons in the fully connected output layer is 1;
[0096] The fully connected output layer is connected to the Sigmoid function, that is, the feature sequence input calculated by the fully connected layer is finally nonlinearly activated by the Sigmoid function, and the output range is constrained to be (0, 1) to adapt to the normalized simulated gas sensor response;
[0097] The output characteristics of the Sigmoid function avoid negative responses, aiming to improve the nonlinear fitting ability of the model and ensure that the final predicted response value is non-negative. At the same time, in backpropagation, the smooth gradient of the Sigmoid function alleviates the gradient vanishing problem of the network.
[0098] In model training, the mean square error (MSE) is used as the model loss function to measure the gap between the predicted concentration and the actual concentration. The model is iterated through the gradient descent algorithm to make the loss function decrease and converge to the minimum value.
[0099] Set the batch size to 20 and the learning rate to 10 -3 The number of iterations is 400, and the Adam optimizer is used to optimize the model and complete the training;
[0100] During the training process, the pre-training model is first trained with all normalized sub-pulse signals and normalized initial state signals in the training set as input and the normalized sub-response signals corresponding to different gas sensors as output to obtain pre-trained models corresponding to different gas sensors.
[0101] Example: Using a PdNi gas sensor as a hydrogen sensor, during the training process of the pre-trained model, the difference between the PdNi gas sensor response sequence simulated by the gas sensor dynamic response model and the normalized sub-response signal (i.e., the actual response value) corresponding to the PdNi gas sensor is used as the loss function. The loss function is optimized using gradient descent to iterate the pre-trained model corresponding to the PdNi gas sensor.
[0102] The fine-tuning model includes a GRU encoding layer and a fully connected output layer, the GRU encoding layer in the trained pre-trained model is directly used as the GRU encoding layer of the fine-tuning model, all normalized sub-pulse signals and normalized starting state signals in the training set are used as input, and the normalized sub-response signal of the gas sensor type corresponding to the trained pre-trained model is used as output, the fine-tuning model is trained, the GRU encoding layer parameters are frozen during the training process, and only the fully connected output layer parameters are trained to obtain the trained fine-tuning model corresponding to the gas sensor type; and the trained fine-tuning model is used as the trained gas sensor dynamic response model of the corresponding gas sensor type;
[0103] The parameters of the last P nodes of the GRU encoding layer in the pre-trained model after training are frozen as the parameters of the GRU encoding layer of the fine-tuning model, and the hidden state of the time series encoded by the last P nodes is used as the effective feature and input into the fully connected output layer of the fine-tuning model; in the fine-tuning model training, the same loss function and optimizer are used, and the learning rate is kept at 10 -3 , perform 400 rounds of fine-tuning; the MSE mean square error loss function curve of the fine-tuning model is as follows Figure 6 shown.
[0104] Step 11: Taking the PdNi gas sensor as an example, the trained gas sensor dynamic response model corresponding to the PdNi gas sensor is used to test the test set. The relative error results are as follows: Figure 7 As shown, the relative error of the model prediction is 0.16%, and the relative error of all data in the test set is within the range of 3σ; under the 95% confidence interval, the confidence range is [-0.43%, 0.75%], achieving the effect of streamlining demand and accurate prediction.
[0105] In summary, the present invention provides a small-sample adaptive dynamic response modeling method for mixed gas sensors. In practical applications, high-precision modeling of the dynamic response of the gas sensor can be achieved by utilizing the test concentration pulse signal and the initial resistance state of the gas sensor. All response curves covering the working concentration range of the gas sensor can be reconstructed using a small amount of concentration-initial state signal.
[0106] It should be noted that these are only specific implementation methods of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with this technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered by the scope of protection of the present invention.
Claims
1. A small sample adaptive mixed gas sensor dynamic response modeling method, characterized in that: The following steps are involved: Step 1: Test the mixed gas using a gas sensor array. The number of sensors and the number of gas types are both N, and the sensors and gas types have a one-to-one correspondence. Each sensor outputs a response curve with a time length of L. The gas sensor array then outputs an N-dimensional response curve group as a sample. M samples are obtained by testing mixed gases with M different component concentrations. Step 2: For M mixed gases, a pulse of the nth gas, n=1, 2, ..., N, is suddenly generated at the moment of introduction of each mixed gas, and an nth gas pulse signal C containing M pulses is obtained. n (t),n=1,2,...,N; The response curves corresponding to the nth gas in the M samples are spliced according to the time of introduction of each mixed gas to obtain the response curves corresponding to C n (t) The nth gas sensor response signal R aligned with the timestamp n (t),n=1,2,...,N; Then construct the initial sample set D={R1(t),R2(t),...,R N (t),C1(t),C2(t),...,C N (t)}; Step 3: For D, starting from the time step before each response rising point, the time length L is truncated and separated to obtain M short time series segments. The mth, m=1, 2, ..., M short time series segments are recorded as in, n=1,2,...,N,m=1,2,...,M is R n The mth sub-response signal is truncated and separated in (t), n=1,2,...,N,m=1,2,...,M is C n (t) The mth sub-pulse signal is truncated and separated; Step 4: Collection The starting position at time t (m) ,m=1,2,...,M corresponding to the signal amplitude, as the starting state value The starting state value Duration length L, generates the mth starting state signal of the nth gas sensor n=1,2,...,N,m=1,2,...,M, and then obtain the mth total starting state signal m=1,2,...,M; B m and S m Merge as the mth independent short time series sample S m '=(S m ,B m ), m = 1, 2, ..., M, and then construct a short time series segment sample set D' consisting of M independent short time series samples; Step 5: Extract W independent short time series samples from the short time series sample set D' through a random sampling strategy without replacement, and splice them together according to the time dimension to generate an enhanced long sequence; if all M independent short time series samples have been extracted, then complete all independent short time series samples and continue to extract, thereby generating Q enhanced long sequences to form an enhanced data set D aug ; Step 6: Enhance the dataset D aug Normalization processing to obtain the normalized enhanced data set D aug_norm , as the training set; Step 7. Construct a gas sensor dynamic response model based on the timing prediction network, using all normalized sub-pulse signals and normalized starting state signals in the training set as input and the normalized sub-response signals corresponding to different gas sensors as output. Train the gas sensor dynamic response models separately to obtain trained gas sensor dynamic response models corresponding to different gas sensors.
2. The small sample adaptive mixed gas sensor dynamic response modeling method according to claim 1 is characterized in that: The specific process of normalization processing in step 6 is as follows: To D aug All sub-response signals, all sub-pulse signals and all starting state signals are processed by the maximum and minimum value normalization method respectively; among which, when processing all starting state signals, the maximum value of the sub-response signal is taken as the maximum value of the starting state signal, and the minimum value of the sub-response signal is taken as the minimum value of the starting state signal.
3. The small sample adaptive mixed gas sensor dynamic response modeling method according to claim 2 is characterized in that: The gas sensor dynamic response model includes a pre-training model and a fine-tuning model; the pre-training model uses a GRU model as a temporal feature encoder, including an input layer, a GRU encoding layer and a fully connected output layer; the fine-tuning model includes a GRU encoding layer and a fully connected output layer.
4. The small sample adaptive mixed gas sensor dynamic response modeling method according to claim 3 is characterized in that: During the training process of the gas sensor dynamic response model, the pre-trained model is first trained with all normalized sub-pulse signals and normalized starting state signals in the training set as input and normalized sub-response signals corresponding to different gas sensors as output, thereby obtaining trained pre-trained models corresponding to different gas sensors; then, the GRU encoding layer in the trained pre-trained model is directly used as the GRU encoding layer of the fine-tuning model, and all normalized sub-pulse signals and normalized starting state signals in the training set are input and normalized sub-response signals of the gas sensor type corresponding to the trained pre-trained model are output, thereby training the fine-tuning model, freezing the GRU encoding layer parameters during the training process, and obtaining a trained fine-tuning model corresponding to the gas sensor type; The trained fine-tuned model is used as the trained gas sensor dynamic response model for the corresponding gas sensor type.
5. The small sample adaptive mixed gas sensor dynamic response modeling method according to claim 4 is characterized in that: The parameters of the last P nodes of the GRU encoding layer in the pre-trained model after training are frozen as the GRU encoding layer parameters of the fine-tuning model, and the hidden state of the time series encoded by the last P nodes is used as the effective feature and input into the fully connected output layer of the fine-tuning model; where P is the hidden state variable dimension.
6. The small sample adaptive mixed gas sensor dynamic response modeling method according to claim 5, characterized in that: The calculation process of the hidden state variable dimension P includes the following steps: Step A: extracting the response steady-state value of each sample in step 1, and obtaining N-dimensional standardized response data points after normalization processing; Step B: Use the RBF kernel to map the standardized response data points of all samples to a higher-dimensional feature space to obtain an M×M-dimensional kernel matrix K. After centralization, the centralized kernel matrix K is obtained. centered ; Step C: Calculate the centralized kernel matrix K centered The eigenvalues and eigenvectors of are used to determine the number of principal components P using the cumulative variance explanation rate as the dimension of the hidden state variable.
7. The small sample adaptive mixed gas sensor dynamic response modeling method according to claim 3 is characterized in that: A transfer learning method is used to train the dynamic response model of the gas sensor. Specifically, the pre-trained model is first trained with the normalized sub-pulse signals and normalized starting state signals of all gas components in the training set as input and the normalized sub-response signal corresponding to a gas sensor as output to obtain a trained pre-trained model. The GRU encoding layer in the trained pre-trained model is then directly used as the GRU encoding layer of the fine-tuning model. The fine-tuning model is trained with all the normalized sub-pulse signals and normalized starting state signals in the training set as input and the normalized sub-response signal of the gas sensor type corresponding to the trained pre-trained model as output. The parameters of the GRU encoding layer are frozen during the training process to obtain a trained fine-tuning model corresponding to the gas sensor type. The trained fine-tuned model is used as the trained gas sensor dynamic response model for the corresponding gas sensor type.
8. The small sample adaptive mixed gas sensor dynamic response modeling method according to any one of claims 1 to 7, characterized in that: M, L, N, W and Q are all positive integers.
Citation Information
Patent Citations
Sensor array neural network method for predicting concentration of mixed gas
CN115860056A
Self-adaptive pre-fusion detection method for gas sensor array
CN116340882A
Local dynamic neural network mixed gas quantitative analysis method
CN116448957A
Data enhancement method in gas classification system and gas classification method and system
CN118169340A
Gas identification and concentration prediction method based on deep learning
CN118608869A
Cited By
Gas sensor dynamic response modeling method based on liquid continuous time network
CN121741118A
Gas concentration identification method based on semiconductor oxide sensor array short-period temperature modulation signal
CN122153816A
A Gas Concentration Identification Method Based on Short-Period Temperature Modulation Signals from a Semiconductor Oxide Sensor Array
CN122153816B