Carbon monoxide concentration prediction method based on BWO-XGBoost

Optimizing the hyperparameters of the XGBoost model through the MI-RF joint strategy and BWO algorithm, the problems of insufficient feature selection and low hyperparameter optimization efficiency in the existing technology are solved, and efficient and accurate concentration prediction is achieved, which is suitable for monitoring carbon monoxide concentration and other gas concentrations and environmental pollution prediction.

CN120372565APending Publication Date: 2025-07-25JINGSHU TECHNOLOGY (HAINING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510389397.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The prior art has problems such as insufficient feature selection, limited model accuracy and low hyperparameter optimization efficiency in the prediction of carbon monoxide concentration, resulting in low detection accuracy and efficiency.

Method used

The MI-RF joint strategy is used for feature selection, and the hyperparameters of the XGBoost model are optimized through the BWO algorithm, combining multi-fold cross-validation and continuous monitoring of model performance to improve feature extraction capabilities and hyperparameter optimization efficiency.

Benefits of technology

It improves the accuracy of carbon monoxide concentration prediction and the stability of the model, shortens the training time, enhances the adaptability and generalization ability of the model, and is suitable for carbon monoxide concentration prediction and other gas concentration monitoring and environmental pollution prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120372565A_ABST
    Figure CN120372565A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of environment monitoring and prediction, and discloses a carbon monoxide concentration prediction method based on BWO-XGBoost, which aims to improve the accuracy and efficiency of environment monitoring, and can effectively extract features highly related to CO concentration by adopting an MI-RF joint strategy for feature selection in the method, thereby reducing redundant information and improving the accuracy and efficiency of environment monitoring. By introducing a white whale optimization algorithm to optimize hyper-parameters of an XGBoost model, the convergence speed of the model is accelerated, the calculation efficiency of the model is improved, experimental verification shows that the error indexes of RMSE and MAE of the method are both lower than those of a traditional model, meanwhile, R2 and EVS indexes are higher, and the method can be applied to the field of prediction of the XGBoost model. The advantages and stability of the method in a carbon monoxide concentration prediction task are proved, so that the method is not only suitable for carbon monoxide concentration prediction, but also can be popularized to other gas concentration monitoring and environmental pollution prediction fields, and has the advantages of high efficiency, high prediction precision and optimized hyper-parameter adjustment strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of environmental monitoring and prediction, and specifically to a carbon monoxide concentration prediction method based on BWO-XGBoost. Background Art

[0002] Carbon monoxide is a colorless, odorless, and tasteless toxic gas, and its concentration monitoring is crucial for air quality assessment and human health. However, traditional carbon monoxide concentration detection methods, such as chemical sensors or gas chromatography analysis, have problems of high equipment cost, complex operation, and long response time. In addition, since carbon monoxide is difficult to be detected and identified manually, it is easy to cause safety hazards.

[0003] In recent years, electronic nose (E-nose) technology has attracted much attention due to its application potential in the field of gas detection. This technology qualitatively or quantitatively analyzes gas molecules through a multi-sensor array and combines pattern recognition algorithms for concentration prediction. However, the existing E-nose technology still faces many challenges when applied to carbon monoxide detection: First, feature selection is insufficient. The data obtained by E-nose has a high dimension, which may contain redundant or irrelevant features, affecting the computational efficiency and prediction accuracy of the model. Existing methods mostly use single feature selection techniques and are difficult to effectively combine the advantages of multiple strategies, resulting in insufficient key feature extraction ability.

[0004] Second, the model prediction ability is limited. The current mainstream carbon monoxide concentration prediction methods are mostly based on traditional statistical regression or simple machine learning algorithms (such as decision trees, support vector machines, etc.), and these methods perform poorly in dealing with high-dimensional and non-linear data, and the prediction accuracy and generalization ability need to be improved.

[0005] Finally, hyperparameter optimization is insufficient. The performance of machine learning models highly depends on the reasonable setting of hyperparameters, and the currently commonly used grid search or random search methods have large computational amounts and low search efficiency, and it is difficult to quickly find the optimal parameter combination, thus affecting the practical application value of the model.

[0006] In summary, the existing technologies have problems such as insufficient feature selection, limited model accuracy, and low hyperparameter optimization efficiency in carbon monoxide concentration prediction. Therefore, there is an urgent need for a more efficient feature selection method, a stronger prediction model, and an optimized hyperparameter adjustment strategy to improve the accuracy and robustness of carbon monoxide concentration prediction. Based on this, this study proposes a carbon monoxide concentration prediction method based on BWO-XGBoost. Summary of the Invention

[0007] (I) Technical Problems to be Solved

[0008] In view of the deficiencies of the prior art, the present invention provides a carbon monoxide concentration prediction method based on BWO-XGBoost, which has the advantages of high efficiency, high prediction accuracy and an optimized hyperparameter adjustment strategy, and solves the problems of insufficient feature selection, limited model accuracy and low hyperparameter optimization efficiency in the prior art for carbon monoxide concentration prediction.

[0009] (II) Technical Solution

[0010] To achieve the above object, the present invention provides the following technical solution: A carbon monoxide concentration prediction method based on BWO-XGBoost, comprising the following steps:

[0011] Step 1. Experimental setup and data collection: Configure the experimental equipment and collect carbon monoxide concentration data;

[0012] Step 2. Data preprocessing and feature selection: Normalize the collected data, divide the training / validation sets, and apply the MI-RF joint strategy for feature selection;

[0013] Step 3. Model construction and hyperparameter optimization: Construct a BWO-XGBoost prediction model and optimize the hyperparameters of XGBoost through the BWO algorithm.

[0014] Preferably, the configuration of the experimental equipment in Step 1: Use a mass flow controller and a data recording device to construct a chemical detection platform, equipped with different types of temperature-modulated metal oxide gas sensors, and the sensors are placed in a polytetrafluoroethylene test chamber.

[0015] Preferably, the data collection process in Step 1:

[0016] S1.1. During the experiment, introduce gas samples with different flow rates through the chemical detection platform and collect the sample flow rate data;

[0017] S1.2. Before each experiment, clean the gas chamber with synthetic gas flow for 15-20 minutes;

[0018] S1.3. After the cleaning is completed, release the mixed gas randomly at a constant flow rate, each time for 15-20 minutes;

[0019] S1.4. The concentration of the mixed gas is evenly distributed in the range of 0-20 ppm, each concentration is repeated 10-12 times, the relative humidity value is evenly distributed between 15% and 75%, and the same is repeated 9-11 times, and record the gas concentration and repetition times data.

[0020] Preferably, the repeatability of the experiment: The entire experimental process is repeated 13 - 15 times within 17 - 20 days. Each experiment lasts for 20 - 25 hours, and one experiment is randomly selected from the 13 - 15 repeated experiments as the dataset.

[0021] Preferably, the normalization of the dataset: For the dataset collected by the sensor, the MinMaxScaler technique is used for normalization processing.

[0022] Preferably, the dataset division: The dataset is randomly divided into a training set and a validation set in a ratio of 7:3.

[0023] Preferably, the feature selection process in step two:

[0024] S2.1. Adopt a combined feature selection strategy of MI - RF;

[0025] S2.2. Calculate the mutual information between each feature and the target variable;

[0026] S2.3. Then use random forest to sort 14 - 16 features in the dataset;

[0027] S2.4. Finally, perform weighted fusion of MI and RF, and determine the optimal feature subset through ten - fold cross - validation.

[0028] Preferably, the model construction in step three: Based on the feature subset selected in step two, construct a carbon monoxide concentration prediction model based on BWO - XGBoost.

[0029] Preferably, the definition of hyperparameters in step three: Set the key hyperparameter ranges of XGBoost, including the learning rate, maximum depth of the tree, sample sampling rate, feature sampling rate, and minimum loss reduction threshold.

[0030] Preferably, step three includes:

[0031] S3.1. Model construction: Based on the dataset after feature selection, initialize the XGBoost regressor and set the basic hyperparameters;

[0032] S3.2. Hyperparameter optimization: Use the BWO algorithm to globally optimize the learning_rate, max_depth, subsample, colsample_bytree, and gamma of XGBoost;

[0033] S3.3. Model training and validation: Use the optimized hyperparameter combination to train the model and evaluate its prediction accuracy through the validation set;

[0034] S3.4, Model Deployment: Apply the optimized BWO-XGBoost model to the actual carbon monoxide concentration prediction field.

[0035] Compared with the prior art, the present invention provides a carbon monoxide concentration prediction method based on BWO-XGBoost, which has the following beneficial effects:

[0036] 1. By adopting the MI-RF joint feature selection strategy and weighted fusion method, the present invention can achieve the beneficial effects of improving the prediction accuracy and model generalization ability. Among them, by calculating the mutual information between features and target variables and combining with random forest for feature ranking, features highly correlated with carbon monoxide concentration are effectively extracted to reduce redundant information. At the same time, the optimal feature subset is determined through ten-fold cross-validation to further improve the interpretability and prediction accuracy of the model. And through experimental results, the model of the present invention performs better in error indicators such as RMSE and MAE, and has higher R2 and EVS indicators, indicating that the model has smaller prediction errors, better fitting degree, and can better adapt to unseen data.

[0037] 2. By introducing the beluga whale optimization algorithm to optimize the key hyperparameters of XGBoost, the present invention can achieve the beneficial effects of improving the calculation efficiency and accelerating the model convergence. The BWO algorithm can efficiently update the step factor and position through its exploration stage, exploitation stage, and whale fall stage, and find the current best position, so as to quickly determine the best combination of hyperparameters. Compared with traditional methods, the training time of the present invention is significantly shortened, and the overall performance of the model is improved, proving its superiority in improving the calculation efficiency.

[0038] 3. By multi-fold cross-validation and continuous monitoring of the model performance, the present invention can achieve the beneficial effects of improving the model stability and adaptability. During the model training process, the multi-fold cross-validation method is adopted to ensure the stability of the model on different data subsets. After the model is deployed, the model performance is continuously monitored, and timely adjustment and optimization are carried out according to the changes in the actual scenario, so that the model can better adapt to the dynamic changes in actual applications. And the method of the present invention is not only applicable to carbon monoxide concentration prediction, but also has wide applicability, and can be extended to other gas concentration monitoring and environmental pollution prediction fields, with broad application prospects. Description of the Drawings

[0039] Figure 1 It is the flow chart of the BWO algorithm of the present invention;

[0040] Figure 2 It is the flow chart of constructing the XGBoost model of the present invention;

[0041] Figure 3 It is the flow chart of the method of the present invention. Detailed Embodiments

[0042] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0043] Please refer to Figure 1 - Figure 3 , a carbon monoxide concentration prediction method based on BWO-XGBoost, comprising the following steps:

[0044] Step 1. Experimental setup and data collection: Configure the experimental equipment and collect carbon monoxide concentration data;

[0045] Step 2. Data preprocessing and feature selection: Normalize the collected data, divide the training / validation set, and apply the MI-RF joint strategy for feature selection;

[0046] Step 3. Model construction and hyperparameter optimization: Construct a BWO-XGBoost prediction model and optimize the hyperparameters of XGBoost through the BWO algorithm.

[0047] Specifically, for the configuration of the experimental equipment in Step 1: Use a mass flow controller (MFC) and a data recording device to construct a chemical detection platform, equipped with different types (14 types) of temperature-modulated metal oxide (MOX) gas sensors, and the sensors are placed in a 250-ml polytetrafluoroethylene (PTFE) test chamber.

[0048] Specifically, for the data collection process in Step 1:

[0049] S1.1. During the experiment, introduce gas samples with different flow rates through the chemical detection platform and collect the sample flow rate data (dry and wet air: 1000 ml / min, carbon monoxide: 3 ml / min);

[0050] S1.2. Before each experiment, clean the gas chamber with a synthetic gas flow rate of 240 ml / min for 15-20 minutes;

[0051] S1.3. After the cleaning is completed, randomly release the mixed gas at a constant flow rate of 240 ml / min, each time for 15-20 minutes;

[0052] S1.4. The concentration of the mixed gas is evenly distributed in the range of 0 - 20 ppm, with each concentration repeated 10 - 12 times. The relative humidity value is evenly distributed between 15% and 75%, also repeated 9 - 11 times. Record the gas concentration and repetition times data. Such a design aims to better simulate the real environment.

[0053] Specifically, the repeatability of the experiment: The entire experiment process is repeated 13 - 15 times within 17 - 20 days. Each experiment lasts 20 - 25 hours, and one experiment is randomly selected from the 13 - 15 repeated experiments as the dataset.

[0054] Specifically, the normalization of the dataset: For the dataset collected by the sensor, the MinMaxScaler technology is used for normalization processing to ensure that the eigenvalue of different dimensions is within the same range.

[0055] Specifically, the dataset division: The dataset is randomly divided into a training set and a validation set according to the ratio of 7:3.

[0056] Specifically, the feature selection process in step two:

[0057] S2.1. Adopt the feature selection strategy of MI - RF combination;

[0058] S2.2. Calculate the mutual information (MI) between each feature and the target variable;

[0059] S2.3. Then use random forest (RF) to sort 14 - 16 features in the dataset to determine their importance in predicting the target variable;

[0060] S2.4. Finally, through the weighted fusion of MI and RF (weights are 0.36 and 0.64 respectively), and determine the optimal feature subset through ten - fold cross - validation to improve the interpretability and prediction accuracy of the model.

[0061] The advantage is that by using MI - RF for feature selection, features highly correlated with the CO concentration are effectively extracted to reduce redundant information, improve the generalization ability of the model, and thus improve the prediction accuracy.

[0062] Specifically, the model construction in step three: Based on the feature subset selected in step two, construct a carbon monoxide concentration prediction model based on BWO - XGBoost.

[0063] Specifically, the hyperparameter definition in Step 3: To further improve the model performance, the cuckoo search (BWO) algorithm is applied to optimize the key hyperparameters of XGBoost, including learning_rate, max_depth, subsample, colsample_bytree, and gamma. The goal is to find the best combination of these hyperparameters to improve the accuracy and generalization ability of the model in predicting carbon monoxide concentration. The ranges of the key hyperparameters of XGBoost are set, including the learning rate (learning_rate, range 0.01 - 0.3), the maximum depth of the tree (max_depth, range 3 - 10), the sample sampling rate (subsample, range 0.6 - 1.0), the feature sampling rate (colsample_bytree, range 0.6 - 1.0), and the minimum loss reduction threshold (gamma, range 0 - 0.5).

[0064] The advantages are: By optimizing the model hyperparameters, the computational efficiency is improved. Among them, introducing the beluga whale optimization algorithm (BWO) to optimize the hyperparameters of the XGBoost model can accelerate the model convergence and improve the computational efficiency.

[0065] Specifically, Step 3 includes:

[0066] S3.1. Model construction: Based on the dataset after feature selection, initialize the XGBoost regressor and set the basic hyperparameters;

[0067] S3.2. Hyperparameter optimization: Use the BWO algorithm to globally optimize learning_rate, max_depth, subsample, colsample_bytree, and gamma of XGBoost;

[0068] S3.3. Model training and validation: Use the optimized hyperparameter combination to train the model and evaluate its prediction accuracy (such as RMSE, MAE, R2) through the validation set;

[0069] S3.4. Model deployment: Apply the optimized BWO - XGBoost model to the actual carbon monoxide concentration prediction scenario.

[0070] Example 1

[0071] T1. Experimental setup and data collection: According to Figure 1The flowchart of the BWO algorithm shown first determines the BWO parameters, including the population size (n) and the maximum number of iterations (T_max), initializes the population and calculates the fitness value, starts the main loop, finds the optimal solution according to the fitness value. The experimental equipment configuration includes a mass flow controller (MFC) and a data recording device. The chemical detection platform consists of 14 temperature-modulated metal oxide (MOX) gas sensors, placed in a 250-ml polytetrafluoroethylene (PTFE) test chamber;

[0072] T2. Data preprocessing and feature selection: Normalize the data collected by the sensors, use the MinMaxScaler technique to ensure that the feature values of different dimensions are in the same range, randomly divide the dataset into a training set and a validation set according to a ratio of 7:3, adopt a combined MI-RF feature selection strategy, calculate the mutual information (MI) between each feature and the target variable, and use random forest (RF) to rank the features to determine their importance in predicting the target variable. Through weighted fusion of MI and RF (weights are 0.36 and 0.64 respectively), and determine the optimal feature subset through ten-fold cross-validation;

[0073] T3. Model construction and hyperparameter optimization: Based on the selected feature subset, construct a carbon monoxide concentration prediction model based on BWO-XGBoost, apply the BWO algorithm to optimize the key hyperparameters of XGBoost, including learning_rate, max_depth, subsample, colsample_bytree, and gamma. Through the exploration phase, exploitation phase, and whale fall phase of the BWO algorithm, update the step size factor and position, calculate the fitness value, and find the current best position. Repeat the above process until the maximum number of iterations T_max is reached;

[0074] T4. Model training and validation: Use the optimized hyperparameter combination to train the model, evaluate its prediction accuracy (such as RMSE, MAE, R2) through the validation set. During the model training process, continuously update the model parameters until the optimal hyperparameter combination is found;

[0075] T5. Model deployment: Apply the optimized BWO-XGBoost model to the actual carbon monoxide concentration prediction scenario for real-time prediction. After the model is deployed, continuously monitor the model performance and make adjustments and optimizations as needed.

[0076] Example 2

[0077] T1. Experimental setup and data collection: According to Figure 2The flowchart of constructing the XGBoost model shown first constructs decision tree 1, then calculates the residuals, then constructs decision tree 2, and calculates the residuals again. This cycle continues until decision tree t is constructed. The experimental equipment configuration is the same as that in Example 1;

[0078] T2. Data preprocessing and feature selection: The same as in Example 1, the data collected by the sensor is normalized. The MinMaxScaler technology is used to ensure that the feature values with different dimensions are in the same range. The dataset is randomly divided into a training set and a validation set in a ratio of 7:3. The MI-RF combined feature selection strategy is adopted. The mutual information (MI) between each feature and the target variable is calculated, and a random forest (RF) is used to rank the features to determine their importance in predicting the target variable. Through the weighted fusion of MI and RF (weights are 0.36 and 0.64 respectively), and the optimal feature subset is determined through ten-fold cross-validation;

[0079] T3. Model construction and hyperparameter optimization: Based on the selected feature subset, a carbon monoxide concentration prediction model based on BWO-XGBoost is constructed. The BWO algorithm is applied to optimize the key hyperparameters of XGBoost, including learning_rate, max_depth, subsample, colsample_bytree, and gamma. Through the exploration stage, development stage, and whale fall stage of the BWO algorithm, the step size factor and position are updated, the fitness value is calculated, and the current best position is searched. The above process is repeated until the maximum number of iterations T_max is reached;

[0080] T4. Model training and validation: The model is trained using the optimized hyperparameter combination, and its prediction accuracy (such as RMSE, MAE, R2) is evaluated through the validation set. During the model training process, the model parameters are continuously updated until the optimal hyperparameter combination is found;

[0081] T5. Model deployment: The optimized BWO-XGBoost model is applied to the actual carbon monoxide concentration prediction scenario for real-time prediction. After the model is deployed, the model performance is continuously monitored, and adjustments and optimizations are made as needed.

[0082] Comparative Example 1

[0083] G1. Experimental setup and data collection: The experimental equipment configuration is the same as in Example 1. The chemical detection platform consists of 14 temperature-modulated metal oxide (MOX) gas sensors and is placed in a 250-ml polytetrafluoroethylene (PTFE) test chamber. The initialization data collection process is adopted;

[0084] G2. Data preprocessing and feature selection: Normalize the data collected by the sensor. Use the MinMaxScaler technique to ensure that feature values with different dimensions are within the same range. For feature selection, adopt a single Pearson correlation coefficient method, and select features only based on the linear correlation between features and the target variable. Do not perform complex weighted fusion and cross-validation to determine the optimal feature subset;

[0085] G3. Model construction and hyperparameter optimization: Based on the selected feature subset, construct an ordinary XGBoost carbon monoxide concentration prediction model. Do not use the BWO algorithm to optimize the hyperparameters of XGBoost, and use the default values of XGBoost for hyperparameters;

[0086] G4. Model training and validation: Train the model using the default hyperparameters, and evaluate its prediction accuracy (such as RMSE, MAE, R2) through the validation set. During the model training process, do not perform dynamic update and optimization of hyperparameters;

[0087] G5. Model deployment: Apply the ordinary XGBoost model to the actual carbon monoxide concentration prediction scenario for real-time prediction. After the model is deployed, monitor the model performance less frequently and do not make timely adjustments and optimizations according to the actual situation.

[0088] Comparative Example 2

[0089] G1. Experimental setup and data collection: The experimental equipment configuration is the same as that in Example 1. When constructing the decision tree, follow the conventional method, and there is no specific way to construct the decision tree in a loop according to the flowchart as in Example 2. Just construct several decision trees for model building;

[0090] G2. Data preprocessing and feature selection: The same as Comparative Example 1. Normalize the data collected by the sensor. Use the MinMaxScaler technique to ensure that feature values with different dimensions are within the same range, and adopt a single Pearson correlation coefficient method for feature selection;

[0091] G3. Model construction and hyperparameter optimization: Based on the selected feature subset, construct an ordinary XGBoost carbon monoxide concentration prediction model. Do not use the BWO algorithm to optimize the hyperparameters of XGBoost, and use the default values of XGBoost for hyperparameters;

[0092] G4. Model training and validation: Train the model using the default hyperparameters, and evaluate its prediction accuracy (such as RMSE, MAE, R2) through the validation set. During the model training process, do not perform dynamic update and optimization of hyperparameters;

[0093] G5. Model Deployment: Apply the ordinary XGBoost model to the actual carbon monoxide concentration prediction scenario for real-time prediction. After the model is deployed, the model performance is monitored less, and no timely adjustment and optimization are made according to the actual situation.

[0094] The following are the specific experimental data of the examples and comparative examples, as shown in Table 1:

[0095] Table 1

[0096]

[0097] The following experimental information is obtained from Table 1 above:

[0098] From the comparison of the experimental data of the examples and comparative examples, Examples 1 and 2 are superior to Comparative Examples 1 and 2 in terms of prediction accuracy. Among them, the RMSE and MAE values are lower, and the R2 value is higher, indicating that the models of the examples have smaller prediction errors and better fitting degrees. In terms of the model training time, Example 2 has the shortest training time due to the use of more efficient equipment and algorithm optimization. In terms of hyperparameter optimization and feature selection, the examples can effectively improve the model performance through the BWO algorithm and advanced feature selection strategies, while the comparative examples are not effectively optimized, resulting in limited performance. In the model stability test, the examples perform better after multiple-fold cross-validation. In the test of the adjustment frequency after model deployment, the examples are more active and can better adapt to the changes in the actual scenario.

[0099] Summary: The experimental results show that the BWO-XGBoost proposed in the embodiments of the present invention is lower than the comparative example models in terms of the error indexes of RMSE and MAE. At the same time, the R2 and EVS indexes are higher, proving the superiority and stability of the prediction method of the present invention in the carbon monoxide concentration prediction task. Moreover, the method of the present invention is not only applicable to the carbon monoxide concentration prediction, but also applicable to other gas concentration monitoring and environmental pollution prediction fields.

[0100] Although the embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made therein without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A carbon monoxide concentration prediction method based on BWO-XGBoost, characterized in that, It includes the following steps: Step 1, Experimental setup and data collection: Configure the experimental equipment and collect carbon monoxide concentration data; Step 2, Data preprocessing and feature selection: Normalize the collected data, divide it into training / validation sets, and apply the MI-RF joint strategy for feature selection; Step 3, Model construction and hyperparameter optimization: Construct a BWO-XGBoost prediction model and optimize the hyperparameters of XGBoost through the BWO algorithm.

2. The carbon monoxide concentration prediction method based on BWO-XGBoost according to claim 1, characterized in that: Configuration of the experimental equipment in Step 1: Build a chemical detection platform using a mass flow controller and a data recording device, equipped with different types of temperature-modulated metal oxide gas sensors, and place the sensors in a polytetrafluoroethylene test chamber.

3. A carbon monoxide concentration prediction method based on BWO-XGBoost according to claim 1, characterized in that: Data collection process in Step 1: S1.1, During the experiment, introduce gas samples with different flow rates through the chemical detection platform and collect sample flow rate data; S1.2, Before each experiment, clean the gas chamber with synthetic gas flow for 15 - 20 minutes; S1.3, After cleaning, release the mixed gas randomly at a constant flow rate, each time lasting for 15 - 20 minutes; S1.4, The concentration of the mixed gas is evenly distributed in the range of 0 - 20 ppm, each concentration is repeated 10 - 12 times, the relative humidity value is evenly distributed between 15% and 75%, and is also repeated 9 - 11 times. Record the gas concentration and repetition times data.

4. The carbon monoxide concentration prediction method based on BWO-XGBoost according to claim 3, wherein: Repeatability of the experiment: The entire experimental process is repeated 13 - 15 times within 17 - 20 days, each experiment lasts for 20 - 25 hours, and randomly select one from the 13 - 15 repeated experiments as the data set.

5. A carbon monoxide concentration prediction method based on BWO-XGBoost according to claim 3, characterized in that: Normalization of the data set: Use the MinMaxScaler technique to normalize the data set collected by the sensor.

6. A carbon monoxide concentration prediction method based on BWO-XGBoost according to claim 4, characterized in that: Data set division: Randomly divide the data set into a training set and a validation set according to a ratio of 7:

3.

7. A carbon monoxide concentration prediction method based on BWO-XGBoost according to claim 1, characterized in that: Feature selection process in Step 2: S2.1, Adopt the MI-RF joint feature selection strategy; S2.2, Calculate the mutual information between each feature and the target variable; S2.3, Then use random forest to rank 14 - 16 features in the data set; S2.4, Finally, perform weighted fusion of MI and RF, and determine the optimal feature subset through ten-fold cross-validation.

8. A carbon monoxide concentration prediction method based on BWO-XGBoost according to claim 1, characterized in that: Model construction in Step 3: Based on the feature subset selected in Step 2, construct a carbon monoxide concentration prediction model based on BWO-XGBoost.

9. A carbon monoxide concentration prediction method based on BWO-XGBoost according to claim 1, characterized in that: Definition of hyperparameters in Step 3: Set the key hyperparameter ranges of XGBoost, including learning rate, maximum depth of the tree, sample sampling rate, feature sampling rate, and minimum loss reduction threshold.

10. A carbon monoxide concentration prediction method based on BWO-XGBoost according to claim 1, characterized in that: Step 3 includes: S3.1, Model construction: Based on the data set after feature selection, initialize the XGBoost regressor and set the basic hyperparameters; S3.2, Hyperparameter optimization: Use the BWO algorithm to globally optimize the learning_rate, max_depth, subsample, colsample_bytree, and gamma of XGBoost; S3.

3. Model Training and Validation: Train the model using the optimized hyperparameter combination and evaluate its prediction accuracy through the validation set; S3.

4. Model Deployment: Apply the optimized BWO-XGBoost model to the actual carbon monoxide concentration prediction scenario.