An improved dyna-q method inspired by prospective prediction mechanism of hippocampus in rat brain
By combining the forward scanning mechanism of the mouse hippocampus to improve the Dyna-Q method, simulating multi-step operations and dynamically adjusting the scanning depth, the problem of low navigation efficiency of the Dyna-Q method in dynamic obstacle environments is solved, and more efficient path planning and decision-making are achieved.
Patent Information
- Application Number
- CN202410169286.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2044-02-06
AI Technical Summary
Existing Dyna-Q methods have low learning efficiency in robot navigation in dynamic obstacle environments, are prone to getting trapped in local optima, and struggle to balance exploration and utilization.
By combining forward scanning mechanisms of the rat hippocampus with improved Dyna-Q methods, we can simulate future multi-step operations, dynamically adjust scanning depth and action selection, and combine striatal function for decision-making determinism assessment, thus balancing exploration and utilization.
It improves the navigation convergence and decision-making efficiency of robots in unknown environments, reduces the probability of getting trapped in local optima, plans shorter paths, and accelerates the convergence speed of path length.
Smart Images

Figure CN118133901B_ABST
Abstract
Description
Technical Field
[0001] This invention utilizes an improved Dyna-Q method inspired by the prospective prediction mechanism of the rat brain's hippocampus to realize the path planning task of mobile robots in unknown environments with static and dynamic obstacles. Path planning is an essential function of mobile robots and has a significant impact on the robot's navigation efficiency, belonging to the field of robot navigation. Background Technology
[0002] Robotics has always been a popular field of study, and in recent years, a large amount of research has focused on tasks such as environmental cognition, path planning, and obstacle avoidance. Therefore, the research results of this invention have broad application prospects.
[0003] Reinforcement learning (RL) is an artificial intelligence method that learns optimal strategies through continuous interaction with the environment, thereby adapting to complex environments. Mobile robots can employ reinforcement learning methods to explore and experiment in situations where environmental information is unknown and prior knowledge is lacking, thereby developing environmental awareness and planning a good path. RL methods can be categorized into model-free reinforcement learning and model-based reinforcement learning, depending on whether an environmental model is available.
[0004] MFRL (Direct Reinforcement Learning) is a direct reinforcement learning method where robots use experience gained from direct interaction with the environment to improve their policies or estimate value functions. It can learn autonomously even without an environment map and is widely used for robot path planning tasks. However, as the scale and complexity of the environment increase, this type of method suffers from low exploration efficiency and poor convergence. Furthermore, it requires extensive interaction with the real environment to generate a lot of invalid experience, increasing the probability of the robot encountering unexpected obstacles such as collisions.
[0005] In the MBRL method, the robot integrates a planning process and direct reinforcement learning, incorporating a virtual environment model in addition to direct interaction with the real environment. Using the virtual environment model for decision-making reduces the number of trial-and-error attempts in the real environment and yields well-performing strategies, effectively lowering the probability of unexpected events during exploration and enhancing navigation efficiency. Simultaneously, the newly added planning process fully utilizes experience gained from interacting with the real environment, improving sample utilization.
[0006] Some researchers have applied the MBRL method Dyna-Q to robot navigation, which performs well under static obstacle conditions but poorly in dynamic environments. First, the sparsity of environmental rewards makes it difficult for the robot to find the target point, resulting in low learning efficiency. Second, planning an efficient and collision-free path in environments with multiple dynamic obstacles remains a challenge. Furthermore, RL methods, including Dyna-Q, generally face the exploration-exploitation dilemma; the robot needs to continuously try new actions to avoid getting trapped in local optima and gradually converge to the optimal policy. Balancing exploration and exploitation remains a significant challenge.
[0007] Environmental cognition in unfamiliar environments is a crucial survival skill for mammals, and numerous studies have shown that environmental cognition plays a vital role in animal navigation. Researching the mechanisms of animal environmental cognition is significant for improving existing navigation methods and for drawing inspiration from unique biological mechanisms. Therefore, to enable robot navigation in the absence of known environmental maps and with incomplete prior knowledge of the environment, and to address the shortcomings of existing RL methods in robot path planning, this invention proposes an improved Dyna-Q method inspired by the prospective prediction mechanism of the rat hippocampus. Summary of the Invention
[0008] To address the aforementioned issues, this invention proposes an improved Dyna-Q method inspired by the prospective prediction mechanism of the rat hippocampus. This method improves the Dyna-Q method by incorporating the forward scanning mechanism of the rat hippocampus, enabling it to simulate future multi-step operations. Simultaneously, it mimics striatal function to perform decision deterministic evaluation of the forward simulation and dynamically adjusts the scanning depth and action selection method, thereby improving the robot's convergence and decision-making efficiency. This prospective prediction mechanism balances exploration and utilization, reducing the probability of the robot getting trapped in local optima.
[0009] The present invention adopts the following technical solution and implementation steps:
[0010] 1. An improved Dyna-Q method inspired by the prospective prediction mechanism of the rat hippocampus, characterized by imitating the forward scanning mechanism of the rat hippocampus to improve the action selection mechanism of the reinforcement learning method Dyna-Q, and applying it to navigation tasks of robots in the absence of a cognitive map, thereby improving the ability of mobile robots to perform environmental cognition in unknown environments. The implementation process of this method is as follows:
[0011] S1. Initialize the simulation experimental environment: Set the experimental environment to a two-dimensional square maze, which contains multiple static obstacles and dynamic obstacles that move back and forth. Set the starting point and the target point.
[0012] S2. Define the environmental cognition task as a Markov Decision Process (MDP):
[0013] Standard reinforcement learning methods are processes of interaction and trial and error with the environment within the MDP framework; this invention uses a quintuple M = {S, A, P, R, γ} to describe the environmental cognition task, where S represents the set of states s in the environment, s∈S, A is the set of actions that the robot can take, P is the state transition probability, R is the reward function, and γ is the discount factor.
[0014] S3. Conduct an experiment to test the environmental perception performance of the method of the present invention. The robot starts from the starting point to explore the environment and find the target point.
[0015] S4. Improving the action selection mechanism of the Dvna-Q method by mimicking the cognitive mechanism of the rat brain, the robot makes decisions based on this mechanism:
[0016] Environmental cognition in unfamiliar environments is a crucial survival skill for mammals. Imitating and drawing upon unique neurophysiological mechanisms in animals is significant for improving existing navigation methods. This invention improves the action selection mechanism of the Dvna-Q method by incorporating the forward scanning mechanism of the hippocampus, enabling the robot to internally simulate future multi-step operations during action selection. This forward scanning mechanism allows the robot to balance exploration and utilization, reducing the probability of getting trapped in local optima. Simultaneously, mimicking striatal function, it performs decision deterministic evaluation at each depth of the forward scan, dynamically adjusting the scan depth and action selection method to improve the robot's convergence and decision-making efficiency. The overall structure of this invention is as follows: Figure 1 As shown.
[0017] The following is the specific process of the action selection mechanism, such as Figure 2 As shown:
[0018] (1) Set the robot's current state s t As a starting point;
[0019] (2) First step of scanning, at s t Simulate n actions in the action set sequentially and reach n subsequent potential states. And respectively assign the i-th state action value Q(s) t a i ) Accumulate to Q_sweepi; i is the i-th direction of the scan, i∈[1,n], and the value range is the same as the number of actions in the action set; Q_sweep represents the state reached during the scan. i This represents the accumulated Q value in the i-th scanning direction during the scanning process;
[0020] (3) Subsequently, the decision certainty at the current depth j is calculated. jj is the current scanning depth, 1≤j≤Max_depth, which is dynamically adjusted based on the determinism of the decision during the scanning process. If the determinism exceeds the threshold, the scanning stops. Max_depth is the maximum scanning depth.
[0021] The decision determinism metric is as follows: First, the state-action values Q_sweep, accumulated from n directions, are calculated using the softmax function. i Nonnegation and normalization are performed to obtain the contrast of the accumulated Q values in each direction, where β is the softmax factor. The results are then sorted in descending order, and the difference between the maximum and second-largest values after sorting represents the decision certainty for this scan step. j ;
[0022]
[0023] certainty j =max(softmax(Q_sweep) i ))-submax(softmax(Q_sweep i (2)
[0024] a i =argmax Q_sweep i (3)
[0025] If the decision certainty is greater than the threshold SweepCertThr, the scan stops, and the robot selects the branch with the largest cumulative state action value among the n directions and takes the initial action a. i As shown in formula (3);
[0026] (4) If the decision certainty does not exceed the threshold, then based on the n potential states reached in the previous scan. Proceed to the next scan in sequence; due to Q_sweep i After being processed by the softmax function to become nonnegative and normalized, the value range is (0, 1). Therefore, the range of the difference between the maximum and the second largest value after processing is also (0, 1). The threshold SweepCertThr is also set to a decimal between 0 and 1, and the specific value is fine-tuned during the experiment.
[0027] Unlike the first step of the scan described above, to reduce computational complexity, subsequent scan steps no longer expand into n branches separately, but instead are based on the state. Maximum state-action value in Q table Determine the action to be simulated in this step a i and the next possible state Where j is the current scanning depth; while scanning, the robot will record the state and action values in each direction at each scanning depth. Accumulate them separately into Q_sweep i It also uses a discount factor that decreases with increasing scan depth to reduce long-distance Q_sweep. i Weight; discount j This is a discount factor that decreases with increasing scan depth;
[0028]
[0029] After accumulating the state and action values in n directions at the current depth, the robot uses these n accumulated values to perform a sweep. i The robot will assess the decision certainty according to the method mentioned in step (3) until the decision certainty exceeds the threshold. Then, the robot will select the initial action a with the largest cumulative Q value. i ;
[0030] The above mechanism operates internally within the robot, starting from the current state s. t The process begins by simulating the new state reached after each action is taken, and a decision determinism judgment is made on the accumulated Q value of each scanning direction during the scanning process. If the decision determinism of a certain scanning depth exceeds the threshold, the scanning ends and the scanning direction with the largest accumulated Q value is selected as the final action output.
[0031] S5. Improve the ε-greedy method in the Dyna-Q method to increase the robot's decision-making efficiency:
[0032] Make parameter ε vte In the early stages of training, ε is relatively high, and the robot tends to randomly select actions to explore unknown states in the environment; as the number of iterations increases, ε... vte The greedy factor ε gradually decays to the final value, and the robot tends to use the obtained optimal strategy, thereby accelerating the robot's convergence; episode is the current training round number, and MaxEpisode is the maximum number of training rounds.
[0033]
[0034] S6. Use the reward function R and the state transition model P to evaluate each step of the robot's action and record the experience gained from taking this action.
[0035] The following is the reward function, which includes the reward for reaching or approaching the target and the penalty for hitting a wall or moving away from the target; the reward for distance information follows a Gaussian distribution; the robot evaluates the reward in the following way: r hold Let r be the initial value of the reward function. near r represents the reward coefficient for the robot getting closer to the target; the overall reward increases the closer the robot is to the destination. negAs a penalty for encountering obstacles, r goal A reward for reaching the goal;
[0036]
[0037] Subsequently, a statistical approach was used to model the state transition model P(s′|s,a) of MBRL, as shown in formulas (7) and (8); in the case of discrete environmental states, each (S′|s,a) is stored in discrete triples. t+1 s t a t The robot processes each instance of the current state s. t Take action a t After reaching a specific subsequent state s t The number of times the state transition occurs is counted, and the ratio of this count to the total number of times the state s′ is reached is used as the state transition probability P(S). t+1 s t a t The more frequently a state is accessed by the robot, the greater the discount factor during value iteration, enabling the internal representation of the environment to be achieved under stable environmental structure.
[0038] count(s t+1 s t a t ) = count(s t+1 s t a t )+1; (7)
[0039]
[0040] The Q-value update also employs a model-based value iteration method, with the reward R based on the observations after taking the current action; the transitions between task states are presented in probabilistic form, with the state transition function P(s) t+i |s t a t Let be the probability distribution of all possible states; the influence of future Q-values on current Q-values is measured by state transition probabilities. The more times a state is visited during training, the more significant its role in the model.
[0041] Q(s t a t )=Q(s t a t )+α×(R+γ×P(s t+1 |s t a t )×maxQ(s t+1 a t+1 )-Q(s ta t (9)
[0042] During the training process of the robot to find the target point, consistent with the Dyna architecture, the preceding and following states and action rewards (s) of each step are saved. t s t+1 a t After reaching the target point in a training round, the robot randomly extracts the experience stored in the model to learn the state value function internally, which is consistent with the planning process of the Dyna-Q method. Simulation training in a virtual environment model can accelerate the convergence speed of path length.
[0043] S7. After multiple rounds of training, a learning curve for the robot's path length is obtained, demonstrating the advantages of the forward scanning mechanism. Simultaneously, curves showing the change in the forward scanning length and decision determinism of this invention are also obtained, proving the biological rationale of this invention.
[0044] The inventiveness of this invention is mainly reflected in:
[0045] (1) This invention addresses the problems of low learning efficiency, susceptibility to local optima, and exploration and utilization dilemmas inherent in the reinforcement learning method Dyna-Q. It proposes an improved Dyna-Q method inspired by the prospective prediction mechanism of the rat hippocampus, enabling robot navigation in unknown environments with both static and dynamic obstacles. This method improves the Dyna-Q method by incorporating the forward scanning mechanism of the rat hippocampus, allowing it to simulate future multi-step operations. Simultaneously, it mimics striatal function to perform decision deterministic evaluation of the forward simulation and dynamically adjusts the scanning depth and action selection method to improve the robot's convergence and decision-making efficiency.
[0046] (2) This forward prediction mechanism can balance exploration and utilization, and reduce the probability of the robot getting stuck in local optima. Experimental results show that the method has better convergence, shorter planned path length, and biological rationality, providing a new idea for improving existing reinforcement learning methods and enhancing the robot's navigation capabilities. Attached Figure Description
[0047] Figure 1 This is the overall structure of the model of the present invention;
[0048] Figure 2 This is the forward scanning and action selection mechanism of the present invention;
[0049] Figure 3 These are the path trajectories planned by various methods in a dynamic environment;
[0050] Figure 4 It compares the learning curves of the four methods in a dynamic environment;
[0051] Figure 5 It is the curve showing the change in the forward scan length;
[0052] Figure 6 It is the curve of change in decision certainty; Detailed Implementation
[0053] This invention proposes an improved Dyna-Q method inspired by the prospective prediction mechanism of the rat hippocampus. This method improves the Dyna-Q method by combining the forward scanning mechanism of the rat hippocampus, enabling it to simulate future multi-step operations. At the same time, it mimics the striatal function to perform decision deterministic evaluation of the forward simulation and dynamically adjusts the scanning depth and action selection mode to improve the robot's convergence and decision-making efficiency. This prospective prediction mechanism can balance exploration and utilization, reducing the probability of the robot getting trapped in local optima.
[0054] The present invention adopts the following technical solution and implementation steps:
[0055] 1. An improved Dyna-Q method inspired by the prospective prediction mechanism of the rat hippocampus, characterized by imitating the forward scanning mechanism of the rat hippocampus to improve the action selection mechanism of the reinforcement learning method Dyna-Q, and applying it to navigation tasks of robots in the absence of a cognitive map, thereby improving the ability of mobile robots to perform environmental cognition in unknown environments. The implementation process of this method is as follows:
[0056] S1. Initialize the simulation environment: The experimental environment is a 50×50 two-dimensional square maze. Obstacles are randomly distributed in the environment, represented by black grids, and white grids represent passable paths. The start and end points are marked by red and green circles, respectively. Add three dynamic obstacles to the environment, each 3×3 black grids in size. Each dynamic obstacle moves back and forth along the trajectory shown by the gray line in the figure, with a constant speed of half the robot's moving speed, i.e., moving half a grid per unit time step.
[0057] S2. Define the environmental cognition task as a Markov Decision Process (MDP):
[0058] Standard reinforcement learning methods involve interaction with the environment and trial and error within the MDP framework. This invention uses a quintuple M = {S, A, P, R, γ} to describe the environmental cognition task, where S represents the set of states s in the environment, s∈S, A = {a1, a2, a3, a4, a5, a6, a7, a8} is the set of actions that the agent can take, including 8 action primitives, P is the state transition probability, R is the reward function, and γ = 0.95 is the discount factor.
[0059] S3. Conduct an experiment to test the environmental perception performance of the method of the present invention. The robot starts from the starting point to explore the environment and find the target point.
[0060] S4. Improving the action selection mechanism of the Dyna-Q method by mimicking the cognitive mechanism of the rat brain, the robot makes decisions based on this mechanism:
[0061] Environmental cognition in unfamiliar environments is a crucial survival skill for mammals. Imitating and drawing upon unique neurophysiological mechanisms in animals is significant for improving existing navigation methods. This invention improves the action selection mechanism of the Dyna-Q method by incorporating the forward scanning mechanism of the hippocampus, enabling the robot to internally simulate future multi-step operations during action selection. This forward scanning mechanism allows the robot to balance exploration and utilization, reducing the probability of getting trapped in local optima. Simultaneously, mimicking striatal function, it performs decision deterministic evaluation at each depth of the forward scan, thereby dynamically adjusting the scan depth and action selection method to improve the robot's convergence and decision-making efficiency. The overall structure of this invention is as follows: Figure 1 As shown.
[0062] The following is the specific process of the action selection mechanism, such as Figure 2 As shown:
[0063] (1) Set the robot's current state s t As a starting point;
[0064] (2) First step of scanning, at s t Simulate the eight actions in the action set in sequence and reach the eight subsequent potential states. And respectively assign the i-th state action value Q(s) t a i Accumulated into Q_sweep i ; i represents the i-th direction of the scan, i∈[1,8]; Q_sweep represents the state reached during the scan. i This represents the accumulated Q value in the i-th scanning direction during the scanning process;
[0065] (3) Subsequently, the decision certainty at the current depth j is calculated. j j is the current scanning depth, j∈[1,5], which is dynamically adjusted by the decision determinism during the scanning process. If the determinism exceeds the threshold, the scanning stops.
[0066] The decision determinism measure is as follows: First, the state-action values Q_sweep accumulated in each of the eight directions are calculated using the softmax function. iNonnegation and normalization are performed to obtain the contrast of the accumulated Q values in each direction, with β = 0.5 as the softmax factor. The results are then sorted in descending order, and the difference between the maximum and second-largest values after sorting represents the decision certainty for this scan step. j ;
[0067]
[0068] certainty j =max(softmax(Q_sweep) i ))-submax(softmax(Q_sweep i (2)
[0069] a i =argmax Q_sweep i (3)
[0070] If the decision certainty is greater than the threshold SweepCertThr, the scan stops, and the robot selects the branch with the largest cumulative state action value among the eight directions to take the initial action a. i As shown in formula (3);
[0071] (4) If the decision certainty does not exceed the threshold, then based on the 8 potential states reached in the previous scan. Proceed to the next scan in sequence; due to Q_sweep i After being processed by the softmax function to become nonnegative and normalized, the value range is (0, 1). Therefore, the range of the difference between the maximum and the second largest value after processing is also (0, 1). The threshold SweepCertThr is set to 0.5.
[0072] Unlike the first step of the scan described above, to reduce computational complexity, subsequent scan steps no longer expand into eight branches separately, but instead are based on the state. Maximum state-action value in Q table Determine the action to be simulated in this step a i and the next possible state Where j is the current scanning depth; while scanning, the robot will record the state and action values in each direction at each scanning depth. Accumulate them separately into Q_sweep i It also uses a discount factor that decreases with increasing scan depth to reduce long-distance Q_sweep. i The weights are shown in formula (4); discount j This is a discount factor, initially set to 0.95, which decreases as the scan depth increases.
[0073]
[0074] After sequentially accumulating the state action values in the eight directions at the current depth, the robot uses these eight accumulated values to perform the Q_sweep operation. i The robot will assess the decision certainty according to the method mentioned in step (3) until the decision certainty exceeds the threshold. Then, the robot will select the initial action a with the largest cumulative Q value. i ;
[0075] The above mechanism operates internally within the robot, starting from the current state s. t The process begins by simulating the new state reached after each action is taken, and a decision determinism judgment is made on the accumulated Q value of each scanning direction during the scanning process. If the decision determinism of a certain scanning depth exceeds the threshold, the scanning ends and the scanning direction with the largest accumulated Q value is selected as the final action output.
[0076] S5. Improve the ε-greedy method in the Dyna-Q method to increase the robot's decision-making efficiency:
[0077] Make parameter ε vte In the early stages of training, ε is relatively high, and the robot tends to randomly select actions to explore unknown states in the environment; as the number of iterations increases, ε... vte The greedy factor ε gradually decreases until it reaches 0.2, thus gradually favoring the use of the obtained optimal strategy and accelerating the robot's convergence; episode is the current training round number, and Max_Episode = 1500 is the maximum number of training rounds;
[0078]
[0079] S6. Use the reward function R and the state transition model P to evaluate each step of the robot's action and record the experience gained from taking this action.
[0080] The following is the reward function, which includes the reward for reaching or approaching the target and the penalty for hitting a wall or moving away from the target; the reward for distance information follows a Gaussian distribution; the robot evaluates the reward in the following way:
[0081]
[0082] Subsequently, a statistical approach was used to model the state transition model P(s′|s,a) of MBRL, as shown in formulas (7) and (8); in the case of discrete environmental states, each (s′|s,a) is stored in discrete triples. t+1 s t a t The robot processes each instance of the current state s. t Take action a tAfter reaching a specific subsequent state s t The number of times the state transition occurs is counted, and the ratio of this count to the total number of times the state s′ is reached is used as the state transition probability P(s′). t+1 s t a t The more frequently a state is accessed by the robot, the greater the discount factor during value iteration, enabling the internal representation of the environment to be achieved under stable environmental structure.
[0083] count(s t+1 s t a t ) = count(s t+1 s t a t )+1; (7)
[0084]
[0085] The Q-value update also employs a model-based value iteration method, with the reward R based on the observations after taking the current action; the transitions between task states are presented in probabilistic form, with the state transition function P(S) t+1 |s t a t Let be the probability distribution of all possible states; the influence of future Q-values on current Q-values is measured by state transition probabilities. The more times a state is visited during training, the more significant its role in the model.
[0086] Q(s t a t )=Q(s t a t )+0.1×(R+0.95×P(s t+1 |s t a t )×maxQ(s t+1 a t+1 )-Q(s t a t (9)
[0087] During the training process of the robot to find the target point, consistent with the Dyna architecture, the preceding and following states and action rewards (s) of each step are saved. t s t+1 a t After reaching the target point in a training round, the robot randomly extracts the experience stored in the model to learn the state value function internally, which is consistent with the planning process of the Dyna-Q method. Simulation training in a virtual environment model can accelerate the convergence speed of path length.
[0088] S7. This invention compares SARSA, the Dyna-Q method, and the case where this invention only uses forward scanning and does not use decision determinism. Figure 3 The paper demonstrates the paths planned by the three methods after 1500 rounds. It shows that the robot can effectively realize environmental cognition and path planning in dynamic environments and successfully avoid obstacles. The path planned by this invention is smoother, while the other two methods result in detours and path redundancy.
[0089] Figure 4 Table 1 shows the average learning results of the robot in a dynamic obstacle environment. Regarding learning efficiency, it can be seen that the convergence of this invention still has a significant advantage over the other two methods. The average path length planned by this invention is shorter, and the convergence speed is faster, stabilizing towards the later stages of training, while the other two methods still struggle to converge in the later stages and exhibit significant fluctuations.
[0090] Figure 5 and Figure 6 The figures show the changes in forward scan length and decision certainty during the training process of this invention. As training progresses, the scan length continuously shortens and the decision certainty continuously improves, which is consistent with the characteristics of the rat brain's cognitive mechanism and proves the biological rationality of this invention.
[0091] Table 1 Average learning outcomes in dynamic obstacle environments
[0092]
Claims
1. An improved Dyna-Q method inspired by the prospective prediction mechanism of the rat hippocampus, characterized in that, The action selection mechanism of the reinforcement learning method Dyna-Q is improved by mimicking the forward scanning mechanism of the mouse hippocampus, and applied to the navigation task of robots in the absence of a cognitive map, thereby improving the ability of mobile robots to perform environmental cognition in unknown environments. The implementation process of this method is as follows: S1. Initialize the simulation experimental environment: Set the experimental environment to a two-dimensional square maze, which contains multiple static obstacles and dynamic obstacles that move back and forth, and set the starting point and the target point. S2. Define the environmental cognition task as a Markov Decision Process (MDP): The standard reinforcement learning method is a process of interaction and trial and error with the environment within the MDP framework. The environmental cognition task is described by a quintuple M = {S, A, P, R, γ}, where S represents the set of states s in the environment, s∈S, A is the set of actions that the robot can take, P is the state transition probability, R is the reward function, and γ is the discount factor. S3. Conduct an experiment to test the environmental perception performance of this method. The robot starts from the starting point, explores the environment, and searches for the target point. S4. Improving the action selection mechanism of the Dyna-Q method by mimicking the cognitive mechanism of the rat brain, the robot makes decisions based on this mechanism: By combining the forward scanning mechanism of the hippocampus with the action selection mechanism of the Dyna-Q method, the robot can internally simulate future multi-step operations when making action selection. This forward scanning mechanism enables the robot to balance exploration and utilization, reducing the probability of getting trapped in local optima. By mimicking the function of the striatum, the decision determinism of each depth of the forward scan is evaluated, thereby dynamically adjusting the scanning depth and action selection method, improving the robot's convergence and decision efficiency. S5. Improve the ε-greedy method in the Dyna-Q method to increase the robot's decision-making efficiency: Make parameter ε vte In the early stages of training, ε is relatively high, and the robot tends to randomly select actions to explore unknown states in the environment; as the number of iterations increases, ε... vte The greedy factor ε gradually decays to the final value, and the robot tends to use the obtained optimal strategy, thereby accelerating the convergence of the robot; episode is the current training episode number, and Max_Episode is the maximum number of training episodes. S6. Use the reward function R and the state transition model P to evaluate each step of the robot's action and record the experience gained from taking this action. The following is the reward function, which includes the reward for reaching or approaching the target and the penalty for hitting a wall or moving away from the target; the reward for distance information follows a Gaussian distribution; the robot evaluates the reward in the following way: r hold Let r be the initial value of the reward function. near r is the reward coefficient for the robot getting closer to the target; the overall reward increases the closer the robot is to the destination. neg As a penalty for encountering obstacles, r goal A reward for reaching the goal; Subsequently, a statistical approach was used to model the state transition model P(s'|s,a) of MBRL; in the case of discrete environmental states, each (s) was stored using discrete triples. t+1 s t a t The robot processes each instance of the current state s. t Take action a t After reaching a specific subsequent state s t The number of times the state is reached is counted, and the ratio of this count to the total number of times all possible subsequent states s' are reached is used as the state transition probability P(s). t+1 s t a t The more frequently a state is accessed by the robot, the greater the discount factor during value iteration, enabling the internal representation of the environment to be achieved under stable environmental structure. count(s t+1 ,s t ,a t )=count(s t+1 ,s t ,a t )+1; (7) The Q-value update also employs a model-based value iteration method, with the reward R based on the observations after taking the current action; the transitions between task states are presented in probabilistic form, with the state transition function P(s) t+1 |s t a t Let be the probability distribution of all possible states; the influence of future Q-values on current Q-values is measured by state transition probabilities. The more times a state is visited during training, the more significant its role in the model. Q(s t ,a t )=Q(s t ,a t )+α×(R+γ4P(s t+1 |s t ,a t )×maxQ(s t+1 ,a t+1 )-Q(s t ,a t )); (9) During the training process of the robot to find the target point, consistent with the Dyna architecture, the preceding and following states and action rewards (s) of each step are saved. t s t+1 a t After reaching the target point in a training round, the robot randomly extracts the experience stored in the model to learn the state value function internally, which is consistent with the planning process of the Dyna-Q method. Simulation training in a virtual environment model can accelerate the convergence speed of path length. S7. After multiple rounds of training, the learning curve of the robot's path length was obtained, proving the advantages of using the forward scanning mechanism; the curves of the change in forward scanning length and the change in decision determinism were also obtained, proving the biological rationale.
2. The improved Dyna-Q method inspired by the prospective prediction mechanism of the rat hippocampus, as described in claim 1, is characterized in that... The specific process of the action selection mechanism is as follows: (1) Set the robot's current state s t As a starting point; (2) First step of scanning, at s t Simulate n actions in the action set sequentially and reach n subsequent potential states. And respectively assign the i-th state action value Q(s) t ,a i Accumulated into Q_sweep i ; i represents the i-th direction of the scan, i∈[1,n], and its value range is the same as the number of actions in the action set; Q_sweep represents the state reached during the scan. i This represents the accumulated Q value in the i-th scanning direction during the scanning process; (3) Subsequently, the decision certainty at the current depth j is calculated. j j is the current scanning depth, 1≤j≤Max_depth, which is dynamically adjusted based on the determinism of the decision during the scanning process. If the determinism exceeds the threshold, the scanning stops. Max_depth is the maximum scanning depth. The decision determinism metric is as follows: First, the state-action values Q_sweep, accumulated from n directions, are calculated using the softmax function. i Nonnegation and normalization are performed to obtain the contrast of the accumulated Q values in each direction, where β is the softmax factor. The results are then sorted in descending order, and the difference between the maximum and second-largest values after sorting represents the decision certainty for this scan step. j ; certainty j =max(softmax(Q_sweep i ))-submax(softmax(Q_sweep i )); (2) a i =argmaxQ_sweep i ; (3) If the decision certainty is greater than the threshold SweepCertThr, the scan stops, and the robot selects the branch with the largest cumulative state action value among the n directions and takes the initial action a. i ; (4) If the decision certainty does not exceed the threshold, then based on the n potential states reached in the previous scan. Proceed to the next scan in sequence; due to Q_sweep i After being processed by the softmax function to become nonnegative and normalized, the value range is (0,1). Therefore, the range of the difference between the maximum and second largest values after processing is also (0,1). The threshold SweepCertThr is also set to a decimal between 0 and 1, and the specific value is fine-tuned during the experiment. Unlike the first step of the scan described above, subsequent scans no longer expand into n branches separately, but are based on the state. Maximum state-action value in Q table Determine the action to be simulated in this step a i and the next possible state Where j is the current scanning depth; while scanning, the robot will record the state and action values in each direction at each scanning depth. Accumulate them separately into Q_sweep i It also uses a discount factor that decreases with increasing scan depth to reduce long-distance Q_sweep. i The weights; di scount j This is a discount factor that decreases with increasing scan depth; After accumulating the state and action values in n directions at the current depth, the robot uses these n accumulated values to perform a sweep. i The robot will assess the decision certainty according to the method mentioned in step (3) until the decision certainty exceeds the threshold. Then, the robot will select the initial action a with the largest cumulative Q value. i ; The above mechanism operates internally within the robot, starting from the current state s. t The process begins by simulating the new state reached after each action, and then makes a decision-making deterministic judgment on the accumulated Q value of each scanning direction during the scanning process. If the decision-making determinism of a certain scanning depth exceeds the threshold, the scanning ends and the scanning direction with the largest accumulated Q value is selected as the final action output.
Citation Information
Patent Citations
Improved Dyna-Q learning path planning algorithm
CN112964272A
Robot obstacle avoidance method based on model and model-free reinforcement learning
CN116679711A
