A mobile control method for a legged robot based on dynamics search
Through a method based on dynamics search, combined with an improved strategy search algorithm and a behavior cloning mechanism, the problems of novelty quantification error and low sample utilization in footed robot mobile control are solved, and more efficient control strategy search and precise movement are achieved. control.
Patent Information
- Application Number
- CN202210797745.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-06
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-07-06
AI Technical Summary
Existing footed robot movement control methods cannot generate control strategies efficiently and with high quality, resulting in inaccurate movement actions. Especially in tasks with sparse or deceptive rewards, agent training is difficult and easy to converge to local optimality.
A method based on dynamics search is adopted to train the dynamics model by obtaining trajectory data of the interaction between historical control strategies and the environment. Combined with the improved strategy search algorithm, the local sample playback mechanism and neural network model are used to quantify individual novelty, and a behavioral cloning mechanism is introduced. Bidirectional mutation operator, optimizes strategy search to improve sample utilization and control strategy quality.
It solves the problem of novelty quantification error in the control strategy search process, improves the sample utilization rate and the search efficiency and quality of the control strategy, and ensures the accuracy of the movement control of the legged robot.
Smart Images

Figure CN115220342B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of robot movement control, and in particular to a footed robot movement control method based on dynamics search. Background Art
[0002] As an important symbol and development result of modern high-tech, robots have been widely used in various fields of national production and have brought revolutionary changes to the traditional production mode of mankind. A legged robot is a robot that simulates walking movements, and its walking movements rely on the coordinated control of the movements of each joint. At present, the mobile control of a legged robot is mainly achieved by constructing a dynamic model and then using a strategy search method to search for the corresponding control parameters, thereby controlling the legged robot to complete the corresponding mobile movement.
[0003] Traditional search algorithms mainly include evolutionary algorithms (EA) and reinforcement learning (RL). However, these two algorithms perform poorly in tasks with sparse or deceptive rewards. For reinforcement learning algorithms, agents can usually only learn based on the experience gained from interacting with the environment, which makes tasks with deceptive or sparse rewards very difficult to train agents due to the scarcity of effective samples. Without an appropriate exploration strategy, it may lead to convergence to a local optimum, and the performance of the agent in the task will be severely reduced.
[0004] In order to improve the exploration ability of agents in reinforcement learning, scholars have conducted a lot of related work in recent years. One of the major works is to improve the exploration ability by proposing an intrinsic reward mechanism. The intrinsic reward is usually quantified as the novelty of the state-action data pair, and is used as a supplement to the extrinsic reward to encourage the agent to visit rare state-action data pairs. In order to define the novelty of the state-action data pair, a counting-based method is also proposed, which uses different density models to approximate the counting of state data. Curiosity-based exploration aims to learn a world model and use the prediction error of the world model to quantify the novelty of the state data. Techniques such as adversarial training, noise perturbation, meta-gradient, entropy regularization, and uncertainty measures using past experience and model clusters have also shown good results in several challenging tasks with sparse rewards. However, these optimization exploration algorithms only focus on the performance of a single local optimal solution that is finally learned. Different local optima in the policy space can correspond to different strategies, and discovering different sets of strategies is crucial for tasks that require fast adaptation and have multiple deceptive local optima.
[0005] The Quality-Diversity (QD) algorithm can learn different high-performance strategies in tasks with deceptive local optima. The algorithm searches for multiple solutions through an evolutionary algorithm based on the quality of the solution and the novelty in a predefined behavior space. The QD algorithm is derived from the Novelty Search (NS) method, which aims to find new solutions without considering the performance quality of the solution. Since the QD method can obtain high-performance solutions with different behavioral characteristics, it has been applied to many applications such as robot morphological design and robot motion adaptation. QD algorithms can be classified according to their construction of the behavior space. The Novelty Search-Local Competition algorithm optimizes the behavioral diversity of solutions based on the distance function of the behavior space, and only compares the quality of solutions between solutions with similar behaviors, thereby ensuring that the algorithm obtains multiple high-performance solutions with different behavioral characteristics. The Multi-dimensional Archive of Phenotypic elite (Map-elite) algorithm constructs a structured behavior map of discrete grids based on the behavior space. Each grid represents a unique behavioral characteristic and stores the solution with the highest performance for that behavioral characteristic. Although QD algorithms have shown robust results on some deceptive problems, the prior expert knowledge required to define and discretize the behavior space limits the application of these methods to tasks with high-dimensional information. In addition, since most controllers use nonlinear approximators, such as neural networks with high-dimensional parameters, the spatial complexity of storing elite policies makes QD algorithms inapplicable to such settings.
[0006] In order to extend the QD method to high-dimensional tasks, scholars have proposed several methods with automatic learning behavior space in recent years. For example, dimensionality reduction methods such as principal component analysis (PCA) and auto encoder are used to map high-dimensional behavior features to low-dimensional representations as behavior spaces; the evolution of behavior descriptors (BDs) is also modeled as a two-level optimization problem, in which the outer loop uses the CMA-ES algorithm to optimize the BD model based on meta-fitness, and the population evolves the QD algorithm through the learned BD model in the inner loop. Although dimensionality reduction methods can reduce the size of data, due to the high dimensionality of the input vector, the operability of using long-term trajectories as model input for training is poor. The two-level training paradigm in the meta-training method will lead to low sample utilization, which further weakens the low sample utilization of the CMA-ES algorithm itself.
[0007] In summary, the existing legged robot movement control methods cannot generate control strategies efficiently and with high quality, and cannot ensure that the legged robot can accurately complete the movement movements. Summary of the invention
[0008] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a legged robot mobile control method based on dynamic search, so as to solve the novelty quantization error problem in the control strategy search process, achieve higher sample utilization, and improve the search efficiency and quality of the control strategy, thereby ensuring the accuracy of the mobile control of the legged robot.
[0009] The object of the present invention can be achieved by the following technical solution: A method for controlling the movement of a legged robot based on dynamics search, comprising the following steps:
[0010] S1. Obtain the trajectory data obtained by the interaction between the historical control strategy and the environment, and use it as sample data to train the corresponding dynamic model;
[0011] S2. Based on the dynamics model and combined with the improved strategy search algorithm, the optimal individual, i.e. the optimal control strategy, is obtained;
[0012] S3. According to the optimal control strategy, the states of the joints of the legged robot are changed accordingly to complete the movement control of the legged robot.
[0013] Furthermore, the trajectory data in step S1 specifically refers to state data and action data corresponding to different time points.
[0014] Furthermore, the step S1 specifically includes the following steps:
[0015] S11, based on the local sample playback mechanism, the trajectory data corresponding to different historical control strategies are stored respectively;
[0016] S12. Construct a dynamic model based on the neural network model;
[0017] S13. The quadratic mean square error between the predicted value and the true value is used as the training loss function, and the dynamics model is trained using all the acquired trajectory data. By improving the novelty quantization paradigm, a fixed-parameter dynamics model is obtained.
[0018] Furthermore, the training loss function is specifically:
[0019]
[0020] in, is the global sample playback mechanism, i is the index of the individual, that is, the index corresponding to different control strategies, T φ (s t+1|s t , a t ) is a dynamic model with non-fixed parameters, φ is the corresponding neural network model parameter, a t 、s t are the state data and action data at time t, s t+1 It is the state data at the next time t+1.
[0021] Furthermore, the improved novelty quantification paradigm is specifically:
[0022]
[0023] Among them, Novelty fix (π i ) is the quantitative value of individual novelty, is a kinetic model with fixed parameters, π i is the ith individual.
[0024] Furthermore, the specific process of improving the strategy search algorithm in step S2 is:
[0025] S21. Evaluate the fitness of individuals in the population and classify all individuals into elite, ordinary and other categories according to the fitness values.
[0026] S22, by improving the crossover operator in the genetic algorithm, the individuals belonging to other classes are guided and optimized;
[0027] S22. Using a learning-based bidirectional mutation operator, random bidirectional mutation operations are performed on individuals belonging to the common class and other classes.
[0028] Furthermore, the calculation formula for fitness evaluation in step S21 is:
[0029] Fitness(π i ):=Quality(π i )+αNovelty(π i )
[0030]
[0031] Among them, Fitness(π i ) is the quantitative value of individual fitness, Quality(π i ) is the individual mass quantification value, τ i represents a single trajectory and α is a hyperparameter.
[0032] Furthermore, the crossover operator in step S22 is specifically a crossover operator based on a behavior cloning mechanism, and the behavior cloning loss function of the crossover operator is:
[0033]
[0034] Among them, θ o With θ e They respectively represent an individual belonging to the other category and the elite category.
[0035] Furthermore, the learning-based bidirectional mutation operator in step S22 includes a behavior rejection operator and an action value operator. Step S22 specifically randomly selects one of the operators to perform a mutation operation on a selected individual in the common class and other classes.
[0036] Furthermore, the loss function of the behavior rejection operator is specifically:
[0037]
[0038] By minimizing the loss function corresponding to the behavior repulsion operator, different individuals are encouraged to perform different actions when facing the same state, thereby accelerating the generation of novel individuals;
[0039] The loss function of the action value operator is specifically:
[0040]
[0041] By minimizing the loss function corresponding to the action value operator, individuals are encouraged to perform actions with higher Q values, thereby indirectly improving the quality of individuals.
[0042] Compared with the prior art, the present invention has the following advantages:
[0043] First, the present invention adopts an individual novelty quantification method based on a dynamic model, which can be applied to tasks with long trajectories that are difficult to directly compare. In addition, the present invention further proposes a dynamic model with fixed parameters as the training target, so as to avoid the novelty quantification error problem caused by the randomness of the Markov decision process.
[0044] Second, the present invention introduces a crossover operator based on a behavioral cloning mechanism, which can achieve guided optimization between individuals, thereby having a higher sample utilization rate and being able to produce better performance in tasks with sparse rewards.
[0045] 3. The present invention proposes a learning-based bidirectional mutation operator that integrates the optimization of individual quality and individual novelty. Compared with the traditional method that relies on random perturbations to generate high-quality and high-novelty individuals, the present invention has better iteration efficiency and can more efficiently generate high-novelty and high-quality individuals in tasks with a large parameter space.
[0046] In summary, the present invention proposes a dynamic novelty search scheme, which can solve the novelty quantization error problem in the control strategy search process, achieve higher sample utilization, and improve the search efficiency and quality of the control strategy, thereby reliably ensuring the mobile control accuracy of the legged robot. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0048] Figure 2 It is a schematic diagram of the architecture of the improved strategy search algorithm in the embodiment;
[0049] Figure 3 Schematic diagram of movement control of a biped robot in an embodiment. DETAILED DESCRIPTION
[0050] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0051] Example
[0052] like Figure 1 As shown, a legged robot movement control method based on dynamic search includes the following steps:
[0053] S1. Obtain the trajectory data obtained by the interaction between the historical control strategy and the environment, and use it as sample data to train the corresponding dynamic model;
[0054] S2. Based on the dynamics model and combined with the improved strategy search algorithm, the optimal individual, i.e. the optimal control strategy, is obtained;
[0055] S3. According to the optimal control strategy, the states of the joints of the legged robot are changed accordingly to complete the movement control of the legged robot.
[0056] This embodiment applies the above method, such as Figure 2 As shown, it mainly includes:
[0057] 1) Novelty quantification based on kinetic model
[0058] In order to quantify the behavioral characteristics of the agent, this technical solution selects the most intuitive trajectory data, namely:
[0059] b(π):={s1,a1,s2,a2,...,s T-1 , a T-1 ,s T , a T}.
[0060] Where T is the trajectory length. However, due to the randomness of the Markov decision process (MDP), a single trajectory data often cannot accurately represent the behavior characteristics of the agent. Therefore, this technical solution introduces a local sample replay mechanism (Local Replay Buffer) to store sample data from different individuals separately:
[0061]
[0062] Where i is the index of the individual. Since sample data is used to quantify the behavioral characteristics of the agent, the problem of quantifying the novelty of the agent's behavior is transformed into the problem of quantifying the novelty of the sample data. Therefore, the dynamic model T constructed by the neural network is introduced. φ (s t+1 |s t , a t ), where φ is the corresponding neural network model parameter. The purpose of this model is to: based on the input state data s at time t t And action data a t To predict the state data s at the next time t+1 t+1 , since the prediction of this model is a regression problem, this technical solution uses the quadratic mean square error between the predicted value and the true value as the loss function for training the model:
[0063]
[0064] in, It is a global sample replay mechanism (Global Replay Buffer), that is, samples from all individuals are used to train the dynamic model. When a sample is more novel, that is, the rarer it is, the fewer times it is used to train the dynamic model, resulting in a larger loss value of the dynamic model under this sample. Therefore, this technical solution uses the prediction error of the dynamic model as an indicator to quantify the novelty of the sample, combined with the local sample replay mechanism, to quantify the novelty of the individual as:
[0065]
[0066] However, since the transition probability of some tasks in the MDP may have a certain randomness, that is, the same (s t , a t ) data pairs may produce different s t+1 Data, if the above kinetic model is used alone, it may also lead to certain prediction errors. Therefore, the present technical solution improves the above novelty quantification paradigm and adds s t+1Change to a fixed parameter kinetic model output, namely:
[0067]
[0068] Due to the introduction of the fixed parameter kinetic model So that any (s t , a t ) data pairs have a unique corresponding label, which is the output of the dynamic model with fixed parameters, thus effectively solving the problem of inaccurate novelty quantification caused by the randomness of MDP itself.
[0069] 2) Solution selection and crossover
[0070] Since this technical solution follows the general architecture of the QD algorithm, it is necessary to evaluate the fitness of individuals; in addition, the crossover operator in the genetic algorithm is introduced to further guide the optimization of individuals in the population.
[0071] First, in the individual selection module, the quality and novelty of each individual need to be evaluated. For the quality evaluation, the average reward value that the corresponding individual can obtain in a single trajectory in the task is directly used to quantify it, that is:
[0072]
[0073] Among them, τ i Represents a single trajectory. Combined with the above novelty quantification formula, the final individual fitness quantification value is obtained:
[0074] Fitness(π i ):=Quality(π i )+αNovelty(π i )
[0075] Among them, α is a hyperparameter used to weigh the preference between individual quality and novelty.
[0076] In order to optimize individuals with lower fitness towards individuals with higher fitness, this technical solution uses the crossover operator in the genetic algorithm to perform guided optimization for individuals with lower fitness. Considering that the traditional crossover operator is difficult to apply to individuals represented by the neural network model, this technical solution introduces the behavior cloning mechanism in imitation learning to implement the crossover operation:
[0077] First, based on the size of the fitness value, all individuals are divided into three categories from high to low: elite, normal, and others. For all individuals in others, the following behavioral cloning loss is used for optimization:
[0078]
[0079] Among them, θ o With θ e Represents an individual in Others and Elites respectively. Through this loss function, the gap between the output actions of individuals with lower fitness and those of individuals with higher fitness can be narrowed, thereby achieving guided optimization of individuals with poor fitness and indirectly improving the average fitness of individuals in the entire population.
[0080] 3) Learning-based bidirectional mutation operator
[0081] In traditional QD algorithms, the emergence of novel individuals often depends on random perturbations of individual model parameters. This method is often difficult to generate highly novel individuals. Therefore, this technical solution proposes a learning-based behavior repulsion (BR) operator to encourage individuals to perform different action modes. The specific loss function is:
[0082]
[0083] By minimizing the above loss function, different individuals are encouraged to perform different actions when facing the same state, thereby accelerating the generation of novel individuals. In addition, since this technical solution needs to take into account both the novelty and quality of individuals (i.e., the size of the reward that individuals can obtain in the task), this technical solution is based on reinforcement learning theory and uses the action value function in the actor-critic architecture to perform policy gradient optimization. The specific loss function is:
[0084]
[0085] By minimizing the loss function, individuals are encouraged to perform actions with higher Q values, thereby indirectly improving the quality of individuals. After the crossover calculation is completed, the above-mentioned bidirectional mutation operation is randomly performed on individuals belonging to the Normal and Others classes, that is, one of the operators is randomly selected to perform the mutation operation on a selected individual.
[0086] like Figure 3 As shown, this embodiment performs mobile control on a biped robot (specific hyper parameters are shown in Table 1), and sets the biped robot to include 10 strategy models: A strategy family and a strategy containing π θ With Double Q Network The reinforcement learning algorithm architecture has the same number of local sample buffers for each individual {D i}, i = 1, ..., 10, based on all the collected data, a deterministic dynamic model T is trained φ (s t , a t ): S×A→S, which is used to quantify the novelty of the individual.
[0087] Table 1
[0088] Hyperparameters Numeric Learning Rate 0.0003 Training sample batch size 256 Number of individuals by race 10 Buffer capacity 1000000 Number of elite individuals 2
[0089] In tasks with sparse or deceptive rewards, first, based on the fitness obtained by the above-mentioned individual quality quantification and behavior novelty quantification, select the two individuals with the highest fitness values as the elite class, the next four individuals as the ordinary class, and the last four individuals as other classes. Then, the crossover loss function is used to train the individuals in other classes. After the crossover calculation, a bidirectional mutation operator is used to randomly select several individuals from the ordinary class and other classes for optimization. In addition, the strategy of the reinforcement learning algorithm proposed in this technical solution is also synchronously trained based on the samples collected from the population, and in order to combine the high sample utilization rate of the reinforcement learning algorithm itself, it can be periodically replaced with individuals in the population to accelerate the search for high-performance individuals.
[0090] In summary, this technical solution is aimed at the mobile control of legged robots. In order to solve the problem of solution search in tasks with sparse or deceptive rewards, a hybrid strategy search method called Dynamics-aware Novelty Search with Behavior Repulsion (DANSBR) is proposed. The reinforcement learning algorithm is combined with the QD paradigm to improve the strategy search. In order to properly quantify the novelty of the solution, this technical solution proposes a task-independent behavior description mechanism and uses a dynamics model of self-supervised learning to quantify the novelty of the solution. In order to achieve solution search with high sample utilization, this technical solution introduces a reinforcement learning algorithm to guide the solution search of the population. In order to promote the emergence of highly novel and high-performance solutions, this technical solution introduces a bidirectional mutation operator to drive the behavior of the solution to be different from other solutions, or to encourage the solution to obtain better performance.
Claims
1. A method for controlling the movement of a legged robot based on dynamic search, characterized in that: The following steps are involved: S1. Obtain the trajectory data obtained by the interaction between the historical control strategy and the environment, and use it as sample data to train the corresponding dynamic model; S2. Based on the dynamics model and combined with the improved strategy search algorithm, the optimal individual, i.e. the optimal control strategy, is obtained; S3. According to the optimal control strategy, the states of the joints of the legged robot are changed accordingly to complete the movement control of the legged robot; The trajectory data in step S1 specifically refers to the state data and action data corresponding to different time points. Step S1 specifically includes the following steps: S11, based on the local sample playback mechanism, the trajectory data corresponding to different historical control strategies are stored respectively; S12. Construct a dynamic model based on the neural network model; S13, using the quadratic mean square error between the predicted value and the true value as the training loss function, and using all the acquired trajectory data to train the dynamics model, and obtaining a fixed-parameter dynamics model by improving the novelty quantization paradigm; The training loss function is specifically: in, is the global sample playback mechanism, i is the index of the individual, that is, the index corresponding to different control strategies, T φ (s t+1 |s t ,a t ) is a dynamic model with non-fixed parameters, φ is the corresponding neural network model parameter, a t 、s t are the state data and action data at time t, s t+1 It is the state data at the next time t+1.
2. The method for controlling the movement of a legged robot based on dynamic search according to claim 1, characterized in that: The improved novelty quantification paradigm is specifically: Among them, Novelty fix (π i ) is the quantitative value of individual novelty, is a kinetic model with fixed parameters, π i is the ith individual.
3. The method for controlling the movement of a legged robot based on dynamic search according to claim 2, characterized in that: The specific process of improving the strategy search algorithm in step S2 is: S21. Evaluate the fitness of individuals in the population and classify all individuals into elite, ordinary and other categories according to the fitness values. S22, by improving the crossover operator in the genetic algorithm, the individuals belonging to other classes are guided and optimized; S23. Using a learning-based bidirectional mutation operator, random bidirectional mutation operations are performed on individuals belonging to the common class and other classes.
4. The method for controlling the movement of a legged robot based on dynamic search according to claim 3, characterized in that: The calculation formula for fitness evaluation in step S21 is: Fitness(p i ):=Quality(p i )+αNovelty(π i ) Among them, Fitness(π i ) is the quantitative value of individual fitness, Quality(π i ) is the individual mass quantification value, τ i represents a single trajectory and α is a hyperparameter.
5. The method for controlling the movement of a legged robot based on dynamic search according to claim 3, characterized in that: The crossover operator in step S22 is specifically a crossover operator based on a behavior cloning mechanism, and the behavior cloning loss function of the crossover operator is: Among them, θ o With θ e They respectively represent an individual belonging to the other category and the elite category.
6. The method for controlling the movement of a legged robot based on dynamic search according to claim 3, characterized in that: The learning-based bidirectional mutation operator in step S23 includes a behavior rejection operator and an action value operator. Step S23 specifically randomly selects one of the operators to perform a mutation operation on a selected individual in the common class and other classes.
7. The method for controlling the movement of a legged robot based on dynamic search according to claim 6, characterized in that: The loss function of the behavior rejection operator is specifically: By minimizing the loss function corresponding to the behavior repulsion operator, different individuals are encouraged to perform different actions when facing the same state, thereby accelerating the generation of novel individuals; The loss function of the action value operator is specifically: By minimizing the loss function corresponding to the action value operator, individuals are encouraged to perform actions with higher Q values, thereby indirectly improving the quality of individuals.
