A hydrogen leak monitoring method based on deep learning algorithm
By constructing a semiconductor gas sensor array and a deep learning algorithm network model, the selectivity and accuracy issues of semiconductor sensors in hydrogen detection were solved, enabling precise hydrogen leak monitoring in complex environments.
Patent Information
- Application Number
- CN202410371958.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-03-29
AI Technical Summary
Existing semiconductor gas sensors have poor selectivity and low accuracy when detecting hydrogen, making it difficult to achieve accurate detection in complex environments.
An array of multiple semiconductor resistive gas sensors is used, combined with a deep learning algorithm network model. The model is trained by collecting signal feature data of hydrogen and interfering gases, and identification and regression are performed using LSTM and bottleneck-CBAM framework structures. A threshold algorithm is then used to monitor hydrogen leaks.
It enables precise monitoring of hydrogen leaks in complex environments, improving the accuracy and selectivity of detection and reducing the false alarm rate.
Smart Images

Figure CN118245776B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gas leak monitoring, and more specifically, to a hydrogen leak monitoring method based on a deep learning algorithm. Background Technology
[0002] Hydrogen energy is a clean energy source with significant development potential, characterized by high energy density, high conversion efficiency, and wide application range. It can achieve low CO2 emissions during development and zero emissions during utilization, making it a key national strategy for most economies worldwide. However, hydrogen is a colorless and odorless flammable gas. When its volume concentration in the air exceeds 4.1%, it is highly susceptible to explosion, causing major safety accidents and property damage. Therefore, rapid monitoring of hydrogen leaks is crucial for promoting the sustainable and stable development of the hydrogen energy industry.
[0003] Semiconductor gas sensors are devices that convert information such as gas concentration and type into electrical signals. They detect gases by utilizing the change in resistance caused by the adsorption and reaction of gases on the surface of metal oxides. This is one of the most effective methods for real-time measurement of gas composition and concentration. They are characterized by simple manufacturing processes, low cost, wide applicability, and ease of integration, making them highly suitable for online monitoring of hydrogen leaks requiring a large number of monitoring points. However, due to the limitations of the semiconductor sensing principle and the universality of the sensing materials, existing technologies for these sensors have consistently faced the problem of poor selectivity, making it difficult to achieve accurate hydrogen detection in complex environments. Therefore, there is an urgent need to develop hydrogen leak monitoring technologies with high selectivity, high accuracy, and low cost to achieve rapid and accurate detection of hydrogen leaks in complex atmospheres. Summary of the Invention
[0004] 1. The technical problem to be solved by the present invention
[0005] The purpose of this invention is to provide a hydrogen leak monitoring method based on deep learning algorithms to solve the technical problem that existing semiconductor gas sensors have limited application due to poor selectivity and low accuracy when detecting hydrogen.
[0006] 2. Technical Solution
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] A hydrogen leak detection method based on deep learning algorithms includes the following steps:
[0009] S1. Assemble multiple gas sensors into a sensor array to form a gas acquisition module, and obtain transient change characteristic data of hydrogen concentration and output response as a hydrogen training dataset.
[0010] S2. Using a gas sensor array, collect signal data features of other interfering gases present in a real hydrogen leak scenario, and use them as a training dataset for interfering gases.
[0011] S3. Based on the hydrogen training dataset obtained in S1 and the interference gas training dataset obtained in S2, a deep learning algorithm network model is designed. All training datasets are preprocessed and then imported into the neural network for recognition and regression training to obtain the gas concentration.
[0012] S4. Set a threshold, use a threshold algorithm to filter out gas types with too low concentrations, and record the types of remaining gases and their corresponding concentrations.
[0013] S5. The deep learning algorithm network model is mounted on a microcontroller development board, and combined with the signal acquisition and processing module, data transmission module, and LCD display module, hydrogen leakage monitoring is realized.
[0014] Preferably, the gas sensor is a semiconductor resistive gas sensor, and the number of gas sensors used in the sensor array is 2 to 20.
[0015] Preferably, the sensitive material used in the semiconductor resistive gas sensor is one or more of tin oxide or palladium-modified tin oxide.
[0016] Preferably, the method for preparing the tin oxide sensitive material is as follows:
[0017] A1. Mix tin tetrachloride, deionized water, anhydrous ethanol, and dilute hydrochloric acid in a weight ratio of 0.1–5: 10–200: 1: 0.01–1;
[0018] A2. React the mixture at 120–220 °C for 5–48 hours;
[0019] A3. Solid-liquid separation and washing are performed to obtain tin oxide sensitive material, which is used as a gas-sensitive material for semiconductor gas sensors.
[0020] Preferably, the method for preparing the palladium particle-modified tin oxide sensitive material is as follows:
[0021] B1. Disperse tin oxide and palladium nitrate in deionized water at a weight ratio of 1:0.001 to 10 and stir for 5 to 72 hours.
[0022] B2. Perform solid-liquid separation and washing;
[0023] B3. Disperse the separated tin oxide material and sodium borohydride in deionized water at a weight ratio of 1:0.005-1, and stir for 5-72 hours.
[0024] B4. Perform secondary solid-liquid separation to obtain palladium-modified tin oxide material, which is used as a gas-sensitive material for semiconductor gas sensors.
[0025] Preferably, the other interfering gases include, but are not limited to, one or more of methane, nitrogen dioxide, carbon monoxide, ethanol, and acetone.
[0026] Preferably, the deep learning algorithm network is a serial structure of LSTM and bottleneck-CBAM framework. It is first processed by bottleneck-CBAM, which includes two 1×1 convolutions and one 3×1 convolution. The output after being processed by the CBAM algorithm is added to the output data of the original data after the 3×1 convolution to obtain the data output by bottleneck-CBAM. After scaling, this data is processed by the LSTM algorithm, and then passed through a linear regressor to finally obtain the gas composition and output concentration information.
[0027] Preferably, the identification and regression training specifically includes the following: dividing the training set and the test set according to 70% and 30% respectively, importing the training dataset into the deep learning algorithm network for training, with 50 to 500 training iterations, a learning rate of 0.001 to 0.2, and a batch size of 50 to 500, and then inputting the test dataset into the neural algorithm network, and comparing the output results with the gas concentration of the actual test set.
[0028] Preferably, the threshold in S4 is obtained by comparing the predicted result after the test data is input into the network with the actual test label. Each gas corresponds to a threshold concentration, and the threshold is adopted as follows:
[0029] T i = Max ( P 1, P 2,…, P n )
[0030] In the formula, i Indicates the first i Gas-like T i Indicates the first i Threshold for gas-like substances; P n Indicates the first n The concentration of the gas is predicted by inputting test data with a concentration of 0 from a labeled dataset into the network.
[0031] Preferably, the specific method for mounting the deep learning algorithm network on a microcontroller in S5 is as follows:
[0032] C1. Convert the trained algorithm network model from a .pt file to a generic model file .onnx;
[0033] C2. Select the STM32f407ZGT6 microcontroller, use STM32cubemx to enable ADC, UART, and LCD functions, and simultaneously enable the Cubeai function to import the saved .onnx model;
[0034] C3. Generate C language code, write the code for UART, ADC, Lcd, and algorithm network data input and output, and then compile it;
[0035] C4. Burn the compiled file into the STM32f407ZGT6 microcontroller.
[0036] 3. Beneficial effects
[0037] (1) The hydrogen leakage monitoring method proposed in this invention adopts a semiconductor gas sensor array structure. Through the collaborative work of multiple gas sensors, the characteristic signals of hydrogen and possible interfering gases are collected simultaneously. Combined with a deep learning algorithm network model, the method is trained based on the different gas signal characteristic data collected by the semiconductor gas sensor array. This enables accurate monitoring of hydrogen leakage in complex environments and solves the problems of low accuracy and large concentration error when using a single sensor to monitor hydrogen leakage in the prior art.
[0038] (2) This invention proposes a deep learning algorithm that adopts a serial structure of LSTM and bottleneck-CBAM framework. The deep learning algorithm network can be imported and mounted on a microcontroller development board. On the one hand, it can achieve a small error index of the algorithm network and provide high classification accuracy when combined with the threshold algorithm. In practical applications, it can perform high-accuracy hydrogen leakage monitoring with low false positive rate. On the other hand, it can enable the device to still receive gas sensor data in areas with poor network conditions and perform hydrogen leakage data monitoring. Attached Figure Description
[0039] Figure 1 This is a simplified flowchart of a hydrogen leak monitoring method based on a deep learning algorithm proposed in this invention.
[0040] Figure 2 This is a detailed flowchart of a hydrogen leak monitoring method based on a deep learning algorithm proposed in this invention;
[0041] Figure 3 The following are the resistance response diagrams of the four sensors proposed in Embodiment 1 of this invention;
[0042] Figure 4This is a network framework diagram of the deep learning algorithm model proposed in Embodiment 1 of the present invention. Detailed Implementation
[0043] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0044] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0045] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0046] Example 1:
[0047] Please see Figure 1-2 This invention proposes a hydrogen leak monitoring method based on deep learning algorithms, specifically including the following:
[0048] (1) Sensor fabrication:
[0049] Disperse 0.8 g of tin tetrachloride pentahydrate in a 50 mL mixture of ethanol and deionized water, maintaining a volume ratio of ethanol to deionized water of 5:1. Then, add 2 mL of concentrated hydrochloric acid to the mixture and stir for 30 minutes. Transfer the mixture to a reaction vessel and react at 200 °C for 12 hours. After the reaction, wash the product three times by centrifugation with anhydrous ethanol and deionized water, respectively. Finally, dry the product for subsequent use.
[0050] Disperse 100 mg of SnO2 powder in deionized water, then add 0.5 g of Pd(NO3)2 and stir for 48 hours. Next, add 10 mg of sodium borohydride and react for 24 hours. Wash the product three times by centrifugation with anhydrous ethanol and deionized water, respectively. Dry and store.
[0051] The pure SnO2 and Pd-modified tin oxide prepared above were used as gas-sensitive materials and coated onto a flat electrode to obtain four semiconductor gas sensors with different compositions.
[0052] (2) Data collection work:
[0053] 1. Place a sensor array consisting of four sensors into the test chamber. After the sensors stabilize, first collect the response characteristic data of the sensor array to hydrogen, and then sequentially collect the response characteristic data to other interfering gases. Compile all collected data into a master data table (AD), with the data in the master table sorted chronologically. Please refer to [link to relevant documentation]. Figure 3 The responses of the above four types of sensors to resistance are as follows: Figure 3 As shown.
[0054] 2. In the data annotation stage, a combination of time windows and indexes is used. The time steps are... α The value is set to 20, meaning the input network data consists of 20 consecutive response data points collected from all sensors. The starting index of each data set in the data table is placed in index list I1, and the concentration information data is placed in label list L1, completing the data labeling stage.
[0055] 3. During the data input phase into the network, the index list Idx and the concentration label list Con are shuffled. The training and test sets of the network are split according to 70% and 30% of the total number of index lists I1, respectively. The data input for network training consists of gas sensor data corresponding to 20 consecutive index values, including the starting index value, from the total data table. The specific function is as follows:
[0056] feature =( AD ( Idx i )), AD ( Idx i +1),…, AD ( Idx i +19)
[0057] AD ( Idx i )=( S i1 , S i2 , S i3 , S i4 )
[0058] label = Con ( i )
[0059] In the formula, i Indicates an index; Idx i express Idx Index list number i +1 data value, AD ( Idx i ) represents the first item in the AD data summary table. Idx i Each index corresponds to a value. S i1 No. Idx i The value measured by the first sensor in the corresponding index. S i2 ,S i3 ,S i4 Similarly. Con ( i In the concentration sequence Con The Middle i +1 data value.
[0060] (3) Network training and validation:
[0061] 1. During the parameter tuning phase, for the network's input parameters, set the batch_size to 200, the learning rate to 0.02, and the number of iterations to 200. Change the input data format to (b,c,t,1), where b represents the batch size, c represents the sensor type, and t represents the time step.
[0062] 2. The training phase of the network. Please refer to [link / reference]. Figure 4 The deep learning algorithm network is specifically a serial structure of LSTM and bottleneck-CBAM framework. It first passes through bottleneck-CBAM, which contains two 1×1 convolutions and one 3×1 convolution. The output of the CBAM algorithm is added to the output of the original data after the 3×1 convolution to obtain the output data of bottleneck-CBAM. After scaling, the data is processed by LSTM algorithm, and then passed through a linear regressor to finally obtain the gas composition and output concentration information.
[0063] The network optimizer uses the Adam optimizer, and the loss function uses the MSELOSS loss function. By taking the derivative of the directional gradient of the loss function, the optimizer updates the network parameters to make the model fit. The network code is written in PyTorch and the model is trained using an NVIDIA GPU Geforce-RTX-3060 graphics card.
[0064] 3. Network Result Validation Phase. After training, test data is imported into the network using the same input method as the training data, but without backpropagating or optimizing the network, to obtain the network's test results. MSE, RMSE, and RMS are used to evaluate the network's performance. 2Model metrics are used to evaluate the regression performance of the model, and the specific function is expressed as follows:
[0065]
[0066] In the formula, yi Indicates the actual gas concentration; Indicates the predicted gas concentration; n This represents the total number of data sets, as described below. yi , , n Similarly.
[0067] The smaller the MSE index, the better the model fit.
[0068]
[0069] The smaller the RMSE index, the better the model fits.
[0070]
[0071] R 2 The closer the value is to 1, the better the model fits.
[0072] (4) Model mounting:
[0073] 1. Convert the exported .pt file from the model to .onnx file format.
[0074] 2. Select the STM32F407ZGT6 microcontroller, use the STM32CubeMX tool to enable the signal acquisition and processing module, data transmission module, and LCD display module, and simultaneously enable the CubeAI module, importing the ONNX model file.
[0075] 3. Write module code to ensure the module functions correctly. Adjust the microcontroller's sampling frequency so that the sensor can sample 4 times per second. After the gas sensor collects data and the network processes it, add a threshold algorithm. This means that if the network detects a gas concentration below a certain level, it considers the gas to be absent. The threshold in the threshold algorithm uses the maximum value method; that is, the maximum predicted concentration of the gas after inputting test data from the test dataset where the gas concentration is marked as 0 into the network.
[0076] Ti = Max ( P 1, P 2,…, P n )
[0077] In the formula, i Indicates the first i Gases;T i Indicates the first i Threshold for gas-like substances P n Indicates the first n The concentration of the gas is predicted by inputting test data with a concentration of 0 from a labeled dataset into the network.
[0078] The data sampled by the gas sensor is processed through a neural network and a threshold algorithm, and finally the gas type and concentration information are displayed on the LCD screen.
[0079] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and its improved concept, should be covered within the scope of protection of the present invention.
Claims
1. A hydrogen leak monitoring method based on deep learning algorithms, characterized in that, Includes the following steps: S1. Assemble multiple gas sensors into a sensor array to form a gas acquisition module, and obtain transient change characteristic data of hydrogen concentration and output response as a hydrogen training dataset. S2. Using a gas sensor array, collect signal data features of other interfering gases present in a real hydrogen leak scenario, and use them as a training dataset for interfering gases. S3. Based on the hydrogen training dataset obtained in S1 and the interference gas training dataset obtained in S2, a deep learning algorithm network model is designed. All training datasets are preprocessed and then imported into the neural network for recognition and regression training to obtain gas concentration. The deep learning algorithm network is specifically a serial structure of LSTM and bottleneck-CBAM framework. It is first processed by bottleneck-CBAM, which contains two 1×1 convolutions and one 3×1 convolution. The output after CBAM processing is added to the output data after the original data has undergone 3×1 convolution to obtain the bottleneck-CBAM output data. After scaling, this data is processed by LSTM algorithm and then passed through a linear regressor to finally obtain the gas composition and output concentration information. S4. Set a threshold and use a threshold algorithm to filter out gas types with excessively low concentrations, recording the remaining gas types and their corresponding concentration information. The threshold is obtained by comparing the predicted results after inputting the test data into the network with the actual test labels. Each gas corresponds to a threshold concentration, and the method for adopting the threshold is as follows: T i = Max ( P 1, P 2,…, P n ) In the formula, i Indicates the first i Gas-like T i Indicates the first i Threshold for gas-like substances; P n Indicates the first n The concentration of the gas is predicted by inputting test data with a concentration of 0 from a labeled dataset into the network. S5. The deep learning algorithm network model is mounted on a microcontroller development board, and combined with the signal acquisition and processing module, data transmission module, and LCD display module, hydrogen leakage monitoring is realized.
2. The hydrogen leak monitoring method based on deep learning algorithm according to claim 1, characterized in that, The gas sensor is a semiconductor resistive gas sensor, and the number of gas sensors used in the sensor array is 2 to 20.
3. The hydrogen leak monitoring method based on deep learning algorithm according to claim 2, characterized in that, The sensitive material used in the semiconductor resistive gas sensor is one or more of tin oxide or palladium-modified tin oxide.
4. The hydrogen leak monitoring method based on deep learning algorithm according to claim 3, characterized in that, The method for preparing the tin oxide sensitive material is as follows: A1. Mix tin tetrachloride, deionized water, anhydrous ethanol, and dilute hydrochloric acid in a weight ratio of 0.1–5: 10–200: 1: 0.01–1; A2. React the mixture at 120–220 °C for 5–48 hours; A3. Solid-liquid separation and washing are performed to obtain tin oxide sensitive material, which is used as a gas-sensitive material for semiconductor gas sensors.
5. The hydrogen leak monitoring method based on deep learning algorithm according to claim 3, characterized in that, The method for preparing the palladium-modified tin oxide sensitive material is as follows: B1. Disperse tin oxide and palladium nitrate in deionized water at a weight ratio of 1:0.001 to 10 and stir for 5 to 72 hours. B2. Perform solid-liquid separation and washing; B3. Disperse the separated tin oxide material and sodium borohydride in deionized water at a weight ratio of 1:0.005-1, and stir for 5-72 hours. B4. Perform secondary solid-liquid separation to obtain palladium-modified tin oxide material, which is used as a gas-sensitive material for semiconductor gas sensors.
6. The hydrogen leak monitoring method based on deep learning algorithm according to claim 1, characterized in that, The other interfering gases include, but are not limited to, one or more of methane, nitrogen dioxide, carbon monoxide, ethanol, and acetone.
7. The hydrogen leak monitoring method based on deep learning algorithm according to claim 1, characterized in that, The identification and regression training specifically includes the following: The training and testing sets were divided into 70% and 30% respectively. The training dataset was imported into the deep learning algorithm network for training, with 50 to 500 training iterations, a learning rate of 0.001 to 0.2, and a batch size of 50 to 500. Then, the testing dataset was input into the neural algorithm network, and the output results were compared with the gas concentration of the actual test set.
8. The hydrogen leak monitoring method based on deep learning algorithm according to claim 1, characterized in that, The specific method for mounting the deep learning algorithm network described in S5 on a microcontroller is as follows: C1. Convert the trained algorithm network model from a .pt file to a generic model file .onnx; C2. Select the STM32f407ZGT6 microcontroller, use STM32cubemx to enable ADC, UART, and LCD functions, and simultaneously enable the Cubeai function to import the saved .onnx model; C3. Generate C language code, write the code for UART, ADC, Lcd, and algorithm network data input and output, and then compile it; C4. Burn the compiled file into the STM32f407ZGT6 microcontroller.
Citation Information
Patent Citations
Early-stage gas leakage monitoring method and system based on width learning
CN117454159A
Hail weather identification and classification method based on multi-channel deep residual shrinkage network
WO2023216583A1