A pursuit-evasion game method based on multi-agent graph reinforcement learning
By constructing a global time-varying undirected graph and a local observation graph, extracting node features and generating actions, and optimizing the policy network, the problem of ignoring geometric position information between agents in existing technologies is solved, and efficient tracking and adaptive capabilities in dynamic environments are achieved.
Patent Information
- Application Number
- CN202611322448.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-24
AI Technical Summary
Existing multi-agent reinforcement learning methods ignore the geometric position information between agents in pursuit tasks, resulting in low efficiency of collaborative pursuit in dynamic environments and poor adaptability to changes in the number of agents.
We construct a global time-varying undirected graph and a local observation graph, extract node feature vectors, generate the actions of the pursuit robot using graph attention mechanism and GRU hidden state, and optimize the policy network through a composite shared reward mechanism to achieve adaptive processing of different numbers of agent inputs.
It enhances the collaboration capabilities among pursuit robots, improves capture performance and mission success rate in dynamic environments, and possesses good generalization ability and deployment flexibility.
Smart Images

Figure CN123156594A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of multi-agent cooperation, specifically a chase-and-escape game method based on multi-agent graph reinforcement learning. Background Technology
[0002] Cooperative pursuit, a cornerstone problem in multi-agent collaboration, has significant practical value in areas such as military reconnaissance and interception, border intrusion defense, and urban security patrols. In real-world applications, pursuit missions often face highly complex dynamic environments: on the one hand, the pursued target (the escaping agent) typically possesses greater mobility and intelligent escape algorithms; on the other hand, the pursuing force is often limited by a finite perception range, and the number of agents may dynamically increase or decrease due to malfunctions, losses, or reinforcements during mission execution. Therefore, researching a highly adaptive, scalable cooperative pursuit strategy capable of handling asymmetric information is crucial for improving the success rate of unmanned swarm missions.
[0003] Currently, multi-agent reinforcement learning (MAL) has gradually become the mainstream technical approach for solving cooperative pursuit problems. This method leverages the powerful feature extraction and nonlinear representation capabilities of deep neural networks, enabling multiple agents to autonomously learn cooperative strategies through continuous interaction with the environment, eliminating the need for manually designed complex pursuit rules. Furthermore, MAL can adapt to complex dynamic environments and changing target strategies, possessing strong collaborative decision-making capabilities, thus demonstrating significant advantages in areas such as multi-robot pursuit and intelligent unmanned systems. However, existing reinforcement learning methods often neglect the geometrical positional information between agents and have weak adaptability to the number of agents in the system.
[0004] Existing technologies, based on the MADDPG algorithm, employ a continuous state space including position and attitude, and guide UAVs to form a cooperative pursuit posture through a distance-based reward and punishment mechanism. Another approach concatenates local observation information such as relative distance and velocity acquired by the sensors of each pursuit robot into a fixed-length feature vector, and uses the MADDPG algorithm framework for policy training. However, existing solutions neglect the dynamic local topological relationships formed by pursuit robots in real-world pursuit scenarios due to their limited perception radius. Fully connected methods not only introduce a large amount of redundant information irrelevant to the current decision but also fail to accurately capture the spatial geometric relationships between the pursuit robot and its neighbors, and between the pursuit robot and the escape robot. Furthermore, existing solutions typically concatenate the robot's own state with the information of "neighbor 1 to neighbor N" in a fixed order to form a high-dimensional vector. In actual pursuit, the status of the pursuit robot and its teammates should be homogeneous and equal (permutation invariance). Once the number of pursuers dynamically increases or decreases, or the input order changes, the original model's weight matrix and strategy will become invalid. In real-world environments, agents typically have only a limited observation radius, and the system adheres to the principle of permutation invariance. Existing technologies lack mechanisms for extracting such local spatial features, which reduces the convergence speed and collaborative efficiency of the encirclement. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the present invention aims to propose a pursuit-escape game method based on multi-agent graph reinforcement learning, which extracts important geometric position features in the multi-agent system, thereby effectively improving the collaborative pursuit efficiency of the system.
[0006] This invention provides a chase-and-escape game method based on multi-agent graph reinforcement learning, comprising: Step 1: During the pursuit of N chasing robots and 1 escape robot on a preset map, construct a global time-varying undirected graph and a local observation graph, and construct a node feature vector for each node in the global time-varying undirected graph and the local observation graph; Step 2: Construct node feature vectors for each node based on the global time-varying undirected graph and the local observation graph, generate GRU hidden states, and then generate the actions of the pursuit robot; Step 3: Each pursuit robot performs the corresponding action, and the composite shared reward is calculated; Step 4: Set the time step The global time-varying undirected graph, the local observation graph, the actions of all pursuit robots, the composite shared reward, the termination flag, and the GRU hidden states of all pursuit robots are combined to form a joint state transition sample. The joint state transition samples of multiple consecutive time steps are spliced into a trajectory sequence, and the spliced trajectory sequence is stored in the experience buffer. Step 5: Train the policy network based on the joint state transition samples in the experience buffer to obtain the trained policy network; Step 6: Construct a local observation map, input the feature vectors of all nodes in the local observation map into the trained policy network to obtain actions, and the pursuit robot executes the actions.
[0007] Optionally, step 1 includes: Step 1.1: During the chase between N pursuing robots and 1 escape robot on a preset map, acquire the pursuing robots. At time step state vector , ,in , , , The first The position, heading angle, linear velocity, and angular velocity of the pursuit robot; Step 1.2: Treat each pursuit robot as a node, calculate the relative distance between the positions of two pursuit robots, and construct an edge between the nodes of the two pursuit robots when the relative distance is less than the preset perception radius, thus obtaining a global time-varying undirected graph. By using the node corresponding to each pursuit robot as the central node, a global time-varying undirected graph can be obtained. Nodes directly connected to the central node are designated as neighboring nodes. The central node and its directly connected neighboring nodes form a local observation graph. ; Step 1.3: Create a globally time-varying undirected graph Each node is built at time step Node feature vectors , ,in, This represents the position difference between the pursuing robot i and the escaped agent e on the horizontal axis. This represents the positional difference between the pursuing robot i and the escaped agent e on the vertical axis; For local observation map Each neighbor node in the time step is built. Node feature vectors , ,in, Including linear velocity and angular velocity ; Including neighboring nodes and central node relative displacement between and relative speed ; Includes the tracking robot corresponding to the neighbor node and escape robots relative displacement between and relative velocity ; This is a flag bit, which indicates the pursuit robot. Is it possible to observe the escaped robot? Indicates a pursuit robot The closest distance to the preset map boundary.
[0008] Optionally, step 2 includes: Step 2.1: Input the node feature vector of the center node and the node feature vectors of the neighboring nodes of the local observation graph into the attention layer to obtain the weights corresponding to each neighboring node. Specifically, this is achieved through the following formula: ; in, This represents a nonlinear activation function with a negative slope. This represents the transpose of the trainable attention weight vector. Represents the weight matrix; Indicates the central pursuit robot The node feature vector at time step t, i.e. ; Indicates a pursuit robot At time step The set of neighboring nodes, Indicates a pursuit robot itself, This represents the union operation. This represents a vector concatenation operation; Indicates a pursuit robot neighboring nodes The node feature vector at time step t, express The node feature vector of node c in the array; Aggregate the weights of all neighboring nodes to obtain the aggregated spatial feature vector. Specifically, this is achieved through the following formula: ; in, Represents a non-linear activation function. This represents the aggregated shared weight matrix used for neighborhood space feature transformation; Step 2.2: Utilize flag bits relative displacement Perform mask filtering and max pooling to obtain the central pursuit robot. At time step Extracted and aggregated feature vectors of escaped targets Specifically, it is expressed by the following formula: ; in, This represents a multilayer perceptron; Step 2.3: Combine the aggregated spatial feature vectors and escape target feature vector The features are concatenated to obtain a joint feature vector, which is then input into a gated recurrent unit to obtain the GRU hidden state. Hide the GRU state The pursuit robot is obtained through a multi-layer sensor. action The action includes linear velocity and angular velocity.
[0009] Optionally, step 3 includes: Step 3.1: After each pursuing robot performs its corresponding action, calculate the distance between each pursuing robot and the escaped robot. If the distance between any pursuing robot and the escaped robot is less than or equal to the capture radius, then set the sparse termination reward... As a preset value, if the distance between all pursuing robots and escaped robots is greater than the capture radius, then the sparse termination reward is set. =0; Step 3.2: Calculate the angle potential reward Specifically, this is achieved through the following formula: ; in, For time step The maximum angular clearance between adjacent pursuit robots at the time of the action. This is the reward coefficient; Calculate distance potential reward Specifically, this is achieved through the following formula: ; in, It is a preset reward coefficient. Indicates time step The minimum distance between all pursuing robots and the escaped robot at that time. Indicates time step The minimum distance between all pursuing robots and the escaped robot at that time. Indicates time step The average of the F smallest distances between all pursuing and escaping robots. Indicates time step The average of the F smallest distances between all pursuing and escaping robots; Rewarding Angle Potential Distance potential rewards Adding them together yields a dense plasticity reward. ; Step 3.3: At the time step If the distance between any two pursuit robots is less than or equal to the preset collision avoidance distance for pursuit robots, then the collision penalty for teammates will be a fixed negative penalty value. If the distance between any two pursuit robots is greater than the preset collision avoidance distance for pursuit robots, then the collision penalty for teammates will be 0. At time step If the shortest distance between any pursuing robot and the map boundary is less than or equal to the preset area boundary collision avoidance distance, then the boundary collision penalty is set to a fixed negative penalty value. If the shortest distance between all the chasing robots and the map boundary is greater than the preset area boundary collision avoidance distance, then the boundary collision penalty is set to 0. If the current time step Reaching the maximum number of rounds limit If the escaped robot is still not captured, the time step over-limit penalty is set to a fixed negative penalty value. If the current time step The maximum number of rounds has not been reached. Then the time step over-limit penalty is set to 0; The penalty for teammate collision, boundary collision, and time step exceeding the limit is added together to obtain the penalty item that ensures safety and coordination. ; Step 3.4: Reduce sparse termination rewards Intensive Plasticity Reward Penalties for ensuring security and collaboration Add them together to get a compound shared reward. .
[0010] Optionally, step 5 includes: Step 5.1: Randomly select from the cache A joint state transition sample is used to update the node feature vector of the pursuit robot, and then the state estimate values at B time steps are calculated. Step 5.2: According to The advantage function is calculated based on the state estimates at each time step. Step 5.3: Calculate the total loss of the policy network and the total loss of the value network based on the advantage function; Step 5.4: Based on the total loss of the policy network and the total loss of the value network, update the parameters in the policy network and the value network using the Adam optimizer; Step 5.5: Repeat steps 5.1-5.4 above to iteratively update the parameters in the policy network and the value network multiple times. After each update, calculate the average of all composite shared rewards in the current iteration and the previous M-1 iterations to obtain the average round reward, which is achieved through the following formula: ; in, For the first Total time step of the iteration. For the first In the nth iteration The composite shared reward obtained at each time step; Count the number of escaped robots successfully captured by the pursuing robot in M iterations. Calculate the task success rate Specifically, this is achieved through the following formula: ; When the difference in average round rewards over M consecutive iterations is less than a preset threshold, and the task success rate... Reaching the preset threshold, and the value loss function If the value drops below a preset threshold, the training is considered complete, and the trained policy network is obtained.
[0011] Optionally, step 5.1 includes: For each joint state transition sample, a multi-head graph attention mechanism is used to update the node feature vectors in the global time-varying undirected graph and the node feature vectors in the local observation graph through multiple layers, resulting in updated node features. ; Among them, in the first l The update of a layer is represented as: ; in, This indicates the current layer number of the multi-head graph attention network. For the first The node at the th The updated feature vector after the layer, For the first The node at the th The updated feature vector after the layer, For the number of attention heads, Indicates all The feature vectors calculated by each independent attention head are concatenated according to the channel dimension. and They represent the first Normalized attention coefficients and shared weight matrix for each attention head; Global average pooling and max pooling operations are used to combine and concatenate the updated nodes of all the pursuit robots to obtain the global feature vector. Specifically, this is achieved through the following formula: ; global feature vectors Input the value network to obtain state estimates, and then obtain state estimates for all time steps.
[0012] Optionally, step 5.2 includes: The time series difference error is calculated using the generalized dominance estimation method. Specifically, this is achieved through the following formula: ; in, It's the discount rate. These are parameters of the value network. This represents the state estimate at time step t+1. This represents the state estimate at time step t. and from Obtained from the state estimates at each time step; Based on timing difference error Calculate the advantage function Specifically, this is achieved through the following formula: ; in, Indicates the maximum time step length. Indicates a time step. This represents the tradeoff hyperparameters for generalized advantage estimation. Indicates the offset from time step t. The timing difference error at a specific future moment in time steps.
[0013] Optionally, step 5.3 includes: Calculate probability ratio Specifically, this is achieved through the following formula: ; in, For the parameters of the policy network, This represents the distribution of the policy network output. This represents the distribution of the policy network output before the update; Calculate the objective function value of the policy after shearing. Specifically, this is achieved through the following formula: ; in, Represents the mathematical expectation. This represents a numerical clipping function. It is a hyperparameter of the shear range; Calculate the total loss of the policy network. Specifically, it is calculated using the following formula: ; in, For the policy entropy weights, express strategy entropy; Calculate the total loss of the value network Specifically, it is calculated using the following formula: ; ; in, Indicates a time step. This represents the state estimate at time step b. This indicates the cumulative return on the discount. This represents the composite shared reward for time step b+x.
[0014] The beneficial effects of adopting the above technical solution are as follows: 1. Scalability and generalization ability: Based on graph neural network representation and global pooling mechanism, this invention can adaptively process different numbers of agent inputs, and has good generalization ability and deployment flexibility.
[0015] 2. Capture performance and mission success rate: This invention effectively improves the cooperation ability between pursuit robots through efficient graph structure information interaction and neighborhood cooperation mechanism, enabling pursuit robots with weaker mobility to still form a stable encirclement and capture of high-speed escape targets. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating a pursuit-escape game method based on multi-agent graph reinforcement learning in an embodiment of the present invention. Figure 2 This is a flowchart illustrating another pursuit-escape game method based on multi-agent graph reinforcement learning in an embodiment of the present invention. Figure 3 This is a schematic diagram illustrating the process of actor network output actions in an embodiment of the present invention. Detailed Implementation
[0017] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0018] To address the problems of existing technologies, this invention provides a pursuit-escape game method based on multi-agent graph reinforcement learning. It constructs a graph representation of agent states based on the geometric relationships between agents; generates a decentralized collaborative pursuit strategy using local graph perception information; constructs a composite shared reward function for the multiple objectives of the collaborative pursuit task; records interaction states and actions according to time series to construct and store experience trajectories; optimizes the parameters of Actors and Critics using experience trajectories; and deploys the Actor policy network in a distributed manner and executes online decisions.
[0019] This invention provides a pursuit-escape game method based on multi-agent graph reinforcement learning. Figure 1 and Figure 2 This may include the following steps: Step 1: In a two-dimensional continuous space environment, during the pursuit and escape process of N chasing robots and 1 escape robot on a preset map, construct a global time-varying undirected graph and a local observation graph, and construct a node feature vector for each node in the global time-varying undirected graph and the local observation graph; Step 1.1: During the chase between N pursuing robots and 1 escape robot on a preset map, acquire the pursuing robots. At time step state vector , ,in , , , The first The position, heading angle, linear velocity, and angular velocity of the pursuit robot; Furthermore, the present invention can also construct the first The dynamic model of the pursuer is expressed as follows: ; The maximum linear velocity of the escape robot is set to And satisfy .in, Indicating the pursuers The maximum linear velocity of motion.
[0020] Step 1.2: To reflect the partially observable finite sensing constraints, based on the sensing radius... The edge set of the graph is constructed using connectivity rules. Specifically, each pursuit robot is treated as a node, and the relative distance between the positions of two pursuit robots is calculated. If the relative distance is less than a preset perception radius, an edge is constructed between the nodes of the two pursuit robots, thus obtaining a global time-varying undirected graph. By using the node corresponding to each pursuit robot as the central node, a global time-varying undirected graph can be obtained. Nodes directly connected to the central node are designated as neighboring nodes. The central node and its directly connected neighboring nodes form a local observation graph. ; Because escape robots lack cooperative communication capabilities, they do not participate in edge connections as independent nodes in the graph topology; they only do so when they enter the hunter's perception radius. Within a given timeframe, the state is extracted as environmental feature information. Based on this rule, the environmental state is modeled as a globally time-varying undirected graph. Each pursuer Each element independently and in a distributed manner creates a local graph centered on itself. This local map is used to carry its local observation information; the local map is based on the current pursuers. As the central node, and with its sensing radius Other pursuers observed within the environment are considered as neighboring nodes. Due to the different real-time spatial locations and topological neighborhoods of each pursuer in the environment, the local graphs they construct are usually different in terms of the number of nodes and the edge relationships, and they evolve dynamically with time steps.
[0021] Step 1.3: Due to the use of centralized training and decentralized execution methods, at each time step... Global map All of the multi-agent systems Each pursuer node is composed of a set of edges, representing the global topological state of the system. This is a globally time-varying undirected graph. Each node is built at time step Node feature vectors , ,in, This represents the position difference between the pursuing robot i and the escaped agent e on the horizontal axis. This represents the positional difference between the pursuing robot i and the escaped agent e on the vertical axis; For local observation map Each neighbor node in the time step is built. Node feature vectors , ,in, Including linear velocity and angular velocity ; Including neighboring nodes and central node relative displacement between and relative speed ; Represents relative displacement, including the tracking robot corresponding to the neighboring node. and escape robots relative displacement between and relative velocity ; This is a flag bit, which indicates the pursuit robot. If an escaped robot cannot be observed, fill the vector with 0s and set a flag. =0; Indicates a pursuit robot The closest distance to the preset map boundary; the escape robot is not modeled as an independent node, but is embedded in the node features of the pursuing robot through relative information.
[0022] Step 2: Construct node feature vectors for each node based on the global time-varying undirected graph and the local observation graph, generate GRU hidden states, and then generate the actions of the pursuit robot; Step 2.1: Utilize a graph attention mechanism to weighted aggregate the cooperative motion features of neighboring agents. Specifically, input the node feature vectors of the central node and neighboring nodes of the local observation graph into the attention layer, and use a weight matrix... For sets All nodes within the node are mapped uniformly to obtain the weight of each neighbor node. Specifically, this is achieved through the following formula: ; in, This represents a nonlinear activation function with a negative slope. This represents the transpose of the trainable attention weight vector. Represents the weight matrix; Indicates the central pursuit robot The node feature vector at time step t, i.e. ; Indicates a pursuit robot At time step The set of neighboring nodes, Indicates a pursuit robot itself, This represents the union operation. This represents a vector concatenation operation; Indicates a pursuit robot neighboring nodes The node feature vector at time step t, express The node feature vector of node c in the array; It should be noted that when m is i, that is ; Aggregate the weights of all neighboring nodes to obtain the aggregated spatial feature vector. Specifically, this is achieved through the following formula: ; in, Represents a non-linear activation function. This represents the aggregated shared weight matrix used for neighborhood space feature transformation; Aggregated Characteristics of collaborative movement trends within the node's neighborhood.
[0023] Step 2.2: To solve the problem of "the central node not being able to see the target", the system specifically searches for the current pursuit robot. partial view All neighboring nodes In the node features Fragment. Using flags. relative displacement Perform mask filtering and max pooling to obtain the central pursuit robot. At time step Extracted and aggregated feature vectors of escaped targets Specifically, it is expressed by the following formula: ; in, This represents a multilayer perceptron, used for nonlinear feature mapping of input feature segments; after masking, max pooling is performed to propagate target information in the local graph.
[0024] Step 2.3: Combine the aggregated spatial feature vectors and escape target feature vector The features are concatenated to obtain a joint feature vector, which is then input into a gated recurrent unit (GRU). The GRU receives the joint feature vector from the current time step and combines it with the one from the previous time step. Hidden state (the aforementioned) (Used to carry the agent's historical sequential memory information over time), it is updated through the gating mechanism inside the GRU to obtain the GRU hidden state. Hide the GRU state The pursuit robot is obtained through a multilayer perceptron (MLP). action The action includes linear velocity and angular velocity; Step 3: Each pursuit robot performs the corresponding action, and the composite shared reward is calculated. ; Step 3.1: Each pursuit robot performs a corresponding action, and the dynamic model of each pursuit robot updates its geometric position and physical state, thereby advancing the system to the state of the next moment.
[0025] After each pursuing robot performs its corresponding action, the distance between each pursuing robot and the escaped robot is calculated. If the distance between any pursuing robot and the escaped robot is less than or equal to the capture radius, then the sparse termination reward is set. As a preset value, if the distance between all pursuing robots and escaped robots is greater than the capture radius, then the sparse termination reward is set. =0; Step 3.2: Calculate the angle potential reward The angular potential reward aims to reduce the maximum angular gap when surrounded by pursuing robots, and is specifically achieved through the following formula: ; in, For time step The maximum angular clearance between adjacent pursuit robots at the time of the action. This is the reward coefficient; Calculate distance potential reward Specifically, this is achieved through the following formula: ; in, It is a preset reward coefficient. Indicates time step The minimum distance between all pursuing robots and the escaped robot at that time. Indicates time step The minimum distance between all pursuing robots and the escaped robot at that time. Indicates time step The average of the F smallest distances between all pursuing and escaping robots. Indicates time step The average of the F smallest distances between all pursuing and escaping robots is calculated at the current time step. Specifically, the environmental system calculates the distances between all pursuing and escaping robots in real time, sorts these distances in ascending order of value, and selects the top F distances. The distance between each pursuing robot and the escaped robot was calculated and its average value was determined. For a pre-set value greater than or equal to 1 and less than the total number of pursuit robots A positive integer (F=3 is set in actual training).
[0026] Rewarding Angle Potential Distance potential rewards Adding them together yields a dense plasticity reward. ; Step 3.3: At the time step If the distance between any two pursuit robots is less than or equal to the preset collision avoidance distance, an unsafe behavior of teammate collision is determined, and the teammate collision penalty is a fixed negative penalty value. If the distance between any two pursuit robots is greater than the preset collision avoidance distance for pursuit robots, then the collision penalty for teammates will be 0. At time step If any pursuing robot's shortest distance from the map boundary is less than or equal to the preset area boundary collision avoidance distance, then an out-of-bounds or boundary collision has occurred, and the boundary collision penalty is set to a fixed negative penalty value. If the shortest distance between all the chasing robots and the map boundary is greater than the preset area boundary collision avoidance distance, then the boundary collision penalty is set to 0. If the current time step Reaching the maximum number of rounds limit If the escaped robot is still not captured, the time step over-limit penalty is set to a fixed negative penalty value. If the current time step The maximum number of rounds has not been reached. Then the time step over-limit penalty is set to 0; The penalty for teammate collision, boundary collision, and time step exceeding the limit is added together to obtain the penalty item that ensures safety and coordination. ; Step 3.4: Reduce sparse termination rewards Intensive Plasticity Reward Penalties for ensuring security and collaboration Add them together to get a compound shared reward. ; Step 4: Set the time step The global time-varying undirected graph, the local observation graph, the actions of all pursuit robots, the composite shared reward, the termination flag, and the GRU hidden states of all pursuit robots constitute a joint state transition sample. The joint state transition samples of multiple consecutive time steps are spliced into a trajectory sequence, which is then stored in an experience buffer. The buffer adopts a first-in-first-out strategy to maintain a fixed capacity and samples in units of completed trajectory segments to avoid disrupting the timing.
[0027] Step 5: Under the Multi-Agent Proximal Policy Optimization (MAPPO) framework, the policy network (Actor) is trained based on the joint state transition samples in the experience buffer to obtain the trained policy network. Step 5.1: Randomly select from the cache A joint state transition sample is used to update the node feature vector of the pursuit robot, and then the state estimate values at B time steps are calculated. Because this invention introduces gated recurrent units into the Actor network, in order to ensure the continuity of temporal features, each extracted sample is a segment of length [length missing]. L Continuous time-series trajectory segments: ; For each joint state transition sample, a multi-head graph attention mechanism is used to update the node feature vectors in the global time-varying undirected graph and the node feature vectors in the local observation graph through multiple layers, resulting in updated node features. ; Among them, in the first l The update of a layer is represented as: ; in, Indicates the current layer number of the multi-head graph attention network ( =1,2,…, ), For the first The node at the th The updated feature vector after the layer, For the first The node at the th The updated feature vector after the layer, For the number of attention heads, Indicates all The feature vectors calculated by each independent attention head are concatenated according to the channel dimension. and They represent the first Normalized attention coefficients and shared weight matrix for each attention head; Global average pooling and max pooling operations are used to combine and concatenate all updated nodes of the pursuit robot to generate a fixed-length global feature vector that is unaffected by the number of nodes. Specifically, this is achieved through the following formula: ; With this design, the Critic network becomes adaptable to changes in the number of nodes, i.e., the number of agents. Subsequently, the global feature vector... Inputting the Critic network yields state estimates, which in turn provide state estimates for all time steps. These state estimates are used to assist the Actor network in calculating the advantage function and updating its parameters.
[0028] Step 5.2: According to The advantage function is calculated based on the state estimates at each time step. To reduce the variance of policy gradient estimation, the generalized dominance estimation method (GAE) is used to calculate the time-series difference error. Specifically, this is achieved through the following formula: ; in, It's the discount rate. These are parameters of the value network. This represents the state estimate at time step t+1. This represents the state estimate at time step t. and from Obtained from the state estimates at each time step; Based on timing difference error Calculate the advantage function Specifically, this is achieved through the following formula: ; in, Indicates the maximum time step length. Indicates a time step. This represents the tradeoff hyperparameters for generalized advantage estimation. Indicates the offset from time step t. The timing difference error at a specific future moment in a given time step is considered because evaluating the quality of an action at the current time step cannot rely solely on the feedback from that current time step; the cumulative impact of that action on all future moments must also be taken into account. (Opportunity Value) This indicates that the current action taken is better than the average performance, and vice versa.
[0029] Step 5.3: Calculate the total loss of the policy network and the total loss of the value network based on the advantage function; Calculate probability ratio Specifically, this is achieved through the following formula: ; in, For the parameters of the policy network, This represents the distribution of the policy network output. This represents the distribution of the policy network output before the update; Calculate the objective function value of the policy after shearing. Specifically, this is achieved through the following formula: ; in, Represents the mathematical expectation. This represents a numerical clipping function used to restrict the probability ratio of an input to a specified closed interval. It is a hyperparameter of the shear range; To encourage agents to explore different policies, a policy entropy term is added to the loss function to calculate the total loss of the policy network. Specifically, it is calculated using the following formula: ; in, For the policy entropy weights, express strategy entropy; Calculate the total loss of the value network Specifically, it is calculated using the following formula: ; ; in, Indicates a time step. This represents the state estimate at time step b. This indicates the cumulative return on the discount. This represents the composite shared reward for time step b+x; Step 5.4: Based on the total loss of the policy network and the total loss of the value network, update the parameters in the policy network and the value network using the Adam optimizer; Step 5.5: Repeat steps 5.1-5.4 above to iteratively update the parameters in the policy network and the value network multiple times. To accurately monitor the policy performance, after each update, calculate the average of all composite shared rewards in the current iteration and the previous M-1 iterations to obtain the average round reward, which is achieved through the following formula: ; in, For the first Total time step of the iteration. For the first In the nth iteration The composite shared reward obtained at each time step; Count the number of escaped robots successfully captured by the pursuing robot in M iterations. Calculate the task success rate Specifically, this is achieved through the following formula: ; When the difference in average round rewards over M consecutive iterations is less than a preset threshold, and the task success rate... Reaching the preset threshold, and the value loss function Once the value drops below a preset threshold, the training is considered complete, and the trained policy network is obtained. After training, deploying the Actor network enables distributed, real-time pursuit decisions. The Critic network can assist in training policy networks with varying numbers of pursuit robots without initialization, effectively improving training efficiency.
[0030] Step 6: Construct a local observation map, input the feature vectors of all nodes in the local observation map into the trained policy network to obtain actions, and the pursuit robot executes the actions; Step 6.1: Fixing and Deploying Actor Policy Network Parameters; Combination Figure 3 The trained Actor network parameters are solidified and shared with each isomorphic pursuit robot agent, including the parameters of the graph attention module, mask pooling module, GRU module, and MLP decision layer. The Critic network is only used during the training phase and does not participate in decision-making during the execution phase.
[0031] Step 6.2: Construction of online graph structure based on local observations; During the execution phase, each pursuit robot is constantly... By sensing neighboring intelligent agents within its observation range and acquiring local information such as their relative positions and velocities, it constructs a local graph centered on itself. .
[0032] Step 6.3: Generation and execution of decentralized collaborative actions; Each pursuing robot inputs its local graph into the Actor network to obtain its action at the current moment. Therefore, the pursuit robot can perform actions in parallel by relying only on its own local observations, without the need for coordination from a central node.
[0033] The key points of this invention are as follows: This invention models the spatial relationships of multiple agents under limited perception conditions as a dynamic graph structure, and utilizes the permutation invariance of graph representation to achieve adaptive processing of dynamically changing agent numbers.
[0034] This invention proposes a graph-based decentralized Actor network, which extracts neighborhood features and models temporal dependencies through a graph attention network, effectively improving collaborative decision-making capabilities in some observable environments.
[0035] This invention proposes a graph-based centralized Critic framework that generates fixed-dimensional global features through a multi-head attention mechanism, enabling the model to adapt to intelligent agent systems of different sizes and supporting policy transfer in variable-number pursuit scenarios.
[0036] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A pursuit-evasion game method based on multi-agent graph reinforcement learning, characterized in that, include: Step 1: During the pursuit of N chasing robots and 1 escape robot on a preset map, construct a global time-varying undirected graph and a local observation graph, and construct a node feature vector for each node in the global time-varying undirected graph and the local observation graph; Step 2: Construct node feature vectors for each node based on the global time-varying undirected graph and the local observation graph, generate GRU hidden states, and then generate the actions of the pursuit robot; Step 3: Each pursuit robot performs the corresponding action, and the composite shared reward is calculated; Step 4: the global time-varying undirected graph of time step The joint state transition sample is composed of the global time-varying undirected graph of time step , the local observation graph, the action of all chasing robots, the composite shared reward, the termination flag and the GRU hidden state of all chasing robots. The joint state transition samples of multiple continuous time steps are spliced into a trajectory sequence, and the spliced trajectory sequence is stored in the experience buffer. Step 5: Train the policy network based on the joint state transition samples in the experience buffer to obtain the trained policy network; Step 6: Construct a local observation map, input the feature vectors of all nodes in the local observation map into the trained policy network to obtain actions, and the pursuit robot executes the actions.
2. The pursuit-escape game method based on multi-agent graph reinforcement learning according to claim 1, characterized in that, Step 1 includes: Step 1.1: During the chase between N pursuing robots and 1 escape robot on a preset map, acquire the pursuing robots. At time step state vector , ,in , , , The first The position, heading angle, linear velocity, and angular velocity of the pursuit robot; Step 1.2: Treat each pursuit robot as a node, calculate the relative distance between the positions of two pursuit robots, and construct an edge between the nodes of the two pursuit robots when the relative distance is less than the preset perception radius, thus obtaining a global time-varying undirected graph. By using the node corresponding to each pursuit robot as the central node, a global time-varying undirected graph can be obtained. Nodes directly connected to the central node are designated as neighboring nodes. The central node and its directly connected neighboring nodes form a local observation graph. ; Step 1.3: Create a globally time-varying undirected graph Each node is built at time step Node feature vectors , ,in, This represents the position difference between the pursuing robot i and the escaped agent e on the horizontal axis. This represents the positional difference between the pursuing robot i and the escaped agent e on the vertical axis; For local observation map Each neighbor node in the time step is built. Node feature vectors , ,in, Including linear velocity and angular velocity ; Including neighboring nodes and central node relative displacement between and relative speed ; Includes the tracking robot corresponding to the neighbor node and escape robots relative displacement between and relative velocity ; This is a flag bit, which indicates the pursuit robot. Is it possible to observe the escaped robot? Indicates a pursuit robot The closest distance to the preset map boundary.
3. The pursuit-escape game method based on multi-agent graph reinforcement learning according to claim 2, characterized in that, Step 2 includes: Step 2.1: Input the node feature vector of the center node and the node feature vectors of the neighboring nodes of the local observation graph into the attention layer to obtain the weights corresponding to each neighboring node. Specifically, this is achieved through the following formula: ; in, This represents a nonlinear activation function with a negative slope. This represents the transpose of the trainable attention weight vector. Represents the weight matrix; Indicates the central pursuit robot The node feature vector at time step t, i.e. ; Indicates a pursuit robot At time step The set of neighboring nodes, Indicates a pursuit robot itself, This represents the union operation. This represents a vector concatenation operation; Indicates a pursuit robot neighboring nodes The node feature vector at time step t, express The node feature vector of node c in the array; Aggregate the weights of all neighboring nodes to obtain the aggregated spatial feature vector. Specifically, this is achieved through the following formula: ; in, Represents a non-linear activation function. This represents the aggregated shared weight matrix used for neighborhood space feature transformation; Step 2.2: Utilize flag bits relative displacement Perform mask filtering and max pooling to obtain the central pursuit robot. At time step Extracted and aggregated feature vectors of escaped targets Specifically, it is expressed by the following formula: ; in, This represents a multilayer perceptron; Step 2.3: Combine the aggregated spatial feature vectors and escape target feature vector The features are concatenated to obtain a joint feature vector, which is then input into a gated recurrent unit to obtain the GRU hidden state. Hide the GRU state The pursuit robot is obtained through a multi-layer sensor. action The action includes linear velocity and angular velocity.
4. The pursuit-escape game method based on multi-agent graph reinforcement learning according to claim 1, characterized in that, Step 3 includes: Step 3.1: After each pursuing robot performs its corresponding action, calculate the distance between each pursuing robot and the escaped robot. If the distance between any pursuing robot and the escaped robot is less than or equal to the capture radius, then set the sparse termination reward... As a preset value, if the distance between all pursuing robots and escaped robots is greater than the capture radius, then the sparse termination reward is set. =0; Step 3.2: Calculate the angle potential reward Specifically, this is achieved through the following formula: ; in, For time step The maximum angular clearance between adjacent pursuit robots at the time of the action. This is the reward coefficient; Calculate distance potential reward Specifically, this is achieved through the following formula: ; in, It is a preset reward coefficient. Indicates time step The minimum distance between all pursuing robots and the escaped robot at that time. Indicates time step The minimum distance between all pursuing robots and the escaped robot at that time. Indicates time step The average of the F smallest distances between all pursuing and escaping robots. Indicates time step The average of the F smallest distances between all pursuing and escaping robots; Rewarding Angle Potential and distance potential rewards Adding them together yields a dense plasticity reward. ; Step 3.3: At the time step If the distance between any two pursuit robots is less than or equal to the preset collision avoidance distance for pursuit robots, then the collision penalty for teammates will be a fixed negative penalty value. If the distance between any two pursuit robots is greater than the preset collision avoidance distance for pursuit robots, then the collision penalty for teammates will be 0. At time step If the shortest distance between any pursuing robot and the map boundary is less than or equal to the preset area boundary collision avoidance distance, then the boundary collision penalty is set to a fixed negative penalty value. If the shortest distance between all the chasing robots and the map boundary is greater than the preset area boundary collision avoidance distance, then the boundary collision penalty is set to 0. If the current time step Reaching the maximum number of rounds limit If the escaped robot is still not captured, the time step over-limit penalty is set to a fixed negative penalty value. If the current time step The maximum number of rounds has not been reached. Then the time step over-limit penalty is set to 0; The penalty for teammate collision, boundary collision, and time step exceeding the limit is added together to obtain the penalty item that ensures safety and coordination. ; Step 3.4: Reduce sparse termination rewards Intensive Plasticity Reward Penalties for ensuring security and collaboration Add them together to get a compound shared reward. .
5. The pursuit-escape game method based on multi-agent graph reinforcement learning according to claim 1, characterized in that, Step 5 includes: Step 5.1: Randomly select from the cache A joint state transition sample is used to update the node feature vector of the pursuit robot, and then the state estimate values at B time steps are calculated. Step 5.2: According to The advantage function is calculated based on the state estimates at each time step. Step 5.3: Calculate the total loss of the policy network and the total loss of the value network based on the advantage function; Step 5.4: Based on the total loss of the policy network and the total loss of the value network, update the parameters in the policy network and the value network using the Adam optimizer; Step 5.5: Repeat steps 5.1-5.4 above to iteratively update the parameters in the policy network and the value network multiple times. After each update, calculate the average of all composite shared rewards in the current iteration and the previous M-1 iterations to obtain the average round reward, which is achieved through the following formula: ; in, For the first Total time step of the iteration. For the first In the nth iteration The composite shared reward obtained at each time step; Count the number of escaped robots successfully captured by the pursuing robot in M iterations. Calculate the task success rate Specifically, this is achieved through the following formula: ; When the difference in average round rewards over M consecutive iterations is less than a preset threshold, and the task success rate... Reaching the preset threshold, and the value loss function If the value drops below a preset threshold, the training is considered complete, and the trained policy network is obtained.
6. The pursuit-escape game method based on multi-agent graph reinforcement learning according to claim 5, characterized in that, Step 5.1 includes: For each joint state transition sample, a multi-head graph attention mechanism is used to update the node feature vectors in the global time-varying undirected graph and the node feature vectors in the local observation graph through multiple layers, resulting in updated node features. ; Among them, in the first l The update of a layer is represented as: ; in, This indicates the current layer number of the multi-head graph attention network. For the first The node at the th The updated feature vector after the layer, For the first The node at the th The updated feature vector after the layer, For the number of attention heads, Indicates all The feature vectors calculated by each independent attention head are concatenated according to the channel dimension. and They represent the first Normalized attention coefficients and shared weight matrix for each attention head; Global average pooling and max pooling operations are used to combine and concatenate the updated nodes of all the pursuit robots to obtain the global feature vector. Specifically, this is achieved through the following formula: ; global feature vectors Input the value network to obtain state estimates, and then obtain state estimates for all time steps.
7. The pursuit-escape game method based on multi-agent graph reinforcement learning according to claim 5, characterized in that, Step 5.2 includes: The time series difference error is calculated using the generalized dominance estimation method. Specifically, this is achieved through the following formula: ; in, It's the discount rate. These are parameters of the value network. This represents the state estimate at time step t+1. This represents the state estimate at time step t. and from Obtained from the state estimates at each time step; Based on timing difference error Calculate the advantage function Specifically, this is achieved through the following formula: ; in, Indicates the maximum time step length. Indicates a time step. This represents the tradeoff hyperparameters for generalized advantage estimation. Indicates the offset from time step t. The timing difference error at a specific future moment in time steps.
8. The pursuit-escape game method based on multi-agent graph reinforcement learning according to claim 5, characterized in that, Step 5.3 includes: Calculate probability ratio Specifically, this is achieved through the following formula: ; in, For the parameters of the policy network, This represents the distribution of the policy network output. This represents the distribution of the policy network output before the update; Calculate the objective function value of the policy after shearing. Specifically, this is achieved through the following formula: ; in, Represents the mathematical expectation. This represents a numerical clipping function. It is a hyperparameter of the shear range; Calculate the total loss of the policy network. Specifically, it is calculated using the following formula: ; in, For the policy entropy weights, express strategy entropy; Calculate the total loss of the value network Specifically, it is calculated using the following formula: ; ; in, Indicates a time step. This represents the state estimate at time step b. This indicates the cumulative return on the discount. This represents the composite shared reward for time step b+x.
