# A Collision Avoidance Method for Intelligent Ship Based on the Improved Bacterial Foraging Optimization Algorithm

Authors: Xingzhong Wang; Xinghua Kou; Jinfeng Huang; Xianchun Tan
Journal: Journal of Robotics
 (2021)

---

## Abstract

The bacterial foraging optimization algorithm (BFOA) is an intelligent population optimization algorithm widely used in collision avoidance problems; however, the BFOA is inappropriate for the intelligent ship collision avoidance planning with high safety requirements because BFOA converges slowly, optimizes inaccurately, and has low stability. To fix the above shortcomings of BFOA, an autonomous collision avoidance algorithm based on the improved bacterial foraging optimization algorithm (IBFOA) is demonstrated in this paper. An adaptive diminishing fractal dimension chemotactic step length is designed to replace the fixed step length to achieve the adaptive step length adjustment, an optimal swimming search method is proposed to solve the invalid searching and repeated searching problems of the traditional BFOA, and the adaptive migration probability is developed to take the place of the fixed migration probability to prevent elite individuals from being lost in BOFA. The simulation of benchmark tests shows that the IBFOA has a better convergence speed, optimized accuracy, and higher stability; according to a collision avoidance simulation of intelligent ships which applies the IBFOA, it can realize the autonomous collision avoidance of intelligent ships in dynamic obstacles environment is quick and safe. This research can also be used for intelligent collision avoidance of automatic driving ships.


---

## Body

## 1. Introduction

The intelligent navigation is the future development direction of ships and an important part of intelligent ships. It adopts the computer technology, control technology, etc. to analyze and process the sensed and acquired information, design and optimize the ship’s route and speed, and navigate autonomously by achieving automatic collision avoidance in open waters, narrow waterways, and complex environmental conditions with the help of shore-based support center [1]. Autonomous collision avoidance planning is an important technology in the field of intelligent navigation [2], the foundation for a ship to perform tasks, and reflects its intelligence [3]. Partial autonomous collision avoidance means that the intelligent ship can effectively and quickly adjust its speed and course and avoid floating obstacles on the water, such as ships and mobile objects, autonomously and safely [4, 5].At present, experts and scholars principally achieve the collision avoidance planning of intelligent ships with partial planning and intelligent algorithms [6]. An autonomous collision avoidance method for ships, which was put forward by Kuwata and his team and based on speed obstacles in a dynamic environment, has included the Convention on the International Regulations for Preventing Collisions at Sea (COLREGS) and established a collision-avoidance formula [7], but it results in a slow collision avoidance since the collision avoidance formula incorporates dynamic and static obstacles and fails to simplify the rule, which leads to a complex algorithm. Referring to the classic ant colony algorithm, Song has carried out a grid modeling intelligent ship path planning in a complex environment [8]; however, optimization efficiency is low because of the limitation by the classic ant colony algorithm [9]. Zhang et al. came up with a new adaptive intelligent ship avoidance algorithm based on the reinforcement learning of collision avoidance rules. The algorithm can guide the intelligent ship to avoid obstacles through the local obstacle avoidance module and the adaptive learning module, but the learning process of the algorithm is too complicated and difficult to plan the path in a dynamic and complex environment [10]. Liu [11] suggested a nonlinear decreasing step size, improved the replication and migration, and increased the global optimization ability and convergence speed of the BFOA, but the stability of the algorithm was poor. Scholars later indicated a bacterial foraging algorithm with adaptive fractal dimension step size, which can optimize quickly, but its stability and accuracy are poor [12]. Afterward, scholars optimized the path of the intelligent ship with the improved ant colony algorithm. The parameter is improved by adding the direction angle weight to the selection probability, and then, the algorithm can converge faster and its searchability is enhanced; however, the accuracy and stability of later optimization are still low [13]. Chen [14] improved the artificial potential field method by amending the gravitational and repulsive potential field functions and conducted the path planning of the intelligent ship, but a local minimum point problem still existed. Liu [15] used the fast-travel method to plan the collision avoidance of intelligent ships, but the generated path is too far away from obstacles and too long. The velocity obstacle (VO) approach was first used in the robotic field and now is widely applied in the collision avoidance of intelligent ship [16]. According to the method, a cone-shaped space is generated on the obstacles and an intelligent ship outside the space, which is impossible to crash. Since the method is efficient, a combination of VO algorithm and COLREGS rules is now the direction of many scholars’ researches [17–19]. Liu [20] and Ma [21] illustrate two particle swarm bacterial foraging intelligent algorithm in ship collision avoidance, but the motion of obstacles in the references is simple uniform rectilinear motion which has no change in velocity and heading and has the shortcomings of slow convergence speed, low optimization precision, and low stability. Yoshiaki [22] presented a theory to generate conic obstacles in the velocity space of the intelligent ship and measure the risk of collision in different conic zones based on the COLREGS; the results of the collision avoidance experiment in a multiobstacle environment show that the method has a considerable success rate, and the convergence speed can be improved a lot. In view of the existing shortcomings, the author proposed the intelligent ship autonomous collision avoidance algorithm with IBFOA, which improves the chemotaxis step size, swimming, and migration operations of the traditional BFOA. The simulation of the function test shows that the convergence speed, optimization accuracy, and stability of the improved algorithm are improved. The result of collision avoidance simulation of smart ships after IBFOA is used and shows that the improved algorithm can realize the autonomous collision avoidance of smart ships under dynamic obstacles quickly and safely.In Section2, the motion model based on the VO algorithm was briefly introduced. In Section 3, the IBFOA is discussed in detail, and the effectiveness of the algorithm was verified by simulation experiments and the results and detail analysis are presented in Section 4. Section 5 gives the conclusion of the article.


## 2. Collision Avoidance Model Based on Speed Obstacles

The automatic identification system (AIS) is developed from the identification friend-or-foe system ships and aircraft, and it cooperates with the global positioning system (GPS) to integrate static data such as the ship’s name, call sign, length, width, draft, ship code, communication service identification code, ship type, dangerous goods, and dynamic information such as ship position (latitude and longitude), ship speed, and rate of changing course and course. Broadcasting to shore stations and vessels in adjacent water via very high frequency (VHF) enables local ships to grasp the dynamic and static information of nearby ships in real time and then takes necessary measures to avoid collisions, which is an advanced navigation aid system and has a higher accuracy compared with radar. The intelligent ship considered in this paper obtains the motion information of the obstacle ship through the AIS system, so no observation error exists. As shown in Figure1, given an intelligent ship with shape A and a moving ship with shape B and their velocity vectors to be vR and vo, respectively. The identification zone of the intelligent ship is defined as C, which is determined by the AIS and the reaction demand for avoidance. The domain of the moving ship is D, which is used to represent the area of an obstacle that needs to be kept away from. A∈C and B∈D. Both C and D are considered as circles because circles are more convenient for designing the obstacle avoidance algorithm, and the moving parameters of the intelligent ship can be calculated faster. As D enters C, the intelligent ship should decide whether and how to avoid the obstacle.Figure 1
The motion model of the intelligent ship and an obstacle boat.The motion model based on the VO method is shown in Figure2. R stands for the intelligent ship; the circle O stands for the domain around the obstacle. According to Figure 2, the velocity vector of the intelligent ship and the obstacle, vR and vo, could also be represented as oX and vo,β, respectively. α=∡X,vR, β=∡X,vo, θ=∡X,RO, ψ=∡X,Δv, γ=∡RO,Δv, φ=∡Δv,vR, η=∡vo,Δv, μ=∢RO,RT, and λ=∢vo,vR, where “∡a,b” donates the angle that the vector a rotates to the vector b through the minor arc side, and it can be either positive or negative depending on whether the rotation is in the anticlockwise direction or clockwise direction. ∢c,d donates an invariably positive angle, and it represented the angle between the vector c and the vector d. a, b, c, and d are variables used to state the symbols ∡ and ∢, and they are replaced by specific points in the figure to express a certain meaning. RT (RT1 and RT2) represents two tangents from R to the obstacle O.Figure 2
The intelligent ship and the velocity obstacle.Figure2 shows that the intelligent ship is impossible to collide with the obstacle if ψ. Based on the velocity vector triangle formed by vR, v0, and Δv, we get(1)vosinα−β=−Δvsinφ,vR−vocosα−β=Δvcosφ,vR2+vo2−2vRvocosα−β=Δv2,vRsinβ−α=Δvsinη,vo−vRcosβ−α=Δvcosη.From the above equation set, the following equation can be derived:(2)γ=tan−1vRsinα−θ−vosinβ−θvRcosα−θ−vocosβ−θ.Taking a derivative of equation (2), the following equation is obtained:(3)Δγ=sinφΔvΔvR+vRcosφΔvΔα+−sinηΔvΔvo+vocosηΔvΔβ.So, if the obstacle velocityvo, course β, and their changes Δvo and Δβ are acquired from the AIS data, Δγ could be altered by adjusting the intelligent ship velocity vR and the course α.The aim of the algorithm is to adjustγ to satisfy γ+Δγ≥μ.The collision avoidance schemes are described as(4)Δγ≥μ−γ,ifγ>0,Δγ≤−μ−γ,ifγ<0.


## 3. The Autonomous Collision Avoidance Algorithm Established on IBFOA

### 3.1. Basic Principles of the Bacterial Foraging Optimization Algorithm (BFOA)

The bacterial foraging optimization algorithm (BFOA) is a new type of swarm intelligence optimization algorithm proposed by K.M. Passino based onEscherichia coli (E. coli) foraging behavior in 2002. This algorithm has the advantages of global optimization, easy to jump out of local optimization, parallel search, and strong robustness; in the BFO algorithm, the position of bacteria in the search space corresponds to the solution of the optimization problem, and the fitness value of the optimization function, which is the objective function, represents the optimization degree solution. The BFOA solves the problem by simulating the four behaviors of bacteria: chemotaxis, aggregation, replication, and migration:(1)
Chemotaxis: the behavior that bacteria tend to the eutrophic area when foraging is called chemotaxis. During the chemotaxis, the bacteria will perform two kinds of movement: veer and swimming. The veer is to move a unit step in a new direction, that is, turn to a new direction; if the fitness value is improved after turning, move a few steps in this direction until the fitness value no longer improves, which is called swimming. The mathematical expression of chemotaxis is shown as follows:(5)θij+1,k,l=θij,k,l+CiΔiΔTiΔi.In the formula,θij,k,l indicates the position of the bacteria i after chemotaxis at the j-th time, replicated at the k-th time, and dispersed after the l-th time; Ci is the chemotaxis step of bacteria; and Δi is a unit vector of bacteria in a random direction in the search space.(2)
Aggregation: when bacteria are foraging, there are gravitational and repulsive forces between individuals. Gravity causes bacteria to gather more nutrient-rich areas, and repulsion forces each bacterium to have a certain foraging area in the search space. The algorithm expresses bacterial aggregation behavior through the following formula:(6)Jccθ,Pj,k,l=∑i=1SJccθ,θij,k,l=∑i=1S−daexp−wa∑m=1pθm−θim2+∑i=1S−hrexp−wr∑m=1pθm−θim2.In the formula,da is the depth of gravity, wa is the width of gravity, hr is the height of repulsion, wr is the width of repulsion, θim is the m-th component of bacteria i, and θm is the m-th component of all other bacteria.(3)
Replication: bacterial evolution obeys “survival of the fittest,” the weaker foraging ability half of the bacteria (referring to the fitness value, that is, the objective function value is large because the article seeks the minimum value of the objective function) will be eliminated. Another half of the bacteria will replicate:(7)Jhealthi=∑i=1Nc+1Ji,j,k,l.The formula (7) is called the health function (energy function) of bacteria i. The larger the value, the stronger the foraging ability of bacteria i. After sorting Jhealthi, the algorithm will discard half of the bacteria with less health and copy the other half with greater health. This behavior improves the foraging ability of bacteria on the premise that the number of bacteria remains unchanged and is more conducive to the algorithm to find the global optimal solution.(4)
Migration: if the environment of the bacteria gradually changes or mutates, the bacteria would randomly migrate to a new area to cope with this change. The algorithm is given a migration probabilityPed to simulate this behavior, and any individual bacteria will die and generate new bacteria in a new area when the probability is satisfied. This behavior is conducive to the algorithm to jump out of the local optimal solution.


### 3.2. Improvement of Bacterial Foraging Optimization Algorithm (IBFOA)

#### 3.2.1. Adaptive Decreasing Fractal Dimension Chemotaxis Step Size

The chemotaxis step length of the basic BFOA is a constant, so the step length is completely the same in the algorithm iteration process, which affects the convergence speed and optimization accuracy of the algorithm. Two improvement approaches for constant step length are shown in the following equations:(8)C=Cmin+Cmax−Cmin×cosgengenmπ.In the formula,C is the step length, gen is the iterations, and genm is the maximum iterations:(9)Cd=cos2πangle360×stepdj+k+l.In the formula,Cd is the d-th dimension step length, angle is the random number on 0,360, stepd is the original step length of d-th dimension, and j, k, and l are current chemotaxis counts, replication counts, and migration counts, respectively.The improved chemotaxis step size shown in formula (8) depends on the choice of Cmax and Cmin; however, a good empirical formula has not been developed for the selection of Cmin, the decreasing change based on cosine is not obvious, and the improvement of the algorithm convergence speed and optimization accuracy is limited. Equation (9) limits the change in step size reduction with j+k+l and adopts the cos2πangle/360 control the optimizing forward direction; as a result, a lot of useless calculations are carried out, which makes the algorithm convergence speed decrease. In this paper, the above improvements are integrated according to the idea of adaptive decrement: abandon Cmin and choose Cmax based on experience as a quarter of the d-th dimension optimization space range; change the decremental change to the multiplication, which makes the step changes faster in the early stage, and approach the optimal value quickly, and more attention would be paid to the small local optimization in the later stage, which can search more accurate; the random step length control of the rand function is used to replace the direction control of equation (9), which greatly reduces the computational complexity of the algorithm. The improved self-adaptive decreasing fractal dimension chemotaxis step length formula is shown in the following formula:(10)Cd=Cmaxj×k×l×rand.In the formula,Cmax=MAXd−MINd/4, MAXd is the maximum value of the d-dimensional optimization range, MINd is the minimum value of the d-th dimension optimization range, rand is a random number between [0,1], and j, k, and l are current chemotaxis counts, replication counts, and migration counts, respectively.The improved chemotaxis step length allows each bacterium to advance in different dimensions with different step lengths, the early search efficiency is high, and the later search accuracy is high, which improves the convergence speed and optimization accuracy of the algorithm.


#### 3.2.2. Optimal Swimming Search Method

The basic BFOA will judge the fitness value after each step of the swimming. If the new fitness value at the new position is increased, the swimming would continue. Although this kind of movement can theoretically perform the algorithm, it has an inevitable shortcoming: in an iteration, once the bacteria swim to a disadvantaged position, they cannot return to the superior position, nor continue swimming, or repeat swimming at the same position, which makes the algorithm convergence slower and the calculation is wasted.To deal with the above problem, an optimal swimming search method is demonstrated in this article. During the swimming, the bacteria would detect the fitness value of the next swimming position, which is called the intelligent search; if the fitness value is better than the value of the previous position, the bacteria will move to the new position, or it would stop swimming. This method can prevent bacteria from moving to a bad position and increase the calculation speed greatly; the improved swimming method is shown in Figure3.Figure 3
Seeking better fitness value ahead of time for moving.


#### 3.2.3. Adaptive Migration

The migration probability of the traditional BFOA is a certain valuePed, and the bacteria of different health levels are all migrated according to Ped, which may force the bacteria near the optimal position to migrate. This situation would cause the loss of elite individuals, solution degradation, and the decreasing convergence speed, accuracy, and stability. An adaptive migration probability referring to the idea of roulette is proposed in this article, as shown in the following equation:(11)Pselfi=Jhealthmax−JhealthiJhealthmax−Jhealthmin×Ped.Adopting the adaptive migration probability makes the migration probability of bacteria with a higher health degree smaller, and the probability of bacteria migration with a lower health degree higher. According to the roulette theory, the bacteria with the smallestJhealth would migrate, which greatly increases the ability for searching the optimal swimming, and the convergence speed, accuracy, and the stability of the algorithm.


### 3.3. Developing the Collision Avoidance Strategy

In the actual process of autonomous collision avoidance of intelligent ships, it is not easy to achieve collision avoidance by simply changing the course or speed, so the speed and course of the smart ship are simultaneously adjusted to avoid obstacles. When avoiding obstacles, the IBFOA is applied to solve the optimaldvR and dα that satisfy formula (5) at any collision avoidance timing, that is, to solve the optimization problem, as follows:(12)fx1,x2=minm1x1+m2x2,sinφΔvx1+vRcosφΔvx2≥μ−γ,ifγ≥0,sinφΔvx1+vRcosφΔvx2≤−μ−γ,ifγ<0.In the formula,x1=dvR and x2=dα are the unknowns we need to figure out, and other parameters are known quantities. fx1,x2 is the objective function (fitness function), which is defined as the comprehensive change in the speed and direction of the intelligent ship in each cycle. The smaller the change, the smoother the movement, so under the premise of ensuring the safety of collision avoidance, the lower the fitness value, the better the outcome. m1,m2 is the weight of x1,x2 in the objective function, and the value of m1,m2 reflects the priority of speed adjustment and course adjustment; since the changing course is more effective in avoidance, m2 is much larger than m1.The IBFOA is used to develop the collision avoidance strategy, and the optimaldvR and dα should follow the actual acceleration and steering capabilities of the intelligent ship, which may cause the intelligent ship to be unable to successfully avoid obstacles in a collision-avoidance cycle, so the expansion of the arena and ship obstacles is considered to ensure that the smart ship has sufficient time to complete the obstacle avoidance action during the avoidance of collisions.


## 3.1. Basic Principles of the Bacterial Foraging Optimization Algorithm (BFOA)

The bacterial foraging optimization algorithm (BFOA) is a new type of swarm intelligence optimization algorithm proposed by K.M. Passino based onEscherichia coli (E. coli) foraging behavior in 2002. This algorithm has the advantages of global optimization, easy to jump out of local optimization, parallel search, and strong robustness; in the BFO algorithm, the position of bacteria in the search space corresponds to the solution of the optimization problem, and the fitness value of the optimization function, which is the objective function, represents the optimization degree solution. The BFOA solves the problem by simulating the four behaviors of bacteria: chemotaxis, aggregation, replication, and migration:(1)
Chemotaxis: the behavior that bacteria tend to the eutrophic area when foraging is called chemotaxis. During the chemotaxis, the bacteria will perform two kinds of movement: veer and swimming. The veer is to move a unit step in a new direction, that is, turn to a new direction; if the fitness value is improved after turning, move a few steps in this direction until the fitness value no longer improves, which is called swimming. The mathematical expression of chemotaxis is shown as follows:(5)θij+1,k,l=θij,k,l+CiΔiΔTiΔi.In the formula,θij,k,l indicates the position of the bacteria i after chemotaxis at the j-th time, replicated at the k-th time, and dispersed after the l-th time; Ci is the chemotaxis step of bacteria; and Δi is a unit vector of bacteria in a random direction in the search space.(2)
Aggregation: when bacteria are foraging, there are gravitational and repulsive forces between individuals. Gravity causes bacteria to gather more nutrient-rich areas, and repulsion forces each bacterium to have a certain foraging area in the search space. The algorithm expresses bacterial aggregation behavior through the following formula:(6)Jccθ,Pj,k,l=∑i=1SJccθ,θij,k,l=∑i=1S−daexp−wa∑m=1pθm−θim2+∑i=1S−hrexp−wr∑m=1pθm−θim2.In the formula,da is the depth of gravity, wa is the width of gravity, hr is the height of repulsion, wr is the width of repulsion, θim is the m-th component of bacteria i, and θm is the m-th component of all other bacteria.(3)
Replication: bacterial evolution obeys “survival of the fittest,” the weaker foraging ability half of the bacteria (referring to the fitness value, that is, the objective function value is large because the article seeks the minimum value of the objective function) will be eliminated. Another half of the bacteria will replicate:(7)Jhealthi=∑i=1Nc+1Ji,j,k,l.The formula (7) is called the health function (energy function) of bacteria i. The larger the value, the stronger the foraging ability of bacteria i. After sorting Jhealthi, the algorithm will discard half of the bacteria with less health and copy the other half with greater health. This behavior improves the foraging ability of bacteria on the premise that the number of bacteria remains unchanged and is more conducive to the algorithm to find the global optimal solution.(4)
Migration: if the environment of the bacteria gradually changes or mutates, the bacteria would randomly migrate to a new area to cope with this change. The algorithm is given a migration probabilityPed to simulate this behavior, and any individual bacteria will die and generate new bacteria in a new area when the probability is satisfied. This behavior is conducive to the algorithm to jump out of the local optimal solution.


## 3.2. Improvement of Bacterial Foraging Optimization Algorithm (IBFOA)

### 3.2.1. Adaptive Decreasing Fractal Dimension Chemotaxis Step Size

The chemotaxis step length of the basic BFOA is a constant, so the step length is completely the same in the algorithm iteration process, which affects the convergence speed and optimization accuracy of the algorithm. Two improvement approaches for constant step length are shown in the following equations:(8)C=Cmin+Cmax−Cmin×cosgengenmπ.In the formula,C is the step length, gen is the iterations, and genm is the maximum iterations:(9)Cd=cos2πangle360×stepdj+k+l.In the formula,Cd is the d-th dimension step length, angle is the random number on 0,360, stepd is the original step length of d-th dimension, and j, k, and l are current chemotaxis counts, replication counts, and migration counts, respectively.The improved chemotaxis step size shown in formula (8) depends on the choice of Cmax and Cmin; however, a good empirical formula has not been developed for the selection of Cmin, the decreasing change based on cosine is not obvious, and the improvement of the algorithm convergence speed and optimization accuracy is limited. Equation (9) limits the change in step size reduction with j+k+l and adopts the cos2πangle/360 control the optimizing forward direction; as a result, a lot of useless calculations are carried out, which makes the algorithm convergence speed decrease. In this paper, the above improvements are integrated according to the idea of adaptive decrement: abandon Cmin and choose Cmax based on experience as a quarter of the d-th dimension optimization space range; change the decremental change to the multiplication, which makes the step changes faster in the early stage, and approach the optimal value quickly, and more attention would be paid to the small local optimization in the later stage, which can search more accurate; the random step length control of the rand function is used to replace the direction control of equation (9), which greatly reduces the computational complexity of the algorithm. The improved self-adaptive decreasing fractal dimension chemotaxis step length formula is shown in the following formula:(10)Cd=Cmaxj×k×l×rand.In the formula,Cmax=MAXd−MINd/4, MAXd is the maximum value of the d-dimensional optimization range, MINd is the minimum value of the d-th dimension optimization range, rand is a random number between [0,1], and j, k, and l are current chemotaxis counts, replication counts, and migration counts, respectively.The improved chemotaxis step length allows each bacterium to advance in different dimensions with different step lengths, the early search efficiency is high, and the later search accuracy is high, which improves the convergence speed and optimization accuracy of the algorithm.


### 3.2.2. Optimal Swimming Search Method

The basic BFOA will judge the fitness value after each step of the swimming. If the new fitness value at the new position is increased, the swimming would continue. Although this kind of movement can theoretically perform the algorithm, it has an inevitable shortcoming: in an iteration, once the bacteria swim to a disadvantaged position, they cannot return to the superior position, nor continue swimming, or repeat swimming at the same position, which makes the algorithm convergence slower and the calculation is wasted.To deal with the above problem, an optimal swimming search method is demonstrated in this article. During the swimming, the bacteria would detect the fitness value of the next swimming position, which is called the intelligent search; if the fitness value is better than the value of the previous position, the bacteria will move to the new position, or it would stop swimming. This method can prevent bacteria from moving to a bad position and increase the calculation speed greatly; the improved swimming method is shown in Figure3.Figure 3
Seeking better fitness value ahead of time for moving.


### 3.2.3. Adaptive Migration

The migration probability of the traditional BFOA is a certain valuePed, and the bacteria of different health levels are all migrated according to Ped, which may force the bacteria near the optimal position to migrate. This situation would cause the loss of elite individuals, solution degradation, and the decreasing convergence speed, accuracy, and stability. An adaptive migration probability referring to the idea of roulette is proposed in this article, as shown in the following equation:(11)Pselfi=Jhealthmax−JhealthiJhealthmax−Jhealthmin×Ped.Adopting the adaptive migration probability makes the migration probability of bacteria with a higher health degree smaller, and the probability of bacteria migration with a lower health degree higher. According to the roulette theory, the bacteria with the smallestJhealth would migrate, which greatly increases the ability for searching the optimal swimming, and the convergence speed, accuracy, and the stability of the algorithm.


## 3.2.1. Adaptive Decreasing Fractal Dimension Chemotaxis Step Size

The chemotaxis step length of the basic BFOA is a constant, so the step length is completely the same in the algorithm iteration process, which affects the convergence speed and optimization accuracy of the algorithm. Two improvement approaches for constant step length are shown in the following equations:(8)C=Cmin+Cmax−Cmin×cosgengenmπ.In the formula,C is the step length, gen is the iterations, and genm is the maximum iterations:(9)Cd=cos2πangle360×stepdj+k+l.In the formula,Cd is the d-th dimension step length, angle is the random number on 0,360, stepd is the original step length of d-th dimension, and j, k, and l are current chemotaxis counts, replication counts, and migration counts, respectively.The improved chemotaxis step size shown in formula (8) depends on the choice of Cmax and Cmin; however, a good empirical formula has not been developed for the selection of Cmin, the decreasing change based on cosine is not obvious, and the improvement of the algorithm convergence speed and optimization accuracy is limited. Equation (9) limits the change in step size reduction with j+k+l and adopts the cos2πangle/360 control the optimizing forward direction; as a result, a lot of useless calculations are carried out, which makes the algorithm convergence speed decrease. In this paper, the above improvements are integrated according to the idea of adaptive decrement: abandon Cmin and choose Cmax based on experience as a quarter of the d-th dimension optimization space range; change the decremental change to the multiplication, which makes the step changes faster in the early stage, and approach the optimal value quickly, and more attention would be paid to the small local optimization in the later stage, which can search more accurate; the random step length control of the rand function is used to replace the direction control of equation (9), which greatly reduces the computational complexity of the algorithm. The improved self-adaptive decreasing fractal dimension chemotaxis step length formula is shown in the following formula:(10)Cd=Cmaxj×k×l×rand.In the formula,Cmax=MAXd−MINd/4, MAXd is the maximum value of the d-dimensional optimization range, MINd is the minimum value of the d-th dimension optimization range, rand is a random number between [0,1], and j, k, and l are current chemotaxis counts, replication counts, and migration counts, respectively.The improved chemotaxis step length allows each bacterium to advance in different dimensions with different step lengths, the early search efficiency is high, and the later search accuracy is high, which improves the convergence speed and optimization accuracy of the algorithm.


## 3.2.2. Optimal Swimming Search Method

The basic BFOA will judge the fitness value after each step of the swimming. If the new fitness value at the new position is increased, the swimming would continue. Although this kind of movement can theoretically perform the algorithm, it has an inevitable shortcoming: in an iteration, once the bacteria swim to a disadvantaged position, they cannot return to the superior position, nor continue swimming, or repeat swimming at the same position, which makes the algorithm convergence slower and the calculation is wasted.To deal with the above problem, an optimal swimming search method is demonstrated in this article. During the swimming, the bacteria would detect the fitness value of the next swimming position, which is called the intelligent search; if the fitness value is better than the value of the previous position, the bacteria will move to the new position, or it would stop swimming. This method can prevent bacteria from moving to a bad position and increase the calculation speed greatly; the improved swimming method is shown in Figure3.Figure 3
Seeking better fitness value ahead of time for moving.


## 3.2.3. Adaptive Migration

The migration probability of the traditional BFOA is a certain valuePed, and the bacteria of different health levels are all migrated according to Ped, which may force the bacteria near the optimal position to migrate. This situation would cause the loss of elite individuals, solution degradation, and the decreasing convergence speed, accuracy, and stability. An adaptive migration probability referring to the idea of roulette is proposed in this article, as shown in the following equation:(11)Pselfi=Jhealthmax−JhealthiJhealthmax−Jhealthmin×Ped.Adopting the adaptive migration probability makes the migration probability of bacteria with a higher health degree smaller, and the probability of bacteria migration with a lower health degree higher. According to the roulette theory, the bacteria with the smallestJhealth would migrate, which greatly increases the ability for searching the optimal swimming, and the convergence speed, accuracy, and the stability of the algorithm.


## 3.3. Developing the Collision Avoidance Strategy

In the actual process of autonomous collision avoidance of intelligent ships, it is not easy to achieve collision avoidance by simply changing the course or speed, so the speed and course of the smart ship are simultaneously adjusted to avoid obstacles. When avoiding obstacles, the IBFOA is applied to solve the optimaldvR and dα that satisfy formula (5) at any collision avoidance timing, that is, to solve the optimization problem, as follows:(12)fx1,x2=minm1x1+m2x2,sinφΔvx1+vRcosφΔvx2≥μ−γ,ifγ≥0,sinφΔvx1+vRcosφΔvx2≤−μ−γ,ifγ<0.In the formula,x1=dvR and x2=dα are the unknowns we need to figure out, and other parameters are known quantities. fx1,x2 is the objective function (fitness function), which is defined as the comprehensive change in the speed and direction of the intelligent ship in each cycle. The smaller the change, the smoother the movement, so under the premise of ensuring the safety of collision avoidance, the lower the fitness value, the better the outcome. m1,m2 is the weight of x1,x2 in the objective function, and the value of m1,m2 reflects the priority of speed adjustment and course adjustment; since the changing course is more effective in avoidance, m2 is much larger than m1.The IBFOA is used to develop the collision avoidance strategy, and the optimaldvR and dα should follow the actual acceleration and steering capabilities of the intelligent ship, which may cause the intelligent ship to be unable to successfully avoid obstacles in a collision-avoidance cycle, so the expansion of the arena and ship obstacles is considered to ensure that the smart ship has sufficient time to complete the obstacle avoidance action during the avoidance of collisions.


## 4. Simulation Experiment and Result Analysis

By adopting the MatlabR2016a to conduct the numerical simulation and collision avoidance simulation, an intelligent ship autonomous collision avoidance system is built.


### 4.1. The Verification of Numerical Simulation

#### 4.1.1. Test Function

Four standard benchmark functions are selected and shown in Figure4 and Table 1 to carry out tests for three algorithms: the BFOA mentioned above, the reformed step size in BFOA according to equations (8) and (9) (indicated by BFO in the graph), and the ant colony optimization algorithm with improved parameters in the literature (ant colony optimization algorithm, referred to as ACO algorithm). These four benchmark functions are all multimodal functions and have multiple local minima, so they are difficult to find the global optimal value and credible for evaluating the optimization level of the algorithm. The ACO algorithm is referred for comparison because the ACO algorithm is widely used in the field of collision avoidance and has a high reference.Figure 4
3D graph of test functions: (a) Schwefel; (b) Rastrigin; (c) Griewank; (d) Ackley.
(a)(b)(c)(d)Table 1
Standard test functions.
Function nameFunction expressionSearch rangeThe optimal positionThe optimal solutionSchafferminfx1,x2=0.5+sinx12+x222−0.5/1+0.001x12+x222−10,10xi = 00Rastrigrinminfxi=∑i=1nxi2−10cos2πxi+10−5.12,5.12xi = 00Griewankminfxi=∑i=1nxi2/4000−∏i=1ncosxi/i+1−600,600xi = 00Ackleyminfxi=−c1exp−0.21/n∑i=1nxi2−exp1/n∑i=1ncos2πxi+c1+e−8,8xi = 00


#### 4.1.2. Parameter Settings

The parameters of the BFOA are set as the value in Table2: p is the search dimension of the algorithm, s is the size of the bacterial population, Nc is the counts of bacterial chemotaxis, Ns is the maximum number of steps in the one-way movement of the bacteria in the chemotaxis, Nre is the counts of bacterial replication, Ned is the counts of bacterial migration, and Ped is the basic migration probability of bacteria.Table 2
Algorithm parameters of BFO.
Parameter nameParameter valueParameter nameParameter valuep2Nre4s20Ned2Nc25Ped0.25Ns4——The parameters of the ACO algorithm are shown in Table3: p is the algorithm search dimension, Ant is the number of ants, Times is the counts of ants moving, Rou is the pheromone volatilization coefficient, and P0 is the transition probability.Table 3
Algorithm parameters of ACO.
Parameter namepAntTimesRouP0Parameter value21002000.80.2


#### 4.1.3. Simulation Results

Figure5 is a comparison diagram of the optimal fitness values obtained by applying these three algorithms to the four standard test functions. The horizontal axis is the algorithm iteration counts, and the vertical axis is the fitness value.Figure 5
Simulation results of the benchmark tests: (a) Schaffer; (b) Rastrigrin; (c) Griewank; (d) Ackley.
(a)(b)(c)(d)


#### 4.1.4. Result Analysis

It can be concluded from Figure5 and Table 4 that, for the four standard test functions, the IBFOA has better global optimization and optimization accuracy than the ACO algorithm with improved parameter and the BFO algorithm with improved step size, and for the precocious Griewank and Rastrigrin functions and the Schaffer and Ackley functions that are difficult to find the global optimal value, the optimal position obtained by the IBFOA reaches the optimal value 0,0, and the convergence accuracy and the global optimization of the algorithm are increased remarkably.Table 4
Running results of test functions.
Function nameAlgorithmThe optimal positionThe optimal valueConvergenceSchafferACO(−0.0688, 0.0689)0.312310BFOA(−0.0029,−0.0034)−0.0043140IBFOA(0,0)−2.5238E − 0542RastrigrinACO(−0.0953, 0.0954)0.503920BFOA(0.0126, −0.0145)−0.0058142IBFOA(0, 0)−2.5468E − 0528GriewankACO(−0.1863, 0.1861)2.45848BFOA(0.0007, −0.0350)0.0046162IBFOA(0, 0)−1.1387E − 0552AckleyACO(−0.2406, 0.2405)3.239213BFOA(0.0042, −0.0035)0.0035103IBFOA(0, 0)−1.1253E − 0536Compared with the ACO algorithm with improved parameters, the IBFOA has better global optimization and convergence accuracy; compared with the BFOA with improved step size, the IBFOA has advantages in convergence accuracy, speed, and algorithm stability. The BFOA has a slower convergence speed in the early stage; it may be limited by a local optimum, then gradually approaches the optimal value after a single dispersal, and the stability of the algorithm is insufficient in the later stage. The algorithm's early optimization ability and later optimization accuracy are increased through the improvement of adaptive step size and swimming operation, which makes the algorithm convergence faster and more accurate, and the selection of adaptive migration probability enhances the global optimization ability and algorithm stability. Analyzing the changes in the fitness value in Figure5, it can be found that the IBFOA has better convergence speed, accuracy, global optimization, and stability.


### 4.2. The Analysis of Single Obstacle Avoidance Simulation

Figure6 is a simulation of a single obstacle autonomous collision avoidance solved by the improved BFO algorithm, which shows that the intelligent ship completes collision avoidance and reaches the target point. We did not discuss the subtarget points calculated in the global planning process but considered the collision avoidance planning of the intelligent ship against dynamic obstacles when the starting point and target points are known. The uniform velocity obstacle means that the obstacle speed and heading do not change, so the speed and heading obtained by AIS at the time are used as the reference for the collision avoidance judgment and strategy solution in each cycle, and the transient changes in the obstacle are not considered.Figure 6
Simulation of uniform single speed obstacle collision avoidance.The data of dynamic performance of the USV used in this paper are measured by the USV platform of Harbin Engineering University in China; specifically, the cruising speed is 20 knots and the minimum avoidance velocity is set as 15 knots. During navigation, the operational sensors for detecting the obstacles on the platform include a radar, a binocular vision, a stereo vision, a monocular vision, infrared cameras, and laser range finders, and the maximum sensor detecting distance is 1000 m. The radar information for boat updates every 5 s, so the period for collision avoidance in this paper is set as 5 s. According to experiments, no matter what the speed is, the maximum steering angle of the boat in one cycle is not less than 8°. To ensure the feasibility of collision avoidance, we set the steering angle of collision avoidance to be no more than 3° under general cases and no more than 5° in emergency cases in this paper, and the coupling relationship between speed and heading during the steering process is ignored for simplicity. The motion capacity is controlled and implemented, dynamic performance for the above is set as the standard value in this study, and parameters set above are within the limit power range of the boat. The algorithm solves fast, so there is enough time to complete the collision avoidance in the cycle. The overtaking situation was selected for the simulation. And the obstacle boat kept a fixed course and speed as COLREGS required. The unit of the distance was meter. The initial position of the USV was [0, 0], and the initial velocity was 38 kN, while the initial velocity of the obstacle boat was 23 kN, and both these two velocities were eastward. The collision range of the intelligent ship is 1000. The initial position of the obstacle boat was [1500, 100]. It can be seen from Figure6 that the smart ship can successfully complete the autonomous collision avoidance under the condition of the obstacles at a constant speed or a variable speed. The safety expansion circle in Figure 6 no longer shows that the intelligent ship has successfully completed the collision avoidance.


### 4.3. The Analysis of Multiobstacle Collision Avoidance Simulation

The intelligent ship has an initial position of (0, 0) and an eastward velocity. The obstacle boat I, which is enclosed by the yellow circle, is located at (1500, −500), and its velocity points to the north by west. The obstacle boat II, which is enclosed by the red circle, is located at (2000, 500), and its velocity points to the east by south. The obstacle boat III, which is enclosed by the blue circle, is located at (6000, −500), and its velocity points to the west by north. The intelligent ship has done the global path planning in the static obstacle environment, and the next subglobal goal is located at (6500, −800). In the first 3 cycles, the relative position of the boats is shown in Figure7. Figure 7 shows that the intelligent ship had avoided all three obstacles, so in the case of multiple variable-speed obstacles, using the IBFOA to solve the collision avoidance strategy, the intelligent ship can successfully complete the autonomous collision avoidance. The intelligent ship was always in the center of the 3D graph (Figure 8). Figure 8 shows the real-time 3D simulation of collision avoidance. In the figure, the obstacle detected is the real position of the obstacle. The dark-colored area around the obstacle boat indicates its domain, while the light-colored area represents its eccentric expansion. This simulation can provide a clear insight into the avoidance process of USVs in a real-world environment. The finding indicates the accuracy of the proposed method in obstacle avoidance.Figure 7
Simulation of variable-speed multiple obstacles collision avoidance.Figure 8
The collision avoidance process displayed by Unity3D.


## 4.1. The Verification of Numerical Simulation

### 4.1.1. Test Function

Four standard benchmark functions are selected and shown in Figure4 and Table 1 to carry out tests for three algorithms: the BFOA mentioned above, the reformed step size in BFOA according to equations (8) and (9) (indicated by BFO in the graph), and the ant colony optimization algorithm with improved parameters in the literature (ant colony optimization algorithm, referred to as ACO algorithm). These four benchmark functions are all multimodal functions and have multiple local minima, so they are difficult to find the global optimal value and credible for evaluating the optimization level of the algorithm. The ACO algorithm is referred for comparison because the ACO algorithm is widely used in the field of collision avoidance and has a high reference.Figure 4
3D graph of test functions: (a) Schwefel; (b) Rastrigin; (c) Griewank; (d) Ackley.
(a)(b)(c)(d)Table 1
Standard test functions.
Function nameFunction expressionSearch rangeThe optimal positionThe optimal solutionSchafferminfx1,x2=0.5+sinx12+x222−0.5/1+0.001x12+x222−10,10xi = 00Rastrigrinminfxi=∑i=1nxi2−10cos2πxi+10−5.12,5.12xi = 00Griewankminfxi=∑i=1nxi2/4000−∏i=1ncosxi/i+1−600,600xi = 00Ackleyminfxi=−c1exp−0.21/n∑i=1nxi2−exp1/n∑i=1ncos2πxi+c1+e−8,8xi = 00


### 4.1.2. Parameter Settings

The parameters of the BFOA are set as the value in Table2: p is the search dimension of the algorithm, s is the size of the bacterial population, Nc is the counts of bacterial chemotaxis, Ns is the maximum number of steps in the one-way movement of the bacteria in the chemotaxis, Nre is the counts of bacterial replication, Ned is the counts of bacterial migration, and Ped is the basic migration probability of bacteria.Table 2
Algorithm parameters of BFO.
Parameter nameParameter valueParameter nameParameter valuep2Nre4s20Ned2Nc25Ped0.25Ns4——The parameters of the ACO algorithm are shown in Table3: p is the algorithm search dimension, Ant is the number of ants, Times is the counts of ants moving, Rou is the pheromone volatilization coefficient, and P0 is the transition probability.Table 3
Algorithm parameters of ACO.
Parameter namepAntTimesRouP0Parameter value21002000.80.2


### 4.1.3. Simulation Results

Figure5 is a comparison diagram of the optimal fitness values obtained by applying these three algorithms to the four standard test functions. The horizontal axis is the algorithm iteration counts, and the vertical axis is the fitness value.Figure 5
Simulation results of the benchmark tests: (a) Schaffer; (b) Rastrigrin; (c) Griewank; (d) Ackley.
(a)(b)(c)(d)


### 4.1.4. Result Analysis

It can be concluded from Figure5 and Table 4 that, for the four standard test functions, the IBFOA has better global optimization and optimization accuracy than the ACO algorithm with improved parameter and the BFO algorithm with improved step size, and for the precocious Griewank and Rastrigrin functions and the Schaffer and Ackley functions that are difficult to find the global optimal value, the optimal position obtained by the IBFOA reaches the optimal value 0,0, and the convergence accuracy and the global optimization of the algorithm are increased remarkably.Table 4
Running results of test functions.
Function nameAlgorithmThe optimal positionThe optimal valueConvergenceSchafferACO(−0.0688, 0.0689)0.312310BFOA(−0.0029,−0.0034)−0.0043140IBFOA(0,0)−2.5238E − 0542RastrigrinACO(−0.0953, 0.0954)0.503920BFOA(0.0126, −0.0145)−0.0058142IBFOA(0, 0)−2.5468E − 0528GriewankACO(−0.1863, 0.1861)2.45848BFOA(0.0007, −0.0350)0.0046162IBFOA(0, 0)−1.1387E − 0552AckleyACO(−0.2406, 0.2405)3.239213BFOA(0.0042, −0.0035)0.0035103IBFOA(0, 0)−1.1253E − 0536Compared with the ACO algorithm with improved parameters, the IBFOA has better global optimization and convergence accuracy; compared with the BFOA with improved step size, the IBFOA has advantages in convergence accuracy, speed, and algorithm stability. The BFOA has a slower convergence speed in the early stage; it may be limited by a local optimum, then gradually approaches the optimal value after a single dispersal, and the stability of the algorithm is insufficient in the later stage. The algorithm's early optimization ability and later optimization accuracy are increased through the improvement of adaptive step size and swimming operation, which makes the algorithm convergence faster and more accurate, and the selection of adaptive migration probability enhances the global optimization ability and algorithm stability. Analyzing the changes in the fitness value in Figure5, it can be found that the IBFOA has better convergence speed, accuracy, global optimization, and stability.


## 4.1.1. Test Function

Four standard benchmark functions are selected and shown in Figure4 and Table 1 to carry out tests for three algorithms: the BFOA mentioned above, the reformed step size in BFOA according to equations (8) and (9) (indicated by BFO in the graph), and the ant colony optimization algorithm with improved parameters in the literature (ant colony optimization algorithm, referred to as ACO algorithm). These four benchmark functions are all multimodal functions and have multiple local minima, so they are difficult to find the global optimal value and credible for evaluating the optimization level of the algorithm. The ACO algorithm is referred for comparison because the ACO algorithm is widely used in the field of collision avoidance and has a high reference.Figure 4
3D graph of test functions: (a) Schwefel; (b) Rastrigin; (c) Griewank; (d) Ackley.
(a)(b)(c)(d)Table 1
Standard test functions.
Function nameFunction expressionSearch rangeThe optimal positionThe optimal solutionSchafferminfx1,x2=0.5+sinx12+x222−0.5/1+0.001x12+x222−10,10xi = 00Rastrigrinminfxi=∑i=1nxi2−10cos2πxi+10−5.12,5.12xi = 00Griewankminfxi=∑i=1nxi2/4000−∏i=1ncosxi/i+1−600,600xi = 00Ackleyminfxi=−c1exp−0.21/n∑i=1nxi2−exp1/n∑i=1ncos2πxi+c1+e−8,8xi = 00


## 4.1.2. Parameter Settings

The parameters of the BFOA are set as the value in Table2: p is the search dimension of the algorithm, s is the size of the bacterial population, Nc is the counts of bacterial chemotaxis, Ns is the maximum number of steps in the one-way movement of the bacteria in the chemotaxis, Nre is the counts of bacterial replication, Ned is the counts of bacterial migration, and Ped is the basic migration probability of bacteria.Table 2
Algorithm parameters of BFO.
Parameter nameParameter valueParameter nameParameter valuep2Nre4s20Ned2Nc25Ped0.25Ns4——The parameters of the ACO algorithm are shown in Table3: p is the algorithm search dimension, Ant is the number of ants, Times is the counts of ants moving, Rou is the pheromone volatilization coefficient, and P0 is the transition probability.Table 3
Algorithm parameters of ACO.
Parameter namepAntTimesRouP0Parameter value21002000.80.2


## 4.1.3. Simulation Results

Figure5 is a comparison diagram of the optimal fitness values obtained by applying these three algorithms to the four standard test functions. The horizontal axis is the algorithm iteration counts, and the vertical axis is the fitness value.Figure 5
Simulation results of the benchmark tests: (a) Schaffer; (b) Rastrigrin; (c) Griewank; (d) Ackley.
(a)(b)(c)(d)


## 4.1.4. Result Analysis

It can be concluded from Figure5 and Table 4 that, for the four standard test functions, the IBFOA has better global optimization and optimization accuracy than the ACO algorithm with improved parameter and the BFO algorithm with improved step size, and for the precocious Griewank and Rastrigrin functions and the Schaffer and Ackley functions that are difficult to find the global optimal value, the optimal position obtained by the IBFOA reaches the optimal value 0,0, and the convergence accuracy and the global optimization of the algorithm are increased remarkably.Table 4
Running results of test functions.
Function nameAlgorithmThe optimal positionThe optimal valueConvergenceSchafferACO(−0.0688, 0.0689)0.312310BFOA(−0.0029,−0.0034)−0.0043140IBFOA(0,0)−2.5238E − 0542RastrigrinACO(−0.0953, 0.0954)0.503920BFOA(0.0126, −0.0145)−0.0058142IBFOA(0, 0)−2.5468E − 0528GriewankACO(−0.1863, 0.1861)2.45848BFOA(0.0007, −0.0350)0.0046162IBFOA(0, 0)−1.1387E − 0552AckleyACO(−0.2406, 0.2405)3.239213BFOA(0.0042, −0.0035)0.0035103IBFOA(0, 0)−1.1253E − 0536Compared with the ACO algorithm with improved parameters, the IBFOA has better global optimization and convergence accuracy; compared with the BFOA with improved step size, the IBFOA has advantages in convergence accuracy, speed, and algorithm stability. The BFOA has a slower convergence speed in the early stage; it may be limited by a local optimum, then gradually approaches the optimal value after a single dispersal, and the stability of the algorithm is insufficient in the later stage. The algorithm's early optimization ability and later optimization accuracy are increased through the improvement of adaptive step size and swimming operation, which makes the algorithm convergence faster and more accurate, and the selection of adaptive migration probability enhances the global optimization ability and algorithm stability. Analyzing the changes in the fitness value in Figure5, it can be found that the IBFOA has better convergence speed, accuracy, global optimization, and stability.


## 4.2. The Analysis of Single Obstacle Avoidance Simulation

Figure6 is a simulation of a single obstacle autonomous collision avoidance solved by the improved BFO algorithm, which shows that the intelligent ship completes collision avoidance and reaches the target point. We did not discuss the subtarget points calculated in the global planning process but considered the collision avoidance planning of the intelligent ship against dynamic obstacles when the starting point and target points are known. The uniform velocity obstacle means that the obstacle speed and heading do not change, so the speed and heading obtained by AIS at the time are used as the reference for the collision avoidance judgment and strategy solution in each cycle, and the transient changes in the obstacle are not considered.Figure 6
Simulation of uniform single speed obstacle collision avoidance.The data of dynamic performance of the USV used in this paper are measured by the USV platform of Harbin Engineering University in China; specifically, the cruising speed is 20 knots and the minimum avoidance velocity is set as 15 knots. During navigation, the operational sensors for detecting the obstacles on the platform include a radar, a binocular vision, a stereo vision, a monocular vision, infrared cameras, and laser range finders, and the maximum sensor detecting distance is 1000 m. The radar information for boat updates every 5 s, so the period for collision avoidance in this paper is set as 5 s. According to experiments, no matter what the speed is, the maximum steering angle of the boat in one cycle is not less than 8°. To ensure the feasibility of collision avoidance, we set the steering angle of collision avoidance to be no more than 3° under general cases and no more than 5° in emergency cases in this paper, and the coupling relationship between speed and heading during the steering process is ignored for simplicity. The motion capacity is controlled and implemented, dynamic performance for the above is set as the standard value in this study, and parameters set above are within the limit power range of the boat. The algorithm solves fast, so there is enough time to complete the collision avoidance in the cycle. The overtaking situation was selected for the simulation. And the obstacle boat kept a fixed course and speed as COLREGS required. The unit of the distance was meter. The initial position of the USV was [0, 0], and the initial velocity was 38 kN, while the initial velocity of the obstacle boat was 23 kN, and both these two velocities were eastward. The collision range of the intelligent ship is 1000. The initial position of the obstacle boat was [1500, 100]. It can be seen from Figure6 that the smart ship can successfully complete the autonomous collision avoidance under the condition of the obstacles at a constant speed or a variable speed. The safety expansion circle in Figure 6 no longer shows that the intelligent ship has successfully completed the collision avoidance.


## 4.3. The Analysis of Multiobstacle Collision Avoidance Simulation

The intelligent ship has an initial position of (0, 0) and an eastward velocity. The obstacle boat I, which is enclosed by the yellow circle, is located at (1500, −500), and its velocity points to the north by west. The obstacle boat II, which is enclosed by the red circle, is located at (2000, 500), and its velocity points to the east by south. The obstacle boat III, which is enclosed by the blue circle, is located at (6000, −500), and its velocity points to the west by north. The intelligent ship has done the global path planning in the static obstacle environment, and the next subglobal goal is located at (6500, −800). In the first 3 cycles, the relative position of the boats is shown in Figure7. Figure 7 shows that the intelligent ship had avoided all three obstacles, so in the case of multiple variable-speed obstacles, using the IBFOA to solve the collision avoidance strategy, the intelligent ship can successfully complete the autonomous collision avoidance. The intelligent ship was always in the center of the 3D graph (Figure 8). Figure 8 shows the real-time 3D simulation of collision avoidance. In the figure, the obstacle detected is the real position of the obstacle. The dark-colored area around the obstacle boat indicates its domain, while the light-colored area represents its eccentric expansion. This simulation can provide a clear insight into the avoidance process of USVs in a real-world environment. The finding indicates the accuracy of the proposed method in obstacle avoidance.Figure 7
Simulation of variable-speed multiple obstacles collision avoidance.Figure 8
The collision avoidance process displayed by Unity3D.


## 5. Conclusion

Aiming at the problem of autonomous collision avoidance of intelligent ships, the IBFOA was proposed in this article to use this algorithm to solve the VO model and obtain the autonomous collision avoidance strategy of intelligent ships. Finally, numerical verification and collision avoidance simulation are conducted with MatlabR2016a, and the following are the conclusions: (1) designing an adaptive decreasing fractal dimension chemotaxis step size to realize the adaptive adjustment of the step size and solve the problems of the fixed step size that the algorithm is easy to be limited by the local optimal solution, the early convergence speed is slow, and the late convergence accuracy is low, which increased the convergence speed and optimization accuracy of the algorithm; (2) the optimal swimming search method is proposed, which solves the defects of invalid swimming and repeated swimming of the basic BFO algorithm and improves the convergence speed of the algorithm; (3) figuring out an adaptive migration probability instead of a fixed migration probability, which solves prevent elite individuals from being lost and improves the accuracy and stability of the algorithm; (4) conducting the numerical simulations of IBFOA and ACO algorithm with improved parameters and the BFO algorithm with improved step size, and the result indicates that the IBFOA has better global optimization capability and accuracy than the ACO algorithm with improved parameters and has better convergence speed, accuracy, and stability than the BFO algorithm with improved step size; (5) applying the IBFOA to the autonomous collision avoidance of intelligent ships, developing the collision avoidance strategy of intelligent ships, and performing collision avoidance simulation; then, the results show that the IBFOA can quickly and safely realize the autonomous collision avoidance of intelligent ships under dynamic obstacles.In the future, an algorithm of obstacle avoidance, which takes the moving capacity of the USV and the influence of the control system into consideration, will be designed to make it an integrated closed loop in the planning and execution of obstacle avoidance.



---

*Source: 6661986-2021-02-10.xml*