ANN-Based Stop Criteria for a Genetic Algorithm Applied to Air Impingement Design

Artificial Neural Networks (ANNs) have proven to be a powerful tool in many fields of knowledge. At the same time, evolutionary algorithms show a very efficient technique in optimization tasks. Historically, ANNs are used in the training process of supervising networks by decreasing the error between the output and the target. However, we propose another approach in order to improve these two techniques together. The ANN is trained with the points obtained during an optimization process by a genetic algorithm and a flower pollination algorithm. The performance of this ANN is used as a stop criterion for the optimization process. This new configuration aims to reduce the number of iterations executed by the genetic optimizer when learning the cost function by an ANN. As a first step, this approach is tested with eight benchmark functions. As a second step, the authors apply it to an air jet impingement design process, optimizing the surface temperature and the fan efficiency. Finally, a comparison between the results of a regular optimization and the results obtained in the present study is presented.


Introduction
In industrial applications, thermal management is a critical task, requiring optimal design of cooling or heating systems. Among heat transfer methods, jet impingement is a technique with excellent performance for applications where high heat fluxes are required. The working fluid, which can be air, passes through one or more nozzles, increasing its speed and impinging on the surface of the element to be cooled or heated. In a previous work by Martinez-Filgueira et al. [1], the particularities of this kind of design were studied extensively. The air impingement system requires an appropriate air supply, which is commonly provided by a blower. The influence of this component on the heat exchange system makes the selection or the design of a proper blower a major task. The blower is usually characterized by different variables such as the specific diameter (Ds) and the specific speed (Ns); for more details, see Wright et al. [2]. One of the main properties of the blower that influences the air jet impingement application is the efficiency, which can be expressed in function of Ns. In other cases, efficiency is directly related to the flow; see the study of Ingole et al. [3].
To make a correct characterization of heat exchange, it is necessary to define the variables that impact directly on the cooling performance. These variables can be classified into two different GAs were developed several years ago. They are commonly use in optimization tasks. Beasley et al. [11] explain that they are composed of populations that use heuristic and stochastic mechanics to solve problems such as search and optimization. GAs are adaptive methods, which can solve realworld and engineering problems. Many examples of GA applications in optimization problems can be found in the literature, such as crude oil operations [12], energy management optimization in electric vehicles by Wieczorek et al. [13], optimization of a building's thermal design by Ferdyn-Grygiereket et al. [14] and optimization of a solar chimney power plant's collector roof by Gholamalizadeh et al. [15] .
GAs emulate natural behavior, and for each particle that forms the population, a "fitness" or "cost" score is assigned depending on the problem and according to a defined function. For this emulation purpose, GAs' coding distinguishes some functions such as "Reproduction", where two individuals are selected for breeding. New particles called "children" are created in the "offspring" process. In some cases, the oldest particles suffer a "die out". Every iteration of the algorithm that involves these functions is called "generation". The GA architecture and working process are largely discussed in the related literature [16,17] and present different types and approaches. The correct selection and implementation of the different GA variants depend on the application. Due to the new children generation process, GAs is a good choice in applications where the variety of the population is critical.
Artificial Neural Networks (ANNs) are a type of machine learning that aims to emulate the behavior of the human brain. Ali et al. explain in [18] that ANNs are a combination of simpler computation elements called "neurons". ANNs are divided into three main types of layer: Input, Hidden, and Output. Different types of ANN can be distinguished depending on their internal connection and the number of hidden layers, such as single-layer perceptron, multi-layer perceptron or competitive networks.
These tools allow researchers to solve different types of problems, such as numerical regression, pattern recognition, clustering, and image processing. These problems appear in a large amount of engineering and real-life applications such as nanophotonic particle simulation and design by Peurifoy et al. [19], modeling of photovoltaic modules by Manuel Lopez-Guede et al. [20] or horizontal-axis wind turbine control by Saenz-Aguirre et al. [21]. Arena et al. [22] presented a combination of game theory and GA for the optimization of the Parrando paradox probability region.
The current work aims to develop a neural network trained alongside a genetic algorithm optimization process and to use its training performance as a stop condition. In addition, the new optimization approach is tested with various benchmark functions. This test is repeated with a Flower pollination algorithm in order to compare the performance of both algorithms.
The final goal is to apply this technique to an air jet impingement cooling system design by optimizing the surface junction temperature and hydraulic efficiency.

Air Impingement Design
A novel methodology to calculate the junction temperature of the cooled surface and the machining time of the plate was presented in the work of Martínez-Filgueira et al. [1]. In the current work, the same criteria for the temperature calculation are used. However, the machining time is discarded as a design criterion in the present study, and it has been replaced by the hydraulic efficiency. In both cases, the variables needed for the calculation are the nozzle diameter (D) and nozzle-to-nozzle spacing and diameter ratio (s/D).
In this application, an industrial centrifugal fan is used as a source of flow. Such fans operate according to their characteristic curve, which indicates the relation between the pressure and the flow rate provided by the fan [23]. Figure 1 illustrates an example of this type of curve. Alongside the previous figure, industrial fans are also characterized by efficiency curves. Even though the fan can work at all the points contained in the fan curve, the efficiency changes depending on the point of operation. Figure 2 shows how the maximum efficiency that is achieved when the air flow supplied by the fan is higher than half the maximum. The plot presented in Figure 2 is assumed in the current design as an estimation for the efficiency. In order to implement the efficiency calculation on our air jet impingement design algorithm, a regression of the data presented in Figure 2 was performed. In order to obtain a mathematical expression, the figure adapted from [2] was processed to obtain data points from the curve. A numerical regression was performed with the obtained points. Finally, the following expression, in terms of efficiency (η) and relative air volume (Φ), was obtained: η = 8.0346 × 10 0 Φ 6 − 3.0005 × 10 1 Φ 5 + 4.1693 × 10 1 Φ 4 − 2.3701 × 10 1 Φ 3 + 9.6981 × 10 −1 Φ 2 + 3.0118 × 10 0 Φ The relative air volume is the fraction of the maximum flow that is achieved at the operation point. In our case, the maximum flow provided by the fan is 61 m 3 /h. So, Φ can be calculated as: The design criteria and restrictions are summarized in Table 1. In a previous study [1], the size of the plate was fixed to match the dimension of an industrial insulated gate bipolar transistor (IGBT). In the present work, we aim to cool a hypothetical surface with the same properties as that device, but considerably more prominent. Therefore, the research team decided a new plate size in order to increase the search space for the algorithm. The z/D ratio was set to be equal to 3 according to the results of Xing et al. [24] and Attala et al. [25]. The minimum s/D ratio was also set by the research team in order to set a minimum nozzle-to-nozzle spacing. Finally, the nozzle diameter and the maximum s/D ratio were selected by the research team's criteria. This change in the specifications allows for finding more solutions that are possible and checking the performance of the new algorithm in a better way.

Fitness Function
A multi-objective optimization is proposed in this work. One way to solve this kind of problem is to reduce it to a single optimization problem [1]. Minimizing the temperature (T) of the surface and maximizing η are the main goals. So, in order to implement a single function where the two variables need to be minimized, Equation (3) is presented where the loss of efficiency (1 − η) is added as a minimization criterion: where WT and Wη are two coefficients that weight the temperature and the loss of efficiency. The value of these coefficients is determined by the users, as is explained in the study of Lin et al. [26]. In this work, both coefficients are set to be equal to 0.5. The loss of efficiency is multiplied by a factor of 100 in order to set this value in the same order as the temperature.

Optimization Algorithms
The main task of this work is to find a new stop criterion in order to reduce the computational cost of optimizing the air impingement problem. For this optimization task, the research team propose two different algorithms a GA and a Flower pollination algorithm.
In the present work, the solutions found by the algorithm in each iteration works as the inputs of the neural network, so it is necessary to maintain a high level of diversity throughout the optimization process. Due to the diversity requirement, exploration is predominant over exploitation during the process.

Genetic Algorithm
In Table 2 the algorithm parameters are presented. The number of variables was set to be equal to the number of variables needed to solve the air impingement problem (D and s/D). The rest of the values presented in the table were decided after a preliminary test, where different combinations were analyzed.  Number of variables  2  Population  500  Maximum Generations  500  Elite count 10 Crossover factor 0.5 Tournament number 5 The crossover factor indicates the fraction of particles dedicated to the crossover process. The number of particles destined for the mutation process is the remainder of the total population after the elite count and crossover processes.

GA Parameter Value
An initialization of the variables is necessary to start the optimization process. After the population is initialized randomly, each particle is evaluated by the cost function and the optimization process begins. First, the elite count process is executed. It consists of the selection of k particles with the best cost. The elite count variable indicates the value of k, which is 10 in the present study.
The second process is known as crossover. It consists of a cross of two particles called "parents" to obtain a new particle, the "child". This process can be divided into two steps. The first one is the selection, where a few particles from the population are chosen to be the next parents. Different methodologies can be used to decide which particles will be selected, such as roulette wheel, rank, tournament, or Boltzmann. In a work by Nish [27], a review of these different methods was presented. In the algorithm developed in the present study, the tournament method developed by Abbas [28] is implemented. This method consists of making a random selection of n particles from the population. The value of n is set up by the tournament number variable. Finally, between these n particles, the one with the best cost is selected. Since the selection of the particles is random, these techniques maintain the diversity of the population.
The second step in the crossover process consists of mixing two parents selected by the tournament method and generating a child particle. Equation (4) describes how this child is obtained, where α is a random number between 0 and 1.
The number of children produced in every generation is decided by the crossover factor. In the current case, 250 particles are generated in each generation by this method.
Finally, mutation is the last process that occurs in the GA. The mutation changes the particle randomly, intending to increase the exploration of the algorithm. There are different manners of applying a mutation process. In our case, due to the diversity requirement for the population, the mutation adds new random particles to the population. In each generation, 240 completely new particles are added to the population. After the generation of all the new particles, the former ones are erased and substituted.

Flower Pollination Algorithm
The flower pollination algorithm is implemented following the process described in [8] by Abdel-Basset et al. in Table 3, the main parameters of FPA algorithm are presented. The values are set to be equal to the proposed by Abdel-Basset. The number of iterations and the number of flowers are set to be equal to the values for GA presented in Table 3.

Test Functions
Our algorithm was tested by benchmark functions. A list of these different functions is presented in Table 4. All the information exposed in this table, the function expressions and how to implement them in computers, can be found in [29,30]. These functions can be optimized, considering a significant number of dimensions; see the works of Mirjalili [31] and Evers et al. [32]. In our case, the algorithm only optimized two dimensions in order to mirror the air impingement design problem.

Neural Network Model
After the first test with the benchmark functions, a new functionality was added. In every generation, the value of the particles generated by the mutation process is stored. This continues until the accumulation of data is significant enough to begin the training of the neural network.
The current model is built by supervised training. The cost associated with each particle is used as the target of the training. In Table 5, the model structure and training parameters can be seen.

New Stop Condition
The main objective of this paper is using the neural model explained in the previous section as stop criteria for the optimization process. As the maximum number of generations is 500, our algorithm will perform a training of the network after 50 generations, dividing the process into five steps. After the training, the performance is checked. If it is lower than 2, the optimization ends. In order to check the feasibility of the technique, the test explained in section 2.3 was executed with the addition of these new criteria. Figure 3 shows a flow diagram of the proposed optimization algorithm.
Therefore, this new stop condition brings the following improvements: The optimization algorithm is stopped when the neural network learns the functions. The number of iterations is reduced. If each iteration has a high computational cost, these stop criteria improve the optimization time.

Optimization with Genetic Algorithm
The results of the first test are illustrated in Table 6. Here, the genetic algorithm optimizes eight different equations without any stop condition. The algorithm ends at the moment of reaching the maximum number of generations. Table 6. Genetic algorithm (GA) optimization test summary. The first column shows the mean values of the best results obtained after 20 executions. The second column shows the standard deviations of these results. Finally, the last two columns show the best and worst results obtained.

Tag Mean Best Value Standard Deviation
Best Worst On the other hand, the same test was re-executed with the addition of the stop criteria by the neural network. Table 7 shows the results of the test with the addition of the information about the neural network training. The first four columns contain the same information as Table 6. The last two columns represent the best performance of the neural training and the median of the training performance after 20 executions.

Optimization with Flower Pollination
The eight functions presented in Table 4 are optimized with FPA algorithm. The result of the optimization test is presented in Table 8.  Table 9 shows the results obtained in optimization test with the proposed stop criteria. The values of the training performance are worse than the obtained in the GA test. The low diversity of the flowers in the FPA algorithms and the low variation of the flowers between iterations generates bad training data. 2.28 × 10 7 6.08 × 10 5 2.20 × 10 7 2.37 × 10 7 2.28 × 10 7 6.08 × 10 5 The FPA algorithm, as is explained in [8], only update the flowers values if a new flower with a better solution is found. This is a good feature for the optimization process. However, a dynamic population is required for the approach presented in this work.
Other algorithms presented in the literature and the introduction have a similar problem. The research team implement a GA with modifications in order to obtain a better data training.

Computational Cost Reduction with GA
In order to show how the computational cost is reduced by the new stop criteria, Table 10 is presented. The stop criteria have no effect on functions f2 f5 and f7; this correlates with the data in the previous table. The training performance did not reach the minimum value in any run of the algorithm, showing that the stop criteria do not stop the optimization process. For the other five functions, a 50% reduction in iterations can be appreciated in the worst case. It generally is enough with only 150 iterations, which means three trainings of the network, to learn the function.  f1  100  100  250  f2  500  500  500  f3  100  100  250  f4  150  100  250  f5  500  500  500  f6  100  100  250  f7  500  500  500  f8  100  100  250 In addition, Figure 4 shows how many times the algorithm stops at a certain iteration for each function. In most of the cases, the algorithm stops after executing 100 iterations. Finally, a graphical comparison between the model obtained after the optimization process and the real function is attached in Figure A1 and Figure A2 (a) f1

Tag Generation Reached Mode Best Result Worst Result
(e) f8

Air Impingement Design
The air impingement design problem is solved twice. First time with the GA without the proposed stop criteria. Then the new stop condition is added, and a new test is performed. The results obtained after ten runs of each method are summarized in Table 11.

Air Impingement Design Graphical Analysis
A comparison between the cost surface and the obtained model is presented in Figure 5. In addition, the efficiency and temperature curves are shown.

Testing the Algorithm
First, the eight functions are labeled in two different groups due to the results that appear in the experiments. The first group contains smooth functions (f1, f3, f4, f6, and f8), while the second group includes sharp functions (f2, f5, and f7). Table 6 shows the difference in the results between these two groups of functions. The functions with a smoother shape produce a mean result closer to the minimum. They also have a better best result compared with the sharp functions. This effect agrees with the standard deviation of the test; the sharp functions have the highest deviation due to the many local minima present in them.
The effect of the new stop criteria can be observed in Table 7. The difference between the mean best value achieved by the algorithm with the new stop criteria and the theoretical minimum one is larger than that obtained with the GA without stop criteria. Nonetheless, the solution achieved is good enough for our purposes, and besides, these stop criteria reduce the number of iterations run by the algorithm. Looking at the performance reached in each function, a significant difference is observed between the smooth and sharp functions.
The difference in the behavior of the algorithm between the smooth and sharp functions can also be appreciated in the graphical comparison. The smooth functions seem to be very similar in both cases. However, in sharp functions, a big difference between the plots can be appreciated, especially in the local minimum points. This difference happens because our algorithm does not have enough data to learn the complex shape function.

Applying the Algorithm
As can be appreciated in Figure 5a, the cost function of the air impingement presents a smooth shape, similar to the functions analyzed in the previous section. Because of this, the algorithm presents an excellent way to optimize air jet impingement design. The comparison between the results of both algorithms is presented in Table 7. The addition of the stop criteria shows a similar result to the standard algorithm. The mode of the number of iterations needed to optimize the function is 50. The neural network is capable of learning the cost function after the first 50 iterations of the optimization algorithm. Besides, because the algorithm converges quickly, the solution obtained is good enough. It is also similar to the solution obtained by the GA without the stop condition. Figure 5b and Table 11 show the accuracy of the model. The accuracy is adequate to approximate the cost function.
Finally, the solution obtained satisfies the design criteria. It makes the fan works at a high efficiency point and reduces the temperature to a low point in the curve.

Conclusions
A genetic algorithm optimization is developed in the current work. The points found by the algorithm are used in the training of a neural network model that predicts the cost function. The performance of the training of this ANN is used as a stop criterion for the GA.
The new approach is tested with a Flower pollination algorithm. The lack of diversity and the static population of FPA algorithm shows as a problem for the training process. In order to achieve good training data, the optimization algorithm must have dynamic population between iteration and a high exploration ability.
The new criterion is shown as a good way to stop optimization algorithms that have a smooth cost function, which is the case of the air impingement design. At the same time, the algorithm is capable of learning the cost function. Therefore, this new approach provides two advantages in one algorithm. Due to the requirement of diversity in the population, the number of particles needed to develop this new approach is higher than that of a classical GA. Besides, a better result is obtained due to the fact that the population was split into two subpopulations, one focused on the search task and the other on the optimization. For future work with algorithms that aim to achieve more goals than only an optimization, the division of the population would be crucial.
The normalization of the data before the neural network training improves the results and allows the learning of different functions with only one algorithm. However, as the targets are not normalized, functions that have a large range are more difficult to model. In future works, this would be an excellent addition to the algorithm.
Finally the air impingement design is improved. With this new optimization process, the efficiency of the blower is taken into account, making it work at an operating point close to the optimum. In addition, along with optimization, the algorithm proves to be able to learn the cost function. However, the cooled surface in this article is larger than the existing ones in industrial equipment; therefore, in future work, it would be interesting to obtain similar results by working with smaller surfaces. Funding: The Regional Development Agency of the Basque Country (SPRI) is gratefully acknowledged for economic support through the research project "Refrigeración de dispositivos de alto flujo térmico mediante impacto de chorro" (AIRJET), KK-2018/00109, Programa ELKARTEK. . Graphical representation of the last four processes (f5 to f8). The left column shows the real shape, and the right column shows the shape obtained with the model.