A ship collision avoidance decision-making method based on generative adversarial imitation learning

By combining generative adversarial imitation learning with reinforcement learning and imitation learning, using the PPO algorithm and convolutional neural network, the problem of high cost and long training time for ship collision avoidance methods is solved, and intelligent collision avoidance decision-making in complex maritime environments is achieved. Significantly improve training efficiency and decision-making performance.

CN115616917BActive Publication Date: 2024-10-08DALIAN MARITIME UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211394429.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-08
Publication Date
2024-10-08
Estimated Expiration
2042-11-08

AI Technical Summary

Technical Problem

Existing ship collision avoidance methods based on reinforcement learning have high training costs and long training times, and cannot meet the needs of complex maritime environments.

Method used

Using a method based on generative adversarial imitation learning, combined with reinforcement learning and imitation learning, through the game training of the generator and the discriminator, using the PPO algorithm and convolutional neural network, the environment features are extracted and adversarial training is performed to generate optimized ship collision avoidance decisions. .

Benefits of technology

The training speed is significantly accelerated, collision avoidance decisions with superior performance are obtained, intelligent collision avoidance can be achieved in multi-ship encounter scenarios, and training costs and time are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115616917B_ABST
    Figure CN115616917B_ABST
Patent Text Reader

Abstract

The present invention provides a ship collision avoidance decision method based on generative adversarial imitation learning, comprising the following steps: extracting state-action pairs of good behaviors as expert data based on the expert demonstration data; initializing image information; inputting the image information into a generator for feature extraction and adversarial training; obtaining the state-action pairs output by the generator as generated data; inputting the expert data and the generated data into a discriminator, the discriminator is used to perform binary classification on the generated data and output a true or false judgment value of the generated data as reward information; feeding back the reward information to the environment input; repeatedly performing the above steps until the reward signals output by the discriminator are all true, and the training ends. The present invention combines reinforcement learning with imitation learning, which can greatly speed up the training speed and obtain collision avoidance decisions with superior performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of ship traffic safety, and in particular to a ship collision avoidance decision-making method based on generative adversarial imitation learning. Background Art

[0002] With the development of big data and artificial intelligence technology, autonomous ships have appeared in shipbuilding, maritime and shipping-related businesses, aiming to ensure maritime transportation safety, improve the intelligence level of waterway transportation and strengthen marine environmental protection. Collision avoidance decision technology is the core content of autonomous ships to achieve navigation safety. From the perspective of the solution algorithm, intelligent collision avoidance decision is a complex multi-constraint dynamic programming problem. At present, the most common method is to use artificial intelligence algorithms to solve it. For example: real-time collision avoidance prediction optimization method based on COLREGs rule constraints. Or by quantifying DCPA and TCPA to determine the motivation for ship collision avoidance. Or the model predictive control algorithm (MPC) is adopted to introduce uncertainty constraints such as ship motion model and evolution between dynamic environments into MPC to achieve the calculation of the optimal trajectory. Or by designing Q-learning algorithm to solve the collision avoidance model in dynamic and static obstacle environments. Or use the model-free deep Q learning algorithm to solve the autonomous ship collision avoidance decision and adaptive obstacle avoidance path planning model in unknown environments, and perform simulation verification.

[0003] The above methods can only adapt to simple ship encounter scenarios, such as static obstacle environments. However, there are many uncertainties in open waters, and traditional algorithms can no longer meet the needs. The reinforcement learning algorithm in artificial intelligence methods is widely used in ship collision avoidance decision-making tasks because it can solve sequential decision-making problems. Although reinforcement learning can obtain intelligent agents with better performance, the training cost is high and unsafe, and the training time is often long. Summary of the invention

[0004] According to the above, the existing ship collision avoidance method based on reinforcement learning has the technical problems of high training cost and long training time, and a ship collision avoidance decision method based on generative adversarial imitation learning is provided. The present invention combines reinforcement learning with imitation learning, which can greatly speed up the training speed and obtain collision avoidance decisions with superior performance.

[0005] The technical means adopted by the present invention are as follows:

[0006] A ship collision avoidance decision method based on generative adversarial imitation learning comprises the following steps:

[0007] S101, acquiring expert demonstration data, and extracting state-action pairs of good behaviors as expert data based on the expert demonstration data;

[0008] S102, initializing environmental image information, wherein the environmental image information includes the number of ships, ship positions, ship target points, ship headings, and ship speeds;

[0009] S103, inputting the image information into a generator for feature extraction and adversarial training, wherein the generator is an intelligent agent trained by a PPO algorithm;

[0010] S104, obtaining the state-action pair output by the generator as generated data;

[0011] S105, inputting the expert data and the generated data into a discriminator, wherein the discriminator is used to perform binary classification on the generated data and output a true or false judgment value of the generated data as reward information;

[0012] S106, feeding back the reward information to the environment input;

[0013] S107. Repeat the above steps S101 to S107 until all reward signals output by the discriminator are true. Then the training is completed.

[0014] Further, initializing the environmental image information includes: dividing the encounter scenes, the encounter scenes include: a head-on encounter scene, a crossing scene in the case of a give-way ship, a crossing encounter scene in the case of a straight-line ship, and an overtaking scene.

[0015] Furthermore, initializing the environmental image information further includes: building a ship kinematics model, wherein the ship kinematics model is:

[0016]

[0017]

[0018]

[0019]

[0020]

[0021] Among them, (x O ,y O ) represents the coordinates of the own ship, (x goal ,y goal ) represents the end point coordinates, (x T ,y T ) represents the target ship coordinates, θ o Represents the angle between the ship and the target point, θ T represents the target ship speed angle, θ OT Indicates the relative heading angle between the own ship and the target ship, α T Indicates the angle between own ship and target ship, Vo Indicates own ship's speed, V xO Indicates V o The component on the x-axis, V yO Indicates V o The component on the y-axis, V T Indicates the target ship speed, V xT Indicates V T The component on the x-axis, V yT Indicates V T The component on the y-axis.

[0022] Furthermore, the discriminator is a convolutional neural network, which is optimized by minimizing the binary cross entropy, and the optimization objective is:

[0023]

[0024] Among them, L is the binary cross entropy, the range of the discriminator D is (0, 1), and D(s, a) is the state-action pair input to the discriminator. is the discriminator's expectation of the data generated by the generator, is the expectation of the discriminator on the expert data.

[0025] Furthermore, before the image information is input into the generator for feature extraction, the generator is constructed based on a Markov decision model training process, and constructing the Markov decision model includes:

[0026] The state space is constructed based on the image state observation method, taking the image within the observable range of the ship at each moment as input;

[0027] According to the characteristics of ship control, an action space is constructed, which includes port, starboard and heading-keeping actions.

[0028] Define the reward function based on the discriminator in the generative adversarial network:

[0029]

[0030] Where r represents the reward function value.

[0031] Furthermore, the generator is trained by a PPO algorithm in reinforcement learning, and the Markov decision model is input into the generator by the PPO algorithm to realize the training of the generator;

[0032] The PPO algorithm includes two neural networks: Actor and Critic networks;

[0033] The Actor network is used to learn a strategy to obtain the highest possible reward;

[0034] The Critic network is used to estimate the value function of the current strategy.

[0035] Furthermore, the image information is input into the generator for feature extraction, including: extracting the features of the image through a CNN network, the CNN network includes an extraction layer and a processing layer, wherein the extraction layer is Conv2D, the processing layer is ReLU, and the result is output by a fully connected layer after a flattening operation.

[0036] Compared with the prior art, the present invention has the following advantages:

[0037] The present invention proposes a humanoid ship collision avoidance decision-making method based on generative adversarial imitation learning. The present invention utilizes the idea of ​​generative adversarial network GAN in imitation learning, trains the discriminator through adversarial training with the data sampled by the current generator, and then the discriminator outputs a reward signal to train the generator, and the generator and the discriminator are in a game behavior. The PPO algorithm in deep reinforcement learning is adopted in the design of the generator, and the generator is designed as an intelligent agent. The discriminator is designed using a neural network. Through this framework, the intelligent collision avoidance of unmanned ships in multi-ship encounter scenarios can be realized. And it solves the problem that a large amount of expert demonstration data and learning results cannot surpass humans when using imitation learning alone, and at the same time, it can solve the problem that reinforcement learning alone is extremely dependent on costly and unsafe training mechanisms. Therefore, the present invention can not only greatly speed up the training speed, but also surpass the ultra-high level of humans, and realize more intelligent ship collision avoidance behavior decision-making. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0039] Figure 1 The present invention is a flow chart of a ship collision avoidance decision-making method based on generative adversarial imitation learning.

[0040] Figure 2 This is a schematic diagram of the scene division encountered by the present invention.

[0041] Figure 3 It is a schematic diagram of the ship kinematic model of the present invention.

[0042] Figure 4 A schematic diagram of the adversarial imitation learning framework generated by the present invention.

[0043] Figure 5 Schematic diagram of the network structure of the identifier of the present invention.

[0044] Figure 6 Schematic diagram of the state space of the present invention.

[0045] Figure 7 Schematic diagram of the PPO algorithm training process of the present invention. DETAILED DESCRIPTION

[0046] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0047] like Figure 1 As shown, the present invention provides a ship collision avoidance decision method based on generative adversarial imitation learning, comprising the following steps:

[0048] S101 . Acquire expert demonstration data, and extract state-action pairs of good behaviors as expert data based on the expert demonstration data.

[0049] The expert demonstration data is obtained from actual ships at sea, or simulated from a navigation simulator. The data content is some good navigation trajectory data including the initial position of the ship, target point, ship speed, target ship position speed information, when and where the pilots between ships encountered the encounter scenario and what kind of collision avoidance actions they took, etc.

[0050] S102, initializing environmental image information, wherein the environmental image information includes the number of ships, ship positions, ship target points, ship headings, and ship speeds.

[0051] Further, initializing the environmental image information includes: dividing the encounter scenes, the encounter scenes include: a head-on encounter scene, a crossing scene in the case of a give-way ship, a crossing encounter scene in the case of a straight-line ship, and an overtaking scene.

[0052] Specifically, if Figure 2 As shown in the figure, the classification of encounter scenarios is based on the International Regulation for the Preventing Collision at Sea (COLREGs) and is divided in a relative heading manner, including four typical rule-based encounter scenarios: head-on encounter, crossing encounter and giving way, crossing encounter and direct sailing, and overtaking.

[0053] In a head-on situation (A): Both vessels are obliged to keep out of the way of each other on the starboard side.

[0054] In the crossing give way situation (B): The target vessel is a straight-track vessel and has no obligation to avoid collision. According to the COLREGs, own vessel must turn to starboard to avoid collision.

[0055] In the case of a crossing and direct encounter (C): The target vessel is the give-way vessel and must take appropriate action to avoid a potential collision. However, if the target vessel does not take appropriate action, the own vessel should take appropriate avoidance action to prevent a collision.

[0056] In overtaking situations (D): COLREGs do not specify the avoidance direction for overtaking rules. Therefore, own vessel is allowed to take avoidance action to port or starboard.

[0057] Furthermore, initializing the environment image information also includes: building a ship kinematic model, such as Figure 3 As shown, the ship is set to S O , the target point of the ship is set as Goal, and the target ship is set as S T The distance between the own ship and the target point and the target ship; the velocity components of the own ship and the target ship on the x and y axes; the relative speed and relative heading angle of the two ships are calculated as follows:

[0058]

[0059]

[0060]

[0061]

[0062]

[0063] Among them, (x O ,y O ) represents the coordinates of the own ship, (x goal ,y goal ) represents the end point coordinates, (x T ,y T ) represents the target ship coordinates, θ o Represents the angle between the ship and the target point, θ T represents the target ship speed angle, θ OT Indicates the relative heading angle between the own ship and the target ship, α T Indicates the angle between own ship and target ship, V o Indicates own ship's speed, V xO Indicates V o The component on the x-axis, V yO Indicates V o The component on the y-axis, V T Indicates the target ship speed, VxT Indicates V T The component on the x-axis, V yT Indicates V T The component on the y-axis.

[0064] S103: Input the image information into a generator for feature extraction and adversarial training, where the generator is an intelligent agent trained by a PPO algorithm.

[0065] The generative adversarial imitation learning framework constructed in the present invention is as follows Figure 4 As shown in the figure, first, the expert data is extracted according to the (state-action) pairs to form a trajectory set of expert data. The input of the generator is the state image information of the current environment. The generator structure is completed using the PPO algorithm in deep reinforcement learning, which is equivalent to a decision-making agent. The generator will calculate the action information based on the current state input information, and then save the (state-action) pairs into the trajectory set to form a series of generated data. Then the generated data and the expert data are input into the discriminator for discrimination. The discriminator is composed of a neural network structure. Finally, the discriminator outputs a true or false reward signal, and passes the reward information as the reward at the next moment to the input of the environment. Repeat this process until the values ​​output by the discriminator are all true, and the training is terminated.

[0066] The discriminator is composed of a convolutional neural network (CNN) with the following structure: Figure 5 As shown. Since the discriminator's goal is binary classification, the discriminator can be optimized by minimizing the binary cross entropy. The specific formula is:

[0067]

[0068] Where L is the binary cross entropy, and the range of the discriminator D is (0, 1). D(s,a) is the (state-action) pair input to the discriminator. is the discriminator's expectation of the data generated by the generator, is the expectation of the discriminator on the expert data.

[0069] In the present invention, the reinforcement learning algorithm in the generator has a convolutional neural network structure, which is used to extract features for reinforcement learning training decisions to let the generator generate data, and the discriminator is a constructed convolutional network structure, which uses the constructed neural network structure to perform binary classification and output true or false. It can be seen that both the generator and the discriminator have a neural network structure and the network structure is the same, but the two functions are different.

[0070] Furthermore, the present invention constructs a Markov decision process model as the basis of the generator, and the model mainly includes the setting of state space, action space, and reward function.

[0071] Specifically, the state space takes the image observed by the ship at each moment as input. Since the neural network in deep reinforcement learning has the ability to extract features and can understand and evaluate the current situation, it can handle image feature extraction well. Then the state space can be used Figure 6 Indicates that the entire area in the picture is within the range that the ship can fully observe.

[0072] The action space setting mainly includes port, starboard and heading-keeping actions. In order to reduce the amount of calculation, the present invention discretizes the action space. With a minimum turning range of 20°, turning to port or starboard is the maximum turning range. These actions are evenly distributed between [-60°, 60°] to avoid the risk of collision caused by continuous small-angle turning. When the decision action is 0°, it means keeping the heading.

[0073] The reward function is mainly defined based on the discriminator in the Generative Adversarial Network (GAN), which converts the judgment result into the reward signal of the model strategy. The reward function is defined as follows:

[0074]

[0075] Where r represents the reward function value.

[0076] The generator is trained by the PPO algorithm in reinforcement learning. The above-mentioned Markov decision model can be input into the generator through the PPO algorithm to realize the training of the generator. Among them, the PPO algorithm mainly includes two neural networks: Actor and Critic networks. Among them, the actor is a policy network, that is, learning a policy to obtain the highest possible return. Critic is an estimate of the value function of the current policy, that is, evaluating the quality of the participants. Due to the advantages of CNN, the present invention uses CNN to extract the features of the image. The network consists of an extraction layer and a processing layer. The extraction layer is Conv2D, and the processing layer is ReLU. The result is output by the fully connected layer after the flattening operation. On this basis, the features can be parsed, the network information can be enriched, and the network can perform effective feature learning.

[0077] When updating the parameters in the AC framework through PPO, a clipping method is used, called PPO-Clip, and the update method is as follows:

[0078]

[0079] in ε is a hyperparameter representing the scope of clipping, θ k refers to the weight of the actor network during the previous training iteration, is the advantage function, which represents the advantage of an action a relative to the average in state s, and is calculated as follows:

[0080] A π (s,a)=Q π (s,a)-V π (s)

[0081] Among them, Q π (s,a) represents the state action value function, which refers to the action value function under the strategy π, V π (s) represents the state value function. For the specific update process of PPO, see Figure 7 .

[0082] S104, obtaining the state-action pair output by the generator as generated data;

[0083] S105, inputting the expert data and the generated data into a discriminator, wherein the discriminator is used to perform binary classification on the generated data and output a true or false judgment value of the generated data as reward information;

[0084] S106, feeding back the reward information to the environment input;

[0085] S107. Repeat the above steps S101 to S107 until all reward signals output by the discriminator are true. Then the training is completed.

[0086] The present invention combines imitation learning with GAN and uses deep reinforcement learning for adversarial training, thereby effectively solving the problem that imitation learning requires a large number of data samples while deep reinforcement learning has high training costs. In addition, through imitation learning, unmanned ships can learn human-like decision-making behaviors based on expert data, thereby realizing intelligent collision avoidance of unmanned ships in multi-ship encounter scenarios.

[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A ship collision avoidance decision-making method based on generative adversarial imitation learning, characterized in that: The following steps are involved: S101, acquiring expert demonstration data, and extracting state-action pairs of good behaviors as expert data based on the expert demonstration data; S102, initializing environmental image information, wherein the environmental image information includes the number of ships, ship positions, ship target points, ship headings, and ship speeds; S103, inputting the image information into a generator for feature extraction and adversarial training, wherein the generator is an intelligent agent trained by a PPO algorithm; The generator is constructed based on the Markov decision model training process, and constructing the Markov decision model includes: The state space is constructed based on the image state observation method, taking the image within the observable range of the ship at each moment as input. According to the characteristics of ship control, an action space is constructed, which includes port, starboard and heading-keeping actions. Define the reward function based on the discriminator in the generative adversarial network: Where r represents the reward function value; S104, obtaining the state-action pair output by the generator as generated data; S105, inputting the expert data and the generated data into a discriminator, the discriminator is used to perform binary classification on the generated data and output the true or false judgment value of the generated data as reward information; the discriminator is a convolutional neural network, which is optimized by minimizing the binary cross entropy, and the optimization goal is: Among them, L is the binary cross entropy, the range of the discriminator D is (0, 1), and D(s, a) is the state-action pair input to the discriminator. is the discriminator's expectation of the data generated by the generator, is the expectation of the discriminator on the expert data; S106, feeding back the reward information to the environment input; S107. Repeat the above steps S101 to S107 until all reward signals output by the discriminator are true. Then the training is completed.

2. A ship collision avoidance decision-making method based on generative adversarial imitation learning according to claim 1, characterized in that: Initializing the environmental image information includes: dividing the encounter scenes, the encounter scenes include: the encounter scene, the crossing scene in the case of the give-way ship, the crossing encounter scene in the case of the straight-line ship, and the overtaking scene.

3. A ship collision avoidance decision-making method based on generative adversarial imitation learning according to claim 1, characterized in that: Initializing the environmental image information also includes: building a ship kinematics model, the ship kinematics model is: Among them, (x O ,y O ) represents the coordinates of the own ship, (x goal ,y goal ) represents the end point coordinates, (x T ,y T ) represents the target ship coordinates, θ o Represents the angle between the ship and the target point, θ T represents the target ship speed angle, θ OT Indicates the relative heading angle between the own ship and the target ship, α T Indicates the angle between own ship and target ship, V o Indicates own ship's speed, V xO Indicates V o The component on the x-axis, V yO Indicates V o The component on the y-axis, V T Indicates the target ship speed, V xT Indicates V T The component on the x-axis, V yT Indicates V T The component on the y-axis.

4. A ship collision avoidance decision-making method based on generative adversarial imitation learning according to claim 1, characterized in that: The generator is trained by the PPO algorithm in reinforcement learning, and the Markov decision model is input into the generator by the PPO algorithm to realize the training of the generator; The PPO algorithm includes two neural networks: Actor and Critic networks; The Actor network is used to learn a strategy to obtain the highest possible reward; The Critic network is used to estimate the value function of the current strategy.

5. A ship collision avoidance decision-making method based on generative adversarial imitation learning according to claim 4, characterized in that: The image information is input into the generator for feature extraction, including: extracting the features of the image through a CNN network, the CNN network includes an extraction layer and a processing layer, wherein the extraction layer is Conv2D, the processing layer is ReLU, and the result is output by a fully connected layer after a flattening operation.