TDLAS trace gas concentration detection method based on pooled LSTM
By using the PP-LSTM model of pooled LSTM in TDLAS gas concentration detection, extracting high-level features and applying different loss functions, the problem of complex interference and weak signals in TDLAS detection is solved, and high-precision gas concentration detection is achieved.
Patent Information
- Application Number
- CN202010796156.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-10
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2040-08-10
AI Technical Summary
When TDLAS gas concentration detection method faces complex interference and weak signals, it is difficult to achieve high-precision detection, and the prior art has problems such as subjective parameter selection, limited adaptability, and uncertain signal description.
The PP-LSTM model based on pooled LSTM is used to perform deep learning processing on the TDLAS signal. By adding a pooling layer and two fully connected layers, the high-level features of the time series signal are extracted, and different loss functions are used during the training process to improve the model. adaptability.
It effectively reduces the impact of noise on trace signals and improves detection accuracy. Especially under a variety of different intensity noise conditions, the detection accuracy error reaches less than 1.5%, reducing the probability of model overfitting.
Smart Images

Figure CN111898744B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of gas concentration detection, and in particular to a TDLAS trace gas concentration detection method based on pooled LSTM. Background Art
[0002] Tunable Diode Laser Absorption Spectroscopy (TDLS) primarily utilizes the narrow linewidth and wavelength of tunable semiconductor lasers, which change with the injected current, to measure single or a few closely spaced, difficult-to-resolve absorption lines of molecules. It is widely used to obtain molecular structural information, study dynamic processes, and monitor and analyze trace gases, making it a commonly used trace gas detection method. However, because the laser modulation signal required for trace gas concentration detection is weak and subject to numerous interfering factors, such as optical interference fringes, electronic white noise, signal drift, pressure fluctuations, and optical path dust, the effective detection signal is often drowned out by the interference. Therefore, extracting weak signals in the presence of strong interference is crucial to improving the accuracy of TDLAS gas detection. Existing TDLAS gas concentration detection methods primarily employ time-domain analysis, frequency-domain analysis, wavelet analysis, correlation analysis, empirical mode decomposition, or a combination of these methods for noise removal. The core of these denoising methods is to analyze the differences between noise and signal patterns to develop a denoising strategy or construct a denoising model. Improving the accuracy of TDLAS gas concentration detection centers on denoising its second harmonic signal. Because the effective TDLAS gas signal is very weak (in the μV range), it is often lost in the noise. Traditional methods for removing noise from sequence signals have primarily focused on improving the signal-to-noise ratio (SNR) of TDLAS systems, including wavelet transform (WT) denoising, adaptive Savitzky-Golay (SG) denoising, and EMD-FCR denoising.
[0003] However, due to the complex mutual coupling mechanism between interference and interference, and interference and signal in TDLAS, simple signal analysis and processing methods are difficult to cover all situations, making TDLAS's precise gas concentration detection always facing challenges.
[0004] The existing technology has at least the following deficiencies:
[0005] 1. Due to the complex coupling mechanisms between interference and interference, and interference and signal in TDLAS, simple signal analysis and processing methods cannot cover all situations.
[0006] 2. Because TDLAS device noise is unknown or difficult to express analytically, existing technologies often face problems such as subjective parameter selection, limited adaptability, and uncertain signal description, making it difficult to further improve the accuracy of TDLAS trace gas detection.
[0007] 3. Because the effective TDLAS signal is very weak and often submerged in noise signals, existing technologies cannot effectively process trace signals in the presence of noise of varying intensities.
[0008] 4. For TDLAS signals, directly using a multi-layer cascaded LSTM network structure will cause information redundancy during training, and the model is prone to overfitting. Summary of the Invention
[0009] To address the technical issues existing in the prior art, this paper applies the LSTM network, a deep learning approach, to TDLAS gas concentration detection. The LSTM network is improved by adding a pooling layer and two fully connected layers. The model is trained through deep learning of the input signal and then applied to TDLAS gas concentration detection. Experimental verification demonstrates that the present invention, through the introduction of the PP-LSTM model and the training of the weighted model, can accurately detect gas concentrations.
[0010] The present invention provides a TDLAS trace gas concentration detection method based on pooled LSTM, comprising the following steps:
[0011] Step 1: Collect raw data and create a data set, which includes a training sample set and a test sample set;
[0012] Step 2: Downsample and normalize the dataset;
[0013] Step 3: Build a pooled LSTMPP-LSTM gas concentration detection model;
[0014] PP-LSTM is a Pooled Pyramid Long Short Term Memory (LSTM) network model. LSTM is a type of neural network that contains LSTM blocks. LSTM blocks are known as intelligent network units because they can memorize values of indefinite lengths of time, addressing the long-term dependency issues common in recurrent neural networks (RNNs).
[0015] The Max Pooling Layer performs a maximum pooling operation on the LSTM output to obtain coarse-grained features with a larger time span. The second layer LSTM2 is used to obtain higher-level global features. The two-layer LSTM network structure obtains the characteristic expression of input sequence information through learning; the last two layers are fully connected layer networks used for classification and regression of detection characteristics based on the front-end time series information features.
[0016] Step 4: Use the training sample set to perform concentration fitting regression training on the PP-LSTM gas concentration detection model constructed in step 3 using the gradient descent method;
[0017] Step 5: Use the PP-LSTM gas concentration detection model trained in step 4 to detect the test sample dataset and calculate the accuracy of the detection model.
[0018] Preferably, the step of constructing the PP-LSTM gas concentration detection model in step 3 includes:
[0019] The first layer of LSTM unit LSTM1 is used to perform preliminary signal feature extraction on the input signal;
[0020] The PP-LSTM network model analyzes the one-dimensional signal of TDLAS. The input signal X of LSTM1 1 , which is the one-dimensional time series signal collected by the TDLAS system:
[0021]
[0022] in,
[0023] T1 is the time series length of LSTM1.
[0024] The state output of each time series of LSTM1 is:
[0025]
[0026] Add a maximum pooling layer to perform maximum pooling on the output signal of the first layer LSTM unit LSTM1;
[0027] The maximum pooling layer takes the maximum value of the state output signal of each N LSTM1s, reducing the length of the data time series, reducing the amount of calculation, preventing "data redundancy", and reducing the probability of overfitting during training;
[0028] Introduce the maximum pooling layer, for the state output H of LSTM1 1 Perform the maximum pooling operation and take the maximum value of each N state output signal as the input X of LSTM2 2 :
[0029]
[0030] in,
[0031] T2 is the time series length of LSTM2.
[0032]
[0033] in,
[0034] N is the pooling stride.
[0035] The second layer LSTM unit LSTM2 is used to extract high-level features from the output signal of the maximum pooling layer, and the state output of the last time series of LSTM2 is used as the output of LSTM unit LSTM2;
[0036] The state output of each time series of LSTM2:
[0037]
[0038] The state output of the last time series of LSTM2 As the output of the LSTM network structure.
[0039] After the LSTM unit LSTM2, two fully connected layers are added to fit the nonlinear features. To improve the model's ability to fit nonlinear features, Input to two fully connected layers and output the detection value y of the TDLAS concentration signal pre
[0040] The PP-LSTM model improves the inductive bias strength and information expression capacity of the LSTM network for TDLAS signal expression.
[0041] Preferably, in step 4, different loss functions are used for training at different stages of the PP-LSTM gas concentration detection model training, and the training is stopped until the loss value of the network model drops to a preset range.
[0042] Preferably, the different loss functions are the absolute mean square error loss function and the relative mean square error loss function, and the formulas are as follows:
[0043]
[0044]
[0045] in,
[0046] m is the number of samples;
[0047] is the concentration detection value corresponding to the i-th sample of the model;
[0048] y i is the true value of the concentration of the i-th sample.
[0049] Loss1 is used to measure the absolute error between the concentration detection value and the true value, and loss2 is used to measure the relative error between the concentration detection value and the true value.
[0050] Using loss1 as the model's loss function during the initial training phase continuously reduced the absolute error between measured concentrations and true values. After a certain number of training cycles with loss1, the value of loss1 no longer fluctuated significantly. We then switched to loss2 as the loss function and continued training. This approach performed better than using either loss1 or loss2 alone. However, using loss2 at the beginning of training did not result in a significant decrease in the value.
[0051] Preferably, the specific training process of the PP-LSTM gas concentration detection model includes:
[0052] S01: During the training process, the true concentration value is input into the PP-LSTM network model and the loss1 function is used as the loss function for training. The loss1 loss function value will oscillate and decrease until the decrease of loss1 between adjacent iterations is , where:
[0053]
[0054] S02: Replace the loss2 function as the loss function and continue training based on the loss1 function training. Loss2 oscillates and decreases until the decrease rate of loss2 between adjacent iterations is , where:
[0055]
[0056] S03: Stop training and save the training weight model.
[0057] Preferably, in step 1, a TDLAS device is used to collect different gas concentration data at different frequencies.
[0058] Preferably, 80% of the collected original data is randomly selected as a training sample set, and the remaining data is used as a test sample set.
[0059] Preferably, in step 2, each set of sequence signals is downsampled to the same number of sequence signals while ensuring that the waveform of each set of sequence signals is not distorted, and the sequence signal value of each set of data is linearly normalized to [-1, 1].
[0060] Preferably, in step five, the trained PP-LSTM gas concentration detection model is used to perform batch detection on the concentration of the test sample set, and the concentration detection results are output in batches and compared with the actual concentrations to calculate the detection accuracy of the detection model for the test data set.
[0061] Preferably, the detection accuracy indicator is relative error:
[0062] The calculation formula is as follows:
[0063]
[0064] in,
[0065] y is the true concentration of the test data;
[0066] y pre is the detection concentration of this group of sample data by the PP-LSTM model;
[0067] is the relative error of this set of data.
[0068] Compared with the prior art, the present invention has the following beneficial effects:
[0069] 1. This invention draws on the idea of using deep neural networks and uses LSTM layers as the basic structural unit. This technology can fit the vast majority of training samples and can also reduce the impact of various noise intensities on trace signals.
[0070] 2. By adding a pooling layer between two LSTM layers, the present invention creates a pyramidal structure. This network structure can extract features on larger timescales in time series signals, reducing redundant information during training and improving detection accuracy. Specifically, for TDLAS trace gas detection, the detection accuracy error on a given methane TDLAS dataset was reduced to less than 1.5%.
[0071] 3. By adopting a pyramid multi-scale structure, the present invention effectively reduces the dimension of features and time series at the high level of the network, reducing the probability of network overfitting;
[0072] 4. The present invention uses two loss functions in stages during the training process, which more effectively ensures that the loss function drops quickly to a sufficiently small value. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 This is a schematic diagram of the PP-LSTM network model of the present invention.
[0074] Figure 2 It is a network model with multiple layers of LSTM units cascaded.
[0075] Figure 3 This is a schematic diagram of the PP-LSTM network model in Example 1 of the present invention.
[0076] Figures 4a to 4jIt is a fitted distribution diagram of the detection values of each type of concentration in Example 1 of the present invention, including multiple curve graphs; for the detection results of each type of concentration in the test set, the frequency histogram of the detection concentration values and the normal distribution curve obtained by fitting are visualized (Note: the area enclosed by the histogram, curve and horizontal axis is set to 1), and the detection results of each type of concentration present a normal distribution with the true concentration value as the mean.
[0077] Figure 4a The distribution of the test results for a concentration of 1 ppm on the test set in Example 1 of the present invention;
[0078] Figure 4b The distribution of the test results for a concentration of 3 ppm on the test set in Example 1 of the present invention;
[0079] Figure 4c The distribution of the test results for a concentration of 6.1 ppm on the test set in Example 1 of the present invention;
[0080] Figure 4d The distribution of the test results for a concentration of 8 ppm on the test set in Example 1 of the present invention;
[0081] Figure 4e The distribution of the test results for the concentration of 9.72 ppm in Example 1 of the present invention on the test set;
[0082] Figure 4f The distribution of the test results for a concentration of 50 ppm on the test set in Example 1 of the present invention;
[0083] Figure 4g The distribution of the test results for a concentration of 70.8 ppm on the test set in Example 1 of the present invention;
[0084] Figure 4h The distribution of test results for a concentration of 150 ppm on the test set in Example 1 of the present invention;
[0085] Figure 4i The distribution of test results for a concentration of 200 ppm on the test set in Example 1 of the present invention;
[0086] Figure 4j The distribution of test results for a concentration of 253 ppm on the test set in Example 1 of the present invention;
[0087] Figure 5 This is a flow chart of the TDLAS trace gas concentration detection method based on pooled LSTM PP-LSTM of the present invention.
[0088] Figure 6 This is a graph showing the changing trend of the loss value when loss2 is used as the loss function at the beginning of training and the number of training iterations increases.
[0089] Figure 7a The loss function used in the initial stage of training is loss2, and the loss value changes as the number of training iterations increases;
[0090] Figure 7b In order to use different loss functions in stages, loss1 is used as the loss function in the initial stage of training, and then loss2 is replaced as the loss function. The trend chart of the loss value changes as the number of training iterations increases. DETAILED DESCRIPTION
[0091] The following is combined with Figure 1-3 , Figure 4a-4j , Figure 5 、 Figure 6 、 Figure 7a and Figure 7b , the specific implementation methods of the present invention are described in detail.
[0092] The present invention provides a TDLAS trace gas concentration detection method based on pooled LSTM PP-LSTM, comprising the following steps:
[0093] Step 1: Collect raw data and create a data set, which includes a training sample set and a test sample set;
[0094] Step 2: Downsample and normalize the dataset;
[0095] Step 3: Build a pooled LSTMPP-LSTM gas concentration detection model;
[0096] The Max Pooling Layer performs a maximum pooling operation on the LSTM output to obtain coarse-grained features with a larger time span. The second layer LSTM2 is used to obtain higher-level global features. The two-layer LSTM network structure obtains the characteristic expression of input sequence information through learning; the last two layers are fully connected layer networks used for classification and regression of detection characteristics based on the front-end time series information features.
[0097] Step 4: Use the training sample set to perform concentration fitting regression training on the PP-LSTM gas concentration detection model constructed in step 3 using the gradient descent method;
[0098] Step 5: Use the PP-LSTM gas concentration detection model trained in step 4 to detect the test sample dataset and calculate the accuracy of the detection model.
[0099] As a preferred embodiment, the step of constructing the PP-LSTM gas concentration detection model in step 3 includes:
[0100] The first layer of LSTM unit LSTM1 is used to perform preliminary signal feature extraction on the input signal;
[0101] The PP-LSTM network model analyzes the one-dimensional signal of TDLAS. The input signal X of LSTM1 1 , which is the one-dimensional time series signal collected by the TDLAS system:
[0102]
[0103] in,
[0104] T1 is the time series length of LSTM1.
[0105] The state output of each time series of LSTM1 is:
[0106]
[0107] Add a maximum pooling layer to perform maximum pooling on the output signal of the first layer LSTM unit LSTM1;
[0108] The maximum pooling layer takes the maximum value of the state output signal of each N LSTM1s, reducing the length of the data time series, reducing the amount of calculation, preventing "data redundancy", and reducing the probability of overfitting during training;
[0109] Introduce the maximum pooling layer, for the state output H of LSTM1 1 Perform the maximum pooling operation and take the maximum value of each N state output signal as the input X of LSTM2 2 :
[0110]
[0111] in,
[0112] T2 is the time series length of LSTM2.
[0113]
[0114] in,
[0115] N is the pooling stride.
[0116] The second layer LSTM unit LSTM2 is used to extract high-level features from the output signal of the maximum pooling layer, and the state output of the last time series of LSTM2 is used as the output of LSTM unit LSTM2;
[0117] The state output of each time series of LSTM2:
[0118]
[0119] The state output of the last time series of LSTM2 As the output of the LSTM network structure.
[0120] After the LSTM unit LSTM2, two fully connected layers are added to fit the nonlinear features. To improve the model's ability to fit nonlinear features, Input to two fully connected layers and output the detection value y of the TDLAS concentration signal pre
[0121] The PP-LSTM model improves the inductive bias strength and information expression capacity of the LSTM network for TDLAS signal expression.
[0122] As a preferred implementation, in step 4, different loss functions are used for training at different stages of the PP-LSTM gas concentration detection model training until the network model loss value drops to a preset range and the training is stopped.
[0123] As a preferred embodiment, the different loss functions are the absolute mean square error loss function and the relative mean square error loss function, and the formulas are as follows:
[0124]
[0125]
[0126] in,
[0127] m is the number of samples;
[0128] is the concentration detection value corresponding to the i-th sample of the model;
[0129] y i is the true value of the concentration of the i-th sample.
[0130] Loss1 is used to measure the absolute error between the concentration detection value and the true value, and loss2 is used to measure the relative error between the concentration detection value and the true value.
[0131] Using loss1 as the model's loss function during the initial training phase continuously reduced the absolute error between measured concentrations and true values. After a certain number of training cycles with loss1, the value of loss1 no longer fluctuated significantly. We then switched to loss2 as the loss function and continued training. This approach performed better than using either loss1 or loss2 alone. However, using loss2 at the beginning of training did not result in a significant decrease in the value.
[0132] As a preferred embodiment, the specific training process of the PP-LSTM gas concentration detection model includes:
[0133] S01: During the training process, the true concentration value is input into the PP-LSTM network model and the loss1 function is used as the loss function for training. The loss1 loss function value will oscillate and decrease until the decrease of loss1 between adjacent iterations is , where:
[0134]
[0135] S02: Replace the loss2 function as the loss function and continue training based on the loss1 function training. Loss2 oscillates and decreases until the decrease rate of loss2 between adjacent iterations is , where:
[0136]
[0137] S03: Stop training and save the training weight model.
[0138] As a preferred embodiment, in step 1, a TDLAS device is used to collect different gas concentration data at different frequencies.
[0139] As a preferred embodiment, 80% of the collected original data is randomly selected as a training sample set, and the remaining data is used as a test sample set.
[0140] As a preferred embodiment, in step 2, each set of sequence signals is downsampled to the same number of sequence signals while ensuring that the waveform of each set of sequence signals is not distorted, and the sequence signal value of each set of data is linearly normalized to [-1, 1].
[0141] As a preferred embodiment, in step five, the trained PP-LSTM gas concentration detection model is used to perform batch detection on the concentration of the test sample set, and the concentration detection results are batch output and compared with the actual concentration to calculate the detection accuracy of the detection model for the test data set.
[0142] As a preferred embodiment, the detection accuracy indicator is relative error:
[0143] The calculation formula is as follows:
[0144]
[0145] in,
[0146] y is the true concentration of the test data;
[0147] y pre is the detection concentration of this group of sample data by the PP-LSTM model;
[0148] is the relative error of this set of data.
[0149] Example 1
[0150] According to a specific embodiment of the present invention, the present invention provides a TDLAS trace gas concentration detection method based on pooled LSTM, comprising the following steps:
[0151] Step 1: Collect raw data and create a data set, which includes a training sample set and a test sample set;
[0152] The TDLAS device was used to collect two sets of data with different gas concentrations at different frequencies. Since the frequencies set for the TDLAS system were different during the two data collections, 10,000 data points collected at the same time interval during the first collection constituted a data sequence of one cycle, and 500 data points collected at the same time interval during the second collection constituted a data sequence of one cycle. The total amount of data collected for each type of concentration sample is shown in Table 1:
[0153] Table 1. Data volume of samples with different concentrations collected twice
[0154]
[0155] For each type of concentration data, 80% of the samples were randomly selected as the training sample set, and the remaining samples were used as the test sample set to perform performance testing on the trained network model.
[0156] Step 2: Downsample and normalize the dataset;
[0157] Since the number of time series signals in each group of the experimental data collected twice is different, namely 10,000 and 500 respectively, each group of data is downsampled to 120 sequence signals while ensuring that the waveform of each group of sequence signals is not distorted, and the sequence signal values of each group of data are linearly normalized to [-1, 1].
[0158] Step 3: Build a pooled LSTMPP-LSTM gas concentration detection model;
[0159] As attached Figure 3 , the first layer LSTM unit LSTM1 is used to extract the initial signal features of the input signal; the one-dimensional time series signal collected by the TDLAS system is preprocessed as the input signal X 1 Input into LSTM1, the time series length of LSTM1 is T1=120.
[0160] Add a maximum pooling layer to perform a maximum pooling operation on the output signal of the first layer LSTM unit LSTM1, and take the maximum value of each N state output signal; for the state output H of LSTM1 1Perform the maximum pooling operation and take the maximum value of each 3-state output signal as the input signal X of LSTM2 2 , the time series length of LSTM2
[0161] The second layer LSTM unit LSTM2 is used to perform global coarse-grained feature extraction on the output signal of the maximum pooling layer. The state output of the last time series of LSTM2 is used as the output of LSTM unit LSTM2.
[0162] After the LSTM unit LSTM2, add two fully connected layers to fit the nonlinear features; output the state of the last time series of LSTM2 Input into the two fully connected layers, and the output is the detection value y of the TDLAS concentration signal pre .
[0163] Step 4: Train the PP-LSTM gas concentration detection model constructed in step 3;
[0164] The training sample set is trained using the dataset produced in step 2 and the PP-LSTM network model constructed in step 3. Different loss functions are selected at different stages of training until the loss value of the network model drops to an allowable range and the training is stopped.
[0165] For the PP-LSTM network model, two different loss functions are used to train the network model. These two loss functions are the absolute mean square error loss function and the relative mean square error loss function. The formulas are as follows:
[0166]
[0167]
[0168] in,
[0169] m is the number of samples;
[0170] is the concentration detection value corresponding to the i-th sample of the model;
[0171] y i is the true value of the concentration of the i-th sample.
[0172] Loss1 is used to measure the absolute error between the concentration detection value and the true value, and loss2 is used to measure the relative error between the concentration detection value and the true value.
[0173] Using loss1 as the model's loss function during the initial training phase continuously reduced the absolute error between measured concentrations and true values. After a certain number of training cycles with loss1, the value of loss1 no longer fluctuated significantly. We then switched to loss2 as the loss function and continued training. This approach performed better than using either loss1 or loss2 alone. However, using loss2 at the beginning of training did not result in a significant decrease in the value.
[0174] As attached Figure 6 In the initial stage of training, loss2 is used as the loss function. As the number of training iterations increases, the loss value does not decrease significantly. Figure 7a and attached Figure 7b To use the loss function in stages, first use loss1 as the loss function, and then replace it with loss2 as the loss function, which can ensure that the loss function can be reduced to a small enough level.
[0175] The specific training process of the PP-LSTM gas detection network model is as follows:
[0176] For the concentration values corresponding to each set of sequence signals, no processing is done, and the true concentration values are input into the PP-LSTM network model for training during the training process.
[0177] S01: During the training process, the loss1 function is first used as the loss function for training. The loss1 loss function value will oscillate and decrease until the decrease of loss1 between adjacent iterations is , where:
[0178]
[0179] S02: Replace the loss2 function as the loss function and continue training based on the loss1 function training. Loss2 oscillates and decreases until the decrease rate of loss2 between adjacent iterations is , where:
[0180]
[0181] S03: Stop training and save the training weight model.
[0182] Step 5: Use the PP-LSTM gas concentration detection model trained in step 4 to detect the test set sample data and calculate the detection accuracy of the model;
[0183] The test sample set is input into the trained PP-LSTM gas concentration detection model for batch detection. The relative error is calculated and used as an indicator to evaluate the accuracy of the model. The relative error calculation formula is as follows:
[0184]
[0185] in:
[0186] y is the true concentration of the test data;
[0187] y pre is the detection concentration of this group of sample data by the PP-LSTM model;
[0188] is the relative error of this set of data.
[0189] The detection error of each type of concentration is the average value of the detection error of each group of data of that type of concentration, and the overall error is the average value of the detection error of all concentration data. The test results are shown in Table 2:
[0190] Table 2. Test set test results
[0191]
[0192] From the results in the above table, we can see that similar Figure 2 The LSTM cascade structure shown above, which directly uses a two-layer LSTM cascade structure for training on the above dataset, fails to converge the network model, resulting in extremely large test errors and no reference value. However, using the PP-LSTM model structure of the present invention, the relative errors in detecting the concentrations of ten gas types are very small, reaching a relative error of 0.69% for the entire test set. This specific example further demonstrates that the PP-LSTM model of the present invention is capable of highly accurate concentration detection of one-dimensional TDLAS sequence signals.
[0193] According to the test results in Table 2, the detection values of the test data of each type of concentration are visualized, and the mean and standard deviation of the detection values of each type of concentration are calculated. The normal distribution curve is fitted as shown in Figure 4. It can be seen that the detection results of each type of concentration basically present a normal distribution with the true concentration as the mean.
[0194] The present invention provides a TDLAS trace gas concentration detection method based on a pooled LSTM. This method is used to perform data acquisition and processing, model construction, model training, and sample data detection on the aforementioned embodiment. The results in Figure 4 demonstrate that the method employed by the present invention is superior to the LSTM cascade in processing TDLAS gas concentration detection. The present invention can accurately detect multiple concentration signals, and the detection results for each concentration type exhibit a normal distribution trend.
[0195] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. TDLAS trace gas concentration detection method based on pooled LSTM, characterized in that: The following steps are involved: Step 1: Collect original data and create a data set, which includes a training sample set and a test sample set; Step 2: Downsample and normalize the data set; Step 3: Build a pooled LSTMPP-LSTM gas concentration detection model; The steps to build the PP-LSTM gas concentration detection model include: The first layer of LSTM unit LSTM1 is used to perform preliminary signal feature extraction on the input signal; Add a maximum pooling layer to perform maximum pooling on the output signal of the first layer LSTM unit LSTM1; The second layer LSTM unit LSTM2 is used to extract high-level features from the output signal of the maximum pooling layer, and the state output of the last time series of LSTM2 is used as the output of LSTM unit LSTM2; After the LSTM unit LSTM2, two fully connected layers are added to fit the nonlinear features; Step 4: Use the training sample set to perform concentration fitting regression training on the PP-LSTM gas concentration detection model constructed in step 3 using the gradient descent method; Step 5: Use the PP-LSTM gas concentration detection model trained in step 4 to detect the test sample data set and calculate the accuracy of the detection model.
2. The TDLAS trace gas concentration detection method according to claim 1, characterized in that: In step 4, different loss functions are used for training at different stages of the PP-LSTM gas concentration detection model training until the network model loss value drops to a preset range and the training is stopped.
3. The TDLAS trace gas concentration detection method according to claim 2, characterized in that: The different loss functions are the absolute mean square error loss function and the relative mean square error loss function, and the formulas are as follows: in, m is the number of samples; is the concentration detection value corresponding to the i-th sample of the model; y i is the true value of the concentration of the ith sample.
4. The TDLAS trace gas concentration detection method according to claim 3, characterized in that: The specific training process of the PP-LSTM gas concentration detection model includes: S01: During the training process, the true concentration value is input into the PP-LSTM network model and the loss1 function is used as the loss function for training. The loss1 loss function value will oscillate and decrease until the decrease of loss1 between adjacent iterations is hour, in: S02: Replace the loss2 function as the loss function and continue training based on the loss1 function training. Loss2 oscillates and decreases until the decrease in loss2 between adjacent iterations is , where: S03: Stop training and save the training weight model.
5. The TDLAS trace gas concentration detection method according to claim 1, characterized in that: In step 1, the TDLAS device is used to collect different gas concentration data at different frequencies.
6. The TDLAS trace gas concentration detection method according to claim 5, characterized in that: For the collected original data, 80% is randomly selected as the training sample set, and the rest of the data is used as the test sample set.
7. The gas concentration detection method according to claim 1, characterized in that: In step 2, under the condition that the waveform of each group of sequence signals is not distorted, it is downsampled into the same number of sequence signals, and the sequence signal value of each group of data is linearly normalized to [-1,1].
8. The TDLAS trace gas concentration detection method according to claim 1, characterized in that: In step five, the trained PP-LSTM gas concentration detection model is used to perform batch detection on the concentration of the test sample set, and the concentration detection results of the samples are batch output and compared with the actual concentration to calculate the detection accuracy of the detection model for the test data set.
9. The TDLAS trace gas concentration detection method according to claim 8, characterized in that: The detection accuracy index is the relative error: The calculation formula is as follows: in: y is the true concentration of the test data; y pre is the detection concentration of this group of sample data by the PP-LSTM model; is the relative error of this group of data.
Citation Information
Patent Citations
Secondary combustion chamber high-temperature gas concentration detection method, system and device based on convolutional neural network and storage medium
CN111007035A