Next Article in Journal
A Combined Model Based on Recurrent Neural Networks and Graph Convolutional Networks for Financial Time Series Forecasting
Next Article in Special Issue
Preface to “Swarm and Evolutionary Computation—Bridging Theory and Practice”
Previous Article in Journal
A Trie Based Set Similarity Query Algorithm
Previous Article in Special Issue
Industrial Demand-Side Management by Means of Differential Evolution Considering Energy Price and Labour Cost
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Optimal Agent Search Using Surrogate-Assisted Genetic Algorithms

1
Department of Computer Science, Kwangwoon University, 20 Kwangwoon-ro, Nowon-gu, Seoul 01897, Republic of Korea
2
School of Software, Kwangwoon University, 20 Kwangwoon-ro, Nowon-gu, Seoul 01897, Republic of Korea
*
Author to whom correspondence should be addressed.
Mathematics 2023, 11(1), 230; https://doi.org/10.3390/math11010230
Submission received: 21 November 2022 / Revised: 29 December 2022 / Accepted: 30 December 2022 / Published: 2 January 2023
(This article belongs to the Special Issue Swarm and Evolutionary Computation—Bridging Theory and Practice)

Abstract

:
An intelligent agent is a program that can make decisions or perform a service based on its environment, user input, and experiences. Due to the complexity of its state and action spaces, agents are approximated by deep neural networks (DNNs), and it can be optimized using methods such as deep reinforcement learning and evolution strategies. However, these methods include simulation-based evaluations in the optimization process, and they are inefficient if the simulation cost is high. In this study, we propose surrogate-assisted genetic algorithms (SGAs), whose surrogate models are used in the fitness evaluation of genetic algorithms, and the surrogates also predict cumulative rewards for an agent’s DNN parameters. To improve the SGAs, we applied stepwise improvements that included multiple surrogates, data standardization, and sampling with dimensional reduction. We conducted experiments using the proposed SGAs in benchmark environments such as cart-pole balancing and lunar lander, and successfully found optimal solutions and significantly reduced computing time. The computing time was reduced by 38% and 95%, in the cart-pole balancing and lunar lander problems, respectively. For the lunar lander problem, an agent with approximately 4% better quality than that found by a gradient-based method was even found.

1. Introduction

1.1. Motivation

Intelligent agents are systems used to achieve various goals in uncertain environments [1]. They receive states and rewards from the environment and select actions through policies that constitute their action probability distributions based on the current state. As the complexity of an agent’s environment space increases, policies can be approximated as deep neural networks (DNNs) [2]. The parameters of these DNNs are optimized through evolution strategies or the gradient descent algorithm using backpropagation [3]. However, these methods are accompanied by simulation-based evaluation for optimization, which incurs enormous costs when applied to expensive real-world environments. Therefore, to reduce the simulation cost, we propose surrogate-assisted genetic algorithms (SGAs) for optimizing the DNN parameters of agents and compare their computational costs and optimization performance with those of a simulation-based method. The proposed SGAs replace the real fitness function of the genetic algorithm (GA) [4,5] with surrogate models that predict cumulative rewards according to the DNN parameters of the agent.

1.2. Contribution

However, SGAs mislead to a false optimum if the fidelity of surrogates is low [6,7]. To solve this problem, we propose three stepwise improvements to increase the surrogate-assisted efficiency associated with the optimization performance of SGAs. The first is to use multiple surrogates, which can reduce the prediction error by combining various machine learning-based classifiers and regressors. The second is data standardization to address overfitting and outlier problems caused by the experimental data. The third is random sampling with dimensional reduction to address the problem of high-dimensional and limited samples, wherein a domain is set up through dimensionality reduction and samples are added to it. We conducted experiments on benchmark environments of cart-pole balancing and lunar lander using the proposed SGAs, and compared their performance and computational costs with the gradient-based baseline method for each environment. The contributions of this paper are as follows: we proposed novel SGAs to optimize DNNs of intelligent agents to reduce computational costs compared to the double deep Q-network and we presented three stepwise improvements that successfully solve the misleading problems of SGAs.

1.3. Organization

The remainder of this paper is organized as follows. Section 2 presents the related research. In Section 3, the structure and techniques of the proposed SGAs with stepwise improvements for optimizing the DNN parameters of intelligent agents are introduced, and the experimental details are presented. In Section 4, the results obtained in the experiments are presented and discussed. Finally, the conclusions and future research directions are presented in Section 5.

2. Related Work

2.1. Surrogate-Assisted Genetic Algorithm

The GA is a global optimization method that mimics natural selection and genetics. Through the computation of the selection and crossover operators, cooperation is achieved among several solutions, which enables a faster optimization search than simple parallel search methods. The GA is applicable to nonlinear or incalculable problems, regardless of the shape of the evaluation functions. Owing to these advantages, the GA is widely used in various fields such as natural science, engineering, humanities, and social sciences [8,9,10]. However, it generally requires evaluating all chromosomes in the population at each generation, which is inefficient if the computational cost of the fitness function is very high. To reduce the fitness function cost, SGA studies have replaced the surrogate model with real fitness functions [11,12,13]. Surrogate-assisted methods have the advantage of reducing evaluation costs, but they can mislead to false optima [14]. To prevent this, a strategy for managing the genetic process or the surrogate model is required. In the genetic process, evolution control involves a hybrid evaluation that evaluates a specific chromosome of a population as the real fitness function [15,16]. Surrogate and surrogated-assisted performances can be degraded by problems such as the curse of dimensionality and lack of environmental data. Degradation of surrogate-assisted performance can be prevented by employing improvement strategies such as multiple surrogates [17] and intelligent data sampling [18].

2.2. Neural Network Optimization of Agents

The learning of intelligent agents used to solve problems is performed by maximizing the cumulative rewards using an unsupervised method [19]. As the problem environment is complex, when the state and action space are represented in high-dimensional space, the agent is approximated by a DNN. Optimizing the DNN parameters of an agent involves two methods. The first is deep reinforcement learning (DRL), wherein the parameters are optimized by computing or approximating the gradient of an agent’s DNN [20]. DRL involves directly learning policies, which are the action probability distributions according to the state, or Q-functions, which represent the state value according to the action in the given state [21,22]. The second method optimizes the agent DNN parameters for GA. Unlike DRL, this method can reduce the computation time by configuring a non-gradient method in parallel. Some studies proposed learning both the topologies and DNN parameters, and showed performance improvements over DRL [23,24]. In this study, we collected experimental points through the learning process of the gradient-based double deep Q-network (DDQN) [25] and designed a surrogate model. We searched for the optimal agent DNN using GAs, which can reduce computing time by parallel structure and on which there have been a lot of prior studies [23,24]. Since the collected experimental points are network parameters of a fixed structure, a conventional GA [26] for optimizing the structure is considered to be suitable.

3. Materials and Methods

3.1. SGA

3.1.1. Encoding and Fitness

In GAs, the solutions to problems are encoded in chromosomes. Encoding is designed in various ways, based on the nature of the problem or the GA operator. In this study, we encoded all weights and biases of DNNs into length- L vectors of 1D real numbers to represent the agent’s DNN (Figure 1). The network θ is an agent DNN and should be satisfied with the range of set Θ of training network in the surrogate model. The first experimental environment, cart-pole balancing, was designed with four architecture cases that were encoded in real numbers with lengths of 23, 35, 37, and 67. The reason for these architecture cases is to minimize the number of parameters encoded. A small number of encoded parameters can avoid the performance degradation of GAs’ computing time and surrogates. The second experimental environment, the lunar lander, requires a more complex architecture for problem solving because its action and state space are more complicated than those of cart-pole balancing. Because the lunar lander has 1476 parameters, the surrogate-assisted performance decreases and the GA computing time increases when encoding all of them. To address this, we measured their Gini importance using DNN parameters and encoded the top 100 parameters. Fitness was used to measure the quality of the solution encoded in the chromosome. Because fitness is used as an indicator for selecting good-quality solutions in selection operations, it is important to design a fitness function according to the GA structure and problem characteristics. We evaluated the chromosome quality using a surrogate model that predicted a cumulative reward for the agent’s DNN parameters.

3.1.2. Selection and Crossover

The selection operation is used to select the parent chromosomes used for crossover generation, and the probability of selecting high−quality chromosomes should be high. In this study, chromosomes were selected based on the quality measured with surrogate assistance. When a roulette-wheel is directly applied to our SGAs, the fitness range of the initial population is very wide due to the penalties of classifiers in the surrogates, which will be described in Section 3.1.4. Therefore, the diversity of GAs may decrease due to premature convergence. To avoid the problem, we adjusted fitness values to increase the probability that low-quality solutions will be selected at early generations. The roulette- wheel method adjusts the population fitness such that the maximum quality is k times the minimum quality, and the parent chromosomes are selected according to the adjusted fitness. k is a selection pressure variable that determines convergence, and as the value increases, the probability deviation selected according to fitness increases. Equation (1) calculates the adjusted fitness f a d j from the existing fitness f is as follows:
f a d j = C m i n f + C m i n C m a x k 1 , k > 1 ,
where C m a x and C m i n the maximum and minimum in existing fitness.
For populations size P , 2 P chromosomes for crossover are selected. Then, the time complexity of the selection operator becomes Θ( P L ), where L is the chromosome length. In this study, we adopted the extended-box crossover because the chromosomes were encoded with real numbers [27]. The extended-box crossover extends the maximum and minimum ranges of each gene of the parent chromosomes using the expansion rate α and selects random real numbers from the extended ranges. Additionally, to reflect the learning domain of the surrogate model, the boundary value was set per gene, and the operator was adjusted such that it did not exceed the boundary. Compared to the box crossover, the extended-box crossover prevents early convergence and bias problem. The time complexity of the extended-box crossover is Θ( L ). The pseudocode of the extended-box crossover is shown in Algorithm 1. In this study, the typical selection pressure k and the expansion rate α were used, as 3 and 0.5, respectively.
Algorithm 1 Extended-box Crossover
Extended-box Crossover (p1, p2)
L:= Chromosome length
for i1 to L
mmin(p1i, p2i), Mmax(p1i, p2i)
emm-α(M-m), eMM+α(M-m)
zi ← a random real number in [max(em, minθ∈Θ θi), min(eM, maxθ∈Θ θi)]
//Θ: set of training networks
//θi: the i-th value of θ encoded by Section 3.1.1
return Z = (z1, z2, …, zL)

3.1.3. Mutation and Replacement

The mutation operator adds diversity to the population to reduce chromosomal similarity and prevent convergence to the local optimum. In this study, we generated random values for each gene in the chromosome, compared them with the threshold to replace them with a random real number, and verified that the replaced gene satisfied the domain range. The mutation rate was set to 0.015, and the rate was chosen as showing the best optimization performance in the range [0, 0.05]. Our mutation operator’s time complexity is Θ( L ). The pseudocode of the mutation is shown in Algorithm 2. The replacement operator replaces the offspring generated by previous operators with parent chromosomes. In this study, generational GA, which replaces all offspring with parents, and elitism, which preserves the highest-quality chromosomes, were used.
Algorithm 2 Mutation
Mutation (Chromosome)
L:= Chromosome length
p:= Mutation rate
for i1 to L
if (random [0, 1) < p)
Chromosome[i] ← random[minθ∈Θ θi, maxθ∈Θ θi]

3.1.4. Surrogate Model with Stepwise Improvement

The surrogate model performance is not a compulsory evaluation factor of SGA; however, the optimization performance may degrade in the surrogate-assisted method. In this study, three stepwise improvements were applied to improve the surrogate-assisted performance. The first involves using an ensemble with multiple homogeneous surrogates, rather than a single surrogate, to improve the performance. The second involves standardization of the input data for surrogate-assisted training. The third involves adding experimental points other than those in the existing simulation-based methods through data sampling. Sampling that reflects the problem domain can improve the performance of the surrogates. We reduced the dimensions through principal component analysis (PCA) and added experimental points that satisfied the domain. In the following, these three stepwise improvements are described in more detail:
  • Heuristic Measure using Multiple Surrogates: The advantage of using ensembles that employ multiple surrogates is that it is possible to address the degradation problem of a single surrogate, and the predicted performance variance helps avoid false optima [28]. In this study, we designed multiple homogeneous surrogates that combine classifiers and regressors designed using the same training data. The fitness function of the proposed surrogate is expressed as the sum of the predicted values of the regressor and output of the classifiers that reflects the penalty weights. The decision boundary of the classifiers is determined by the cumulative reward quality of an agent based on the problem. The heuristic measure that returns the results for the input network θ is expressed as Equation (2). c1 and c2 are classifiers for the input network θ, and have an output value of 1 or 0. r is a regressor and outputs the cumulative reward prediction for θ. pc1 and pc2 are negative penalty constants such that p c 1 p c 2 0 .
    Heuristic   measure ( θ )   = r θ r θ r θ + p c 1 + p c 2       if   c 1 θ = 0 ,       if   c 1 θ = 1         if   c 1 θ = 1     and   c 2 θ = 0 , and   c 2 θ = 1  
  • Data Standardization: Because this study collected experimental points through a gradient-based, we obtained numerous low-quality outliers prior to the convergence to the optimal solution. To prevent performance degradation of the surrogate owing to this problem, we calculated the average m and standard deviation σ for each agent’s DNN parameter and adjusted the input data to have a standard normal distribution. The standardized value Z for the input random variable X is calculated as follows:
    Z = X m σ
  • Random Sampling using PCA: Training data used for designing surrogate models for optimizing DNNs of agents are limited and highly dimensional. This could not sufficiently represent the problem domain, which may deteriorate the quality of surrogate-assisted computation. Data sampling was applied to address this problem, reduce biases, and increase robustness to outliers [29]. However, in the case of higher dimensions, the domain is very wide and it is difficult to add samples. In this study, we reduced the dimensions through PCA [30] and added experimental points randomly and uniformly in the reduced domains. PCA analyzes the correlation between DNN parameters and extracts the principal components representing them, thereby minimizing information loss in high-dimensional spaces and performing dimension reduction that reflects the domain. Figure 2 shows an example of data sampling after 2D reduction through PCA, wherein Figure 2a shows a scatter plot of training data before sampling and Figure 2b shows the scatter plot after performing random data sampling through PCA. From Figure 2b, it can be qualitatively confirmed that the cluster is well-formed according to the decision boundary of the classifier presented in the heuristic measure using multiple surrogates.
The flowchart of the proposed SGA is shown in Figure 3. GA operators designed in Section 3 optimize the encoded parameters of an agent DNN, and the fitness values of the chromosomes are evaluated by surrogate model with stepwise improvements of Section 3.1.4.

3.2. Experiments

3.2.1. Objective for Optimal Agent Search

The purpose of a general agent is to maximize the cumulative reward according to the environment. An agent’s reward function typically takes as input a trajectory, which is a set of sequences of actions and states. The objective function for agent optimization is as follows:
Maximize   t = 1 T E n v R s t , θ s t + F t = 1 T s t , θ s t ,  
where st+1 = EnvN(st, θ(st)) and EnvR(su, θ(su)) = 0 for ut if st is not feasible. θ is an agent DNN, returning an action vector that maximizes the cumulative rewards when st is an input. The output of EnvR is a loss of the reward calculated through the input of agent’s actions. EnvN takes a pair of action and state as input and returns the next state vector at next time step. T is the maximum time step value. F returns the agent’s reward.

3.2.2. Cart-Pole Balancing Problem

In this study, we experimented using cart-pole balancing, a classical continuous control environment that is mainly used as a benchmark in DRL and neuroevolution. Cart-pole balancing comprises a pole l attached through a pivot joint on cart M, as shown in Figure 4. It is a physical system that maintains the attached pole l in a vertical position by moving M in the left and right directions on a frictionless track. In this study, a simulation was performed using the CartPole-v1 environment of the OpenAI Gym toolkit. The state space in question comprised a 4D real number vector, constituting the position and velocity of M and the angle and angular velocity of l. The action space in question comprised a 2D discrete vector constituting the mechanism to push the cart left and right. The end conditions of the environment were as follows: (1) The position of cart M is outside ±2.4, (2) the angle of pole l is outside ±24, and (3) the step reward exceeds 500. When an end condition was not met, the agent received a reward of one for each time step. In this environment, the optimal solution for DNNs is to achieve a cumulative reward of 500 according to the maximum time step. Table 1 presents the environment characteristics of the cart-pole balancing experiment. Cart-pole balancing’s objective function as follows:
Maximize   t = 1 T E n v R s t , θ s t ,  
where st+1 = EnvN(st, θ(st)) and EnvR(su, θ(su)) = 0 for ut if st is not feasible. st is agent’s state vector at time step t. θ is an agent DNN, returning an action vector that maximizes the cumulative rewards when st is an input. EnvR and EnvN are simulation functions that receive state and action vectors at each time step. EnvR returns a reward of time step, and EnvN returns a state at next time step. T is a variable representing the maximum time step value 500.
The following describes the data for surrogate modeling and the design of SGAs in the cart-pole balancing environment in more detail:
  • Surrogate Modeling Data: For designing a surrogate model, pairs of DNN parameters of agents and cumulative reward data according to the DNNs are required. The experimental points were collected through DDQN, which is an off-policy DRL technique. To improve the encoding and computational speed of the SGA, we set it to have a simple DNN architecture. The minimal topology for collecting good solutions was 1 hidden layer and 3 hidden nodes. To measure the performance of the proposed SGAs by network topologies, we set up 4 architecture cases as follows: the number of hidden layers is 1 or 2, and the number of hidden nodes in each layer is 3 or 5. The network collected by DDQN is a fully connected network, and the number of the input and output nodes of cart-pole balancing is 4 and 2, respectively. Therefore, the number of parameters per architecture case are 23 ( = 4 × 3 + 3 + 3 × 2 + 2 ), 37 ( = 4 × 5 + 5 + 5 × 2 + 2 ), 35 ( = 4 × 3 + 3 + 3 × 3 + 3 + 3 × 2 + 2 ), and 67 ( = 4 × 5 + 5 + 5 × 5 + 5 + 5 × 2 + 2 ), respectively. A total of 10,000 data were collected through DDQN learning.
2.
Surrogate-assisted GA for the Cart-pole Balancing Problem: Following the stepwise improvements proposed in Section 3.1.4, we designed surrogate models using the surrogate modeling data. In Step 1, two classifiers and one regressor were combined into multiple heuristic surrogates. The classifiers were designed as DNN-based, and each decision boundary was set as 195 and the median value of the experimental points exceeding 195. The first decision boundary of the classifiers, 195, was the threshold of the previous version, CartPole-v0. The regressor of the initial experiment was a DNN that is a nonlinear method commonly used in surrogates. However, in the GA performance to be described later, DNN cannot search the solution that allows it to achieve the maximum reward of 500 for all network architectures. To improve our SGAs, we replaced the regressor with support vector regression (SVR). SVR is a method that applies support vector machine to regression, and it adjusts the regression line to adding as much data as possible inside the margin. In addition, SVR is robust to outliers and overfitting through an ε-incentive loss function. In Step 2, the learning data of the surrogate was adjusted through standardization. In Step 3, the domain of the surrogate was reduced to 2D through PCA, and 10,000 experimental points were added with the same number as the training data.
Table 2 lists the operators and parameters of the SGA used for the cart-pole balancing problem. We used the surrogate models designed through stepwise improvements for fitness evaluation and computed 30 runs in parallel. The fitness and simulation results of 30 runs were confirmed, and their performances were compared according to the network architecture and surrogate model. Our SGAs’ experiments were conducted in the environment of Table 3.

3.2.3. Lunar Lander

The lunar lander is a classical rocket trajectory problem, wherein the trajectory of the landing craft must be adjusted to ensure that it lands on the landing pad without collision. As shown in Figure 5, the simulation was conducted using LunarLander-v2, a Gym OpenAI Box2D gaming environment. It is evident that the state and action spaces are more complicated than the cat-pole balancing environment, making the agent’s DNN more complex. The state space is an 8D mixed vector comprising the lander coordinates, speed, angle, angular speed, and ground attachment. The action space is a 4D discrete vector comprising do nothing, fire left orientation engine, fire right orientation engine, and fire main engine actions. The agent end condition was configured as follows: (1) the lander touches the ground, (2) the lander is out of the specified x range, and (3) the time step achieves 1000. If the lander reached the landing pad, the agent received a reward; if it moved away, the reward was lost. Additional rewards could be scored based on whether the leg of the lander was in contact with the ground. Finally, if the lander used an engine, the agent lost the reward. The threshold for solving the lunar lander problem was that the average reward of the simulation exceeded 200, which is evaluated as the optimal solution in this environment. The environment characteristics of the lunar lander problem is presented in Table 4. Lunar lander’s objective function as follows:
Maximize   t = 1 T E n v R s t , θ s t + F s T ,  
where st+1 = EnvN(st, θ(st)), EnvR(su, θ(su)) = 0 for ut if st is not feasible, and we meet the end condition, we set T′ as t. st is agent’s state vector at time step t. θ is an agent DNN, returning an action vector that maximizes the cumulative rewards when st is an input. The output of EnvR is a loss of the reward calculated through the input of agent’s actions (Landers’ engine usage). EnvN takes a pair of action and state as input and returns the next state vector at next time step. T is the maximum time step value, and 1000 is used in lunar lander’s environment. F receives sT′ that satisfies the end condition as an input and returns the agent’s reward.
SGA for the Lunar Lander Problem: Similar to the method described in Section 3.2.2, in the lunar lander problem, we attempted to construct the agent’s DNN architecture in a simple manner; however, the architecture that satisfied the threshold comprised 2 hidden layers and 32 hidden nodes. The number of parameters of the designed DNN was 1476, which was approximately 22 times higher than that of the structure with the largest number of parameters in the experimental environment of the cart-pole balancing problem. This may degrade computational speed and surrogate performance. Therefore, we measured the Gini importance for all DNN parameters and used the top 100 parameters in the surrogate model design. In the lunar lander experiment, we designed the surrogate model with Step 3 using SVR, which performed best for the cart-pole balancing problem. The same operator and parameters used in the cart-balancing problem were used in the SGAs for the lunar lander problem, and 30 runs were executed in parallel. In the case of the lunar lander problem, even if optimization is performed through the proposed SGAs, it is necessary to set the remaining 1376 parameters for the simulation. To solve this problem, a group of upper experimental points exceeding the threshold value of 200 was selected. We measured the Euclidean distance of all experimental points of the upper group and the solutions calculated through the SGAs. The simulation was conducted using the parameters of the experimental point that showed the highest similarity.
To help readers reimplement our study, the source codes about our SGAs are available at the site: https://github.com/GoojungMyeon/Mathematics-Surrogate-assisted-Genetic-algorithm (accessed on 20 November 2022).

4. Results and Discussion

4.1. Surrogate Modeling Data

The cumulative reward distribution for each architecture case is shown in Figure 6. The experimental points that achieved the maximum cumulative reward of 500 were collected for all architecture cases. In the simplest case (1, 3), the solution quality was worst, and the most returns were lower than the decision threshold of 195 for the first classifier of the surrogate model described in the cart-pole balancing problem.

4.2. Surrogate-Assisted GA for the Cart-Pole Balancing Problem

We trained and evaluated collecting data of the cart-pole balancing according to stepwise improvements as shown in Table A2 (see Appendix B). In Step 2, wherein the learning data of the surrogate was adjusted through standardization, improvements in both the root mean square error (RMSE) and correlation coefficient were confirmed, except in the (2, 3, 3) case. For all architectures, the RMSE values were improved compared with Step 2, and for the (1, 5) case, the RMSE value in Steps 1–3 was improved the most to 19.2%. Figure 7 shows the RMSE and correlation coefficient values of surrogate models according to the architectures and stepwise improvements.
Table 5 lists the performance results of the proposed SGA for the cart-pole balancing problem according to the surrogate model and the network. It presents the fitness and simulation results of 30 runs. In addition, the hypothesis test results between simulation values according to the SGAs’ surrogate model are also shown. Since the simulation values of SGA are nonparametric and independent, the method of a hypothesis test is Mann–Whitney U; most fitness scores are overestimated compared to the simulation score. In Step 1, multiple surrogates were used, and the regressor was configured as DNN or SVR. When the DNN regressor was used, the maximum cumulative reward could not be determined in all the architecture cases. However, the agent DNN achieved a maximum cumulative reward of 500 in all cases except (1, 3) when the SVR regressor was used. This suggests that in the data distribution discussed in Section 4.1, the (1, 3) case achieved a low optimization performance because many solutions did not satisfy the decision boundary of the first classifier. The results obtained using the Step 2 surrogate model that applied input data standardization were enhanced for all architectures. In the (1, 5) network, the simulation scores of all runs were 500. The last step improved the results for all networks, and an optimum value of 500 was obtained by all runs in the (1, 5) network. The p-value is a significant probability, and it can be analyzed that the difference in variance between two samples is significant when p-value is less than 0.05. When the regressor was changed from DNN to SVR and improvement on Step 2 was applied, p-values was less than 0.5 except the (1, 3) case. Figure 8 shows the computing times of the proposed SGAs and the baseline DDQN for cart-pole balancing optimization. Through DDQN, which was used for collecting experimental points, the time required for searching the maximum cumulative reward was set to the baseline. Although the computing time of the SGAs increased when the stepwise improvement was applied, it is shown that the computing time was reduced in all architectures rather than in baseline. The computing time was reduced in all network experiments using the proposed SGAs, and in the best optimization (1, 5) it was reduced by approximately 38%.

4.3. Results for the Lunar Lander Problem

Like the environment of the cart-pole balancing, our SGAs in the Lunar lander also reduced computing time compared to the baseline. The baseline is the initial discovery time of the achievement of a problem via DDQN for collecting experimental points. The average computing time of 30 runs of our SGA was approximately 18 min and the calculation time of the baseline was 363 min, which was improved approximately 95% over the baseline. Among the 30 runs, 24 exceeded the problem-solving threshold, and the best-performing SGAs explored agent DNNs, which were approximately 4% better than the best solution of the training data of the surrogate (Table 6). Figure 9 shows the best individual average for each generation of the 30 runs.

5. Conclusions

In this study, we proposed novel SGAs for agent’s DNN parameter optimization and conducted experiments to determine an optimal agent. The goal was to reduce computing time over simulation-based methods and to identify an optimal agent DNN. We designed a surrogate model to predict cumulative rewards for agent’s DNN parameters, wherein we proposed three stepwise improvements to prevent convergence misleading, which are disadvantages of existing surrogate-assisted methods. The first step involved using multiple surrogates to prevent the convergence of the approximate performance and false optimum. In the second step, data standardization was applied to prevent performance degradation owing to outliers in the experimental points. Finally, random sampling with PCA was applied to prevent performance degradation owing to the high-dimensional nature and limited number of experimental points. The improvement in performance owing to these stepwise improvements was confirmed through experiments in a cart-pole balancing environment. We identified agents that achieved the maximum reward in all SGAs except for the surrogate model that did not have good-quality experimental points, and reduced the computing time by 38% compared to the DDQN. We also proposed using SGAs in complex problem environments, such as the lunar lander. We proposed a strategy to measure the importance of each parameter when the number of agent’s DNN parameters is high and to design a surrogate model with only some parameters. Consequently, we designed a surrogate model with only 100 parameters selected by Gini importance among the existing 1476, and our SGAs’ performances were better than that of the baseline. The computing time was reduced by approximately 95%, and the quality was even improved by approximately 4%. Through the above experiments, we confirmed that our SGAs can be applied to any discrete and deterministic environment of the action space such as mountain car or Atari video games. However, since our SGAs are offline methods in which high-quality experimental points must be preceded, their performance may be poor if the efficiency of collecting experimental points is low.
In future research, three types of expansion are possible: more complex problems, online learning, and genetic process control. In this study, the action space employed was discrete and deterministic. However, in future studies, it could be applied to a continuous or stochastic action space for experimentation. Additionally, we will investigate whether or not it is applicable to partially observed environments. In this study, the offline method was adopted to collect experimental points; however, this method was inefficient when the quality of the experimental points was poor or the collection cost was high. Therefore, in future experiments, the online learning method of updating the surrogate-assisted for optimization during genetic process will be applied. Finally, the performance improvement will be confirmed through intelligent evolution control, which evaluate specific chromosomes with a real fitness function in the population.

Author Contributions

Conceptualization, Y.-H.K.; methodology, Y.-H.K.; software, S.-S.S.; validation, S.-S.S.; formal analysis, Y.-H.K.; investigation, S.-S.S.; resources, Y.-H.K.; data curation, Y.-H.K.; Writing—Original draft preparation, S.-S.S.; Writing—Review and editing, Y.-H.K.; visualization, S.-S.S.; supervision, Y.-H.K.; project administration, Y.-H.K.; funding acquisition, Y.-H.K. All authors have read and agreed to the published version of the manuscript.

Funding

The present research has been conducted by the Research Grant of Kwangwoon University in 2022. This work was also supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. 2021R1F1A1048466).

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A. Experiments for Surrogate-Assisted Genetic Algorithms According to the Number of Surrogates Samples in the Cart-Pole Balancing

In this appendix, experiments were conducted to examine the appropriate number of samples for the surrogates’ design in cart-pole balancing environment. When each surrogate is applied to a GA, the performance is compared. Surrogates in these experiments were designed with Step 3 SVR in Section 3.1.4. The SGAs for this pilot test used the operators and parameters in Section 3 and performed 30 independent runs. The performances of SGAs according to the number of samples are shown in Table A1. In all the cases, the optimal solution with real fitness 500 was found. In addition, it is shown that the average values among 30 runs of SGA increased as increasing of the sample’s number. Therefore, we set the number of samples in our SGAs to 10,000.
Table A1. Performance of SGAs based on the number of samples in the cart-pole balancing.
Table A1. Performance of SGAs based on the number of samples in the cart-pole balancing.
The Number of SamplesFitnessSimulation
BestAverageSTD.BestAverageSTD.
1000554.068551.1142.077500.000437.360138.333
3000611.015605.5903.745500.000467.87295.159
6000548.681543.4192.957500.000469.74182.721
10,000578.489574.0122.166500.000500.0000.000

Appendix B. Results of the Proposed Surrogates on Each Network Architecture with Stepwise Improvement in the Cart-Pole Balancing

In this appendix, we provide performances of our surrogates on each network architecture with stepwise improvement in the cart-pole balancing. Table A2 shows root mean square error (RMSE), mean percentage error (MPE), mean absolute percentage error (MAPE), and Pearson coefficient (Coef.) values according to surrogate and network architecture.
Table A2. Results of surrogate models in the cart-pole balancing.
Table A2. Results of surrogate models in the cart-pole balancing.
Step 1-DNN
Network(1, 3)/23(1, 5)/37(2, 3, 3)/35(2, 5, 5,)/67
MeasurementRMSEMPEMAPECoef.RMSEMPEMAPECoef.RMSEMPEMAPECoef.RMSEMPEMAPECoef.
Test93.17−101.45120.850.7593.52−52.9070.390.7182.89−41.5360.480.8590.79−29.8846.440.82
Train90.02−86.51106.050.7782.83−45.5861.200.7876.57−39.5456.160.8771.74−22.4235.920.90
Step 1-SVR
Network(1, 3)/23(1, 5)/37(2, 3, 3)/35(2, 5, 5,)/67
MeasurementRMSEMPEMAPECoef.RMSEMPEMAPECoef.RMSEMPEMAPECoef.RMSEMPEMAPECoef.
Test105.99−95.89120.370.67104.70−42.7864.270.6398.72−51.7169.440.7999.72−41.0254.950.79
Train105.29−80.65106.100.68100.95−37.0457.840.6698.09−49.9967.320.8092.54−38.6051.810.82
Step 2-SVR
Network(1, 3)/23(1, 5)/37(2, 3, 3)/35(2, 5, 5,)/67
MeasurementRMSEMPEMAPECoef.RMSEMPEMAPECoef.RMSEMPEMAPECoef.RMSEMPEMAPECoef.
Test88.92−72.3195.110.78103.02−52.1880.330.72103.00−34.6359.080.7778.88−46.4766.190.91
Train83.70−65.8389.290.79102.12−48.2477.560.75102.55−34.2257.860.7877.48−45.1164.040.92
Step 3-SVR
Network(1, 3)/23(1, 5)/37(2, 3, 3)/35(2, 5, 5,)/67
MeasurementRMSEMPEMAPECoef.RMSEMPEMAPECoef.RMSEMPEMAPECoef.RMSEMPEMAPECoef.
Test85.31−65.7987.020.7984.04−53.7480.780.8292.84−27.4747.750.8275.16−42.3660.920.92
Train80.73−59.1081.090.7982.43−50.6078.170.8192.40−27.4946.780.8272.26−41.1658.710.92

References

  1. Stuart, J.R.; Peter, N. Artificial Intelligence: A Modern Approach, 4th ed.; Prentice Hall: Hoboken, NJ, USA, 2020. [Google Scholar]
  2. Otterlo, M.V.; Wiering, M. Reinforcement learning and Markov decision processes. In Reinforcement Learning; Wiering, M., van Otterlo, M., Eds.; Springer: Berlin/Heidelberg, Germany, 2012; Volume 12, pp. 3–42. [Google Scholar] [CrossRef]
  3. Such, F.P.; Madhavan, V.; Conti, E.; Lehman, J.; Stanley, K.O.; Clune, J. Deep neuroevolution: Genetic algorithms are a competitive alternative for training deep neural networks for reinforcement learning. arXiv 2017, arXiv:1712.06567. [Google Scholar]
  4. Katoch, S.; Chauhan, S.S.; Kumar, V. A review on genetic algorithm: Past, present, and future. Multimed. Tools Appl. 2021, 80, 8091–9126. [Google Scholar] [CrossRef] [PubMed]
  5. Mirjalili, S. Genetic Algorithm. In Evolutionary Algorithms and Neural Networks; Springer: Cham, Germany, 2019; pp. 43–55. [Google Scholar] [CrossRef]
  6. Jin, Y. Surrogate-assisted evolutionary computation: Recent advanced and future challenges. Swarm Evol. Comput. 2011, 1, 61–70. [Google Scholar] [CrossRef]
  7. Pei, Y.; Gao, H.; Han, X. A Surrogate Model Based Genetic Algorithm for Complex Problem Solving. In Proceedings of the 6th Annual International Conference on Network and Information Systems for Computers (ICNISC2020), Guiyang, China, 14–15 August 2020. [Google Scholar]
  8. Cho, D.H.; Moon, S.H.; Kim, Y.H. Genetic feature selection applied to KOSPI and cryptocurrency price prediction. Mathematics 2021, 9, 2574. [Google Scholar] [CrossRef]
  9. Kim, Y.H.; Yoon, Y.; Kim, Y.H. Towards a better basis search through a surrogate model-based epistasis minimization for pseudo-Boolean optimization. Mathematics 2020, 8, 1287. [Google Scholar] [CrossRef]
  10. Cho, H.Y.; Kim, Y.H. A Genetic Algorithm to Optimize SMOTE and GAN Ratios in Class Imbalanced Datasets. In Proceedings of the Genetic and Evolutionary Computation Conference Companion, Cancun, Mexico, 8–12 July 2020; pp. 33–34. [Google Scholar] [CrossRef]
  11. Cai, X.; Gao, L.; Li, X. Efficient generalized surrogate-assisted evolutionary algorithm for high-dimensional expensive problems. IEEE Trans. Evol. Comput. 2020, 24, 365–379. [Google Scholar] [CrossRef]
  12. Francon, O.; Gonzalez, S.; Hodjat, B.; Meyerson, E.; Miikkulainen, R.; Qiu, X.; Shahrzad, H. Effective Reinforcement Learning through Evolutionary Surrogate-Assisted Prescription. In Proceedings of the Genetic and Evolutionary Computation Conference, Cancun, Mexico, 8–12 July 2020; pp. 814–822. [Google Scholar] [CrossRef]
  13. Yu, D.P.; Kim, Y.-H. Predictability on Performance of Surrogate-Assisted Evolutionary Algorithm According to Problem Dimension. In Proceedings of the Genetic and Evolutionary Computation Conference Companion, Prague, Czech Republic, 13–17 July 2019; pp. 91–92. [Google Scholar] [CrossRef]
  14. Jin, Y. A comprehensive survey of fitness approximation in evolutionary computation. Soft Comput. 2005, 9, 3–12. [Google Scholar] [CrossRef] [Green Version]
  15. Calisto, M.B.; Lai-Yuen, S.K. EMONAS-Net: Efficient multiobjective neural architecture search using surrogate-assisted evolutionary algorithm for 3D medical image segmentation. Artif. Intell. Med. 2019, 119, 102154. [Google Scholar] [CrossRef] [PubMed]
  16. Sun, Y.; Wang, H.; Xue, B.; Jin, Y.; Ten, G.G.; Zhang, M. Surrogate-assisted evolutionary deep learning using an end-to-end random forest-based performance predictor. IEEE Tran. Evol. Comput. 2019, 24, 350–364. [Google Scholar] [CrossRef]
  17. Pholdee, N.; Baek, H.M.; Bureerat, S.; Im, Y.T. Process optimization of a non-circular drawing sequence based on multi-surrogate assisted meta-heuristic algorithms. J. Mech. Sci. Technol. 2015, 29, 3427–3436. [Google Scholar] [CrossRef]
  18. Vincenzi, L.; Gambarelli, P. A proper infill sampling strategy for improving the speed performance of a surrogate-assisted evolutionary algorithm. Comput. Struct. 2017, 178, 58–70. [Google Scholar] [CrossRef]
  19. Sutton, R.S.; Barto, A.G. Reinforcement Learning: An Introduction; MIT Press: Cambridge, MA, USA, 1998. [Google Scholar] [CrossRef]
  20. Mnih, V.; Kavukcuoglu, K.; Silver, D.; Graves, A.; Antonoglou, I.; Wierstra, D.; Riedmiller, M. Playing Atari with deep reinforcement learning. arXiv 2013, arXiv:1312.5602. [Google Scholar]
  21. Haarnoja, T.; Zhou, A.; Abbeel, P.; Levine, S. Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with A Stochastic Actor. In Proceedings of the International Conference on Machine Learning, Stockholm, Sweden, 10–15 July 2018; pp. 1861–1870. [Google Scholar]
  22. Schulman, J.; Wolski, F.; Dhariwal, P.; Radford, A.; Klimov, O. Proximal Policy Optimization Algorithms. arXiv 2017, arXiv:1707.06347. [Google Scholar]
  23. Hausknecht, M.; Lehman, J.; Miikkulainen, R.; Stone, P. A neuroevolution approach to general Atari game playing. IEEE Tran. Comput. Intell. AI 2014, 6, 355–366. [Google Scholar] [CrossRef] [Green Version]
  24. Stanley, K.O.; Clune, J.; Lehman, H.; Miikkulainen, R. Designing neural networks through neuroevoultion. Nat. Mach. Intell. 2019, 1, 24–35. [Google Scholar] [CrossRef] [Green Version]
  25. Van Hasselt, H.; Guez, A.; Silver, D. Deep Reinforcement Learning with Double Q-Learning. In Proceedings of the AAAI Conference on Artificial Intelligence, Phoenix, AZ, USA, 14–17 February 2016; pp. 2094–2100. [Google Scholar] [CrossRef]
  26. Clune, J.; Stanley, K.O.; Pennock, R.T.; Ofria, C. On the performance of indirect encoding across the continuum of regularity. IEEE Trans. Evol. Comput. 2011, 15, 346–367. [Google Scholar] [CrossRef]
  27. Yoon, Y.; Kim, Y.H.; Moraglio, A.; Moon, B.R. A theoretical and empirical study on unbiased boundary-extended crossover for real-valued representation. Inf. Sci. 2012, 183, 48–65. [Google Scholar] [CrossRef] [Green Version]
  28. Shin, S.S.; Kim, Y.H. A surrogate model-based genetic algorithm for the optimal policy in cart-pole balancing environments. In Proceedings of the Genetic and Evolutionary Computation Conference Companion, Boston, MA, USA, 9–13 July 2022; pp. 503–505. [Google Scholar] [CrossRef]
  29. Zheng, N.; Wang, H.; Yuan, B. An adaptive model switch-based surrogate-assisted evolutionary algorithm for noisy expensive multi-objective optimization. Complex Intell. Syst. 2022, 8, 4339–4356. [Google Scholar] [CrossRef]
  30. Shaukat, S.S.; Rao, T.A.; Khan, M.A. Impact of sample size on principal component analysis ordination of an environmental data set: Effects on eigenstructure. Ekológia 2016, 35, 173. [Google Scholar] [CrossRef]
Figure 1. Example of DNN encoding.
Figure 1. Example of DNN encoding.
Mathematics 11 00230 g001
Figure 2. Scatter plots expressed in 2D through PCA: (a) training data and (b) random sampling added to (a).
Figure 2. Scatter plots expressed in 2D through PCA: (a) training data and (b) random sampling added to (a).
Mathematics 11 00230 g002
Figure 3. Flowchart of the proposed surrogate-assisted genetic algorithm.
Figure 3. Flowchart of the proposed surrogate-assisted genetic algorithm.
Mathematics 11 00230 g003
Figure 4. Example of the cart-pole balancing problem environment.
Figure 4. Example of the cart-pole balancing problem environment.
Mathematics 11 00230 g004
Figure 5. Example of the lunar lander problem environment.
Figure 5. Example of the lunar lander problem environment.
Mathematics 11 00230 g005
Figure 6. Return distribution of each neural network architecture.
Figure 6. Return distribution of each neural network architecture.
Mathematics 11 00230 g006
Figure 7. Performance for each architecture with stepwise improvement. (a) RMSE and (b) Pearson correlation coefficient.
Figure 7. Performance for each architecture with stepwise improvement. (a) RMSE and (b) Pearson correlation coefficient.
Mathematics 11 00230 g007
Figure 8. Calculation times of the baseline DDQN and the proposed SGAs for cart-pole balancing optimization.
Figure 8. Calculation times of the baseline DDQN and the proposed SGAs for cart-pole balancing optimization.
Mathematics 11 00230 g008
Figure 9. Fitness of the proposed SGAs for the lunar lander problem according to generation.
Figure 9. Fitness of the proposed SGAs for the lunar lander problem according to generation.
Mathematics 11 00230 g009
Table 1. Environment of the cart-pole balancing problem.
Table 1. Environment of the cart-pole balancing problem.
Environment PartsValue
Action spaceDiscrete (2)
Observation shapeContinuous (4)
Continuous observation range±[2.4, ∞, 24, ∞]
Table 2. Operators and parameters of the proposed SGA for the cart-pole balancing problem.
Table 2. Operators and parameters of the proposed SGA for the cart-pole balancing problem.
Operator/ParameterValue
Population size100
Number of generations1000
Chromosome lengths23/37/35/67
Selection methodRoulette-wheel
Crossover methodExtended-box
Mutation rate1.5%
ReplacementElitism & Generational
Table 3. Experiments environments.
Table 3. Experiments environments.
CPU (core)AMD Ryzen Threadripper 2990WX (32)
RAM64 GB
Operating systemUbuntu 18.04 LTS
Programming language (version)Python (3.7.11)
Table 4. Lunar lander problem environment.
Table 4. Lunar lander problem environment.
Environments PartsValue
Action spaceDiscrete (4)
Observation shapeMixed (Continuous: 6; Bool: 2)
Continuous observation range±[1.5, 1.5, 5, 5, 3.14, 5]
Table 5. Results of the SGAs for the cart-pole balancing problem according to the network architecture and surrogate model (from 30 runs).
Table 5. Results of the SGAs for the cart-pole balancing problem according to the network architecture and surrogate model (from 30 runs).
Surrogate ModelNetworkFitnessSimulation
BestAverageSTDBestAverageSTDp-Value
DNN
step 1
(1, 3)762.602748.41977.3349.4809.3590.070-
(1, 5)2636.0062414.450412.27288.47011.99014.202-
(2, 3, 3)1936.1461893.75132.74427.29013.7295.578-
(2, 5, 5)13,117.20812,286.410295.6669.4809.3450.080-
SVR
step 1
(1, 3)682.976682.5100.2769.5709.3570.0757.56 × 10−1
(1, 5)991.123920.751151.260500.000333.722184.8312.46 × 10−11
(2, 3, 3)969.271942.01092.769500.00042.093122.3814.62 × 10−3
(2, 5, 5)637.732614.53212.041500.000165.670167.8017.66 × 10−10
SVR
step 2
(1, 3)649.203649.1390.04413.82011.9370.7732.98 × 10−11
(1, 5)585.734573.5163.355500.000500.0000.0005.37 × 10−6
(2, 3, 3)574.514557.82147.189500.000469.50773.1035.29 × 10−9
(2, 5, 5)534.788514.0156.391500.000327.571199.0727.00 × 10−4
SVR
step 3
(1, 3)649.197649.1450.03625.85013.0652.6779.26 × 10−3
(1, 5)578.489574.0122.166500.000500.0000.000N.A.
(2, 3, 3)574.635567.21517.360500.000491.20020.2611.22 × 10−1
(2, 5, 5)534.798510.5366.585500.000259.955201.4001.80 × 10−1
Note: The results of “Fitness” were calculated by each SGA’s surrogate model, and the results of “Simulation” were calculated by a real simulator of cart-pole balancing.
Table 6. Simulation performance of the baseline and the proposed SGAs for the lunar lander problem (from 30 runs).
Table 6. Simulation performance of the baseline and the proposed SGAs for the lunar lander problem (from 30 runs).
Best RewardMean Reward
Baseline303.452216.66 ± 5.056
Proposed SGAsBest
Mean
308.930224.665 ± 5.657
290.352155.297 ± 8.047
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

Shin, S.-S.; Kim, Y.-H. Optimal Agent Search Using Surrogate-Assisted Genetic Algorithms. Mathematics 2023, 11, 230. https://doi.org/10.3390/math11010230

AMA Style

Shin S-S, Kim Y-H. Optimal Agent Search Using Surrogate-Assisted Genetic Algorithms. Mathematics. 2023; 11(1):230. https://doi.org/10.3390/math11010230

Chicago/Turabian Style

Shin, Seung-Soo, and Yong-Hyuk Kim. 2023. "Optimal Agent Search Using Surrogate-Assisted Genetic Algorithms" Mathematics 11, no. 1: 230. https://doi.org/10.3390/math11010230

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