Intelligent multi-gas detection module data processing system and method based on NDIR
Through the combination of multi-wavelength NDIR sensor and wavelet transformation, Bill-Lambert's law, recursive least squares method and non-negative matrix decomposition, combined with edge-end and cloud-end federated learning, the problem of the gas concentration prediction model's accuracy decrease under environmental changes is solved, and high-precision real-time gas detection is achieved.
Patent Information
- Application Number
- CN202510370730.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-07-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing gas concentration prediction models cannot be automatically updated in the face of a continuously changing detection environment, resulting in a decrease in detection accuracy, which may cause serious consequences in the fields of environmental monitoring and industrial safety.
Multi-wavelength NDIR sensors are used to obtain spectral signals, combined with wavelet transformation, Bill-Lambert's law and recursive least squares method to update the model parameters, use non-negative matrix to decompose and separate gas signals, and use edge-end lightweight models to perform real-time optimization with cloud-end federated learning.
Real-time response to environmental changes is achieved, high-precision gas concentration prediction is maintained, and the accuracy reduction caused by traditional models is avoided due to staticity is provided, and continuous and reliable detection support is provided.
Smart Images

Figure CN120260734A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of gas detection, and in particular to an intelligent multi-gas detection module data processing system and method based on NDIR. Background Art
[0002] In the field of gas detection, non-dispersive infrared (NDIR) technology has become one of the mainstream detection methods due to its high sensitivity, high precision and wide applicability to a variety of gases. Its principle is based on the unique absorption characteristics of different gases to infrared light of specific wavelengths. When a gas sample enters the detection area, the sensor collects data on light intensity changes at different wavelengths, and forms a spectral signal after processing, thereby analyzing the gas composition and concentration.
[0003] Traditional gas concentration prediction models are mostly statically constructed. During the model training phase, parameter fitting and model building are performed based on limited data collected within a specific time period. Once the training is completed, the model structure and parameters are fixed. When faced with a continuously changing actual detection environment, its limitations are fully exposed. As time goes by, new gas sample data is constantly generated. These data may contain new gas characteristics or environmental factors. However, static models cannot automatically incorporate this new information into learning and updating. In fields such as environmental monitoring and industrial safety assurance, which require extremely high accuracy in gas concentration detection, serious consequences may occur. Summary of the invention
[0004] The purpose of the present invention is to provide an intelligent multi-gas detection module data processing system and method based on NDIR to solve the problems raised in the prior art.
[0005] To achieve the above object, the present invention provides the following technical solution: an intelligent multi-gas detection module data processing method based on NDIR, the method comprising the following steps:
[0006] Step 1: Use a multi-wavelength NDIR sensor to obtain the light intensity changes of the gas sample at different wavelengths to generate an original spectrum signal;
[0007] Step 2, using wavelet transform to denoise the spectral signal, and performing zero point calibration and dynamic baseline subtraction;
[0008] Step 3: Based on the Beer-Lambert law and environmental factors, a relationship model between gas absorption and spectral signals is established;
[0009] Step 4: Use the recursive least squares algorithm to update the model parameters and continuously optimize the gas concentration prediction;
[0010] Step 5: Use non-negative matrix decomposition algorithm to separate gas signals and predict the concentration of each gas;
[0011] Step 6: The lightweight model runs in real time at the edge side and periodically uploads the model to the cloud for global optimization and federated learning.
[0012] In Step 1, the multi-wavelength NDIR sensor integrates a tunable laser light source to cover multiple gas absorption peaks; when the gas sample enters the detection area, the sensor obtains data on the change in light intensity at different wavelengths based on the absorption characteristics of different gases for light of specific wavelengths, forming an original spectral signal, which is represented in discrete form: for the wavelength range [λ min , λ max , sampling is performed with a sampling interval set to Δλ, and discrete wavelength points λ i = λ min + (i - 1)Δλ are obtained; the light intensity values measured at each wavelength point λi form the original spectral signal, denoted as S[i];
[0013] Among them, λ min and λ max respectively represent the minimum and maximum values of the wavelength to be sampled; i = 1, 2, …, n; n = (λ max - λ min ) / Δλ + 1.
[0014] In Step 2, the method of wavelet transform is used to remove high-frequency noise: the discrete wavelet transform is performed on the original spectral signal S[i] using a wavelet basis function; for the discrete signal, the discrete wavelet transform is implemented through a filter bank; the low-pass filter coefficients and high-pass filter coefficients are set, and after one-layer wavelet decomposition of the signal S[i], the approximation coefficient A[S[i]] and the detail coefficient D[S[i]] are obtained;
[0015] The hard threshold is used to process the detail coefficient: when |D[S[i]]| > λ, the value of D[S[i]] is retained; when |D[S[i]]| ≤ λ, the value of D[S[i]] is set to 0;
[0016] Among them, λ represents the threshold, which is set by the staff or determined according to the threshold selection criterion;
[0017] Through the inverse discrete wavelet transform, the denoised spectral signal S'[i] is reconstructed based on the processed approximation coefficient and the processed detail coefficient;
[0018] The baseline signal measured when there is no gas sample is denoted as B[i]; zero calibration is performed on the spectral signal S'[i]: S1'[i] = S'[i] - B[i]; the quasi-line is estimated using the moving average method, and the dynamic baseline signal B'[i] is obtained according to the moving average window size, and the dynamic baseline is deducted: S”[i] = S1'[i] - B'[i];
[0019] Among them, S1'[i] represents the spectral signal after zero-point calibration; S”[i] represents the spectral signal after dynamic baseline subtraction.
[0020] In step 3, dynamic model adjustment: Obtain the absorption coefficient data of the target gas at different wavelengths from the standard spectral library; the target gas is represented as: [g1, g2, …, g s ; gas g a At wavelength λ i The absorption coefficient is represented as α a,i ;
[0021] Combined with the spectral signal S”[i], initially establish a relationship model between gas absorption and spectral signal according to the Beer-Lambert law: S”[i] = B[i]e -αa,i·L·c ,
[0022] Among them, s is a positive integer representing the number of target gases; g1 to g s Respectively represent the 1st to s-th target gases; a ∈ {1, 2, …, s}, representing the target gas sequence; L represents the optical path length; c represents the gas concentration;
[0023] Arrange environmental sensors to obtain the collected temperature t, humidity w, and air pressure p in real time;
[0024] Construct a regression model to fit the influence relationship of environmental parameters on gas absorption characteristics, and obtain the environmental parameter influence factor β; β = f(t, w, p); where f(t, w, p) represents a function of t, w, and p;
[0025] The absorption coefficient α i after real-time adjustment = α a,i × β, and adjust at each wavelength λ i .
[0026] In step 4, introduce the recursive least squares method. The deconvolution model parameter vector is represented as θ, and the initial value is θ0; the newly obtained spectral data is represented as y k ; Based on the adjusted absorption coefficient α i Construct the observation matrix H k ;
[0027] Update the parameters according to the recurrence formula of the RLS algorithm:
[0028] K k = (P k-1 H k T) / (γ + H k P k-1 H k T );
[0029] Pk =(1 / γ)(P k-1 -K k H k P k-1 ));
[0030] θ k =θ k-1 +K k (y k -H k θ k-1 );
[0031] where k represents the time step; γ is the forgetting factor, 0 < γ ≤ 1, which is used to control the influence degree of old data on the update of model parameters; K k is the gain matrix, which is calculated through the covariance matrix P k-1 at the previous moment and the observation matrix H k at the current moment; P k is the covariance matrix;
[0032] By continuously iterating the above formula, according to the newly acquired spectral data and the adjusted absorption coefficient, the deconvolution model parameter θ k is updated online.
[0033] In step 5, multi-gas separation: The mixed spectral signal after being processed by the dynamic model adjustment is expressed as matrix A, where the rows represent different wavelength sampling points and the columns represent different measurement times; Using the non-negative matrix factorization algorithm, matrix A is decomposed into two non-negative matrices B and C, that is, A≈BC; Among them, the column vectors of B represent the spectral characteristics of different gas components, and the row vectors of C represent the concentration distributions of each gas component at different measurement times;
[0034] The multiplicative update rule is used to iteratively solve B and C; Through multiple iterations, when the preset convergence condition is satisfied, the decomposed matrices B and C are obtained; Each column of B is extracted to obtain the spectral signals of each gas component;
[0035] The background signal is obtained by using the reference channel and is expressed as a vector or matrix with the same dimension as the spectral signals of each gas component; The background interference is subtracted from the spectral signals of each gas component to obtain the spectral characteristics of each gas.
[0036] In step 6, each detection module collects the locally preprocessed and spectroscopically deconvolved data at the edge and organizes them into a data set; The lightweight neural network 1D–CNN is selected;
[0037] Training with loss function and optimizer: For the gas concentration prediction task, mean squared error is used as the loss function, and stochastic gradient descent is selected as the optimizer. During training, the predicted values are calculated through forward propagation, the gradients are calculated through backward propagation, and the model parameters are updated. The training is continuously iterated until the loss function no longer decreases on the validation set or reaches the preset maximum number of training epochs. Through training, the model extracts spectral features and predicts the local gas concentration.
[0038] After completing local training, the edge detection module regularly uploads the model parameters obtained from local training to the cloud. After receiving the model parameters uploaded by each edge device, the cloud uses the federated averaging algorithm for aggregation, performs weighted averaging on the model parameters of each edge device, and obtains the globally optimized model parameters.
[0039] The edge device runs a lightweight model in real time. Using the model obtained through preprocessing, spectral deconvolution, and local training, it processes the data collected in real time. The spectral data collected in real time is formatted and preprocessed according to the input requirements of the local training model, and then input into the model for forward propagation calculation to obtain the predicted gas concentration value.
[0040] Set a gas concentration threshold. When the gas concentration predicted by the model exceeds this threshold, an alarm is immediately triggered. At the same time, the relevant data is packaged and uploaded to the cloud for subsequent analysis.
[0041] The cloud receives and stores the data uploaded by the edge device, including normal detection data and data in abnormal situations. Using the stored historical data and the globally aggregated model parameters, the global model is continuously optimized. The federated learning process is periodically restarted, new historical data is incorporated into the training, and the model parameters are updated in real time according to the newly uploaded data.
[0042] An intelligent multi-gas detection module data processing system based on NDIR, which includes a data acquisition and preprocessing module, a gas absorption and prediction module, and an edge and cloud module.
[0043] The data acquisition and preprocessing module is used to collect spectral data and environmental parameters, perform denoising, zero calibration, and dynamic baseline deduction to ensure the quality of the spectral signal. The gas absorption and prediction module is used to establish a gas absorption model based on the Beer-Lambert law and environmental data, and use the NMF and RLS algorithms to predict the gas concentration. The edge and cloud module is used to predict the gas concentration in real time at the edge and trigger an alarm. The cloud optimizes the model through federated learning to achieve global parameter update.
[0044] The data acquisition and preprocessing module includes a sensor unit, an environmental data unit, and a preprocessing unit.
[0045] The sensor unit is used to collect multi-wavelength spectral data; the environmental data unit is used to obtain environmental parameters such as temperature, humidity, and air pressure; the preprocessing unit is used to denoise the spectral signal, calibrate the zero point, and perform dynamic baseline deduction.
[0046] The gas absorption and prediction module includes a gas model unit and a gas separation and prediction unit;
[0047] The gas model unit is used to establish an absorption model based on the Beer-Lambert law and environmental data, and adjust the absorption coefficient; the gas separation and prediction unit is used to separate the gas signal using the NMF algorithm and apply the RLS algorithm to predict the gas concentration in real time;
[0048] The edge and cloud module includes an edge computing unit and a cloud learning unit;
[0049] The edge computing unit is used to perform real-time prediction on the edge device and trigger an alarm; the cloud learning unit is used to upload the local model to the cloud and perform global optimization and model aggregation through federated learning.
[0050] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention monitors environmental parameters such as temperature, humidity, and air pressure in real time, constructs a regression model to obtain the environmental parameter influence factors, and dynamically adjusts the absorption coefficient, which can accurately compensate for the influence of environmental changes on the gas absorption characteristics; the present invention introduces the recursive least squares method to update the deconvolution model parameters online, and combines federated learning to enable the edge and the cloud to cooperate. The model can be optimized in real time according to new data and environmental changes, overcoming the problems that traditional static models cannot adapt to new situations and the accuracy decreases after long-term use, and always maintaining high-precision prediction, providing continuous and reliable support for gas monitoring. Description of the Drawings
[0051] Figure 1 It is a schematic diagram of the steps of the data processing method of the intelligent multi-gas detection module based on NDIR of the present invention;
[0052] Figure 2 It is a schematic diagram of the process of the data processing system of the intelligent multi-gas detection module based on NDIR of the present invention. Detailed Embodiments
[0053] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0054] Embodiment: As Figure 1 - Figure 2As shown in the figure, the present invention provides a technical solution, a data processing method for an intelligent multi-gas detection module based on NDIR. The method includes the following steps:
[0055] Step 1: Use a multi-wavelength NDIR sensor to obtain the light intensity changes at different wavelengths of a gas sample, and generate an original spectral signal.
[0056] Step 2: Use wavelet transform to denoise the spectral signal, and perform zero-point calibration and dynamic baseline deduction.
[0057] Step 3: Based on the Beer-Lambert law and combined with environmental factors, establish a relationship model between gas absorption and spectral signal.
[0058] Step 4: Use the recursive least squares algorithm to update the model parameters and continuously optimize the gas concentration prediction.
[0059] Step 5: Use the non-negative matrix factorization algorithm to separate the gas signals and predict the concentrations of each gas.
[0060] Step 6: The lightweight model runs in real time at the edge, and the model is regularly uploaded to the cloud for global optimization and federated learning.
[0061] In Step 1, the multi-wavelength NDIR sensor integrates a tunable laser light source, covering multiple gas absorption peaks; when the gas sample enters the detection area, the sensor obtains the data of the light intensity changes at different wavelengths based on the absorption characteristics of different gases for light of specific wavelengths, and forms an original spectral signal, which is represented in discrete form: sample the wavelength range [λ min , λ max , set the sampling interval as Δλ, and obtain the discrete wavelength points λ i = λ min + (i - 1)Δλ; the light intensity values measured at each wavelength point λi constitute the original spectral signal, denoted as S[i].
[0062] Among them, λ min and λ max respectively represent the minimum value and the maximum value of the wavelength to be sampled; i = 1, 2,..., n; n = (λ max - λ min ) / Δλ + 1.
[0063] In Step 2, use the wavelet transform method to remove high-frequency noise: perform discrete wavelet transform on the original spectral signal S[i] using the wavelet basis function; for discrete signals, the discrete wavelet transform is implemented through a filter bank; set the low-pass filter coefficients and high-pass filter coefficients, and after one-layer wavelet decomposition of the signal S[i], the approximation coefficient A[S[i]] and the detail coefficient D[S[i]] are obtained.
[0064] Threshold the detail coefficients using a hard threshold: when |D[S[i]]| > λ, retain the value of D[S[i]]; when |D[S[i]]| ≤ λ, set the value of D[S[i]] to 0;
[0065] where λ represents the threshold, which is set by the staff or determined according to the threshold selection criterion;
[0066] Through the inverse discrete wavelet transform, reconstruct the denoised spectral signal S'[i] according to the processed approximation coefficients and the processed detail coefficients;
[0067] Measure the baseline signal obtained when there is no gas sample, denoted as B[i]; perform zero calibration on the spectral signal S'[i]: S1'[i] = S'[i] - B[i]; Estimate the reference line using the moving average method, and obtain the dynamic baseline signal B'[i] according to the moving average window size, and subtract the dynamic baseline: S”[i] = S1'[i] - B'[i];
[0068] where S1'[i] represents the spectral signal after zero calibration; S”[i] represents the spectral signal after subtracting the dynamic baseline.
[0069] In step 3, dynamic model adjustment: Obtain the absorption coefficient data of the target gas at different wavelengths from the standard spectral library; The target gas is represented as: [g1, g2, …, g s ; The gas g a The absorption coefficient at the wavelength λ i is represented as α a,i ;
[0070] Combined with the spectral signal S”[i], initially establish a relationship model between gas absorption and the spectral signal according to the Beer-Lambert law: S”[i] = B[i]e -αa,i·L·c ,
[0071] where s is a positive integer representing the number of target gases; g1~g s represent the 1st to s-th target gases respectively; a ∈ {1, 2, …, s}, representing the target gas sequence; L represents the optical path length; c represents the gas concentration;
[0072] Arrange environmental sensors to obtain the collected temperature t, humidity w, and air pressure p in real time;
[0073] Construct a regression model to fit the influence relationship of environmental parameters on gas absorption characteristics, and obtain the environmental parameter influence factor β; β = f(t, w, p); where f(t, w, p) represents a function of t, w, and p;
[0074] The absorption coefficient α i after real-time adjustment = α a,i×β, adjusted at each wavelength λ i At this point.
[0075] In step 4, the recursive least squares method is introduced. The deconvolution model parameter vector is denoted as θ, with an initial value of θ0; the newly acquired spectral data is denoted as y k ; Based on the adjusted absorption coefficient α i Construct the observation matrix H k ;
[0076] According to the recurrence formula of the RLS algorithm, parameter update is performed:
[0077] K k =(P k-1 H k T) / (γ + H k P k-1 H k T );
[0078] P k =(1 / γ)(P k-1 - K k H k P k-1 );
[0079] θ k = θ k-1 + K k (y k - H k θ k-1 );
[0080] Among them, k represents the time step; γ is the forgetting factor, 0 < γ ≤ 1, which is used to control the influence degree of old data on the model parameter update; K k is the gain matrix, calculated through the covariance matrix P k-1 at the previous moment and the observation matrix H k at the current moment; P k is the covariance matrix;
[0081] By continuously iterating the above formula, according to the newly acquired spectral data and the adjusted absorption coefficient, the deconvolution model parameter θ k is updated online.
[0082] In step 5, multi-gas separation: The mixed spectral signal after dynamic model adjustment is represented as matrix A, whose rows represent different wavelength sampling points and columns represent different measurement times; using the non - negative matrix factorization algorithm, matrix A is decomposed into two non - negative matrices B and C, that is, A≈BC; among them, the column vectors of B represent the spectral characteristics of different gas components, and the row vectors of C represent the concentration distributions of each gas component at different measurement times;
[0083] Iteratively solve for B and C using the multiplicative update rule; through multiple iterations, when the preset convergence condition is met, obtain the decomposed matrices B and C; extract each column of B to obtain the spectral signals of each gas component;
[0084] Use the reference channel to obtain the background signal, which is represented as a vector or matrix with the same dimension as the spectral signals of each gas component; subtract the background interference from the spectral signals of each gas component to obtain the spectral characteristics of each gas.
[0085] In step 6, each detection module collects locally preprocessed and spectroscopically deconvolved data at the edge and organizes it into a dataset; select the lightweight neural network 1D–CNN;
[0086] Use the loss function and optimizer for training: for the gas concentration prediction task, use the mean squared error as the loss function and select stochastic gradient descent as the optimizer; during training, calculate the predicted values through forward propagation, calculate the gradients through backward propagation and update the model parameters, and continuously iterate the training until the loss function no longer decreases on the validation set or reaches the preset maximum number of training epochs; through training, the model extracts spectral features and predicts the local gas concentration;
[0087] After the edge detection module completes local training, it regularly uploads the locally trained model parameters to the cloud; after the cloud receives the model parameters uploaded by each edge, it uses the federated averaging algorithm for aggregation, performs weighted averaging on the model parameters of each edge to obtain globally optimized model parameters;
[0088] The edge runs the lightweight model in real time, uses the model obtained through preprocessing, spectroscopic deconvolution, and local training to process the real-time collected data; convert and preprocess the real-time collected spectral data according to the input requirements of the local training model, and then input it into the model for forward propagation calculation to obtain the predicted gas concentration value;
[0089] Set a gas concentration threshold, and when the gas concentration predicted by the model exceeds this threshold, immediately trigger an alarm; at the same time, package and upload the relevant data to the cloud for subsequent analysis;
[0090] The cloud receives and stores the data uploaded by the edge, including normal detection data and data under abnormal conditions; uses the stored historical data and globally aggregated model parameters to continuously optimize the global model; regularly re-perform the federated learning process, incorporate the new historical data into the training, and update the model parameters in real time according to the newly uploaded data.
[0091] An intelligent multi-gas detection module data processing system based on NDIR, which includes a data acquisition and preprocessing module, a gas absorption and prediction module, and an edge and cloud module;
[0092] The data acquisition and preprocessing module is used to collect spectral data and environmental parameters, perform denoising, zero calibration, and dynamic baseline deduction to ensure the quality of spectral signals; the gas absorption and prediction module is used to establish a gas absorption model based on the Beer-Lambert law and environmental data, and use the NMF and RLS algorithms to predict gas concentrations; the edge and cloud module is used to predict gas concentrations in real time at the edge and trigger alarms, and the cloud optimizes the model through federated learning to achieve global parameter updates.
[0093] The data acquisition and preprocessing module includes a sensor unit, an environmental data unit, and a preprocessing unit;
[0094] The sensor unit is used to collect multi-wavelength spectral data; the environmental data unit is used to obtain environmental parameters such as temperature, humidity, and air pressure; the preprocessing unit is used to perform denoising, zero calibration, and dynamic baseline deduction on spectral signals.
[0095] The gas absorption and prediction module includes a gas model unit and a gas separation and prediction unit;
[0096] The gas model unit is used to establish an absorption model according to the Beer-Lambert law and environmental data, and adjust the absorption coefficient; the gas separation and prediction unit is used to separate gas signals using the NMF algorithm and apply the RLS algorithm to predict gas concentrations in real time;
[0097] The edge and cloud module includes an edge computing unit and a cloud learning unit;
[0098] The edge computing unit is used to perform real-time prediction on edge devices and trigger alarms; the cloud learning unit is used to upload the local model to the cloud and perform global optimization and model aggregation through federated learning.
[0099] In this embodiment: An industrial waste gas emission monitoring station needs to monitor the concentrations of three gases, sulfur dioxide, nitric oxide, and carbon monoxide, in the waste gas in real time to ensure that the waste gas emissions meet environmental protection standards;
[0100] Sensor parameters: Multi-wavelength NDIR sensor: The wavelength range [λmin, λmax] is set to [2.5μm, 5μm], the sampling interval Δλ = 0.01μm; the optical path length L = 10cm;
[0101] Select the Daubechies4 wavelet basis function for discrete wavelet transform; the low-pass filter coefficients and high-pass filter coefficients are generated according to the characteristics of the Daubechies4 wavelet basis function; the threshold λ is determined by the Stein unbiased risk estimator criterion;
[0102] The forgetting factor γ of the recursive least squares method is 0.98; the initial value θ0 of the deconvolution model parameter vector θ is set to [0.1, 0.1, 0.1], corresponding to three gases;
[0103] Neural network parameters: 1D-CNN network structure: The input layer is the spectral data dimension, determined according to the number of sampling points, including two convolutional layers with convolutional kernel sizes of 3 and 5 respectively, a stride of 1, two pooling layers with a pooling window size of 2, a fully connected layer, and the output layer is the predicted values of the concentrations of three gases; Training parameters: The maximum number of training epochs is set to 100, and the learning rate is 0.001;
[0104] Signal acquisition: At a certain moment, the sensor samples the wavelength range [2.5μm, 5μm] with a sampling interval of 0.01μm, then the number of sampling points n = (5 - 2.5) / 0.01 + 1 = 251;
[0105] Measure the light intensity value at each wavelength point to obtain the original spectral signal S[i], i = 1, 2, …, 251; The light intensity value S[1] = 1000 (unit: arbitrary light intensity unit) is measured at a wavelength of 2.5μm, and S[2] = 998 at 2.51μm, etc.;
[0106] Perform discrete wavelet transform on the original spectral signal S[i] using Daubechies4 wavelet basis function; It is implemented through a filter bank, and after one-level wavelet decomposition, the approximation coefficient A[S[i]] and the detail coefficient D[S[i]] are obtained;
[0107] Determine the threshold λ = 50 according to the Stein unbiased likelihood estimation criterion; Perform threshold processing on the detail coefficients. When |D[S[i]]| > 50, retain the value of D[S[i]]; when |D[S[i]]| ≤ 50, set the value of D[S[i]] to 0;
[0108] After discrete wavelet inverse transform, reconstruct the denoised spectral signal S'[i] according to the processed approximation coefficient and the processed detail coefficient;
[0109] Measure the baseline signal B[i] when there is no gas sample. B[1] = 800 at a wavelength of 2.5μm, B[2] = 802 at 2.51μm, etc.;
[0110] Perform zero calibration on S'[i] to obtain S1'[i] = S'[i] - B[i]; For example, at a wavelength of 2.5μm, S1'[1] = S'[1] - B[1] = 1000 - 800 = 200;
[0111] The moving average method is used to estimate the alignment line, and the moving average window size is set to 10; the dynamic baseline signal B'[i] is calculated according to the moving average window; for example, when calculating B'
[11] , the average value of S1'[1] to S1'
[10] is used as the value of B'
[11] ;
[0112] The dynamic baseline is deducted to obtain S”[i] = S1'[i] - B'[i]; for example, if B'
[11] = 190 is calculated, then S”
[11] = S1'
[11] - B'
[11] ;
[0113] The absorption coefficient data of sulfur dioxide, nitrogen monoxide, and carbon monoxide at different wavelengths are obtained from the standard spectral library; for example, at a wavelength of 2.5μm, the sulfur dioxide absorption coefficient α1,1 = 0.05, the nitrogen monoxide absorption coefficient α2,1 = 0.03, and the carbon monoxide absorption coefficient α3,1 = 0.01;
[0114] Combined with the spectral signal S”[i], a relationship model between gas absorption and spectral signal is initially established according to the Beer-Lambert law: S”[i] = B[i]e^(-αa,iLc); for sulfur dioxide, at a wavelength of 2.5μm, B[1] = 800, L = 10cm, and the concentration c1 is unknown, then S”[1] = 800e^(-0.05×10×c1);
[0115] Environmental sensors are arranged to obtain the collected temperature t = 30°C, humidity w = 50%, and air pressure p = 101.3kPa in real time;
[0116] A regression model is constructed, and the regression model is β = 0.01t + 0.005w + 0.001p + 0.5; the environmental parameter influence factor β is calculated;
[0117] The absorption coefficient is adjusted in real time. For sulfur dioxide at a wavelength of 2.5μm, the adjusted absorption coefficient α1 = α1,1×β;
[0118] The newly obtained spectral data yk is the spectral signal S”[i] after preprocessing at the current moment; an observation matrix Hk is constructed based on the adjusted absorption coefficient αi; the observation matrix Hk is a 251×3 matrix (251 wavelength points, 3 gases), where the element in the j-th row and a-th column is the coefficient related to the wavelength λj and the gas ga (related to the adjusted absorption coefficient);
[0119] Parameter update is performed according to the recurrence formula of the RLS algorithm: the gain matrix and covariance matrix are calculated, and the deconvolution model parameter vector is updated; after one update, a new θk value is obtained. For example, after update, θk = [0.12, 0.11, 0.105];
[0120] The mixed spectral signal after dynamic model adjustment processing is represented as matrix A, where the rows represent 251 different wavelength sampling points and the columns represent different measurement times (currently the k-th measurement time, with only one column of data);
[0121] Using the non-negative matrix factorization algorithm, matrix A is decomposed into two non-negative matrices B and C, i.e., A≈BC; the multiplicative update rule is used to iteratively solve for B and C; after 50 iterations, the preset convergence condition is satisfied (such as the maximum relative change of matrix elements between two iterations is less than 0.001), and the decomposed matrices B and C are obtained;
[0122] The column vectors of B represent the spectral characteristics of different gas components, and the row vectors of C represent the concentration distributions of each gas component at the current measurement time;
[0123] The background signal is obtained using the reference channel, and the background signal is a vector with the same dimension (251 elements) as the spectral signals of each gas component; the background interference is subtracted from the spectral signals of each gas component (extracted from B) to obtain the spectral characteristics of each gas; for example, for the spectral signal of sulfur dioxide, the spectral characteristic value at a wavelength of 2.5 μm is subtracted by the value of the background signal at this wavelength to obtain the spectral characteristic value of sulfur dioxide after background interference subtraction;
[0124] The edge device collects the locally preprocessed and spectroscopically deconvolved data and organizes it into a data set. The data set is divided into a training set (80%), a validation set (10%), and a test set (10%);
[0125] Select a 1D-CNN neural network for training: use the mean squared error as the loss function, and the optimizer selects stochastic gradient descent; during the training process, the predicted values are calculated through forward propagation, and the gradients are calculated and the model parameters are updated through backward propagation; after 80 rounds of training, the loss function no longer decreases on the validation set, and the training is completed;
[0126] The edge device runs the lightweight model in real time, converts and preprocesses the real-time collected spectral data according to the input requirements of the locally trained model, and then inputs it into the model for forward propagation calculation to obtain the predicted gas concentration values; for example, the predicted sulfur dioxide concentration is 50 ppm, the nitric oxide concentration is 30 ppm, and the carbon monoxide concentration is 20 ppm;
[0127] Set gas concentration thresholds, such as the sulfur dioxide threshold is 60 ppm, the nitric oxide threshold is 40 ppm, and the carbon monoxide threshold is 30 ppm; the current predicted concentrations do not exceed the thresholds, and no alarm is triggered;
[0128] The edge device regularly uploads the model parameters obtained from local training to the cloud; it uploads once a day; after the cloud receives the model parameters uploaded by each edge device, it uses the federated averaging algorithm for aggregation, performs weighted averaging on the model parameters of each edge device to obtain the globally optimized model parameters;
[0129] The cloud uses the stored historical data and the globally aggregated model parameters to continuously optimize the global model; it re - conducts the federated learning process every week, incorporates the new historical data into the training, and updates the model parameters in real - time according to the newly uploaded data.
[0130] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above - mentioned exemplary embodiments, and without departing from the spirit or basic characteristics of the present invention, the present invention can be implemented in other specific forms. Therefore, from any point of view, the embodiments should be regarded as exemplary and non - restrictive. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be embraced within the present invention. Any reference signs in the claims should not be regarded as limiting the claimed claim.
Claims
1. A data processing method for an intelligent multi-gas detection module based on NDIR, characterized in that: The method includes the following steps: Step 1: Use a multi-wavelength NDIR sensor to obtain the change in light intensity at different wavelengths of a gas sample, and generate an original spectral signal; Step 2: Adopt wavelet transform to denoise the spectral signal, and perform zero-point calibration and dynamic baseline deduction; Step 3: Based on the Beer-Lambert law and combined with environmental factors, establish a relationship model between gas absorption and spectral signal; Step 4: Use the recursive least squares algorithm to update the model parameters and continuously optimize the gas concentration prediction; Step 5: Adopt the non-negative matrix factorization algorithm to separate the gas signals and predict the concentration of each gas; Step 6: The lightweight model runs in real time at the edge, and the model is regularly uploaded to the cloud for global optimization and federated learning.
2. The data processing method of the intelligent multi-gas detection module based on NDIR according to claim 1, wherein: In step 1, a multi-wavelength NDIR sensor integrates a tunable laser light source, covering multiple gas absorption peaks; when a gas sample enters the detection area, the sensor obtains data on the change in light intensity at different wavelengths based on the absorption characteristics of different gases for light of specific wavelengths, forming an original spectral signal, which is represented in discrete form: for the wavelength range [λ min , λ max , sampling is performed with a sampling interval set to Δλ, and discrete wavelength points λ i = λ min + (i - 1)Δλ are obtained; the light intensity values measured at each wavelength point λi constitute the original spectral signal, denoted as S[i]; where λ min and λ max represent the minimum and maximum values of the wavelength to be sampled, respectively; i = 1, 2, …, n; n = (λ max - λ min ) / Δλ + 1.
3. The data processing method of the intelligent multi-gas detection module based on NDIR according to claim 2, characterized in that: In Step 2, the wavelet transform method is used to remove high-frequency noise: perform discrete wavelet transform on the original spectral signal S[i] using a wavelet basis function; for the discrete signal, the discrete wavelet transform is implemented through a filter bank; set the low-pass filter coefficient and high-pass filter coefficient, and after one-layer wavelet decomposition of the signal S[i], the approximation coefficient A[S[i]] and the detail coefficient D[S[i]] are obtained; Perform threshold processing on the detail coefficient using a hard threshold: when |D[S[i]]| > λ, retain the value of D[S[i]]; when |D[S[i]]| ≤ λ, set the value of D[S[i]] to 0; Among them, λ represents the threshold, which is set by the staff or determined according to the threshold selection criterion; Through the inverse discrete wavelet transform, reconstruct the denoised spectral signal S'[i] according to the processed approximation coefficient and the processed detail coefficient; Measure the baseline signal obtained when there is no gas sample, denoted as B[i]; perform zero-point calibration on the spectral signal S'[i]: S1'[i] = S'[i] - B[i]; estimate the reference line using the moving average method, and obtain the dynamic baseline signal B'[i] according to the moving average window size, and deduct the dynamic baseline: S”[i] = S1'[i] - B'[i]; Among them, S1'[i] represents the spectral signal after zero-point calibration; S”[i] represents the spectral signal after deducting the dynamic baseline process.
4. The data processing method of the intelligent multi-gas detection module based on NDIR according to claim 3, characterized in that: In step 3, dynamic model adjustment: Obtain the absorption coefficient data of the target gas at different wavelengths from the standard spectral library; The target gas is represented as: [g1, g2, …, g s ; The gas g a The absorption coefficient at the wavelength λ i is represented as α a,i ; Combined with the spectral signal S”[i], initially establish a relationship model between gas absorption and the spectral signal according to the Beer-Lambert law: S”[i] = B[i]e -αa,i·L·c , where s is a positive integer representing the number of target gases; g1 to g s respectively represent the 1st to s-th target gases; a ∈ {1, 2, …, s}, representing the target gas sequence; L represents the optical path length; c represents the gas concentration; Arrange environmental sensors to obtain the collected temperature t, humidity w, and air pressure p in real time; Construct a regression model to fit the influence relationship of environmental parameters on gas absorption characteristics, and obtain the environmental parameter influence factor β; β = f(t, w, p); where f(t, w, p) represents a function about t, w, and p; Absorption coefficient α adjusted in real time i =α a,i ×β, at each wavelength λ i Make adjustments at.
5. The data processing method of the intelligent multi-gas detection module based on NDIR according to claim 4, characterized in that: In step 4, the recursive least squares method is introduced, and the deconvolution model parameter vector is denoted as θ with an initial value of θ0; the newly acquired spectral data is denoted as y k ; based on the adjusted absorption coefficient α i an observation matrix H is constructed k ; Update the parameters according to the recurrence formula of the RLS algorithm: K k = (P k-1 H k T) / (γ + H k P k-1 H k T ); P k = (1 / γ)(P k-1 - K k H k P k-1 ); θ k = θ k-1 + K k (y k - H k θ k-1 ); where k represents the time step; γ is the forgetting factor, 0 < γ ≤ 1, which is used to control the influence degree of old data on the update of model parameters; K k is the gain matrix, which is calculated through the covariance matrix P k-1 at the previous moment and the observation matrix H k at the current moment; P k is the covariance matrix; By continuously iterating the above formula, the deconvolution model parameters θ are updated online according to the newly acquired spectral data and the adjusted absorption coefficient k .
6. The data processing method of the intelligent multi-gas detection module based on NDIR according to claim 5, characterized in that: In Step 5, multi-gas separation: represent the mixed spectral signal after dynamic model adjustment processing as matrix A, whose rows represent different wavelength sampling points and columns represent different measurement times; use the non-negative matrix factorization algorithm to decompose matrix A into two non-negative matrices B and C, that is, A ≈ BC; among them, the column vectors of B represent the spectral characteristics of different gas components, and the row vectors of C represent the concentration distributions of each gas component at different measurement times; Iteratively solve for B and C using the multiplicative update rule; through multiple iterations, when the preset convergence condition is met, obtain the decomposed matrices B and C; extract each column of B to obtain the spectral signals of each gas component. Use the reference channel to obtain the background signal, which is represented as a vector or matrix with the same dimension as the spectral signals of each gas component; subtract the background interference from the spectral signals of each gas component to obtain the spectral characteristics of each gas.
7. The data processing method of the intelligent multi-gas detection module based on NDIR according to claim 6, characterized in that: In step 6, each detection module collects the locally preprocessed and spectroscopically deconvolved data at the edge and organizes it into a dataset; select the lightweight neural network 1D–CNN. Use the loss function and optimizer for training: for the gas concentration prediction task, use the mean squared error as the loss function and select the stochastic gradient descent as the optimizer; during the training process, calculate the predicted values through forward propagation, calculate the gradients through backward propagation, and update the model parameters, continuously iterating the training until the loss function no longer decreases on the validation set or reaches the preset maximum number of training epochs. Through training, the model extracts spectral features and predicts the local gas concentration. After completing local training, the edge detection module regularly uploads the model parameters obtained from local training to the cloud. After receiving the model parameters uploaded by each edge, the cloud uses the federated averaging algorithm for aggregation, performs a weighted average on the model parameters of each edge to obtain the globally optimized model parameters. The edge runs the lightweight model in real time, using the model obtained through preprocessing, spectroscopic deconvolution, and local training to process the real-time collected data. Convert the format and preprocess the real-time collected spectral data according to the input requirements of the local training model, and then input it into the model for forward propagation calculation to obtain the predicted gas concentration value. Set a gas concentration threshold, and when the gas concentration predicted by the model exceeds this threshold, immediately trigger an alarm; at the same time, package and upload the relevant data to the cloud for subsequent analysis. The cloud receives and stores the data uploaded by the edge, including normal detection data and data in abnormal situations; uses the stored historical data and the globally aggregated model parameters to continuously optimize the global model; regularly re-perform the federated learning process, incorporate the new historical data into the training, and update the model parameters in real time according to the newly uploaded data.
8. An NDIR-based intelligent multi-gas detection module data processing system, applied to the NDIR-based intelligent multi-gas detection module data processing method according to any one of claims 1-7, characterized in that: The system includes a data acquisition and preprocessing module, a gas absorption and prediction module, and an edge and cloud module. The data acquisition and preprocessing module is used to collect spectral data and environmental parameters, perform denoising, zero calibration, and dynamic baseline subtraction to ensure the quality of the spectral signal; the gas absorption and prediction module is used to establish a gas absorption model based on the Beer-Lambert law and environmental data, and use the NMF and RLS algorithms to predict the gas concentration; the edge and cloud module is used to predict the gas concentration in real time at the edge and trigger an alarm, and the cloud optimizes the model through federated learning to achieve global parameter update.
9. The data processing system of the intelligent multi-gas detection module based on NDIR according to claim 8, wherein: The data acquisition and preprocessing module includes a sensor unit, an environmental data unit, and a preprocessing unit. The sensor unit is used to collect multi-wavelength spectral data; the environmental data unit is used to obtain environmental parameters such as temperature, humidity, and air pressure; the preprocessing unit is used to denoise the spectral signal, perform zero calibration, and dynamic baseline deduction.
10. The data processing system of the NDIR-based intelligent multi-gas detection module according to claim 9, characterized in that: The gas absorption and prediction module includes a gas model unit and a gas separation and prediction unit; The gas model unit is used to establish an absorption model based on the Beer-Lambert law and environmental data, and adjust the absorption coefficient; the gas separation and prediction unit is used to separate gas signals using the NMF algorithm and apply the RLS algorithm to predict gas concentration in real time; The edge and cloud module includes an edge computing unit and a cloud learning unit; The edge computing unit is used to perform real-time prediction on edge devices and trigger an alarm; the cloud learning unit is used to upload the local model to the cloud and perform global optimization and model aggregation through federated learning.
Citation Information
Cited By
AI technology-based oil-in-water spectrum analysis and data transmission system
CN120427549A
An oil-in-water spectrum analysis and data transmission system based on AI technology
CN120427549B
Breath gas concentration change warning system based on ndir data modeling
CN120604998B
Online virtual sensing method for hydrogen and ammonia emission of hydrogen internal combustion engine based on lightweight neural network
CN120952070A
Overlapped spectrum separation device and method based on novel evolution deep learning model
CN121049204A