4.2. Proposed Methodology
In this research, we combine basic neural network algorithm methods and genetic algorithms. The neural network is the basis for generating USV motion parameter values, acceleration, and turning angle. The input for the network is the value obtained from the number of
sensors. The sensor used in this research platform is a ray cast. This sensor’s real-world implementation is the same as that of a ray sensor that detects distance values (radar or lidar).
Figure 4 shows the configuration of the sensor embedded in the agent. The three-sensor configuration has direction angles of 45°, 0°, and −45°. The five-sensor configuration has direction angles of 45°, 22.5°, 0°, −22.5°, and −45°. The seven-sensor configuration has direction angles of 67.5°, 45°, 22.5°, 0°, −22.5°, −45°, and −67.5°. The angle 0° is in the same direction as the USV’s rectilinear motion direction.
A neural network consists of three main layers, including the input layer, hidden layer (single or multiple), and output layer [
1]. The inputs from the sensor embedded in USVs are fed to the network with n neurons and m number of layers. During the learning process, the network is optimized based on the parameter of weights and biases. The initial values for weight and bias are randomly generated. In this configuration, the activation function for acceleration is sigmoid, while the steering angle uses the TanH function. The output values range from 0 to 1 for acceleration and from −1 to 1 for the steering angle.
Figure 5 provides a visual representation of the neural network utilized in this study.
In each individual process, the neural network generates a weight value represented as
and a bias value represented as
. The agent, such as an unmanned surface vehicle (USV), associated with a particular neural network model constitutes an individual genome within the population of the genetic input algorithm. In a broader view, the genetic algorithm process is illustrated in
Figure 6 [
27].
- a.
Generate Initial Population
As shown in
Figure 6, the genetic algorithm begins with the process of generating an initial population. In this context, “population” refers to neural networks characterized by random weight and bias parameters. Each genome, representing either an agent or a USV, is depicted using its dedicated neural network model. Each model will be expected as our solution for the path planning task. In our experiment, we continued to create the initial population until we reached the maximum number of genomes within a single generation, which was set at 40 agents. Once this maximum value was reached for a generation, we either reset the process to the current genome or assigned the first genome from the existing population to the new generation’s USV.
The main novelty in this research is related to the fitness function modification. To assess the performance of the pathfinding model generated by the network, we employed a fitness function. A higher fitness value for a generated path or solution indicates a more accurate representation of the path, while a lower fitness value suggests the opposite [
30]. The fitness function is related to the variables of speed, distance, and sensors. The common fitness function for a USV with three input sensors follows Equation (2):
where (
) =
denotes the average speed;
is the average speed multiplier;
denotes the total distance traveled;
is the distance multiplier;
,
, and
are the values of sensor a, sensor b, and sensor c; and
is the sensor multiplier.
If the combination of these three variables shows different values, then the difference will be very small if it is in linear space (illustrated in
Figure 7). If we apply the fitness function in exponential space, the slightly different output fitness values will be more visible because there is the influence of the power values
and
. We also add an inverse of the time parameter so that agents that move in a short time obtain a greater fitness value. Therefore, the form of the proposed fitness function formulation will be as in Equation (3):
where
denotes the number of sensor inputs, T is the execution time, and
is the time multiplier with a constant number. This proposed fitness function modification is expected to produce a GA that can reach a convergent solution more quickly with a shorter USV travel time.
- b.
Repopulation (Generate New Population)
As explained in the GA flowchart in
Figure 6, if one of the networks in the initial population produces a solution that converges or fits the end function, then the learning process will stop. However, very rarely does the initial population produce convergent solutions. If this happens, then the next process is repopulation or generating a new population. The randomly generated population is evaluated or optimized with genetic operators including selection, crossover, and mutation. Following the application of these three operators, the updated population is assessed to determine whether or not the system has generated a convergent solution. If a convergent solution has not yet been achieved, the population will undergo further processing using the genetic operator to produce a convergent solution.
- 1.
Selection
The selection operator operates by choosing individual agents from the population, and this selection can be random or based on their fitness values [
28]. In this stage, we organize and rank the population according to their modified fitness values using Equation (2). The top-performing individuals are chosen as parents to undergo further processing with the next genetic operator. In this study, we identify the best ten agents and the worst four agents for this purpose.
Figure 8 illustrates the selection process of a USV as an agent based on the fitness value.
- 2.
Crossover
In the crossover operator, a higher probability denoted as
is implemented compared to that of other genetic operators. This operator involves exchanging one array or segment of one chromosome with the corresponding segment from another chromosome, and this exchange occurs at a random location. The main purpose of this operator is to facilitate the merging or combination of convergent characteristics in a subspace and to generate expected solutions [
23]. In the context of the USVs, this operator combines all of the network arrays and swaps the entire set of weights and biases between two parent chromosomes to create two offspring chromosomes. This step can be referred to as an exploration process within genetic algorithms [
31].
Figure 9 shows how the USV performs the crossover process.
- 3.
Mutation
The mutation operator operates by randomly flipping selected bits, and the mutation probability,
, is typically set to be smaller than that of other operators. This operator serves to enrich the diversity within the population [
29] and offers a means to break free from local optima [
23]. In the context of the USVs, this operator introduces randomization by altering both the row and column of the weight matrix. It then adjusts the values by adding a random rank value ranging from −1 to 1. This step can be thought of as an exploitation task within the genetic algorithm.
Figure 10 shows the mutation process of the USV.
- c.
End function
The “end” function serves to conclude the iteration process or initiate a new iteration when the USV encounters difficulties in executing the pathfinding task. Specifically, we halt and restart the learning process under the following conditions:
If the USV collides with obstacles or barriers in the environment;
When the agent produces a suboptimal or too-weak solution (determined by both the achieved fitness value and the time iteration);
If the USV submerges below the water’s surface.
Ultimately, the process concludes when the USV successfully reaches the target, completing more than one full round without colliding with any obstacles.
4.3. Performance Evaluation
In this study, we use three parameters to evaluate the performance of the proposed method (the modified neuronal GA) compared to that of the baseline method (the neural network-based GA). These three parameters include convergence speed, travel distance, and travel time. The speed of convergence is determined according to the total number of genomes required by the model to be able to produce. The fewer total genomes needed, the faster a model will produce a convergent solution or path (the USV does not hit an obstacle). In our research, we used 40 genomes for one generation, so the total number of genomes follows Equation (4):
The distance evaluation parameter is determined by the total distance traveled by the USV to make one full rotation on the track (from one point back to the starting point). The total displacement path is described as follows (Equation (5)) [
11]:
where
,
, and
denote the X, Y, and Z coordinate axis values of node
. For the travel time parameter, this is determined based on the time required for the USV to complete one full circle from one place back to the same place. Travel time values are obtained from the simulator platform that we use.
To measure the significance of the performance of the proposed algorithm compared with that of the baseline method, we used the
t-test. This test is commonly employed when we have two sets of data and want to assess whether or not any observed differences between them are statistically significant. Therefore, the
t statistic for a paired
t-test is as follows [
32]:
where
denotes the mean of the differences between paired observations,
is the standard deviation of the differences, and
is the number of pairs (or the sample size). This
t Stat value will be compared with the
t Critical value to determine whether the performance of the proposed method produces a significant increase or not. If
t Stat >
t Critical, or
p-Value < alpha, then we can conclude that the increase in the performance of the proposed method is significant, and vice versa.