An Improved Fruit Fly Optimization Algorithm and Its Application in Heat Exchange Fouling Ultrasonic Detection

Inspired by the basic theory of Fruit Fly Optimization Algorithm, in this paper, cat mapping was added to the original algorithm, and the individual distribution and evolutionmechanism of fruit fly populationwere improved in order to increase the search speed and accuracy. The flowchart of the improved algorithm was drawn to show its procedure. Using classical test functions, simulation optimization results show that the improved algorithm has faster and more reliable optimization ability. The algorithm was then combined with sparse decomposition theory and used in processing fouling detection ultrasonic signals to verify the validity and practicability of the improved algorithm.


Introduction
Energy crisis is a serious challenge to the whole world.Improving the energy efficiency has become an important issue in industrial production field.Heat exchange fouling exists widely in various industrial fields, and it could cause heat transfer reduction, energy consumption increase, frequent accidents, and so on.Its negative effect on production efficiency and safety cannot be ignored.According to statistics, from an economic point of view only, the losses caused by heat exchange fouling in developed countries in Europe and the United States account for about 3% of GDP each year.In 1984, the losses in the United States have reached 8−10 billion US dollars [1][2][3].Research on heat exchange fouling detection and elimination is urgently needed.
The traditional detection methods, such as temperature differential method, are hard to achieve real-time, accurate, and quantitative measurements.In this study, ultrasonic time-domain reflectometry (UTDR) method was proposed for fouling detection [4,5].Efforts were also made on further research of the ultrasonic detection information acquisition method.
Due to the nonstationarity, noise, and interference of heat exchange fouling ultrasonic detection signal, the waveforms need to be extracted and processed.But the speed and accuracy of traditional sparse decomposition methods are unsatisfactory.So optimization algorithms could be brought in to improve the decomposition results [6,7].
In 2011, Pan, a Taiwan researcher, proposed a new swarm intelligence bionic optimization algorithm, which is called fruit fly optimization algorithm (FOA) [8][9][10].FOA was based on the food finding behavior of the fruit fly swarm.A fruit fly can smell the food source from far away and then flies towards that direction quickly.After it gets close to the food location, it can use its vision to find food.Compared with particle swarm optimization (PSO), genetic algorithm (GA), and other classical optimization algorithms, the FOA algorithm is simple and practicable and can reach accurate optimization quickly, which is suitable for signal sparse decomposition by combining matching pursuit method.
This paper studied on improving the fruit fly optimization algorithm (FOA) and combined it with matching pursuit method to process the sparse decomposition of heat exchange fouling ultrasonic detection signal.The simulation analysis and experimental application verified the effectiveness and practicability of this new algorithm.This study has great significance to the feasibility of fouling ultrasonic detection.

Algorithm Basic Principles and Its Application
The FOA is a method for finding global optimization based on the food finding behavior of the fruit fly.Steps of original FOA can be summarized as follows.
Step 1 (initialization).Define the population size of the fly group, the iteration termination condition, and the random initial fruit fly swarm center location ( axis,  axis); Step 2 (individual location assignment).An individual fruit fly location (  ,   ) is random: Step 3. Set the smell concentration judgment value   as the reciprocal of the distance from the fruit fly to the origin (Dist): Step 4. Define the smell concentration judgment function (Fitness Functions) by substituting   to find the smell concentration of the corresponding position (Smell).
Step 7 (repeat Steps 2-5).If bestSmell is superior to the swarm history best Smellbest, then go to Step 6.Otherwise, go to Step 2 and continue iteration.
The flowchart is shown in Figure 1.
FOA is relatively simple and fast.FOA can be applied to neural network learning, model parameter identification, and other fields.And it can be combined with sparse decomposition algorithm or other algorithms to improve the computation efficiency [11].
Sparse decomposition is an important part of compressed sensing.Its basic theory is using the signals sparse feature to represent it losslessly by small data volume [12].In 1993, Mallat proposed matching pursuit (MP), which is one of the representative sparse decomposition algorithms [13][14][15].
MP is a global greedy search algorithm.Its main idea is to select the atomic form based on the features of the signal  and then construct the super complete atomic dictionary  = {  }, ‖  ‖ = 1,  ∈ ; then search the best matching atom  1 in  by targeting the maximization of the inner product energy ‖⟨  (), ()⟩‖.The difference between the signal and its projection on the atomic library is processed and the signal will be decomposed into a linear combination as (1).⟨  (),   ()⟩  () represents the projection and  +1 () represents the residual at the iteration termination, which reflects the decomposition error and noise.
This method can achieve signal decomposition, but its computation speed is slow and the accuracy is not good enough.If efficient FOA is used in best matching atom search, both the sparse decomposition performance and the exchange fouling ultrasonic detection information acquisition performance could be improved.

Analysis and Improvements of FOA
Ergodicity and accuracy are important indicators to measure the optimization algorithm performance.Accuracy improvement needs detailed search in solution range and global optimum acquisition requires good individual ergodicity.These two requirements contradict with each other.How to solve the contradiction is the main problem of swarm intelligence optimization algorithm.For better results, improved FOA will be discussed below.

Improvements on the Random Distribution of Fruit Fly
Individuals.In nature, there exists a special movement form called Chaos, which seems to have no rules, but has its underlying rules in fact.Chaos theory was proposed first by Lorenz, an American meteorologist, with the Butterfly Effect theory in 1963 [16].It has been widely used in physics, chemistry, geology, and so on.
In optimization algorithm field, the combination of chaotic mapping and swarm intelligence optimization algorithm can improve the results of swarm intelligence optimization.This theory has been verified by many examples and it is based on Chaos features, such as randomness, ergodicity, and sensitivity to initial conditions.So efforts have been made to combine Chaos theory with FOA to get better efficiency and accuracy.
So far the swarm intelligence optimization algorithm is usually combined with logistic or tent mapping models to achieve some improvements [17].But the chaotic sequence generated from the logistic mapping model is nonuniform distribution.It follows Chebyshev Distribution, whose destiny is high at both ends and is low at the center.This feature has certain influence on the ergodicity of the optimization solution space.The chaotic sequence generated from tent mapping model follows uniform distribution, but the value will quickly fall into the small cycle under the influence of word length.It is short of good randomness [18,19].Using a model, which can produce uniform distribution chaotic sequence, to improve FOA individual distribution could increase the algorithm search efficiency.Cat Map, a chaotic algorithm, is usually used in image encryption [20].Its basic function is (2) Sparse decomposition often needs multiparameter highdimension optimization, so the generalized high-dimension Cat Map is more suitable for FOA improvement, because of its high sensitivity to the initial value and strong ergodicity [21].In this paper, the chaotic sequence generated by the highdimension Cat Map in the interval [0, 1] is set as Random Value instead of the rand function to define the individual distribution.The mapping values in the interval [0, 1] construct the multidimension chaotic sequence Cat(, ).The sequence data in different dimension is independent from each other and has strong ergodicity.This feature can reduce the ergodic problems brought by the pure random distribution and guarantee the ergodicity of the individual fly on the solution space.This method can avoid premature convergence and improve the algorithm performance.

Improvements on Search Strategy and Methods.
The ergodicity of the optimization algorithm guarantees that the algorithm will not fall into local optimization, but the accuracy requires the further search in the existing optimal neighborhood.To solve this contradiction, researchers put forward a new dynamic random search technology: add local search on the basis of general search, and narrow the search range with local search iteration number to do further search, so the solution accuracy will be improved [22,23].
This method can improve optimization accuracy effectively.So the FOA search steps are changed as follows: The distribution range in the bestIndex neighborhood decreases rapidly until the iteration number reaches the limit or  is out of the scope, and then local search stops.
The combination of local search theory with FOA can narrow the search range when there is no more progress on the optimal search in the current range, and the solution will be more accurate.But this method will reduce the search horizon with the search range narrowing and increase the probability of falling into local optimization.To solve this problem, a phenomenon is simulated, as the population will continue to rise and fall after food is found and a small amount of the population will keep searching food in the air.The proportion of these fruit flies is ,  ∈ (0, 0.5).Their individual distributions vary at roulette random.This parameter could increase in pace with the local search time to ensure the ergodicity of the algorithm.
Efforts have been made on both optimization method and optimization search range.FOA used the reciprocal of the distance to the origin as the concentration judgment value, so the solutions in the search plane are not evenly distributed and the density is inversely proportional to the distance to the origin.For multiparameter optimization individual distribution, distribution range of variety groups is set up by equal Random Value.This is not conducive to improve the multiparameter parallel search efficiency.So the group optimization search ranges are set up based on the center points corresponding to every dimensional parameter and  ⋅ Dist represents the individual distribution radius,  ∈ (0, 1).The proposed changes can help improve the speed and accuracy of FOA method.
According to FOAs own characteristics,   = 1/Dist can be changed to   = 1/(Dist + ),  = 1/max, where max is the solution space upper limit of each parameter optimization.This improvement reflects the parameter boundary conditions in the optimization range.The one-dimensional parameter solution space upper limit is converted to the individual distribution two-dimensional space origin in the optimization process, so the search range is more reasonable.
The fruit fly optimization algorithm (IFOA) flowchart is shown in Figure 2. The combination of FOA and chaotic map can improve the fruit fly individual ergodicity and the local search method is conducive to improving the accuracy of results.The changes of the individual distribution range further improved the optimization efficiency.So IFOA combined with matching pursuit has more efficiency and accuracy for the exchange fouling ultrasonic detection signal sparse decomposition.

Improved FOA Simulation Analysis
In order to evaluate the effect of improved FOA objectively, the classical test functions, Schatter function and Bohachevesky function, were used to observe, compare, and analyze the extremum acquisition effect.Equation (3) shows Schatter function and (4) shows Bohachevesky function.
The spatial characteristics of two functions are shown in Figure 3. Schatter function has the unique global minimum value 0 at the origin; Bohachevesky function has global maximal value 0.24003441 at points (1, 2) = (0, 0.23) and (1, 2) = (0, −0.23).Both of them are complex highly oscillatory two-dimension functions.They have a lot of local extremums close to each other, so their global extremum value points are hard to obtain.This requires the optimization algorithm to have better ability to jump out of local extremums.
The common PSO, GA, FOA, chaotic FOA with Cap Map (CFOA), and the proposed IFOA are used to search the test function extremums, respectively.The experiments were repeated 50 times.And the population size was 50 and the maximum iteration number was 50.According to the basic PSO algorithm, the learning factor  1 is generally equal to  2 , ranging from 0 to 4, and the commonly used value is 2.So individual optimal coefficient  1 was 2, group optimal coefficient  2 was 2, and inertia coefficient  was 0.8.GA algorithm uses a more common parameter setting: the probability of crossover was 0.6 and the mutation probability was 0.10, and the search range was shown in Figure 3.
The performance of the optimization algorithm is usually evaluated by convergence speed and optimization accuracy at the same iteration number.Use the results error as the index of the convergence, and set the function accuracy target of Schatter function and Bohachevesky function as 10 −5 and 10 −3 , respectively.The optimization statistics were shown in Table 1, including the minimum error, the maximum error, mean, successful convergence times out of 50, and the rounded up average iteration number reaching the convergence indicators.
As shown by Table 1, under the same population size and iteration times, GA algorithm is very vulnerable to get premature convergence when dealing with complex multimodal function optimization problems, and the accuracy of optimization results is low, while the quality is unstable; both FOA and IFOA need less average convergence iteration number than PSO, reflecting the FOAs own fast convergence feature; CFOAs convergence speed is slightly faster than FOA without chaotic mapping; the proposed IFOA has the least average iteration number reaching the convergence accuracy.
Comparing the minimum error, the maximum error, and mean optimization results of different algorithms, IFOA has the lowest algorithm error, the most accurate optimization results, and the most probability of successful convergence.Thus, IFOA has more accurate optimization results at the same iteration number.
In order to study the iterative convergence of different optimization algorithms, the convergence process of the minima optimization for Schaffer function at a certain time is shown in Figure 4.
Figure 4 shows that the optimization convergence iteration numbers of fruit fly optimization and its improved algorithm are lower than the basic particle swarm algorithm and GA, and the convergence iteration numbers of chaotic fruit fly optimization algorithm (CFOA) and FOA algorithm without chaotic mapping have little difference, while the proposed improved fruit fly optimization algorithm (IFOA) has the    lowest.By statistics, the average cycle time of PSO, FOA, CFOA, and IFOA is in the magnitude of 10 −3 seconds, so the improvement of IFOA algorithm did not increase the amount of time required for a single cycle largely.Therefore, the convergence rate and accuracy of the IFOA algorithm are the best compared with other methods.
The analysis shows that PSO and GA has low convergence speed and it can be stuck easily at the local optimal points in optimization process of some complex functions, causing low success rate; FOA and CFOA have better ability to avoid local extremums, but the convergence speed is not ideal; IFOA, the proposed algorithm, has quick convergence speed, high optimization accuracy, and good stability in searching the classical test functions extreme values.The ergodicity and the accuracy have been greatly improved.IFOA combined with matching pursuit should be able to obtain the information more quickly and accurately in the exchange fouling ultrasonic detection signal decomposition.

Research on IFOA Application
The device shown in Figure 5 was used in the heat exchange fouling ultrasonic detection experiment.This device is mainly composed of upper and lower water tanks, pipelines, a constant temperature water tank, a temperature control device, The experimental pipe is small and thin copper pipe horizontally is laid in a constant temperature water tank.The pipes diameter is about 25 mm and the average wall thickness is 1.5 mm.The constant temperature water tank joins the upper and lower water tanks and the circulating device to ensure the stability of heat exchange.The water temperature in the tank is about 50 ∘ C. Saturated CaCO 3 solution is placed in the lower water tank, and after the solution temperature is maintained at 30 ∘ C by cooling device, the circulating pump pushes the solution into the experimental pipeline to initiate fluid heat exchange.Schematic diagram and devices are shown in Figure 6.
In the experiment, 5800PR ultrasonic pulse transmitting and receiving apparatus was used as ultrasonic pulse generator, to drive a V312-SU 10 MHz transceiver water immersion focusing ultrasonic probe to detect the calcium carbonate fouling on the pipeline inner wall.The acquired echo signal was stored in the computer for subsequent data processing.The waveform of pipe heat exchange fouling ultrasonic detection signal after 252 hours is shown in Figure 7.
Reflection waveform A is the pipe outside wall echo.Due to the short distance and the smooth and compact metal, A has strong reflective energy; B, C, and E are the inner wall echoes, and their energy decreases gradually.Fouling echo D is between C and E and has waveform aliasing.The fouling  echo energy is loose and has noise and interference because of the characteristics of the pipe and the fouling material.So the specific waveforms are hard to obtain independently.If the accurate ultrasonic echo waveform of the fouling interface can be obtained, the important information related to fouling layer can be analyzed, such as fouling properties and fouling thickness, which will play an important role in subsequent research.
The main steps of extracting heat exchange fouling waveform by IFOA and MP are as follows: (1) Select the data to be processed (), and set the number of reflected waveforms to .
In formula (5), () = EXP(− 2 ) is a Gauss window function; , , V, and  represent the atomic scale, displacement, frequency, and phase parameters, respectively.The expansion of the parameters forms a complete atomic library.
(3) IFOA is used to solve the following optimization problems, such as in formula (6).
Inner product ‖⟨  (), ()⟩‖ can be set as fitness function of IFOA algorithm; , , V, and  represent four dimensions of an optimization space.Using the fruit fly group to find the location coordinates and atoms  1 with the largest concentration of fitness in the four-dimensional optimization space, extract the most powerful waveform  1 () from ultrasonic reflection waveform (), as shown by formula (7).
(4) Taking the remainder  2 () = () −  1 () as the new signal and repeating step (3), search the most matched atom  2 ∼  in the atomic dictionary and extract other ultrasonic reflection waveforms  2 ()∼  () in the same way.
(5) If the distribution of final residual  +1 () is uniform and the energy is small, the sparse decomposition is more accurate and complete, and the residual part is mainly composed of noise and interference.The form of sparse decomposition of ultrasonic signals is shown in formula (1), and  1 () is ().
Using IFOA to select the MP atomic parameters can change the discrete solution space to continuous solution space and improve the efficiency and accuracy of the atom selection at meantime.So the purpose of the accurate decomposition of heat exchange fouling ultrasonic detection signal can be achieved.
In the specific application, the ultrasonic reflection signal, the false line part in Figure 7, is taken as the data to be processed (), and the number of reflected waveforms  is 3.The IFOA with matching pursuit (IFOA-MP) method was used to decompose and reconstruct the detection signal.One of the results and residuals is shown in Figure 8.The population size was 100 and the iteration number was 100.The residual distribution is smooth and has small amplitude, reflecting that IFOA-MP has better sparse decomposition results.
The sparse decomposition was processed by MP, particle swarm optimization matching pursuit (PSO-MP), genetic algorithm matching pursuit (GA-MP), and FOA-MP, respectively.Independent experiment was repeated 50 times.The population size was 100 and the iteration number was 100 for all algorithms; PSO optimization parameters were the same as shown before.The mean statistics of time consumption and energy ratio of residual/signal from each experiment are shown in Table 2.
As shown by Table 2, the original MP has low accuracy and the highest residual/signal energy ratio and spends the most time.The decomposition speed of the GA-MP method is fast, but the residual energy is large and the resolution precision is low.Although the IFOA-MP method time consumption slightly increased compared to the FOA-MP method time, IFOA-MP time is still only about half of the PSO-MP method, which means it has a good speed advantage.And the residual energy of IFOA-MP method decomposition is far less than FOA-MP and PSO-MP methods, only about 7% of the original ultrasonic signal, indicating that the accuracy of decomposition is improved.IFOA-MP method can conduct sparse decomposition of the exchange fouling ultrasonic detection signal more quickly and accurately and achieve the acquisition of fouling characteristics better.

Conclusions
According to the feature and application requirements of FOA, this paper proposed an improved FOA (IFOA), which is FOA combined with chaotic mapping and local search theory.The simulation analysis was based on typical optimization problems.And the IFOA combined with matching pursuit method was used to conduct the sparse decomposition and reconstruction of the exchange fouling ultrasonic detection signal.Experimental results showed that IFOA has better ergodicity and ability to avoid local extremums; sparse decomposition combined with IFOA has less time consumption and smaller residual energy and is quicker and more accurate than traditional decomposition methods.The new method is suitable for the exchange fouling ultrasonic detection signal decomposition and is important for the research of signal denoising and transit time acquisition methods.

( 1 )
Set the local search maximum times   , and search range scaling coefficient , the condition parameters for entering the local search Δ, and  0 .(2) Use the difference between current optimal concentration bestSmell and historical optimal concentration Smellbest as local search starting determinant parameter  = (Smellbest − bestSmell).(3) Compare  with local search threshold parameter Δ.If  < Δ and the steps in the threshold interval are equal to  0 , then start the local search.(4) Since the beginning of local search, Random Value will be multiplied by  in each iteration,  ∈ [0, 1].

Figure 3 : 6 Mathematical
Figure 3: Spatial characteristics of standard test functions.

Figure 4 :
Figure 4: Optimization process of Schaffer function extremum problem.

Figure 5 :
Figure 5: Heat exchange fouling dynamic simulation experiment equipment.

Figure 8 :
Figure 8: Signal decomposition and reconstruction results with IFOA-MP method.

Table 1 :
Optimization results statistics of the test function extremum problem.

Table 2 :
Statistics of signal reconstruction results.