Electrochemical sensor calibration method and system based on two-stage decoupling and extreme learning

By combining wavelet-Kalman filtering and extreme learning machine calibration, the problems of gas cross-interference and nonlinear response of electrochemical sensors in environmental monitoring are solved, achieving high-precision and robust concentration calibration, which is suitable for low-cost micro monitoring stations.

CN121955149APending Publication Date: 2026-05-01TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TIANJIN UNIV
Filing Date
2026-01-23
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Traditional electrochemical sensors suffer from gas cross-interference and nonlinear response problems in environmental monitoring, which lead to a decrease in measurement accuracy. Existing calibration methods cannot effectively solve these problems.

Method used

A calibration method based on two-stage decoupling and extreme learning is adopted, including wavelet-Kalman filtering preprocessing, linear decoupling and extreme learning machine nonlinear compensation. Through the cascaded processing of signal preprocessing, linear decoupling and nonlinear compensation, high-precision real-time concentration calibration is achieved.

Benefits of technology

It significantly improved measurement accuracy and model fit, increasing the goodness of fit from 0.7193 to 0.9440, enhancing the robustness and real-time processing capabilities of the system, making it suitable for deployment in low-cost, low-power micro monitoring stations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121955149A_ABST
    Figure CN121955149A_ABST
Patent Text Reader

Abstract

The invention discloses an electrochemical sensor calibration method and system based on two-stage decoupling and an extreme learning machine, and belongs to the technical field of sensor signal processing and intelligent calibration. Preprocessing the signal by adopting wavelet-Kalman combined filtering; performing preliminary decoupling by using a linear inverse matrix method; inputting the result into an extreme learning machine model for nonlinear fine tuning; finally, the final concentration is output through amplitude limiting processing. The system correspondingly comprises a preprocessing module, a linear decoupling module, a nonlinear fine tuning module and an amplitude limiting output module. Through a cascade strategy of combining linear decoupling and nonlinear compensation, the problems of cross interference and nonlinear response of the electrochemical sensor are effectively solved, and the measurement precision and the real-time performance are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Electrochemical Sensor Calibration Method and System Based on Two-Level Decoupling and Limit Learning Technical Field

[0001] This invention belongs to the field of electrochemical sensor signal processing and intelligent calibration technology, and in particular relates to an electrochemical sensor calibration method and system based on two-stage decoupling and extreme learning machine. Background Technology

[0002] Traditional environmental monitoring often relies on large instruments, which are costly to purchase, bulky, and complex to maintain, making it difficult to achieve widespread and dense monitoring coverage. To address this, micro-environmental monitoring stations based on electrochemical sensors have emerged. With their low cost, small size, ease of dense deployment, and simple maintenance, they have become an effective supplement to traditional monitoring methods.

[0003] Specifically, these miniature air quality monitoring stations typically employ electrochemical sensors targeting sulfur dioxide (SO2), nitrogen dioxide (NO2), ozone (O3), and carbon monoxide (CO) to achieve real-time measurement of major air pollutants. However, in practical application, these devices still face some challenges that urgently need to be addressed.

[0004] a. Gas cross-interference:

[0005] Although electrochemical sensors, constructed with Pt noble metal electrodes, permeable membranes, and electrolytes to create a multi-target gas filtration mechanism, exhibit selectivity, they are highly susceptible to "interference responses" from non-target gases. For example, sulfur dioxide (SO2) sensors not only respond to SO2 gas but also to other gases such as NO2 and O3. NO2 interference with SO2 sensors is particularly significant, reaching a strong negative feedback interference of -160% to -165%. This interference can even cancel out the target signal, leading to severely distorted readings or even negative values ​​that indicate physical failure.

[0006] b. Complexity of gas-mixed coupling:

[0007] Electrochemical sensors exhibit different response characteristics in low and high concentration ranges, and their full-range response curves show a certain degree of nonlinearity. Furthermore, in real-world mixed gas environments, deep-seated high-order cooperative interference exists between gases. When multiple gases coexist, the nonlinear fluctuations generated by their interactions are far more complex than interference from a single gas.

[0008] Currently, the calibration of electrochemical sensors used in ambient air monitoring stations is usually based on a fitting method using empirical formulas, that is, correction is made according to the general interference coefficients provided in the sensor manufacturer's technical manual. Summary of the Invention

[0009] To address the problem of decreased measurement accuracy caused by cross-interference and nonlinear response of multi-gas electrochemical sensors in micro environmental monitoring stations in the prior art, this invention aims to propose an electrochemical sensor calibration method and system based on two-stage decoupling and limit learning. Through cascaded processing of signal preprocessing, linear decoupling and nonlinear compensation, high-precision, real-time concentration calibration on embedded hardware is achieved.

[0010] To achieve the above-mentioned objectives, the present invention proposes the following technical solution:

[0011] In a first aspect, the present invention proposes an electrochemical sensor calibration method based on two-stage decoupling and limit learning, characterized in that the method includes the following cascaded steps:

[0012] Step 1: Preprocessing step, the raw signal of the electrochemical sensor array to be calibrated is subjected to joint filtering to eliminate rapid jump noise and circuit noise in the electrochemical reaction;

[0013] The raw signals from the electrochemical sensor array to be calibrated are subjected to joint filtering to eliminate rapid jump noise and circuit noise in the electrochemical reaction; Step 2: First-stage linear decoupling step, constructing the gas cross-interference coefficient matrix. The signal processed in the preprocessing step is initially decoupled using the linear inverse matrix method to obtain preliminary concentration prediction values ​​after linear decoupling. ;

[0014] Step 3: Second-level nonlinear fine-tuning step, adjusting the preliminary concentration prediction value S pre The input is fed into the Extreme Learning Machine (ELM) model, and the residual after the first-level linear decoupling step is compensated by the nonlinear mapping of the ELM model to obtain the fine-tuned concentration value after nonlinear residual compensation of the ELM model.

[0015] Step 4: Limiting process, performing logical limiting and zero-point truncation on the fine-tuned concentration value, and outputting the final calibrated concentration after logical limiting and zero-point truncation.

[0016] In some implementations, the joint filtering process in step one employs a wavelet-Kalman cascaded filtering architecture, specifically including:

[0017] First, the original signal is decomposed into five levels using the db8 wavelet basis. Then, a soft thresholding function is used to remove instantaneous high-frequency spike noise, resulting in the wavelet-filtered signal. ;

[0018] Subsequently, the wavelet-reconstructed signal is input into a Kalman recursive filter, and time-domain smoothing is achieved through prediction and correction stages to obtain the jointly filtered signal. .

[0019] In some implementations, step two involves constructing a gas cross-interference coefficient matrix. The methods include: obtaining the linear interference coefficients between gases through experimental calibration based on an electrochemical sensor response model, and utilizing inverse matrix operations. Solve for the preliminary concentration prediction value.

[0020] In some implementations, the extreme learning machine model in step three employs a single hidden layer structure, and its output weights are calculated by solving the hidden layer output matrix. The Moore-Penrose generalized inverse matrix is ​​obtained in one step, i.e. ,in, For the target concentration matrix, Hidden layer output matrix The Moore-Penrose generalized inverse is used, and the model uses the Sigmoid function as the activation function.

[0021] In some implementations, the input data is linearly normalized before entering the Extreme Learning Machine model, mapping it to the interval [0.2, 0.8] to avoid the saturation region of the Sigmoid activation function.

[0022] In some implementations, the limiting process in step four includes: truncating the output concentration to zero and assigning negative values ​​to zero; and protecting the upper limit of each sensor's range by truncating the concentration to the upper limit value when the concentration exceeds a preset threshold.

[0023] Secondly, this invention proposes an electrochemical sensor calibration system based on two-level decoupling and limit learning, used to implement the method described in any of the above statements, characterized in that the system comprises:

[0024] The preprocessing module is used to receive the raw signals from the electrochemical sensor array and perform wavelet-Kalman joint filtering on the raw signals to eliminate fast jump noise and circuit noise in the electrochemical reaction.

[0025] A linear decoupling module, connected to the preprocessing module, is used to perform operations based on the gas cross-interference coefficient matrix. The signal processed by the preprocessing module is subjected to a linear inverse matrix operation to output a preliminary concentration prediction value after linear decoupling. ;

[0026] The nonlinear fine-tuning module, connected to the linear decoupling module, includes an extreme learning machine processing unit for processing the preliminary concentration prediction value. The input is fed into the extreme learning machine model, and the residual output by the linear decoupling module is compensated by the nonlinear mapping of the model to obtain the fine-tuned concentration value after nonlinear residual compensation.

[0027] The limiting output module is connected to the nonlinear fine-tuning module and is used to perform logical limiting and zero-point truncation processing on the fine-tuned concentration value processed by the nonlinear fine-tuning module, and output the final calibrated concentration.

[0028] In some embodiments, the preprocessing module includes:

[0029] The wavelet filtering unit is configured to use the db8 wavelet basis for 5-level multi-scale decomposition and soft thresholding denoising.

[0030] The Kalman filter unit is configured for recursive filtering to achieve time-domain smoothing.

[0031] In some implementations, the extreme learning machine processing unit of the nonlinear fine-tuning module is deployed on edge computing hardware, including an STM32 series microcontroller, and the unit outputs weights in one go through generalized inverse matrix operations without iterative training.

[0032] In some embodiments, the system further includes a data normalization unit for linearly mapping the input data to the interval [0.2, 0.8] to adapt to the characteristics of the activation function; the data normalization unit is located between the output of the linear decoupling module and the input of the nonlinear fine-tuning module.

[0033] Compared with the prior art, the present invention has achieved the following beneficial technical effects:

[0034] 1) High-precision calibration is achieved: Through a unique two-stage cascaded calibration architecture of "linear inverse matrix coarse adjustment" and "extreme learning machine nonlinear fine adjustment," the limitations of a single model are overcome. This method not only efficiently eliminates major linear cross-interference (such as the large-scale negative interference of NO2 on SO2 sensors), but also accurately compensates for complex nonlinear coupling residuals. Experimental data show that this invention significantly improves the model's goodness of fit (i.e., calibration accuracy R0). 2 The accuracy was significantly improved from 0.7193 when using only the linear inverse matrix to 0.9440, achieving a leap in precision.

[0035] 2) Achieved strong robustness and stability: An innovative data normalization strategy was adopted to linearly map the input data to the [0.2, 0.8] interval, effectively avoiding the saturation region of the Sigmoid activation function. This process ensures that the model maintains stable mapping capability even when facing extreme concentrations (such as high concentrations of O3) or signal fluctuations, avoiding prediction failures caused by gradient saturation and significantly enhancing the system's robustness in real-world complex environments.

[0036] 3) Highly efficient real-time processing capability: The Extreme Learning Machine (ELM) model used in the second stage obtains its output weights in a single step by solving the Moore-Penrose generalized inverse matrix, eliminating the need for iterative training of traditional neural networks. This mechanism maintains high real-time performance while significantly improving computational efficiency, making it suitable for the real-time data processing requirements of micro-monitoring stations.

[0037] 4) Cost Advantage: Due to the efficient preprocessing of wavelet-Kalman filtering and the use of the analytical solution characteristics of ELM, the overall algorithm has low computational complexity and low resource consumption. The method described in this invention is easy to deploy and run stably on low-cost, low-power microcontroller edge hardware such as STM32, and is suitable for large-scale, high-density deployment of micro environmental monitoring stations. Attached Figure Description

[0038] Figure 1 is a flowchart of the electrochemical sensor calibration method based on two-stage decoupling and limit learning of the present invention;

[0039] Figure 2 is a block diagram of the electrochemical sensor calibration method based on two-stage decoupling and limit learning of the present invention.

[0040] Figure 3 shows a comparison between the original signal and the signal after wavelet-Kalman joint filtering;

[0041] Figure 4 is a comparison of the prediction results of different models for CO, O3, SO2 and NO2. Detailed Implementation

[0042] To enable those skilled in the art to clearly understand and implement the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only for explaining the present invention and are not intended to limit the scope of protection of the present invention.

[0043] Example 1: As shown in Figure 1, the flowchart of the electrochemical sensor calibration method based on two-stage decoupling and limit learning of the present invention is illustrated, including preprocessing, two-stage decoupling, and amplitude limiting steps. The specific process of this method includes the following steps:

[0044] Step 1: Preprocessing step, the raw signal of the electrochemical sensor array to be calibrated is subjected to joint filtering to eliminate rapid jump noise and circuit noise in the electrochemical reaction;

[0045] The joint filtering process in step one adopts a wavelet-Kalman cascaded filtering architecture, specifically including:

[0046] First, the original signal is decomposed into five levels using the db8 wavelet basis, and a soft thresholding function is used to remove transient high-frequency spike noise. In practice, the original signal contains complex electrochemical noise, which is then removed during data cleaning and noise reduction. This scheme captures impulse noise through five-level db8 wavelet decomposition, and uses soft thresholding to ensure waveform continuity. The sampled signal values ​​of CO, O3, SO2, and NO2 for the electrochemical sensor to be calibrated are as follows: express The actual value of environmental concentration. Therefore, the corresponding... The sensor samples the raw signal.

[0047] Subsequently, the wavelet-reconstructed signal is input into a Kalman recursive filter, and time-domain smoothing is achieved through prediction and correction stages. The wavelet-Kalman joint filtering algorithm further includes the following processing:

[0048] 1-1. First, perform wavelet transform on the original signal (using the db8 wavelet basis) to remove high-frequency spikes and burst noise. The specific processing flow is as follows:

[0049] 1-1-1 Multi-scale decomposition of the signal: Select the preset db8 wavelet basis function to perform 5-level multi-scale wavelet decomposition on the input original signal.

[0050] a. The considerations for choosing the db8 wavelet basis are as follows:

[0051] Electrochemical sensor signals contain complex electrical noise, primarily stemming from the randomness of adsorption-desorption on the electrode surface and rapid transitions generated by the circuitry. db8 possesses a high vanishing moment, enabling it to extremely sensitively capture and identify rapid transitions, high-frequency spikes, and sudden noise in the signal. Furthermore, by combining db8 with a soft thresholding function, its mathematical continuity at the threshold point can be utilized to ensure high-fidelity reconstruction, guaranteeing that the processed signal still accurately reflects the gas concentration fluctuation trend.

[0052] b. The advantages of using the 5-level decomposition technique are as follows:

[0053] The choice of the decomposition level (Level 5) is based on the characteristics of the electrochemical signal. Electrochemical gas-sensitive responses are typically low-frequency trend signals, while circuit thermal noise and transient interference are distributed in the high-frequency band. Through 5-level multi-scale decomposition, the signal can be divided into sufficiently fine frequency bands, thereby maximizing noise removal without inadvertently damaging the low-frequency components representing the true concentration. 1-1-2. Dynamic Threshold Calculation and Adaptive Scaling: An initial threshold is generated using a fixed threshold formula sqtwolog, and the threshold is dynamically adjusted based on a layer-dependent adaptive scaling mechanism (mln mode) according to the noise standard deviation of each decomposition level.

[0054] Furthermore, the specific process of "dynamic adjustment" is described as follows: In electrochemical sensor signal processing, since noise is not ideal white noise, its energy distribution is uneven across different frequency scales (decomposition levels). Therefore, a uniform threshold cannot be used, and a layer-dependent adaptive scaling mechanism ('mln' mode) is introduced. By calculating the absolute median deviation of a certain layer, the noise standard deviation specific to that layer is estimated; if the noise of a certain layer is large, the threshold of that layer is automatically increased to more effectively remove glitches; conversely, in layers with lower noise, the threshold is automatically reduced to retain the subtle gas concentration fluctuation characteristics to the maximum extent.

[0055] 1-1-3. Nonlinear soft thresholding: Apply a soft thresholding function with mathematical continuity to the wavelet coefficients of each layer for nonlinear mapping.

[0056] 1-1-4. Coefficient Shrinking Logic: Wavelet coefficients with absolute values ​​less than the dynamic threshold are set to zero to suppress noise, and coefficients greater than the threshold are processed according to the formula... Perform smooth contraction. Where:

[0057] Representing the original wavelet detail coefficients, these are the high-frequency signal detail coefficients obtained at each decomposition level after the original electrochemical signal has undergone five levels of multi-scale decomposition. They contain noise components in the signal as well as detailed information reflecting abrupt changes in gas concentration.

[0058] These represent the detail coefficients after shrinkage, specifically the coefficients processed by the soft thresholding function. These coefficients will then be used for inverse transform reconstruction of the signal, outputting a high-fidelity denoised signal.

[0059] This represents the dynamic threshold, which is the dynamic threshold mentioned in step 1.1.2 above. This parameter represents the "threshold" for determining whether a signal is noise or valid.

[0060] The sign function is mathematically defined as when... Returns 1 when Returns -1 when It returns to 0. Its function is to ensure that the coefficients always move smoothly towards zero during the contraction process, keeping the phase direction of the signal unchanged.

[0061] The multiplication operator representation indicates the multiplication operation between the result of the sign function and the contraction magnitude.

[0062] 1-1-5. Eliminating instantaneous high values: By utilizing the continuous characteristics of the soft threshold function at the threshold point, artificial waveform oscillations or distortions are avoided during the reconstruction process when filtering out "instantaneous high value" spikes caused by environmental interference in the signal.

[0063] Unlike the "hard threshold" that directly truncates, the soft threshold... The points are continuous. For values ​​greater than... The coefficient, while containing the abrupt changes in the signal, often also includes interference from "instantaneous high values." Through the above formula... The algorithm smoothly shrinks these large coefficients towards zero, reducing the amplitude of abrupt signal changes and effectively eliminating high-value glitches in the voltage signal during reconstruction. This invention improves robustness and signal fidelity: electrochemical sensors are often affected by circuit jumps and sudden noise. By using a soft threshold to accurately remove impulse noise without oscillation, the monitoring stability of the system in complex mixed gas environments is significantly improved.

[0064] Anti-distortion capability: By avoiding waveform oscillation, the signal will not be distorted due to human numerical sampling problems when entering the first stage of linear decoupling (such as the appearance of negative values ​​with no physical meaning), which enhances the robustness of the model.

[0065] 1-1-6. Inverse Signal Transform Reconstruction: The processed wavelet coefficients at each scale are reconstructed using an inverse transform to obtain a high-fidelity denoised signal, i.e., the reconstructed signal output after wavelet transform. .

[0066] 1-2. Then, after performing wavelet filtering on the original signal, the reconstructed signal output after wavelet transform is obtained. Input a Kalman recursive filter and perform time-domain smoothing to track the dynamic trend of the signal. The specific steps are as follows:

[0067] 1-2-1 Algorithm Initialization Parameter Configuration: The state transition matrix A and observation matrix H are both set to 1 in this invention. The process noise covariance Q is set to 1×10⁻⁶. −3 This value, used to reflect the uncertainty of the system model, can be adjusted based on the actual stability of the sensor. The measurement noise covariance R is set to 1×10⁻⁶.−2 This is used to characterize the noise level of the sensor itself. P (Estimated Covariance Matrix / Error Covariance Matrix) is initialized to 1 and is used to measure the accuracy of the state estimate. The first value is assigned to the initial value of the state estimate. .

[0068] 1-2-2, Let the recursive loop variable be... , From 1 to Data length N. Each time the value of k increases by 1, repeat steps 1-2-3 to 1-2-6.

[0069] 1-2-3. Kalman filtering process 1 performs prediction processing, which further includes:

[0070] State prediction: Based on the state estimate from the previous time step, predict the current state matrix, as shown in the formula. .

[0071] Covariance prediction: Calculate the covariance matrix of the predicted state, using the following formula:

[0072] 1-2-4. The Kalman filter process 2 performs update and correction processing, which further includes:

[0073] Calculate Kalman gain : Used to determine the trust weight for the current measurement value, the formula is: In the formula:

[0074] The observation matrix is ​​used to map the state space to the observation space. In this invention, to simplify calculations and adapt to embedded environments, this parameter is set to 1.

[0075] This represents the transpose of the observation matrix, used in matrix operations to calculate gain. Because... =1, therefore It is also 1.

[0076] This represents the measurement noise covariance, used to reflect the noise level of the sensor itself. In this invention, it is set to 1e-2. Increasing... A value that makes the filtering effect smoother (stronger noise reduction capability) will reduce the filtering effect. This will result in a faster signal response but may leave more residual noise.

[0077] This represents the state prediction value, which is the predicted value for the current time calculated based on the optimal estimate value of the previous time step.

[0078] This represents the state estimate, the core output of the Kalman filter, which is the optimal concentration estimate combining the predicted and actual measured values ​​(residual correction). After filtering... It will be assigned to the vector Proceed to the next calibration stage.

[0079] This represents the process noise covariance, reflecting the uncertainty of the system model. In this invention, it is set to 1×10-1. −3 It depends primarily on the physical stability of the sensor and the frequency of environmental changes.

[0080] The error covariance matrix (or error covariance matrix) is used to measure the accuracy of the state estimates. It is continuously updated during the recursive process. This provides an error reference for recursively predicting the next time step.

[0081] Update the state estimate and correct it using the measurement residuals: This yields the optimal estimate. ,in, This is the input signal at the current moment.

[0082] Obtain the updated covariance matrix The formula is This prepares for the recursion in the next moment.

[0083] 1-2-5. The reconstructed signal output after the second Kalman filter is the signal value after the joint filtering process. ; Update the state estimate Assigned to the output vector, represented as .

[0084] 1-2-6. Return to step 1-2-3 and repeat the process.

[0085] Step 2: First-level linear decoupling step, constructing the gas cross-interference coefficient matrix. The signal processed in the preprocessing step is initially decoupled using the linear inverse matrix method to obtain preliminary concentration prediction values ​​after linear decoupling. This step belongs to the first-level inverse matrix coarse adjustment, which solves the problem of large-scale interference. The processing of the first-level linear decoupling step further includes: using the cross-interference coefficient matrix, linearly separating the mutually coupled four gas signals to obtain the preliminary concentration. By establishing a gas cross-interference coefficient matrix Using the inverse matrix method Eliminating linear coupling interference between sensors achieves initial signal decoupling. Based on the reaction principle of electrochemical sensors, the sensor's response to a mixed gas can be approximated as a linear superposition of contributions from each gas. Let... The signal value after the aforementioned filtering process, This is the gas linear cross-interference coefficient matrix. If the error is nonlinear, the sensor response model can be expressed as:

[0086] ;

[0087] The above formula can be rewritten with the following expanded details:

[0088] ;

[0089] in:

[0090] , , , ;

[0091] , , , ;

[0092] ;

[0093] This is expressed as the cross-interference coefficient between gas y and target gas x. For example... express The interference coefficient of the sensor.

[0094] 2-1. First-level linear decoupling steps: Based on this model, the first-level linear decoupling process is executed in the following two steps:

[0095] 2-1-1. Calculate the linear cross-interference coefficient matrix:

[0096] The true concentrations were obtained sequentially through experimental calibration procedures. and The interference coefficients were obtained using linear regression.

[0097] = / ;

[0098] = / ;

[0099] ......;

[0100] Obtain the cross-interference coefficient matrix .

[0101] 2-1-2. Solving the preliminary linear inverse matrix to calibrate the concentration:

[0102] Using the obtained interference coefficient matrix Calculate the inverse matrix and reconstruct the measurement signal. Preliminary decoupling concentration prediction values ​​were obtained. :

[0103] ;

[0104] This step effectively eliminates linear cross-interference between gases, providing input for subsequent nonlinear compensation.

[0105] Step 3: Second-level nonlinear fine-tuning step, adjusting the preliminary concentration prediction value... The input is fed into the Extreme Learning Machine (ELM) model, and the residual after the first-level linear decoupling step is compensated by the nonlinear mapping of the ELM model to obtain the fine-tuned concentration value after nonlinear residual compensation of the ELM model.

[0106] The extreme learning machine model in step three adopts a single hidden layer structure, and its output weights are obtained by solving the hidden layer output matrix. The Moore-Penrose generalized inverse matrix is ​​obtained in one step, i.e. ,in, Let be the target concentration matrix, and let be the model using the Sigmoid function as the activation function.

[0107] Before entering the Extreme Learning Machine model, the input data is linearly normalized and mapped to the interval [0.2, 0.8] to avoid the saturation region of the Sigmoid activation function.

[0108] 3-1. The second-level nonlinear fine-tuning step (ELM fine-tuning) uses an extreme learning machine model to learn the initial concentration prediction value through its single hidden layer structure. Compared with the true concentration The model establishes a nonlinear residual mapping relationship between the hidden layer output matrices. It determines the output weights in a single step by solving for the Moore-Penrose generalized inverse matrix of the hidden layer output matrix, eliminating the need for iterative training as in the backpropagation algorithm, thus achieving extremely high computational efficiency. The specific process involves the following two steps:

[0109] 3-1-1. Data Preprocessing and Model Input Preparation, Dataset Splitting: First, all sample data is randomly shuffled, and then divided into training and test sets proportionally. Specifically, the first 70% of the randomized samples are used as the training set. The implementation logic code is as follows:

[0110] train_num = floor(0.7 * ), calculate the number of training samples, where floor represents rounding;

[0111] = (1:train_num), the input features of the training set;

[0112] = (1:train_num), the target concentration of the training set;

[0113] 3-1-2. Data Normalization: To adapt to the characteristics of the Sigmoid activation function in the subsequent ELM model and improve the stability and convergence speed of model training, the input data needs to be normalized. Normalization is performed to linearly map it to the interval [0.2, 0.8]. The specific steps are as follows:

[0114] 3-1-2-1. Calculate the training set statistics:

[0115] First, calculate the input features of the training set. (Right now The arithmetic mean and standard deviation of the training set (the portion of the dataset) are used to provide parameters for subsequent normalization. The calculation process can be described as follows:

[0116] = mean( ), calculate the arithmetic mean of each feature column;

[0117] = std( ), calculate the standard deviation of each feature column;

[0118] 3-1-2-2, Perform linear normalization mapping:

[0119] In the second-level nonlinear fine-tuning step of the electrochemical sensor calibration method, to adapt to the characteristics of the sigmoid activation function of the Extreme Learning Machine (ELM) and ensure the stability and efficiency of model training, the input data needs to be normalized preprocessed. The core logic of this processing is to linearly map the training set data to the target interval [0.2, 0.8], and its specific implementation includes the following two computational logics:

[0120] (1) Input feature normalization logic: based on the input features of the training set (i.e., preliminary concentration prediction value) The statistical properties of ) are first determined by subtracting its mean. Divide by the standard deviation Additional minimal constant To prevent division by zero, Z-score standardization is performed, and then the result is scaled and shifted to the target interval to obtain... The formula is expressed as:

[0121] ;

[0122] (2) Target concentration normalization logic: Simultaneously normalize the target concentration of the training set. (i.e., true concentration) Perform the same transformation. Use its own mean. with standard deviation Standardize and then map to the same interval to obtain The formula is expressed as:

[0123] ;

[0124] This normalization operation effectively avoids the slow convergence or failure caused by gradient vanishing during training by linearly transforming the data to the non-saturated region where the Sigmoid function is most sensitive, thereby significantly improving the accuracy, training speed and stability of ELM model nonlinear compensation.

[0125] 3-1-3. ELM Extreme Learning Machine Model Construction and Operation Mechanism:

[0126] The Extreme Learning Machine (ELM) model utilizes its hidden layer random weight mapping capability to automatically learn and fit complex nonlinear fluctuation characteristics in data. Its key feature is that it constructs the hidden layer output matrix by randomly generating input weights and biases, and then, based on the Moore-Penrose generalized inverse operation, obtains the output matrix through analytical solution. By obtaining the optimal output weights in one go, the traditional neural network requires iterative training and parameter tuning, thus significantly improving learning efficiency.

[0127] This model employs a single-hidden-layer feedforward neural network structure, specifically comprising the following three layers:

[0128] 1) Input layer: Let the first layer be the input layer. The input vector of each training sample is Its dimension corresponds to the number of features in the preliminary concentration prediction value after preprocessing and normalization.

[0129] 2) Hidden layer: The hidden layer contains One neuron. The input weight matrix is ​​randomly generated. With bias vector The input is nonlinearly mapped to generate the hidden layer output matrix. .

[0130] Output layer: ( The output vector corresponding to ) samples is Its dimensions are consistent with the concentration of the target gas.

[0131] Output weight matrix Through analytical solution Obtained directly by calculation, where, For the target concentration matrix, Hidden layer output matrix Moore-Penrose generalized inverse.

[0132] For a dataset containing N samples The output function of an Extreme Learning Machine (ELM) model can be described as follows:

[0133] ;

[0134] in:

[0135] This represents the activation function. The Sigmoid function is chosen for this model to effectively simulate the S-shaped nonlinear response characteristics commonly found in electrochemical reactions.

[0136] Indicates the connection between the input layer and the first... The weight vector of each hidden layer node

[0137] Indicates the connection of the first The output weights of each hidden layer node and the output layer node

[0138] The above system of equations can be simplified to the following matrix equations:

[0139]

[0140] in, The hidden layer output matrix has dimensions N×L, and is expressed as follows:

[0141] ;

[0142] Let be the output weight vector to be determined. Output matrix for target .

[0143] Select the output weight vector to be determined. As the optimal output weight of the system The optimal output weights of the system can be obtained analytically in one step by directly solving the Moore-Penrose generalized inverse matrix of the linear system described above. Its expression is:

[0144] ;

[0145] in, Hidden layer output matrix The Moore-Penrose generalized inverse. This solution process requires no iterative optimization, thus ensuring extremely high efficiency in model training.

[0146] Based on this analytical solution, the forward propagation function of the model can be directly applied. The normalized second-level calibration concentration value is obtained.

[0147] This analytical solution method based on the generalized inverse matrix not only completely avoids the complex calculation process of the adjoint matrix and determinant in the traditional matrix inversion operation, but also endows the model with extremely high real-time performance, thus making it perfectly adaptable to embedded hardware environments such as micro air stations where power consumption and computing power are strictly limited.

[0148] Step 4: Limiting process, performing logical limiting and zero-point truncation on the fine-tuned concentration value, and outputting the final calibrated concentration after logical limiting and zero-point truncation; the limiting process in step 4 includes: zero-point truncation of the output concentration, assigning zero to negative values; and protecting the upper limit of each sensor range, truncating to the upper limit value when the concentration exceeds a preset threshold.

[0149] After completing the second-level nonlinear fine-tuning, the predicted concentration data output by the ELM model were processed. Perform the following post-processing operations to ensure it conforms to physical meaning and actual range constraints:

[0150] 4-1. Data denormalization: Restoring the range from [0.2, 0.8] to the original range:

[0151] First, the normalized predicted concentration values ​​located in the interval [0.2, 0.8] are... Perform an inverse normalization operation to restore the original physical dimensions and range. The calculation process is described as follows:

[0152]

[0153] 4-2. Zero-point truncation protection to ensure non-negative concentration: After inverse normalization, the results are truncated at the zero point. If any concentration value is less than 0, it is assigned a value of 0. This operation ensures the physical validity of the concentration data. The implementation logic is as follows:

[0154] ;

[0155] 4-3. Upper limit protection: Constrains the concentration within the sensor's measurement range.

[0156] Finally, based on the upper limit of the design range of each gas sensor, an upper limit cutoff protection is implemented for the concentration value. The specific protection logic is as follows:

[0157] For SO2, NO2, and O3, the upper limit of the measurement range is 500 ppm, and the processing logic is as follows:

[0158] ;

[0159] For CO gas, the upper limit of the range is 10000 ppm, and the processing logic is as follows:

[0160] ;

[0161] After the above three steps, the final calibrated concentration output that meets the physical constraints and instrument range is obtained.

[0162] Summary: Comparing the goodness of fit of the first-level linear decoupling model and the second-level nonlinear fine-tuning model:

[0163] To quantitatively evaluate the performance improvement of the proposed two-level calibration architecture (linear inverse matrix decoupling + extreme learning machine nonlinear fine-tuning) compared to a single linear model, the root mean square error (RMSE) and goodness of fit (coefficient of determination R) were used. 2 () is used as the core evaluation indicator.

[0164] A. Goodness of fit of the linear inverse matrix model

[0165] Goodness of fit of a single linear inverse matrix model (i.e., a first-order decoupled model) Calculated using the following formula:

[0166] ;

[0167] In the formula, This represents the actual gas concentration. These are the preliminary concentration predictions output by the linear inverse matrix model. This is the average of the predicted values. This metric reflects the extent to which the model explains the linear variation in the data.

[0168] B. Goodness of fit of the Extreme Learning Machine (ELM) model

[0169] After the second level of nonlinear fine-tuning, the goodness of fit of the complete ELM model is... Calculated using the following formula:

[0170] ;

[0171] In the formula, This represents the fine-tuned concentration prediction value output by the ELM model. This metric comprehensively reflects the overall model accuracy after linear decoupling and nonlinear compensation.

[0172] By comparison and The numerical value can intuitively quantify the performance improvement brought by the ELM model. Experimental data shows that... Significantly higher than This demonstrates that the second-level nonlinear fine-tuning step added in this invention effectively captures and compensates for residual errors, thereby substantially improving the overall model's fit and prediction accuracy.

[0173] Example 2: As shown in Figure 2, the electrochemical sensor calibration system based on two-stage decoupling and limit learning of the present invention is illustrated, used to implement the method described in any of Examples 1. The system includes:

[0174] The preprocessing module 100 is used to receive the raw signal from the electrochemical sensor array and perform wavelet-Kalman joint filtering on the raw signal to eliminate fast jump noise and circuit noise in the electrochemical reaction.

[0175] The linear decoupling module 200, connected to the preprocessing module, is used to perform operations based on the gas cross-interference coefficient matrix. The signal processed by the preprocessing module is subjected to a linear inverse matrix operation to output a preliminary concentration prediction value after linear decoupling. ;

[0176] The nonlinear fine-tuning module 300, connected to the linear decoupling module, includes an extreme learning machine processing unit 310 for processing the preliminary concentration prediction value. The input is fed into the extreme learning machine model, and the residual output by the linear decoupling module is compensated by the nonlinear mapping of the model to obtain the fine-tuned concentration value after nonlinear residual compensation.

[0177] The limiting output module 400 is connected to the nonlinear fine-tuning module and is used to perform logical limiting and zero-point truncation processing on the fine-tuning concentration value processed by the nonlinear fine-tuning module, and output the final calibrated concentration.

[0178] The preprocessing module 100 further includes:

[0179] Wavelet filtering unit 110 is configured to use db8 wavelet basis for 5-level multi-scale decomposition and soft thresholding denoising.

[0180] The Kalman filter unit 120 is configured as a recursive filter to achieve time-domain smoothing.

[0181] Furthermore, the extreme learning machine processing unit of the nonlinear fine-tuning module 300 is deployed on edge computing hardware, including an STM32 series microcontroller, and this unit outputs weights in one go through generalized inverse matrix operations without iterative training.

[0182] Furthermore, the system also includes a data normalization unit 500, used to linearly map the input data to the interval [0.2, 0.8] to adapt to the characteristics of the activation function. The data normalization unit 500 is located between the output of the linear decoupling module 200 and the input of the nonlinear fine-tuning module 300.

[0183] Figure 3 shows a comparison between the original signal and the signal after wavelet-Kalman filtering. This figure visually demonstrates the key processing effect of step one (front-end preprocessing step) in the calibration method described in this invention. The blue curve represents the unprocessed original signal from the electrochemical sensor, exhibiting significant random noise and fluctuations; the green curve represents the signal after wavelet-Kalman joint filtering. The comparison shows that the filtered signal (green) effectively smooths high-frequency noise and anomalous jumps while retaining the main trends and amplitude characteristics of the original signal (blue), resulting in a smoother and more stable signal curve. This preprocessing significantly improves signal quality, providing clean and reliable input data for subsequent two-stage decoupling and concentration inversion, and is a crucial foundation for achieving high-precision calibration in this method.

[0184] Figure 4 shows a comparison of the prediction results of different models for CO, O3, SO2, and NO2. Specifically: (a) compares the prediction results of the traditional injection valve model and the ELM model for the standard value of carbon monoxide (CO); (b) compares the prediction results of the traditional injection valve model and the ELM model for the standard value of ozone (O3); (c) compares the prediction results of the traditional injection valve model and the ELM model for the standard value of sulfur dioxide (SO2); and (d) compares the prediction results of the traditional injection valve model and the ELM model for the standard value of nitrogen dioxide (NO2). In each sub-figure, red represents the standard value, blue represents the predicted value of the traditional model, and green represents the predicted value of the ELM model. This visually demonstrates that the ELM model used in this invention has better accuracy and fit than the traditional model in tracking the actual changing trends of gas concentrations.

[0185] The above embodiments illustrate the core idea of ​​the two-level decoupling and extreme learning machine collaborative calibration of the present invention. Within the scope of protection defined by the claims of the present invention, any modifications and improvements based on this concept should be considered to fall within the scope of protection of the present invention.

[0186] This invention is not limited to the embodiments described above. The above description of specific embodiments is intended to illustrate and explain the technical solutions of this invention. The specific embodiments described above are merely illustrative and not restrictive. Without departing from the spirit and scope of the claims, those skilled in the art can make many specific modifications based on the teachings of this invention, and these modifications all fall within the scope of protection of this invention.

Claims

1. A calibration method for electrochemical sensors based on two-stage decoupling and limit learning, characterized in that, The method includes the following cascaded steps: Step 1: Preprocessing step, processing the raw signals of the electrochemical sensor array to be calibrated. Joint filtering is performed to eliminate rapid switching noise in the electrochemical reaction and circuit noise; Step 2: First-stage linear decoupling step, constructing the gas cross-interference coefficient matrix. The signal processed in the preprocessing step is initially decoupled using the linear inverse matrix method to obtain preliminary concentration prediction values ​​after linear decoupling. ; Step 3: Second-level nonlinear fine-tuning step, adjusting the preliminary concentration prediction value S pre The input is fed into the Extreme Learning Machine (ELM) model, and the residual after the first-level linear decoupling step is compensated by the nonlinear mapping of the ELM model to obtain the fine-tuned concentration value after nonlinear residual compensation of the ELM model; Step 4: Limiting process step, the fine-tuned concentration value is subjected to logical limiting and zero-point truncation processing, and the final calibrated concentration after logical limiting and zero-point truncation processing is output.

2. The electrochemical sensor calibration method based on two-stage decoupling and limit learning according to claim 1, characterized in that, The joint filtering process in step one employs a wavelet-Kalman cascaded filtering architecture, specifically including: first, using the db8 wavelet basis to perform a 5-level multi-scale decomposition of the original signal; then, using a soft thresholding function to remove instantaneous high-frequency spike noise to obtain the wavelet-filtered signal. Subsequently, the wavelet-reconstructed signal is input into a Kalman recursive filter, and time-domain smoothing is achieved through prediction and correction stages to obtain the jointly filtered signal. 。 3. The electrochemical sensor calibration method based on two-stage decoupling and limit learning according to claim 1 or 2, characterized in that, In step two, a gas cross-interference coefficient matrix is ​​constructed. The methods include: obtaining the linear interference coefficients between gases through experimental calibration based on an electrochemical sensor response model, and utilizing inverse matrix operations. Solve for the preliminary concentration prediction value.

4. The electrochemical sensor calibration method based on two-stage decoupling and limit learning according to claim 1, characterized in that, The extreme learning machine model in step three adopts a single hidden layer structure, and its output weights are obtained by solving the hidden layer output matrix. The Moore-Penrose generalized inverse matrix is ​​obtained in one step, i.e. ,in, For the target concentration matrix, Hidden layer output matrix The Moore-Penrose generalized inverse is used, and the model uses the Sigmoid function as the activation function.

5. The electrochemical sensor calibration method based on two-stage decoupling and limit learning according to claim 4, characterized in that, Before entering the Extreme Learning Machine model, the input data is linearly normalized and mapped to the interval [0.2, 0.8] to avoid the saturation region of the Sigmoid activation function.

6. The electrochemical sensor calibration method based on two-stage decoupling and limit learning according to claim 1, characterized in that, The limiting process in step four includes: truncating the output concentration to zero and assigning zero to negative values; and protecting the upper limit of each sensor's range by truncating the concentration to the upper limit value when it exceeds a preset threshold.

7. An electrochemical sensor calibration system based on two-stage decoupling and limit learning, used to implement the method according to any one of claims 1 to 6, characterized in that, The system includes: a preprocessing module for receiving the raw signals from the electrochemical sensor array and performing wavelet-Kalman joint filtering on the raw signals to eliminate fast-jump noise and circuit noise in the electrochemical reaction; and a linear decoupling module connected to the preprocessing module for performing decoupling based on the gas cross-interference coefficient matrix. The signal processed by the preprocessing module is subjected to a linear inverse matrix operation to output a preliminary concentration prediction value after linear decoupling. The nonlinear fine-tuning module, connected to the linear decoupling module, includes an extreme learning machine processing unit for processing the preliminary concentration prediction values. The input is fed into the Extreme Learning Machine model, and the residual output by the linear decoupling module is compensated by the nonlinear mapping of the model to obtain the fine-tuned concentration value after nonlinear residual compensation; the limiting output module is connected to the nonlinear fine-tuning module and is used to perform logical limiting and zero-point truncation processing on the fine-tuned concentration value processed by the nonlinear fine-tuning module, and output the final calibrated concentration.

8. The electrochemical sensor calibration system based on two-stage decoupling and limit learning according to claim 7, characterized in that, The preprocessing module includes: a wavelet filtering unit configured to perform 5-level multi-scale decomposition and soft thresholding denoising using the db8 wavelet basis; and a Kalman filtering unit configured to perform recursive filtering to achieve temporal smoothing.

9. The electrochemical sensor calibration system based on two-stage decoupling and limit learning according to claim 7, characterized in that, The extreme learning machine processing unit of the nonlinear fine-tuning module is deployed on edge computing hardware, including an STM32 series microcontroller. This unit outputs weights in one go through generalized inverse matrix operations, without the need for iterative training.

10. The electrochemical sensor calibration system based on two-stage decoupling and limit learning according to claim 7, characterized in that, The system also includes a data normalization unit, which is used to linearly map the input data to the interval [0.2, 0.8] to adapt to the characteristics of the activation function; the data normalization unit is located between the output of the linear decoupling module and the input of the nonlinear fine-tuning module.