Gas recognition device and gas recognition method based on switch thermal cycle modulation
Through a gas identification method based on switch thermal cycle modulation, combined with hardware circuits and data processing technology, the problems of poor selectivity and long response time of traditional gas sensors are solved, and multi-dimensional, high-precision gas detection is achieved, which is suitable for environmental monitoring, industrial safety, medical diagnosis and other fields.
Patent Information
- Application Number
- CN202510874018.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-06-27
AI Technical Summary
Traditional gas sensors have poor selectivity, complex systems, high costs, and long response times, making it difficult to achieve rapid detection on resource-constrained devices.
A gas identification method based on switch thermal cycle modulation is adopted. By simplifying the hardware circuit design and thermal cycle modulation technology, combining the gas sensor array, switch thermal cycle modulation module and gas identification module, and using 1DCNN and transformer network for data processing, multi-dimensional and high-precision gas detection is achieved.
It significantly reduces system complexity and cost, improves the flexibility and accuracy of gas detection, and can meet the needs of rapid gas detection in different scenarios.
Smart Images

Figure CN120761580A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of gas detection, and in particular relates to a gas identification device and a gas identification method based on switch thermal cycle modulation. Background Art
[0002] As an effective monitoring tool, gas sensors play a vital role in environmental monitoring, industrial safety, medical diagnosis, and other fields. Traditional metal oxide semiconductor (MOS) gas sensors are widely used due to their low cost and high sensitivity. However, they suffer from poor selectivity, cross-sensitivity, and susceptibility to interference from other gases. This makes them ineffective in identifying mixed gases and makes it difficult to identify the type and concentration of target gases in complex gas environments.
[0003] To improve the selectivity of gas sensors, the problem of poor selectivity of individual sensors has been addressed by combining sensor arrays with pattern recognition technology. Sensor arrays typically consist of multiple gas sensors with different sensitivity characteristics. By expanding the array size, the characteristic parameters of the gas response can be increased, providing more gas response information and thus improving selectivity. However, this approach comes with challenges such as large system size, high power consumption, and high cost, making it difficult to widely apply on resource-constrained devices.
[0004] Another improvement is to employ temperature modulation technology to obtain more response information by varying the sensor's operating temperature. Traditional temperature modulation techniques typically rely on microcontrollers or complex software algorithms to enhance the sensor's response to specific gases by periodically varying the sensor's operating temperature. However, the response signals obtained by this method are typically limited to the sensor's quasi-steady-state response values at different temperatures, making it difficult to fully reflect the dynamic interaction between the gas and the sensor, and increasing system complexity and cost. Furthermore, the low frequency of traditional temperature modulation technology results in prolonged sensor response times, making it difficult to meet the needs of rapid on-site testing. Summary of the Invention
[0005] This paper proposes a gas identification device and method based on on-off thermal cycle modulation. By simplifying the hardware circuit design and incorporating thermal cycle modulation technology, it addresses the issues of poor selectivity, complex systems, high costs, and long response times faced by traditional gas sensors, enabling multi-dimensional, high-precision detection of target gases.
[0006] To achieve the above object, the technical solution adopted by the present invention is:
[0007] A gas identification method based on on-off thermal cycle modulation comprises the following steps:
[0008] Step 1: Setting up a gas sensor array for detecting the gas to be measured, a switch thermal cycle modulation module for cyclically heating the gas sensor array, and a gas identification module, wherein the gas identification module includes a classification model for identifying the type of the gas to be measured and a regression model for identifying the gas concentration;
[0009] Step 2: preheating the gas sensor array to a stable state;
[0010] Step 3: Turn on and off the thermal cycle modulation module to perform thermal cycle modulation heating, and allow the gas sensor array to maintain at least one complete thermal cycle modulation cycle in the ambient gas to obtain an initial sensor response value;
[0011] Step 4: introducing the gas to be tested so that the gas sensor array is in the atmosphere of the gas to be tested until a set detection time threshold is reached to obtain multi-dimensional response characteristic data; the set detection time threshold is 10-40 thermal cycle modulation cycles;
[0012] Step 5: Input the multi-dimensional response characteristic data into the gas identification module to obtain the gas types contained in the gas to be tested and the corresponding concentrations of each gas.
[0013] As a further improvement, the data processing method of the gas identification module is as follows:
[0014] 1): Preprocess the multi-dimensional response feature data to obtain samples;
[0015] 2): Input the sample into the classification model to obtain the gas types contained in the gas to be tested;
[0016] 3): The classification results of the classification model and the samples are input into the regression model to obtain the concentration of each type of gas in the gas to be tested.
[0017] For further improvement, the pre-processing method is as follows:
[0018] 1.1): Use the difference quotient method to perform benchmark correction on multi-dimensional response characteristic data:
[0019] S t '=(S t -S0) / S0
[0020] Among them S t and S0 are the sensor response value and the initial value of the sensor response at the tth moment, respectively. t ' is the sensor response value at the tth moment after reference correction;
[0021] 1.2): The sensor response value after reference correction is divided into L time periods according to the switching thermal cycle adjustment period, and each switching thermal cycle modulation period is a time period.
[0022] For further improvement, the data processing method of the classification model is as follows:
[0023] 2.1): Construct a sample set. A training sample in the sample set consists of the response values of n sensors in L time periods. The response values of n sensors in a time period are sent to the 1DCNN module to extract the response features of n sensors in the time period. The input X of the 1DCNN module is a real-valued matrix, expressed as Where T represents the number of samples in a time period, n represents the number of sensors, represents the field of real numbers;
[0024] 2.1.1): The response values of n sensors are fed into 1DCNN. The formula is described as follows:
[0025]
[0026] in, represents the output of the kth convolution kernel at position i, K represents the width of the convolution kernel, is the convolution weight, b (k) is the bias term, X i+j,c Represents the value of the input signal at time step i+j and the cth channel;
[0027] 2.1.2): After convolution, the feature batch normalization and nonlinear mapping are performed. The formula is described as follows:
[0028]
[0029] Among them, μ B , δ B 2 Represent the mean and variance of the batch samples, Represents the value of the kth convolution kernel at position i, ε represents a very small positive number to prevent division by zero, represents the normalized value of the kth convolution kernel at position i, γ and β are learnable parameters, is the batch normalized output of the kth convolution kernel at position i, ReLU(·) is the ReLU activation function, is the output value of the kth convolution kernel after activation at position i.
[0030] 2.1.3): Adaptive average pooling is used to compress feature dimensions. The formula is as follows:
[0031]
[0032] Among them, S i represents the pooling area, s i is the number of regional elements;
[0033] 2.2): The features extracted by the 1DCNN module are fed into the self-attention module for feature enhancement;
[0034] 2.2.1): Output feature F pool Denoted as F, the query vector Q = FW is obtained through linear transformation Q , key vector K = FW K , value vector V = FW V , where W Q , W K , W V is the trainable weight matrix;
[0035] 2.2.2): Calculate the attention matrix A and output the enhanced feature F α , the formula is described as follows:
[0036]
[0037] F α =AV
[0038] softmax() represents the normalization function, T represents the matrix transpose, d k Dimensions represented as key vectors;
[0039] 2.2.3): Adaptive average pooling is used to compress and extract feature dimensions, stacking features from different time periods. The formula is as follows:
[0040]
[0041] Among them, L represents the number of time periods of a single sample, d represents the feature dimension of a single time period, and F α (i) represents the output features of the i-th time period strengthened by the attention mechanism, and represents the features of all time periods in a single sample;
[0042] 2.2.4) The features F of all time periods all The data is fed into the transformer network to extract the correlation features of sensor responses in different time periods.
[0043] 2.2.5): Flatten the associated features output by the transformer and feed them into the fully connected layer for classification training. Use the cross-entropy loss function to calculate the difference between the model prediction results and the true labels. Optimize the network parameters through backpropagation and retain the final classification model. The formula is described as follows:
[0044]
[0045] where z j represents the predicted value of the jth class of sample, zy is the label value of the real gas component, and C represents the total number of categories;
[0046] 2.2.6): Load the final classification model, feed the preprocessed sensor response data into the final classification model to output the component identification result of the gas to be tested, and obtain the gas types contained in the gas to be tested.
[0047] For further improvement, the data processing flow of the regression model is as follows:
[0048] 3.1) Construct a sample set. A training sample in the sample set consists of the response values of n sensors in L time periods. The response values of n sensors in a time period are respectively sent to n 1DCNN modules to extract the response features of n sensors in the time period. The input of the 1DCNN module is represented by the matrix X i ∈R 1×T , where T represents the number of samples in each time period and i represents the i-th sensor:
[0049] The response values of n sensors are fed into n 1DCNN modules respectively. The sensor responses are convolved three times with the convolution kernel scale decreasing in sequence. After convolution, the features are batch normalized and nonlinearly mapped. The formula is described as follows:
[0050]
[0051] Where k represents the number of convolutional layers, W i (k) and b i (k) are the weight and bias of the k-th convolution kernel, BN(·) is batch normalization, σ() is the nonlinear activation function; F i (k) Represents the output of k-layer convolution;
[0052] 3.2): Adaptive maximum pooling is used to compress and extract feature dimensions:
[0053] The 1DCNN convolution module output F of the i-th sensor (k) Denoted as F, the features of the same sensor at different time periods are stacked. The formula is as follows:
[0054]
[0055] in, represents the real domain feature vector of the i-th sensor in the j-th time period, represents the real domain feature vector of the i-th sensor in all time periods;
[0056] 3.3): Introduce a trainable scalar weight coefficient for each sensor channel. The initial value is set to α = 1 / n, where n is the number of sensors. The formula is described as follows:
[0057]
[0058] in, is the weighted response value of the i-th sensor, S i is the response value of the i-th sensor, α i For S i The weight coefficient of
[0059] 3.4): The features of n sensors in all time periods are fed into n transformers respectively to extract the correlation features of sensor responses in different time periods;
[0060] 3.5): The features H output by n transformers i ∈R L×d After flattening, the data is concatenated and fed into a fully connected layer for regression training. The mean square error loss function is used to calculate the difference between the model prediction results and the actual notes. The mean square error loss function is used to obtain the final regression model. The network parameters are optimized through backpropagation to retain the final regression model. The formula is described as follows;
[0061] h i =Flatten(H i )
[0062] h=Concat(h1,h2,...,h n )
[0063]
[0064] Flatten() means flattening, H i represents the output of the i-th transformer model, h i Represents the output of the i-th transformer model after flattening, Concat() represents concatenation by dimension, h represents concatenation of all transformer model output values, and f() represents a fully connected layer. represents the regression prediction value of the regression model, and y j They represent the regression prediction value and label true value of the jth sample, respectively, and m represents the number of samples in the batch;
[0065] 3.6): Load the final regression model and feed the preprocessed sensor response data into the model to output the gas component identification results.
[0066] For further improvement, the sample set is divided into a training set, a validation set and a test set; the ratio of the training set, the validation set and the test set is 6:2:2; and the training process adopts five-fold cross validation.
[0067] A gas identification device based on on-off thermal cycle modulation, characterized in that the gas identification device is used to implement the above-mentioned gas identification method based on on-off thermal cycle modulation; the gas identification device includes an on-off thermal cycle signal generating module, an operating mode switching module, and a gas detection sensor module;
[0068] The gas detection sensor module includes a detachable and replaceable metal oxide semiconductor gas sensor array and a signal acquisition system. The gas detection sensor module is used to detect the target gas, output a corresponding electrical signal response, and detect the gas type and content of each gas in the gas to be tested;
[0069] The switch thermal cycle signal generating module is used to perform temperature modulation on the metal oxide semiconductor gas sensor array and the gas to be measured;
[0070] The working mode switching module is used to turn off or on the switch thermal cycle signal generating module, so that it works in the constant temperature working mode or the switch thermal cycle working mode.
[0071] Further improvement, the working mode switching module is a double-pole double-throw slide switch K1, which includes six electrical connection points, namely the normally closed end 1 of the first pole, the common end 2 of the first pole and the normally open end 3 of the first pole, and the normally closed end 4 of the second pole, the common end 5 of the second pole and the normally open end 6 of the second pole;
[0072] The gas sensor array includes sensor 1, sensor 2, sensor 3 and sensor 4;
[0073] When the double-pole double-throw slide switch K1 is in the first position, the normally closed end 1 of the first knife is connected to the common end 2 of the first knife, and the normally closed end 4 of the second knife is connected to the common end 5 of the second knife; when the double-pole double-throw slide switch K1 slides to the second position, the connection point of the common end 2 of the first knife is connected to the normally open end 3 of the first knife, and the common end 5 of the second knife is connected to the normally open end 6 of the second knife; the switch thermal cycle signal generating module includes a power supply line VCC and a ground line GND, and the power supply line VCC is electrically connected to one end of the first adjustable resistor VR1, the RESET pin of the timer, the VCC pin of the timer, the normally closed end 1 of the first knife of the double-pole double-throw slide switch K1, and the first heating resistor R of the sensor. H1 One end of the first sensing resistor R S1 One end of sensor 2, the second heating resistor R H2 One end of the second sensing resistor R S2 One end of sensor 3, the third heating resistor R H3 One end of the third sensing resistor RS3 One end of the sensor 4, the fourth heating resistor R H4 One end of the fourth sensing resistor R S4 one end of the first adjustable resistor VR1; the other end of the first adjustable resistor VR2 is electrically connected to one end of the second adjustable resistor VR2 and the DIS pin of the timer; the other end of the second adjustable resistor VR2 is electrically connected to one end of the first capacitor C1, the TRIG pin of the timer, the THR pin of the timer and the second normally closed end 4 of the slide switch K1; the OUT pin of the timer is electrically connected to the common terminal 2 of the first knife;
[0074] The ground wire GND is electrically connected to the other end of the timing capacitor C1, the GND pin of the timer, one end of the bypass capacitor C0, the second common terminal 5, the source of the first MOS tube Q1, one end of the sensor 1 load resistor R1, one end of the sensor 2 load resistor R2, one end of the sensor 3 load resistor R3 and one end of the sensor 4 load resistor R4; the other end of the sensor 1 load resistor R1 is electrically connected to the sensor resistor R S1 The other end of the load resistor R2 of the sensor 2 is electrically connected to the sensing resistor R S2 The other end of the load resistor R3 of sensor three is electrically connected to the sensing resistor R S3 The other end of the load resistor R4 of sensor four is electrically connected to the sensing resistor R S4 The other end of the bypass capacitor C0 is electrically connected to the CTRL pin of the timer; the first common terminal 2 of the slide switch K1 is electrically connected to the gate of the first MOS tube Q1, and the drain of the first MOS tube Q1 is electrically connected to the sensor heating resistor R H1 The other end of the sensor, the second heating resistor R H2 The other end of the sensor three heating resistors R H3 The other end of the sensor and the four heating resistors R H4 the other end.
[0075] Further improvement, the switch thermal cycle signal generating module forms a periodic pulse signal, the frequency of which is adjusted by the first adjustable resistor VR1, the second adjustable resistor VR2 and the timing capacitor C1, and the periodic pulse signal is output by the timer OUT terminal; when the sliding switch K1 is in the first position, the supply voltage V CCThe first MOS transistor Q1 remains conductive, the heating resistor circuit of the gas sensor is conductive, and the sensor operates in the normal temperature mode. At the same time, the second normally closed terminal 4 of the double-pole double-throw slide switch K1 is conductively connected to the second common terminal 5 of the double-pole double-throw slide switch K1, and the timing capacitor C1 is discharged. When the double-pole double-throw slide switch K1 is in the first position, the output of the timer OUT terminal is conductively connected from the first normally open terminal 3 of the double-pole double-throw slide switch K1 to the first common terminal 2 of the double-pole double-throw slide switch K1, causing the first MOS transistor Q1 to be periodically conductive, the heating resistor circuit of the gas sensor to be periodically conductive, and the sensor to operate in the switch thermal cycle modulation mode.
[0076] As a further improvement, the signal acquisition system is composed of a data acquisition card, a computer and the computer software Labview. The data acquisition card is used to connect the metal oxide semiconductor gas sensor array and the computer, and the computer software Labview is used to obtain the analog signal of the metal oxide semiconductor gas sensor array in real time.
[0077] Compared with the prior art, the present invention has the following beneficial effects:
[0078] The present invention realizes temperature modulation through timer integrated circuit and MOSFET, without the need for microcontroller or software control, which significantly reduces the complexity and cost of the system; through thermal cycle modulation technology, the multi-dimensional response characteristics of the sensor under dynamic temperature changes can be obtained, which significantly improves the dimension and accuracy of gas detection; the use of a detachable sensor array design supports the replacement of sensors according to application requirements, enhancing the applicability of the system; the design of "switch thermal cycle modulation-constant temperature" dual working modes effectively improves the flexibility of gas identification and can meet the gas detection needs in different scenarios; the gas component classification model and gas concentration regression prediction model proposed in the present invention are designed according to the switch thermal cycle signal at two time scales: within the thermal cycle cycle and between cycles. The gas component classification model shows high classification accuracy under both constant temperature and switch thermal cycle modulation data sets, and has good generalization; the gas concentration regression prediction model has high accuracy under the switch thermal cycle data set. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 This is a schematic structural diagram of a gas identification device based on switch thermal cycle modulation according to the present invention.
[0080] Figure 2 It is a flow chart of a mixed gas component identification method based on on-off thermal cycle modulation in the gas identification method of the present invention.
[0081] Figure 3It is a flow chart of a mixed gas concentration identification method based on on-off thermal cycle modulation in the gas identification method based on on-off thermal cycle modulation of the present invention. DETAILED DESCRIPTION
[0082] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0083] like Figure 1 As shown in FIG, a gas identification device based on on-off thermal cycle modulation consists of three parts: an on-off thermal cycle signal generating module, an operating mode switching module, and a gas detection sensor module. The on-off thermal cycle modulation module is used to generate an on-off signal with an adjustable period and duty cycle, perform temperature modulation on the gas sensor, and enhance the sensor's gas identification capability. The operating mode switching module is used to switch between a constant temperature operating mode and an on-off thermal cycle operating mode to adapt to different detection requirements.
[0084] The gas detection sensor module includes a detachable and replaceable metal oxide semiconductor gas sensor array and a signal acquisition system, which is used to detect the target gas, output the corresponding electrical signal response, and convert the electrical signal into a digital signal and upload it to a computer.
[0085] The switch thermal cycle control module is composed of a timer integrated circuit, a timer peripheral circuit and a MOSFET connection. The timer peripheral circuit includes an adjustable resistor and a capacitor. The switch thermal cycle control module is connected in series to the gas sensor heating circuit. The sensor temperature change cycle can be adjusted by adjusting the adjustable resistor.
[0086] The working mode switching module includes a sliding switch that can switch between constant temperature mode and switch thermal cycle modulation mode, and synchronously triggers capacitor discharge when the working mode is switched to constant temperature mode, ensuring the uniformity of the initial state of the switch thermal cycle modulation, and avoiding the influence of the asynchronous initial state on gas identification;
[0087] The gas detection sensor module is composed of a metal oxide semiconductor gas sensor array and a signal acquisition system. The metal oxide semiconductor gas sensor array is composed of multiple metal oxide semiconductor gas sensors. The gas sensing module adopts a detachable design, and different types or different parameters of metal oxide semiconductor gas sensors can be replaced according to application requirements. The signal acquisition system is composed of a data acquisition card, a computer and computer software Labview. The data acquisition card is used to connect the metal oxide semiconductor gas sensor array and the computer, and the computer software Labview is used to acquire the analog signals of the metal oxide semiconductor gas sensor array in real time.
[0088] The data acquisition step of the gas identification device based on the switch thermal cycle modulation is as follows:
[0089] Step 1: When the device is cold started, the working mode is switched to the constant temperature mode, and the gas sensing module is preheated to a stable state;
[0090] Step 2: After preheating, the working mode is switched to the thermal cycle mode, and at least one complete thermal cycle modulation period is maintained in the environment gas to obtain a reference signal;
[0091] Step 3: After the reference signal acquisition is completed, the quality flow controller is adjusted to pass the gas to be detected into the device until the set detection time threshold is reached;
[0092] Step 4: After the detection is completed, the quality flow controller is used to pass the environment gas into the device until the set recovery time threshold is reached, the sensor signal is restored to the stable state before the detection, the multi-dimensional response characteristic data of the gas sensing module is recorded, and the working mode is switched to the constant temperature mode.
[0093] A gas identification method based on switch thermal cycle modulation, the gas identification method based on switch thermal cycle modulation comprises: sensor response data preprocessing, mixed gas component identification method based on switch thermal cycle modulation and mixed gas concentration identification method based on switch thermal cycle modulation.
[0094] The sensor data preprocessing comprises the following steps:
[0095] Step 1: The difference quotient method is used for reference correction of the sensor data:
[0096] S t ’=(S t -S0) / S0
[0097] Wherein S t and S0 are the sensor response value at the tth moment and the initial sensor response value, respectively, and S t ’ is the sensor response value at the tth moment after the reference correction.
[0098] Step 2: The reference checked sensor response value is divided into multiple time periods according to the on-off thermal cycle adjustment period;
[0099] As shown in Figure 2 , the mixed gas component identification method based on on-off thermal cycle modulation includes the following steps:
[0100] Step 1: The response values of n sensors in a time period are sent to a 1D CNN module to extract the response features of n sensors in the time period;
[0101] Step 1.1: The response values of n sensors are sent to a 1D CNN;
[0102] Step 1.2: Batch normalization and nonlinear mapping are performed on the features after convolution;
[0103] Step 1.3: Adaptive average pooling is used to compress the feature dimension.
[0104] Step 2: The features extracted by the 1D CNN module are sent to a self-attention module for feature enhancement;
[0105] Step 3: The extracted feature dimension is compressed using adaptive average pooling, and the features of different time periods are stacked;
[0106] Step 4: The features of all time periods are sent to a transformer to extract the correlation features of sensor responses between different time periods;
[0107] Step 5: The flattened features output by the transformer are sent to a fully connected layer for classification training. The cross-entropy loss function is used to calculate the difference between the model prediction results and the true labels. The network parameters are optimized through backpropagation, and the final classification model is retained;
[0108] Step 6: Load the classification model and send the preprocessed sensor response data to the model to output the gas component identification result.
[0109] As shown in Figure 3 , the mixed gas concentration identification method based on on-off thermal cycle modulation includes the following steps:
[0110] Step 1: The response values of n sensors in a time period are sent to n 1D CNN modules to extract the response features of n sensors in the time period;
[0111] Step 1.1: The response values of n sensors are sent to n 1D CNNs;
[0112] Step 1.2: Three times of convolution are performed on the sensor response, and the convolution kernel size decreases in turn. Batch normalization and nonlinear mapping are performed on the features after convolution;
[0113] Step 1.3: Adaptive max pooling is used to compress the extracted feature dimensions.
[0114] Step 2: Stack the features of the same sensor at different time periods;
[0115] Step 3: Give different sensor channels trainable weight coefficients. The initial coefficient is 1 / n, where n is the number of sensors.
[0116] Step 4: Feed the features of n sensors in all time periods into n transformers respectively to extract the correlation features of sensor responses in different time periods;
[0117] Step 5: Flatten and concatenate the features output by the n transformers and feed them into the fully connected layer for regression training. The mean square error loss function is used to calculate the difference between the model prediction results and the actual labels. The network parameters are optimized through backpropagation to retain the final regression model.
[0118] Step 6: Load the regression model and feed the preprocessed sensor response data into the model to output the gas concentration identification result.
[0119] The training process of the mixed gas component identification method based on on-off thermal cycle modulation and the mixed gas concentration identification method based on on-off thermal cycle modulation both adopts five-fold cross validation, and the ratio of training set, validation set and test set is 6:2:2.
[0120] The following is a comparison of the recognition data of the existing 1DCNN, GA_BPNN, GAF_CNN and SVM gas detection models of the gas component identification method and gas concentration identification method proposed in the present invention under the switch thermal cycle gas sensor array and constant temperature sensor array data sets proposed in the present invention.
[0121] The switch thermal cycle gas sensor array data set construction method is as follows
[0122] Step 1: When the device is cold started, switch the working mode to constant temperature mode and preheat the gas sensor module to a stable state;
[0123] Step 2: After preheating is completed, switch the operating mode to thermal cycling mode and maintain at least one complete thermal cycling modulation cycle in the ambient gas to obtain a reference signal;
[0124] Step 3: After the reference signal is acquired, adjust the mass flow controller to pass the target gas into the device until the set detection time threshold is reached;
[0125] Step 4: After the test is completed, the ambient gas is introduced into the device using a mass flow controller until the set recovery time threshold is reached and the sensor signal returns to the stable state before the test. The multi-dimensional response characteristic data of the gas sensing module is recorded and the working mode is switched to the constant temperature mode.
[0126] Step 5: Record the target gas component and concentration and use it as a label. Repeat steps 1-4 10 times with the target gas of the same component and concentration until all target gas response data are collected.
[0127] The traditional constant temperature sensor array data set construction method is as follows:
[0128] Step 1: When the device is cold started, switch the working mode to constant temperature mode and preheat the gas sensor module to a stable state;
[0129] Step 2: After preheating is completed, adjust the mass flow controller to pass the target gas into the device until the set detection time threshold is reached;
[0130] Step 3: After the detection is completed, the mass flow controller is used to pass the ambient gas into the device until the set recovery time threshold is reached and the sensor signal returns to the stable state before the detection. The multi-dimensional response characteristic data of the gas sensing module is recorded and the working mode is changed.
[0131] Step 4: Record the target gas component and concentration and use them as labels. Repeat steps 1-3 10 times with the target gas of the same component and concentration until all target gas response data are collected.
[0132] The gas concentrations used in constructing the switch thermal cycle gas sensor array and constant temperature sensor array data sets are shown in the following table.
[0133] Correspondence between sample labels and gas concentrations
[0134]
[0135] The data comparison results are as follows:
[0136] Comparison of the accuracy of gas component identification methods using constant temperature sensing arrays
[0137]
[0138] Comparison of gas component identification accuracy using on-off thermal cycle modulation sensing arrays
[0139]
[0140]
[0141] From the accuracy comparison of the constant temperature sensor array gas component identification method, it can be seen that the gas component identification method proposed in the present invention has the best accuracy compared with the existing gas component identification method at the two sample time scales of 400s and 100s, which proves the effectiveness of the gas component identification method proposed in the present invention; by comparing the constant temperature sensor array gas component identification method and the switch thermal cycle modulation sensor array gas component identification method, it can be seen that the accuracy of the existing gas component identification method under the switch thermal cycle modulation data set is higher than that of the constant temperature data set, which proves the effectiveness of the switch thermal cycle modulation device proposed in the present invention.
[0142] 2. Comparison of Gas Concentration Identification Algorithm Accuracy
[0143] Comparison of the accuracy of methane gas concentration identification methods using traditional constant temperature sensor arrays
[0144]
[0145] Comparison of accuracy of methane gas concentration identification methods using on-off thermal cycle modulation sensor arrays
[0146]
[0147] In the methane gas concentration prediction scenario, the gas identification algorithm proposed in the present invention lags only behind the 1DCNN algorithm in the traditional constant temperature dataset, but in the switching thermal cycle dataset, the accuracy of the proposed algorithm is significantly better than other identification algorithms in both datasets, proving the effectiveness of the gas concentration identification algorithm proposed in the present invention; at the same time, the accuracy of all algorithms in the switching thermal cycle dataset is better than that in the constant temperature dataset, proving the effectiveness of the switching thermal cycle modulation device proposed in the present invention.
[0148] Accuracy comparison of acetylene gas concentration identification methods using traditional constant temperature sensor arrays
[0149]
[0150]
[0151] Accuracy comparison of acetylene gas concentration identification methods using on-off thermal cycle modulation sensor arrays
[0152]
[0153] In the acetylene gas concentration prediction scenario, the gas identification algorithm proposed in the present invention lags only behind the SVM algorithm in the traditional constant temperature dataset, but in the switching thermal cycle dataset, the accuracy of the proposed algorithm is significantly better than other identification algorithms in the two datasets, which proves the effectiveness of the gas concentration identification algorithm proposed in the present invention; at the same time, the accuracy of all algorithms in the switching thermal cycle dataset is better than that of the constant temperature dataset, which proves the effectiveness of the switching thermal cycle modulation device proposed in the present invention.
[0154] Comparison of the accuracy of methane concentration identification methods in mixed gases using traditional constant temperature sensing arrays
[0155]
[0156] Comparison of accuracy of methane gas concentration identification methods in mixed gases using on-off thermal cycle modulation sensor arrays
[0157]
[0158] Comparison of the accuracy of acetylene concentration identification methods in mixed gases using traditional constant temperature sensing arrays
[0159]
[0160] Comparison of accuracy of acetylene gas concentration identification methods in mixed gases using on-off thermal cycle modulation sensor arrays
[0161]
[0162] Conclusion: In the scenario of acetylene and gas concentration prediction in mixed gas, the algorithm proposed in this invention has significantly better accuracy than other recognition algorithms under two data sets, which proves the effectiveness of the gas concentration recognition algorithm proposed in this invention.
[0163] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A gas identification method based on on-off thermal cycle modulation, characterized in that: The steps include: Step 1: Setting up a gas sensor array for detecting the gas to be measured, a switch thermal cycle modulation module for cyclically heating the gas sensor array, and a gas identification module, wherein the gas identification module includes a classification model for identifying the type of the gas to be measured and a regression model for identifying the gas concentration; Step 2: preheating the gas sensor array to a stable state; Step 3: Turn on and off the thermal cycle modulation module to perform thermal cycle modulation heating, and allow the gas sensor array to maintain at least one complete thermal cycle modulation cycle in the ambient gas to obtain an initial sensor response value; Step 4: introducing the gas to be tested so that the gas sensor array is in the atmosphere of the gas to be tested until a set detection time threshold is reached to obtain multi-dimensional response characteristic data; the set detection time threshold is 10-40 thermal cycle modulation cycles; Step 5: Input the multi-dimensional response characteristic data into the gas identification module to obtain the gas types contained in the gas to be tested and the corresponding concentrations of each gas.
2. The gas identification method based on on-off thermal cycle modulation according to claim 1, characterized in that: The data processing method of the gas identification module is as follows: 1): Preprocess the multi-dimensional response feature data to obtain samples; 2): Input the sample into the classification model to obtain the gas types contained in the gas to be tested; 3): The classification results of the classification model and the samples are input into the regression model to obtain the concentration of each type of gas in the gas to be tested.
3. The gas identification method based on on-off thermal cycle modulation according to claim 2, characterized in that: The pretreatment method is as follows: 1.1): Use the difference quotient method to perform benchmark correction on multi-dimensional response characteristic data: S t ’=(S t -S0) / S0 Among them S t and S0 are the sensor response value and the initial value of the sensor response at the tth moment, respectively. t ' is the sensor response value at the tth moment after reference correction; 1.2): The sensor response value after reference correction is divided into L time periods according to the switching thermal cycle adjustment period, and each switching thermal cycle modulation period is a time period.
4. The gas identification method based on on-off thermal cycle modulation according to claim 1, characterized in that: The data processing method of the classification model is as follows: 2.1): Construct a sample set. A training sample in the sample set consists of the response values of n sensors in L time periods. The response values of n sensors in a time period are sent to the 1DCNN module to extract the response features of n sensors in the time period. The input X of the 1DCNN module is a real-valued matrix, expressed as Where T represents the number of samples in a time period, n represents the number of sensors, represents the field of real numbers; 2.1.1): The response values of n sensors are fed into 1DCNN. The formula is described as follows: Among them, F i (k) represents the output of the kth convolution kernel at position i, K represents the width of the convolution kernel, is the convolution weight, b (k) is the bias term, X i+j,c Represents the value of the input signal at time step i+j and the cth channel; 2.1.2): After convolution, the feature batch normalization and nonlinear mapping are performed. The formula is described as follows: Among them, μ B , δ B 2 Represent the mean and variance of the batch samples, F i (k) Represents the value of the kth convolution kernel at position i, ε represents a very small positive number to prevent division by zero, represents the normalized value of the kth convolution kernel at position i, γ and β are learnable parameters, and F i BN(k) is the batch normalized output of the kth convolution kernel at position i, ReLU(·) is the ReLU activation function, F i out(k) is the output value of the kth convolution kernel after activation at position i. 2.1.3): Adaptive average pooling is used to compress feature dimensions. The formula is as follows: Among them, S i represents the pooling area, s i is the number of regional elements; 2.2): The features extracted by the 1DCNN module are fed into the self-attention module for feature enhancement; 2.2.1): Output feature F pool Denoted as F, the query vector Q = FW is obtained through linear transformation Q , key vector K = FW K , value vector V = FW V , where W Q , W K , W V is the trainable weight matrix; 2.2.2): Calculate the attention matrix A and output the enhanced feature F α , the formula is described as follows: F α =OFF softmax() represents the normalization function, T represents the matrix transpose, d k Dimensions represented as key vectors; 2.2.3): Adaptive average pooling is used to compress and extract feature dimensions, stacking features from different time periods. The formula is as follows: Among them, L represents the number of time periods of a single sample, d represents the feature dimension of a single time period, and F α (i) represents the output features of the i-th time period strengthened by the attention mechanism, and represents the features of all time periods in a single sample; 2.2.4) The features F of all time periods all The data is fed into the transformer network to extract the correlation features of sensor responses in different time periods. 2.2.5): Flatten the associated features output by the transformer and feed them into the fully connected layer for classification training. Use the cross-entropy loss function to calculate the difference between the model prediction results and the true labels. Optimize the network parameters through backpropagation and retain the final classification model. The formula is described as follows: where z j represents the predicted value of the jth class of sample, z y is the label value of the real gas component, and C represents the total number of categories; 2.2.6): Load the final classification model, feed the preprocessed sensor response data into the final classification model to output the component identification result of the gas to be tested, and obtain the gas types contained in the gas to be tested.
5. The gas identification method based on on-off thermal cycle modulation according to claim 1, characterized in that: The data processing flow of the regression model is as follows: 3.1) Construct a sample set. A training sample in the sample set consists of the response values of n sensors in L time periods. The response values of n sensors in a time period are respectively sent to n 1DCNN modules to extract the response features of n sensors in the time period. The input of the 1DCNN module is represented by the matrix X i ∈R 1×T , where T represents the number of samples in each time period and i represents the i-th sensor: The response values of n sensors are fed into n 1DCNN modules respectively. The sensor responses are convolved three times with the convolution kernel scale decreasing in sequence. After convolution, the features are batch normalized and nonlinearly mapped. The formula is described as follows: Where k represents the number of convolutional layers, W i (k) and b i (k) are the weight and bias of the k-th convolution kernel, BN(·) is batch normalization, σ() is the nonlinear activation function; F i (k) Represents the output of k-layer convolution; 3.2): Adaptive maximum pooling is used to compress and extract feature dimensions: The 1DCNN convolution module output F of the i-th sensor (k) Denoted as F, the features of the same sensor at different time periods are stacked. The formula is as follows: in, represents the real domain feature vector of the i-th sensor in the j-th time period, represents the real domain feature vector of the i-th sensor in all time periods; 3.3): Introduce a trainable scalar weight coefficient for each sensor channel. The initial value is set to α = 1 / n, where n is the number of sensors. The formula is described as follows: in, is the weighted response value of the i-th sensor, S i is the response value of the i-th sensor, α i For S i The weight coefficient of 3.4): The features of n sensors in all time periods are fed into n transformers respectively to extract the correlation features of sensor responses in different time periods; 3.5): The features H output by n transformers i ∈R L×d After flattening, the data is concatenated and fed into a fully connected layer for regression training. The mean square error loss function is used to calculate the difference between the model prediction results and the actual notes. The mean square error loss function is used to obtain the final regression model. The network parameters are optimized through backpropagation to retain the final regression model. The formula is described as follows; h i =Flatten(H i ) h=Concat(h1,h2,...,h n ) Flatten() means flattening, H i represents the output of the i-th transformer model, h i Represents the output of the i-th transformer model after flattening, Concat() represents concatenation by dimension, h represents concatenation of all transformer model output values, and f() represents a fully connected layer. represents the regression prediction value of the regression model, and y j They represent the regression prediction value and label true value of the jth sample, respectively, and m represents the number of samples in the batch; 3.6): Load the final regression model and feed the preprocessed sensor response data into the model to output the gas component identification results.
6. The gas identification method based on on-off thermal cycle modulation according to claim 4 or 5, characterized in that: The sample set is divided into a training set, a validation set and a test set; the ratio of the training set, the validation set and the test set is 6:2:2; and the training process adopts five-fold cross validation.
7. A gas identification device based on on-off thermal cycle modulation, characterized in that: The gas identification device is used to implement the gas identification method based on switch thermal cycle modulation according to any one of claims 1 to 5; the gas identification device includes a switch thermal cycle signal generating module, a working mode switching module and a gas detection sensor module; The gas detection sensor module includes a detachable and replaceable metal oxide semiconductor gas sensor array and a signal acquisition system. The gas detection sensor module is used to detect the target gas, output a corresponding electrical signal response, and detect the gas type and content of each gas in the gas to be tested; The switch thermal cycle signal generating module is used to perform temperature modulation on the metal oxide semiconductor gas sensor array and the gas to be measured; The working mode switching module is used to turn off or on the switch thermal cycle signal generating module, so that it works in the constant temperature working mode or the switch thermal cycle working mode.
8. The gas identification device based on on-off thermal cycle modulation according to claim 7, characterized in that: The working mode switching module is a double-pole double-throw slide switch (K1), comprising six electrical connection points, namely a normally closed end (1) of the first pole, a common end (2) of the first pole, and a normally open end (3) of the first pole, and a normally closed end (4) of the second pole, a common end (5) of the second pole, and a normally open end (6) of the second pole; When the double-pole double-throw slide switch (K1) is in the first position, the normally closed end (1) of the first knife is connected to the common end (2) of the first knife, and the normally closed end (4) of the second knife is connected to the common end (5) of the second knife; when the double-pole double-throw slide switch (K1) slides to the second position, the common end (2) of the first knife at the connection point is connected to the normally open end (3) of the first knife, and the common end (5) of the second knife is connected to the normally open end (6) of the second knife; The gas sensor array includes sensor 1, sensor 2, sensor 3 and sensor 4; The switch thermal cycle signal generating module comprises a power supply line (VCC) and a ground line (GND), wherein the power supply line (VCC) is electrically connected to one end of a first adjustable resistor (VR1), a RESET pin of a timer, a VCC pin of a timer, a first normally closed end (1) of a double-pole double-throw slide switch (K1), a first heating resistor (R H1 ) one end, the first sensing resistor (R S1 ) one end, the second heating resistor of sensor 2 (R H2 ) one end, the second sensing resistor (R S2 ) one end, the third heating resistor (R H3 ) one end, the third sensing resistor (R S3 ) one end, the fourth heating resistor (R H4 ) and the fourth sensing resistor (R S4 ); the other end of the first adjustable resistor (VR1) is electrically connected to one end of the second adjustable resistor (VR2) and the DIS pin of the timer; the other end of the second adjustable resistor (VR2) is electrically connected to one end of the first capacitor (C1), the TRIG pin of the timer, the THR pin of the timer and the second normally closed end (4) of the slide switch (K1); the OUT pin of the timer is electrically connected to the common end (2) of the first switch; The grounding wire (GND) is electrically connected to the other end of the timing capacitor (C1), the GND pin of the timer, one end of the bypass capacitor (C0), the second common terminal (5), the source of the first MOS tube (Q1), one end of the sensor 1 load resistor (R1), one end of the sensor 2 load resistor (R2), one end of the sensor 3 load resistor (R3) and one end of the sensor 4 load resistor (R4); the other end of the sensor 1 load resistor (R1) is electrically connected to the sensor 1 sensing resistor (R S1 ) the other end of the load resistor (R2) of the sensor 2 is electrically connected to the sensing resistor (R S2 ) The other end of the load resistor (R3) of sensor three is electrically connected to the sensing resistor (R S3 ) the other end of the load resistor (R4) of sensor four is electrically connected to the sensing resistor (R S4 ); the other end of the bypass capacitor (C0) is electrically connected to the CTRL pin of the timer; the first common end (2) of the slide switch (K1) is electrically connected to the gate of the first MOS tube (Q1), and the drain of the first MOS tube (Q1) is electrically connected to the sensor heating resistor (R H1 ) and the other end of the sensor's second heating resistor (R H2 ) the other end of the sensor three heating resistors (R H3 ) and the other end of the sensor's four heating resistors (R H4 ) at the other end.
9. The gas identification device based on on-off thermal cycle modulation according to claim 8, characterized in that: The switch thermal cycle signal generating module generates a periodic pulse signal, the frequency of which is adjusted by the first adjustable resistor (VR1), the second adjustable resistor (VR2) and the timing capacitor (C1), and the periodic pulse signal is output from the timer OUT terminal; when the sliding switch K1 is in the first position, the supply voltage V CC The first normally closed end (1) of the double-pole double-throw slide switch (K1) is connected to the first common end (2) of the double-pole double-throw slide switch (K1), so that the first MOS tube (Q1) remains conductive, the heating resistor circuit of the gas sensor is conductive, and the sensor operates in a normal temperature mode. At the same time, the second normally closed end (4) of the double-pole double-throw slide switch (K1) is connected to the second common end (5) of the double-pole double-throw slide switch (K1), and the timing capacitor (C1) is discharged. When the double-pole double-throw slide switch (K1) is in the first position, the output of the timer OUT end is connected from the first normally open end (3) of the double-pole double-throw slide switch (K1) to the first common end (2) of the double-pole double-throw slide switch (K1), so that the first MOS tube (Q1) is periodically conductive, the heating resistor circuit of the gas sensor is periodically conductive, and the sensor operates in a switch thermal cycle modulation working mode.
10. The gas identification device based on on-off thermal cycle modulation according to claim 7, characterized in that: The signal acquisition system consists of a data acquisition card, a computer and computer software Labview. The data acquisition card is used to connect the metal oxide semiconductor gas sensor array and the computer, and the computer software Labview is used to obtain the analog signal of the metal oxide semiconductor gas sensor array in real time.
Citation Information
Patent Citations
Gas detection method based on combination of temperature modulation detection and PSO-SVM algorithm
CN113705100A
Harbor confined space operation safety environment monitoring method and system
CN118501210A
Mixed gas concentration detection method based on temperature modulation technology
CN119442905A