A laser gas concentration sensor correction method
By combining multi-wavelength spectral measurement with neural networks, the measurement error problem of laser gas concentration sensors under environmental changes has been solved, achieving higher accuracy and wider applicability.
Patent Information
- Application Number
- CN202411795056.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-12-09
AI Technical Summary
Existing laser gas concentration sensors exhibit measurement errors when environmental parameters change, limiting their application range.
Gas concentration is measured using spectra of different wavelengths. Laser absorption vector features are extracted using a first feedforward neural network, and environmental matrix feature maps are extracted using a convolutional neural network. Weighted summation is performed using an attention mechanism, and gas concentration is predicted using a second feedforward neural network. The loss function takes into account environmental factors and light intensity differences for model correction.
It improves the accuracy and applicability of gas concentration measurement, can automatically correct gas concentration results under different environments, reduce measurement errors, and enhance the robustness and adaptability of the model.
Smart Images

Figure CN119643472B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a laser gas concentration sensor correction method and belongs to the technical field of gas concentration detection. BACKGROUND
[0002] The principle of the laser gas concentration sensor is that the laser gas concentration sensor determines the laser passing through the gas to be measured through the light intensity value, and then measures the laser light intensity after passing through the gas to determine the concentration of the gas. The sensor uses the difference in absorption of laser in different concentration gases to obtain the concentration value of the gas. It has the characteristics of fast response and high precision, and is widely used in industrial monitoring and environmental protection.
[0003] However, the existing laser gas concentration sensor has the problem that only the measurement results of the gas in a specific environment, such as temperature, humidity and pressure, are considered, and once the environmental parameters change, the measurement results will also have errors, so the prior art has the problems of limited measurement environment and small use range. SUMMARY
[0004] The technical problem to be solved by the present application is to provide a laser gas concentration sensor correction method to overcome the shortcomings of the prior art.
[0005] The technical scheme of the present application is: a laser gas concentration sensor correction method, the method comprising:
[0006] using different wavelengths of light spectrum to measure gas concentration;
[0007] extracting laser absorption vector features through a first feedforward neural network, the laser absorption vector being a vector composed of light intensity values after different wavelengths of laser passing through the gas;
[0008] extracting feature maps of an environmental matrix through a convolutional neural network, the environmental matrix being a matrix intercepted by a sliding window at the end of a temperature time series, a pressure time series and a humidity time series;
[0009] allocating weights of the laser absorption vector features and the feature maps of the environmental matrix through an attention mechanism and performing weighted summation to obtain fusion features;
[0010] inputting the fusion features into a second feedforward neural network to obtain a gas concentration prediction value.
[0011] Further, the loss function of the second feedforward neural network is: wherein, , represents the absorption cross section of the gas at temperature T; is an absorption linear function, representing the absorption intensity at wavelength relative to the center wavelength of the absorption spectrum line distribution of the humidity; is a humidity correction function; , , , ; represents the predicted value of the gas concentration output by the second feedforward neural network at the i-th training, represents the actual value of the gas concentration in the training set, represents the size of the training set, and N represents the total number of lasers used to measure the gas concentration, represents the wavelength of the j-th laser used to measure the gas concentration, represents the weight coefficient, represents the incident light intensity of the j-th laser used to measure the gas concentration, represents the center wavelength of the absorption spectral line of the gas molecule, represents the half-width of the Lorentz distribution of spectral line broadening due to collisions between gas molecules, represents the integral variable, represents the speed of light, represents the Boltzmann constant, and T represents the Kelvin temperature of the gas, represents the wavelength-dependent index, represents the mass of the gas molecule, represents the humidity-dependent constant, H is the relative humidity, and d represents the path length of the laser through the gas.
[0012] Further, the method for obtaining the fusion feature by assigning weights to the laser absorption vector feature and the feature map of the environment matrix through the attention mechanism and performing weighted summation is specifically:
[0013] The laser absorption vector feature is expanded into a tensor with the same dimension as the feature map of the environment matrix through the broadcast mechanism;
[0014] The value tensor corresponding to the tensor of the feature map of each environment matrix is calculated , represents the learning matrix of the corresponding value tensor;
[0015] The attention weight corresponding to each value tensor is calculated, , the fusion feature is calculated, wherein, , , represents the i-th tensor obtained by the laser absorption vector feature through the broadcast mechanism, represents the corresponding query tensor learning matrix, represents the j-th tensor of the feature map of the environment matrix, represents a corresponding key tensor learning matrix; an attention weight of a jth value tensor of a tensor corresponding to a feature map of an environment matrix, a dimension of , F represents a fusion feature, , N represents a total number of lasers used to measure the gas concentration.
[0016] Further, the method further comprises: extending the standard temperature, the standard pressure and the standard humidity into a time series with the same value at each time point, and obtaining a standard environment matrix by cutting the end of the time series through a sliding window;
[0017] inputting the standard environment matrix into a convolutional neural network, inputting different standard residual light intensity values in a measurement range into a first feedforward neural network to obtain a prediction value, taking the gas concentration value on the standard absorption curve as a true value, and correcting the neural network through the following loss function, , wherein the standard absorption curve is obtained by changing the gas concentration in a set measurement range and measuring the laser absorption value of each wavelength under the standard temperature, pressure and humidity, and obtaining the curve of each wavelength laser according to the gas concentration value of each wavelength laser in the set measurement range and the corresponding laser absorption value, , represents the absorption cross section of the gas at temperature T; is a linear function of absorption, and represents the distribution of absorption intensity at wavelength relative to the center wavelength of the absorption spectrum line; is a humidity correction function; , , , ; represents the gas concentration prediction value output by the second feedforward neural network at the ith training, represents the actual value of the gas concentration in the training set, represents the size of the training set, and N represents the total number of lasers used to measure the gas concentration, represents the wavelength of the jth laser used to measure the gas concentration, represents a weight coefficient, represents the incident light intensity of the jth laser used to measure the gas concentration, represents the center wavelength of the absorption spectrum line of the gas molecule, represents the half width of the Lorentz distribution of the spectral line broadening due to the collision between the gas molecules, represents an integral variable, represents the speed of light, represents the Boltzmann constant, and T represents the Kelvin temperature of the gas, represents a wavelength-dependent index, represents a gas molecule mass, represents a humidity-dependent constant, H is relative humidity, and d represents a path length of laser passing through the gas.
[0018] Further, the loss function of the second feedforward neural network further comprises a wavelength weight correction, and the corrected loss function of the second feedforward neural network is: wherein, represents a weight of the jth laser for measuring the gas concentration, , is a detection noise variance of the laser intensity of the jth laser of the laser receiver at a standard temperature, is a standard temperature, and T is an actual temperature, is a temperature-dependent noise gain coefficient.
[0019] The present application has the following advantages compared with the prior art:
[0020] 1) The present application extracts laser absorption vector features through the first feedforward neural network, extracts environmental matrix feature maps through the convolutional neural network, and the environmental matrix feature maps are matrices extracted through a sliding window at the end of the temperature time series, the pressure time series and the dust concentration time series, so that the feature maps extracted from the environmental matrix by the convolutional neural network can have time characteristics. For temperature, pressure and humidity, not only the current value will affect the current measurement result, but also the historical value in a short time will affect the current measurement result. Through the feature map, the influence in a short time can be extracted, and then the laser absorption vector features and the feature maps of the environmental matrix are fused through the attention mechanism, and the multi-modal features after fusion are nonlinearly mapped and linearly transformed through the second feedforward neural network, and finally the predicted value of the gas concentration is output, so that the model can better focus on the features important to the prediction of the gas concentration, effectively combine the spectral information with the environmental factors, and improve the prediction accuracy. Therefore, the present application can consider the influence of environmental factors in the measurement of gas concentration under different environments, and the environmental parameters obtained by the neural network automatically correct the gas concentration results. Compared with the prior art which only determines the gas concentration by the laser attenuation intensity, the present application has a wider range of application, and the measurement result is more accurate under non-standard environment.
[0021] 2) The present application utilizes the different sensitivity of gas absorption characteristics to different wavelengths of laser, and measures multiple wavelengths, on the one hand, it can integrate multiple spectral information and reduce measurement error. The measurement results of different wavelengths verify and supplement each other, thereby improving the overall measurement accuracy. On the other hand, the absorption characteristics of different wavelengths of light spectrum are different under different conditions. By combining the measurement of multiple wavelengths, the measurement result stability can be better adapted to environmental changes;
[0022] 3) The loss function of the present application not only considers the difference between the gas concentration prediction value and the true value, but also considers the difference between the light intensity value after the laser passes through the gas and the theoretical light intensity value as a physical constraint. Let the model not only rely on data, but also use existing physical knowledge, effectively reduce the interference of noise on the measurement result, and enhance the robustness of the model when facing uncertainty. The model can identify and correct errors caused by environmental fluctuations, thereby providing more stable output;
[0023] 4) The present application fuses the laser absorption vector features and the feature map of the environment matrix through the attention mechanism. First, the laser absorption vector is expanded to the same dimension as the environment matrix feature map through the broadcast mechanism. Then, the value tensor of each feature and the attention weight are calculated. Finally, the fused features are obtained by weighted summation. It can dynamically allocate the weight of different features, so as to more accurately reflect the complex relationship between gas concentration and environmental factors, and improve the measurement accuracy and robustness of the model;
[0024] 5) The present application expands the standard temperature, pressure and humidity into a time series, and uses a sliding window to intercept the end to form a standard environment matrix. Then, the matrix is input into the convolutional neural network, and the light intensity value under different standard conditions is input into the feedforward neural network for prediction. Finally, the predicted value and the actual gas concentration value under the standard absorption curve are compared through the loss function, and the parameters of the neural network are corrected. Its advantage lies in that it can use accurate measurement data under standard environmental conditions to correct the model, thereby improving the generalization ability and prediction accuracy of the model under different environmental conditions, and effectively considering the influence of temperature, pressure and humidity on gas absorption characteristics;
[0025] 6) The present application introduces wavelength weight correction in the loss function of the second feedforward neural network. The wavelength weight is adjusted according to the noise variance of the laser receiver under standard temperature and the difference between the actual temperature and the standard temperature, so as to give different weights to different wavelengths of laser. Its advantage lies in that it can effectively reduce the measurement error caused by temperature change, improve the gas concentration prediction accuracy under non-standard temperature conditions, and enhance the robustness of the model when facing temperature fluctuations. BRIEF DESCRIPTION OF DRAWINGS
[0026] Figure 1A flowchart of the present application. DETAILED DESCRIPTION
[0027] In order to better understand the above technical solutions, the above technical solutions will be described in detail below in combination with the drawings and specific embodiments of the specification.
[0028] Embodiment 1:
[0029] A laser gas concentration sensor correction method, the method comprising:
[0030] Using different wavelengths of spectrum to measure gas concentration;
[0031] Extracting laser absorption vector features through a first feedforward neural network, the laser absorption vector being a vector composed of light intensity values after different wavelengths of laser pass through the gas;
[0032] Extracting feature maps of an environmental matrix through a convolutional neural network, the environmental matrix being a matrix intercepted by a sliding window at the end of a temperature time series, a pressure time series and a humidity time series;
[0033] Assigning weights to the laser absorption vector features and the feature maps of the environmental matrix through an attention mechanism and performing weighted summation to obtain fusion features;
[0034] Inputting the fusion features into a second feedforward neural network to obtain a gas concentration prediction value.
[0035] Measuring gas concentration through multi-wavelength spectrum, extracting features of laser absorption vectors through a first feedforward neural network, and extracting feature maps of an environmental matrix constructed based on temperature, pressure and humidity time series through a convolutional neural network. Then, the laser absorption features and the environmental features are weighted and fused through an attention mechanism to obtain fusion features, and finally the fusion features are input into a second feedforward neural network to generate a prediction value of the gas concentration. This method combines environmental factors and multi-wavelength spectrum information to improve the accuracy and adaptability of gas concentration measurement.
[0036] Since measurement in a real environment is inevitably affected by noise and uncertainty, when the model is learned through the training set, noise will affect the generalization ability of the model. In this embodiment, further, the loss function of the second feedforward neural network is: wherein, , represents the absorption cross section of the gas at temperature T; is an absorption linear function, representing the distribution of absorption intensity at wavelength relative to the center wavelength of the absorption spectrum line; is a humidity correction function; , , , ; represents the predicted value of the gas concentration output by the second feedforward neural network at the i-th training, represents the actual value of the gas concentration in the training set, represents the size of the training set, N represents the total number of lasers used to measure the gas concentration, represents the wavelength of the j-th laser used to measure the gas concentration, represents the weight coefficient, represents the incident light intensity of the j-th laser used to measure the gas concentration, represents the center wavelength of the absorption spectral line of the gas molecule, represents the half-width of the Lorentz distribution of spectral line broadening due to collisions between gas molecules, represents the integral variable, represents the speed of light, represents the Boltzmann constant, T represents the Kelvin temperature of the gas, represents the wavelength-dependent index, represents the mass of the gas molecule, represents the humidity-related constant, H is the relative humidity, and d represents the path length of the laser passing through the gas.
[0037] In order to obtain the optimal value, the present patent proposes a method for determining the value of the , as follows:
[0038] S01, select an initial value range;
[0039] S02, equally divide the initial value range;
[0040] S03, respectively train the value of each division point in the initial value range;
[0041] S04, cross-validate the model and calculate the loss value of each value on the validation set;
[0042] S05, fit the loss value with the value as the independent variable to obtain a fitting function;
[0043] S06, search for the saddle point of the fitting function using a genetic algorithm;
[0044] S07, if no If a saddle point is searched in the value range, go to step S08, otherwise go to step S06 to train the model and end;
[0045] S08, expand the value range and make equidistant cutting, and the cutting interval is the same as that in step S02;
[0046] S09, go to step S03.
[0047] Through the above method, the value of can be determined without any prior knowledge, which has the advantage of strong adaptability.
[0048] Further, the method for obtaining the fusion feature by assigning weights to the laser absorption vector feature and the feature map of the environment matrix through the attention mechanism and performing weighted summation is specifically:
[0049] The laser absorption vector feature is expanded into a tensor with the same dimension as the feature map of the environment matrix through the broadcast mechanism;
[0050] Calculate the value tensor corresponding to the tensor of the feature map of each environment matrix , The learning matrix corresponding to the value tensor;
[0051] Calculate the attention weight corresponding to each value tensor,
[0052] Calculate the fusion feature, wherein, , , The i-th tensor obtained by the laser absorption vector feature through the broadcast mechanism is represented as The query tensor learning matrix corresponding to is represented as The j-th tensor of the feature map of the environment matrix is represented as The key tensor learning matrix corresponding to is represented as The attention weight of the j-th value tensor corresponding to the tensor of the feature map of the environment matrix is represented as The dimension of is represented as F, the fusion feature is represented as F, the size of the training set is represented as N, and the total number of lasers used to measure the gas concentration is represented as N.
[0053] The application expands the dimension of the laser absorption vector through a broadcast mechanism, matches it with the feature map of the environment matrix, and then assigns higher weights to features that are more important for gas concentration prediction by calculating attention weights, so as to obtain more accurate fused features for gas concentration prediction. This method effectively deals with the influence of environmental parameter (such as temperature, pressure, humidity) changes on the measurement accuracy of gas concentration, and improves the adaptability and robustness of the sensor in different environments.
[0054] To prompt the prediction accuracy of the model, further, the method further comprises: expanding the standard temperature, the standard pressure and the standard humidity into a time sequence with the same value at each time point, and obtaining a standard environment matrix by intercepting the end of the time sequence through a sliding window;
[0055] inputting the standard environment matrix into a convolutional neural network, inputting different standard residual light intensity values in the measurement range into a first feedforward neural network to obtain a prediction value, taking the gas concentration value on the standard absorption curve as a true value, and correcting the neural network through the following loss function, wherein the standard absorption curve is obtained by changing the gas concentration in a set measurement range and measuring the laser absorption value of each wavelength under the standard temperature, pressure and humidity, and the obtained curve of each wavelength laser is obtained according to the gas concentration value and the corresponding laser absorption value of each wavelength laser in the set measurement range, , represents the absorption cross section of the gas at temperature T; is an absorption linear function, and represents the distribution of the absorption intensity at the wavelength relative to the center wavelength of the absorption spectrum line; is a humidity correction function; , , , ; represents the gas concentration prediction value output by the second feedforward neural network at the i-th training, represents the actual value of the gas concentration in the training set, represents the size of the training set, and N represents the total number of lasers used to measure the gas concentration, represents the wavelength of the jth laser used to measure the gas concentration, represents a weight coefficient, represents the incident light intensity of the jth laser used to measure the gas concentration, represents the center wavelength of the absorption spectrum line of the gas molecule, represents the half width of the Lorentz distribution of the spectral line broadening caused by the collision between the gas molecules, represents an integral variable, represents the speed of light, represents the Boltzmann constant, T represents the Kelvin temperature of the gas, represents the wavelength-dependent index, represents the gas molecular mass, represents the humidity-dependent constant, H is the relative humidity, and d represents the path length of the laser through the gas.
[0056] First, the standard temperature, pressure and humidity are extended into a time series, and a standard environment matrix is obtained through a sliding window. The standard environment matrix is input into a convolutional neural network, and the light intensity value under the standard condition is input into a feedforward neural network to obtain a prediction value. By comparing these prediction values with the true value of the gas concentration under the standard absorption curve, the neural network is corrected using a loss function.
[0057] Further, the loss function of the second feedforward neural network also includes a wavelength weight correction, and the corrected loss function of the second feedforward neural network is: wherein, represents the weight of the jth laser for measuring the concentration of the gas, , is the detection noise variance of the laser receiver to the laser intensity of the jth laser under the standard temperature, is the standard temperature, and T is the actual temperature, is the temperature-dependent noise gain coefficient.
[0058] The corrected loss function includes a wavelength weight correction part, wherein the weight is adjusted according to the detection noise variance of the laser and the temperature change. Specifically, the weight is calculated based on the noise level of the laser under different environmental conditions, and is used to weight the error term in the loss function, so as to better adapt to the measurement error of different wavelength lasers.
[0059] The above is a further detailed description of the present application in combination with specific preferred embodiments, and cannot be regarded as limiting the specific implementation of the present application to these descriptions. For ordinary skilled persons in the technical field to which the present application belongs, several simple deductions or substitutions can be made without departing from the concept of the present application, and all of them should be regarded as falling within the protection scope of the present application.
Claims
1. A method for correcting a laser gas concentration sensor, characterized in that, The method includes: Gas concentration was measured using spectra at different wavelengths; Laser absorption vector features are extracted by a first feedforward neural network. The laser absorption vector is a vector composed of the light intensity values of lasers of different wavelengths after passing through the gas. The feature map of the environment matrix is extracted by a convolutional neural network. The environment matrix is a matrix truncated at the end of the temperature time series, pressure time series and humidity time series by a sliding window. The fused features are obtained by weighting the feature maps of the laser absorption vector and the environment matrix through an attention mechanism and then summing them by weight. The fused features are input into a second feedforward neural network to obtain gas concentration predictions. The method further includes: The standard temperature, standard pressure, and standard humidity are extended to a time series where the values are the same at every moment. The standard environment matrix is obtained by truncating the end of the time series using a sliding window. The standard environment matrix is input into a convolutional neural network, and different standard residual light intensity values within the measurement range are input into a first feedforward neural network to obtain predicted values. The gas concentration values on the standard absorption curve are used as the true values, and the neural network is corrected using the following loss function. , The standard absorption curve is obtained by varying the gas concentration and measuring the laser absorption value at each wavelength within a set measurement range under standard temperature, pressure, and humidity conditions. The curve is derived from the gas concentration and corresponding laser absorption value for each wavelength within the set measurement range. , This represents the absorption cross section of the gas at temperature T. For absorption linear function, it means that at wavelength The absorption intensity at a certain point relative to the center wavelength of the absorption spectral line Distribution; This is a humidity correction function; , , , ; This represents the predicted gas concentration output by the second feedforward neural network during the i-th training iteration. This represents the actual gas concentration in the training set. This indicates the size of the training set, and N represents the total number of lasers used to measure gas concentration. This represents the wavelength of the j-th laser used to measure gas concentration. Indicates the weighting coefficient. This represents the incident light intensity of the j-th laser used to measure gas concentration. Indicates the center wavelength of the absorption spectral line of gas molecules. The full width at half maximum (FWHM) of the Lorentz distribution represents the broadening of spectral lines caused by collisions between gas molecules. Represents the integral variable. Represents the speed of light. Represents Boltzmann's constant. Indicates wavelength correlation index. Indicates the mass of gas molecules. The constant represents the humidity-related constant, where H is the relative humidity and d represents the path length of the laser through the gas. T represents the standard temperature, and T represents the actual temperature.
2. The laser gas concentration sensor calibration method according to claim 1, characterized in that, The method of allocating weights to the feature maps of the laser absorption vector and the environment matrix through an attention mechanism and then performing a weighted summation to obtain the fused features is as follows: The laser absorption vector features are expanded into a tensor of the same dimension as the feature map of the environment matrix through a broadcast mechanism; Calculate the value tensor corresponding to the tensor of the feature map for each environment matrix. , express The learning matrix of the corresponding value tensor; Calculate the attention weights corresponding to each value tensor. , Computational fusion features, , in, , , Let i represent the i-th tensor obtained through a broadcast mechanism representing the laser absorption vector features. express The corresponding query tensor learning matrix, Let j-th tensor represent the feature map of the environment matrix. express The corresponding key tensor learning matrix; The attention weights of the j-th value tensor corresponding to the tensor of the feature map of the environment matrix are represented by the tensor. express The dimension, F, represents the fusion feature. The training set size is represented by N, which represents the total number of lasers used to measure gas concentration.
3. The laser gas concentration sensor calibration method according to claim 2, characterized in that, The loss function of the second feedforward neural network also includes wavelength weight correction. The corrected loss function of the second feedforward neural network is as follows: ,in, This represents the weight of the j-th laser used to measure gas concentration. , Let be the variance of the detection noise of the laser receiver for the intensity of the j-th laser at standard temperature. This is the temperature-dependent noise gain coefficient.
Citation Information
Patent Citations
Multiplexed optical fiber gas sensor capable of measuring various gas components
CN103954572A
Internet of Things system
CN116368355A