# Research on Underground Chemical Gas Monitoring and Target Location Based on an Improved Moth Flame Algorithm

Authors: Chunmei Tu; Guobin Chen
Journal: Journal of Sensors
 (2021)

---

## Abstract

The danger of downhole work is mainly due to the chemical toxic gases and flammable gases NO2, CO, SO2, H2S, CH4, CO2, etc. When the concentration reaches a certain value, it will produce very great harm. With the continuous development of sensor technology and communication technology, it is necessary to monitor the relevant geographic features below the ground. Because of the complex environmental parameters of the coal mine roadway and the interference caused by various electrical equipment, the transmission of mine electromagnetic signals will be affected, resulting in low positioning accuracy. However, the underground chemical gas leakage leads to the life of underground workers which cannot be guaranteed, so it is necessary to effectively monitor the concentration of chemical gas components in underground mines. In this paper, a moth flame algorithm based on optimized inertia weights is proposed. By continuously improving the local inertia weights, the global optimum is determined by using the change of inertia weights in the iterative process of the algorithm. By testing the convergence and optimal value of several algorithms under common test functions, IMFO can obtain the global optimal solution. Finally, the concentrations of chemical gases NO2, CO, SO2, H2S, CH4, and CO2 are monitored by setting specific areas to see if they reach the early warning values. Then, 16 coordinates in the region are used to predict the above method, and the IMFO algorithm can achieve the best prediction effect.


---

## Body

## 1. Introduction

Because the mining operation of coal resources is below the ground and has high harmfulness, there are still hundreds of people who pay their lives due to coal mining every year, and major accidents often occur. With the continuous development of sensor technology and communication technology, it has become a realistic need to monitor the relevant geographic feature information below the ground. Nowadays, with the development of wireless sensor network communication technology, smart mines also appear and Zigbee technology, radio frequency identification technology, WiFi network technology, and UWB technology are also gradually put into use in mine environment. Due to the complex environmental parameters of the coal mine roadway and the interference caused by various electrical equipment, the transmission of mine electromagnetic signals will be affected, resulting in low positioning accuracy [1]. Therefore, the wireless sensor network technology and algorithm used to realize accurate mine positioning are an important research direction of the mine positioning system at present. Whether the massive data generated under the above technical background can accurately measure the specific position has become a hot spot in the research of the positioning algorithm. Therefore, how to build a complete and reliable wireless sensor network combined with the actual positioning algorithm to complete the real-time positioning of underground personnel is an important issue in current research [2].Considering the difference in testing accuracy and model mismatch between noise positioning algorithms [3], a nonlinear fading filtering algorithm with a single fading factor is proposed to remove noise, and the sensitivity of the algorithm is improved by combining the least square algorithm. The results show that the positioning accuracy is better than Kalman filtering. The weights of different positioning algorithms are fused by fuzzy theory [4], and then, the positioning information is predicted by the weighted average method. The weights of three different positioning methods are applied to dynamically adjust the covariance of measurement noise. On the other hand, based on the theoretical model of wireless transmission signals, the weighted average value of the attenuation index of signal transmission paths is obtained periodically and optimized in combination with the genetic algorithm. This method is an intelligent swarm algorithm, a hot issue studied [5]. A large number of calculations by the genetic algorithm in underground environment lead to low search efficiency and poor stability in the later stage of evolution. In PSO [6], each particle in the best position is used to give inertia weights of different dimensions, different particles have different tasks, and the acceleration parameters of PSO are determined by different adaptive weights. Using the correlation sequencing function, the algorithm is tested, and the performance advantage of the proposed method is obvious in convergence speed. Considering that the underground environment is complex and affects the weighted centroid positioning [7], the genetic algorithm is used to optimize the weighting, and the improved method is superior to the traditional method in accuracy. In order to improve the positioning accuracy, a gradient enhanced regression tree positioning algorithm [8] is proposed, which fuses the positioning results of the KNN, random forest, SVM, and multilayer regression algorithm. It can see that the fused positioning can better improve the positioning accuracy of the algorithm. Aiming at the problem of low matching positioning accuracy such as MSD and MAD [9], the MPMD matching algorithm based on the feature vector product is used to improve positioning accuracy, and the results are better in error and pit noise. In view of the blind areas in the mining and monitoring of underground coal resources, document [10] proposes an improved DV-Hop positioning and monitoring system, which can accurately track personal operations, calculate the distance per jump of anchor nodes, and collect relevant operation safety data. To improve the positioning accuracy, ensure the safety of personnel and improve the production level underground in complex environment. In the wireless network environment, especially in the narrow underground space and complex working environment, there is a contradiction between its positioning error and wireless broadband. Literature [11] proposes a positioning algorithm based on PSO and Taylor-D. PSO provides optimized coordinate information, thus further reducing the positioning error and obtaining higher positioning accuracy. Literature [12] is aimed at the problems of unstable WLAN information and low positioning accuracy in narrow space; it is proposed to fuse GPS and WLAN data information, sample the integrated data, and realize particle weight by combining the Kalman filter and map. Thus, the advantages of GPS and WLAN positioning are realized, and the positioning accuracy is improved.Inspired by moth navigation in nature, Mirjalili proposed a moth flame optimization algorithm (MFO) in 2015 [13], which is based on moth behavior and achieves a good balance between exploration and development through a special mechanism called lateral directional navigation to obtain global optimization performance. Because of the high efficiency of MFO in optimization, it has many applications in many fields and the effect is better [14]. Literature [15] constantly updates the flame position by adjusting the weight function, so as to achieve the goal of global optimization. Constantly accelerate the convergence efficiency, and calculate the adaptive value to infer the optimal position. Experiments show that the improved MFO algorithm can get the global optimization and the best performance in path optimization. Literature [16] proposes an improved IMFO based on exploration/development rate control in the field of machine learning for feature selection. Literature [17, 18] proposed a moth flame algorithm and solved the engineering optimization problem successfully. The improved MFO algorithm has achieved good results in specific applications. However, it must be admitted that, in solving complex peak function optimization problems, it is necessary to design a new improved MFO algorithm to improve the global optimization performance of MFO, aiming at the problem that MFO is easy to fall into local optimization and leads to low global search accuracy. In view of the difficulty in predicting the underground location, this paper puts forward an improved IMFO algorithm to improve the prediction accuracy of the underground geographical location. The algorithm can solve the problem of low position prediction accuracy and can improve the position prediction accuracy in different spaces. The above research is based on the position prediction in two-dimensional space or the existence of insufficient accuracy. At present, the accuracy of geographical position prediction is insufficient, and it is impossible to predict effectively in three-dimensional space. The second part introduces the MFO algorithm and explains the algorithm flow. In the third part, there are some problems in improving MFO, and the linear decreasing inertia weight adjustment strategy is used to improve MFO algorithm. In the fourth part, the performance of the improved IMFO algorithm is compared with those of other algorithms.


## 2. Moth Flame Optimization Algorithm

### 2.1. Population Initialization

In order to be able to simply describe the MFO algorithm, the moth as an individual is in the optimal position in the solution space. By continuously optimizing the position, we can achieve the goal of global optimization. The MFO model is described by(1)M=m1,m2,⋯,mnT,wheremi=mi,1,mi,2,⋯,mi,dT,wheren is moths’ number and d is the dimension of the optimization problem. The individual fitness value of moths is stored in the OM matrix:
(2)OM=OM1OM2⋯OMnT.The flame is the optimal position obtained in the local area. Formula (3) describes the optimal position relationship, and the adaptive value is described by OF.
(3)F=f1,f2,⋯,fnT,wherefi=fi,1,fi,2,⋯,fi,dT,(4)OF=OF1OF2⋯OFnT.


### 2.2. Location Update Mechanism

In the process of position optimization of the MFO algorithm, moonlight is used for positioning and navigation. However, moths are prone to fall into artificially set nonmoonlight navigation, which leads to the wrong position. In daily life, moths fly spirally under the light. This characteristic behavior puts forward the MFO algorithm, and moths constantly update their position relationship through moonlight navigation, so that they can search for the best position scheme.(1)
Flame catching behavior: mothMj, which has phototactic characteristics in nature, will move towards the nearest light (flame) Fj. Choose the logarithmic spiral described in equation (5) as the moving track of moth catching flame:(5)SMi,Fj=Di⋅ebt⋅cos2πt+Fj,whereSMi,Fj is the updated moth position, b is a constant, t is a random number from -1 to 1, t=−1 is the closest to the flame, and t=1 is the farthest from the flame. Di=Fj−Mi is the distance between moths Mj and flames Fj, that is, the step length.
(2)
Abandoning flame: MFO constantly adjusts the adaptive value to reach an optimal position, and its flame is constantly decreasing as described by(6)noflame=roundN−t×N−1T.In this,t represents the local maximum iteration number, T represents the global maximum iteration number, and N represents the maximum flame number. Local search is to continuously update the location information of subpopulations to get the optimal location solution. Formula (7) is as follows:
(7)Di=rand∗xF−xM,i=1,2,⋯,m,xb=xb+Di,−Dmin≤Di≤Dmax;i=1,2,⋯,m,whereDi∈0,1 and Dmin and Dmax denote the minimum and maximum moving steps. Di is the offset of position update and constantly adjusts the current position, so as to achieve a certain position offset during position search, which is more conducive to achieving global optimization.


## 2.1. Population Initialization

In order to be able to simply describe the MFO algorithm, the moth as an individual is in the optimal position in the solution space. By continuously optimizing the position, we can achieve the goal of global optimization. The MFO model is described by(1)M=m1,m2,⋯,mnT,wheremi=mi,1,mi,2,⋯,mi,dT,wheren is moths’ number and d is the dimension of the optimization problem. The individual fitness value of moths is stored in the OM matrix:
(2)OM=OM1OM2⋯OMnT.The flame is the optimal position obtained in the local area. Formula (3) describes the optimal position relationship, and the adaptive value is described by OF.
(3)F=f1,f2,⋯,fnT,wherefi=fi,1,fi,2,⋯,fi,dT,(4)OF=OF1OF2⋯OFnT.


## 2.2. Location Update Mechanism

In the process of position optimization of the MFO algorithm, moonlight is used for positioning and navigation. However, moths are prone to fall into artificially set nonmoonlight navigation, which leads to the wrong position. In daily life, moths fly spirally under the light. This characteristic behavior puts forward the MFO algorithm, and moths constantly update their position relationship through moonlight navigation, so that they can search for the best position scheme.(1)
Flame catching behavior: mothMj, which has phototactic characteristics in nature, will move towards the nearest light (flame) Fj. Choose the logarithmic spiral described in equation (5) as the moving track of moth catching flame:(5)SMi,Fj=Di⋅ebt⋅cos2πt+Fj,whereSMi,Fj is the updated moth position, b is a constant, t is a random number from -1 to 1, t=−1 is the closest to the flame, and t=1 is the farthest from the flame. Di=Fj−Mi is the distance between moths Mj and flames Fj, that is, the step length.
(2)
Abandoning flame: MFO constantly adjusts the adaptive value to reach an optimal position, and its flame is constantly decreasing as described by(6)noflame=roundN−t×N−1T.In this,t represents the local maximum iteration number, T represents the global maximum iteration number, and N represents the maximum flame number. Local search is to continuously update the location information of subpopulations to get the optimal location solution. Formula (7) is as follows:
(7)Di=rand∗xF−xM,i=1,2,⋯,m,xb=xb+Di,−Dmin≤Di≤Dmax;i=1,2,⋯,m,whereDi∈0,1 and Dmin and Dmax denote the minimum and maximum moving steps. Di is the offset of position update and constantly adjusts the current position, so as to achieve a certain position offset during position search, which is more conducive to achieving global optimization.


## 3. Improved Moth Flame Optimization Algorithm

The nonfree lunch optimization theorem shows that none of the optimization algorithm can solve all optimization problems, and the MFO algorithm also faces the above problems. MFO is prone to premature convergence and fall into local optimum when dealing with complex function problems, so it needs to be improved to improve its performance. Chaos refers to a nonrepetitive chaotic dynamic system with ergodicity. Kent chaos and logistic chaos are isomorphic, and it has been proven that they can search accurately with good distribution. Literature [14–16] compares the ergodicity of the two. The logistic probability distribution is uniform in the middle and high at both ends, resulting in uneven ergodicity of logistic mapping. However, Kent mapping is evenly distributed in each interval, and good randomness, ergodicity, and uniform distribution characteristics are beneficial for the MFO algorithm to mine around the local optimal solution to search for a better solution. In addition, weight parameters have an important influence on the global and local search of the MFO algorithm, and a single invariant fixed weight will restrict the function of weight adjustment. In order to further improve the convergence accuracy, besides considering the iterative stage of the algorithm, the fitness value of the moth in the iterative process should also be considered; that is, a linear decreasing inertia weight adjustment strategy determined by the iterative stage and the fitness value of the moth is proposed.


### 3.1. Linear Declining Inertia Weight Adjustment Strategy

With the continuous optimization of the current value of the MFO algorithm, the algorithm falls into the local optimum in the complex and high-dimensional optimization process and cannot jump out of the local search process. Experimental simulation shows that the global optimal effect can be achieved by adjusting the inertia weight. Therefore, this paper considers that the inertia weight will degrade the performance of the algorithm in the complex nonlinear optimization function. Combined with the adaptive degree value, a position updating method is proposed to change the inertia weight.(8)ti=tstart−tendmaxiter−imaxiter+tend,Φfit=21+e−fiti/maxiter,wi=Φfit∗ti,wheretstart is the initial value of the algorithm, tend is the final value of the algorithm, 0<tstart<tend<1, maxiter is the maximum number of iterations of the algorithm, i is the current number of iterations, ti is the inertia weight, Φfit is the fitness value factor associated with fit, and wi is the adaptive inertia weight.In order to make better use of inertia weight adjustment to achieve local and global search ability, the object position update formula after inertia weightwi is introduced into the algorithm which is updated to
(9)Dikt+1=wi∗Dikt+vikt+1.wi plays a decisive role in the value range of Dik and decreases with the local optimal solution approaching the optimal solution. The learning experience optimization value of MFO is adopted to improve the optimization ability of MFO.wi represents the predicted trajectory of the MFO motion. When the local optimal solution appears, the inertia weight is relatively large, which leads to the local optimal value; when the global optimal solution appears, the inertia weight is characterized as relatively small, which is more conducive to the further search of the whole local optimal value. Further optimize the linear inertia weight:
(10)ωit=ωmax−ωminmaxiter∗∑i=1mmaxiti−fitj∗∑j=1itmaxfitjmaxiter∗∑i=1mmaxiti+ωmin.ωit represents the inertia weight of each i moth; ωmax and ωmin represent the maximum and minimum values of inertia weights. fitj represents the number of iterations of the current subpopulation, and maxiti represents the maximum number of iterations of the subpopulation. The linear inertia weight decreases linearly with the increase in population iteration times. The linear decreasing strategy of inertia weight is simple and intuitive and has good optimization ability. However, the local search process of the population is a nonlinear and complex process, and the linear decrease in inertia weight cannot accurately reflect the search process. Therefore, this paper puts forward inertia weight:
(11)ωit=ωmax−ωminfitj∗∑j=1itmaxfitjit.The above linear inertia weights are decreasing, and with the continuous iteration of the algorithm, the inertia weights will become smaller and smaller. When the inertia weight is initialized and when the inertia weight changes obviously, it shows that the local optimal situation is easy to appear. When the inertia weight algorithm does not change obviously in the later period, it shows that the algorithm is searching for the global optimal solution and it is easy to get the global optimal solution.


### 3.2. Moth Cross-Border Mirror Strategy

Formula (9) constantly optimizes the position, but the coordinates are easy to cross the boundary and will be limited to the boundary. In this way, the performance of the algorithm will be reduced a lot, and the global optimal value cannot be obtained, thus affecting the overall performance of the MFO algorithm. In view of the above problems, the boundary problem is adjusted by
(12)mi,j=2Lj−rand×mi,j,mi,j≤Lj,2Uj−rand×mi,j,mi,j>Uj,wheremi,j is the j-th dimension crossing position in the i-th moth; Lj and Uj are the value ranges of the j-th dimension. The multiple repetitive operation formula (12) can map mi,j to the range of the dimension, thus ensuring the diversity of the population and effectively improving the optimization performance of the MFO algorithm.As the fitness value and iteration times show a nonlinear decreasing trend, Figure1 shows the dynamic inertia weight change curve. The MFO algorithm iteration is the trend of change in Figure 1; when the algorithm is in the initial stage, the value is close to 1. It decreases rapidly with the change of iteration number and fitness value. When the iteration number is 35, the W value is about 0.293. The optimized position is shown in
(13)SMi,Fj=ωi⋅Di⋅ebt⋅cos2πt+1−ωi⋅Fj.Figure 1
Dynamic inertia weight curve.Dynamic inertia weights and iteration times and fitness value show a nonlinear relationship and artificial moth adaptive value to the better flame movement and effectively improve the search ability of the MFO algorithm.


### 3.3. IMFO Algorithm Steps

The IMFO is shown in Algorithm1.Algorithm 1: IMFO implementation steps
Parameter setting: population size (sizepop), dimension (d), maximum iteration number (Maxiter), current iteration number (Iteration), etc.Initialize Moths and FlamesWhile (Iteration < =Max_iterations)OM = FitnessFunction (M);Update the number of MFO's algorithm flames according to equation (13);IfIteration==1F=sort (m);OF=sort (OM);ElseF=sort (Mt-1, Mt); //t is the current number of iterationsOF=sort (OMt-1, OMt);EndFori=1: sizepopForj=1: dCalculateDi=Fj−Mi;UpdateDi according to formula (7);EndEndUpdate the newDi according to formula (11);Treat trans boundary moths according to formula (12);CalculateDi=Fj−Mi and update the moth position according to Equation (13);EndTerminate and output the global optimal solution moth.


## 3.1. Linear Declining Inertia Weight Adjustment Strategy

With the continuous optimization of the current value of the MFO algorithm, the algorithm falls into the local optimum in the complex and high-dimensional optimization process and cannot jump out of the local search process. Experimental simulation shows that the global optimal effect can be achieved by adjusting the inertia weight. Therefore, this paper considers that the inertia weight will degrade the performance of the algorithm in the complex nonlinear optimization function. Combined with the adaptive degree value, a position updating method is proposed to change the inertia weight.(8)ti=tstart−tendmaxiter−imaxiter+tend,Φfit=21+e−fiti/maxiter,wi=Φfit∗ti,wheretstart is the initial value of the algorithm, tend is the final value of the algorithm, 0<tstart<tend<1, maxiter is the maximum number of iterations of the algorithm, i is the current number of iterations, ti is the inertia weight, Φfit is the fitness value factor associated with fit, and wi is the adaptive inertia weight.In order to make better use of inertia weight adjustment to achieve local and global search ability, the object position update formula after inertia weightwi is introduced into the algorithm which is updated to
(9)Dikt+1=wi∗Dikt+vikt+1.wi plays a decisive role in the value range of Dik and decreases with the local optimal solution approaching the optimal solution. The learning experience optimization value of MFO is adopted to improve the optimization ability of MFO.wi represents the predicted trajectory of the MFO motion. When the local optimal solution appears, the inertia weight is relatively large, which leads to the local optimal value; when the global optimal solution appears, the inertia weight is characterized as relatively small, which is more conducive to the further search of the whole local optimal value. Further optimize the linear inertia weight:
(10)ωit=ωmax−ωminmaxiter∗∑i=1mmaxiti−fitj∗∑j=1itmaxfitjmaxiter∗∑i=1mmaxiti+ωmin.ωit represents the inertia weight of each i moth; ωmax and ωmin represent the maximum and minimum values of inertia weights. fitj represents the number of iterations of the current subpopulation, and maxiti represents the maximum number of iterations of the subpopulation. The linear inertia weight decreases linearly with the increase in population iteration times. The linear decreasing strategy of inertia weight is simple and intuitive and has good optimization ability. However, the local search process of the population is a nonlinear and complex process, and the linear decrease in inertia weight cannot accurately reflect the search process. Therefore, this paper puts forward inertia weight:
(11)ωit=ωmax−ωminfitj∗∑j=1itmaxfitjit.The above linear inertia weights are decreasing, and with the continuous iteration of the algorithm, the inertia weights will become smaller and smaller. When the inertia weight is initialized and when the inertia weight changes obviously, it shows that the local optimal situation is easy to appear. When the inertia weight algorithm does not change obviously in the later period, it shows that the algorithm is searching for the global optimal solution and it is easy to get the global optimal solution.


## 3.2. Moth Cross-Border Mirror Strategy

Formula (9) constantly optimizes the position, but the coordinates are easy to cross the boundary and will be limited to the boundary. In this way, the performance of the algorithm will be reduced a lot, and the global optimal value cannot be obtained, thus affecting the overall performance of the MFO algorithm. In view of the above problems, the boundary problem is adjusted by
(12)mi,j=2Lj−rand×mi,j,mi,j≤Lj,2Uj−rand×mi,j,mi,j>Uj,wheremi,j is the j-th dimension crossing position in the i-th moth; Lj and Uj are the value ranges of the j-th dimension. The multiple repetitive operation formula (12) can map mi,j to the range of the dimension, thus ensuring the diversity of the population and effectively improving the optimization performance of the MFO algorithm.As the fitness value and iteration times show a nonlinear decreasing trend, Figure1 shows the dynamic inertia weight change curve. The MFO algorithm iteration is the trend of change in Figure 1; when the algorithm is in the initial stage, the value is close to 1. It decreases rapidly with the change of iteration number and fitness value. When the iteration number is 35, the W value is about 0.293. The optimized position is shown in
(13)SMi,Fj=ωi⋅Di⋅ebt⋅cos2πt+1−ωi⋅Fj.Figure 1
Dynamic inertia weight curve.Dynamic inertia weights and iteration times and fitness value show a nonlinear relationship and artificial moth adaptive value to the better flame movement and effectively improve the search ability of the MFO algorithm.


## 3.3. IMFO Algorithm Steps

The IMFO is shown in Algorithm1.Algorithm 1: IMFO implementation steps
Parameter setting: population size (sizepop), dimension (d), maximum iteration number (Maxiter), current iteration number (Iteration), etc.Initialize Moths and FlamesWhile (Iteration < =Max_iterations)OM = FitnessFunction (M);Update the number of MFO's algorithm flames according to equation (13);IfIteration==1F=sort (m);OF=sort (OM);ElseF=sort (Mt-1, Mt); //t is the current number of iterationsOF=sort (OMt-1, OMt);EndFori=1: sizepopForj=1: dCalculateDi=Fj−Mi;UpdateDi according to formula (7);EndEndUpdate the newDi according to formula (11);Treat trans boundary moths according to formula (12);CalculateDi=Fj−Mi and update the moth position according to Equation (13);EndTerminate and output the global optimal solution moth.


## 4. IMFO Algorithm Performance Test

This paper selects four commonly used functions for experimental comparison.(1)
Ackley function(14)fx=−20∗e−0.20.5xi2+xj2−e0.5∗cos2πxi+cos2πxj+e+20.The optimal values areminfx∗=0.
(2)
Beale function(15)fX=∑i=1nxi2−10cos2πxi+10,∣xi∣≤5.2.The optimal values areminfx∗=0.
(3)
Rastrigin function(16)fx=−sinxicosxjexp100−xi2+xj2π.The optimal values areminfx∗=0.
(4)
Sphere function(17)fx=∑i=1nxi2.The optimal values areminfx∗=0.The Rastrigin function has many local optima, and global optimum is difficult; the Ackley function has less global optimum and more local optimum; the Griewank function has several local optimum solutions, and the global optimum solution is difficult to realize. The optimal range and global optimal value of the four functions are shown in Table1. According to the above operation results, f1-f4 function is shown in Table 1.Table 1
Benchmark function.
FunctionFunction nameValue rangeOptimal positionOptimal valuef1Ackley−5,5D0D0f2Beale−4.5,4.5D3,0.5D0f3Rastrigin−5.2,5.2D0D0f4Sphere−100,10D0D0The abovef1-f4 function is tested, and its function image is shown in Figure 2.Figure 2
f1-f4 function schematic diagram.f1-f4 test functions are representative, including unimodal functions and multimodal functions. The purpose of the test is to detect the advantages of the proposed algorithm in algorithm performance. From the sequencing effect of the f1-f4 function, the algorithm proposed in this paper has obvious advantages. The theoretical value is the global optimum value. Generally, there are one theoretical value and several local optimum values in multimodal functions. If the test result of the function reaches or approaches the theoretical value, it represents the global optimal value.The design dimensions of the common functions are 10, 30, and 50, respectively. The test function is tested 100 times, and the average value is taken, and the optimal average value (mean) and standard deviation (SD) are taken. Table2 lists the numerical results of PSO, MFO, and IMFO under four test functions.Table 2
Comparison of PSO, MFO, and IMFO results.
FunctionDimensionPSOMFOIMFOMeanMSDMeanMSDMeanMSDf1102.4356.325×10−18.652×10−154.551×10−148.754×10−160304.2315.547×10−13.578×10−25.621×10−38.654×10−160507.9141.3141.135×10−11.7898.231×10−160f2104.9371.6342.451×10−11.625×10−100304.249×10−13.4671.235×10−23.331×10−100501.124×10−15.6573.142×10−25.624×10−100f3107.9843.7412.451×10−11.537×10−100304.314×10−16.7542.145×10−23.354×10−100506.654×10−15.625×1012.578×10−25.624×10−100f4103.147×10−95.124×10−86.514×10−316.457×10−307.985×10−1920301.987×10−21.621×10−23.245×10−35.524×10−32.547×10−1071.214×10−106503.541×10−17.951×10−27.954×10−37.714×10−32.312×10−941.112×10−93From the test average and mean square error analysis of the four algorithms in Table2, PSO and MFO algorithms have the same performance, and the IMFO algorithm is the best. For functions f1-f4, the performance of the IMFO algorithm is globally optimal. When the dimension is increased to 50, the IMFO optimization performance still has high accuracy, and the standard deviation is the smallest among the four algorithms. The optimal solution found by IMFO for the f4 test function does not reach the theoretical optimal value and is still the smallest in value compared with other algorithms. For the multimodal function f1, the IMFO algorithm is improved from 8.652×10−15, 3.578×10−2, and 1.135×10−1 optimized by MFO to 8.754×10−16, 8.654×10−16, and 8.231×10−16 in 10, 30, and 50 dimensions, respectively. The standard deviation is 0, and the IMFO algorithm has the best performance.


## 5. Experimental Simulation and Analysis

### 5.1. Monitoring of Chemical Gas Concentration

Due to the danger of CH4, CO2, CO, NO2, H2S, and SO2 emitted from coal seam during mining, effective monitoring of these gas concentrations can improve the safety of downhole operation. The safety level of chemical gas is shown in Table 3.Table 3
Air quality index (gas concentration (ppm)) of downhole operation.
StatusNO2COSO2H2SCH4CO2Excellent0-11-130-2.50-30-10001-2000Good1-213-232.5-43-51000-20002000-3000Medium2-323-302-65-132000-40003000-4000Poor3-430-496-813-204000-50004000-5000Worst>4>49>8>20>5000>5000Underground air quality monitoring can predict the danger, can effectively predict the future air quality, and can establish a set of safe methods.The IMFO algorithm proposed in this paper is used to predict the air quality of underground operation and give early warning of possible dangers in time. The errors of using three algorithms to predict underground air quality are shown in Figures3 and 4.Figure 3
Comparison of prediction errors of chemical gases NO2, CO, SO2, and H2S.Figure 4
Comparison of prediction errors of chemical gases CH4 and CO2.The IMFO algorithm in the prediction of chemical gas algorithm error is the best and can achieve the effect of prediction.


### 5.2. Location Prediction Algorithm

In order to verify and analyze the positioning accuracy and antinoise performance of this method, MATLAB simulation experiments are carried out and compared with PSO, MFO, and IMFO algorithms proposed in this paper. Because of the special underground environment, the accuracy of spatial ranging is affected, so the simulation environment is set to be in a cuboid three-dimensional area with a certain size.Objective function is a standard to measure the advantages and disadvantages of IMFO. In each iteration of the algorithm, the position of moths needs to be updated according to the value of objective function. It is assumed thatM beacon nodes are deployed in the location area, their coordinates are xi,yi,zi, i=1,2,⋯,m; the coordinates of unknown nodes are x,y,z; the distance measured by the RSSI method is di; and the average location error is the average value of the location error obtained by repeating the experiment 30 times. In order to reduce the ranging error, the mean square error of the measured distance and the estimated distance of the unknown node and the beacon node is taken as the optimization objective function. The objective function is
(18)fx,y,z=1m∑i=1mx−xi2+y−yi2+z−zi2−di2.The coordinate data in a specific area are shown in Table4.Table 4
Positioning simulation data.
Node IDActual coordinatesNode IDActual coordinates1(1, 2, 3)9(4, 1, 4)2(2, 2, 4)10(4, 2, 5)3(2, 3, 4)11(4, 4, 3)4(2, 5, 6)12(5, 2, 4)5(3, 1, 2)13(5, 3, 5)6(3, 2, 3)14(5, 4, 3)7(3, 4, 2)15(6, 3, 4)8(3, 5, 5)16(6, 4, 2)The IMFO algorithm is used to predict the actual coordinates, and the effect is shown in Figure5.Figure 5
Spatial distribution of the IMFO algorithm and actual coordinates.The errors of PSO, MFO, and IMFO algorithms are compared below, and the errors are compared and analyzed by equation (18). The results are shown in Figure 6.Figure 6
Comparison of errors under three algorithms.As can be seen from Figure6, IMFO has the smallest error in different coordinates compared with other algorithms, and most values are less than 1.


## 5.1. Monitoring of Chemical Gas Concentration

Due to the danger of CH4, CO2, CO, NO2, H2S, and SO2 emitted from coal seam during mining, effective monitoring of these gas concentrations can improve the safety of downhole operation. The safety level of chemical gas is shown in Table 3.Table 3
Air quality index (gas concentration (ppm)) of downhole operation.
StatusNO2COSO2H2SCH4CO2Excellent0-11-130-2.50-30-10001-2000Good1-213-232.5-43-51000-20002000-3000Medium2-323-302-65-132000-40003000-4000Poor3-430-496-813-204000-50004000-5000Worst>4>49>8>20>5000>5000Underground air quality monitoring can predict the danger, can effectively predict the future air quality, and can establish a set of safe methods.The IMFO algorithm proposed in this paper is used to predict the air quality of underground operation and give early warning of possible dangers in time. The errors of using three algorithms to predict underground air quality are shown in Figures3 and 4.Figure 3
Comparison of prediction errors of chemical gases NO2, CO, SO2, and H2S.Figure 4
Comparison of prediction errors of chemical gases CH4 and CO2.The IMFO algorithm in the prediction of chemical gas algorithm error is the best and can achieve the effect of prediction.


## 5.2. Location Prediction Algorithm

In order to verify and analyze the positioning accuracy and antinoise performance of this method, MATLAB simulation experiments are carried out and compared with PSO, MFO, and IMFO algorithms proposed in this paper. Because of the special underground environment, the accuracy of spatial ranging is affected, so the simulation environment is set to be in a cuboid three-dimensional area with a certain size.Objective function is a standard to measure the advantages and disadvantages of IMFO. In each iteration of the algorithm, the position of moths needs to be updated according to the value of objective function. It is assumed thatM beacon nodes are deployed in the location area, their coordinates are xi,yi,zi, i=1,2,⋯,m; the coordinates of unknown nodes are x,y,z; the distance measured by the RSSI method is di; and the average location error is the average value of the location error obtained by repeating the experiment 30 times. In order to reduce the ranging error, the mean square error of the measured distance and the estimated distance of the unknown node and the beacon node is taken as the optimization objective function. The objective function is
(18)fx,y,z=1m∑i=1mx−xi2+y−yi2+z−zi2−di2.The coordinate data in a specific area are shown in Table4.Table 4
Positioning simulation data.
Node IDActual coordinatesNode IDActual coordinates1(1, 2, 3)9(4, 1, 4)2(2, 2, 4)10(4, 2, 5)3(2, 3, 4)11(4, 4, 3)4(2, 5, 6)12(5, 2, 4)5(3, 1, 2)13(5, 3, 5)6(3, 2, 3)14(5, 4, 3)7(3, 4, 2)15(6, 3, 4)8(3, 5, 5)16(6, 4, 2)The IMFO algorithm is used to predict the actual coordinates, and the effect is shown in Figure5.Figure 5
Spatial distribution of the IMFO algorithm and actual coordinates.The errors of PSO, MFO, and IMFO algorithms are compared below, and the errors are compared and analyzed by equation (18). The results are shown in Figure 6.Figure 6
Comparison of errors under three algorithms.As can be seen from Figure6, IMFO has the smallest error in different coordinates compared with other algorithms, and most values are less than 1.


## 6. Conclusion

The wireless sensor network technology and algorithm used to realize accurate mine positioning are an important research direction of the mine positioning system at present. Whether the massive data generated under the above technical background can accurately measure the specific position has become a hot spot in the research of the positioning algorithm. In this paper, the IMFO algorithm is proposed to compare the predicted coordinates with the actual coordinates in a specific area, and the prediction effect is good and the error is small. Further research in the future focuses on the problem of signal transmission, the diversity of prediction, and the application of algorithms in different scenarios. It can compare other intelligent algorithms and select the advantages of different algorithms to fuse to predict.



---

*Source: 4001584-2021-08-10.xml*