An unmanned aerial vehicle inspection operation obstacle avoidance training simulation method
Patent Information
- Application Number
- CN202610157143.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-04
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2046-02-04
AI Technical Summary
(1)动态障碍物行为预测精度有限,当前方法多侧重单步预测或短序列历史建模,难以精准刻画复杂障碍物在动态环境下的非线性演化过程
(1)本发明通过引入由可微分神经图灵机驱动的“时空记忆单元”,实现了对关键障碍物运动特征序列的高效记录与语义级提取。该单元采用双通道写入机制,分别编码空间位置与时间动态模式,结合注意力机制从历史轨迹中加权融合最具相关性的演化片段,显著提升了在非线性、不规则运动场景下的趋势预测鲁棒性;进一步借助轻量级图卷积网络对局部障碍群体进行拓扑关系建模,识别潜在碰撞簇与主流运动方向,输出未来多步的概率分布包络面,在无需完整环境重建的前提下,有效克服了传统方法因忽略长期依赖或过度简化运动模型而导致的误判风险,大幅降低全场景物理仿真的计算开销的同时,保障了复杂时变环境下避障行为的安全性与前瞻性;
Smart Images

Figure CN122021324B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of real-time obstacle avoidance technology in UAV inspection operations, and in particular to a UAV inspection operation obstacle avoidance training simulation method. Background Technology
[0002] With the widespread application of UAV technology in complex environments such as power line inspection, forest monitoring, and emergency rescue, its autonomous obstacle avoidance capability has become a core technological foundation for ensuring safe and efficient operations. Currently, UAV autonomous obstacle avoidance training and simulation systems mainly rely on physical simulation-based global environment reconstruction methods or deep temporal network modeling of dynamic obstacle behavior patterns. Some mainstream solutions use traditional recurrent neural networks (such as RNNs and LSTMs) to predict the temporal state of obstacles, or combine them with high-performance physics engines to achieve continuous environmental simulation, thereby obtaining the inference results of the future state of obstacles. In some intelligent agent systems, convolutional graph neural networks are used to analyze spatial relationships, and model transfer strategies are used to achieve limited environmental adaptability. These methods have been widely applied in scenarios such as airborne perception, incremental policy learning, and high-fidelity simulation testing.
[0003] However, the existing technology still has the following shortcomings: (1) The accuracy of dynamic obstacle behavior prediction is limited. Current methods mostly focus on single-step prediction or short-sequence historical modeling, which makes it difficult to accurately depict the nonlinear evolution process of complex obstacles in dynamic environments. Especially in scenarios such as real-time interaction with multiple obstacles and sudden changes in motion patterns, the prediction of the future state of obstacles is prone to large errors, which directly affects the effectiveness and safety of UAV obstacle avoidance routes.
[0004] (2) It consumes a lot of computing resources. Large-scale simulations based on physics engines or deep neural networks require strong computing power support. Due to the limitations of embedded platforms and edge devices' real-time computing capabilities, it is difficult to deploy efficiently in actual UAV inspection scenarios. It is only suitable for experimental environments or cloud-based batch training, and its real-time performance and portability are limited.
[0005] (3) The efficiency of decision strategy transfer is low. Existing knowledge transfer methods mostly rely on offline hard label training or full model parameter synchronization. The transmission of redundant information is high and the real-time feedback of environmental patterns is ignored, which makes it difficult for the student network to adapt to the obstacle evolution characteristics in the new environment and limits the improvement of autonomous decision-making ability.
[0006] (4) Lacking a robust online adaptive mechanism, traditional simulation systems and strategy models have a low update frequency in the face of sudden environmental changes or new obstacle behavior patterns. They cannot trigger timely model fine-tuning based on real-time observation residuals, which can easily lead to safety hazards or decision lag. Summary of the Invention
[0007] In order to solve the above-mentioned technical problems, the present invention provides a method for training and simulating obstacle avoidance in unmanned aerial vehicle (UAV) inspection operations.
[0008] The technical solution of this invention is implemented as follows: A method for simulating obstacle avoidance training in unmanned aerial vehicle (UAV) inspection operations, comprising: S1: Based on historical observation data of dynamic obstacles in UAV inspection operations, obtain time series samples containing position, velocity, acceleration and motion trend, and normalize the samples to generate a standardized obstacle state input vector. S2: A spatiotemporal memory unit is constructed using a differentiable neural Turing machine structure. Based on the standardized obstacle state input vector, the position vector of the spatial channel and the relative displacement difference label of the temporal channel are jointly encoded through a dual-channel writing mechanism to form a memory feature matrix with spatiotemporal correlation. S3: Read the obstacle state trajectory segments of the most recent K time steps from the memory feature matrix, calculate the correlation weight of each segment with the current environmental evolution mode by combining the attention mechanism, and generate a weighted fusion local evolution trend vector as the representation output of the dynamic behavior of the obstacle group. S4: Input the local evolution trend vector into a lightweight graph convolutional network, perform neighborhood aggregation operation based on the topological connection relationship between obstacles, identify potential collision clusters and mainstream motion directions, and output the probability distribution envelope of each obstacle in the next T steps; S5: Based on the probability distribution envelope and the current position information of the UAV, a local obstacle avoidance decision space is constructed, and a set of candidate flight paths is generated in the space. Each path corresponds to a set of action strategy sequences under spatiotemporal constraints. S6: The action policy distribution generated by the teacher network in a high-fidelity simulation environment is used as a soft target. The KL divergence loss function is used to train the edge student network through hierarchical knowledge distillation, so that it learns the implicit behavioral priors guided by memory-enhanced prediction and outputs a lightweight obstacle avoidance strategy model. S7: During actual flight, the newly observed obstacle evolution state is collected in real time, the evolution residual between it and the prediction result is calculated, and it is determined whether the evolution residual exceeds the preset threshold. If it does, a small batch online fine-tuning process is triggered. S8: Perform incremental parameter updates based on the trigger signal, use the latest observation data to locally optimize the lightweight obstacle avoidance strategy model, generate an environmentally adaptable closed-loop obstacle avoidance control strategy, and complete the complete technology chain from memory-driven prediction to feedback-triggered optimization.
[0009] The present invention provides a method for simulating obstacle avoidance training in UAV inspection operations, which has the following beneficial effects: (1) This invention introduces a "spatiotemporal memory unit" driven by a differentiable neural Turing machine to achieve efficient recording and semantic-level extraction of motion feature sequences of key obstacles. The unit adopts a dual-channel writing mechanism to encode spatial location and temporal dynamic patterns respectively. Combined with an attention mechanism, it weighted and fused the most relevant evolutionary segments from historical trajectories, which significantly improves the robustness of trend prediction in nonlinear and irregular motion scenarios. Furthermore, it uses a lightweight graph convolutional network to model the topological relationship of local obstacle groups, identify potential collision clusters and mainstream motion directions, and output the probability distribution envelope of future steps. Without the need for complete environment reconstruction, it effectively overcomes the risk of misjudgment caused by ignoring long-term dependence or oversimplifying motion models in traditional methods. It significantly reduces the computational cost of full-scene physical simulation while ensuring the safety and foresight of obstacle avoidance behavior in complex time-varying environments. (2) This invention constructs a hierarchical knowledge distillation architecture to achieve efficient knowledge transfer from the teacher network to the student network. Unlike the conventional distillation method that directly imitates the output labels, this method focuses on the intermediate state activation values generated by the teacher network under the guidance of memory-enhanced prediction, and uses them as soft targets containing rich environmental priors and decision-making logic. The KL divergence loss function is used to drive the student network to learn deep behavioral representations, so as to maintain high policy consistency in a lightweight structure that retains only the backbone feature layer and action head. At the same time, an event-triggered online update mechanism is introduced, and small-batch fine-tuning is only started when the observation residuals in actual flight exceed the threshold, avoiding the resource consumption caused by continuous high-frequency communication and model synchronization, significantly reducing the computational load and bandwidth requirements of the edge, and improving the system's autonomous adaptability and operating efficiency in long-cycle and long-distance tasks such as power line inspection and forest monitoring. Attached Figure Description
[0010] Figure 1 This is a flowchart of a drone inspection operation obstacle avoidance training simulation method according to the present invention; Figure 2 This is a sub-flowchart of a drone inspection operation obstacle avoidance training simulation method according to the present invention; Figure 3 This is another sub-flowchart of the obstacle avoidance training simulation method for drone inspection operations according to the present invention. Detailed Implementation
[0011] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0012] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0013] like Figure 1 As shown, the present invention provides a method for training and simulating obstacle avoidance during UAV inspection operations, specifically including: S1: Based on historical observation data of dynamic obstacles in UAV inspection operations, obtain time series samples containing position, velocity, acceleration and motion trend, and normalize the samples to generate a standardized obstacle state input vector. S2: A spatiotemporal memory unit is constructed using a differentiable neural Turing machine structure. Based on the standardized obstacle state input vector, the position vector of the spatial channel and the relative displacement difference label of the temporal channel are jointly encoded through a dual-channel writing mechanism to form a memory feature matrix with spatiotemporal correlation. S3: Read the obstacle state trajectory segments of the most recent K time steps from the memory feature matrix, calculate the correlation weight of each segment with the current environmental evolution mode by combining the attention mechanism, and generate a weighted fusion local evolution trend vector as the representation output of the dynamic behavior of the obstacle group. S4: Input the local evolution trend vector into a lightweight graph convolutional network, perform neighborhood aggregation operation based on the topological connection relationship between obstacles, identify potential collision clusters and mainstream motion directions, and output the probability distribution envelope of each obstacle in the next T steps; S5: Based on the probability distribution envelope and the current position information of the UAV, a local obstacle avoidance decision space is constructed, and a set of candidate flight paths is generated in the space. Each path corresponds to a set of action strategy sequences under spatiotemporal constraints. S6: The action policy distribution generated by the teacher network in a high-fidelity simulation environment is used as a soft target. The KL divergence loss function is used to train the edge student network through hierarchical knowledge distillation, so that it learns the implicit behavioral priors guided by memory-enhanced prediction and outputs a lightweight obstacle avoidance strategy model. S7: During actual flight, the newly observed obstacle evolution state is collected in real time, the evolution residual between it and the prediction result is calculated, and it is determined whether the evolution residual exceeds the preset threshold. If it does, a small batch online fine-tuning process is triggered. S8: Perform incremental parameter updates based on the trigger signal, use the latest observation data to locally optimize the lightweight obstacle avoidance strategy model, generate an environmentally adaptable closed-loop obstacle avoidance control strategy, and complete the complete technology chain from memory-driven prediction to feedback-triggered optimization.
[0014] Step S1: Based on historical observation data of dynamic obstacles during UAV inspection operations, acquire time-series samples containing position, velocity, acceleration, and motion trends, and normalize the samples to generate a standardized obstacle state input vector. Specifically, this includes: S1.1: Acquire the historical observation data stream of dynamic obstacles recorded by airborne sensors or simulation systems during the UAV inspection process. This stream includes the three-dimensional coordinates, linear velocity vector, angular velocity components, acceleration magnitude and directional derivative of each obstacle at continuous time steps, which serve as the original observation input conditions. In the scenario of drone inspection operations, the dynamic obstacle observation data stream continuously output by airborne sensors or simulation systems can be used as the input condition for this sub-step. A multi-source sensor data acquisition method (parameters: 3D lidar point cloud resolution 0.1 m, millimeter-wave radar sampling frequency 50 Hz, binocular vision frame rate 30 FPS) is adopted to achieve accurate spatial positioning of each obstacle in the continuous time step within the inspection path range. Furthermore, the kinematic state estimation algorithm (parameters: inertial measurement unit sampling interval 0.02 s, Kalman filter process noise variance) is used. Realize the linear velocity vector of the obstacle. With angular velocity components A stable output is obtained, and the acceleration magnitude is obtained. ; Furthermore, the directional derivative is calculated using a finite difference-based method (parameter: time step Δt = ...). s), to achieve obstacle heading change rate Continuous measurement and generation of heading change sequence; Furthermore, a signal synchronization and timestamp calibration algorithm is adopted (parameter: unified clock error correction). (μs), strictly bind the three-dimensional coordinates, velocity, acceleration and directional derivative signals output by each sensor to a unified time step index to achieve time-series consistency integration of the original observation input conditions; Through the above multi-source acquisition and computation processing, the results of the previous step are transformed into a structured obstacle historical observation data stream, realizing complete spatial-dynamic-directional information capture, and providing accurate input conditions for downstream data alignment and time-series synchronization processing; For example, during a power tower inspection mission, an airborne 3D lidar scans a 50-m radius area at a resolution of 0.1 m, a millimeter-wave radar acquires obstacle velocity information at a frequency of 50 Hz, and a binocular vision system captures obstacle images at a frame rate of 30 FPS and converts them into 3D coordinate points. An inertial measurement unit acquires attitude data at a sampling interval of 0.02 s. After Kalman filtering, the standard deviation of the linear velocity calculation is reduced to [value missing]. m / s. The directional derivative is calculated by the difference of the heading angle between two adjacent frames, and expressed as Δt= s normalization yields Sequence. All data sources are synchronized via a unified clock (error correction). After being bound to the same time index (μs), a raw observation data stream containing three-dimensional position, velocity vector, acceleration magnitude and heading rate of change is formed. It has been verified that the data stream can significantly improve the stability and accuracy of dynamic obstacle state prediction in the downstream time synchronization and feature extraction process. S1.2: Based on the original observation input conditions, perform data alignment and time synchronization processing, use interpolation algorithms to fill in missing data frames caused by communication delays or sampling asynchrony, and resample the state sequences of all obstacles to a unified time reference to generate time-aligned obstacle state time sequence segments. S1.3: Extract key dynamic feature parameters from the time-aligned obstacle state time sequence segment, including current position offset, velocity change rate (i.e., jerk), heading angle change trend label, and local motion consistency index calculated based on sliding window, to form a high-dimensional obstacle state feature vector; Based on the obstacle state time sequence data synchronized and aligned in the preceding step S1.2, a vector difference calculation method is used (parameter: three-dimensional coordinates of adjacent time steps). This allows for the extraction of the current position offset, resulting in the instantaneous displacement vector of each obstacle along the three axes, which serves as the initial motion feature. Furthermore, using the second-order time difference method (parameter: velocity vector of adjacent time steps) (rate of change) to achieve jerk The characteristics of non-stationary acceleration fluctuations of each obstacle over a continuous time period are extracted and used to reflect sudden acceleration or deceleration behavior. Furthermore, the heading angle calculation method (parameter: based on velocity components) is used. The arctangent function is used to generate the heading angle sequence, and a sign change detection algorithm is used to identify significant turning events, obtain heading angle change trend labels, and mark the rotation direction and amplitude of obstacles in each time period. Furthermore, through the sliding window consistency analysis method (parameter: window length) The local motion consistency index is calculated using the velocity vector set, as shown in the following formula:
[0015] in, This represents the velocity vector of a single frame within the window. This is the mean velocity vector within the window, and the exponent value is used to evaluate the consistency of velocity direction between adjacent time steps. Using the above-mentioned multi-feature parallel extraction algorithm, the current position offset, jerk, heading change trend label, and local motion consistency index of each time segment are concatenated and assigned values in chronological order to form a high-dimensional obstacle state feature vector, thereby realizing refined feature modeling of recording dynamic obstacle motion patterns. For example, in a power line inspection drone obstacle avoidance training scenario, the obstacle position sequence output jointly by the onboard vision and laser sensors is 100 frames long, with a time interval of 0.05 seconds. In the calculation of the current position offset... and The 3D coordinate difference ranges from -0.15 to 0.22 meters, the velocity change rate calculated by Jerk is between -2.8 and 3.1 m / s³, and the heading angle is determined by the arctangent function. The trend labels show that turning events occurred in frames 35-40 and 78-80. The local motion consistency index, calculated using a window length W=10 frames, ranges from 0.83 to 0.97, indicating a high consistency motion state. The final high-dimensional obstacle state feature vector, with dimensions of 4×100, is input into subsequent normalization and dual-channel encoding processes to achieve accurate capture and representation of dynamic obstacle motion features. S1.4: Based on the high-dimensional obstacle state feature vector, perform numerical compression processing based on maximum-minimum normalization to map the features of each dimension to the [0,1] interval, eliminate the order-of-magnitude difference between different physical dimensions, and obtain the normalized obstacle state feature matrix. S1.5: Perform outlier detection and robust correction on the normalized obstacle state feature matrix. Use a Mahalanobis distance-based outlier identification method to remove data points that significantly deviate from the normal motion pattern and replace them with the weighted average of the nearest time. Finally, output a structured and standardized obstacle state input vector to drive the joint encoding process of the subsequent dual-channel writing mechanism.
[0016] Step S2: Constructing a spatiotemporal memory unit using a differentiable neural Turing machine structure, wherein, based on the standardized obstacle state input vector, the position vector of the spatial channel and the relative displacement difference label of the temporal channel are jointly encoded through a dual-channel writing mechanism to form a memory feature matrix with spatiotemporal correlation. Specifically, this includes: S2.1: Based on the architectural principle of differentiable neural Turing machines (DNTM), a spatiotemporal memory unit with an external memory matrix and a controller network is constructed. The controller uses gated recurrent units (GRUs) to implement nonlinear mapping of the input sequence. The external memory matrix is defined as... It is used to store obstacle state encoding vectors of length N and dimension d, and initializes all memory pointers and weight distributions to zero values to establish a memory infrastructure that supports differentiated read and write operations. Based on the standardized obstacle state input vector output by step S1, a differentiable neural Turing machine (DNTM) is used to construct a spatiotemporal memory unit to achieve high-precision spatiotemporal storage and guided read / write operations for dynamic obstacle states. An external memory matrix definition method (parameter: matrix dimension N×d) is adopted to establish a storage structure for recording obstacle state encoding vectors with a time step of length N and a dimension of d per step. All memory pointers and weight distributions are initialized to zero to ensure that the storage units have no historical residual information in the initial state and can be updated by gradient. Furthermore, a nonlinear mapping of the input sequence is achieved through a controller network construction method (parameters: hidden layer dimension h of the gated recurrent unit GRU, activation function type tanh). The update gate and reset gate weight matrices of the GRU are randomly initialized by a Gaussian distribution to support the adaptive capture of subsequent time-dependent features. Furthermore, a memory read / write address allocation algorithm is adopted (parameter: the similarity metric for content-based addressing is cosine similarity) to establish an index access mechanism between the DNTM controller and the external memory matrix, and the key value vector dimension and position encoding format are set during the initialization phase to ensure the mapping consistency of spatial features and temporal features within the same addressing domain; Furthermore, by using a differentiable write weight generation method, the normalized distribution of write weights is calculated based on the combination of the current hidden state vector and the input encoding vector of the GRU, so that the obstacle states at different time steps can be written to the specified address of the external memory matrix in a soft-select manner, thereby achieving continuous storage of the state. By constructing the differentiable structure as described above, the standardized obstacle state input vector from the previous step is transformed into a memory feature matrix with spatiotemporal dependencies, thereby achieving the expected technical effect of structured storage and subsequent differentiable reading of the dynamic obstacle evolution trajectory. For example, in a UAV power line inspection simulation scenario, the external memory matrix length N is set to 64, the encoding dimension d to 128, and the hidden layer dimension h of the GRU controller to 256, with tanh as the activation function. The GRU weight matrix is initialized using a Gaussian distribution (mean 0, variance 0.05) to ensure the initial prediction process is not affected by significant offsets. When constructing the addressing mechanism, a cosine similarity threshold of 0.85 is set to filter highly correlated combinations of spatial location encoding and temporal pattern labels. The encoding vector is normalized using softmax to generate a weight distribution during writing, ensuring that the obstacle state encoding of the current time step occupies the main weight position in the matrix, while retaining some states from neighboring time steps to enhance event continuity. In one simulation run, this spatiotemporal memory unit successfully stored and indexed the multi-obstacle position-trend composite features within the last 64 time steps, significantly reducing the query latency of subsequent S2.2 spatial channel encoding reading and providing stable, highly correlated trajectory sequence input in the S3 attention mechanism reading stage, thus exhibiting significantly improved robustness in predicting nonlinear obstacle motion patterns. S2.2: Perform spatial channel encoding on the standardized obstacle state input vector generated in S1, extract its three-dimensional coordinate components and map them to a normalized grid space with a preset resolution, generate the corresponding discretized grid index, and use the embedding layer to convert the index into a fixed-dimensional position vector as a spatial encoding input to characterize the spatial distribution characteristics of the obstacle, so as to support the subsequent structured writing in the memory matrix. S2.3: Based on the standardized obstacle state input vector extracted between consecutive frames, calculate the relative displacement difference between adjacent time steps, and perform sign quantization and interval division on the difference sequence to generate dynamic pattern labels describing the change of motion trend, which serve as input features of the time channel to capture non-stationary characteristics such as acceleration abrupt changes and turning behavior of obstacles in time sequence. S2.4: The DNTM controller receives the position vector from the spatial channel and the dynamic pattern label from the temporal channel, and performs a dual-channel joint encoding operation: First, the two types of features are concatenated and fused into a composite input vector, then the hidden state is updated through GRU, and a writing weight vector and a content vector are generated based on the state; according to the writing weight, the target address in the memory matrix M is located, and the content vector is written to the corresponding position, completing a spatiotemporal coupled information storage action. S2.5: Repeat the dual-channel joint encoding and writing process described in S2.4, continuously update the memory matrix M as the simulation time step progresses, and finally form an ordered memory feature matrix containing the state trajectories of the K most recent time steps of obstacles. This matrix retains the evolution path structure of key obstacles in the spatiotemporal dimension, and serves as the input basis for the next stage of attention mechanism reading and local trend analysis.
[0017] like Figure 2 As shown, step S3 involves: reading obstacle state trajectory fragments from the K most recent time steps from the memory feature matrix, calculating the correlation weights of each fragment with the current environmental evolution pattern using an attention mechanism, and generating a weighted fusion local evolution trend vector as a representation output of the obstacle group's dynamic behavior. Specifically, this includes: S3.1: Based on the memory feature matrix stored in the spatiotemporal memory unit constructed by the differentiable neural Turing machine structure in the previous step, obtain the spatiotemporal correlation sequence composed of the position vectors and relative displacement difference labels of each dynamic obstacle in the most recent K time steps, as the original input data of the attention mechanism; Based on the external memory matrix M of the spatiotemporal memory unit constructed by the differentiable neural Turing machine structure, an index retrieval method (parameters: time window length K, address pointer set) is used to realize the batch positioning and reading operation of the K most recent time step data in the matrix, and output the spatial position vector of each dynamic obstacle and the relative displacement difference label set of the time channel; Furthermore, by using a data unpacking method (parameters: position vector dimension d1, difference label dimension d2), channel separation of the batch reading results is achieved, the original data stream is parsed into two independent subsets: a spatial encoding array and a temporal encoding array, and a sequence of spatiotemporal attribute pairs that retains temporal consistency is obtained; Furthermore, a sequence concatenation method (parameters: position information weight α, dynamic label weight β) is adopted to achieve ordered concatenation of the spatial encoding array and the temporal encoding array in the feature dimension, and generate a combined high-dimensional vector sequence, where each vector corresponds to the joint state of the obstacle's position and motion trend at a time step; Furthermore, a temporal index rearrangement method (parameters: ascending order of time steps, continuity constraint of obstacle IDs) is applied to the combined high-dimensional vector sequence to achieve strict ordering of time steps within the sequence and continuous reconstruction of obstacle trajectories, and to generate a spatiotemporal correlation sequence matrix that meets the input requirements of the attention mechanism. Through the matrix construction process described above, the memory matrix content from the previous step is transformed into explicit and structured raw input data, thereby providing the attention mechanism with a highly consistent spatiotemporal pattern input that can be directly used for query-key-value mapping; For example, in a UAV power line inspection scenario, the time window length K is set to 8. Each time step in the external memory matrix M contains a d1=6-dimensional spatial position vector (including three-dimensional coordinates and their encoded features) and a d2=4-dimensional relative displacement difference label (including acceleration change direction and heading angle change trend). An index retrieval method is used to locate the most recent 8 time steps, with the corresponding obstacle IDs set as consecutive integer indices to ensure trajectory correlation. The spatial array shape is [8×6] and the time array shape is [8×4], separated using a data unpacking method. The splicing weights α=0.6 and β=0.4 are set to generate a combined high-dimensional vector sequence [8×10]. The time indices are then rearranged using an ascending order rule to form a spatiotemporal correlation sequence matrix S with a shape of [8×10]. Each row simultaneously represents the spatial distribution encoding and motion trend label of the obstacle. In subsequent S3.2, this matrix will be directly input into the Query-Key-Value mapping to ensure that the correlation calculation is based on an accurate and complete spatiotemporal trajectory pattern, effectively improving the accuracy of dynamic obstacle evolution prediction. S3.2: Perform a query-key-value mapping transformation on the spatiotemporal correlation sequence, generate a query vector using the current environmental observation state, encode historical trajectory segments into key vectors and value vectors, and calculate the correlation score between each historical segment and the current evolution pattern based on dot product attention to quantify the degree of matching of obstacle movement patterns in different time periods; Based on the spatiotemporal correlation sequence described in S3.1, the input conditions are the obstacle position vectors and relative displacement difference label sequences of the most recent K time steps generated by the differentiable neural Turing machine structure, and the environmental observation state at the current moment is used as the comparison benchmark. The feature similarity mapping algorithm (parameter: ternary mapping structure Query-Key-Value) is adopted to encode the current environmental observation state into a query vector. The location vector and dynamic pattern label are linearly transformed by the environmental feature encoder to generate a set of key vectors and a set of value vectors that match the dimension of the query vector. Furthermore, the relevance between the query vector and each key vector is measured using the dot product attention calculation formula, specifically:
[0018] in, For relevance scores, For query vector, For key vectors, The dimension is the vector dimension. The formula performs dimension normalization on the dot product result to balance the range of attention score values across different dimensional scales. Furthermore, by performing vectorized dot product operations on the key vectors and query vectors of all trajectory segments through batch matrix calculation, a relevance score matrix is obtained. In this matrix, the time index is represented by rows and the different obstacle features are represented by columns, forming structured quantitative data on the degree of matching. Furthermore, an attention mask generation method based on contextual feature constraints (parameters: environmental perception field of view, obstacle visibility markers) is adopted to mask invalid positions in the correlation score matrix, setting the score of obstacle segments that are not visible in the current field of view to zero, thereby improving the effectiveness of correlation calculation. Through the above mapping and correlation calculation, a correlation score matrix is obtained that can reflect the degree of matching between obstacle movement patterns and current environmental evolution patterns at different time periods, thus realizing the transformation of the original spatiotemporal correlation sequence into a quantitative matching index. For example, in a power line inspection UAV simulation environment, the most recent K time steps are set to 10, the position vector dimension is 3, the dynamic mode label dimension is 2, and the query vector dimension is 64. The joint feature vector of each time step is mapped to a 64-dimensional key vector and value vector set using a linear mapping. The matching score for each time step is calculated using the formula described above. Taking the nominal value of the query vector [0.12, 0.05, ..., 0.33] of the observation state at a certain moment and the nominal value of the key vector [0.45, ..., 0.27] of the historical time step t3 as an example, the dot product score is 28.56, and the matching degree after dimension square root normalization is approximately 3.57. Under mask constraints, obstacle segments exceeding a 5-meter perception radius are removed. After this processing, specific column elements in the correlation matrix are set to zero, ultimately retaining the matching scores for 7 valid time periods. Subsequent steps perform Softmax normalization and weighted fusion based on these scores. The resulting local evolution trend vector shows significantly improved stability and accuracy in predicting dynamic obstacles with nonlinear acceleration and turning in simulation verification. S3.3: Apply Softmax normalization to the calculated correlation scores to generate a standardized correlation weight distribution, ensuring that each historical trajectory segment is comparable during the fusion process and suppressing information interference from irrelevant or noisy periods. S3.4: Based on the standardized relevance weights, perform a weighted summation operation on the corresponding value vector sequence to generate a high-dimensional local evolution trend vector, which explicitly encodes the most influential obstacle movement trend in the current environment and its spatiotemporal dependence. S3.5: The generated local evolution trend vector is L2 normalized to eliminate the scale bias caused by amplitude differences, and outputs a stable and suitable dynamic behavior representation of the obstacle group for downstream graph convolutional network input, completing the complete information extraction process from memory retrieval to attention fusion.
[0019] like Figure 3As shown, step S4 involves inputting the local evolution trend vector into a lightweight graph convolutional network, performing neighborhood aggregation based on the topological connections between obstacles, identifying potential collision clusters and mainstream motion directions, and outputting the probability distribution envelope of each obstacle within the next T steps. Specifically, this includes: S4.1: Based on the local evolution trend vector generated by the weighted fusion of the attention mechanism, construct a set of obstacle nodes, where each node represents a sequence of historical motion states of a dynamic obstacle, and use it as the initial node feature input of the graph structure; Based on the local evolution trend vector generated by weighted fusion of attention mechanism, a node mapping method (parameters: unique obstacle identifier, position coordinates, velocity vector, acceleration component) is used to realize the conversion function from high-dimensional trend representation to graph structure node set; Furthermore, by using the historical state sequence encoding method (parameters: time window length K, feature dimension d), the motion state of each dynamic obstacle in the most recent K time steps is temporally packaged, and this packaged sequence is used as the initial feature vector input of the node to obtain the node features containing temporal dependency information. Furthermore, a feature normalization algorithm (parameters: minimum-maximum range [0,1], normalization factor δ) is adopted to achieve scale uniformity of node features on different physical dimensions and generate a comparable normalized node feature matrix, ensuring the consistency of similarity measurement in subsequent graph convolution operations. Furthermore, by using a node index rearrangement method (parameters: index mapping table, hash function), unique numbering of obstacle nodes from different sources is achieved, and an ordered set of nodes is generated to eliminate duplication and conflict issues during cross-source data fusion. Through the above node construction and feature extraction processing methods, the local evolution trend vector of the previous step is transformed into an ordered set of nodes and its initial features that can be directly called by a lightweight graph convolutional network, thereby achieving a high-precision structured modeling effect for dynamic obstacles. For example, in a power line inspection drone obstacle avoidance training simulation scenario, the system receives a local evolution trend vector containing 10 dynamic obstacles. Each obstacle records its position (in meters), velocity (in meters per second), and acceleration (in meters per second²) within the most recent K=8 time steps. The vector dimension d=9 (containing three-dimensional position, three-dimensional velocity, and three-dimensional acceleration components). Using a node mapping method, the unique identifier of each obstacle is combined with the aforementioned motion parameters to generate 10 nodes. Each node has the following characteristics: The temporal unfolded vector is obtained. Through minimum-maximum normalization, each component is mapped to the [0,1] interval. The normalization factor δ is selected according to the amplitude of the physical quantity of that component, such as δ=500 meters for the position component and δ=20 meters / second for the velocity component. After normalization, the node feature matrix is obtained. An index rearrangement method is used to uniformly map obstacle numbers from different data sources to consecutive indices from 0 to 9, forming an ordered set of nodes. The ordered set and normalized feature matrix are input into a lightweight graph convolutional network, which performs neighborhood aggregation and motion pattern classification of the spatiotemporal characteristics of obstacles in subsequent steps, significantly improving prediction accuracy and reducing computational consumption. S4.2: Based on the relative distance threshold of obstacles in the current three-dimensional space, establish undirected edges to connect adjacent obstacle nodes, forming a dynamic adjacency matrix to express the topological connection relationship in the local spatial domain, serving as the basic graph structure for graph convolution operations; S4.3: A lightweight graph convolutional network is used to perform multi-layer neighborhood aggregation on the initial node features and dynamic adjacency matrix. The feature information of neighboring nodes is weighted and summed through learnable weight parameters. The high-order semantic representation of each obstacle node is extracted and updated to obtain an enhanced node embedding vector that integrates context information. Based on the obstacle node set and dynamic adjacency matrix constructed in step S4.2, a lightweight graph convolutional network (parameter configuration includes number of layers L=3, hidden dimension h=64, activation function ReLU, neighbor sampling ratio ρ=1.0) is used to perform multi-layer neighborhood aggregation processing on the initial node features and dynamic adjacency matrix, so as to realize information diffusion and context-aware feature fusion under the constraints of local topology. Furthermore, a weighted summation operation of neighbor node features is achieved by using a normalized adjacency matrix preprocessing method (constructing self-connections by adding an identity matrix I and performing degree matrix normalization), and batch normalization is introduced after each convolutional layer to stabilize the gradient distribution, thereby reducing the risk of gradient vanishing during deep network training. Furthermore, by utilizing a learnable weight parameter matrix A linear transformation is performed on the feature vector after neighbor aggregation to realize the dimensionality increase and decrease and semantic mapping of the feature space. Under the action of a nonlinear activation function, the high-order semantic representation of each obstacle node is extracted to form a cross-node context-enhanced information representation. Furthermore, through multi-layer iterative convolution and aggregation, the potential motion trend connections and spatial collision patterns in dynamic adjacency relationships are captured, and the node feature set output by the convolutional layer is mapped into an enhanced node embedding vector, thereby providing high-quality input for subsequent potential collision cluster identification. By using the above processing method of lightweight graph convolutional networks, the initial node features of the previous step are transformed into enhanced node embedding vectors with rich contextual information and explicit encoding of spatial relationships, thereby achieving high-precision local obstacle group representation under low computational overhead. For example, in a power line UAV inspection scenario, the number of obstacle nodes n is 50, the initial node feature dimension d is 32, the dynamic adjacency matrix is generated by a relative distance threshold r = 2.5m, the sampling ratio ρ is set to 1.0 to ensure full neighbor aggregation, the graph convolutional network has 3 layers L and the hidden layer dimension h = 64. The adjacency matrix A is normalized using a degree matrix normalization method to ensure that the influence of different node degree distributions on aggregation is consistent. A weight matrix is defined. As parameters for the first convolutional layer, the input is The initial feature matrix is used for convolution calculation. This process outputs the result after three stacked convolution layers. The enhanced node embedding vectors are batch-normalized to stabilize the feature distribution. Validation results show that these embedding vectors significantly improve detection accuracy in subsequent collision cluster recognition tasks and maintain low latency and high robustness in complex obstacle dynamic evolution environments. S4.4: Based on the enhanced node embedding vector, calculate the motion consistency metric among the obstacle nodes, use a clustering algorithm to identify spatial clusters with similar motion trends, determine them as potential collision clusters, analyze their overall displacement mean, and extract the mainstream motion direction vector; Based on the enhanced node embedding vectors output by a lightweight graph convolutional network, the cosine similarity method (parameters: node embedding vector dimension d, vector normalization method L2) is used to calculate the motion consistency measure of any two obstacle nodes in the high-order feature space. Furthermore, by constructing a motion consistency matrix (parameters: total number of obstacle nodes n, similarity threshold τ), a global symmetric matrix similarity index is achieved, and weighted adjacency data for subsequent clustering analysis is obtained; Furthermore, the DBSCAN density clustering algorithm (parameters: minimum number of nodes within a cluster, radius threshold ε) is used to identify spatial clustering regions based on the consistency matrix and generate a set of member nodes for each cluster, ensuring that nodes in the same cluster have similar movement trend patterns. Furthermore, by using the linear displacement mean calculation method (parameter: the unit time displacement vector sequence of nodes within the cluster), the overall motion displacement mean of each potential collision cluster is obtained, and the mainstream motion direction vector is obtained; Furthermore, a unit vector normalization method (parameters: direction vector dimension 3, norm type L2) is adopted to standardize the scale of the mainstream motion direction vectors, ensuring the consistency of direction features in subsequent probability density modeling; Through the above clustering analysis and direction extraction processing, the enhanced node embedding vectors of the previous step are transformed into a set of potential collision clusters and mainstream motion direction data, so as to realize the accurate extraction of the obstacle spatial clustering pattern within the future T steps, and provide high confidence input conditions for the spatiotemporal probability modeling of S4.5. For example, in a simulated power line inspection drone scenario, the enhanced node embedding vector dimension d=64 and the total number of obstacle nodes n=25. In the cosine similarity calculation, all vectors are L2 normalized to obtain a motion consistency matrix, where node pairs with a similarity higher than τ=0.85 are considered to have similar motion trends. Using the DBSCAN clustering algorithm, with a minimum cluster size of 3 nodes and ε=0.15, four clusters are identified as potential collision clusters. The average displacement vector per unit time (sampling period 1s) of the nodes within each cluster is calculated; for example, the average displacement of the nodes in the first cluster is... m / s, the mainstream motion direction vector is obtained by L2 norm normalization. The direction vector is then used as a high-confidence input to the next step of the probability density estimation model to calculate the spatiotemporal distribution envelope within the next 5 seconds. The verification results show that this process can significantly improve the stability of collision cluster identification and direction prediction in nonlinear dynamic obstacle environments. S4.5: Combining the spatial expansion range of potential collision clusters with the uncertainty variance of the mainstream motion direction, a probability density estimation method is used to model their position distribution within the next T steps, and the spatiotemporal probability distribution envelope of each obstacle is output as the risk assessment basis required for local obstacle avoidance decision-making.
[0020] Step S5: Based on the probability distribution envelope and the current position information of the UAV, a local obstacle avoidance decision space is constructed, and a set of candidate flight paths is generated in this space. Each path corresponds to a set of action strategy sequences under spatiotemporal constraints. Specifically, this includes: S5.1: Based on the obstacle probability distribution envelope surface output by the lightweight graph convolutional network, obtain the possible pose confidence interval of each dynamic obstacle in the next T steps. Combined with the current position, attitude and perception field of view of the UAV, use the three-dimensional spatiotemporal grid mapping algorithm to discretize the continuous environment into a voxelized decision space with time slices, and generate a local obstacle avoidance decision space volume with spatiotemporal resolution to support path feasibility assessment under multiple time steps. Based on the obstacle probability distribution envelope surface output by a lightweight graph convolutional network, an interval analysis method (parameters: future prediction steps T, obstacle node matrix) is used to extract the confidence interval of the position, attitude and spatiotemporal changes of each dynamic obstacle in the next T steps, and form a joint representation of three-dimensional coordinate components and attitude vector. Furthermore, by performing the intersection calculation of the spatial domain and the visual domain with the joint representation of position and attitude and the current state vector of the UAV (parameters: three-dimensional coordinates, attitude quaternions, and onboard sensor field of view parameters), the system retains only the obstacle confidence interval dataset within the UAV's perception range and filters out redundant information from irrelevant areas. Furthermore, by utilizing a three-dimensional spatiotemporal grid mapping algorithm (parameters: spatial resolution Δx, Δy, Δz, temporal resolution Δt), the continuous three-dimensional environment space and the future T-step time dimension are discretized into a voxel cell structure, and the corresponding obstacle existence probability is assigned to each voxel cell in different time slices; Furthermore, based on the obstacle existence probability field of voxel cells, a local obstacle avoidance decision space is constructed using a probability field weighted mapping function. In this space, passable areas and high-risk obstacle areas are distinguished, and a data format that can be directly accessed by the path planning algorithm is formed. By using a three-dimensional spatiotemporal grid mapping process, the probability distribution envelope result of the previous step is transformed into a voxelized local obstacle avoidance decision space with time slice index, thereby enabling the discretized calculation and rapid evaluation of path feasibility at multiple time steps. For example, during UAV inspection, the obstacle probability distribution envelope predicted by a lightweight graph convolutional network for the next T=5 steps is input, with spatial resolutions Δx=0.5m, Δy=0.5m, Δz=0.5m and temporal resolution Δt=0.2s. The confidence interval for each obstacle within the next 1s is extracted, including its position (x, y, z) and attitude quaternion. This interval is then intersected with the UAV's current 3D coordinates (20.0m, 35.0m, 10.0m), attitude quaternion (0.0, 0.0, 0.7071, 0.7071), and field-of-view parameter 60°. The confidence interval for obstacles within the 60° field of view in front of the UAV is retained. A 3D spatiotemporal raster mapping algorithm is used to discretize the environmental space into 0.5m voxel units in the x, y, and z directions, generating 5 time slice units for each of the next T=5 steps. Each unit is assigned an obstacle presence probability p∈[0,1]. Using probability field weighted mapping function The weighted value of each voxel is calculated, with high-weighted values marked as high-risk areas and low-weighted values marked as passable areas. In actual verification, the generated local obstacle avoidance decision space contains approximately 480 voxel nodes, of which 120 are high-risk areas. The path planning module can directly call this voxel structure to achieve rapid path feasibility screening at multiple time steps, significantly improving the real-time performance and reliability of obstacle avoidance path generation. S5.2: In the local obstacle avoidance decision space, based on the UAV dynamic constraints and the maximum acceleration / angular velocity limit, the improved RRT* (Fast Extended Random Tree Star) algorithm is used to perform forward trajectory sampling to generate N potential flight paths starting from the current pose. Each path consists of a series of discretized spatiotemporal nodes, forming a preliminary set of candidate flight paths, which serves as the basic input for subsequent strategy evaluation. Within the local obstacle avoidance decision space, a path search mechanism combining UAV dynamics constraints and an improved RRT algorithm is employed to generate potential flight paths starting from the current pose. A dynamic model constraint method is used (parameter: maximum translational acceleration). Maximum angular velocity (Moment of inertia I, mass m) to realize the validity determination of node states during the flight path sampling process, ensuring that the generated path sequence meets the kinematic and dynamic feasibility of the UAV; Furthermore, the feasibility index for the transition from the current node to the new sampling node is calculated using the state transition equation, as shown in the following formula:
[0021] in, Let this be the velocity vector at the next moment. Let the velocity vector be the velocity vector at the current moment. For acceleration vectors, For time step; only when satisfy And the angular velocity satisfies The state transition is valid under the given conditions. Furthermore, an improved RRT algorithm is adopted (parameters: sampling step size ε, reconnection radius). The heuristic cost function C) enables global random sampling and local optimization reconnection of the path, and obtains a path tree structure that satisfies spatiotemporal obstacle avoidance and dynamic constraints. Furthermore, by introducing a collision determination function based on the obstacle probability distribution envelope during the RRT sampling process, the number of intersection elements between each newly added edge segment and the obstacle probability region is calculated, and this number is used as the cost function. The input is used to eliminate high-collision-risk paths in real time during the generation process; Furthermore, by utilizing a reconnection optimization strategy, the total path cost is calculated. As a criterion, among which For the price of sports, These are weighting coefficients used to dynamically adjust and optimize the generated path, shortening the total length and reducing the probability of collisions. The path sampling and optimization algorithm transforms the voxelized decision space generated in the previous step into a structured set of N candidate flight paths, achieving the expected technical effect that the path satisfies spatiotemporal constraints, is dynamically feasible, and has a safety evaluation. For example, in the obstacle avoidance training simulation of power line inspection drones, a maximum acceleration is set. for m / s², maximum angular velocity for rad / s, time step s, sampling step size ε is m, reconnection radius for m, the collision cost weight λ is In this configuration, the dynamic constraint equations ensure that the velocity increment of each discrete node does not exceed [a certain value]. m / s, attitude adjustment not exceeding rad. In the improved RRT sampling process, the obstacle probability envelope is derived from the predicted distribution over the next T=5 steps. The collision determination function is called each time a sampled edge segment is generated, removing edges with more than 5 overlapping elements. The final generated path set contains N=40 candidate paths. After cost optimization, the average path length is shortened by more than 20%, and the collision risk index is significantly reduced, meeting the safety and feasibility requirements of the training system for flight paths under different dynamic obstacle scenarios. S5.3: Conduct a collision risk assessment on the spatiotemporal nodes of each candidate flight path. Calculate the cumulative collision cost of the path crossing high-confidence obstacle areas by using the probability distribution envelope surface in the corresponding time slice. Combine the path length, curvature change and angular deviation from the mission target direction to construct a multidimensional cost function and output a comprehensive risk score for each path to screen safe and feasible action sequences. Based on the input conditions of the candidate flight path set generated by the improved RRT* algorithm, the trajectory information of each path represented by a discrete spatiotemporal node sequence is obtained, as well as the probability distribution envelope data of each obstacle in the next T steps output by the lightweight graph convolutional network. A probabilistic risk integral-based method (parameters: path node sequence, probability distribution envelope matrix) is used to calculate the cumulative collision cost of each path crossing a high-confidence obstacle region, thus establishing a basis for risk quantification. Furthermore, by using a node time slice matching algorithm (parameters: path node time index, envelope surface time slice), the time-by-time mapping between path nodes and obstacle probability values is realized, and a temporal collision probability sequence is obtained. Furthermore, the total collision risk value is obtained by integrating the sequence using a weighted cumulative integral method (parameters: collision probability sequence, inter-node duration Δt). The formula is as follows:
[0022] in Let be the probability of the obstacle existing at time t. The time step between nodes; Furthermore, the path length and curvature change rate are calculated using a path geometric feature quantization algorithm (parameter: path node coordinate sequence), and the length cost and curvature cost are obtained. Furthermore, the angular difference in deviation from the target direction is calculated using a directional deviation measurement algorithm (parameters: path start and end vectors, task target direction vector), as shown in the following formula:
[0023] in This is the direction deviation angle. This is the path displacement vector. The direction vector of the mission objective; By weighting the cumulative collision cost, length cost, curvature cost, and orientation deviation cost as described above, a multidimensional cost function is constructed, as shown in the following formula:
[0024] in For comprehensive risk scoring, , , , These are the weighting coefficients for collision, length, curvature, and directional deviation, respectively. For path length, This comes at the cost of curvature variation; The path geometry and risk information from the previous step are transformed into a comprehensive risk score by calculating the results of the multidimensional cost function, thereby enabling the feasibility screening and safety optimization of candidate flight paths. For example, in a scenario where a drone inspects a high-voltage power transmission line, let the future prediction step size T be 10, the time step Δt between path nodes be 0.5s, and the envelope surface sampling resolution be 0.1m. For path A, the total number of nodes is 30, and the cumulative collision cost R calculated through risk integration is 2.3; the path length L is calculated geometrically to be 75m, and the curvature change cost... The value is 1.8, and the direction deviation angle θ is... Radius. Let the weighting coefficients be... =0.4, =0.3, =0.2, =0.1, and the comprehensive risk score C obtained by multidimensional cost function calculation is: The risk score was significantly lower than other path options. In actual simulations, this path effectively avoided three dynamic obstacles while maintaining continuous visibility of the inspection target, validating the efficiency and safety of the cost function selection. S5.4: Based on the comprehensive risk score, the candidate flight path set is non-dominated sorted and clustered and pruned to retain the low-risk and highly diverse path schemes in group P. Each preferred path is mapped to a set of parameterized action strategy sequences, including the expected velocity vector, heading adjustment command and altitude change gradient, to generate a structured action strategy output set as a local decision sample for students' network learning. Based on the comprehensive risk score matrix of each candidate flight path output by S5.3, the Pareto non-dominated sorting algorithm (parameter settings: risk score dimensions are cumulative collision cost, total length, curvature change, and mission direction deviation angle) is used to classify the order of path superiority and inferiority. Furthermore, a density clustering method based on DBSCAN (parameter settings: neighborhood radius ε is set according to spatial resolution, and minimum number of samples within a cluster minPts is set according to the size of the candidate path) is used to identify highly similar path clusters in the top R low-risk paths of non-dominated ranking, and representative sample extraction is performed on the paths within the clusters to reduce strategy redundancy. Furthermore, a sample diversity evaluation algorithm (parameter setting: using the combination of path coverage and directional distribution entropy in the local obstacle avoidance decision space as the diversity score) is used to perform a secondary screening of the representative samples of the cluster, retaining the P group of preferred path schemes that meet the conditions of coverage greater than threshold C and directional distribution entropy higher than threshold H. Furthermore, through the parameterized action strategy mapping method (defining the desired velocity vector) Heading adjustment instructions Gradient of height change The continuous node sequence of each preferred path is transformed into a sequence of action strategy parameters under given spatiotemporal constraints, forming structured strategy data that can directly drive the UAV controller. Furthermore, through motion sequence regularization processing (parameter setting: velocity vector normalized to maximum velocity)... The scale and height gradient are limited to ± This ensures that the output set satisfies the constraints of the UAV dynamics and control system and can be directly used as training input for local decision samples of the student network. By combining Pareto non-dominated sorting, DBSCAN clustering and parameterized mapping, the risk scoring results of the previous step are transformed into a structured action policy output set with significant diversity and high executability, achieving the expected technical effect of balancing training sample security and policy coverage. For example, in a power line inspection drone obstacle avoidance training scenario, the comprehensive risk scoring matrix has a size of N=50, and the scoring dimensions are set as cumulative collision cost (in terms of...). The calculations included path length, mean curvature change, and directional deviation angle. Pareto sorting identified R=15 non-dominated set paths. DBSCAN parameters were set to ε=5m and the minimum number of nodes within a cluster to 2, resulting in 5 clusters. After removing similar paths within each cluster, 9 representative paths were retained. For diversity evaluation, a coverage threshold C=0.6 and a directional distribution entropy threshold H=1.2 were set, ultimately retaining P=6 optimal path schemes. After parameterization mapping, the expected velocity vector range of the optimal paths was... Double the cruising speed, heading adjustment command range =±15°, height change gradient range ±0.5m / s. Regularization restricts all velocity components to within 2m / s and height change rate to within 0.4m / s. The output of 6 sets of action policy samples significantly improves the safe obstacle avoidance ability in areas with dense dynamic obstacles during student network training, while maintaining the diversity of task paths. S5.5: The generated action strategy output set is spatiotemporally aligned and bound with the corresponding local obstacle avoidance decision space feature map to form 'environment representation-action response' paired data tuples, and stored in the local cache in a standardized tensor format for subsequent hierarchical knowledge distillation process, ensuring the consistency and temporal matching between the teacher's network guidance signal and the student's network input state.
[0025] Step S6: Using the action policy distribution generated by the teacher network in a high-fidelity simulation environment as a soft objective, the edge student network is trained using hierarchical knowledge distillation with the KL divergence loss function, enabling it to learn implicit behavioral priors guided by memory-enhanced predictions, and outputting a lightweight obstacle avoidance strategy model. Specifically, this includes: S6.1: Based on the action policy distribution sequence generated by the teacher network running in a high-fidelity simulation environment, obtain its probabilistic action output for the candidate flight path set in the local obstacle avoidance decision space, as a structured soft target label; use the continuous policy response value in the soft target label to replace the traditional hard classification label, so as to retain the fine-grained decision preference information of the teacher network in multimodal obstacle avoidance behavior, and generate a supervision signal vector with behavioral prior characteristics; S6.2: Based on the supervision signal vector, construct the backbone feature extraction layer and action decision head architecture of the edge student network. The backbone layer uses stacked depthwise separable convolutional modules to form a lightweight feature encoder, and the action decision head is designed as a fully connected residual unit with shared weights. By freezing the teacher network parameters and fixing the input dimension alignment mechanism, ensure that the student network receives the same local evolution trend vector and probability distribution envelope as the teacher network, so as to establish a consistent perception-decision mapping space. S6.3: During the forward propagation process, hierarchical alignment processing is performed on the intermediate activation layer outputs of the student network and the teacher network under the same input conditions. Specifically, the feature map tensor of the Lth layer of the backbone feature extraction layer is selected as the first alignment point, and the embedding vector of the hidden layer before the action decision head is selected as the second alignment point. Based on the activation value distribution of the above two alignment points, the KL divergence loss term between them and the corresponding layer output of the teacher network is calculated to form a multi-level behavior imitation objective function. S6.4: The multi-level behavior imitation objective function is weighted and fused with the original action classification cross-entropy loss to form a composite optimization objective; based on the composite objective, the backpropagation algorithm is executed to update the student network parameters end-to-end, so that the student network not only fits the final action distribution, but also inherits the internal representation evolution path of the teacher network under the guidance of memory enhancement prediction, thereby obtaining implicit behavioral prior knowledge with generalization ability. Based on the input condition of the multi-level behavior imitation objective function formed by S6.3 and the original action classification cross-entropy loss coexisting, a linear weighted fusion method is adopted (parameters: weight coefficient α is used to balance the proportion of imitation loss, weight coefficient β is used to balance the proportion of classification loss, constraint α+β=1) to combine the two types of loss functions into a unified composite optimization objective function. Furthermore, by using the gradient calculation method (parameters: AdamW is selected as the optimizer, the initial learning rate is set to 1e-4, and the weight decay coefficient is set to 0.01), the gradient vector of the composite optimization objective in the full parameter space of the student network is solved, and the joint gradient update data including the backbone feature extraction layer and the action decision head is obtained. Furthermore, the end-to-end backpropagation algorithm (parameters: batch size set to 32, maximum number of iterations set to 50) is used to update the weights of the student network parameters layer by layer using the joint gradient, and generate a new network weight matrix to simultaneously optimize the perceptual feature encoding and policy output distribution. Furthermore, by introducing a gradient clipping method (parameter: gradient norm threshold set to 5.0), the gradient explosion phenomenon during backpropagation is suppressed, a stable parameter convergence trend is achieved, and monitoring data on the change of loss function during iteration is generated; Furthermore, by using a loss function monitoring and analysis method (parameters: window length of 10 iterations, evaluation metric: moving average loss value), the update result of the previous step is transformed into a stability metric, thereby realizing dynamic evaluation of the training process and determination of early stopping trigger conditions. By using an end-to-end parameter optimization process, the multi-level behavior imitation results from the previous step are combined with the final action distribution fitting results to form a set of implicit behavioral prior knowledge parameters with generalization capabilities, thereby achieving high adaptability of the lightweight obstacle avoidance strategy model in unknown environments. For example, in a drone inspection and obstacle avoidance training platform, the teacher network runs in a cluster simulation environment, outputting an imitation loss of 0.35 and a classification loss of 0.25. Weighting coefficients α=0.6 and β=0.4 are set, and a fusion formula is used:
[0026] in The KL divergence loss value for hierarchical imitation. The cross-entropy loss value is given. Substituting the parameters, the fusion loss is L = 0.6 × 0.35 + 0.4 × 0.25 = 0.31. The optimizer AdamW has an initial learning rate of 1e-4 and a weight decay of 0.01. End-to-end backpropagation is performed with a batch size of 32. The gradient pruning threshold of 5.0 effectively suppresses the excessive gradient phenomenon in single-batch updates. The moving average loss value remains in the range of 0.29~0.31 within a window length of 10 iterations. The stability index meets the early stopping condition of training. The latent behavioral prior of the finally generated student network significantly improves the avoidance effect of perturbation obstacles in subsequent simulation tests, and can maintain the stability and effectiveness of policy output in complex time-varying environments. S6.5: After training is completed, the action decision head output of the student network is subjected to softmax normalization to generate a standardized lightweight obstacle avoidance strategy model. The output of this model is the action selection probability distribution of each candidate flight path in the current local obstacle avoidance decision space, and it supports low-latency inference and execution on the embedded platform to meet the computing power constraints of real-time obstacle avoidance control in UAV inspection operations.
[0027] Step S7: During actual flight, the newly observed obstacle evolution state is collected in real time, the evolution residual between the observed state and the predicted result is calculated, and it is determined whether the evolution residual exceeds a preset threshold. If it does, a small-batch online fine-tuning process is triggered. Specifically, this includes: S7.1: Based on the dynamic obstacle observation data stream output in real time by the embedded airborne perception system, acquire time-aligned observation frames containing position coordinates, velocity vectors and acceleration components, and perform spatiotemporal registration processing on the observation frames to generate an actual obstacle evolution state vector consistent with the simulation prediction spatiotemporal reference. S7.2: Align the actual obstacle evolution state vector with the probability distribution envelope surface output by the lightweight graph convolutional network in the obstacle avoidance behavior simulation module at the same time step, and calculate the multidimensional evolution residual tensor between the two using the Euclidean distance and KL divergence joint measurement mechanism to obtain a quantitative residual index characterizing the degree of environmental modeling bias. S7.3: Based on the preset dynamic residual threshold range, a threshold comparison judgment operation is performed on the quantitative residual index. If the L2 norm of the evolution residual tensor exceeds the preset upper limit threshold, a high confidence environment mismatch flag signal is generated as a logical enable condition to trigger the online learning process. Based on the multidimensional evolutionary residual tensor calculated by step S7.2, the L2 norm calculation method (parameter: residual tensor dimension = fusion dimension of three-dimensional spatial coordinates and velocity and acceleration components) is used to achieve a quantitative evaluation of the overall residual amplitude. Furthermore, by using a normalization method (parameter: the reference scale is derived from the confidence interval range of the prediction model output), the proportion of residuals with different physical dimensions is unified, and a quantitative residual index that can be used for threshold comparison is obtained. Furthermore, by using a threshold comparison method (parameter: the dynamic residual threshold range is set based on the range of the historical simulation residual mean and three times the standard deviation), the quantitative residual index is directly compared with the preset upper limit threshold, and a Boolean judgment result is generated; Furthermore, through a logical judgment method (parameter: the judgment condition is that the residual index L2 norm is greater than the upper bound), a high-confidence environmental mismatch signal is output when the condition is met, and a logical enable flag that triggers the online learning process is obtained; Through the above comparison and judgment processing method, the residual quantification result of the previous step is transformed into an environmental adaptability discrimination signal, so as to achieve accurate identification and rapid response triggering effect for sudden changes in the flight environment. For example, in a UAV inspection flight mission, the 3D obstacle coordinates, velocity, and acceleration observation data obtained by the fusion of airborne lidar and inertial navigation are aligned with the probability distribution envelope surface of the lightweight graph convolution prediction output. Then, an 8-dimensional residual tensor is formed through joint calculation of Euclidean distance and KL divergence. The L2 norm calculation method is adopted.
[0028] in, Let i be the i-th dimension residual component, where i is the index.
[0029] The obtained norm value is scaled and normalized, with the reference scale being the mean of the standard deviation of the predicted distribution. The calculated quantitative residual index is 1.35. The preset dynamic residual threshold range is [0, 1.0]. When the comparison result shows that 1.35 is greater than the upper threshold, the logic judgment module outputs a high-confidence environment mismatch flag. This flag directly triggers the online learning controller to activate the historical observation sequence cache within the last 20 seconds, which is used to construct an incremental training dataset to achieve rapid adaptive adjustment of the strategy model under sudden changes in the flight environment. In this embodiment, the model fine-tuning after triggering effectively reduces the maximum offset between the subsequent predicted path and the actual obstacle evolution, significantly improving the safety and stability of the obstacle avoidance strategy in complex and ever-changing environments. S7.4: After receiving the high-confidence environment mismatch flag signal, activate the historical observation sequences and corresponding policy execution feedback within the most recent N time windows in the edge buffer, construct a local training dataset with context continuity, and perform denoising enhancement and sample reweighting processing on the dataset to generate a high-quality incremental training subset suitable for small-batch fine-tuning. S7.5: Based on the incremental training subset, perform gradient backpropagation optimization on the action decision head parameters in the deployed student network, use the AdamW algorithm with driving terms for finite iteration updates, complete a low-latency, high-responsive parameter fine-tuning process, and output a temporary enhanced lightweight obstacle avoidance strategy model to cope with the current environmental change scenario.
[0030] Step S8: Incremental parameter updates are performed based on the trigger signal. The lightweight obstacle avoidance strategy model is locally optimized using the latest observation data to generate an environmentally adaptable closed-loop obstacle avoidance control strategy, completing the entire technical chain from memory-driven prediction to feedback-triggered optimization. Specifically, this includes: S8.1: Based on the evolution residual judgment result output by the previous step S7, when the residual between the actual observed state and the predicted state is detected to exceed the preset threshold, the event flag is triggered to generate a Boolean trigger signal as the basis for starting the incremental update process, so as to indicate that there is a significant environmental shift and the lightweight obstacle avoidance strategy model needs to be adaptively adjusted. S8.2: Obtain the latest obstacle observation sequence collected in real time by airborne sensors, including position, velocity and acceleration vectors, and combine it with the current network parameters of the lightweight obstacle avoidance strategy model deployed in S6 to construct a small batch of local training dataset for subsequent parameter fine-tuning; the input conditions are new observation data and existing model weights, and the processing method is sliding window sampling and label alignment operation, with the goal of forming a supervised learning sample set that can be used for backpropagation; S8.3: Based on this small batch training dataset, calculate the forward inference output distribution of the student network in the current environment, and compare it with the action policy soft target distribution generated by the teacher network under the same input. Use the KL divergence loss function to calculate the policy bias loss value, and then use the gradient backpropagation algorithm to perform local parameter updates on the top-level action decision head of the lightweight obstacle avoidance strategy model to narrow the semantic gap between the model output and the high-fidelity policy. S8.4: Inject the updated model parameters into the edge inference engine of the flight control system, replace the original time-delay version of the lightweight obstacle avoidance strategy model, and synchronously update the confidence markers related to the current environment mode in the spatiotemporal memory unit to generate an environmentally adaptable closed-loop obstacle avoidance control strategy that can respond to new obstacle behaviors while maintaining real-time constraints. S8.5: Record the timestamp, triggering reason, and model performance change indicators of this parameter update, and store them in the local log database as the data basis for subsequent offline analysis and teacher network retraining. At the same time, reset the comparison benchmark of the evolutionary residual monitoring module to complete a complete 'perception-decision-execution-feedback' closed-loop link technical implementation.
[0031] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
[0032] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and rules of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for training and simulating obstacle avoidance during unmanned aerial vehicle (UAV) inspection operations, characterized in that, Includes the following steps: S1: Based on the historical observation data of dynamic obstacles in UAV inspection operations, time series samples are obtained and the time series samples are normalized to generate a standardized obstacle state input vector. The historical observation data stream of the dynamic obstacles includes the three-dimensional coordinates, linear velocity vector, angular velocity components, acceleration magnitude and directional derivative of each obstacle in continuous time steps. S2: A spatiotemporal memory unit is constructed using a differentiable neural Turing machine structure. Based on the standardized obstacle state input vector, the position vector of the spatial channel and the relative displacement difference label of the temporal channel are jointly encoded through a dual-channel writing mechanism to form a memory feature matrix. S3: Read obstacle state trajectory segments from the memory feature matrix, calculate the correlation weight of each segment with the current environment evolution mode, and generate a local evolution trend vector, wherein the local evolution trend vector explicitly encodes the most influential obstacle movement trend and its spatiotemporal dependence in the current environment. S4: Input the local evolution trend vector into the graph convolutional network, perform neighborhood aggregation operation based on the topological connection relationship between obstacles, identify potential collision clusters and mainstream motion directions, and output the probability distribution envelope of each obstacle; S5: Based on the probability distribution envelope and the current position information of the UAV, a local obstacle avoidance decision space is constructed, and a set of candidate flight paths is generated in the local obstacle avoidance decision space. Each path corresponds to a set of action strategy sequences under spatiotemporal constraints. S6: Using the action policy distribution generated by the teacher network in a high-fidelity simulation environment as a soft target, hierarchical knowledge distillation training is performed on the edge student network to output an obstacle avoidance strategy model. S7: During actual flight, the newly observed obstacle evolution state is collected in real time, the evolution residual between it and the prediction result is calculated, and it is determined whether the evolution residual exceeds the preset threshold. If it does, the online fine-tuning process is triggered. S8: Perform incremental parameter updates based on the trigger signal, and use the latest observation data to locally optimize the obstacle avoidance strategy model to generate a closed-loop obstacle avoidance control strategy with environmental adaptability.
2. The method for simulating obstacle avoidance training during UAV inspection operations according to claim 1, characterized in that, Step S1 specifically includes: Acquire the historical observation data stream of dynamic obstacles recorded by airborne sensors or simulation systems during the UAV inspection process, and use it as the original observation input condition; Based on the original observation input conditions, data alignment and time synchronization processing are performed. Interpolation algorithms are used to fill in missing data frames caused by communication delays or sampling asynchrony. All obstacle state sequences are resampled to a unified time reference to generate time-aligned obstacle state time sequence segments. Key dynamic feature parameters are extracted from the time-aligned obstacle state time sequence segment to form a high-dimensional obstacle state feature vector; Based on the high-dimensional obstacle state feature vector, a numerical compression process based on max-min normalization is performed to map the features of each dimension to a unified interval, thereby obtaining a normalized obstacle state feature matrix. Outlier detection and robust correction are performed on the normalized obstacle state feature matrix. Outlier identification method based on Mahalanobis distance is used to remove data points that significantly deviate from the normal movement pattern and replace them with the weighted mean of the nearest time. The structured and standardized obstacle state input vector is then output.
3. The method for simulating obstacle avoidance training during UAV inspection operations according to claim 1, characterized in that, Step S2 specifically includes: Based on the architectural principle of differentiable neural Turing machines, a spatiotemporal memory unit with an external memory matrix and a controller network is constructed. The standardized obstacle state input vector is processed by spatial channel encoding, its three-dimensional coordinate components are extracted and mapped to a normalized grid space of preset resolution, and the corresponding discretized grid index is generated. The discretized grid index is converted into a fixed-dimensional position vector using an embedding layer. Based on the standardized obstacle state input vector extracted between consecutive frames, the relative displacement difference between adjacent time steps is calculated, and the relative displacement difference is quantized by sign and divided into intervals to generate dynamic pattern labels describing the change of motion trend. The DNTM controller receives the position vector and the dynamic pattern label, performs a dual-channel joint encoding operation, concatenates and fuses the position vector and the dynamic pattern label into a composite input vector, updates the hidden state through GRU, generates a write weight vector and a content vector, locates the target address in the memory matrix according to the write weight vector, writes the content vector to the corresponding position, and completes the spatiotemporal coupled information storage action. The dual-channel joint encoding operation is repeated, and the memory matrix is continuously updated as the simulation time step progresses, forming an ordered memory feature matrix.
4. The method for simulating obstacle avoidance training during UAV inspection operations according to claim 1, characterized in that, Step S3 specifically includes: Based on the memory feature matrix stored in the spatiotemporal memory unit constructed by the differentiable neural Turing machine structure, the spatiotemporal correlation sequence composed of the position vectors and relative displacement difference labels of each dynamic obstacle in the most recent K time steps is obtained; A query-key-value mapping transformation is performed on the spatiotemporal correlation sequence. A query vector is generated using the environmental observation state at the current moment. Historical trajectory segments are encoded into key vectors and value vectors. The correlation score between each historical segment and the current evolutionary mode is calculated based on dot product attention. The correlation scores are normalized using Softmax to generate a standardized correlation weight distribution. Based on the standardized relevance weights, a weighted summation operation is performed on the corresponding value vector sequence to generate a local evolution trend vector; The local evolution trend vector is L2 normalized to output a dynamic behavior representation of the obstacle group.
5. The method for simulating obstacle avoidance training during UAV inspection operations according to claim 1, characterized in that, Step S4 specifically includes: Based on the local evolution trend vector generated by weighted fusion of attention mechanism, an obstacle node set is constructed and used as the initial node feature of the graph structure; Based on the relative distance threshold of obstacles in the current three-dimensional space, undirected edges are established to connect adjacent obstacle nodes, forming a dynamic adjacency matrix; A graph convolutional network is used to perform multi-layer neighborhood aggregation on the initial node features and the dynamic adjacency matrix. The feature information of neighboring nodes is weighted and summed using learnable weight parameters. The high-order semantic representation of each obstacle node is extracted and updated to obtain an enhanced node embedding vector that integrates context information. Based on the enhanced node embedding vector, the motion consistency metric among each obstacle node is calculated, a clustering algorithm is used to identify spatial clusters with similar motion trends, these are identified as potential collision clusters, and their overall displacement mean is analyzed to extract the mainstream motion direction vector. By combining the spatial expansion range of potential collision clusters with the uncertainty variance of the mainstream motion direction, a probability density estimation method is used to model their position distribution within the next T steps, and the spatiotemporal probability distribution envelope of each obstacle is output.
6. The method for simulating obstacle avoidance training during UAV inspection operations according to claim 5, characterized in that, Each node in the obstacle node set represents the historical motion state sequence of a dynamic obstacle.
7. The method for simulating obstacle avoidance training during UAV inspection operations according to claim 1, characterized in that, Step S5 specifically includes: Based on the obstacle probability distribution envelope surface output by the graph convolutional network, the pose confidence interval of each dynamic obstacle in the next T steps is obtained. Combined with the current position, attitude and perception field of view of the UAV, the continuous environment is discretized into a voxelized decision space with time slices using a three-dimensional spatiotemporal grid mapping algorithm to generate a local obstacle avoidance decision space volume. In the local obstacle avoidance decision space, based on the UAV dynamics constraints and the maximum acceleration / angular velocity limit, the improved RRT* algorithm is used to perform forward trajectory sampling, generating N potential flight paths starting from the current pose, forming a preliminary set of candidate flight paths; Collision risk assessment is performed on spatiotemporal nodes on each candidate flight path. The probability of obstacle existence in the corresponding time slice is used to calculate the cumulative collision cost of the path crossing the high-confidence obstacle region. A multidimensional cost function is constructed by combining the path length, curvature change and angular deviation from the mission target direction, and the comprehensive risk score of each path is output. Based on the comprehensive risk score, the candidate flight path set is non-dominated sorted and clustered and pruned to retain P groups of low-risk and highly diverse path schemes. Each path scheme is mapped to a set of parameterized action strategy sequences to generate a structured action strategy output set. The action strategy output set is spatiotemporally aligned and bound with the corresponding local obstacle avoidance decision space feature map to form paired data tuples, which are then stored in the local cache in a standardized tensor format.
Citation Information
Patent Citations
Power line patrol unmanned aerial vehicle control method and system
CN117806355A
Multi-unmanned aerial vehicle formation dynamic obstacle avoidance method and device, and storage medium
CN120428741A
