Poultry house gas pollutant sensor temperature and humidity compensation method

By constructing the temperature and humidity compensation model based on Stacking integrated learning and the improved beetle optimization algorithm, the problem of decreased accuracy of traditional MOS gas sensors in the humid environment, and realized the precise temperature and humidity compensation of the poultry vitamin sensor sensor. , Improve the detection accuracy and system stability.

CN119355208AInactive Publication Date: 2025-01-24HEBEI AGRICULTURAL UNIV.
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202411456724.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-01-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In humid environments, traditional MOS gas sensors have reduced resistance and weakened gas sensitivity reactions, resulting in deviations in measurement results and affecting the effectiveness of poultry house environmental management.

Method used

Adopt a poultry house gas pollutant sensor temperature and humidity compensation method. By building experimental platforms, data acquisition, data pre -processing, constructing temperature and humidity compensation models, and optimization algorithms, build a temperature and humidity compensation model based on Stacking integrated learning, and optimize algorithm improvement 蜣 Ears optimize algorithms to improve the optimization accuracy and stability of the model.

Benefits of technology

Effectively eliminates the interference of the measurement results of temperature and humidity, improves the accuracy of the concentration of gas pollutants, ensures that the sensor provides accurate gas pollution measurement values ​​at different temperature and humidity conditions, and enhances the reliability and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119355208A_ABST
    Figure CN119355208A_ABST
Patent Text Reader

Abstract

The invention provides a poultry house gas pollutant sensor temperature and humidity compensation method, and belongs to the technical field of temperature and humidity control, and the method comprises the following steps: 1, preparing; building an experiment platform, wirelessly transmitting data acquired by a sensor to a coordinator, and communicating with a cloud platform by adopting a wireless transceiver module to obtain real-time data; step 2, data acquisition; introducing high-purity nitrogen to carry out zero calibration on the sensor, and preparing standard CO2 gases with different concentrations through a dynamic gas distributor; opening the constant-temperature and constant-humidity experiment box, setting temperature and humidity values, and testing to obtain multiple groups of data; 3, data preprocessing; carrying out Min-Max normalization processing on the obtained data; 4, constructing a temperature and humidity compensation model; 5, optimizing an algorithm; step 6, evaluating the model; through real-time monitoring and compensation adjustment of sensor data, interference of temperature and humidity changes on a measurement result is eliminated, and the precision of gas pollutant concentration detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of temperature and humidity control, and more specifically, particularly relates to a temperature and humidity compensation method for a gas pollutant sensor in a poultry house. Background Art

[0002] As people's living standards continue to improve, the requirements for poultry breeding environment are getting higher and higher; a good breeding environment can not only ensure the healthy growth of poultry, but also improve product quality, and ultimately benefit consumers. In order to ensure that poultry can grow in a good environment, monitoring the content of gas pollutants in the poultry house is the key to achieving high-quality breeding. As a tool for monitoring the environment of the poultry house, the measurement accuracy of the gas pollutant sensor directly affects the accuracy of environmental management decisions.

[0003] However, the environmental conditions in poultry houses are complex and changeable, and changes in temperature and humidity will have a significant impact on the measurement accuracy of gas pollutant sensors. For common MOS gas sensors, in a humid environment, water vapor will adsorb on the surface of the sensor, causing the sensor's resistance to be significantly lower than that under dry conditions. In addition, as the water vapor density increases, the sensor's gas-sensitive response will gradually weaken. This phenomenon will cause the sensor's measurement results of gas pollutants to deviate, which may lead to misjudgment in actual applications and affect the effectiveness of poultry house environmental management. Therefore, it is particularly important to perform temperature and humidity compensation on gas pollutant sensors. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a temperature and humidity compensation method for a poultry house gas pollutant sensor to solve the technical problem in the prior art that the resistance of a traditional MOS gas sensor in a humid environment is significantly lower than that in a dry condition, and as the water vapor density increases, the gas sensitive response of the sensor will gradually weaken, resulting in deviations in the measurement results, thereby affecting the effectiveness of poultry house environmental management.

[0005] The purpose and efficacy of the temperature and humidity compensation method for a poultry house gas pollutant sensor of the present invention are achieved by the following specific technical means:

[0006] A poultry house gas pollutant sensor temperature and humidity compensation method comprises the following steps:

[0007] Step 1: Preparation;

[0008] Build an experimental platform, which mainly includes nitrogen standard gas cylinders, carbon dioxide standard gas cylinders, pressure reducing valves, air guide tubes, dynamic gas distributors, constant temperature and humidity chambers, and wireless gas detection systems; at the same time, the data acquisition end uses ZigBee node self-organizing networks to form a wireless sensor network, wirelessly transmits the data collected by the sensors to the coordinator, and uses wireless transceiver modules to communicate with the cloud platform to obtain real-time data;

[0009] Step 2: Data acquisition;

[0010] Introduce high-purity nitrogen to calibrate the sensor to zero point. 2 Gas and high-purity nitrogen are introduced into the dynamic gas distributor to prepare multiple portions of standard CO with different concentrations. 2 gas; open the constant temperature and humidity test box, set the temperature and humidity values; test in the order of concentration, humidity, and temperature, and start to introduce CO after the temperature and humidity inside the test box are stable. 2 Gas, record data and conduct multiple sets of experiments to obtain multiple sets of data;

[0011] Step 3: Data preprocessing;

[0012] The acquired data is normalized using Min-Max processing to map the data output interval to [0,1] so that the measured values ​​of each sensor are in the same order of magnitude;

[0013] Step 4: Construct temperature and humidity compensation model;

[0014] The three machine learning models of SVR, ELM and XGBoost are used as base learners to perform temperature and humidity compensation on sensor data. Kernel ridge regression is used as a meta-learner to build a temperature and humidity compensation model of Stacking ensemble learning.

[0015] Step 5: Optimize the algorithm;

[0016] The dung beetle optimization algorithm improved by multi-fusion strategy is used to optimize the hyperparameters of SVR, ELM and XGBoost models; including the use of Circle chaos mapping to complete population initialization, the introduction of adaptive inertia weight and Gaussian Cauchy mutation strategy;

[0017] Step 6: Model evaluation;

[0018] The mean absolute error (MAE) and root mean square error (RMSE) are used to evaluate the compensation effect of each temperature and humidity compensation model. The collected carbon dioxide sensor measurement data samples are statistically analyzed to compare the average relative errors of the sensor and each temperature and humidity compensation model data before and after optimization.

[0019] In a preferred embodiment, in step 2, the multiple portions of standard CO2 gas with different concentrations are: 500 ppm, 700 ppm, 900 ppm, 1200 ppm, and 1500 ppm standard CO2 gas.

[0020] In a preferred embodiment, the set temperature and humidity values ​​include a temperature control range of 15°C to 30°C, with the temperature increasing at intervals of 5°C, and a total of 4 measuring points; a humidity control range of 50%RH to 90%RH, with the temperature increasing at intervals of 10%RH, and a total of 5 test points.

[0021] In a preferred embodiment, in step three, the calculation formula for the normalization process is:

[0022]

[0023] In the formula, x φ Represents the normalized value, x min Indicates the minimum value of the same sensor response value, x max Indicates the maximum value of the response value of the same sensor.

[0024] In a preferred embodiment, in step 4, constructing a temperature and humidity compensation model of Stacking ensemble learning includes:

[0025] Divide the original sample data into training set P train and the test set P test , the ratio of the division is 5:1; during the training process, the training set is divided by the 5-fold cross validation method, and randomly divided into 5 equal-sized and non-intersecting subsets S1, S2, ..., S5; the SVR base learner model randomly selects 4 subsets for each base learner as the training set of the base model each time, and the remaining 1 is used as the validation set to test the model compensation performance and obtain a compensation result, recorded as A1. The process is repeated 5 times, and the final compensation result set is P train-a =[A 1 ,A 2 ,...,A 5 ], ELM and XGBoost models repeat the above steps to obtain the set P train-b and P train-c , the combination P' of the compensation results of each validation set of the three base learner models train Serves as the training set for the second-layer model meta-learner.

[0026] In a preferred embodiment, during the test, the compensation values ​​B corresponding to the original test set are obtained after 5 trainings using n trained base learners. n1 ,B n2,...,B n2 (n=1,2,3), take the average of the test set compensation results to form a new test set Use the metamodel training set P' train = {P teain ,P teain-a ,P teain-b ,P teain-c} Train the metamodel and then use the metamodel test set P' test = {P test ,C 1 ,C 2 ,C 3}Test and obtain the final compensation result.

[0027] In a preferred embodiment, in step 5, the initialization of the population using the Circle chaotic mapping includes: generating 2000 initial populations with a dimension of 2 using the Circle chaotic mapping method and the random distribution method; the formula of the Circle chaotic mapping is:

[0028]

[0029] In the formula, mod represents the remainder function, a represents the coefficient 0.2, and b represents the coefficient 0.5.

[0030] In a preferred embodiment, the introducing of the adaptive inertia weight includes introducing an adaptive weight factor to adjust and control the search step size, and the adaptive weight factor formula is:

[0031]

[0032] Where t represents the current number of iterations, and T represents the maximum number of iterations.

[0033] In a preferred embodiment, the formula of the Gaussian Cauchy mutation strategy is:

[0034]

[0035] In the formula, Indicates the position of the individual with the highest fitness value after disturbance, represents the position before the disturbance, Canchy(0,σ 2 ) represents a random variable that follows a Cauchy distribution, Caussian(0,σ 2 ) represents a random variable that follows a Gaussian distribution, σ 2 represents the standard deviation, and α and β represent adaptive adjustment dynamic parameters.

[0036] In a preferred embodiment, the calculation formula of the mean absolute error MAE is:

[0037]

[0038] The calculation formula of the root mean square error RMSE is:

[0039]

[0040] Wherein, i (i=1, 2, ..., m) represents the number of samples, yi represents the actual value measured by the sensor, ppm; ypred represents the compensation value.

[0041] Compared with the prior art, the present invention has the following beneficial effects:

[0042] 1. By real-time monitoring and compensation adjustment of sensor data, the interference of temperature and humidity changes on the measurement results is effectively eliminated, and the accuracy of gas pollutant concentration detection is improved; support vector regression SVR, extreme learning machine ELM and gradient boosting decision tree XGBoost are used to construct a temperature and humidity compensation model based on Stacking ensemble learning; the model comprehensively analyzes the temperature, humidity and gas concentration data of the sensor, and continuously adjusts the compensation parameters through the optimization algorithm, and finally realizes the effective correction of the sensor measurement value; this enables the sensor to provide accurate gas pollutant measurement values ​​under different temperature and humidity conditions, making up for the defect of reduced measurement accuracy of traditional MOS gas sensors in humid environments, ensuring the reliability and accuracy of gas concentration data, and helping farmers to understand the environmental conditions in a timely manner and take corresponding management measures to create good environmental conditions for the healthy growth of poultry.

[0043] 2. The dung beetle optimization algorithm was improved by introducing Circle chaos mapping, adaptive inertia weight and Gaussian Cauchy mutation strategy, which improved the algorithm's optimization accuracy and convergence speed. The improved IDBO was used to synchronously optimize the parameters of each base learner model to improve the optimization accuracy of a single model, and further improve the temperature and humidity compensation effect of the Stacking ensemble learning model; the output of the sensor in different temperature and humidity environments is more stable, reducing false alarms and misoperations caused by sensor output fluctuations, and enhancing the reliability and stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 The present invention is a flow chart of the steps of a temperature and humidity compensation method for a gas pollutant sensor in a poultry house.

[0045] Figure 2 The present invention is a principle block diagram of a system experimental platform in a temperature and humidity compensation method for a gas pollutant sensor in a poultry house.

[0046] Figure 3It is a flow chart for establishing a temperature and humidity compensation model of Stacking multi-model fusion in a temperature and humidity compensation method for a poultry house gas pollutant sensor of the present invention.

[0047] Figure 4 It is a population distribution diagram of different initialization methods in a temperature and humidity compensation method for a poultry house gas pollutant sensor of the present invention.

[0048] Figure 5 The invention discloses a self-adaptive weight factor variation curve in a temperature and humidity compensation method for a gas pollutant sensor in a poultry house.

[0049] Figure 6 The present invention discloses a flow chart of an improved dung beetle algorithm in a temperature and humidity compensation method for a gas pollutant sensor in a poultry house.

[0050] Figure 7 It is a temperature and humidity compensation result diagram based on the Stacking model in a temperature and humidity compensation method for a gas pollutant sensor in a poultry house of the present invention.

[0051] Figure 8 It is an evaluation index diagram of different Stacking algorithm models in a temperature and humidity compensation method for a poultry house gas pollutant sensor of the present invention. DETAILED DESCRIPTION

[0052] In order to further understand the present invention, preferred embodiments of the present invention are described below in conjunction with the accompanying drawings and examples. However, it should be understood that these descriptions are only for further illustrating the features and advantages of the present invention, rather than limiting the claims of the present invention.

[0053] Example:

[0054] Please refer to Figures 1 to 8 As shown, the present invention provides a temperature and humidity compensation method for a poultry house gas pollutant sensor, comprising the following steps:

[0055] Step 1: Preparation;

[0056] Build an experimental platform, which mainly includes 99.999% nitrogen standard gas cylinder, carbon dioxide standard gas cylinder, pressure reducing valve, gas guide tube, dynamic gas distributor, constant temperature and humidity chamber and wireless gas detection system; first, adjust the pressure of the pressure reducing valve to convert the gas in the bottle from liquid to gas, turn on the gas cylinder switch to allow the gas to enter the pipeline, set the gas output flow rate through the dynamic gas distributor, the gas detection system inlet pipe is connected to the dynamic gas distributor outlet, the outlet is connected to the detection system and the gas to be tested is discharged through the outlet pipe; the wireless gas detection system collects temperature and humidity by DHT11 sensor, CO2 sensor collects carbon dioxide concentration, the data collection end uses ZigBee node self-organizing network to form a wireless sensor network, the data collected by the sensor is wirelessly transmitted to the coordinator, and the ESP8266 wireless transceiver module is used to communicate with the cloud platform to obtain real-time data; the dynamic gas distributor can choose the MR-DF2 model of Beijing Minnet Environmental Protection Equipment Co., Ltd.; the CO2 sensor can choose the MH-Z19B model of Zhengzhou Weisheng Electronic Technology Co., Ltd.;

[0057] Step 2: Data acquisition;

[0058] In order to simulate the actual environmental temperature and humidity changes as much as possible, high-purity nitrogen was introduced to calibrate the sensor at the zero point, and then the standard CO2 gas and high-purity nitrogen were mixed in different proportions and introduced into the MR-DF2 dynamic gas distributor to prepare multiple portions of standard CO2 gas with different concentrations; the constant temperature and humidity test chamber was turned on and the temperature and humidity values ​​were set; the gas detection system was powered on for 20 minutes for preheating before the experiment, and all experiments were completed under standard atmospheric pressure. The experiments were carried out in the order of concentration, humidity, and temperature, that is, the temperature and humidity were fixed first, and then the concentration values ​​were changed in turn for testing; CO2 gas was introduced after the temperature and humidity inside the test chamber were stable, and data was recorded when the gas filled the test chamber stably. The gas detection system was connected to the cloud platform to obtain data, and each concentration of gas was measured for 5 minutes after the gas was evenly diffused. The test was repeated 3 times under each set of temperature, humidity and calibration gas concentration. A total of 100 sets of experiments were carried out and 3000 sets of data were collected; the specific temperature, humidity and concentration setting values ​​are shown in Table 1 below.

[0059] Table 1 Environment variable values

[0060]

[0061] In step 2, multiple portions of standard CO2 gas with different concentrations are: 500ppm, 700ppm, 900ppm, 1200ppm, 1500ppm standard CO2 gas; the temperature control range is 15℃~30℃, the temperature increases at intervals of 5℃, and there are 4 measuring points in total; the humidity control range is 50%RH~90%RH, the temperature increases at intervals of 10%RH, and there are 5 test points in total.

[0062] Step 3: Data preprocessing;

[0063] Since the dimensions of the temperature, humidity, and gas concentration data input to the model are inconsistent, in order to improve the model training effect and reduce the calculation error caused by the order of magnitude, it is necessary to perform Min-Max normalization on the sample data and map the data output interval to [0,1] so that the measurement values ​​of the three sensors are in the same order of magnitude;

[0064] Step 4: Construct temperature and humidity compensation model;

[0065] The three machine learning models of SVR, ELM and XGBoost are used as base learners to perform temperature and humidity compensation on sensor data. Kernel ridge regression is used as a meta-learner to build a temperature and humidity compensation model of Stacking ensemble learning. The Stacking ensemble learning model is an algorithm that can integrate multiple machine learning models. Ensemble learning trains multiple base learners with given raw data, and uses multi-model fusion methods to obtain a more powerful and robust model, thereby improving the prediction accuracy and generalization ability of the model. The base model is an important part of the ensemble learning framework. When selecting, the principle of "taking advantage of others' strengths and making up for others' weaknesses" is followed. Generally, base learning models that are independent of each other, highly accurate, and have differences in prediction methods are selected.

[0066] Step 5: Optimize the algorithm;

[0067] Although the traditional dung beetle optimization algorithm has the characteristics of strong optimization ability and fast convergence speed, it also has the disadvantages of imbalance between global exploration and local development ability, easy to fall into local optimum, and weak global exploration ability; In order to better play the optimization effect of the DBO algorithm, the Circle chaos map is used to complete the population initialization, so that the initial position distribution of the dung beetles is more uniform and the diversity of the population is improved; the adaptive inertia weight and Gaussian Cauchy mutation strategy are introduced to improve the optimization ability, enhance the global search ability of the algorithm, and improve the convergence speed and accuracy; In the process of model training, the dung beetle optimization algorithm improved by multi-fusion strategy is used to optimize the hyperparameters of the SVR, ELM and XGBoost models to improve the stability and generalization ability of the model, including the use of Circle chaos map to complete the population initialization, the introduction of adaptive inertia weight and Gaussian Cauchy mutation strategy;

[0068] Step 6: Model evaluation;

[0069] During the model construction process, in order to evaluate the model performance, the optimal temperature and humidity compensation model was determined; the mean absolute error (MAE) and root mean square error (RMSE) were used to evaluate the compensation effect of each temperature and humidity compensation model; MAE is a non-negative value, which converts the difference between the compensation value and the true value into an absolute value, and there is no positive or negative offset, which can better reflect the actual situation of the error between the compensation value and the true value; RMSE measures the degree of deviation between the compensation value and the true value through the square difference, which can make it easier to perceive the data.

[0070] In step 3, the calculation formula for normalization is:

[0071]

[0072] In the formula, x φ Represents the normalized value, x min Indicates the minimum value of the same sensor response value, x max Indicates the maximum value of the response value of the same sensor.

[0073] In step 4, the temperature and humidity compensation model of Stacking ensemble learning is constructed including;

[0074] The original sample data is divided into 80% as the training set P. train , the remaining 20% ​​is used as the test set P test , initialize all base learner models of the first layer model and the meta-model of the second layer model; during the training process, the 5-fold cross-validation method is used to divide the training set, randomly divided into 5 equal-sized and non-intersecting subsets S1, S2, ..., S5; taking the SVR base learner model as an example, for each base learner, 4 subsets are randomly selected as the training set of the base model each time, and the remaining 1 is used as the validation set to test the model compensation performance and obtain a compensation result, recorded as A1. The process is repeated 5 times, and the final compensation result set is P train-a =[A 1 ,A 2 ,...,A 5 ], ELM and XGBoost models repeat the above steps to obtain the set P train-b and P train-c , the combination P' of the compensation results of each validation set of the three base learner models train Serves as the training set for the second-layer model meta-learner.

[0075] During the test, the compensation values ​​B corresponding to the original test set are obtained by using n trained base learners after 5 trainings. n1 ,B n2 ,...,B n2 (n=1,2,3), take the average of the test set compensation results to form a new test set

[0076] Use the metamodel training set P' train = {P teain ,P teain-a ,P teain-b ,P teain-c} Train the metamodel and then use the metamodel test set P' test = {P test ,C 1 ,C 2 ,C 3}Test and obtain the final compensation result.

[0077] In step 5, the initialization of the population is completed by using the Circle chaos map, including: 2000 initial populations are generated by using the Circle chaos map method and the random distribution method, with a dimension of 2; the formula of the Circle chaos map is:

[0078]

[0079] In the formula, mod represents the remainder function, a represents the coefficient 0.2, and b represents the coefficient 0.5. After the Circle chaos mapping, the distribution of dung beetle individuals in the population is more uniform, the ergodicity is better, and the global search ability of the algorithm is improved.

[0080] Aiming at the problems of slow convergence speed and low optimization accuracy of the dung beetle optimization algorithm, an adaptive inertia weight is introduced to coordinate the global exploration ability and local development ability, and a weight factor is introduced to adjust and control the search step. The adaptive weight factor has a larger weight value in the early stage of iteration, which can better perform global search, and a smaller weight value in the later stage of iteration, which is conducive to local space search; the formula of the adaptive weight factor is:

[0081]

[0082] Where t represents the current number of iterations, and T represents the maximum number of iterations.

[0083] Gaussian mutation and Cauchy mutation can improve the optimization performance of the algorithm. Gaussian mutation has strong local development ability, and Cauchy mutation has strong disturbance ability. In order to avoid the gradual reduction of the search space, a mutation strategy combining Gaussian and Cauchy is introduced to enable the algorithm to jump out of the local optimal solution and move towards the global optimal solution. The formula of the Gaussian and Cauchy mutation strategy is:

[0084]

[0085] In the formula, Indicates the position of the individual with the highest fitness value after disturbance, represents the position before the disturbance, Canchy(0,σ2 ) represents a random variable that follows a Cauchy distribution, Caussian(0,σ 2 ) represents a random variable that follows a Gaussian distribution, σ 2 represents the standard deviation, and α and β represent adaptive adjustment dynamic parameters.

[0086] The calculation formula for the mean absolute error MAE is:

[0087]

[0088] The calculation formula of root mean square error RMSE is:

[0089]

[0090] Wherein, i (i=1, 2, ..., m) represents the number of samples, yi represents the actual value measured by the sensor, ppm; ypred represents the compensation value.

[0091] Performance comparison of temperature and humidity compensation models based on a single algorithm;

[0092] The sample data is randomly divided, of which 2400 groups are selected as training sets and 600 groups are selected as test sets. This paper uses three standard models SVR, ELM and XGBoost to compensate for the temperature and humidity of infrared CO2 sensors. The multi-strategy improved dung beetle optimization algorithm is used to obtain the optimal hyperparameter combination of SVR penalty factor c and kernel parameter g, ELM hidden layer neuron number m, XGBoost weak learner number n, maximum depth h and learning rate r, and the two evaluation indicators in Section 2.3 above are used to evaluate the model. The optimization parameters and results are shown in Table 2 below;

[0093] Table 2 Comparison of processing results of temperature and humidity compensation models of each single algorithm

[0094]

[0095] The IDBO-ELM model has the best performance, with an RMSE of 1.06 and a MAE of 1.15 on the test set, followed by IDBO-XGBoost and IDBO-SVR, with RMSE of 1.15 and 1.18, and MAE of 2.67 and 2.28, respectively. The PSO-SVR model test set evaluation index MAE of 1.48 and RMSE of 2.87 using the particle swarm algorithm for hyperparameter optimization; the SSA-ELM model test set evaluation index MAE of 1.20 and RMSE of 1.57 using the sparrow search algorithm for hyperparameter optimization; the WOA-XGBoost model test set evaluation index MAE of 1.15 and RMSE of 1.96 using the whale optimization algorithm for hyperparameter optimization. Based on various indicators, it can be concluded that the SVR, ELM and XGBoost machine learning models optimized by the IDBO algorithm with multi-strategy fusion all show a high level of accuracy in the temperature and humidity compensation results of the CO2 sensor.

[0096] Performance comparison of temperature and humidity compensation models based on Stacking algorithm;

[0097] In order to verify the temperature and humidity compensation effect of the IDBO-Stacking ensemble learning agent model, the training set samples were trained using the Stacking model optimized by IDBO, the Stacking ensemble learning model optimized by DBO, and the Stacking ensemble learning model constructed by SVR, ELM and XGboost base learners. After the training was completed, the network was saved and tested with the test set samples. In order to clearly display the temperature and humidity compensation results of different models in the figure, 40 test sample data were randomly selected for drawing. The temperature and humidity compensation results are shown in the figure. Figure 6 The results show that the data processed by the Stacking model is closer to the true value than the sensor measurement result, and the data processed by the IDBO-Stacking model is closer to the true value than the data processed by the Stacking model.

[0098] The evaluation indicators of IDBO-Stacking model, DBO-Stacking model and Stacking model are as follows Figure 7As shown. The MAE and RMSE of the IDBO-Stacking model test set are 0.15ppm and 0.17ppm respectively, the MAE and RMSE of the DBO-Stacking model test set are 0.41ppm and 0.67ppm respectively, and the MAE and RMSE of the Stacking model test set are 0.81ppm and 1.13ppm respectively; the IDBO-Stacking model has obvious advantages in the accuracy of compensated data. After fusing various machine learning models based on the Stacking integration method, the model accuracy is further improved, the robustness is good, and it can realize the effective correction of temperature and humidity compensation of sensor data.

[0099] The CO2 sensor measurement data samples collected through statistical analysis were used to calculate the average measurement accuracy of the CO2 sensor and each temperature and humidity compensation model after data optimization. The results are shown in Table 3 below.

[0100] Table 3 Comparison of sensor and temperature and humidity compensation model data before and after optimization

[0101]

[0102] The average relative error of the carbon dioxide sensor after optimization by the IDBO-Stacking integrated learning model is 0.02%. The optimization effect is good, which improves the accuracy of gas data and improves the problem that non-infrared carbon dioxide sensors are easily affected by environmental temperature and humidity.

[0103] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A temperature and humidity compensation method for a gas pollutant sensor in a poultry house, characterized in that: The following steps are included: Step 1: Preparation; Build an experimental platform, which mainly includes nitrogen standard gas cylinders, carbon dioxide standard gas cylinders, pressure reducing valves, air guide tubes, dynamic gas distributors, constant temperature and humidity chambers, and wireless gas detection systems; at the same time, the data acquisition end uses ZigBee node self-organizing networks to form a wireless sensor network, wirelessly transmits the data collected by the sensors to the coordinator, and uses wireless transceiver modules to communicate with the cloud platform to obtain real-time data; Step 2: Data acquisition; Introduce high-purity nitrogen to calibrate the sensor at zero point, introduce standard CO2 gas and high-purity nitrogen into the dynamic gas distributor, and prepare multiple portions of standard CO2 gas with different concentrations; open the constant temperature and humidity test chamber, and set the temperature and humidity values; conduct tests in the order of concentration, humidity, and temperature, and start introducing CO2 gas after the temperature and humidity inside the test chamber are stable, record the data, and conduct multiple groups of experiments to obtain multiple groups of data; Step 3: Data preprocessing; The acquired data is normalized using Min-Max processing to map the data output interval to [0,1] so that the measured values ​​of each sensor are in the same order of magnitude; Step 4: Construct temperature and humidity compensation model; The three machine learning models of SVR, ELM and XGBoost are used as base learners to perform temperature and humidity compensation on sensor data. Kernel ridge regression is used as a meta-learner to build a temperature and humidity compensation model of Stacking ensemble learning. Step 5: Optimize the algorithm; The dung beetle optimization algorithm improved by multi-fusion strategy is used to optimize the hyperparameters of SVR, ELM and XGBoost models; including the use of Circle chaos mapping to complete population initialization, the introduction of adaptive inertia weight and Gaussian Cauchy mutation strategy; Step 6: Model evaluation; The mean absolute error (MAE) and root mean square error (RMSE) are used to evaluate the compensation effect of each temperature and humidity compensation model. The collected carbon dioxide sensor measurement data samples are statistically analyzed to compare the average relative errors of the sensor and each temperature and humidity compensation model data before and after optimization.

2. A temperature and humidity compensation method for a poultry house gas pollutant sensor according to claim 1, characterized in that: In step 2, a plurality of standard CO2 gases with different concentrations are respectively: 500ppm, 700ppm, 900ppm, 1200ppm, and 1500ppm standard CO2 gases.

3. A temperature and humidity compensation method for a poultry house gas pollutant sensor according to claim 2, characterized in that: The setting of temperature and humidity values ​​includes: a temperature control range of 15°C to 30°C, with the temperature increasing at intervals of 5°C, with a total of 4 measuring points; a humidity control range of 50%RH to 90%RH, with the temperature increasing at intervals of 10%RH, with a total of 5 test points.

4. A temperature and humidity compensation method for a poultry house gas pollutant sensor according to claim 1, characterized in that: In step three, the calculation formula for the normalization process is: In the formula, x φ Represents the normalized value, x min Indicates the minimum value of the same sensor response value, x max Indicates the maximum value of the response value of the same sensor.

5. The temperature and humidity compensation method for a poultry house gas pollutant sensor according to claim 1, characterized in that: In step 4, the building of the temperature and humidity compensation model of Stacking ensemble learning includes: Divide the original sample data into training set P train and the test set P test , the ratio of the division is 5:1; during the training process, the training set is divided by the 5-fold cross validation method, and randomly divided into 5 equal-sized and non-intersecting subsets S1, S2, ..., S5; the SVR base learner model randomly selects 4 subsets for each base learner as the training set of the base model each time, and the remaining 1 is used as the validation set to test the model compensation performance and obtain a compensation result, recorded as A1. The process is repeated 5 times, and the final compensation result set is P train-a =[A1,A2,...,A5], ELM and XGBoost models repeat the above steps to obtain the set P train-b and P train-c , the combination P' of the compensation results of each validation set of the three base learner models train Serves as the training set for the second-layer model meta-learner.

6. A temperature and humidity compensation method for a poultry house gas pollutant sensor according to claim 5, characterized in that: During the test, the compensation values ​​B corresponding to the original test set are obtained by using n trained base learners after 5 trainings. n1 ,B n2 ,...,B n2 (n=1,2,3), take the average of the test set compensation results to form a new test set Use the metamodel training set P' train = {P teain ,P teain-a ,P teain-b ,P teain-c } Train the metamodel and then use the metamodel test set P' test = {P test ,C1,C2,C3} are tested to obtain the final compensation result.

7. A temperature and humidity compensation method for a poultry house gas pollutant sensor according to claim 1, characterized in that: In step 5, the initialization of the population using the Circle chaotic mapping includes: generating 2000 initial populations with a dimension of 2 using the Circle chaotic mapping method and the random distribution method; the formula of the Circle chaotic mapping is: In the formula, mod represents the remainder function, a represents the coefficient 0.2, and b represents the coefficient 0.

5.

8. A temperature and humidity compensation method for a poultry house gas pollutant sensor according to claim 7, characterized in that: The introduction of the adaptive inertia weight includes introducing an adaptive weight factor to adjust and control the search step length. The adaptive weight factor formula is: Where t represents the current number of iterations, and T represents the maximum number of iterations.

9. A temperature and humidity compensation method for a poultry house gas pollutant sensor according to claim 8, characterized in that: The formula of the Gaussian Cauchy mutation strategy is: In the formula, Indicates the position of the individual with the highest fitness value after disturbance, represents the position before the disturbance, Canchy(0,σ 2 ) represents a random variable that follows a Cauchy distribution, Caussian(0,σ 2 ) represents a random variable that follows a Gaussian distribution, σ 2 represents the standard deviation, and α and β represent adaptive adjustment dynamic parameters.

10. A temperature and humidity compensation method for a poultry house gas pollutant sensor according to claim 1, characterized in that: The calculation formula of the mean absolute error MAE is: The calculation formula of the root mean square error RMSE is: Wherein, i (i=1, 2, ..., m) represents the number of samples, yi represents the actual value measured by the sensor, ppm; ypred represents the compensation value.

Citation Information

Cited By

  • Temperature and humidity compensation method and system of gas sensor

    CN120217720A

  • A temperature and humidity compensation method and system for a gas sensor

    CN120217720B

  • Method and device for detecting adsorption performance of activated carbon based on temperature and humidity compensation

    CN120253971A

  • A method and device for detecting adsorption performance of activated carbon based on temperature and humidity compensation

    CN120253971B

  • Intelligent portable terminal device with temperature and humidity detection function

    CN121051593A