Temperature compensation method based on CPSOBPNN infrared ETO gas sensor

Through the improved particle swarm optimization algorithm based on BP neural network, the problem of low measurement accuracy of infrared ETO gas sensors when temperature changes is not high, and high-precision temperature compensation is achieved, with a relative error of less than 2%, which exceeds the industry standard and reduces the The effect of external temperature on sensor output.

CN118980660APending Publication Date: 2024-11-19GUILIN UNIV OF ELECTRONIC TECH

Patent Information

Application Number
CN202411192898.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-11-19

AI Technical Summary

Technical Problem

The existing infrared ETO gas sensors have low measurement accuracy when temperature changes, and the commonly used temperature compensation algorithms are complex and easy to fall into local optimal solutions, making it difficult to effectively reduce the impact of external temperature on sensor output.

Method used

Using an improved particle swarm optimization algorithm based on BP neural network, the weights and thresholds of the BPNN model are constructed, normalized processing and optimized, and iterative optimization is used to achieve high-precision temperature compensation by using the Logistic chaotic adaptive method and PSO algorithm. .

Benefits of technology

In the temperature range of 25℃-65℃ and the concentration range of 0-927mg/L, the relative error is less than 2%, exceeding the industry standard accuracy of 5%, significantly reducing the impact of external temperature on sensor output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118980660A_ABST
    Figure CN118980660A_ABST
Patent Text Reader

Abstract

A CPSOBPNN-based temperature compensation method for a non-dispersive infrared ETO gas sensor comprises the following steps: acquiring three rows of signal values of a measurement channel voltage value, a reference channel voltage value and a temperature sensor voltage value of the ETO infrared gas sensor as the input of a BPNN, and taking the standard concentration of the ETO infrared gas sensor as the output of a neural network; and optimizing the weight and the threshold value of the BPNN by adopting a chaos particle swarm optimization algorithm, training the model to obtain a temperature compensation model, and inputting the prediction set data into the temperature compensation model to determine the ETO gas concentration value of the current stage. The precision of the ETO infrared gas sensor is remarkably improved, the relative error of the ETO infrared gas sensor within the measurement range of 0-927 mg / L is smaller than 2% and exceeds the relative error of 5% of the current industrial standard, and the influence of external temperature or other factors on the output of the sensor is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an infrared gas sensor, and in particular to a temperature compensation method of an infrared ETO gas sensor based on an improved particle swarm optimization algorithm. Background Art

[0002] Ethylene oxide (ETO) is the main sterilizing agent widely used in the medical device industry. It is a colorless gas that is flammable and explosive at room temperature and has strong penetrating and sterilizing capabilities. When patients are exposed to ETO gas on medical devices and equipment during treatment, they may develop infections. Excessive exposure to ETO gas may cause irritation, such as skin, eye, gastrointestinal or respiratory tract irritation, and even have an inhibitory effect on the central nervous system. All countries have formulated strict regulations on the use and waste gas treatment of ethylene oxide. Therefore, it is crucial to develop a sensor specifically for detecting ETO gas with temperature compensation function. In order to reduce the impact of temperature on sensor performance, a common method is to perform temperature compensation to improve the stability and accuracy of the sensor. At present, there are two main methods for temperature compensation: hardware and software. Hardware compensation requires a series of complex circuits and components, which is costly, has poor reliability, and is not easy to maintain. Software compensation can obtain high-precision and reliable compensation results through precise algorithms and calculations, and is widely used. The invention patent with publication number CN114076743A discloses a temperature compensation method for NDIR gas sensors, which performs polynomial fitting on the light intensity compensation coefficient and resistivity corresponding to the standard gas at each range point, thereby obtaining a compensation curve. The invention patent with publication number CN107907250A discloses a temperature compensation method and device for silicon-sapphire pressure sensors, and designs a compensation algorithm combining least squares linear fitting and parabolic interpolation in combination with the temperature drift characteristics of silicon-sapphire pressure sensors. The pressure-temperature relationship curve obtained by the algorithm is more in line with the actual pressure-temperature variation law. The invention patent with publication number CN105807340A discloses a temperature compensation method for marine temperature and humidity sensors, which uses the temperature-specific curve of the amplifier circuit, combined with the conversion coefficient, and adopts the multivariate regression analysis method, and uses the least squares method to fit and analyze the selected equation. These algorithms may have abnormal values ​​in the calculation process, which may have a greater impact on the regression linear fitting. At the same time, the least squares method may require variable conversion in the processing of nonlinear relationships, which is a relatively complicated process. Therefore, there is an urgent need for an algorithm with a simple calculation process, suitable for nonlinear calculations, and a small number of iterations to perform temperature compensation on the sensor. Summary of the invention

[0003] The technical problem solved by the present invention is to provide an infrared ETO gas sensor temperature compensation method based on a BP neural network improved particle swarm optimization algorithm. After temperature compensation, the concentration measurement result of the ETO gas sensor shows that the measurement accuracy is less than 2%.

[0004] In order to solve the above technical problems, the technical solution of the present invention is:

[0005] A temperature compensation method for infrared ETO gas sensor based on improved particle swarm optimization algorithm of BP neural network is established, which mainly includes: constructing a data set; conducting ventilation experiment of ETO gas sensor to obtain experimental data, each set of data includes measurement channel voltage value (Sig), reference channel voltage value (Ref) and voltage value (Temp) collected by temperature sensor; normalizing the obtained data set; constructing BPNN algorithm model, adding chaos mapping optimization particle swarm optimization algorithm when optimizing BPNN weight and threshold; using the obtained data set to train the above CPSO_BPNN neural network model, so as to obtain predicted concentration value. The method proposed in the present invention has a relative error of less than 2% in the measurement of temperature range of 25℃-65℃ and range of 0-927mg / L, which has exceeded the current industry standard of 5% relative error, and effectively reduces the influence of external temperature or other factors on sensor output.

[0006] The technical solution adopted by the present invention is carried out according to the following steps:

[0007] Step 1: Dataset collection and processing:

[0008] The present invention collects measurement channel voltage values, reference channel voltage values ​​and temperature sensor voltage values ​​of an ETO gas sensor under different temperatures and different concentration conditions as sample data; standardizes the sample data; and then divides the sample data into a training set and a prediction set for predicting the concentration value of the ETO gas.

[0009] Step 2: Construct BP neural network:

[0010] Determine the expression of the BP neural network and the number of nodes in the input layer, hidden layer and output layer.

[0011] Step 3: Use the improved particle swarm optimization algorithm to optimize the weights and thresholds of the BP neural network:

[0012] (1) Initialize the particle population;

[0013] (2) Calculate and update the position and velocity of each optimal particle and the global optimal particle;

[0014] (3) Using the Logistic chaos adaptive method to initialize w, the weight w has a certain degree of randomness, so as to better explore the search space;

[0015] (4) Adjust the learning factors C1 and C2 to obtain the diversity of particles in the early stage of the search to obtain better and higher quality particles;

[0016] (5) Compare the best fitness value of each particle with the global best fitness value;

[0017] (6) Calculate the velocity and position of the particle;

[0018] (7) Determine whether the maximum number of iterations has been reached or the error parameter is less than the set error value;

[0019] (8) Using the improved PSO algorithm, the optimal weights and thresholds are assigned to the BP neural network for training and learning.

[0020] The present invention obtains 80 sets of data through experiments, including a data set composed of normalized measurement channel signal values, reference signal values ​​and temperature signal values ​​of the sensor; the data set is divided into a prediction set and a training set; the three columns of collected signal values ​​are normalized and input into a BP neural network; the weights and thresholds of the BP neural network are optimized by an improved particle swarm optimization algorithm, and finally the predicted concentration value of the ETO gas is obtained.

[0021] Compared with the prior art, the present invention has the following advantages:

[0022] The present invention provides a temperature compensation method for an infrared ETO gas sensor based on a BPNN improved particle swarm optimization algorithm. The method has high prediction accuracy and high self-learning ability, can effectively eliminate local optimal solutions, and has a relative error of less than 2% in measurements in a temperature range of 25°C-65°C and a concentration range of 0-927mg / L, which has exceeded the current industry standard of 5% relative error, and effectively reduces the influence of external temperature or other factors on sensor output. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 Schematic diagram of temperature compensation model of improved particle swarm optimization algorithm based on BP neural network;

[0024] Figure 2 CPSO_BPNN neural network model flow chart;

[0025] Figure 3 Comparison chart of BPNN, PSO_BPNN and CPSO_BPNN model errors;

[0026] Figure 4 Schematic diagram of ETO concentration prediction results of the BPNN, PSO_BPNN and CPSO_BPNN model prediction sets. DETAILED DESCRIPTION

[0027] The technical solution of the present invention is clearly and completely described below in conjunction with the accompanying drawings:

[0028] Figure 1 This is a schematic diagram of the temperature compensation model of the ETO gas sensor, which mainly includes the following steps:

[0029] The three columns of signal values ​​of the ETO gas sensor are obtained, including the measurement channel voltage value, the reference channel voltage value and the temperature sensor voltage value, and the three columns of values ​​are input into the ETO gas concentration detection model to determine the ETO gas concentration value. Among them, the three columns of signal values ​​are obtained based on the commercial infrared ETO gas sensor.

[0030] To facilitate those skilled in the art to implement the present invention, an example step is now provided, and the steps are as follows:

[0031] Step 1: Data acquisition and processing. Place the ETO gas sensor in the incubator, set the target temperature manually or in the calibration system, and adjust the incubator temperature for about 1 hour before the temperature remains constant. Then, the gas flow experiment can be performed.

[0032] Set the relative pressure in the incubator according to the concentration point to be calibrated. For example, if you need to calibrate 88mg / L ETO gas at 25℃, you need to set the relative pressure in the incubator to 4.9Kpa. After about 10 minutes, the gas concentration is stable and the measurement operation should be completed. When the gas concentration is stable, observe the voltage value of the measurement channel, the voltage value of the reference channel, and the voltage value of the temperature sensor. When these three columns of values ​​remain unchanged, record the three columns of values ​​of the sensor corresponding to all concentration values.

[0033] Table 1 Experimental data

[0034]

[0035] The obtained data table is shown in Table 1, which shows the measurement channel voltage value / reference channel voltage value of the ETO gas sensor sample collected under different temperatures and different concentration conditions.

[0036] Next, the data is processed and divided into 80 groups of training samples and 20 groups of prediction samples. The prediction samples select different temperatures and concentrations to ensure that every temperature and concentration point can be predicted.

[0037] Then use the normalization formula to normalize the data obtained from the experiment. The formula is as follows:

[0038]

[0039] In the above formula, X max is the maximum value in the sample data sequence, X minis the minimum value in the sample data sequence.

[0040] Figure 2 It is the flow chart of CPSO_BPNN algorithm, which mainly includes the following steps.

[0041] Step 2: Construct BP neural network

[0042] Determine the BP neural network model, use the signal value of the ETO measurement channel, the signal value of the reference channel, and the temperature signal value as the input layer of the BPNN, set the number of hidden layer nodes to 5, use the sigmoid function as the transfer function of the hidden layer, and input the ETO gas concentration value. The number of training times is set to 1000, the learning rate is 0.01, and the error is set to 10 -6 .

[0043] Step 3: Use the improved particle swarm optimization algorithm to optimize the weights and thresholds of the BP neural network

[0044] (1) Initialize the particle population. The number of particles is N and the initial velocity of the particles is V. ij and position x ij And the maximum number of iterations T. Record the fitness value P of a single particle, and record the most suitable fitness value g of particle swarm optimization in each iteration; the number of particles is 30, the number of population iterations is 50, the particle velocity range is [-1, 1], and the particle position range is [-5, 5]. The minimum mean square error is the fitness function of particle swarm optimization.

[0045]

[0046] f g =min(f1,f2,f 31 ,......,f j ......f s ) (3)

[0047] n is the size of the sample, y i and are the actual output value and predicted value of the particle respectively, min is the minimum function, and the lower the fitness value, the better the corresponding PSO algorithm performance.

[0048] (2) Calculate and update the position and velocity of each optimal particle and the global optimal particle. The update formula is as follows.

[0049]

[0050] Where t represents the current iteration number, and is the j-dimensional component velocity of particle i at iterations t+1 and t, and is the j-dimensional component of particle i at iterations t+1 and t, is the global extremum of all particles in the j-dimensional component, c1 and c2 are non-negative learning factors, r1 and r2 are random numbers in [0, 1], and w is the inertia weight coefficient.

[0051] (3) Use the Logistic chaos adaptive method to initialize w, so that the weight w has a certain degree of randomness, so as to better explore the search space. The formula of the Logistic chaos adaptive method is as follows:

[0052] x i+1 =ax i (1-x i ) (6)

[0053] The range of the chaotic map is (0, 1), w n =x n+1 .

[0054] (4) For the traditional PSO algorithm. In the later stage of the search, the particles lack diversity and tend to converge to the local extreme value prematurely. By adjusting the learning factors C1 and C2, the diversity of particles can be obtained in the early stage of the search to obtain better and higher quality particles. By analyzing the impact of the change of the learning factor, the learning factor is updated asynchronously as follows:

[0055]

[0056] (5) Compare the best fitness value P of each particle with the global best fitness value g. If the individual fitness value is better than the global best fitness value, g needs to be reset. best , otherwise g best Remain unchanged.

[0057] (6) Calculate the velocity and position of the particle according to formulas (4), (5), (6), (7) and (8).

[0058] (7) Determine whether the maximum number of iterations has been reached or the error parameter is less than the set error value. If the conditions are met, the optimal solution is obtained, otherwise return to step 2.

[0059] (8) Using the improved PSO algorithm, the optimal weights and thresholds are assigned to BPNN for training and learning.

[0060] This paper selects several error metrics and fits to prove the superiority of the CPSO BPNN algorithm model, including the correlation coefficient (R 2 ), mean square error (RMSE) and mean absolute error (MAE), the formulas are as follows. The specific results are shown in Table 2.

[0061]

[0062]

[0063] Among them: yi is the true concentration value, yi′ is the predicted concentration value, is the average concentration value, and the results are shown in Table 2:

[0064] Table 2 Performance index calculation results

[0065]

[0066] From the performance indicators in the above table, it can be seen that the CPSO BPNN neural network prediction model in this example has better performance than other models. The CPSO BPNN proposed in this invention is compared with the PSO BPNN and BPNN neural network algorithms. Figure 3 This is a comparison chart of the prediction model errors of BPNN, PSO BPNN and CPSO BPNN neural networks. Figure 4 The figure is a comparison diagram of the ETO concentration of the CPSO BPNN prediction set and the standard concentration of ethylene oxide. The results show that the compensation results of the CPSO BPNN neural network are better than those of other algorithms, and it avoids falling into the local optimal solution compared to the PSO BPNN neural network algorithm.

Claims

1. A temperature compensation method for an infrared ETO gas sensor based on a CPSO_BPNN neural network, characterized in that: include: Step 1: Collect three columns of signal values ​​of the ETO gas sensor, including the measurement channel voltage value, the reference channel voltage value and the temperature sensor voltage value; Normalize the three columns of signal values ​​collected; set the relative pressure in the temperature box according to the concentration point that needs to be calibrated; Step 2: The three columns of signal values ​​collected are input into the BP neural network as the sample set, and the concentration of the sample standard gas is used as the output target. The weight and threshold of the BP neural network are optimized by using the improved particle swarm optimization algorithm to obtain the temperature compensation model. The BP neural network has 3 nodes as the input layer, 5 nodes as the hidden layer, and 1 node as the output layer.

2. The temperature compensation method according to claim 1, characterized in that: The specific steps of improving the particle swarm optimization algorithm include: (1) Initialize the particle population; use the Logistic chaos adaptive method to initialize w, adjust the learning factors C1 and C2, and obtain the diversity of particles in the early stage of the search; (2) Compare the best fitness value of each particle with the global best fitness value; (3) Calculate the velocity and position of the particle; (4) Determine whether the maximum number of iterations has been reached or the error parameter is less than the set error value; (5) Using the improved PSO algorithm, the optimal weights and thresholds are assigned to the BP neural network for training and learning; The superiority of the CPSO_BPNN algorithm model is proved by calculating the correlation coefficient, mean square error, relative error, etc. The CPSO_BPNN model is used to update the position of the particles, and the updated fitness value is compared with the optimal fitness. The global optimal solution is selected when the maximum number of iterations or the preset convergence accuracy is reached, and the optimal solution is assigned to the weights and thresholds of the BP neural network. The error back propagation is used to fine-tune the parameters to end the training when the maximum number of iterations or the preset convergence accuracy is reached.

3. The temperature compensation method according to claim 1, characterized in that: Steps one and two involve data collection and the establishment of a temperature compensation model. Step one involves collecting the measurement channel voltage value, reference channel voltage value, and temperature sensor voltage value of the ETO gas sensor under different concentrations and temperatures as sample data; then dividing the sample data into a training set and a prediction set; training the standardized sample data according to the CPSO_BPNN neural network model; and then obtaining the ETO gas concentration detection model.

Citation Information

Patent Citations

  • Temperature compensating method of marine temperature-humidity sensors

    CN105807340A

  • Temperature compensation method and device of silicon-sapphire pressure sensor

    CN107907250A

  • Temperature compensation method and system based on NDIR gas sensor and computer readable storage medium

    CN114076743A

Cited By

  • Gas detection alarm method

    CN120629055A

  • Laser oxygen partial pressure sensor temperature and pressure compensation method based on PSO-BP neural network

    CN120869433A

  • Gas sensor gas pressure compensation method based on PSO-BP-GRU algorithm

    CN121275661A