NO and SO2 mixed gas concentration detection method based on deep learning
Through deep learning technology, a mixed gas concentration detection model composed of a bidirectional long and short-term memory network and a TCN+RNN network is used to solve the problems of cross-sensitivity and differential optical density separation in the detection of mixed gases of NO and SO2, and achieve efficient and accurate gas concentration detection.
Patent Information
- Application Number
- CN202411664543.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-11
AI Technical Summary
The prior art has cross-sensitivity problems and the difficulty in accurately separating differential optical density in detecting mixed gases of NO and SO2, and it is difficult for traditional signal processing methods to achieve accurate gas concentration detection.
Using a deep learning-based method, a mixed gas concentration detection model composed of a bidirectional long and short-term memory network and a TCN+RNN network is used to achieve accurate detection of NO and SO2 concentrations through two stages of spectral separation and reconstruction and concentration detection.
It realizes rapid and accurate detection of NO and SO2 concentrations, overcomes the cross-sensitivity problems and the limitations of traditional methods, and improves the accuracy and efficiency of gas concentration detection.
Smart Images

Figure CN119595565A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence and polluted gas monitoring, and in particular to a method for detecting the concentration of NO and SO2 mixed gas based on deep learning. Background Art
[0002] Sulfur dioxide (SO2) and nitric oxide (NO), as important air pollutants, pose a serious threat to the environment and human health. Therefore, accurate and rapid detection of the concentration of these two gases is crucial for environmental protection and public health.
[0003] In the field of gas detection, although traditional physical or chemical detection methods have high accuracy, they usually have limitations such as expensive equipment, complex operation, and poor real-time performance. In the field of spectral analysis, especially in mixed gas spectral analysis, the traditional least squares method has its application basis, but it also has some significant disadvantages. In spectral analysis, the least squares method is prone to cause measurement errors to deviate from the normal distribution due to the mutual influence between components and the influence of noise, thus affecting the accuracy of the analysis results. There is often redundant information in spectral data, which will lead to the singularity of the spectral matrix, making the least squares operation difficult to implement or the results inaccurate. Secondly, some studies have also performed fast Fourier transform on gas signals, identified and decomposed the target gas characteristic frequency from the mixed gas signal according to the difference in the signal characteristic frequency distribution, and then performed inverse fast Fourier transform to reconstruct the target gas signal. However, there is still an inevitable cross-interference problem of overlapping absorption lines in the reconstructed signal. On the one hand, to improve the sensitivity of the system, it is necessary to use the most sensitive band; but on the other hand, the most sensitive band often has cross-sensitivity problems, which directly affects the measurement accuracy. These drawbacks have limited the spectral analysis of mixed gases to a certain extent, and deep learning technology provides a new way to solve these problems. By training the deep learning model, it can identify the spectral characteristics of different gases, thereby achieving accurate measurement of each component in the mixed gas.
[0004] Through the analysis of the absorption spectrum, it is found that the absorption bands of SO2 are mainly 200-230nm, 280-320nm, and 340-390nm. However, the absorption spectrum of SO2 at 200-230nm is ten times higher than that at 280-320nm and 340-390nm, and the signal-to-noise ratio is high. Therefore, it is considered to select the band 200-230nm to monitor the SO2 concentration. However, the absorption band of NO is also mainly 200-230nm. In this band, the absorption spectra of SO2 and NO will overlap together, so it is necessary to extract the differential optical density information of SO2 and NO from the differential optical density of the mixed gas in order to monitor their concentration values.
[0005] In recent years, with the rapid development of deep learning technology, its application in the field of gas detection has gradually increased. Deep learning algorithms can automatically extract characteristic information from gas spectra and realize fast and accurate gas concentration detection.
[0006] To this end, the present invention designs a NO and SO2 mixed gas concentration detection method based on deep learning to achieve mixed gas spectral separation and NO and SO2 concentration detection, providing more effective and accurate technical support for air pollution monitoring and control. Summary of the invention
[0007] In view of the shortcomings of the above-mentioned prior art, the present invention provides a method for detecting the concentration of NO and SO2 mixed gases based on deep learning. The method realizes spectral separation of the mixed gas and detection of NO and SO2 concentrations through a mixed gas concentration detection model composed of a bidirectional long short-term memory network and a TCN+RNN network, overcoming the problems of cross-sensitivity of SO2 and NO and the inability of traditional signal processing methods to accurately separate the differential optics of SO2 and NO, and there is no need to accurately obtain the gas differential absorption cross-section.
[0008] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0009] A NO and SO2 mixed gas concentration detection method based on deep learning, which obtains the NO and SO2 mixed gas to be detected, inputs the NO and SO2 mixed gas to be detected into a trained mixed gas concentration detection model, and outputs the concentration detection results of each single gas of NO and SO2;
[0010] The mixed gas concentration detection model includes a separation and reconstruction model based on a bidirectional long short-term memory network and a concentration detection model based on a TCN+RNN network; the mixed gas concentration detection model uses the input NO and SO2 mixed gas to be detected as the input of the separation and reconstruction model based on the bidirectional long short-term memory network, performs mixed gas spectrum separation and reconstruction, so as to obtain the differential optical density of two single gases, NO and SO2, as the output of the separation and reconstruction model at one time, and then uses the output of the separation and reconstruction model based on the bidirectional long short-term memory network as the input of the concentration detection model based on the TCN+RNN network, performs feature extraction on the input sequence data and performs concentration prediction, so as to obtain the concentration detection results of each single gas, NO and SO2, as the output.
[0011] The above-mentioned NO and SO2 mixed gas concentration detection method based on deep learning is, as a preferred solution, the acquisition of the NO and SO2 mixed gas to be detected is achieved by the following steps:
[0012] Pure nitrogen, SO2 with a preset standard concentration, and NO gas with a preset standard concentration are diluted and mixed by a gas mixing instrument to obtain mixed gases with different concentration ratios;
[0013] The mixed gas is introduced into the gas chamber through a hose, and after being stabilized, a xenon light is emitted from a light source into the gas chamber, and after being reflected by a concave mirror, the mixed gas is received by a spectrometer and spectrum data is collected at equal intervals;
[0014] The spectral data is transmitted to a computer for processing to extract the differential optical density of the NO and SO2 mixed gas in the 200-230 nm spectral band as an input feature of the separation and reconstruction model.
[0015] The above-mentioned NO and SO2 mixed gas concentration detection method based on deep learning is, as a preferred embodiment, the differential optical density of the NO and SO2 mixed gas is expressed by the following formula:
[0016]
[0017] DOD=OD-ODS;
[0018] Where OD is the optical density of the mixed gas molecules, I0(λ) is the intensity of the incident light, I(λ) is the intensity of the transmitted light after absorption by the mixed gas, DOD is the differential optical density of the mixed gas, and ODS is the Rayleigh and Mie scattering caused by particles and the influence of the measurement system on the spectrum, which is manifested as a slow change.
[0019] The above-mentioned NO and SO2 mixed gas concentration detection method based on deep learning is, as a preferred embodiment, the separation and reconstruction model based on the bidirectional long short-term memory network includes an input layer, a Bi-LSTM network layer, a fully connected layer and an output layer connected in sequence;
[0020] The Bi-LSTM network layer includes a parallel forward LSTM network sublayer and a backward LSTM network sublayer, wherein the input of the Bi-LSTM network layer is simultaneously used as the input of the forward LSTM network sublayer and the backward LSTM network sublayer;
[0021] Among them, the differential optical density of NO and SO2 mixed gas input into the separation and reconstruction model based on the bidirectional long short-term memory network is used as the input of the input layer, the output of the input layer is used as the input of the Bi-LSTM network layer, the output of the Bi-LSTM network layer is used as the input of the fully connected layer, the output of the fully connected layer is used as the input of the output layer, and the output of the output layer is used as the output of the separation and reconstruction model based on the bidirectional long short-term memory network.
[0022] The above-mentioned NO and SO2 mixed gas concentration detection method based on deep learning is, as a preferred solution, the processing process of the separation and reconstruction model based on the bidirectional long short-term memory network includes:
[0023] The differential optical density sequence data of the input mixed gas is processed by two LSTM network sub-layers, forward and backward, to read the contextual information in the sequence data bidirectionally; then, the feature vectors output by the LSTM layers in two directions are concatenated at each time step to obtain a merged feature vector containing bidirectional information; finally, the merged feature vectors are integrated through a fully connected layer to obtain the differential optical densities of the two single gases, NO and SO2, respectively.
[0024] The above-mentioned NO and SO2 mixed gas concentration detection method based on deep learning is, as a preferred solution, the separation and reconstruction model based on the bidirectional long short-term memory network is trained in the following way:
[0025] The pre-acquired NO and SO2 mixed gas is used as the input of the separation and reconstruction model based on the bidirectional long short-term memory network, and the mean square error is used as the loss function. The model parameters of the separation and reconstruction model are optimized and updated with the goal of minimizing the loss function, and then the separation and reconstruction model is trained.
[0026] The loss function is:
[0027]
[0028] Where n is the number of sampling points of the differential optical density of the mixed gas, y(x i ) is the true value of the i-th sampling point, is the predicted value of the i-th sampling point.
[0029] The above-mentioned NO and SO2 mixed gas concentration detection method based on deep learning is, as a preferred solution, a concentration detection model based on TCN+RNN network includes an input layer, three TemporalBlock residual units, an RNN network layer, a fully connected layer and an output layer connected in sequence;
[0030] The TemporalBlock residual unit includes a cascaded one-dimensional convolution module, a trimming module, an activation function layer, a dropout layer and a down-sampled one-dimensional convolution layer, wherein the one-dimensional convolution module, the trimming module, the activation function layer and the dropout layer are connected in series and then connected in parallel with the down-sampled one-dimensional convolution layer; wherein the input of the TemporalBlock residual unit is used as the input of the one-dimensional convolution module, the output of the one-dimensional convolution module is used as the input of the trimming module, the output of the trimming module is used as the input of the activation function layer, the output of the activation function layer is used as the input of the dropout layer, the output of the dropout layer and the input of the one-dimensional convolution module are fused through the output of the down-sampled one-dimensional convolution layer, and then used as the overall output of the TemporalBlock residual unit via the activation function;
[0031] Among them, the output of the separation and reconstruction model based on the bidirectional long short-term memory network is used as the input of the concentration detection model based on the TCN+RNN network, and the input of the concentration detection model based on the TCN+RNN network is used as the input of the input layer, the output of the input layer is used as the input of the first TemporalBlock residual unit, the output of each TemporalBlock residual unit is used as the input of the next layer connected to it in the concentration detection model, the output of the third TemporalBlock residual unit is used as the input of the RNN network layer, the output of the RNN network layer is used as the input of the fully connected layer, the output of the fully connected layer is used as the input of the output layer, and the output of the output layer is used as the overall output of the concentration detection model.
[0032] The above-mentioned NO and SO2 mixed gas concentration detection method based on deep learning is, as a preferred solution, the processing process of the concentration detection model based on the TCN+RNN network includes:
[0033] The differential optical density sequence data of the two single gases, NO and SO2, are inputted for feature extraction through three TemporalBlock residual units, and the convolutional neural network in the TemporalBlock residual unit is used to process the time series data to extract the time series features. Then, the extracted time series features are inputted into the RNN layer to further capture the time series dependencies in the sequence data. Finally, the above features are integrated through the fully connected layer to output the concentration prediction results of each single gas, NO and SO2.
[0034] The above-mentioned NO and SO2 mixed gas concentration detection method based on deep learning is a preferred solution. The concentration detection model based on the TCN+RNN network is trained in the following way:
[0035] The differential optical density of two single gases, NO and SO2, is used as the input of the concentration detection model based on the TCN+RNN network. The mean square error is used as the loss function. The model parameters of the concentration detection model are optimized and updated with the goal of minimizing the loss function, and then the concentration detection model is trained.
[0036] The loss function is:
[0037]
[0038] Where m is the total number of samples of a single gas, y i is the true value of the sample, is the predicted value of the sample.
[0039] Compared with the prior art, the present invention has the following technical effects:
[0040] (1) The present invention aims at the cross-sensitivity problem of NO and SO2 mixed gas in the high signal-to-noise ratio band of 200-230nm. By analyzing the differential optical density (DOD) of 200-230nm and constructing a separation and reconstruction model based on a bidirectional long short-term memory network, a method for separating and reconstructing the differential optical density of the mixed gas of 200-230nm is realized, thereby obtaining the differential absorption spectra of two single gases and overcoming the mutual interference of NO and SO2. The present invention uses a third-order polynomial fitting method to separate the slowly varying (ODS) part of the absorption intensity of the gas to be measured that does not contain the gas to be measured in the gas molecular absorption spectrum, and obtains a narrow-band absorption part that changes rapidly with the wavelength. The narrow-band absorption part (i.e., differential optical density, DOD) obtained based on this method is used as the input and output of the separation and reconstruction model.
[0041] (2) The present invention can significantly improve the accuracy and efficiency of gas concentration detection by using a concentration detection model with TCN+RNN as the core to process the differential optical density data of a single gas. This model combines the advantages of TCN in extracting time series data features and the ability of RNN in processing sequence dependencies, so that it can capture and analyze complex patterns and long-term dependencies in gas spectral data. This not only enhances the model's robustness to noise, but also improves its generalization ability in unknown or changing environments, and realizes rapid and accurate monitoring of low-concentration NO and SO2 gases, providing strong technical support for environmental protection and public health.
[0042] (3) In the spectral separation and reconstruction stage, the average fitting degree of the two gas spectra separated by the network model with Bi-LSTM as the core is above 0.99; in the single gas concentration detection stage, the full-scale error of sulfur dioxide and nitrogen monoxide concentration detection obtained by the deep learning method is controlled within 2.00%, and the fitting degree of the true value and the predicted value is above 0.99. The detection limits of this method for nitrogen monoxide and sulfur dioxide are 0.062ppm*m and 0.065ppm*m, respectively, and the uncertainties are 1.64% and 1.69%, respectively. The method of the present invention has high accuracy and reliability in detecting NO and SO2 gases. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to make the purpose, technical solution and advantages of the invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:
[0044] Figure 1 Schematic diagram of the structure of the mixed gas concentration detection model used in the method of the present invention;
[0045] Figure 2 A schematic diagram of the data collection principle of an embodiment of the present invention;
[0046] Figure 3 This is a structural diagram of a separation and reconstruction model based on Bi-LSTM in an embodiment of the present invention;
[0047] Figure 4 This is a diagram of the LSTM network structure of an embodiment of the present invention;
[0048] Figure 5 This is a line graph showing changes in the loss function of the separation and reconstruction model training according to an embodiment of the present invention;
[0049] Figure 6 This is a structural diagram of a concentration detection model based on a TCN+RNN network according to an embodiment of the present invention;
[0050] Figure 7 1 is a structural diagram of a TemporalBlock residual unit according to an embodiment of the present invention;
[0051] Figure 8 This is a line graph showing the changes in the NO and SO2 training loss functions according to an embodiment of the present invention;
[0052] Fig. 9 This is a differential optical density diagram of SO2 and NO separated from the mixed gas in an embodiment of the present invention;
[0053] Fig.10 It is a scatter diagram of the fitting degree between the actual value and the predicted value of different gas concentrations in the embodiment of the present invention;
[0054] Fig.11This is a scatter diagram of the continuous measurement results of NO and SO2 in an embodiment of the present invention;
[0055] Fig.12 It is a statistical histogram of absolute error and relative error of concentration detection in an embodiment of the present invention;
[0056] Fig.13 It is a time line diagram of the model response of the embodiment of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but only represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0058] The present invention will be further described in detail below in conjunction with the accompanying drawings.
[0059] Figure 1 The present invention discloses a method for detecting the concentration of NO and SO2 mixed gas based on deep learning. The method obtains the NO and SO2 mixed gas to be detected, inputs the NO and SO2 mixed gas to be detected into the trained mixed gas concentration detection model, and outputs the concentration detection result of NO and SO2 mixed gas. In the face of the cross-sensitivity between NO and SO2 and the problem of being unable to accurately separate the differential optics of NO and SO2, the present invention analyzes the differential optical density of NO and SO2 mixed gas in the band of 200-230nm, and proposes a method for detecting the concentration of NO and SO2 mixed gas based on deep learning. The method can be divided into two stages: the first stage, mixed gas spectral separation; the second stage, single gas concentration detection. After these two stages, the concentration values of NO and SO2 gases in the mixed gas are finally obtained. The experimental results show that the method is operable.
[0060] The mixed gas concentration detection model used in the present invention includes a separation and reconstruction model based on a bidirectional long short-term memory network and a concentration detection model based on a TCN+RNN network; the mixed gas concentration detection model uses the input NO and SO2 mixed gas to be detected as the input of the separation and reconstruction model based on the bidirectional long short-term memory network, performs mixed gas spectrum separation and reconstruction, so as to obtain the differential absorption spectra of two single gases, NO and SO2, as the output of the separation and reconstruction model at one time, and then uses the output of the separation and reconstruction model based on the bidirectional long short-term memory network as the input of the concentration detection model based on the TCN+RNN network, performs feature extraction on the input sequence data and performs concentration prediction, so as to obtain the concentration detection result of the NO and SO2 mixed gas as the output.
[0061] The following is a more detailed description of the NO and SO2 mixed gas concentration detection method based on deep learning of the present invention.
[0062] 1. Data collection and processing
[0063] like Figure 2 In the embodiment, the light source adopts a xenon lamp, the spectrometer adopts a Czerny-Turner optical structure, and a grating is used as a spectroscopic element. The optical signal is introduced through an optical fiber connector and connected to a computer to realize direct computer control and power supply. In the embodiment, pure nitrogen, SO2 with a preset standard concentration, and NO gas with a preset standard concentration are diluted and mixed by a gas mixing instrument to obtain mixed gases with different concentration ratios; the mixed gas is introduced into the gas chamber through a hose, and after stabilization (about 5 minutes), a xenon light is emitted by the light source into the gas chamber, and after reflection by a concave mirror, it is received by the spectrometer and spectral data is collected at equal intervals; the spectral data is transmitted to a computer for processing to extract the differential optical density of NO and SO2 mixed gas in the 200-230nm spectral band as the input feature of the separation and reconstruction model. Among them, the wavelength range of ultraviolet light collection is 190-500 nanometers, and the resolution is 0.117; in the gas chamber, due to the reflection mechanism, the optical path can reach 4 meters; during the data collection process, the mixed gas concentration ratio is obtained by diluting the standard gas by a high-precision gas dilution device.
[0064] In the implementation of specific applications, in order to avoid the influence of flow, pressure and temperature on the measurement results, the gas flow, pressure and temperature are controlled to be constant during the experiment.
[0065] The differential optical density of the NO and SO2 mixed gas is expressed by the following formula:
[0066]
[0067] DOD=OD-ODS;
[0068] Where OD is the optical density of the mixed gas molecules, I0(λ) is the intensity of the incident light, I(λ) is the intensity of the transmitted light after absorption by the mixed gas, DOD is the differential optical density of the mixed gas, and ODS is the Rayleigh and Mie scattering caused by particles and the influence of the measurement system on the spectrum, which is manifested as a slow change.
[0069] 2. Mixed gas concentration detection model
[0070] After training, the mixed gas concentration detection model is used to detect the concentration of the NO and SO2 mixed gas to be detected, and obtain the concentration detection results of each single gas of NO and SO2. The mixed gas concentration detection model used in the present invention mainly includes two parts: a separation and reconstruction model based on a bidirectional long short-term memory network and a concentration detection model based on a TCN+RNN network, which are introduced in detail below.
[0071] 2.1 Separation and reconstruction model based on bidirectional long short-term memory network
[0072] Since both SO2 and NO have absorption characteristics in the 200-230nm band, a neural network model is trained using a deep learning method, and then the differential optical density of SO2 and the differential optical density of NO are extracted at one time.
[0073] In the first stage, when separating and reconstructing the mixed gas spectrum, the present invention adopts a separation and reconstruction model based on a bidirectional long short-term memory network (Bidirectional Long Short-Term Memory, Bi-LSTM), which is an improved recurrent neural network specially designed for processing sequence data.
[0074] Specifically, the separation and reconstruction model based on the bidirectional long short-term memory network, such as Figure 3 As shown, it includes an input layer, a Bi-LSTM network layer, a fully connected layer, and an output layer connected in sequence;
[0075] The Bi-LSTM network layer includes a parallel forward LSTM network sublayer and a backward LSTM network sublayer, wherein the input of the Bi-LSTM network layer is simultaneously used as the input of the forward LSTM network sublayer and the backward LSTM network sublayer;
[0076] Among them, the differential optical density of NO and SO2 mixed gas input into the separation and reconstruction model based on the bidirectional long short-term memory network is used as the input of the input layer, the output of the input layer is used as the input of the Bi-LSTM network layer, the output of the Bi-LSTM network layer is used as the input of the fully connected layer, the output of the fully connected layer is used as the input of the output layer, and the output of the output layer is used as the output of the separation and reconstruction model based on the bidirectional long short-term memory network.
[0077] The processing process of the separation and reconstruction model based on the bidirectional long short-term memory network includes: processing the differential optical density sequence data of the input mixed gas through two LSTM network sub-layers, forward and backward, to read the context information in the sequence data bidirectionally; then, the feature vectors output by the LSTM layers in two directions are concatenated at each time step to obtain a merged feature vector containing bidirectional information; finally, the merged feature vectors are integrated through a fully connected layer to obtain the differential optical densities of the two single gases, NO and SO2, respectively.
[0078] In this embodiment, x i (i=1,2,...,n) and y i (i=1, 2, ..., n, n+1, ..., 2n) represent the differential optical density of the mixed gas and the corresponding differential optical density of the two single gases respectively. Figure 4 This is the LSTM network structure diagram. LSTM is a bidirectional long short-term memory computing logic unit. In the input layer, the original x i As direct input, the feature extraction of the two-layer Bi-LSTM network is carried out, and then the extracted features are integrated in the fully connected layer (Fully Connected Layer, Fc), and finally the prediction result of the network is output. Therefore, the network can separate the differential optical density of two different gases at one time.
[0079] For the separation and reconstruction model based on the bidirectional long short-term memory network of this embodiment, the model training is performed in the following manner:
[0080] The pre-acquired NO and SO2 mixed gas is used as the input of the separation and reconstruction model based on the bidirectional long short-term memory network, and the mean square error is used as the loss function. The model parameters of the separation and reconstruction model are optimized and updated with the goal of minimizing the loss function, and then the separation and reconstruction model is trained.
[0081] The loss function is:
[0082]
[0083] Where n is the number of sampling points of the differential optical density of the mixed gas, y(x i ) is the true value of the i-th sampling point, is the predicted value of the i-th sampling point.
[0084] When the MSE is lower, it means that the difference spectrum extracted by the model fits the real difference spectrum better, that is, the extraction effect is better. Figure 5 It can be seen that the loss function MSE keeps fluctuating and decreasing until the fluctuation amplitude becomes flat and the network model gradually converges. At this time, the effect of the network model has become stable.
[0085] 2.2 Concentration detection model based on TCN+RNN network
[0086] In the second stage, when detecting single gas concentration, we combine the temporal convolutional network (TCN) with the recurrent neural network (RNN) so that they can play their respective advantages and provide more powerful sequence modeling capabilities. TCN can be used to extract sequence features, while RNN can be used to process these features for final prediction.
[0087] Specifically, the concentration detection model based on TCN+RNN network, such as Figure 6 As shown, it includes an input layer, three TemporalBlock residual units, an RNN network layer, a fully connected layer, and an output layer connected in sequence;
[0088] The TemporalBlock residual unit, such as Figure 7 As shown in the figure, the input features are passed into the parallel network, one way through the cascaded one-dimensional convolution module, the cropping module, the activation function layer, the dropout layer, and the other way through the downsampled one-dimensional convolution layer. The features of the two network outputs are fused and output after the activation function. Among them, the input of the TemporalBlock residual unit is used as the input of the one-dimensional convolution module, the output of the one-dimensional convolution module is used as the input of the cropping module, the output of the cropping module is used as the input of the activation function layer, the output of the activation function layer is used as the input of the dropout layer, the output of the dropout layer is fused with the output of the downsampled one-dimensional convolution layer, and the fused features are used as the overall output of the TemporalBlock residual unit through the activation function.
[0089] Among them, the output of the separation and reconstruction model based on the bidirectional long short-term memory network is used as the input of the concentration detection model based on the TCN+RNN network, and the input of the concentration detection model based on the TCN+RNN network is used as the input of the input layer, the output of the input layer is used as the input of the first TemporalBlock residual unit, the output of each TemporalBlock residual unit is used as the input of the next layer connected to it in the concentration detection model, the output of the third TemporalBlock residual unit is used as the input of the RNN network layer, the output of the RNN network layer is used as the input of the fully connected layer, the output of the fully connected layer is used as the input of the output layer, and the output of the output layer is used as the overall output of the concentration detection model.
[0090] The processing of the concentration detection model based on the TCN+RNN network includes:
[0091] The differential optical density sequence data of the two single gases, NO and SO2, are inputted for feature extraction through three TemporalBlock residual units, and the convolutional neural network in the TemporalBlock residual unit is used to process the time series data to extract the time series features. Then, the extracted time series features are inputted into the RNN layer to further capture the time series dependencies in the sequence data. Finally, the above features are integrated through the fully connected layer to output the concentration prediction results of each single gas, NO and SO2.
[0092] In this embodiment, x i (i=1,2,...,n) represents the differential optical density of a single gas. NO and They respectively represent the predicted values of nitric oxide concentration and sulfur dioxide concentration under the differential optical density.
[0093] For the concentration detection model based on the TCN+RNN network of this embodiment, the model training is performed in the following manner: the differential optical density of two single gases, NO and SO2, is used as the input of the concentration detection model based on the TCN+RNN network, and the mean square error is used as the loss function. The model parameters of the concentration detection model are optimized and updated with the goal of minimizing the loss function, and then the concentration detection model is trained;
[0094] The loss function is:
[0095]
[0096] Where m is the total number of samples of a single gas, y i is the true value of the sample, is the predicted value of the sample.
[0097] When the MSE is lower, it means that the concentration value of the gas predicted by the model is closer to the actual concentration value, that is, the absolute error between the predicted value and the actual value is smaller. Figure 8 It can be seen that the loss function MSE keeps fluctuating and decreasing until the fluctuation amplitude becomes flat and the network model gradually converges. At this time, the effect of the network model has become stable.
[0098] 3. Example
[0099] 3.1 Evaluation indicators and experimental results
[0100] 3.1.1 Evaluation indicators and experimental results of the separation and reconstruction model based on Bi-LSTM
[0101] The model evaluation indicators are root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R-Square, R 2 ). RMSE is a common way to measure the difference between the observed value and the true value. It is the square root of the average of the sum of squared prediction errors. RMSE is very sensitive to large errors and can therefore be a good indicator of extreme deviations in model predictions. MAE is the average of the absolute errors between the predicted value and the true value. It can intuitively indicate the size of the gap between the model's predicted value and the true value. 2 (also called coefficient of determination or goodness of fit) is a statistic that measures the degree of fit between the model's predicted values and the actual observed values. Its value ranges between 0 and 1, and the closer the value is to 1, the better the model's fit.
[0102] The calculation formulas for the square root error, mean absolute error and coefficient of determination are as follows:
[0103]
[0104] First, the separation and reconstruction model based on the bidirectional long short-term memory network is used to achieve the separation and reconstruction effect of the 200-230nm differential optical density. Fig. 9 As shown, it includes the mixed separation reconstruction effect of low-concentration NO gas and low-concentration SO2 gas, the mixed separation reconstruction effect of low-concentration NO gas and high-concentration SO2 gas, the mixed separation reconstruction effect of high-concentration NO gas and low-concentration SO2 gas, and the mixed separation reconstruction effect of high-concentration NO gas and high-concentration SO2 gas. Fig. 9 As can be seen from Table 1, the separation and reconstruction model based on Bi-LSTM of the present invention can not only separate the two spectra in the mixed gas at one time, but also the spectrum effect of the separated single gas is also very good, and the correlation is above 0.99.
[0105] Table 1 Evaluation indicators of mixed gas samples with different concentrations
[0106]
[0107] 3.1.2 Evaluation indicators and experimental results of the concentration detection model based on TCN+RNN network
[0108] In the evaluation index of the single gas concentration prediction model, for a single measurement value of a certain concentration, the absolute error (Absolute Error, AE), relative error (Relative Error, RE), and full-scale error (FullScale Error, FSE) are used; and for multiple measurement values of multiple groups of concentrations, the linear error (Linear Error, LE) is used. The full-scale error is an error relative to the full scale of the instrument. It represents the ratio of the absolute error of the measurement to the full-scale value of the instrument. It reflects the maximum possible value of the error of the instrument within the entire range. The linear error measures the maximum deviation of the straight line formed by the endpoints of the entire range, that is, the deviation between the measured curve and the ideal straight line. The smaller the value, the more accurate the measurement of the measurement system or instrument within the entire range. Among them, assuming that the total number of sample sequences is m, then i = 1, 2, ..., m; y i is the true value of the concentration of the ith sample sequence, is the predicted value of the concentration of the ith sample sequence, and S is the range (for the data set of this embodiment, the range is 25 ppm).
[0109] The calculation formulas for the absolute error, relative error, full-scale error and linear error are as follows:
[0110]
[0111] The training set divided from the obtained data set is used to train the TCN+RNN network model to verify the effect of the concentration detection algorithm of the single gas absorption spectrum data under this model. In the test set, the degree of fit between the actual value of NO and the predicted value is as follows Fig.10 As shown in the left figure. Similarly, the degree of fit between the actual value and the predicted value of SO2 is shown in Fig.10 As shown in the figure on the right, after calculation, the linear error of NO is 1.12% and the linear error of SO2 is 1.20%.
[0112] During the measurement process, the stability assessment of the measurement algorithm is the key, which involves the degree of deviation between the concentration values calculated by the analysis algorithm after multiple consecutive measurements of the same concentration of gas under the same environment, that is, the uncertainty. Fig.11 As shown. Uncertainty is an important indicator to measure the credibility and accuracy of measurement results: the smaller the uncertainty, the more stable and reliable the measurement results, and the higher the performance of the algorithm; conversely, the increase in uncertainty reflects the reduction of algorithm reliability. Among them, an important source of uncertainty is the experimental standard deviation of repeatable measurements, which reflects the degree of discreteness between multiple measurement results of the same concentration of gas processed by the algorithm under controlled conditions. The calculation formula of uncertainty A is shown as follows:
[0113]
[0114] Where, X i is the measured value of the concentration of the ith sample, is the average value of all sample measurements, and n is the total number of sample sequences.
[0115] After calculation, the uncertainty of the deep learning method for nitric oxide and sulfur dioxide is 1.64% and 1.69% respectively.
[0116] In order to quantitatively evaluate the lowest concentration value detected by the algorithm for the measured gas, that is, the detection limit, it is necessary to use an important indicator of the measurement system, the detection limit (DL), for quantitative analysis. The calculation method of the detection limit is shown in the following formula:
[0117]
[0118] In the formula, K i is the confidence factor, and K is set here i =3, δ0 represents the standard deviation, and C represents the preset standard concentration (ppm). After calculation, the detection limits of the deep learning method for nitrogen monoxide and sulfur dioxide are 0.062ppm*m and 0.065ppm*m respectively.
[0119] 3.2 Concentration detection after spectral separation
[0120] The mixed gas test set is spectrally separated, and then the separated spectra are placed in the concentration detection model of the corresponding gas, and finally the concentration values of sulfur dioxide and nitrogen monoxide are obtained. Compared with traditional DOAS technology, after the spectral data is measured by instruments, the deep learning method does not need to manually extract points with strong correlation, nor does it need to measure the gas absorption cross section. It only needs to pre-process the data set and place it in the neural network for model training. It can automatically extract the characteristic information in the gas spectrum, thereby realizing the mixed gas spectral separation and single gas concentration detection tasks.
[0121] Fig. 9 The differential optical density of nitric oxide and sulfur dioxide separated and reconstructed from mixed gases with different concentration ratios is shown in Table 2. The degree of fit of the separated spectra exceeds 0.99. From the results in Table 2, it can be seen that the use of deep learning methods has a good effect on the spectral separation and concentration detection tasks of SO2 and NO mixed gases. The linear error of nitric oxide is 1.76%, and the linear error of sulfur dioxide is 1.88%. Fig.12 The absolute error and relative error statistics of the concentration detection of the separated single gas after spectral separation are shown. The absolute error of the two gases did not exceed 0.5ppm, and the relative error did not exceed 8%.
[0122] Table 2 Concentration test results of mixed gas samples with different concentrations
[0123]
[0124] 3.3 Model response time
[0125] In the case of mixed gas spectral separation, in order to check the model response time, we put different amounts of data into the model, each batch includes 30 sample spectral data. As the batch increases, the mixed gas sample spectral data put into the model will also increase. In the case of single gas concentration detection, in order to check the model response time, we put different amounts of data into the model, each batch includes 5 sample spectral data. As the batch increases, the single gas sample spectral data put into the model will also increase. Plot the model response time as Fig.13 . Fig.13 The data results are all tested under the 12th Gen Intel(R) Core(TM) i5-12500H 2.50GHz processor.
[0126] 4. Overview
[0127] The present invention proposes a method for detecting the concentration of NO and SO2 mixed gas based on deep learning, which combines the principle of spectral analysis to separate the differential spectra of sulfur dioxide and nitrogen monoxide in the mixed gas, and then accurately detects the concentration of sulfur dioxide or nitrogen monoxide under the separated single gas differential spectrum. According to the characteristics of the data, the band between 200nm-230nm is selected as the research object, and the spectral data in this band is converted into a differential spectrum. The model design is mainly divided into two stages: the first stage is the separation and reconstruction of the mixed gas spectrum, using a separation and reconstruction model with Bi-LSTM neural network as the core. The average fitting degree of the two gas spectra separated by the model is above 0.99; the second stage is the single gas concentration detection, using a neural network concentration detection model combining TCN and RNN. The full-scale error of the sulfur dioxide and nitrogen monoxide concentration detection predicted by the model is controlled within 2.00%, and the fitting degree of the true value and the predicted value is above 0.99. The detection limits of the deep learning method for nitric oxide and sulfur dioxide are 0.062ppm*m and 0.065ppm*m, respectively, with uncertainties of 1.64% and 1.69%, respectively. The method of the present invention has high accuracy and reliability in detecting NO and SO2 gases.
[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described with reference to the preferred embodiments of the present invention, it should be understood by those skilled in the art that various changes may be made in form and details without departing from the spirit and scope of the present invention as defined in the appended claims.
Claims
1. A method for detecting NO and SO2 mixed gas concentration based on deep learning, characterized in that: Obtain a NO and SO2 mixed gas to be detected, input the NO and SO2 mixed gas to be detected into the trained mixed gas concentration detection model, and output the concentration detection results of each single gas of NO and SO2; The mixed gas concentration detection model includes a separation and reconstruction model based on a bidirectional long short-term memory network and a concentration detection model based on a TCN+RNN network; the mixed gas concentration detection model uses the input NO and SO2 mixed gas to be detected as the input of the separation and reconstruction model based on the bidirectional long short-term memory network, performs mixed gas spectrum separation and reconstruction, so as to obtain the differential optical density of two single gases, NO and SO2, as the output of the separation and reconstruction model at one time, and then uses the output of the separation and reconstruction model based on the bidirectional long short-term memory network as the input of the concentration detection model based on the TCN+RNN network, performs feature extraction on the input sequence data and performs concentration prediction, so as to obtain the concentration detection results of each single gas, NO and SO2, as the output.
2. The NO and SO2 mixed gas concentration detection method based on deep learning according to claim 1 is characterized in that: The acquisition of the NO and SO2 mixed gas to be detected is achieved by the following steps: Pure nitrogen, SO2 with a preset standard concentration, and NO gas with a preset standard concentration are diluted and mixed by a gas mixing instrument to obtain mixed gases with different concentration ratios; The mixed gas is introduced into the gas chamber through a hose. After stabilization, a xenon light is emitted from a light source into the gas chamber. After being reflected by a concave mirror, the mixed gas is received by a spectrometer and spectrum data is collected at equal intervals. The spectral data is transmitted to a computer for processing to extract the differential optical density of the NO and SO2 mixed gas in the 200-230 nm spectral band as an input feature of the separation and reconstruction model.
3. The NO and SO2 mixed gas concentration detection method based on deep learning according to claim 2 is characterized in that: The differential optical density of the NO and SO2 mixed gas is expressed by the following formula: DOD=OD-ODS; Where OD is the optical density of the mixed gas molecules, I0(λ) is the intensity of the incident light, I(λ) is the intensity of the transmitted light after absorption by the mixed gas, DOD is the differential optical density of the mixed gas, and ODS is the Rayleigh scattering and Mie scattering caused by particles and the influence of the measurement system on the spectrum, which is manifested as a slow change.
4. The NO and SO2 mixed gas concentration detection method based on deep learning according to claim 1 is characterized in that: The separation and reconstruction model based on the bidirectional long short-term memory network includes an input layer, a Bi-LSTM network layer, a fully connected layer and an output layer connected in sequence; The Bi-LSTM network layer includes a parallel forward LSTM network sublayer and a backward LSTM network sublayer, wherein the input of the Bi-LSTM network layer is simultaneously used as the input of the forward LSTM network sublayer and the backward LSTM network sublayer; Among them, the differential optical density of NO and SO2 mixed gas input into the separation and reconstruction model based on the bidirectional long short-term memory network is used as the input of the input layer, the output of the input layer is used as the input of the Bi-LSTM network layer, the output of the Bi-LSTM network layer is used as the input of the fully connected layer, the output of the fully connected layer is used as the input of the output layer, and the output of the output layer is used as the output of the separation and reconstruction model based on the bidirectional long short-term memory network.
5. The method for detecting NO and SO2 mixed gas concentration based on deep learning according to claim 4 is characterized in that: The processing process of the separation and reconstruction model based on the bidirectional long short-term memory network includes: The differential optical density sequence data of the input mixed gas is processed by two LSTM network sub-layers, forward and backward, to read the contextual information in the sequence data bidirectionally; then, the feature vectors output by the LSTM layers in two directions are concatenated at each time step to obtain a merged feature vector containing bidirectional information; finally, the merged feature vectors are integrated through a fully connected layer to obtain the differential optical densities of the two single gases, NO and SO2, respectively.
6. The method for detecting NO and SO2 mixed gas concentration based on deep learning according to claim 5, characterized in that: The separation and reconstruction model based on the bidirectional long short-term memory network is trained in the following way: The pre-acquired NO and SO2 mixed gas is used as the input of the separation and reconstruction model based on the bidirectional long short-term memory network, and the mean square error is used as the loss function. The model parameters of the separation and reconstruction model are optimized and updated with the goal of minimizing the loss function, and then the separation and reconstruction model is trained. The loss function is: Where n is the number of sampling points of differential optical density of the mixed gas, y(x i ) is the true value of the i-th sampling point, is the predicted value of the i-th sampling point.
7. The method for detecting NO and SO2 mixed gas concentration based on deep learning according to claim 1, characterized in that: The concentration detection model based on TCN+RNN network includes an input layer, three TemporalBlock residual units, an RNN network layer, a fully connected layer and an output layer connected in sequence; The TemporalBlock residual unit includes a cascaded one-dimensional convolution module, a trimming module, an activation function layer, a dropout layer and a down-sampled one-dimensional convolution layer, wherein the one-dimensional convolution module, the trimming module, the activation function layer and the dropout layer are connected in series and then connected in parallel with the down-sampled one-dimensional convolution layer; wherein the input of the TemporalBlock residual unit is used as the input of the one-dimensional convolution module, the output of the one-dimensional convolution module is used as the input of the trimming module, the output of the trimming module is used as the input of the activation function layer, the output of the activation function layer is used as the input of the dropout layer, the output of the dropout layer and the input of the one-dimensional convolution module are fused through the output of the down-sampled one-dimensional convolution layer, and then used as the overall output of the TemporalBlock residual unit via the activation function; Among them, the output of the separation and reconstruction model based on the bidirectional long short-term memory network is used as the input of the concentration detection model based on the TCN+RNN network, and the input of the concentration detection model based on the TCN+RNN network is used as the input of the input layer, the output of the input layer is used as the input of the first TemporalBlock residual unit, the output of each TemporalBlock residual unit is used as the input of the next layer connected to it in the concentration detection model, the output of the third TemporalBlock residual unit is used as the input of the RNN network layer, the output of the RNN network layer is used as the input of the fully connected layer, the output of the fully connected layer is used as the input of the output layer, and the output of the output layer is used as the overall output of the concentration detection model.
8. The method for detecting NO and SO2 mixed gas concentration based on deep learning according to claim 7, characterized in that: The processing process of the concentration detection model based on the TCN+RNN network includes: The differential optical density sequence data of the two single gases, NO and SO2, are inputted for feature extraction through three TemporalBlock residual units, and the convolutional neural network in the TemporalBlock residual unit is used to process the time series data to extract the time series features. Then, the extracted time series features are inputted into the RNN layer to further capture the time series dependencies in the sequence data. Finally, the above features are integrated through the fully connected layer to output the concentration prediction results of each single gas, NO and SO2.
9. The method for detecting NO and SO2 mixed gas concentration based on deep learning according to claim 8, characterized in that: The concentration detection model based on the TCN+RNN network is trained in the following way: The differential optical density of two single gases, NO and SO2, is used as the input of the concentration detection model based on the TCN+RNN network. The mean square error is used as the loss function. The model parameters of the concentration detection model are optimized and updated with the goal of minimizing the loss function, and then the concentration detection model is trained. The loss function is: Where m is the total number of samples of a single gas, y i is the true value of the sample, is the predicted value of the sample.
Citation Information
Cited By
Gaseous pollutant Fourier transform infrared spectroscopic analysis method based on deep learning
CN120490000A
Overlapped spectrum separation device and method based on novel evolution deep learning model
CN121049204A
An overlapping spectrum separation device and method based on a new evolutionary deep learning model
CN121049204B
Method and device for imaging from spectrum to mass concentration based on physical mechanism deep learning
CN121353613A
Mixed gas concentration detection method based on overlapping time multiplexing direct absorption spectrum
CN121409913A