Obstacle avoidance track generation method based on deep network
By using a deep neural network-based obstacle avoidance trajectory generation method, expert data is generated using traditional algorithms and the network is trained for online inference. This solves the real-time and path quality problems of obstacle avoidance planning in dynamic environments, achieving millisecond-level response and smooth trajectory output.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-04-14
AI Technical Summary
Existing obstacle avoidance planning methods struggle to balance computation time and path optimality in dynamic environments with high-frequency responses, making it difficult for traditional methods to meet real-time requirements.
High-quality expert data is generated using traditional planning algorithms, and a deep neural network is trained to mimic the planning behavior of experts for fast online reasoning.
It achieves the generation of smooth and safe obstacle avoidance trajectories within millisecond response time, avoids local optima problems, and meets the real-time planning requirements of highly dynamic environments.
Smart Images

Figure CN121857682A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of robotics, autonomous driving, and motion planning, and in particular to a dynamic environment obstacle avoidance method that combines expert data generation with deep imitation learning. Background Technology
[0002] In the field of robot navigation and autonomous driving, real-time and safe obstacle avoidance planning is one of the core technological challenges. Traditional obstacle avoidance planning methods can be mainly divided into the following categories:
[0003] Heuristic search methods (such as the A* algorithm): These methods can find the globally optimal path in a grid map, but the path is usually composed of broken line segments, which is not smooth enough, and the computational efficiency is low in high-dimensional state spaces or complex environments.
[0004] Sampling methods (such as Rapid Expanding Random Tree (RRT)) are suitable for high-dimensional space planning, but they are random, the path quality is unstable, and the generated paths usually require subsequent smoothing.
[0005] Numerical optimization-based methods can generate smooth trajectories that conform to dynamic constraints, but their performance is heavily dependent on the quality of the initial solution and they are prone to getting trapped in local optima. They also have poor real-time performance in complex non-convex obstacle environments.
[0006] In summary, existing technologies generally suffer from the difficulty of balancing computational time and path optimality. For dynamic environments requiring high-frequency responses, the computational latency of traditional methods is insufficient to meet real-time requirements. Therefore, there is an urgent need for a new obstacle avoidance planning method that can guarantee path quality while achieving millisecond-level response times. Summary of the Invention
[0007] In view of the above-mentioned problems in the prior art, the present invention provides a method for generating obstacle avoidance trajectory based on deep networks. First, high-quality expert data is generated using traditional planning algorithms. Then, a deep neural network is trained to imitate the planning behavior of experts. Finally, the trained network is used for fast online inference.
[0008] This invention provides a method for generating obstacle avoidance trajectories based on deep networks, comprising:
[0009] Step 1: Expert data generation stage. In a randomly generated scene containing obstacles, an initial path is generated based on a given start point and end point. After optimizing the initial path, a dataset that can be divided into a training set and a test set is generated.
[0010] Step 2: Imitation learning and online reasoning stage, construct a deep neural network, train it with the dataset, and enable the deep neural network to learn the mapping relationship from environmental information and target location to the planned trajectory;
[0011] Step 3: Online application, input the real-time acquired environmental perception data and the current target point into the trained deep neural network, and output a smooth obstacle avoidance trajectory through the deep neural network.
[0012] In some embodiments of the present invention, in step 1, the method includes:
[0013] Step 11: Perform environmental modeling, including obtaining the required data through sensors, and using randomly generated data when verifying the feasibility of the method;
[0014] Step 12: Perform coarse path search. In each random scenario, given a starting point and an ending point, use the A* algorithm to find a feasible path from the starting point to the ending point.
[0015] Step 13: Perform path smoothing optimization using a gradient-based smoother.
[0016] In some embodiments of the present invention, the method for random generation in step 11 includes:
[0017] Obstacles are randomly generated in a 50m x 50m two-dimensional map;
[0018] The center coordinates (x, y), quantity δ, and radius r of the obstacles all follow a uniform distribution.
[0019] Specifically: x ~ U(0,50), y ~ U(0,50), δ ~ U(1,20) and take the integer part, r ~ U(1,8).
[0020] In some embodiments of the present invention, in step 12,
[0021] The path obtained by the A* algorithm is a polyline;
[0022] The parameters of the A* algorithm are set as follows: search step size 0.75m, grid resolution 0.5m, and maximum number of iterations 1000.
[0023] In some embodiments of the present invention, in step 13,
[0024] The objective function J for gradient-based smoothers is:
[0025] min q J = λ s J s +λ c J c
[0026]
[0027] J c =∑o∈O σ(x i ,o),
[0028]
[0029] J s It is a smoothing term used to penalize changes in the curvature of the trajectory;
[0030] J c It is a collision avoidance item, used to penalize collisions between the trajectory point and obstacles;
[0031] q i 'o' represents a path point, and 'o' represents the position of the obstacle surface.
[0032] Smoothing weight λ of the smoother s =1, collision avoidance weight is λ c =1, safety distance S f =0.5.
[0033] True value trajectory extraction: To fix the output dimension, only the first 20 control points of the smoothed trajectory are taken as a true value trajectory. The smoothed trajectory has a total of 40 coordinate values, 20 for x and 20 for y.
[0034] In some embodiments of the present invention, during step 2, when constructing a deep neural network and training it with the dataset,
[0035] The inputs to a deep neural network include: environmental perception data and the location of the target point;
[0036] Among them, environmental perception data is represented in the form of a grid map, obstacle information is encoded as an image, and the target point position is a two-dimensional vector, representing the coordinates of the target point that the robot needs to reach.
[0037] In some embodiments of the present invention, in step 2, the deep neural network includes:
[0038] The feature extraction branch is used to perform convolutional encoding on the input environment-aware image to extract environment feature vectors.
[0039] The target encoding branch is used to perform fully connected encoding on the input target point position vector;
[0040] The feature fusion and output module is used to concatenate the environmental feature vector with the encoded target feature vector and output the trajectory point coordinate sequence through a fully connected layer.
[0041] In some embodiments of the present invention, in step 2, when training the deep neural network, the method includes:
[0042] Mean squared error is used as the loss function;
[0043] Training was performed using the Adam optimizer with a learning rate of 0.0001, a batch size of 20, and data shuffling enabled.
[0044] The output is τ pred =[x0,y0,x1,y1….,x 19 ,y 19 ]
[0045] Based on the target point and the sensing data, a unique optimal trajectory is identified:
[0046] τ true =[x0,y0,x1,y1….,x 19 ,y 19 ]
[0047] design Let τ represent the variance of two values, where τ pred For network trajectory prediction, τ true For expert trajectory.
[0048] In some embodiments of the present invention, in step 3,
[0049] The environmental perception data is provided in real time through the robot or vehicle's lidar, camera, or fusion perception system, and the output obstacle avoidance trajectory is used by the trajectory tracking controller to perform motion control.
[0050] Compared with the prior art, the beneficial effects of the obstacle avoidance trajectory generation method based on deep networks provided in the above embodiments of the present invention are as follows:
[0051] Extremely high real-time performance: The online inference stage consists of only one forward propagation of the neural network, with a very short computation time (average only 0.8ms), far exceeding traditional algorithms (tens of milliseconds), which can meet the real-time planning requirements of highly dynamic environments.
[0052] Good path quality: Because the network learns from high-quality expert data, its output trajectory inherits the smoothness and safety of the optimized trajectory.
[0053] Mitigating local optima: The method of this invention does not rely on the initial solution and directly outputs the complete trajectory, effectively avoiding the problem of optimization methods getting trapped in local optima due to poor initial values. Attached Figure Description
[0054] Figure 1 A flowchart illustrating the obstacle avoidance trajectory generation method based on deep networks provided in this embodiment of the invention;
[0055] Figure 2 This is a schematic diagram of the data-driven obstacle avoidance network model structure in the obstacle avoidance trajectory generation method based on deep networks provided in this embodiment of the invention. Detailed Implementation
[0056] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0057] Various embodiments and features of this application are described herein with reference to the accompanying drawings.
[0058] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0059] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application, which have the features described in the claims and are therefore all within the scope of protection defined herein.
[0060] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0061] Specific embodiments of this application are described below with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to ascertain the true intent based on the user's historical operations, and to avoid unnecessary or redundant details that would obscure this application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in various ways with substantially any suitable detailed structure.
[0062] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.
[0063] This invention provides a method for generating obstacle avoidance trajectories based on deep networks, such as... Figure 1 and Figure 2 As shown, the method includes:
[0064] Step 1: Expert data generation stage. In a randomly generated scene containing obstacles, an initial path is generated based on a given start point and end point. After optimizing the initial path, a dataset that can be divided into a training set and a test set is generated.
[0065] Step 2: Imitation learning and online reasoning stage, construct a deep neural network, train it with the dataset, and enable the deep neural network to learn the mapping relationship from environmental information and target location to the planned trajectory;
[0066] Step 3: Online application, input the real-time acquired environmental perception data and the current target point into the trained deep neural network, and output a smooth obstacle avoidance trajectory through the deep neural network.
[0067] The obstacle avoidance trajectory generation method based on deep networks provided in the above embodiments of the present invention first uses traditional planning algorithms to generate high-quality expert data, then trains a deep neural network to imitate the planning behavior of experts, and finally uses the trained network for fast online inference.
[0068] The overall process of the technical solution of this invention is as follows: Figure 1 As shown, it mainly includes two core stages: the expert data generation stage and the imitation learning and online reasoning stage.
[0069] Step 1: Expert Data Generation Phase (Performed Offline)
[0070] This phase aims to create a large-scale, high-quality trajectory planning dataset as the "truth" for neural network learning.
[0071] Step 11) Environment Modeling: This work focuses on the training and inference methods for obstacle avoidance trajectories. In practical applications, the environment modeling part can be obtained from sensor data. In this method, random data can be used to quickly generate obstacles to verify the feasibility of the method. The random generation method is as follows: Obstacles are randomly generated in a 50m x 50m two-dimensional map. The center coordinates (x, y), number (δ), and radius (r) of the obstacles all follow a uniform distribution, specifically: x ~ U(0, 50), y ~ U(0, 50), δ ~ U(1, 20) and rounded, r ~ U(1, 8). A large number of random scenes are generated using this method.
[0072] Step 12) Coarse Path Search: In each random scenario, given a starting point and an ending point, use the A search algorithm to find a feasible path from the starting point to the ending point. The parameters of the A algorithm are set as follows: search step size 0.75m, grid resolution 0.5m, and maximum number of iterations 1000.
[0073] Step 13) Path smoothing optimization: The path obtained by the A search algorithm is a polyline and needs to be smoothed.
[0074] A gradient-based smoother is used for optimization. Its objective function J is:
[0075] min q J = λs J s +λ c J c
[0076]
[0077] J c =∑ o∈O σ(x i ,o),
[0078]
[0079] J s It is a smoothing term used to penalize changes in the curvature of the trajectory.
[0080] J c It is a collision avoidance item, used to penalize collisions between the trajectory point and obstacles.
[0081] q i 'o' represents a path point, and 'o' represents the position of the obstacle surface.
[0082] The smoother smooths the weights λ. s =1, collision avoidance weight is λ c =1, safety distance S f =0.5.
[0083] Truth trajectory extraction: To fix the output dimension, only the first 20 control points (40 coordinate values in total, 20 for x and 20 for y) of the smoothed trajectory are taken as a "truth trajectory".
[0084] The above steps generate a dataset, which is then divided into a training set and a test set.
[0085] Step 2: Imitation Learning and Online Reasoning Stage
[0086] This phase designs a deep convolutional neural network (CNN) to learn an end-to-end mapping from environmental perception information to planned trajectories. The network structure is as follows: Figure 2 As shown.
[0087] Network input: The network input consists of two parts:
[0088] Environmental perception data: represented in the form of a raster map (image), in which obstacle information is encoded as an image.
[0089] Target point location: A 2D vector representing the coordinates of the target point that the robot needs to reach.
[0090] Network structure:
[0091] Feature extraction branch: The environment-aware image is input into a CNN module. This module consists of multiple alternating convolutional and pooling layers (a pooling layer follows every two convolutions), ultimately pooling the image features into a 1024-dimensional feature vector. Subsequently, this vector is further encoded through a fully connected layer sequence [1024, 1024, 1024, 128].
[0092] Target point encoding branch: The target point position (2D vector) is encoded through a small fully connected network [128, 64, 64, 128].
[0093] Feature fusion and output: The feature vectors from the two branches are concatenated and then fed into a final fully connected network [256, 512, 512, 40]. The output layer of this network has a dimension of 40, directly corresponding to a trajectory of 20 points. Except for the output layer, each fully connected layer is followed by the LeakyReLU activation function.
[0094] Network training: Mean squared error (MSE) is used as the loss function. The Adam optimizer is used for training with a learning rate of 0.0001, a batch size of 20, and data shuffling enabled (shuffle=True).
[0095] The output is τ pred =[x0,y0,x1,y1….,x 19 ,y 19 Based on the target point and the sensing data, a unique optimal trajectory τ is determined. true =[x0,y0,x1,y1….,x 19 ,y 19 ].design It represents the variance of two values.
[0096] Step 3: Online Application
[0097] The trained network model can be deployed in the computing unit of a robot or autonomous vehicle. When running online, the system acquires the current local environment perception map and target point location in real time, inputs them into the network, and the network can output a smooth and safe local obstacle avoidance trajectory within milliseconds.
[0098] Combination Figure 2 The network structure shown in this embodiment of the invention provides a method for generating obstacle avoidance trajectories based on deep networks, comprising the following steps:
[0099] Data preparation: Construct a large-scale training dataset according to the methods described in the "Expert Data Generation Phase".
[0100] Model training: Build using deep learning frameworks such as PyTorch or TensorFlow. Figure 2 The network shown.
[0101] Load the training set data, and set the optimizer (Adam, lr = 0.0001) and loss function (MSE). Perform multiple rounds of training until the training loss and validation loss converge.
[0102] Model deployment: Solidify the trained model parameters and deploy them to an embedded platform (such as NVIDIA Jetson, GPU or dedicated AI chip).
[0103] Online planning: The robot constructs a local bird's-eye view (a top-down 2D map) in real time using sensors such as LiDAR and cameras as perception input. The navigation system provides the local target points for the current period. The perception map and target points are input into a deployed neural network model. The network outputs the trajectory coordinates of the next 20 points. The trajectory controller (such as MPC or PID) tracks this trajectory to achieve obstacle avoidance.
[0104] Repeat this process until the global goal is reached.
[0105] As can be seen from the above technical solutions, the beneficial effects of the obstacle avoidance trajectory generation method based on deep networks provided in the above embodiments of the present invention are as follows:
[0106] Extremely high real-time performance: The online inference stage consists of only one forward propagation of the neural network, with a very short computation time (average only 0.8ms), far exceeding traditional algorithms (tens of milliseconds), which can meet the real-time planning requirements of highly dynamic environments.
[0107] Good path quality: Because the network learns from high-quality expert data, its output trajectory inherits the smoothness and safety of the optimized trajectory.
[0108] Mitigating local optima: The method of this invention does not rely on the initial solution and directly outputs the complete trajectory, effectively avoiding the problem of optimization methods getting trapped in local optima due to poor initial values.
[0109] The above embodiments are merely exemplary embodiments of the present invention and are not intended to limit the present invention. The scope of protection of the present invention is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to the present invention within its spirit and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of the present invention.
Claims
1. A method for generating obstacle avoidance trajectories based on deep networks, characterized in that, include: Step 1: Expert data generation stage. In a randomly generated scene containing obstacles, an initial path is generated based on a given start point and end point. After optimizing the initial path, a dataset that can be divided into a training set and a test set is generated. Step 2: Imitation learning and online reasoning stage, construct a deep neural network, train it with the dataset, and enable the deep neural network to learn the mapping relationship from environmental information and target location to the planned trajectory; Step 3: Online application, input the real-time acquired environmental perception data and the current target point into the trained deep neural network, and output a smooth obstacle avoidance trajectory through the deep neural network.
2. The obstacle avoidance trajectory generation method based on deep networks according to claim 1, characterized in that, In step 1, the method includes: Step 11: Perform environmental modeling, including obtaining the required data through sensors, and using randomly generated data when verifying the feasibility of the method; Step 12: Perform coarse path search. In each random scenario, given a starting point and an ending point, use the A* algorithm to find a feasible path from the starting point to the ending point. Step 13: Perform path smoothing optimization using a gradient-based smoother.
3. The obstacle avoidance trajectory generation method based on deep networks according to claim 2, characterized in that, In step 11, the random generation method includes: Obstacles are randomly generated in a 50m x 50m two-dimensional map; The center coordinates (x, y), quantity δ, and radius r of the obstacles all follow a uniform distribution. Specifically: x ~ U(0,50), y ~ U(0,50), δ ~ U(1,20) and take the integer part, r ~ U(1,8).
4. The obstacle avoidance trajectory generation method based on deep networks according to claim 3, characterized in that, In step 12, The path obtained by the A* algorithm is a polyline; The parameters of the A* algorithm are set as follows: search step size 0.75m, grid resolution 0.5m, and maximum number of iterations 1000.
5. The obstacle avoidance trajectory generation method based on deep networks according to claim 4, characterized in that, In step 13, The objective function J for gradient-based smoothers is: min q J=λ s J s +λ c J c J c =∑ o∈O σ(x i ,o), J s It is a smoothing term used to penalize changes in the curvature of the trajectory; J c It is a collision avoidance item, used to penalize collisions between the trajectory point and obstacles; q i 'o' represents a path point, and 'o' represents the position of the obstacle surface. Smoothing weight λ of the smoother s =1, collision avoidance weight is λ c =1, safety distance S f =0.
5. True value trajectory extraction: To fix the output dimension, only the first 20 control points of the smoothed trajectory are taken as a true value trajectory. The smoothed trajectory has a total of 40 coordinate values, 20 for x and 20 for y.
6. The obstacle avoidance trajectory generation method based on deep networks according to claim 5, characterized in that, In step 2, when constructing the deep neural network and training it with the dataset, The inputs to a deep neural network include: environmental perception data and the location of the target point; Among them, environmental perception data is represented in the form of a grid map, obstacle information is encoded as an image, and the target point position is a two-dimensional vector, representing the coordinates of the target point that the robot needs to reach.
7. The obstacle avoidance trajectory generation method based on deep networks according to claim 6, characterized in that, In step 2, the deep neural network includes: The feature extraction branch is used to perform convolutional encoding on the input environment-aware image to extract environment feature vectors. The target encoding branch is used to perform fully connected encoding on the input target point position vector; The feature fusion and output module is used to concatenate the environmental feature vector with the encoded target feature vector and output the trajectory point coordinate sequence through a fully connected layer.
8. The obstacle avoidance trajectory generation method based on deep networks according to claim 7, characterized in that, In step 2, when training the deep neural network, the method includes: Mean squared error is used as the loss function; Training was performed using the Adam optimizer with a learning rate of 0.0001, a batch size of 20, and data shuffling enabled. The output is τ pred =[x0,y0,x1,y1….,x 19 ,y 19 ] Based on the target point and the sensing data, a unique optimal trajectory is identified: t true =[x0,y0,x1,y1….,x 19 ,y 19 ] design Let τ represent the variance of two values, where τ pred For network trajectory prediction, τ true For expert trajectory.
9. The obstacle avoidance trajectory generation method based on deep networks according to claim 8, characterized in that, In step 3, The environmental perception data is provided in real time through the robot or vehicle's lidar, camera, or fusion perception system, and the output obstacle avoidance trajectory is used by the trajectory tracking controller to perform motion control.