A computer-implemented method for training an untrained policy network of an autonomous agent
The behavior-conditioned policy network training method addresses the challenges of replicating human behavior and overfitting in autonomous agents by training agents with unique behaviors and intrinsic rewards, resulting in improved navigation and resource efficiency in crowded environments.
Patent Information
- Application Number
- GB2023004559
- Authority / Receiving Office
- GB · GB
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2024-10-09
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for training autonomous agents in crowded environments, such as local motion planners, face challenges in replicating true human behavior, overfitting, and encouraging cooperative behavior, which affects their robustness and generalization in real-world scenarios.
A computer-implemented method for training an untrained policy network using a behavior-conditioned approach, where autonomous agents are trained with unique behaviors, and a discriminator module predicts behavior vectors to determine intrinsic rewards, allowing for efficient training and diverse behaviors, thereby improving navigation through crowded environments.
The method enhances the robustness and generalization of autonomous agents by allowing them to learn diverse behaviors, reducing collisions, and optimizing computational resources, leading to improved success rates in navigating crowded areas.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
A computer-implemented method for training an untrained policy network of an autonomous agent TECHNICAL FIELD The invention relates to reinforcement learning. Specifically, the invention relates to a computer-implemented method for training an untrained policy network of an autonomous agent in order to obtain a behavior-conditioned policy network. BACKGROUND For training, behaviors of existing data-driven local motion planners rely primarily on the environment in which the agent is deployed. A reinforcement learning (RL) agent can iteratively interact in this environment to learn from past mistakes and reinforce good behaviors to maximise a pre-specified utility. In the context of local motion planning, the choice of the moving obstacles for the interactive environment may determine how robust the agent behaves within crowds in the real world. There are commonly three choices to generate the movements of dynamic obstacles, such as pedestrians. One approach is to use pre-defined waypoints as disclosed in, e.g., https: / / arxiv.org / abs / 1910.09998. In this approach, the pedestrians follow some waypoints which are collected from offline sources. A drawback of such an approach is that these pedestrians are not reactive to the learning agent. This does not reflect true human behavior where humans will often react when an object is moving towards them. Another known approach is using a fixed non-learning-based algorithm as disclosed in, e.g. https: / / arxiv.org / abs / 1809.08835. Here, the pedestrians follow a fixed non-learning-based motion planning algorithm. Whilst these pedestrians are reactive to the learning agent, a drawback of such method is potentially overfitting to this behavior which tends to generalize not as well to unseen scenarios. Another approach is using a de-centralized multi-agent RL setup as disclosed in, e.g., https: / / arxiv.org / abs / 1609.07845. The most popular approach way to generate crowd movements is via an entirely new paradigm based on multi-agent RL. In this approach, instead of specific movements, the pedestrians all bootstrap onto the same RL policy as the learning agent. At first, the agent and pedestrians move randomly from its starting position. As the training progresses, since both agents and pedestrians aim to reach their respective goal, both can implicitly create crowd movements. However, a drawback is that due to the bootstrapping, it encourages cooperative behavior which is not necessarily true in the real world. SUMMARY OF THE INVENTION It is the object of the invention to improve the navigation of autonomous agents through a crowded environment. The object is achieved by the subject matter of the independent claims. Preferred embodiments are subject-matter of the dependent claims. The invention provides a computer-implemented method for training an untrained policy network of an autonomous agent in order to obtain a behavior-conditioned policy network, the method comprising: a) randomly sampling a unique behavior token from a token collection of a plurality of behavior tokens, each behavior token being indicative of a unique behavior of the autonomous agent; b) randomly generating an initial state of a training environment, in which the autonomous agent is to be trained; c) with the policy network, determining a next action to be taken by the autonomous agent based on the unique behavior token and the initial state; d) feeding the next action to a discriminator module that is configured to predict at least one behavior vector based on a current state and / or the next action, wherein the behavior vector includes a value entry for each unique behavior token of the token collection, wherein each value entry is indicative of how much the associated unique behavior token is exhibited by the autonomous agent; e) with the discriminator model determining an intrinsic reward based on the behavior vector predicted in step d); f) updating the policy network with a proximal policy optimization (PPO) algorithm; g) updating the environment and repeating steps c) to f) based on the updated environment until a predetermined condition is met, wherein a next state is randomly sampled from the updated environment based on the previous state and the previous action, wherein the next state is used instead of the initial state. With this method, an autonomous agent - sometimes called the main agent - can be trained in an environment that includes other autonomous agents. In contrast to conventional methods, each autonomous agent in the environment exhibits a different and unique behavior. From the perspective of the main agent the other autonomous agents act as moving obstacles that can represent pedestrians, for example. As a result, the policy network is conditioned such that, if the autonomous agent is moving through crowded places, such as a shopping mall or pedestrian precinct, collisions with the individuals moving around the agent can be more reliably avoided. In addition, the method is able to train a plurality of behaviors for a plurality of autonomous agents simultaneously such that in the deployment phase, each agent may exhibit an individual behavior. Thus, the overall computational resources that are available for training can be used more efficently. Preferably, in step d) the discriminator module comprises a state-action discriminator model that is configured to predict a state-action behavior vector based on the current state and the next action and a state-only discriminator model that is configured to predict a state behavior vector based on the current state. Preferably, in step e) the discriminator module determines the intrinsic reward based on the state-action behavior vector normalized by the state behavior vector. With this measures, the individual behavior of the agent can be predicted more efficiently by basing the prediction merely on a single state-action pair, i.e., current state and next action. With this computational resources can be used more efficiently, e.g., by training a greater amount of agents simultaneously with given resources or by needing fewer resources given a predetermined amound of agents. It should be noted that it is a surprising effect that there is no need to consider the whole stateaction history of each agent to obtain useful results. Preferably, step f) comprises an advantage estimator module determining an estimated total reward based on an extrinsic task reward and the intrinsic reward, wherein the extrinsic task reward is determined based on the current state and the next state. Preferably, the PPO algorithm is performed with a loss function that includes the estimated total reward as an input. The extrinsic task reward is indicative of whether and to what degree the agent comes closer to fulfilling the task. The intrinsic reward is indicative of whether and to what degree the behavior is suitable for performing the task. In combination the rewards steer the PPO algorithm towards a more efficient task performance while still maintaining diverse behaviors. Preferably, the advantage estimator module determines the extrinsic task reward based on a trainable extrinsic value function that is configured for outputting a value that is indicative of an expected task reward. Preferably, the extrinsic task reward is determined based on a difference of the extrinsic value function applied to the next state and the extrinsic value function applied to the current state. Preferably, the advantage estimator module determines the extrinsic task reward based on a trainable intrinsic value function that is configured for outputting a value that is indicative of an expected intrinsic reward. Preferably, the extrinsic task reward is determined based on a weighted sum of the intrinsic reward and a difference of the intrinsic value function applied to the next state and the intrinsic value function applied to the current state. With this implementation the estimation of the different rewards can be a trainable function. Instead of designing a heuristic function for estimating the rewards, the estimation by a trainable function can be more efficent and more accurate. Preferably, step f) comprises a value function module that updates the extrinsic value function based on a squared error loss function that receives as input a discounted task reward as truth and the extrinsic value function applied to the current state as prediction. Preferably, step f) comprises a value function module that updates the intrinsic value function based on a squared error loss function that receives as input a discounted intrinsic reward as truth and the intrinsic value function applied to the current state as prediction. Experiments performed by the inventor have shown that this choice of value function is particularly suitable for this method. Overall the success rate of agents trained with this implementation can be improved. Preferably, step f) comprises updating the discriminator module based on a cross-entropy loss between the behavior token and the behavior vector. Experiments performed by the inventor have shown that this choice of value function is particularly suitable for this method. Overall the success rate of agents trained with this implementation can be improved. Preferably, the state-action discriminator model is updated based on a cross-entropy loss between the state-action behavior vector and the behavior token and / or wherein the state-only discriminator model is updated based on a cross-entropy loss between the state behavior vector and the behavior token. Experiments performed by the inventor have shown that this choice of value function is particularly suitable for this method. Overall the success rate of agents trained with this implementation can be improved. Preferably, the method is performed in a manner that a predetermined number of autonomous agents each initially having an untrained policy network is trained in order to obtain autonomous agents with a trained policy network. With this approach several agents can be trained simultaneously with diverse behaviors. The invention provides a behavior-conditioned policy network obtainable by performing a previously described method. The invention provides an autonomous mobile robot that is configured to navigate through an environment that includes at least one dynamic obstacle, the autonomous mobile robot comprising: - at least one sensor that is configured to obtain sensor data that is indicative of a surrounding portion of the environment; - a control unit that is configured to measure robot information that is indicative of at least one motion-related and / or position-related property of the robot, characterized in that the control unit comprises a previously described behavior-conditioned policy network. The invention provides a method for navigating an autonomous mobile robot through an environment, the method comprising: a) assigning a goal position to the autonomous mobile robot; b) with the at least one sensor detecting sensor data; c) with the behavior-conditioned policy network, generating an action; d) with the control unit generating a control signal based on the action determined in step c); and e) performing steps b) to d) until the sensor data indicate that the autonomous mobile robot reached the goal position. The invention provides a computer program comprising instructions which, when the program is executed by a computer, cause the computer to carry out one, some or all steps of a previously described method. The invention provides a computer-readable data carrier or data carrier signal carrying a computer program. In an embodiment the solution is based on a de-centralized multi-agent RL setup. Benefits include, but are not limited to, a training environment that allows for crowd movements with diverse behaviors between different agents, crowd movements which can continually evolve as the main agent is trained, sampling efficient training which allows to use data collected from all agents and / or a memory efficient implementation with no additional required policies. In an embodiment, a navigation task is formulated as a Markov decision process (MDP) represented by <S, A, P, R, y>, where S designates the (current) state space, A designates the action space, P designates a state-transition model, R designates a reward function, and y designates a discount factor. The state space S provides input elements that are called states and designated with small s to the MDP. The state s may comprise environment information that is indicative of one or more properties of the observed environment in which the agent navigates. Each state s may comprise agent information that is indicative of one or more properties of the agent. The environment information may comprise imaging sensor data, e.g., from an RGB camera, non-imaging sensor data, e.g., from a lidar or ultrasonics, or non-sensor data, e.g., costmaps. The agent information may comprise (current) motion data, such as (current) agent position, (current) agent velocity, and an agent goal. These data are preferably sampled at fixed time intervals. Each state s may comprise goal information that is indicative of how close the respective agent is to its predetermined goal. The goal information may include an absolute or relative destination position of the goal in the environment. The action space A of the agent is a collection of different desired motion data, which form the actions a. The desired motion data may include a desired agent velocity and / or a desired angular velocity. Any of the velocities may be characterized by a direction and a magnitude. The action space A may be limited to a maximum magnitude, i.e. there may be a maximum velocity that is allowed for the agent. The transition probability T is indicative of how likely it is for the agent to transition to a next state s' after taking action a in current state s. This is in general unknown for the navigation task and can be determined by taking actions in the environment at random. The transition probability T may also depend on the agent dynamics and / or environmental factors, such as obstacles and terrain conditions. The reward function R is indicative of whether the agent after transiting from state s to state s' has reached a goal, is closer to a goal or reached an undesired state. The reward r is generally positive for reaching a goal and negative for reaching an undesired state. If neither progress towards the goal was made nor an undesired state was reached, then the reward r is neutral. In terms of numbers, for example, if the state s' lead to reaching a goal, the reward r may be +1, if the state s' lead to an undesired state s', such as a collision of the agent with another agent, the reward r is -1. In other cases the reward r is preferably positive and based on the change in distance of the agent relative to its goal in order to encourage the agent to progress towards its predetermined goal. In some embodiments a policy ttQ is represented by a deep neural network (DNN) which outputs an action a for every given input state s. In some embodiments the policy is chosen to try and maximize the expected sum cumulative reward defined for the MDP. In some embodiments the policy collects data by taking a sequence of actions in the environment. Preferably, the collected data is in a form of trajectories. Each trajectory is represented by a sequence of a state s, an action a, and a reward r across a plurality of time steps. In some embodiments, the policy is optimized using an actor-critic method. The actor proposes a probability distribution for actions to be taken by the agent. The critic determines the expected reward for each action. The optimization is done by updating the policy such that the reward is increased. An optional value function can be used as a critic during policy updates. The discriminator module predicts the behavior token that is designated with z (categorial). Input data to the discriminator is preferably the state only or the state and the action. The policy is preferably conditioned to the behavior token z which allows creation of diverse behaviors depending on the behavior token z. The policy can predict the best action for the specific agent. For each episode during training, each agent samples a discrete behavior token z randomly. In some embodiments the loss for the discriminator module is the cross-entropy loss between the predicted behavior token and the behavior token label from a uniform distribution of behavior tokens. Without prejudice, this is believed to be the key reason for the diverse behaviors due to ability to identify the agents purely based on their past movements. In other words, if the classifier fails to identify individual agents, it means the agents behavior may not be diverse and vice versa. In some embodiments the full policy network is trained end-to-end on the combined loss using stochastic gradient descent. Mobile agents, specifically mobile robots, are typically deployed in non-stationary environments. The states s for the MDP can be observed in the target environment. During deployment, the a behavior token is chosen for the agent and stays fixed. In some embodiments the behavior token together with the current state s are used as inputs to the trained behavior-conditioned policy to predict the best action a for this time step, such as the desired velocity and angular velocity of the agent. The ideas described herein are specifically useful for autonomous robots for transport and delivery in urban areas. During deployment, the robot faces the challenge of traversing crowded environments with multiple dynamic obstacles, such as pedestrians. Some specific use cases include, crossing traffic lights, crossing zebra crossing or moving in crowded places with comparatively limited space indoors like malls or office lobbies. BRIEF DESCRIPTION OF THE DRAWINGS Embodiments of the invention are described in more detail with reference to the accompanying schematic drawings. Fig. 1 depicts an environment in which autonomous mobile robots are navigating; Fig. 2 depicts a diagram of a computer-implemented training setup; Fig. 3 depicts a diagram of a policy network; Fig. 4 depicts a diagram of a value network; Fig. 5 depicts a diagram of a state-action discriminator model; and Fig. 6 depicts a diagram of a state-only discriminator model. DETAILED DESCRIPTION OF EMBODIMENT Referring to Fig. 1, an environment 10 is depicted. The environment 10 includes a plurality of agents 12. Each agent 12 represents an autonomous mobile robot that is to be trained to navigate through the environment 10. The environment 10 is preferably an abstraction of a real environment and may include static obstacles. Referring to Fig. 2, a training setup is described in more detail. The training setup comprises a policy network 14 that is to be trained. The policy network 14 can receive a behavior token z from a token collection 16 of behavior tokens z. The policy network 14 is generally configured to determine an action at to be taken by the agent 12 based on the behavior token z and a current state st of the environment 10. The current state st may include robot information that is indicative of a motion-related and / or position-related property of the agent 12. The current state st may further include goal data that is indicative of a destination position d within the environment 10 that is to be reached by the agent 12. The training setup further includes a discriminator module 17. The discriminator module 17 comprises a state-action discriminator model 18 and a state-only discriminator model 20. The state-action discriminator model 18 is configured to predict a state-action behavior vector zsa based on the behavior token z, the action at and the current state st. The state-only discriminator model 20 is configured to predict a state-only behavior vector zs based on the behavior token z and the current state st. In the training setup, the policy network 14 and the discriminator module 17 are trainable, whereas the environment 10 and the collection 16 are untrainable. Referring to Fig. 3, the policy network 14 is described in more detail. The policy network 14 includes at least one sensor backbone module 22 that is configured to process sensor data from a sensor 23. The sensor backbone module 22 is configured to determine a feature embedding of the sensor data and is adapted to the respective type of the sensor 23. In case of an imaging sensor, e.g., a camera, the sensor backbone module 22 may be configured for object detection and include a convolutional neural network to perform that task. An example for a 2D convolutional network are residual networks. A suitable network is ResNet which is disclosed in He et al., “Deep Residual Learning for Image Recognition”, available at https: / / dgg.org / 10,4855Q / ar:Xiy,1512,03385. In case of a non-imaging sensor, e.g., lidar or ultrasonic sensors an example for a sensor backbone module 22 may include a multi-layer perceptron, transformer-based models or a 1D convolutional neural network. An example for a suitable network for lidar data is VoxelNet which is disclosed in Zhou et al., “VoxelNet: End-to-End Learning for Point Cloud Based 3D Object Detection”, available at httgsjTdo^ Another example is Li3DeTr which is disclosed in Erabati et al., “Li3DeTr: A LiDAR based 3D Detection Transformer”, available at https: / / doi.org / 10.48550 / arXiv.2210.15365. As the various backbones are known in the art, they are not described any further. Instead reference is made to the abovementioned prior art publications. The policy network 14 may include auxiliary feed forward layers 24 that receive robot information srObot, such as position, velocity and / or goal position. The auxiliary feed forward layers 24 may be configured as a multi-layer perceptron having 2 to 4 hidden layers and 16 to 512 hidden nodes in total. The auxiliary feed forward layers 24 receive the robot information srobot and output an embedding thereof. The outputs of the sensor backbone modules 22 and the auxiliary feed forward layers 24 are concatenated by a concatenation module 26. The concatenated data forms bottleneck features 28. The policy network 14 includes main feed forward layers 30, that are preferably configured as a multi-layer perceptron. The main feed forward layers 30 receive the feature embeddings of the sensor backbone modules 22 and the auxiliary feed forward layers 24 as well as the behavior token z. The main feed forward layers 30 output the action at that is to be taken next by the agent 12. During training the policy network 14 uses a proximal policy optimization loss Lppo that will be described later. During training the sensor backbone modules 22, the auxiliary feed forward layers 24 and the main feed forward layers 30 are trained. Referring to Fig. 4, a value network 32 is described in more detail. The value network 32 is similar in structure to the policy network 14 and only described insofar as it differs from the policy network 14. The value network 32 does not have the behavior token z as an input. The main feed forward layers 30 again receive the bottleneck features 28 of the sensor backbone modules 22 and the auxiliary feed forward layers 24. The main feed forward layers 30 output a scalar value that is indicative of an expected reward. During training the value network 32 uses square error loss L2. During training the sensor backbone modules 22, the auxiliary feed forward layers 24 and the main feed forward layers 30 are trained. Referring to Fig. 5, the state-action discriminator model 18 is described in more detail. The state-action discriminator model 18 is similar in structure to the policy network 14 and only described insofar as it differs from the policy network 14. The state-action discriminator model 18 has the action at determined by the policy network 14 as an input instead of the behavior token z. The main feed forward layers 30 again receive the bottleneck features 28 of the sensor backbone modules 22 and the auxiliary feed forward layers 24. The main feed forward layers 30 output a stateaction behavior vector zsa that is indicative of how much the associated unique behavior token z is exhibited by the autonomous agent 12. During training the stateaction discriminator model 18 uses a cross-entropy loss Lzsaz between the predicted state-action behavior vector zsa and the behavior token z. During training the sensor backbone modules 22 and the auxiliary feed forward layers 24 of the policy network 14 are used and not trained based on the cross-entropy loss Lzsaz; only the main feed forward layers 30 are trained based on the cross-entropy loss Lzsaz. Referring to Fig. 6, the state-only discriminator model 20 is described in more detail. The state-only discriminator model 20 is similar to the state-action discriminator model 18 and only described insofar as it differs therefrom. There is no input of the action at. Furthermore, the main feed forward layers 30 output a state-only behavior vector zs. During training a cross entropy loss LZSz is used between the predicted state-only behavior vector zs and the behavior token z. Referring back to Fig. 1 and Fig. 2, each agent 12 comprises a policy network 14 that is configured to determine an action at to be taken by the agent 12. The agent 12 comprises a control unit 34 that generates a control signal based on the action at that causes the agent 12, or rather the autonomous mobile robot represented by the agent 12, to perform the action at. The action at causes a change to the motion-related robot information, in particular the direction and / or magnitude of the robot velocity. In the following a method for training the policy network 14 is described in more detail. In order to form the policy network 14 into a behavior-conditioned policy network 36 the training process involves two general alternating steps: sampling trajectories by executing the policy in parallel, and updating the policy using the sampled data via a PPO algorithm that is known from J. Schulman, et al., “Proximal policy optimization algorithms”, arXiv: 1707.06347, 2017, the disclosure of which is incorporated herein by reference. While collecting data, every agent 12 uses an identical policy network 14 to produce trajectories that are composed of a plurality of actions at until they accumulate a batch of data. All model parameters are updated using the Adam optimizer, which is well known and an improved version of stochastic gradient descent. At the beginning of training, each agent 12 samples a behavior token z from the collection 14 using a discrete uniform distribution with a predetermined number of behaviors, M. Each agent 12 samples from the policy network 14 which is conditioned on the sampled behavior token z. This behavior-conditioned policy network 14 enables agents 12 to take different actions depending on the sampled behavior token z. An intrinsic reward nnt is calculated for each agent 12 based on the predicted stateaction behavior vector zsa and the predicted state-only behavior vector zs according to nnt = log zsa - log zs. The respective behavior vectors zsa, zs are calculated using the discriminator models 18, 20. The discriminator models 18, 20 are neural networks parameterized by two different sets of parameters called ipsa and ips, respectively. The design of the neural network architecture is depicted in Fig. 5 and Fig. 6. Since the discriminator models 18, 20 are to be updated regularly, preferably separate value networks 32 are used to track the non-stationary intrinsic reward nnt. Preferably, there is an intrinsic value function associated with estimating the expected intrinsic reward nnt and an extrinsic value function associated with estimating an extrinsic task reward r. In order to calculate the advantage values for the PPO loss Lppo, a weighted sum of the advantages derived from the respective value functions is computed, i.e. A = Aext + a Ant where a is a hyperparameter. The discriminators 18, 20 are optimized with the cross-entropy loss. This loss is computed between the respective predicted behavior vectors zsa, zs derived using on-policy samples against the ground truth sampled behavior token z. The training is initialized by assigning random values to the parameters of the respective learnable / trainable components, e.g., the policy network 14, the (intrinsic / extrinsic) value networks, and the respective discriminators 18, 20. The training is performed until a predetermined condition is met. The condition may also be a defined by a predetermined number of training steps, i.e., time steps. The following steps are repeated for a predetermined number of times that correspond to the number of agents 12. In other words, the following steps are performed once for each agent. A behavior token z is randomly sampled from the collection 14. Furthermore, a random initial state si is generated. The following steps are performed for a predetermined number of time steps that in total correspond to preferably about one minute of real time. The policy network 14 determines the next action at that the agent 12 will take based on the current state st and the behavior token z. The action at and the current state st are fed to the state-action discriminator model 18 and the state-action discriminator model 18 predicts the state-action behavior vector zsa. Furthermore, the current state st is received by the state-only discriminator model 20, which predicts the state-only behavior vector zs. The intrinsic reward nnt is determined by log zsa - log zs. The intrinsic reward nnt is thus normalized by the log zs term. Now, the next state st+i of the environment 10 is determined. The extrinsic task reward rt is determined based on the next state st+i, the current state st and the action at. As the last step in the same time step, the expected total reward is calculated. The expected total reward A is obtained by first determining an expected extrinsic task reward Aext (sometimes called extrinsic task advantage) based on the following equation: T Aext — '^Y^iTt T YVext($t+l) — Vext(j>t)> 1=0 where Aext is the expected extrinsic task reward, y is the discount factor, A is the PPO smoothing factor, rt is the extrinsic task reward that was just previously calculated, and Vext(st) and Vezt(st+1) is the result of the extrinsic value function applied to the current state st and the next state st+i, respectively. Secondly, an expected intrinsic task reward Ant is determined according to the following equation: T Aint '(Y^) (TintX T intC^t) > 1=0 where Aint is the expected intrinsic task reward, y is the discount factor, A is the PPO smoothing factor, rintit is the intrinsic task reward that was just previously calculated, and Vint^St) and Vint(st+1) is the result of the intrinsic value function applied to the current state st and the next state st+i, respectively. The expected total reward A is calculated according to A = Aext + a Ant, where a is a hyperparameter called the advantage weight. After completing all time steps, the method proceeds with the next agent 12. With all time steps for each agent 12 completed, the policy network 14, the value functions 40, 42 and the discriminators 18, 20 can be updated as described below. Before updating a copy of the policy network 14 is stored. For a predetermined number of epochs, e.g., 3 epochs, an update ratio kt is calculated by dividing the results of the policy network 14 by the copy of the policy network. The PPO Loss Lppo is calculated according to the equation: T Lppo = min(fctA, clip(fct, 1 — £, 1 + e)A), t=i where T is the number of time steps, “min” is the minimum function, “clip” is the clipping function and £ is the clipping parameter, e.g., 0.1. The clipping function restricts the values of the update ratio kt to a reasonable interval ofl-£<fct<l + e. The parameters of the policy network 14 are updated using the well-known Adam optimizer and the PPO loss Lppo. Subsequently, the value functions 40, 42 are updated. For a number of epochs, e.g., 3 epochs, the loss is calculated according to: i=lt=l ' ' \2 yt -trt _ j , i>t / where N is the total number of agents 12, T is the total number of time steps, and y is the discount factor, r- and 7(s£) are the intrinsic reward and the instrinsic value function applied to the state s of agent i at time t or the extrinsic reward and the extrinsic value function. The parameters of each value function, 42 are updated using the Adam optimizer and the respective losses L2. Now, the discriminator models 18, 20 are updated by again for a number of epochs, e.g., 1 epoch predicting the behavior vectors zsa and zs and calculating the loss: N T Lcross—entropy ’ i=lt=l where N is the total number of agents 12, T is the total number of time steps and z' is the behavior token z of agent i. Depending on the discriminator model 18, 20 z^ is the state-action behavior vector zsa or the state-only behavior vector zs of agent i at time t. The parameters of each discriminator model 18, 20 are updated using the Adam optimizer and the respective losses Lcross-entropy. After this step, the next training epoch starts until a predetermined condition is met. The training method was evaluated and experimental results are briefly presented here. A large-scale group of robots is simulated using the well-known Stage simulator. Each agent is initialized as a nonholonomic differential drive robot equipped with a 2D-laser scanner to sense its surroundings. The 2D-laser is set to 360 degrees FOV with a max range of 10m. The method is implemented in PyTorch and the agents are trained using an NVIDIA DGX-2 server. The agents interact with the environment in real time without speeding up the simulation. The full training process takes around 55 hours for 2 millions steps at 10fps. To train agents in a realistic environment with heavy foot traffic, they are spawned randomly in a 40x40m room, and random goals are set on the opposite side of the room with at least 10m distance from their spawn locations. During respawns, collision checks are made to ensure each agent is not spawn in the vicinity of others. In order to evaluate the robustness of the agents, test environments are utilized where the agent interacts with other agents that exhibit pedestrian behaviors that have not been previously encountered. For clarity, the other agents are referred to as pedestrians for the remainder of this description. In total four different pedestrian setups are evaluated: 1) Non-Cooperative: pedestrians are set as the agents trained with the original setup without diversity but using a different seed to prevent cooperativeness with the agent to be tested. This is to reflect the non-cooperative behavior of people in the real world. 2) Non-Reactive: this follows the same setting as 1). However, pedestrians are not reactive to the trained agent. This can be achieved by setting the height of agent under test lower than that of the pedestrians’ sensor in the simulator. In this way, the pedestrians will receive sensor data about other pedestrians but not the agent under test. This is to reflect the nonreactiveness people in the real world. 3) Variability: this follows the same setting as 2). However, pedestrians receive a random linear speed multiplier between 0.5 and 1.5 at the beginning of each episode. This is to reflect the variability in the walking speeds of different people in the real world. 4) Sub-Optimal: this follows the same setting as 1). However, we use the policy trained for only half the period (1 million instead of 2 million steps). This is to reflect the sub-optimality of walking trajectories in the real world. To measure the robustness of an agent, the number of successful episodes out of 1000 episodes under different pedestrian setups is computed. An episode is regarded as successful when the agent can reach within 0.5m of the desired goal in under 50 seconds without any collision. The agent, pedestrians and goals are spawned in the same way as in the training phase. For comparable results between studies, a fixed number of 5 robots which includes 1 agent and 4 pedestrians for all evaluation runs is used. In the non-cooperative simulation and the sub-optimal simulation a success rate of 931 / 1000 and 952 / 1000 could be achieved using the disclosed method, respectively. For the non-reactive and variability scenarios success rates of 721 / 1000 and 745 / 1000 could be achieved. If there was no diverse behavior, i.e. the agents 12 were trained in the conventional manner, the success rate is about 200 / 1000 smaller by comparison. Consequently, the disclosed method shows significant improvement over the conventional multi-agent training methods. REFERENCE SIGNS 10 environment 12 agent 14 policy network 16 token collection 17 discriminator module 18 state-action discriminator model 20 state-only discriminator model 22 sensor backbone module 23 sensor 24 auxiliary feed forward layers 26 concatenation module 28 bottleneck features 30 main feed forward layers 32 value network 34 control unit 36 behavior-conditioned policy network
Claims
1. A computer-implemented method for training an untrained policy network (14) of an autonomous agent (12) in order to obtain a behavior-conditioned policy network (36), the method comprising:a) randomly sampling a unique behavior token from a token collection (16) of a plurality of behavior tokens, each behavior token being indicative of a unique behavior of the autonomous agent (12);b) randomly generating an initial state of a training environment (10), in which the autonomous agent (12) is to be trained;c) with the policy network (14), determining a next action to be taken by the autonomous agent (12) based on the unique behavior token and the initial state;d) feeding the next action to a discriminator module (17) that is configured to predict at least one behavior vector based on a current state and / or the next action, wherein the behavior vector includes a value entry for each unique behavior token of the token collection (16), wherein each value entry is indicative of how much the associated unique behavior token is exhibited by the autonomous agent (12);e) with the discriminator model (17) determining an intrinsic reward based on the behavior vector predicted in step d);f) updating the policy network (14) with a proximal policy optimization (PPO) algorithm;g) updating the environment (10) and repeating steps c) to f) based on the updated environment (10) until a predetermined condition is met, wherein a next state is randomly sampled from the updated environment (10) based on the previous state and the previous action, wherein the next state is used instead of the initial state.
2. The method according to claim 1, wherein in step d) the discriminator module (17) comprises a state-action discriminator model (18) that is configured to predict a stateaction behavior vector based on the current state and the next action and a state-only discriminator model (20) that is configured to predict a state behavior vector based on the current state, wherein in step e) the discriminator module (17) determines the intrinsic reward based on the state-action behavior vector normalized by the state behavior vector.
3. The method according to any of the preceding claims, wherein step f) comprises an advantage estimator module determining an estimated total reward based on an extrinsic task reward and the intrinsic reward, wherein the extrinsic task reward is determined based on the current state and the next state, wherein the PPO algorithm is performed with a loss function that includes the estimated total reward as an input.
4. The method according to claim 3, wherein the advantage estimator module determines the extrinsic task reward based on a trainable extrinsic value function that is configured for outputting a value that is indicative of an expected task reward, wherein the extrinsic task reward is determined based on a difference of the extrinsic value function applied to the next state and the extrinsic value function applied to the current state; and / or wherein the advantage estimator module determines the extrinsic task reward based on a trainable intrinsic value function that is configured for outputting a value that is indicative of an expected intrinsic reward, wherein the extrinsic task reward is determined based on a weighted sum of the intrinsic reward and a difference of the intrinsic value function applied to the next state and the intrinsic value function applied to the current state.
5. The method according to claim 4, wherein step f) comprises a value function module that updates the extrinsic value function based on a squared error loss function that receives as input a discounted task reward as truth and the extrinsic value function applied to the current state as prediction and / or that updates the intrinsic value function based on a squared error loss function that receives as input a discounted intrinsic reward as truth and the intrinsic value function applied to the current state as prediction.
6. The method according to any of the preceding claims, wherein step f) comprises updating the discriminator module (17) based on a cross-entropy loss between the behavior token and the behavior vector.
7. The method according to claim 6, wherein the state-action discriminator model (18) is updated based on a cross-entropy loss between the state-action behavior vector and the behavior token and / or wherein the state-only discriminator model (20)is updated based on a cross-entropy loss between the state behavior vector and the behavior token.
8. The method according to any of the preceding claims, wherein the method is performed in a manner that a predetermined number of autonomous agents (12) each initially having an untrained policy network (14) is trained in order to obtain autonomous agents (12) with a trained policy network (14).
9. A behavior-conditioned policy network (14) obtainable by performing a method according to any of the preceding claims.
10. An autonomous mobile robot that is configured to navigate through an environment (10) that includes at least one dynamic obstacle, the autonomous mobile robot comprising:- at least one sensor (23) that is configured to obtain sensor data that is indicative of a surrounding portion of the environment (10);- a control unit (34) that is configured to measure robot information that is indicative of at least one motion-related and / or position-related property of the robot, characterized in that the control unit (34) comprises a behavior-conditioned policy network (36) according to claim 9.
11. A method for navigating an autonomous mobile robot according to claim 10 through an environment (10), the method comprising:a) assigning a goal position to the autonomous mobile robot;b) with the at least one sensor (23) detecting sensor data;c) with the behavior-conditioned policy network (36), generating an action;d) with the control unit (34) generating a control signal based on the action determined in step c); ande) performing steps b) to d) until the sensor data indicate that the autonomous mobile robot reached the goal position.
12. A computer program comprising instructions which, when the program is executed by a computer, cause the computer to carry out one, some or all steps of a method according to any of the claims 1 to 8 or claim 11.
13. A computer-readable data carrier or data carrier signal carrying a computer program according to claim 12.
Citation Information
Patent Citations
Method and system for predictive control of vehicle using digital images
US20210004006A1
Controlling agents using relative variational intrinsic control
WO2022053593A1
Neural network reinforcement learning with diverse policies
WO2022167623A1
Learning diverse skills for tasks using sequential latent variables for environment dynamics
WO2022248718A1
