Next Article in Journal
IoT Water Quality Monitoring and Control System in Moving Bed Biofilm Reactor to Reduce Total Ammonia Nitrogen
Previous Article in Journal
Dynamic Virtual Fixture Generation Based on Intra-Operative 3D Image Feedback in Robot-Assisted Minimally Invasive Thoracic Surgery
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Temperature Compensation of Laser Methane Sensor Based on a Large-Scale Dataset and the ISSA-BP Neural Network

1
School of Electronics and Information Engineering, Anhui Jianzhu University, Hefei 230601, China
2
Hefei Institute for Public Security, Tsinghua University, Hefei 230601, China
3
Hefei Tsingsensor Technology Co., Ltd., Hefei 230601, China
*
Author to whom correspondence should be addressed.
Sensors 2024, 24(2), 493; https://doi.org/10.3390/s24020493
Submission received: 6 November 2023 / Revised: 30 December 2023 / Accepted: 9 January 2024 / Published: 12 January 2024
(This article belongs to the Section Optical Sensors)

Abstract

:
We aimed to improve the detection accuracy of laser methane sensors in expansive temperature application environments. In this paper, a large-scale dataset of the measured concentration of the sensor at different temperatures is established, and a temperature compensation model based on the ISSA-BP neural network is proposed. On the data side, a large-scale dataset of 15,810 sets of laser methane sensors with different temperatures and concentrations was established, and an Improved Isolation Forest algorithm was used to clean the large-scale data and remove the outliers in the dataset. On the modeling framework, a temperature compensation model based on the ISSA-BP neural network is proposed. The quasi-reflective learning, chameleon swarm algorithm, Lévy flight, and artificial rabbits optimization are utilized to improve the initialization of the sparrow population, explorer position, anti-predator position, and position of individual sparrows in each generation, respectively, to improve the global optimization seeking ability of the standard sparrow search algorithm. The ISSA-BP temperature compensation model far outperforms the four models, SVM, RF, BP, and PSO-BP, in model evaluation metrics such as MAE, MAPE, RMSE, and R-square for both the training and test sets. The results show that the algorithm in this paper can significantly improve the detection accuracy of the laser methane sensor under the wide temperature application environment.

1. Introduction

Natural gas is widely used as a clean energy source in various fields, but its main component, methane (CH4), is flammable and explosive [1,2]. Although methane gas is colorless, odorless, and non-toxic, its leakage can easily lead to severe combustion and explosion accidents, resulting in significant casualties and property damage [3,4]. Especially in environments such as coal mines, methane concentrations are often deficient but sufficient to form explosive mixtures [5]. In emergencies, methane concentrations can quickly reach even tens of percent. The problem with methane, however, is not only its combustion and explosion risks but also its greenhouse effect [6]. Since the Industrial Revolution, global warming has significantly threatened human society and ecosystems. Methane is not only a greenhouse gas; its greenhouse effect is 22 times greater than carbon dioxide, making it the second globally warming greenhouse gas in the earth’s atmosphere after carbon dioxide [7,8,9]. Therefore, how to detect methane gas concentration more effectively and accurately in complex application environments has become the target of attention and research direction for many researchers [10].
Laser methane sensors can be used for real-time online monitoring of natural gas leaks in complex environments. However, laser methane sensors are sensitive to temperature, resulting in a significant difference between the detected CH4 concentration and the actual value [11]. Commonly used temperature compensation methods include hardware compensation and software algorithm compensation. Since hardware compensation is easily affected by circuit components and welding accuracy, resulting in the lack of precision of gas concentration detection results, but also has the defect of high cost, most scientists use software compensation methods such as the least squares method and polynomial fitting method. It has the advantages of high programmability, lower price, and scalability [12,13,14]. Considering that the effect of temperature on the detection results of laser methane sensors includes a variety of factors such as gas molecules, optical components, and circuit components [15], there is still a significant error between the corrected concentration value and the actual value by the above method. Some scholars have improved the prediction effect of laser methane sensors and simplified the temperature compensation process by establishing a neural network temperature compensation model with higher prediction accuracy, strong generalization ability, and learning ability [16].
Machine learning algorithms have various applications in various technical aspects of gas sensors. Xiaonan Liu demonstrated in detail the application of utilizing shallow neural network (SNN) fitting algorithms for the spectral data processing domain to achieve denoising. This neural network has the advantages of simple structure and robustness [17]. In addition, among many machine-learning-based methods for temperature compensation, we cite the following that reflect the state-of-the-art:
SVM [18]: Methane gas temperature compensation using a Support Vector Machine (SVM) algorithm to train regression models. The sensor detects the temperature and corresponding concentration values as inputs, and the temperature-compensated predicted methane concentration is used as an output. However, SVM is sensitive to parameter tuning and unsuitable for training large data samples. This leads to poor temperature compensation when a large number of data samples are used for training.
Random Forest [19]: The structure of a random forest consists of multiple decision trees. In each decision tree, nodes are split by randomly selecting a subset of features and samples until a certain depth or purity is reached. Random forests can handle complex nonlinear relationships and are resistant to overfitting. However, random forest models are more complex and require higher memory and computational resources, which leads to longer training time on large datasets.
BP Neural Network [20]: The method takes advantage of the fact that BP neural networks can backpropagate the error to compensate for the nonlinear errors due to temperature variations. However, the BP neural network tends to fall into local optimization, and the probability of overfitting and underfitting increases.
PSO-BP Neural Network [21]: The primary purpose is to optimize the weights and biases of the BP neural network using the Particle Swarm Optimization (PSO) algorithm, which better enables the neural network to perform in predicting methane concentration. However, the PSO algorithm’s global optimization ability could be more stable under significant temperature variations, leading to insufficient prediction accuracy under extreme temperature conditions or when the temperature range changes too much.
The prediction accuracy for the temperature compensation model based on a neural network mainly depends on training samples and the network model structure. The aim of this paper is twofold. Firstly, to deal with the need for large-scale datasets training laser methane sensors, we created thousands of large-scale data by adding the data cleaning algorithm based on Improved Isolation Forest [22] to the actual laser methane sensor high and low-temperature methane concentration detection. Secondly, this paper introduces the Improved Sparrow Search Algorithm (ISSA) [23] to optimize the BP neural network for global optimization and better generalization ability. Temperature-compensated prediction through data cleaning and model training will lead to higher prediction accuracy and generalization for laser methane sensors. There are different types of Laser methane sensors. The most commonly used detectors are based on TDLAS technology, including Direct Absorption Spectroscopy (DAS) and Wavelength Modulated Spectroscopy (WMS). Photoacoustic Spectroscopy (PAS), although often used in conjunction with TDLAS, works differently from TDLAS in that it detects acoustic waves generated by gas molecules absorbing a modulated laser [24]. In this paper, we utilize the advantages of DAS in terms of simplicity of operation, cost-effectiveness, and stability to conduct a temperature compensation study of a laser methane sensor. However, the large-scale dataset cleaning and temperature compensation methods we designed and studied can also be applied to various fields and spectroscopic techniques.

2. Establishment of Large-Scale Dataset

2.1. Data Acquisition and Segmentation

The essential equipment employed under laboratory conditions to determine the influence of temperature on the CH4 gas concentration detected using TDLAS is illustrated in Figure 1. The laser methane detector mainly includes a DFB laser, an open, reflective gas chamber, a circuit board, a photodetector, a pressure sensor, and a temperature sensor. Among them, the laser has a center wavelength of 1653.72 nm, a drive current of 20–50 mA, and a drive voltage of 3.3 V. The open-reflective gas chamber includes two gold-plated mirrors. Mounting holes for the laser, photodetector, temperature, and pressure sensors are provided at the bottom. The top of the circuit board is mounted with an MCU master control chip, laser temperature control chip, temperature sensor, memory chip, resistor, and capacitor. The experimental system mainly consists of the gas distribution system, the light source emission part, the gas absorption cell, the data receiving and processing unit, and the programmable constant temperature and humidity box. The light source emission part mainly consists of a distributed feedback (DFB) laser and a semiconductor laser controller.
The data collected in this paper are the ambient temperature sensor detections and methane concentration values detected by the laser methane sensor in low-temperature (−20~0 °C), normal-temperature (10~30 °C), and high-temperature (40~65 °C) environments. Within each temperature interval, we slowly ramped the temperature from −20 °C, taking measurements in 5 °C steps and selecting stable laser methane sensor temperature and concentration values during the ramp-up process. Figure 2 shows the photographs of the equipment required for the laser methane sensor to collect data for high- and low-temperature experiments.
This paper collected 15,810 sets of sensor temperature and concentration data from laser methane sensors, thus creating large-scale datasets to serve as the base data for temperature compensation studies. The datasets include data obtained at low, normal, and high temperatures, with each temperature interval containing CH4 measurements at standard concentrations of 0.5%, 2%, and 8%. As shown in Table 1, the datasets were divided into training and test datasets to improve the prediction accuracy of the established temperature compensation model. To select the temperature compensation model. The training data set consists of 2800 records of 2% and 8.0% CH4 concentration detection data, corresponding to different ambient temperatures. The test datasets contain data from untrained temperatures (−10~0 °C, 10~15 °C, and 40~55 °C) from 0.5%, 2%, and 8% CH4 concentration data.
In order to ensure the completeness and randomness of the sample data used for model training, we obtained 15,810 sets of detection data from 9160 laser methane sensors in high- and low-temperature experiments at different temperatures and concentrations. We established a large-scale dataset to ensure its completeness and representativeness. In addition, data preprocessing cleaning is performed on the collected data to eliminate as much noise and outliers as possible in the dataset to ensure the quality of the large-scale measured data. Finally, to ensure the randomness of the data used for temperature compensation model training, we use random sampling to train the data, which reduces the potential selection bias and enhances the model’s generalization ability.

2.2. Data Preprocessing with Improved Isolation Forest Outlier Detection Algorithm

When the laser methane sensor collects high- and low-temperature test data and builds a large-scale dataset before temperature compensation, there may be some anomalous concentration data due to different sensor use times and hardware performance differences. The abnormal data can significantly impact the prediction effect of the temperature compensation model for gas concentration.
Isolation Forest (IForest) is a typical class of unsupervised anomaly detection algorithms in integrated learning algorithms. High- and low-temperature gas concentration detection can change significantly with temperature, and the IForest algorithm uses a random selection of features and segmentation points for the segmentation of the data, which can lead to inaccurate and meaningless segmentation and limitations in the accuracy of data cleaning. This paper proposes an Improved Isolation Forest (IIForest) algorithm. We add the K-Means++ clustering algorithm [25] to the basic IForest algorithm. The steps of the IIForest-based high- and low-temperature gas concentration detection data cleaning method are as follows:
Step 1: Data preparation. Experimentation and data sampling of laser methane sensors at different ambient temperature conditions.
Step 2: Construction of Isolated Forest. A set of decision trees is constructed using the traditional Isolated Forest algorithm.
Step 3: Automatic selection of the number of clusters. Firstly, the data is clustered using the K-Means++ algorithm to select an appropriate K value to divide the data into K clusters. Secondly, the cluster center is calculated as a representative point of the data subset for each cluster, and the clustering error is calculated. Finally, the location where the inflection point occurs in the 2D data consisting of the clustering error and the number of clustered clusters is taken as the optimal number.
Step 4: The K-Means++ algorithm is used in the traditional process of constructing the tree of an isolation forest to divide the dataset into several optimal clustering clusters, and each optimal clustering cluster is used as a branch of the isolated forest tree. During the construction of each decision tree, the dataset is divided into clusters rather than randomly selecting data division points. This allows for better differentiation between each cluster and provides more accurate anomaly scores. For each data point x, the membership grade is calculated based on its path length in the tree and the total path length of the tree.
Step 5: Data Cleaning. Anomaly detection is performed on the dataset using the IIForest method. The anomaly score is calculated based on each data point’s path length and cluster size in the decision tree. The formula for calculating the anomaly score S(x, T) is
S ( x ,   T ) = 2 ( E ( h ( x ) ) c ( m ) )
where h(x) is the path length of data point x in tree T, E(h(x)) denotes the expected value of the path length, and c(m) is a constant given depth m is a constant.
Figure 3 shows a graph of the outlier detection results of the experimental CH4 data at 2% concentration using the IIForest algorithm. The distribution of data types after the outlier removal of the training set data by the IIForest algorithm is shown in Table 2.

3. ISSA-BP Temperature Compensation Methods

3.1. ISSA-BP Temperature Compensation Models

Due to the complex mechanisms by which the gas is to be measured, and the various components in the laser methane sensor are affected by temperature, it is not easy to ensure stable CH4 concentration output accuracy by a single polynomial fitting model [26,27,28]. The sensor temperature compensation algorithm based on a neural network model has good generalization and learning ability, and better compensation results can be obtained from a large number of training datasets [29]. The neural network training method and datasets have an essential influence on the prediction accuracy. In this paper, we propose the ISSA-BP model with global optimization capability to improve the prediction accuracy of temperature compensation.
Based on the temperature compensation model of ISSA-BP, we set the number of nodes in the input layer to 2, the number of nodes in the output layer to 1, the number of hidden layers to 1, and the loss function is defined as Mean Square Error (MSE). As shown in Table 3, the detection data of 2% standard concentration of CH4 gas in the temperature range of −20 °C to 65 °C were selected for the cyclic experiment. At the hidden layer node number of 5, the MSE is 3.23 × 10−5, and the optimal hidden layer node number can be determined compared to other node numbers.
As shown in Figure 4, the model structure of ISSA-BP Neural Network in the temperature compensation model, which takes Sensor temperature detection value and CH4 concentration before compensation as the data of the input layer of the model, and the output is the predicted value of the concentration after temperature compensation.

3.2. Improved Sparrow Search Algorithm

3.2.1. Quasi-Reflective-Based Learning Strategies Initialize Populations

The standard sparrow search algorithm (SSA) initializes the population using a random function. This method results in a lack of diversity of sparrow populations and needs to improve on problems such as uneven distribution within the search space. This paper uses the Quasi-reflective-based Learning strategy [30] (QRBL), which can quickly perform a wide range of searches to initialize the population. Let a feasible solution for the current population in the j-dimensional search space be X j = ( x 1 , x 2 , , x j ) . Its quasi-reflective solution is X j ¯ = ( x 1 ¯ , x 2 ¯ , , x j ¯ ) , The position of the quasi-reflective solution is given by
X j ¯ = r a n d ( ( l b j + u b j ) / 2 ,   X j )
where Xj is a sparrow individual in the j-dimensional search space; X j l b j , u b j ; lb and ub are the lower and upper bounds in the algorithm parameters, and j 1,2 , . . . , j .

3.2.2. Explorer Location Update Strategy Improvements

Since the position update formula for the explorer position in the standard SSA algorithm when the warning value is less than the safety threshold is
X i , j t + 1 = X i , j t · exp i α · i t e r m a x
where X i , j t is the j-dimensional value of the i sparrow at iteration number t; i t e r m a x is the maximum number of iterations. Since the search range of the explorer particles in this formula gradually decreases and tends to 0, it affects the convergence speed of the algorithm. It causes the algorithm to fall into the local optimum easily.
To solve the aforementioned problems, this paper introduces the randomized prey search strategy in the Chameleon Swarm Algorithm [31] (CSA) to improve the explorer position update. This position update strategy can improve the information exchangeability between populations and prevent them from falling into local optimality. The improved sparrow explorer position update formula is
X i , j t + 1 = X i , j t + μ u b j l b j r 1 + l b j s g n rand 0.5 ,   R 2 < S T X i , j t + Q L ,                                                                                                                             R 2 S T
where r1 is a random number within (0, 1); μ is the convergence factor, calculated as: μ = γ e x p α t i t e r m a x β , the values of γ, α, and β are taken as 1, 3.5 and 3; rand is a random number within (0, 1); Q is a normally distributed random number; R2 is a hazard warning value, ST is an indication of the safety threshold.

3.2.3. Anti-Predator Location Update Strategy Improvements

The global optimal position of the antipredator in the standard SSA algorithm for the ith sparrow, the antipredator position update formula when it realizes the danger and escapes is
X i , j t + 1 = X i , j t + K X i , j t X w o r s t t f i f w + ε
where Xworst is the current worst position in the world; K denotes a random number in [−1, 1]; fi is the current fitness value of the individual sparrow; fw is the current global worst fitness value; ε is a constant that avoids the denominator being zero, ε = 1 × 10−10.
The anti-predator individual in this formulation is at the current global optimum, so the search range of its particles is reduced, increasing the probability that the algorithm is premature. To solve the aforementioned problems, this paper introduces the Levy flight strategy [32] with a randomized step size, which can achieve a more extensive search area when searching in an unknown location, thus improving the global search capability of the anti-predator. The improved anti-predator position update formula is
X i , j t + 1 = X b e s t t + β X i , j t X b e s t t ,                                             f i > f g X i , j t + α X i , j t X w o r s t t L e v y ( ξ ) ,         f i = f g
where X b e s t t is the location of the current optimal solution; α denotes the randomized step size after repeated experiments to take the value of 0.55; fg denotes the current global best fitness value. For Levy( ξ ) is usually represented by Mantegna’s algorithm [33], whose randomized search path is formulated as
Levy ( ξ ) ~ u | v | 1 / 2
u ~ N ( 0 ,   δ u 2 ) ,   v ~ N ( 0 ,   δ v 2 )
δ u = Γ ( 1 + ξ ) · s i n π ξ 2 Γ 1 + ξ 2 ξ · 2 ( ξ 1 ) 2 1 / ξ ,   δ v = 1
where Γ( ξ ) is the Gamma function and the ξ affects the Levy flight trajectory value.

3.2.4. Artificial Rabbit Optimization Perturbation Strategy

During each iteration of the algorithm, to improve the global optimization capability and convergence speed of the algorithm, this paper uses the mathematical model that simulates the rabbit’s foraging detour in the Artificial Rabbits Optimization [34] (ARO) algorithm to perturb and update the position of individual sparrows in each generation. The formula for correcting the role of individual sparrows in each generation using the artificial rabbit perturbation strategy is given by
X i , j t + 1 = X b e s t t + L · c · ( X e l s e t X b e s t t ) + S · n 1
L = ( e e x p ( t 1 i t e r m a x ) 2 ) · s i n ( 2 π r 2 )
c ( k ) = 1 ,         k = randperm ( d ) 0 ,                                                 else         k = 1 , . . . , d
S = r o u n d ( 0.5 · ( 0.05 + r 3 ) )
where X e l s e t is the location of the remaining sparrow individuals; n 1 is a random number that follows a standard normal distribution; L is the step factor; r 2   a n d   r 3 are all random numbers between (0, 1); round denotes rounding up or down; d is a variable dimension; r a n d p e r m ( d ) is a random integer between 1 and d is returned.
Figure 5 shows the variation of the step length factor L with increasing iterations. The improved method of updating the perturbation position of sparrow individuals is carried out from both positive and negative directions, generating a longer step length in the initial iteration and gradually becoming shorter with the increase in the number of iterations. This strategy improves the global search ability of sparrow individuals in the early stage and the convergence speed of the population in the later stage to a greater extent. It can help the ISSA algorithm escape the local optimum for global exploration and local exploitation.

3.2.5. ISSA Performance Evaluation

The SSA, particle Swarm Optimization Algorithm (PSO), and Grey Wolf Optimizer (GWO), which evolved by simulating the information exchange and cooperation behavior among biological groups, are all swarm intelligence optimization algorithms with better iterative optimization effects. They are all used in gas monitoring and gas temperature compensation. To verify the iterative optimization performance of the ISSA algorithm, four algorithms, PSO, GWO, SSA, and ISSA, are used for performance evaluation. Schwefel’s Problem single-peak function and Rastrigin multi-peak function are selected among the test functions. The experimental parameters were set as follows: the population size was 21, the number of iterations was 300, and the algorithms were run 30 times, respectively. The test results are shown in Figure 6.
As shown in the test results in Figure 6a, the convergence accuracy and speed are better than the PSO, GWO, and SSA algorithms when solving Schwefel’s problem function with the ISSA algorithm. In Figure 6b, when solving the Rastrigin function, the ISSA algorithm has the fastest convergence speed, which indicates that the ISSA algorithm is more capable of global search and local evolution.

4. Model Validation and Discussion

4.1. Realization Details

4.1.1. Temperature Compensation Model Prediction Details

In the model study of this paper, we propose to use the non-saturation and smoothness of the Mish function as the activation function of the BP neural network and optimize the BP neural network by combining the ISSA algorithm and the Adam optimizer. As shown in Figure 7 is the flow chart of using ISSA-BP algorithm to establish the temperature compensation model of laser methane sensor, and its specific optimization process is as follows:
Step 1: The 15,810 data detected by the laser methane sensor at different temperatures were divided into training and test samples. The IIForest algorithm was utilized to clean the data of the training samples.
Step 2: The BP neural network hyperparameters are set with the maximum training number and learning rate set to 100 and 0.1, respectively, and the minimum error set to 1 × 10−5. We propose using the Mish function as the activation function of the BP neural network and replacing the traditional S-type activation function. The expression for the Mish activation function is
f ( x ) = x · t a n h ( l n ( 1 + e x ) )
Step 3: Initialize the parameters related to ISSA and initialize the coding work for the weights and thresholds of the BP neural network. The ISSA algorithm sets the population size to be 21 after iterative round-robin trials, the variable dimensions d = 21, the maximum number of evolutions to be 150, the population limit popmax = 4, popmin = −4, and 20% of the population to be the explorers, and the rest to be the followers.
Step 4: Initialize the Adam optimizer [35]. The learning rate of the Adam optimizer is set to 0.001, the two moving average coefficients β1 and β2 take the values of 0.9 and 0.999, and the smallest actual number of positional stability is 1 × 10−8.
Step 5: Calculate the judgment loss function Loss value. When the Loss value shows a decreasing trend, Step 6~Step 12 is performed, and the parameters are updated using ISSA global search. When the Loss value is no longer decreasing, jump to Step 13 and update using Adam optimizer local search.
Step 6: Initializing the population using a quasi-reflective learning strategy.
Step 7: Calculate the fitness of sparrows during foraging and antipredation. Find the location of the best and worst fitness.
Step 8: Sparrow Explorer performs the position update according to Equation (4).
Step 9: The remaining individuals outside of the explorer are followers that follow the explorer for foraging, and their positions are iteratively updated by the formula:
X i , j t + 1 = Q exp X w o r s t t X i , j t i 2 ,                                                     i > n 2 X P t + 1 + X i , j t X P t + 1 A + L ,                                   o t h e r s
where Xp and Xworst denote the best and worst adaptation searched by the explorer, respectively; A denotes that each element in a 1 × g matrix is randomly assigned a value of 1 or −1, and A+ = AT(AAT)−1; L is a 1 × d matrix.
Step 10: The sparrow anti-predator performs position updating according to Equation (6).
Step 11: All individuals were updated with the current optimal position of sparrow individuals using the artificial rabbit perturbation Equations (10)–(13).
Step 12: Fitness update. Determine whether the set maximum number of iterations or the initially set minimum error has been reached. If it is satisfied, then proceed to the next step. Otherwise, return to Step 7.
Step 13: If the value of the loss function Loss varies smoothly, the Adam optimizer is used to search locally for each parameter of the improved BP neural network and update each parameter.
Step 14: The optimal individual fitness was assigned to each parameter of the BP neural network and tested by simulation modeling of the ambient temperature and concentration data, which continued to output the temperature-compensated CH4 concentration predictions after the inverse normalization process.

4.1.2. Model Performance Evaluation Index

To evaluate the prediction accuracy of temperature compensation models, the commonly used model evaluation metrics are Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), Root Mean Square Error (RMSE), and Correlation Coefficient (R2). The evaluation index formulas are
MAE = 1 n i = 1 n y ^ i y i
M A P E = 1 n i = 1 n y ^ i y i y i × 100 %
R M S E = 1 n i = 1 n y ^ i y i 2
R 2 = 1 i = 1 n ( y ^ i y i ) 2 i = 1 n ( y ¯ i y i ) 2
where yi and y ^ i are the actual value of methane concentration and the predicted output, respectively. y ¯ i is the average of the fundamental importance of the experimentally measured CH4 and the actual values of gas concentration measured in the test. This paper calculates concentrations in ppm when using MAE, RMSE, and MAPE evaluation indexes.

4.2. Comparison Experiment

To verify the effectiveness of the ISSA-BP model in temperature compensation comparatively, we compare and analyze it with existing widely used SVM, Random Forest, BP, and PSO-BP temperature compensation models, respectively. The results of the comparison experiments are shown in Table 4. The table shows that the neural network-based temperature compensation model predictions are distributed on both sides of the standard concentration. The random forest model outperforms the SVM and basic BP neural network models, but the error is larger than the PSO-BP and ISSA-BP models. The predictions of the ISSA-BP temperature compensation model are concentrated near the standard values, and its projections and errors are much better than those of the other models.
The model evaluation results in Table 5 show that the MAE, MAPE, and RMSE of the test samples of SVM, BP, and RF models are much higher than those of the training samples, while the R2 is significantly lower than that of the training samples. This indicates that these three models overfit the data during training, resulting in reduced generalization ability and stability and increased error. In contrast, the prediction results of the training and test sets of the ISSA-BP neural network-based temperature compensation model are the same. This indicates that the ISSA-BP model has better learning ability and robustness.

4.3. Ablation Experiments

4.3.1. Experimental Results before and after Data Preprocessing

To verify the effect of data preprocessing on the temperature compensation results. The prediction effect of the model before and after data preprocessing is compared and experimentally verified. A comparison of the 50 sets of predicted values near the maximum relative error for each concentration is shown in Figure 8a–c. It can be seen that the prediction of the test set has been improved more after using the IIForest algorithm to remove the outlier data from the training set. Its predicted values are closer to the standard concentrations. The prediction effect of the ISSA-BP model has been significantly improved after data preprocessing. The maximum values expected for each concentration before data preprocessing were 0.5088%, 2.0286%, and 8.1379%, respectively. After data preprocessing, the maximum values predicted by each concentration were 0.5049%, 2.0182%, and 8.0764%, respectively.
The model evaluation index in Table 6 shows that the temperature compensation based on the ISSA-BP Neural Network has better stability and generalization ability. The difference between the evaluation indexes of its prediction effect in the test and training sets is slight. The MAPE values of the training and test sets before and after data preprocessing were reduced by 0.5890% and 0.6160%.

4.3.2. ISSA-BP Ablation Experiments

To further validate the scientific validity of the proposed ISSA-BP temperature compensation model. This section investigates different optimization approaches based on this model, and ablation experiments are carried out on large-scale datasets with different temperatures and concentrations, as follows:
Baseline: Directly use the improved BP neural network to build a temperature compensation model to achieve a laser methane sensor’s predicted output with different temperatures and concentrations.
+Adam optimizer: To solve the BP neural network problem, which has a slow convergence speed and quickly falls into the local optimum, the Adam optimizer is introduced to improve the BP neural network.
+SSA: Due to the Adam-BP temperature compensation model, the Adam optimizer cannot optimize the parameters of the BP neural network well when the value of the loss function Loss is decreasing fast. Therefore, the introduction of SSA is considered for iterative optimization of the weights and thresholds of the BP neural network when the Loss value of the temperature compensation model decreases faster.
Our proposed ISSA-BP Neural Network: To address the shortcomings of the standard SSA algorithm’s global optimization search and local development capabilities. Optimized BP neural networks using our proposed ISSA and Adam algorithms are used to build temperature compensation models, and model validation and evaluation are performed on the established large-scale data.
The comparison of the corrected results of each model with the actual values is shown in Figure 9. From the figure, it can be seen that the ISSA-BP temperature compensation model has the best prediction accuracy and stability on the retraining set and the test and training set.
Table 7 lists the highest and lowest predicted values of the three sets of untrained CH4 experimental test samples at different temperature intervals of the concentration. As can be seen from the data distribution in the table, there is a slight difference in the prediction effect of the several groups of temperature compensation models performing ablation experiments at room temperature conditions. However, there is a significant gap in the compensation effect for the laser methane sensor’s high- and low-temperature data. With the step-by-step optimization of the model, the prediction effect of the ISSA-BP temperature compensation model reaches the best, and the prediction value fluctuates stably between the standard concentrations.
Figure 10a–c shows the comparison of the results of 50 sets of prediction samples near the maximum relative error after temperature compensation using four temperature compensation models. The ISSA-BP temperature compensation model results are concentrated on both sides of the standard concentration, and the predicted values fluctuate steadily on both sides of the standard value.
Figure 11a shows a histogram of the RMSE for the training and testing samples and the four models, while Figure 11b shows a histogram of the correlation coefficient R2. As shown in Table 8, to compare the modified performance of each model, the MAE, MAPE, RMSE, and R2 of the training and testing samples were calculated for the four models and original data. The MAE, MAPE, and RMSE of the Adam-BP model were more significant than those of the SSA-BP model in both the training and testing phases, and the R2 was smaller than the SSA-BP model, indicating that the nonlinear fitting performance of the Adam-BP model was not ideal. In the testing phase, the MAE, MAPE, RMSE, and R2 of the SSA-BP model differed less from the training phase, but the error was more significant, and the R2 was relatively small.
However, the deviations of MAE, MAPE, and RMSE of the ISSA-BP temperature compensation model in the test phase were all less different from the results of the training phase, and no large overfitting was found. Compared with the original measurement errors, the training samples predicted results with 52.0644 ppm lower MAE, 15.1463% lower MAPE, 61.5973 lower RMSE, and 0.1264 higher R2. The test samples indicated effects with 52.0172 ppm lower MAE, 15.5535% lower MAPE, 62.5873 lower RMSE, and 0.1227 higher R2. From the overall performance, the ISSA-BP model has a low error, stable model output, high generalization, and high stability. Therefore, the ISSA-BP temperature compensation model has higher prediction accuracy and better equilibrium. The system meets the requirement of compensating for detecting CH4 gas concentration under significant temperature variations.
Figure 12a shows the histogram of the distribution of relative errors predicted by the ISSA-BP model. Figure 12b compares experimental data and relative errors of the above four models after compensation for 0.5% standard CH4 concentration under different temperature conditions. The experimental results show that the relative error between the predicted value and the standard concentration value of the temperature compensation model using ISSA-BP is significantly reduced, and the gas concentration fluctuates within a small range. Based on the above comparison and analysis, the ISSA-BP model is suitable for temperature compensation of CH4 gas detection based on TDLAS technology, and the reliability of the system measurement is significantly improved.

4.4. Algorithm Utility Analysis

In order to further explore the practical application capability of the temperature compensation model algorithm proposed in the article, we chose the BP neural network, which is suitable for embedded hardware implementation, as the basis and analyzed in detail the performance of the ISSA-BP neural network model in practical applications. Considering the importance of the number of parameters, operational complexity, and inference speed of the established temperature compensation model for practical applications, we conducted the following comprehensive analysis as follows:
  • Number of operational parameters. According to the analysis in Section 3.1, the ISSA-BP neural network temperature compensation model contains two input layer neurons, five hidden layer neurons, and one output layer neuron. Every two connected neurons have operational parameters for weights, and neurons in the remote and output layers contain operational threshold parameters. A smaller number of parameters means lower model complexity and faster training speed, which helps reduce the risk of model overfitting and facilitates deployment in environments with limited hardware computing resources.
  • Number of model operations. In the neural network model structure, each connected neuron node performs a multiplication operation with the neural network weights and an addition operation with the threshold value. Therefore, our proposed temperature compensation model requires 15 multiplication operations, six addition operations, and six operations of the activation function during forward propagation. This indicates that the model can enhance its nonlinear fitting ability by activating the function in the operation and showing high computational efficiency, which is suitable for scenarios requiring fast response.
  • Inference speed and practical application. The hardware temperature compensation based on the ISSA-BP model structure takes only about 40 milliseconds to compute the prediction process on an MCU chip running at 8 MHz. This short prediction inference time is suitable for real-time application environments, and different hardware devices will also exhibit different inference speeds.
  • Hardware compatibility. The model’s simplicity implies lower hardware requirements, making it easier to deploy on various devices, including in environments such as embedded systems.
As shown in Table 9, the above analysis concludes that the temperature compensation model based on the ISSA-BP neural network architecture has good practical advantages regarding the number of parameters, computational efficiency, hardware compatibility, and so on. The model is suitable for application scenarios requiring fast response, such as real-time temperature compensation or pressure compensation of laser methane sensors.

5. Discussion and Conclusions

This paper proposes a temperature compensation method based on the ISSA-BP Neural Network model and a large-scale measured high- and low-temperature methane gas dataset. The prediction accuracy of the temperature compensation of the laser methane sensor under a wide range of temperature application conditions is improved. Firstly, the improved isolation forest algorithm is used to eliminate the outliers in the laser methane sensor data training set under high- and low-temperature conditions to reduce the influence of data noise on the training effect of the temperature compensation model. Secondly, the BP neural network is improved regarding the weight updating method. The original S-type activation function is replaced with the Mish activation function, and the improved BP neural network is optimized using the ISSA and Adam algorithms. The prediction performance and generalization ability of temperature compensation are greatly improved. Finally, the model’s applicability in the field of temperature compensation of laser methane sensors is verified by the established 15,810 sets of experimental data. The experimental results show that the linear regression coefficients of the temperature compensation model selected based on IIForest outlier detection and ISSA-BP neural network for the training and test sets reach 0.9997 and 0.9996, respectively. Compared with other temperature compensation models, the proposed method achieves higher prediction accuracy and more vital generalization ability, illustrating its effectiveness.

Author Contributions

Conceptualization, X.Z.; methodology, X.Z.; validation, S.Y., Y.C. and Y.L.; formal analysis, S.Y., Y.C. and X.Z.; investigation, Y.L.; writing—original draft preparation, X.Z.; writing—review and editing, S.Y. and Y.C. All authors have read and agreed to the published version of the manuscript.

Funding

Key Research Development Program of Anhui Province, grant number 2023g07020001, and the Open Project of Hefei Institute of Public Security, Tsinghua University, grant number QHHFYKF202202.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

Songfeng Yin and Yue Cheng are employed by Hefei Tsingsensor Technology Co., Ltd. The remaining authors declare that they did not have any business or financial relationships that could be perceived as a potential conflict of interest at the time of the study.

References

  1. Wang, S.; Xiao, G.; Mi, H.; Feng, Y.; Chen, J. Experimental and numerical study on flame fusion behavior of premixed hydrogen/methane explosion with two-channel obstacles. Fuel 2023, 333, 126530. [Google Scholar] [CrossRef]
  2. Zhang, Z.; Pang, T.; Yang, Y.; Xia, H.; Cui, X.; Sun, P.; Bian, W.; Yu, W.; Markus, W.S.; Dong, F. Development of a tunable diode laser absorption sensor for online monitoring of industrial gas total emissions based on optical scintillation cross-correlation technique. Opt. Express 2016, 24, A943–A955. [Google Scholar] [CrossRef]
  3. Ma, C.; Wang, Z.; Xu, J.; Tan, G.; Lv, Z.; Zhu, Q. Development and Application of Gas Production Measurement System of Coal-Rock under Temperature–Pressure Coupling. Sensors 2022, 22, 6776. [Google Scholar] [CrossRef]
  4. Wittstock, V.; Scholz, L.; Bierer, B.; Perez, A.O.; Wöllenstein, J.; Palzer, S. Design of a LED-based sensor for monitoring the lower explosion limit of methane. Sens. Actuators B Chem. 2017, 247, 930–939. [Google Scholar] [CrossRef]
  5. Huang, L.; Li, Z.; Wang, Y.; Zhang, L.; Su, Y.; Zhang, Z.; Ren, S. Experimental assessment on the explosion pressure of CH4-Air mixtures at flammability limits under high pressure and temperature conditions. Fuel 2021, 299, 120868. [Google Scholar] [CrossRef]
  6. Wang, G.; Mei, J.; Tian, X.; Liu, K.; Tan, T.; Chen, W.; Gao, X. Laser frequency locking and intensity normalization in wavelength modulation spectroscopy for sensitive gas sensing. Opt. Express 2019, 27, 4878–4885. [Google Scholar] [CrossRef]
  7. Dang, J.; Kong, L.; Zheng, C.; Wang, Y.; Sun, Y.; Yu, H. An open-path sensor for simultaneous atmospheric pressure detection of CO and CH4 around 2.33 μm. Opt. Lasers Eng. 2019, 123, 1–7. [Google Scholar] [CrossRef]
  8. Cui, X.; Dong, F.; Zhang, Z.; Sun, P.; Xia, H.; Fertein, E.; Chen, W. Simultaneous detection of ambient methane, nitrous oxide, and water vapor using an external-cavity quantum cascade laser. Atmos. Environ. 2018, 189, 125–132. [Google Scholar] [CrossRef]
  9. Zhao, L.; Du, Y.; Wang, W.; Shang, C.; Naren, Q. Progress on Monitoring Methods of Atmospheric Greenhouse Gases. Meteorol. Environ. Res. 2022, 13, 14–24. [Google Scholar]
  10. Seymour, S.P.; Festa-Bianchet, S.A.; Tyner, D.R.; Johnson, M.R. Reduction of Signal Drift in a Wavelength Modulation Spectroscopy-Based Methane Flux Sensor. Sensors 2022, 22, 6139. [Google Scholar] [CrossRef]
  11. Shemshad, J.; Aminossadati, S.M.; Kizil, M.S. A review of developments in near infrared methane detection based on tunable diode laser. Sens. Actuators B Chem. 2012, 171, 77–92. [Google Scholar] [CrossRef]
  12. Zhao, P.; Ho, H.L.; Jin, W.; Fan, S.; Gao, S.; Wang, Y. Hollow-core fiber photothermal methane sensor with temperature compensation. Opt. Lett. 2021, 46, 2762–2765. [Google Scholar] [CrossRef]
  13. Kazemi, N.; Abdolrazzaghi, M.; Musilek, P.; Daneshmand, M. A temperature-compensated high-resolution microwave sensor using artificial neural network. IEEE Microw. Wirel. Compon. Lett. 2020, 30, 919–922. [Google Scholar] [CrossRef]
  14. Zhang, G.; Liu, J.; Xu, Z.; He, Y.; Kan, R. Characterization of temperature non-uniformity over a premixed CH4–air flame based on line-of-sight TDLAS. Appl. Phys. B 2016, 122, 3. [Google Scholar] [CrossRef]
  15. Xu, L.; Zhirong, Z.; Pengshuai, S.; Lewen, Z.; Tao, P.; Hua, X.; Bian, W.; Zhifeng, S.; Chimin, S. Design of high precision temperature and pressure closed-loop control system for methane carbon isotope ratio measurement by laser absorption spectroscopy. Pol. J. Environ. Stud. 2022, 31, 969. [Google Scholar] [CrossRef]
  16. Aldhafeeri, T.; Tran, M.K.; Vrolyk, R.; Pope, M.; Fowler, M. A review of methane gas detection sensors: Recent developments and future perspectives. Inventions 2020, 5, 28. [Google Scholar] [CrossRef]
  17. Liu, X.; Qiao, S.; Han, G.; Liang, J.; Ma, Y. Highly sensitive HF detection based on absorption enhanced light-induced thermoelastic spectroscopy with a quartz tuning fork of receive and shallow neural network fitting. Photoacoustics 2022, 28, 100422. [Google Scholar] [CrossRef] [PubMed]
  18. Zhang, L.; Wang, R.L.; Liu, K.K. Study on errors correction of infrared methane sensor based on Support Vector Machines. In Proceedings of the 2009 Second International Conference on Intelligent Computation Technology and Automation, Changsha, China, 10–11 October 2009; Volume 2, pp. 471–475. [Google Scholar]
  19. Xu, P.; Song, K.; Xia, X.; Chen, Y.; Wang, Q.; Wei, G. Temperature and humidity compensation for MOS gas sensor based on random forests. In Intelligent Computing, Networked Control, and Their Engineering Applications; Springer: Berlin/Heidelberg, Germany, 2017; pp. 135–145. [Google Scholar]
  20. Wang, H.; Zhang, W.; You, L.; Yuan, G.; Zhao, Y.; Jiang, Z. Back propagation neural network model for temperature and humidity compensation of a non dispersive infrared methane sensor. Instrum. Sci. Technol. 2013, 41, 608–618. [Google Scholar] [CrossRef]
  21. Li, M.; Xin, F.; Shuo, Z.; Wei, W.; Gao, M. Research on CH4 gas detection and temperature correction based on TDLAS technology. Spectrosc. Spectr. Anal. 2021, 41, 3625–3631. [Google Scholar]
  22. Ding, Z.; Fei, M. An anomaly detection approach based on isolation forest algorithm for streaming data using sliding window. IFAC Proc. Vol. 2013, 46, 12–17. [Google Scholar] [CrossRef]
  23. Xue, J.; Shen, B. A novel swarm intelligence optimization approach: Sparrow search algorithm. Syst. Sci. Control Eng. 2020, 8, 22–34. [Google Scholar] [CrossRef]
  24. Zhang, C.; He, Y.; Qiao, S.; Ma, Y. Differential integrating sphere-based photoacoustic spectroscopy gas sensing. Opt. Lett. 2023, 48, 5089–5092. [Google Scholar] [CrossRef] [PubMed]
  25. Yoder, J.; Priebe, C.E. Semi-supervised k-means++. J. Stat. Comput. Simul. 2017, 87, 2597–2608. [Google Scholar] [CrossRef]
  26. Yang, H.; Bu, X.; Song, Y.; Shen, Y. Methane concentration measurement method in rain and fog coexisting weather based on TDLAS. Measurement 2022, 204, 112091. [Google Scholar] [CrossRef]
  27. Azimirad, E.; Movahhed Ghodsinya, S.R. Design of an electronic system for laser methane gas detectors using the tunable diode laser absorption spectroscopy method. J. Laser Appl. 2022, 34, 022020. [Google Scholar] [CrossRef]
  28. Wang, Y.; Wang, X. Temperature Compensation Algorithm of Air Quality Monitoring Equipment Based on TDLAS. Mathematics 2023, 11, 2656. [Google Scholar] [CrossRef]
  29. Zhang, R.; Duan, Y.; Zhao, Y.; He, X. Temperature compensation of elasto-magneto-electric (EME) sensors in cable force monitoring using BP neural network. Sensors 2018, 18, 2176. [Google Scholar] [CrossRef] [PubMed]
  30. Fan, Q.; Chen, Z.; Xia, Z. A novel quasi-reflected Harris hawks optimization algorithm for global optimization problems. Soft Comput. 2020, 24, 14825–14843. [Google Scholar] [CrossRef]
  31. Braik, M.S. Chameleon Swarm Algorithm: A bio-inspired optimizer for solving engineering design problems. Expert Syst. Appl. 2021, 174, 114685. [Google Scholar] [CrossRef]
  32. Bhullar, A.K.; Kaur, R.; Sondhi, S. Optimization of fractional order controllers for AVR system using distance and levy-flight based crow search algorithm. IETE J. Res. 2022, 68, 3900–3917. [Google Scholar] [CrossRef]
  33. Bojnordi, E.; Mousavirad, S.J.; Pedram, M.; Schaefer, G.; Oliva, D. Improving the Generalisation Ability of Neural Networks Using a Lévy Flight Distribution Algorithm for Classification Problems. N. Gener. Comput. 2023, 41, 225–242. [Google Scholar] [CrossRef]
  34. Wang, L.; Cao, Q.; Zhang, Z.; Mirjalili, S.; Zhao, W. Artificial rabbits optimization: A new bio-inspired meta-heuristic algorithm for solving engineering optimization problems. Eng. Appl. Artif. Intell. 2022, 114, 105082. [Google Scholar] [CrossRef]
  35. Yi, D.; Ahn, J.; Ji, S. An effective optimization method for machine learning based on ADAM. Appl. Sci. 2020, 10, 1073. [Google Scholar] [CrossRef]
Figure 1. Experimental equipment for testing the effect of temperature on CH4 gas concentration.
Figure 1. Experimental equipment for testing the effect of temperature on CH4 gas concentration.
Sensors 24 00493 g001
Figure 2. High and low-temperature experimental equipment of laser methane sensor: (a) Photo of laser methane sensor; (b) High and low-temperature calibration.
Figure 2. High and low-temperature experimental equipment of laser methane sensor: (a) Photo of laser methane sensor; (b) High and low-temperature calibration.
Sensors 24 00493 g002
Figure 3. IIForest algorithm outlier detection results: (a) 2% CH4 gas concentration data clustering classification and outlier detection effect map; (b) IIForest algorithm rating scores for 2% CH4 gas concentration data.
Figure 3. IIForest algorithm outlier detection results: (a) 2% CH4 gas concentration data clustering classification and outlier detection effect map; (b) IIForest algorithm rating scores for 2% CH4 gas concentration data.
Sensors 24 00493 g003
Figure 4. ISSA-BP Neural Network temperature compensation model structure.
Figure 4. ISSA-BP Neural Network temperature compensation model structure.
Sensors 24 00493 g004
Figure 5. The update method of the step length factor L as the number of iterations increases.
Figure 5. The update method of the step length factor L as the number of iterations increases.
Sensors 24 00493 g005
Figure 6. Test unimodal and multimodal function results: (a) Schwefel’s Problem function iteration curve; (b) Rastigin function iteration curve.
Figure 6. Test unimodal and multimodal function results: (a) Schwefel’s Problem function iteration curve; (b) Rastigin function iteration curve.
Sensors 24 00493 g006
Figure 7. ISSA-BP temperature compensation model prediction flowchart.
Figure 7. ISSA-BP temperature compensation model prediction flowchart.
Sensors 24 00493 g007
Figure 8. Comparison of model prediction effect before and after data preprocessing: (a) prediction results of 0.5% CH4 concentration; (b) prediction results of 2% CH4 concentration; (c) prediction results of 8% CH4 concentration.
Figure 8. Comparison of model prediction effect before and after data preprocessing: (a) prediction results of 0.5% CH4 concentration; (b) prediction results of 2% CH4 concentration; (c) prediction results of 8% CH4 concentration.
Sensors 24 00493 g008
Figure 9. Comparison of corrected results and actual values for four models and the training and testing samples: (a) training samples; (b) testing samples.
Figure 9. Comparison of corrected results and actual values for four models and the training and testing samples: (a) training samples; (b) testing samples.
Sensors 24 00493 g009
Figure 10. BP, Adam-BP, SSA-BP, and ISSA-BP temperature compensation model prediction output: (a) prediction results of 0.5% CH4 concentration; (b) prediction results of 2% CH4 concentration; (c) prediction results of 8% CH4 concentration.
Figure 10. BP, Adam-BP, SSA-BP, and ISSA-BP temperature compensation model prediction output: (a) prediction results of 0.5% CH4 concentration; (b) prediction results of 2% CH4 concentration; (c) prediction results of 8% CH4 concentration.
Sensors 24 00493 g010
Figure 11. Histogram of RMSE and R2 for training and testing the four models: (a) Histogram of RMSE for training and testing samples; (b) Histogram of R2 for training and testing samples.
Figure 11. Histogram of RMSE and R2 for training and testing the four models: (a) Histogram of RMSE for training and testing samples; (b) Histogram of R2 for training and testing samples.
Sensors 24 00493 g011
Figure 12. Analysis of data for methane gas temperature compensation: (a) Histogram of the prediction error of ISSA-BP model; (b) Comparison of model predictions for CH4 gas at 0.5%.
Figure 12. Analysis of data for methane gas temperature compensation: (a) Histogram of the prediction error of ISSA-BP model; (b) Comparison of model predictions for CH4 gas at 0.5%.
Sensors 24 00493 g012
Table 1. Differentiation of training and test data samples.
Table 1. Differentiation of training and test data samples.
DatasetsTemperatureConcentration/%Samples
Training samples−20~−10 °CMeasured values of 2% and 8.0% CH4 concentration2800
15~30 °C2800
55~65 °C2800
Test samples−20~0 °CMeasured values of 0.5%, 2.0% and 8.0% CH4 concentration2470
10~30 °C2470
40~65 °C2470
Table 2. Data distribution of the training set after outlier removal.
Table 2. Data distribution of the training set after outlier removal.
DatasetsTemperatureConcentration/%Samples
Training samples−20~−10 °CMeasured values of 2% and 8.0% CH4 concentration2653
15~30 °C2694
55~65 °C2660
Table 3. Cyclic test results of different hidden layer nodes.
Table 3. Cyclic test results of different hidden layer nodes.
Nodes34567
MSE2.95 × 10−32.32 × 10−43.23 × 10−59.61 × 10−54.33 × 10−4
Table 4. CH4 concentration output predicted value after temperature compensation.
Table 4. CH4 concentration output predicted value after temperature compensation.
CH4
Concentration
AlgorithmPredicted Value of CH4 Concentration/%
−20~0 °C10~30 °C40~65 °C
0.5%SVM0.5178~0.54650.4911~0.50890.4568~0.5141
BP0.5147~0.54110.4863~0.50810.4632~0.5125
Random Forest0.5102~0.52510.4931~0.50760.4687~0.5098
PSO-BP0.5067~0.51130.4972~0.50410.4887~0.5052
ISSA-BP0.4991~0.50490.4996~0.50340.4955~0.5025
2.0%SVM2.0623~2.16011.9963~2.01101.8633~2.0953
BP2.0798~2.14931.9981~2.00941.8895~2.0866
Random Forest2.0312~2.10221.9961~2.01121.9411~2.0791
PSO-BP2.0192~2.05111.9933~2.00981.9883~2.0252
ISSA-BP1.9921~2.01821.9992~2.01051.9803~2.0098
8.0%SVM8.1088~8.52627.9813~8.01667.5351~8.1211
BP8.0994~8.49837.9877~8.01607.6043~8.1088
Random Forest8.0692~8.36887.9828~8.01587.7102~8.0868
PSO-BP8.0594~8.20037.9891~8.01367.8866~8.0534
ISSA-BP7.9893~8.07647.9916~8.01237.9228~8.0398
Table 5. Performance evaluation index of five temperature compensation models.
Table 5. Performance evaluation index of five temperature compensation models.
ModelMAE (ppm)MAPE (%)RMSE (ppm)R2 (%)
TrainingTestingTrainingTestingTrainingTestingTrainingTesting
SVM15.374322.98783.45847.094719.016128.23630.97890.9669
BP15.156021.68883.27686.625318.689224.16910.98410.9722
Random Forest13.774317.16582.92765.424115.681619.26360.98750.9788
PSO-BP6.72349.01972.40414.46619.451511.31610.98910.9872
ISSA-BP1.28131.45250.27210.29612.31012.54150.99970.9996
Table 6. Indicators for model evaluation before and after data preprocessing.
Table 6. Indicators for model evaluation before and after data preprocessing.
ExperimentMAE (ppm)MAPE (%)RMSER2 (%)
TrainingTestingTrainingTestingTrainingTestingTrainingTesting
Before preprocessing2.67932.76550.86110.91213.91234.12110.99950.9993
After preprocessing1.28131.45250.27210.29612.31012.54150.99970.9996
Table 7. Predicted output of CH4 concentration for ablation experiments.
Table 7. Predicted output of CH4 concentration for ablation experiments.
CH4 ConcentrationAlgorithmPredicted Value of CH4 Concentration/%
−20~0 °C10~30 °C40~65 °C
0.5%BP0.5138~0.53560.4913~0.50770.4682~0.4965
Adam-BP0.5061~0.51980.4975~0.50520.4839~0.5093
SSA-BP0.5022~0.50930.4991~0.50580.4916~0.4985
ISSA-BP0.4991~0.50490.4996~0.50310.4955~0.5025
2.0%BP2.0541~2.12151.9896~2.01041.9033~2.0621
Adam-BP1.9872~2.08131.9965~2.00961.9104~2.0224
SSA-BP1.9951~2.05631.9988~2.00841.9462~2.0156
ISSA-BP1.9921~2.01821.9992~2.00811.9803~2.0098
8.0%BP8.0681~8.40567.9877~8.01437.6043~8.0988
Adam-BP8.0264~8.26037.9869~8.01267.7565~8.0401
SSA-BP8.0212~8.14527.9901~8.01247.8688~8.0416
ISSA-BP7.9893~8.07647.9916~8.01237.9228~8.0398
Table 8. Performance evaluation index of four temperature compensation models.
Table 8. Performance evaluation index of four temperature compensation models.
ModelMAE (ppm)MAPE (%)RMSER2 (%)
TrainingTestingTrainingTestingTrainingTestingTrainingTesting
Original53.345753.469715.418415.849663.907465.12880.87330.8769
BP10.031713.70183.84554.706918.915619.90670.98910.9876
Adam-BP6.38087.76592.44423.578410.496311.67710.99130.9890
SSA-BP3.36563.5381.16381.20935.90816.51660.99830.9952
ISSA-BP1.28131.45250.27210.29612.31012.54150.99970.9996
Table 9. Analysis of parameter operations based on ISSA-BP neural network model architecture.
Table 9. Analysis of parameter operations based on ISSA-BP neural network model architecture.
Practicality AnalysisDescriptionsValue
Number of parametersTotal number of weights and bias values in the model21
Additive and multiplicative operationsTotal number of multiplication and addition operations during forward propagation21
Activation function operationNumber of operations using the activation function6
Forecasted timeTime taken to complete one temperature compensation prediction40 ms
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Yin, S.; Zou, X.; Cheng, Y.; Liu, Y. Temperature Compensation of Laser Methane Sensor Based on a Large-Scale Dataset and the ISSA-BP Neural Network. Sensors 2024, 24, 493. https://doi.org/10.3390/s24020493

AMA Style

Yin S, Zou X, Cheng Y, Liu Y. Temperature Compensation of Laser Methane Sensor Based on a Large-Scale Dataset and the ISSA-BP Neural Network. Sensors. 2024; 24(2):493. https://doi.org/10.3390/s24020493

Chicago/Turabian Style

Yin, Songfeng, Xiang Zou, Yue Cheng, and Yunlong Liu. 2024. "Temperature Compensation of Laser Methane Sensor Based on a Large-Scale Dataset and the ISSA-BP Neural Network" Sensors 24, no. 2: 493. https://doi.org/10.3390/s24020493

APA Style

Yin, S., Zou, X., Cheng, Y., & Liu, Y. (2024). Temperature Compensation of Laser Methane Sensor Based on a Large-Scale Dataset and the ISSA-BP Neural Network. Sensors, 24(2), 493. https://doi.org/10.3390/s24020493

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop