Autonomous driving vehicle trajectory generation method and system based on adaptive segmentation and data evolution of diffusion model

Through the trajectory generation method based on the diffusion model, the trajectory data is processed using greedy strategies and diffusion Transformer model, the problem of scarcity of trajectory data of autonomous driving vehicles is solved, and more accurate and robust trajectory generation is achieved, improving the vehicle's driving safety and traffic efficiency.

CN118886303BActive Publication Date: 2025-04-08JIANGSU UNIV

Patent Information

Application Number
CN202410907531.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2025-04-08
Estimated Expiration
2044-07-08

AI Technical Summary

Technical Problem

The trajectory data of autonomous driving vehicles is scarce, resulting in inaccurate trajectory generation and affecting the safe driving of the vehicle.

Method used

The trajectory generation method based on the diffusion model is adopted, and the optimal trajectory segment length is divided through greedy strategies, a diffusion Transformer model is constructed for data diffusion and editing, and a multi-layer perceptron and time fusion Transformer is used to build a data evolution model to generate a multimodal autonomous driving vehicle trajectory.

Benefits of technology

It effectively solves the problem of scarcity of trajectory data, improves the accuracy and robustness of trajectory generation, and enhances the driving safety and traffic efficiency of the vehicle under different conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118886303B_ABST
    Figure CN118886303B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for generating autonomous driving vehicle trajectories based on adaptive segmentation and data evolution of a diffusion model. On the basis of obtaining vehicle trajectory data, first, a greedy strategy is used to dynamically select the optimal historical trajectory segment length to obtain the historical trajectory segment length under different conditions. Secondly, the historical trajectory segment is input into a data diffusion model for training. After training with an improved Transformer model, a variety of vehicle trajectory data of different vehicle behaviors are obtained. After that, a data editing model is used to construct vehicle trajectory data without the guidance of a predictor to generate new samples in the target domain. Then, a data evolution model is used to predict the mode, length and amplitude of the next segment, and the obtained information is input into the data diffusion and data editing models to obtain new samples, and the generated trajectory is obtained by combining them. The present invention can improve the stability and reliability of the generated trajectory, thereby improving the safety and adaptability of driving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of autonomous driving vehicle trajectory generation, and in particular to a method and system for autonomous driving vehicle trajectory generation based on a diffusion model. Background Art

[0002] An autonomous vehicle is a wheeled vehicle that can sense the surrounding environment, spontaneously generate decision instructions and execute driving behaviors without human intervention. Environmental perception, decision planning and control execution are the three core technologies of autonomous driving. The environmental perception module can provide information guarantee for safe driving, including vehicle sensor data, vehicle dynamic status and traffic status information.

[0003] Trajectory generation refers to the process of autonomous vehicles continuously learning from historical trajectories and generating future trajectories in real time. In autonomous driving, trajectory generation plays a vital role in the safe driving of vehicles. By accurately generating trajectories, vehicles can better make decisions and control tasks, improving vehicle driving efficiency and driving safety.

[0004] At present, the scarcity of autonomous driving vehicle trajectory data is a major problem in the field. The diffusion model of the present invention is mainly used for data generation, which includes a forward process and a reverse process, i.e., noise addition and denoising, and can generate similar data with different characteristics under different conditions. Using the diffusion model, multimodal autonomous driving vehicle trajectories are generated using historical trajectory data, which can solve the problem of scarcity of autonomous driving vehicle trajectories. Summary of the invention

[0005] Based on the above technical requirements, the present invention provides a method and system for generating autonomous driving vehicle trajectories based on a diffusion model. The method mainly includes three key contents: (1) Vehicle trajectory segment length division based on a greedy strategy. Different from the traditional time series data division method, this module selects the optimal length segment division under different conditions from candidate segments of different lengths; (2) Vehicle trajectory data diffusion and editing module based on a diffusion strategy. A new factor editing method based on transfer learning is constructed to enhance the original factors in the target domain; (3) The data evolution model of a multi-layer perceptron (MLP) and a time-fusion transformer is used to predict the detailed information of the next segment and pass it into the diffusion and editing module.

[0006] The trajectory generation method proposed in the present invention mainly comprises the following steps:

[0007] Step 1: Input construction: Collect trajectory data and driving data of the vehicle and surrounding vehicles as the original input of the model;

[0008] Step 2: Divide the optimal segment length: Use the greedy strategy SISC to segment the acquired historical trajectory data and driving data to obtain the optimal trajectory length under different conditions;

[0009] Step 3: Construct a diffusion model: Based on the length of the segments divided in step 2, use Transformer to construct a diffusion model DiTransformer;

[0010] Step 4: Model training: Use different vehicle behavior data to train the diffusion model DiTransformer;

[0011] Step 5: trajectory data editing: based on the model training results of step 4, perform data editing operations on the vehicle trajectory data sequence;

[0012] Step 6: Evolution model construction: Use multi-layer perceptron (MLP) and time fusion Transformer to build the trajectory data evolution model;

[0013] Step 7: Trajectory generation: Use the edited data to learn through the data evolution model to obtain the pattern, length and amplitude of the next segment, and then obtain the new segment through diffusion and editing again, and combine it with the current data to synthesize the vehicle trajectory.

[0014] Furthermore, the original model input includes the driving data and trajectory data of the vehicle and surrounding vehicles. The trajectory data includes the position change of the vehicle in the x, y, and z axes in space compared to the previous moment. The x axis is the vehicle driving direction, the y axis is the vehicle lateral movement direction perpendicular to the vehicle driving direction in the road plane, and the z axis is the vehicle up and down movement direction perpendicular to the road plane in space; the driving data includes information such as speed, acceleration, deceleration, and steering angle.

[0015] Furthermore, in the process of constructing the model input in step 1, the collected data needs to be preprocessed, including:

[0016] (1) Data cleaning: involves processing missing values, outliers, and erroneous data to ensure data quality and integrity;

[0017] (2) Feature selection: Selection refers to selecting features with higher importance and relevance, thereby reducing the dimensionality of features;

[0018] (3) Encoding normalization: The collected data is represented by embedding so that the model can be used directly; normalization is to process the values ​​of different features to make them consistent in range.

[0019] Furthermore, in step 2, the length of the optimal segments is adaptively determined by a greedy segmentation strategy, and they are divided into K different clusters. After appropriate scaling in both duration and amplitude dimensions, the segments within the same cluster have similar shapes and trends. The centroid of each cluster represents the scale-invariant pattern in the trajectory sequence.

[0020] Compare each assessment location Different candidate sequence lengths s∈[s min ,s max ], the length closest to the centroid is recorded as the best segmentation of the current segment Right now

[0021]

[0022] Where n is the total number of fragments, p δ is the candidate sequence for the δth segment, represents the optimal segment length determined by the greedy segmentation method, G p:p+s Represents the length of any segment, s * is the optimal segment length, C is the scale-invariant cyclic pattern, and r(·,·) is the distance metric.

[0023] Furthermore, dynamic time warping (DTW) is used to calculate the minimum cost of point-by-point alignment between two segments.

[0024] DTW(s i ,s j )=min d∈D <d,Δ(s i ,s j )>

[0025] Where d represents the consistency between two sequences in all possible permutations set D, Δ(s i ,s j ) are two sequences s i and j The point-wise distance matrix between .

[0026] Furthermore, in step 3, the original Transformer module is modified to obtain a diffusion Transformer model. The specific modifications are as follows:

[0027] (1) Adding adaptive layer normalization (AdaLN) before the multi-head attention mechanism;

[0028] (2) Adaptive layer normalization is also added before the forward propagation layer;

[0029] (3) A parallel multi-layer perceptron (MLP) process was added.

[0030] In detail, the steps to build a Transformer are as follows:

[0031] The first step is to embed the input sequence I and add position information;

[0032] I embedding =EmbeddingLookup(I)+PositionalEncoding

[0033] Among them, I embedding is the sequence after embedding representation, EmbeddingLookup is the embedding query function, and PositionalEncoding is the position encoding function.

[0034] The second step is to perform adaptive normalization on the input sequence processed in the first step;

[0035]

[0036] Among them, AdaLN(I embedding ) is the normalized result, γ and β are learnable parameters used to adjust the normalization scale and bias, μ and σ are the mean and standard deviation of the input respectively.

[0037] The third step is to put the sequence processed in the second step into the self-attention layer to generate a new vector. By multiplying different weight matrices, three different vectors are obtained, and self-attention calculations are performed on the three different vectors.

[0038] I attention =Attention(Q,K,V)

[0039] Among them, I attention is the result of self-attention calculation, Attention is the self-attention algorithm, Q, K, and V are query, key, and value respectively.

[0040] The fourth step is to put the generated self-attention vector into the multi-attention mechanism layer for calculation.

[0041] MultiHead(Q,K,V)=Concat(I attention_1 ,...,I attention_h )W O

[0042] Among them, W O is the weight matrix, I attention_1 ,...,I attention_h Represents the self-attention vector of different heads, h represents the number of layers of the attention mechanism, MultiHead(Q,K,V) is the calculation result of multiple attention mechanism layers, and Concat represents the connection operation.

[0043] The fifth step is to make a residual connection between the input sequence and the output of the multi-attention mechanism and normalize them.

[0044] I attention_i =I+I attention_i

[0045] I attention_i =LayerNorm(I attention_i )

[0046] Among them, LayerNorm is the normalization function, i=1,2,…h, and I is the original input sequence.

[0047] Step 6: Adaptively normalize the residual connection and normalized results again;

[0048] Step 7: Input the output result of step 6 into the feedforward network.

[0049] FFN(I attention_i )=max(0,I attention_i ×W1+b1)W2+b2

[0050] Among them, FFN is the forward propagation operation, W1 and W2 are the weights of the two fully connected layers, b1 and b2 are the biases of the two fully connected layers, and I attention_i is the self-attention vector of the i-th head.

[0051] In the eighth step, the output of the feedforward network and the output of the fourth step are subjected to residual connection and normalization operations.

[0052] Meanwhile, the steps to construct a parallel MLP are:

[0053] The first step is to embed the input sequence and add position information;

[0054] I embedding =EmbeddingLookup(I)+PositionalEncodinf

[0055] Among them, I embedding is the sequence after embedding representation, EmbeddingLookup is the embedding query function, and PositionalEncoding is the position encoding function.

[0056] In the second step, the input sequence is passed to the hidden layer, which is a fully connected layer. The calculation is as follows:

[0057]

[0058] in, is the output of the fully connected layer, n (l-1)is the number of neurons in the previous layer, is the weight connecting the i-th upper layer neuron and the j-th hidden layer neuron, represents the output of the l-1th layer of neurons, is the bias of the jth hidden layer neuron, f(·) is the activation function of the hidden layer, is the final output.

[0059] The third step is to pass the output of the hidden layer to each layer in the Transformer according to different weights and biases.

[0060] Furthermore, in step 4, the specific steps of training the diffusion model are:

[0061] The first step is to add noise to the data. The noise adding process is modeled as follows:

[0062]

[0063] in, represents a set of real numbers, n is the number of trajectory segments, s is the time step, and d is the factor dimension; g p is the segment of the trajectory at position p, g0 is the initial trajectory segment, α i is the signal retention strength at position i, p is the position, g is p Approximately is a Gaussian distribution, I represents the unit matrix, The diagonal elements are The covariance matrix of .

[0064] The second step is to accelerate sampling and model the denoising process as follows:

[0065]

[0066] in,

[0067]

[0068] Among them, p θ is the distribution estimate of q above, g p is the trajectory segment at position p, g p-1 is the previous trajectory segment, ∈ θ is the trainable noise term in the distribution process, β p Controls the size of the additional noise, V represents the variance of the Gaussian distribution, μ θ (g p ,p) means that at position p, from the noisy trajectory segment g p Infer the previous segment g p-1 The mean of αi is the signal retention strength at position i, p is the position, g represents the original trajectory segment, ∑ q (p) represents the position p, according to the noisy trajectory segment g p Infer the previous step fragment g p-1 The variance of .

[0069] The third step is to construct the optimization function as follows:

[0070]

[0071] Among them, Loss is the loss value, Indicates that in g0~q(g0), p~Uniform condition, g0~q(g0) means g0 is extracted from q(g0), Uniform means uniform distribution, ∈ and ∈ θ (g p ,p) represents the noise term,∈ θ (g p ,p) is the model prediction noise term, the noise vector predicted according to the current trajectory segment and position, and ∈ is the data noise actually added during the diffusion process.

[0072] The fourth step is to follow the DDIM principle to accelerate reasoning, as follows:

[0073]

[0074] Where σ represents the degree of randomness. σ (g 1:P |g0) means that under the condition of the initial segment g0, g 1:P The distribution of g 1:P represents all trajectory segments from position 1 to position P, q σ (g P |g0) means that under the condition of the initial segment g0, g P The distribution of q σ (g p-1 ∣g p ,g0) indicates that between the initial segment g0 and the segment g p Under the condition of g P-1 distribution.

[0075] Furthermore, in step 5, the data is edited.

[0076]

[0077] in, represents the noise term predicted based on the current trajectory segment, position and condition vector, ω freerepresents the bootstrapping strength without predictor bootstrapping, c is the conditional vector, is a learnable zero vector, represents the noise term predicted under the unconditional vector, representing the overall distribution of the learned trajectory segments, ∈ θ (g p ,c) represents the predicted noise term given the conditional vector c, which represents the distribution of the learned conditional information.

[0078] In step 6, a data evolution model is constructed, that is, an MLP model is constructed, and the next pattern, size and amplitude are used as prediction objects for training prediction.

[0079] Furthermore, the MLP model is constructed as follows:

[0080] z (1) =gW (1) +b (1)

[0081] a (1) =ReLU(z (1) )

[0082] z (2) =a (1) W (2) +b (2)

[0083] Among them, z (l) represents the weighted input of the lth layer, a (l) represents the activation output of layer l, W (l) and b (l) They represent the weight and bias of the lth layer respectively, l=1, 2, ReLU is the nonlinear activation function, and finally the hidden layer output is processed according to the task type.

[0084] Furthermore, the time fusion Transformer is used for time series prediction trajectory, and the construction steps are as follows:

[0085] The first step is to construct a gated residual network GRN as follows:

[0086] GRN ω (a,e)=LayerNorm(a+GLU ω (η1))

[0087] η1=W 1,ω η2+b 1,ω

[0088] η2=ELU(W 2,ω a+W 3,ω e+b 2,ω )

[0089] Among them, a is a main input, e is an optional context vector, η1 and η2 are intermediate layers, and W 1,ω represents the linear transformation matrix from the intermediate layer η2 to η1, W 2,ω represents the linear transformation matrix from the main input a to the intermediate layer η2, W 3,ω represents the linear transformation matrix from the context vector e to the intermediate layer η2, ω is the exponent representing weight sharing, b is the bias, and b 1,ω represents the bias vector from the middle layer η2 to η1, b 2,ω is the bias vector from the main input a and the context vector e to the intermediate layer η2, ELU is the exponential linear unit activation function, and GLU is the gated linear unit.

[0090] The second step is to build a variable selection network as follows:

[0091]

[0092] in, represents the output of the gated residual network, which receives two inputs, is the variable selection weight vector, e s represents the context vector generated from the static covariate encoder, Ξ t is the flattened vector of all past inputs.

[0093] The third step is to construct a static covariate encoder, the output is e s ,as follows:

[0094]

[0095] Among them, ζ is the output of the variable selection network.

[0096] The fourth step is to construct an interpretable multi-head attention mechanism InterpretableMultiHead as follows:

[0097]

[0098] Among them, Q, K, V are key, query and value respectively, and W H is the weight, For all heads.

[0099] The fifth step is to build a temporal fusion decoder. In detail, the decoder mainly consists of a sequence-to-sequence layer for enhancing position attributes, a static enrichment layer, a temporal self-attention layer, and a position feedforward layer.

[0100] In step 7, the learning method of the data evolution model is as follows:

[0101]

[0102] Where φ is the learning network, r is the mode, l is the length, and f is the amplitude scaling factor. are the parameters after evolution, r n Indicates the current fragment mode, l n is the current segment length, f n The current clip amplitude scaling factor.

[0103] The optimization goal of learning is to minimize the loss function Loss(φ), as follows:

[0104]

[0105] in, is the cross entropy calculation, represents the expected value of all training segments.

[0106] Furthermore, learning is continued and the learned fragments are combined together to generate vehicle trajectories.

[0107] A diffusion model-based autonomous driving vehicle trajectory generation system, characterized by comprising a data acquisition module, a data preprocessing module, a trajectory data partitioning module, a data diffusion model, a data editing model and a data evolution module.

[0108] The data acquisition module mainly includes perception devices such as cameras, lidars and ultrasonic radars, which are used to collect vehicle trajectory data and driving data.

[0109] The main function of the data preprocessing module is to clean the collected data, select features, and normalize the code;

[0110] The trajectory data partitioning module divides the acquired trajectory data by length, and uses a greedy partitioning strategy to divide the acquired historical trajectory data into segments of variable length and group them into different clusters. The segments within the same cluster present similar shapes after appropriate duration and amplitude scaling. Then, the centroid of each cluster represents the scale-invariant pattern in the financial time series. A more effective centroid initialization method is used, which first randomly selects a segment from all available segments of a pre-specified length as the first centroid. Then, subsequent centroids are selected from the remaining segments, and the selection weights are proportional to their distance to the nearest centroid in the selected set.

[0111] The data diffusion model includes processes such as denoising and denoising. The denoising process follows DDPM (DenoisingDiffusion Probabilistic Models), which gradually transforms the initial noise distribution into the conditional probability distribution of the target data through a series of diffusion steps. This process is achieved by maximizing the likelihood of the data; the denoising process follows DDIM (Diffusion Deformable Implicit Models), which is an autoregressive model that starts with the initial noise data and gradually deforms to generate the target data through multiple steps. In addition, there is a parallel MLP structure to initialize the model parameters to 0. At this time, the Transformer block becomes an identity function, and the input block is directly passed to the next layer.

[0112] The structure of the data editing model is the same as that of the diffusion model, but in actual operation, the number of noise addition steps in the editing process is much smaller than the number of initialization steps. This strategy can reduce the difficulty of data recovery caused by low signal-to-noise ratio.

[0113] The data evolution module regards the modeling of the next segment pattern as a multi-classification problem, and the learning of the length scaling factor and the amplitude scaling factor as a regression problem. The state between consecutive segments is modeled through a fully connected neural network with multiple outputs, and the network is trained using the Adam optimizer. The vehicle trajectory data of this segment is then generated through the data diffusion model and data editing model operations, and is continuously appended to finally generate a real-time vehicle trajectory.

[0114] The method and system for generating trajectory of an autonomous driving vehicle based on a diffusion model according to the present invention firstly dynamically select the optimal length of a historical trajectory segment using a greedy strategy on the basis of obtaining vehicle trajectory data, and obtain the length of a historical trajectory segment under different conditions; secondly, the historical trajectory segment is input into a data diffusion model for training, and a variety of vehicle trajectory data of different vehicle behaviors are obtained through training with an improved Transformer model; then, a data editing model is used to construct vehicle trajectory data without the guidance of a predictor, and new samples in a target domain are generated; then, a data evolution model is used to predict the mode, length and amplitude of the next segment, and the obtained information is input into the data diffusion and data editing models to obtain new samples, which are then combined to obtain a generated trajectory.

[0115] Beneficial effects of the present invention:

[0116] 1. The optimal segmentation technology of the present invention uses a greedy adaptive segmentation strategy to divide the optimal historical trajectory length under different circumstances. The two key components are the distance metric r(·,·) and the initialization of the cluster centroid. r(·,·) is robust to different lengths and amplitudes, and can accurately calculate the differences between sub-segments. After completing the greedy segmentation of the entire time series, the standard K-means clustering process is continued; the cluster centroid initialization of the present invention first randomly selects segments as centroids from all available segments of a pre-specified length, and selects subsequent centroids from the remaining segments. The selection weight is proportional to their distance to the nearest centroid in the selected set. The line segment farther from the nearest centroid has a higher probability of being selected as the next centroid. Reduce the computational complexity of the trajectory generation algorithm, reduce the impact of redundant information, shorten the calculation time, and meet the requirements of real-time trajectory generation; perform trajectory generation independently on each subsequence, improve the robustness of the system to noise and uncertainty, reduce sensitivity to abnormal trajectory data, and improve the stability and reliability of the generated trajectory.

[0117] 2. The vehicle trajectory data diffusion and editing module based on the diffusion strategy in the present invention newly constructs a factor editing method based on transfer learning to enhance the original factors in the target domain. Following the DDPM noise addition process to increase the diversity and richness of the data, it can simulate the randomness and uncertainty in different driving scenarios, so that the autonomous driving vehicle can make plans in advance for emergencies and improve the robustness of the generated trajectory. The Transformer model in the module includes a multi-head attention mechanism, a feedforward neural network, and a residual connection layer. The multi-head attention allows the model to focus on different parts in different representation spaces in parallel. It can extract implicit interaction information in the trajectory data and learn the impact of surrounding vehicles on the trajectory of the autonomous driving vehicle, so as to better capture the long-distance dependencies in the sequence. The feedforward neural network can capture more complex nonlinear relationships between inputs through a multi-layer fully connected structure and a ReLU activation function (non-linear activation function). It helps the model better learn abstract features and patterns in the input sequence.

[0118] 3. The data evolution module in the present invention learns the patterns and time series dynamics in historical data, and predicts the patterns, length scaling factors and amplitude scaling factors of future trajectories with the help of the MLP model, and learns the evolution of states between continuous segments. MLP has a multi-layer neural network structure, each layer contains multiple neurons, and can adapt to different types of prediction problems, using trajectory patterns as classification predictions and length and amplitude factors as regression predictions. MLP introduces nonlinear changes, allowing it to fit nonlinear relationships, observe and learn the incoming trajectory data, and dynamically adjust the trajectory generation process according to the characteristics of the current driving scene and the patterns of historical data. Its adaptability enables the system to generate suitable trajectories under different road conditions and driving scenarios, thereby improving driving safety and adaptability. BRIEF DESCRIPTION OF THE DRAWINGS

[0119] Figure 1 This is a schematic structural diagram of the principle of trajectory generation of an autonomous driving vehicle based on a diffusion model according to the present invention;

[0120] Figure 2 This is a flow chart of the method for generating trajectories of an autonomous driving vehicle based on a diffusion model according to the present invention;

[0121] Figure 3 This is a schematic diagram of the trajectory length division of the present invention;

[0122] Figure 4 This is the structure diagram of the data operation Transformer of the present invention;

[0123] Figure 5 A schematic diagram of training and editing the diffusion model of the present invention;

[0124] Figure 6 This is a structural diagram of the time fusion Transformer module of the present invention;

[0125] Figure 7 This is a schematic diagram of the original vehicle driving of the present invention;

[0126] Figure 8 A schematic diagram of trajectory generation for an autonomous driving vehicle based on a diffusion model according to the present invention. DETAILED DESCRIPTION

[0127] The present invention will be further described below in conjunction with the accompanying drawings.

[0128] The method and system for generating trajectory of an autonomous driving vehicle based on a diffusion model proposed in the present invention first collect the historical trajectory data and driving status data of the vehicle to construct the original input of the model; secondly, the greedy strategy is used to adaptively cut the length of the optimal trajectory data segment to obtain the optimal length under different conditions; then, the Transformer is used to build a data diffusion model and train the data; then, the data editing model is built through the diffusion strategy to edit the trajectory data; finally, a data evolution model is built, the aforementioned processed segment trajectory data is input, the mode, length and amplitude of the next trajectory segment are predicted, and then new segments are obtained through data diffusion and data editing, which are merged to generate the vehicle trajectory.

[0129] like Figure 1 , Figure 2 As shown, the method and system for generating trajectory of an autonomous driving vehicle based on a diffusion model described in the present invention include a data acquisition module, a data preprocessing module, a trajectory data division module, a data diffusion editing model and a data evolution module.

[0130] The data acquisition module mainly includes sensing devices such as cameras, laser radars and ultrasonic radars, which are used to collect vehicle trajectory data and driving data. The vehicle trajectory data includes the position change of the vehicle on the x, y, and z axes compared to the previous moment, and the trajectory data of surrounding vehicles includes the relative positions of the x, y, and z axes of all surrounding vehicles within the current sensing range; driving data includes information such as the speed, acceleration, deceleration, and steering angle of the vehicle and surrounding vehicles.

[0131] The main function of the data preprocessing module is to clean the collected data, select features, normalize the code, etc., to improve the data quality, facilitate the direct use of the model, and improve the reliability of the generated trajectory. The specific contents include:

[0132] (1) Data cleaning: involves processing missing values, outliers, and erroneous data to ensure data quality and integrity;

[0133] (2) Feature selection: Selection refers to selecting features with higher importance and relevance, thereby reducing the dimensionality of features;

[0134] (3) Encoding normalization: The collected data is represented by embedding so that the model can be used directly; normalization is to process the values ​​of different features to make them consistent in range.

[0135] The data diffusion model includes processes such as denoising and denoising. The denoising process follows DDPM (DenoisingDiffusion Probabilistic Models), which gradually transforms the initial noise distribution into the conditional probability distribution of the target data through a series of diffusion steps. This process is achieved by maximizing the likelihood of the data; the denoising process follows DDIM (Diffusion Deformable Implicit Models), which is an autoregressive model that starts with the initial noise data and gradually deforms to generate the target data through multiple steps. In addition, there is a parallel MLP structure to initialize the model parameters to 0. At this time, the Transformer block becomes an identity function, and the input block is directly passed to the next layer.

[0136] The data evolution module regards the modeling of the next segment pattern as a multi-classification problem, and the learning of the length scaling factor and the amplitude scaling factor as a regression problem. The state between consecutive segments is modeled through a fully connected neural network with multiple outputs, and the network is trained using the Adam optimizer. The vehicle trajectory data of this segment is then generated through the data diffusion model and data editing model operations, and is continuously appended to finally generate a real-time vehicle trajectory.

[0137] The method for generating trajectory of an autonomous driving vehicle based on a diffusion model described in the present invention realizes trajectory generation based on data diffusion and data editing. The specific process is as follows:

[0138] Step 1: Model input construction: Collect the vehicle's trajectory data and driving status data as model input, and then fuse the trajectory data and driving status data to construct an input data sequence.

[0139] The vehicle trajectory data includes timestamp, relative position change of x-axis, y-axis and z-axis and heading angle, etc. The relative position change can get the direction of movement of the vehicle, and the heading angle can describe the steering behavior of the vehicle. These data describe the vehicle trajectory in real time; the vehicle driving data includes timestamp, speed, acceleration, angular velocity and distance from surrounding vehicles, etc., which can analyze the driving status of the vehicle, such as parking, acceleration, deceleration, turning, etc. The timestamp records the time point of data collection and is used to analyze the time series characteristics of the vehicle driving process.

[0140] Step 2: Divide the trajectory segment length: Use the greedy strategy to divide the optimal trajectory segment length under different conditions.

[0141] like Figure 3 Specifically, compare each evaluation position Different candidate sequence lengths s∈[s min ,s max ], the length closest to the centroid is recorded as the best segmentation of the current segment Right now

[0142]

[0143] Where n is the total number of fragments, p δ is the candidate sequence for the δth segment, represents the optimal segment length determined by the greedy segmentation method, G p:p+s Represents the length of any segment, s * is the optimal segment length, C is the scale-invariant cyclic pattern, and r(·,·) is the distance metric.

[0144] Furthermore, dynamic time warping (DTW) is used to calculate the minimum cost of point-by-point alignment between two segments.

[0145] DTW(s i ,s j )=min d∈D <d,Δ(s i ,s j )>

[0146] Where d represents the consistency between two sequences in all possible permutations set D, Δ(s i ,s j) are two sequences s i and j The point-wise distance matrix between .

[0147] Afterwards, the K-means clustering operation is performed on the fragments as follows:

[0148] In the first step, m data points are randomly selected as the initial cluster centroid points, and the fragments are assigned to the nearest centroid;

[0149] The second step is to calculate the distance between the samples in the fragment and the centroid of the cluster. The formula is as follows:

[0150]

[0151] Among them, d(g i ,μ j ) represents the distance between the sample and the centroid, g ik Indicates the gth i The kth feature of the fragment, μ jk represents the kth eigenvalue of the jth cluster centroid;

[0152] The third step is to convert each fragment g i Assigned to the nearest cluster center μ j Belongs to cluster C j ;

[0153] The fourth step is to update the centroid. The formula is as follows:

[0154]

[0155] The iterations are repeated until a predetermined number of iterations or a stable assignment of clusters is achieved.

[0156] Step 3: Build a diffusion model: Use Transformer to build a data diffusion model for diffusion training.

[0157] S3.1 builds a special Transformer module, such as Figure 4 , the steps are as follows:

[0158] The first step is to embed the input sequence and add position information;

[0159] I embedding =EmbeddingLookup(I)+PositionalEncoding

[0160] Among them, I embedding is the sequence after embedding representation, EmbeddingLookup is the embedding query function, and PositionalEncoding is the position encoding function.

[0161]

[0162]

[0163] Among them, PositionalEncoding (p,2i) and PositionalEncoding (p,2i+1) The position encoding output of the same position but different dimensions, p is the position, i is the dimension, d model For the model dimension, each dimension of the position encoding corresponds to a sine wave, using sine and cosine functions of different frequencies. The sine and cosine functions are chosen because, for any fixed offset t, PositionalEncoding p+t Can be expressed as PositionalEncoding p Linear function, PositionalEncoding p PositionalEncoding is the position encoding of position p. p+t is the position code of position p+t.

[0164] The second step is to perform adaptive normalization on the input sequence;

[0165]

[0166] Among them, AdaLN(I embedding ) is the normalized result, γ and β are learnable parameters used to adjust the normalization scale and bias, μ and σ are the mean and standard deviation of the input respectively.

[0167]

[0168] The third step is to put the input sequence into the self-attention layer to generate a new vector. By multiplying different weight matrices, three different vectors are obtained, and self-attention calculations are performed on the three different vectors.

[0169] I attention =Attention(Q,K,V)

[0170]

[0171] Among them, I attention is the result of self-attention calculation, Attention is the self-attention algorithm; d k The dimension of the key.

[0172] Q=Linear(I embedding )=I embedding W Q

[0173] K=Linear(I embedding )=I embedding W K

[0174] V=Linear(I embedding )=I embedding W V

[0175] Among them, Q is the query vector; K is the key vector; V is the value vector; W Q , W K , W V are the weights corresponding to the three vectors respectively.

[0176] The fourth step is to put the generated self-attention vector into the multi-attention mechanism layer for calculation.

[0177] MultiHead(Q,K,V)=Concat(I attention_1 ,...,I attention_h )W O

[0178] Among them, MultiHead is the multi-head attention mechanism operation, h represents the number of layers of the attention mechanism, and W O is the weight matrix, I attention_1 …I attention_h Represents the self-attention vector under different head mechanisms, MultiHead(Q,K,V) is the calculation result of the multi-attention mechanism layer, and Concat represents the connection operation.

[0179] The fifth step is to make a residual connection between the input sequence and the output of the multi-attention mechanism and normalize them.

[0180] I attention_i =I+I attention_i

[0181] I attention_i =LayerNorm(I attention_i )

[0182] Among them, LayerNorm is the normalization function, I attention_i is the self-attention vector of the i-th head.

[0183] Step 6: Adaptively normalize the residual connection and normalized results again;

[0184] Step 7: Input the output result of step 6 into the feed-forward network FFN.

[0185] FFN(I atention )=ReLu(Linear(Linear(I attention)))

[0186] =max(0,I attention_i ×W1+b1)W2+b2

[0187] Among them, Linear is a linear operation, ReLu is the activation function, W1 and W2 are the weights of the two fully connected layers, and b1 and b2 are the biases of the two fully connected layers.

[0188] In the eighth step, the output of the feedforward network and the output of the fourth step are subjected to residual connection and normalization operations.

[0189] Step 4: Model training: Use vehicle trajectories from different situations to train the model in step 3.

[0190] Specifically, the first step is to diffuse and add noise to the data, and the modeling is as follows:

[0191]

[0192] in, represents a set of real numbers, n is the number of trajectory segments, s is the time step, and d is the factor dimension; g p is the segment of the trajectory at position p, g0 is the initial trajectory segment, α i is the signal retention strength at position i, p is the position, g is p Approximately is a Gaussian distribution, I represents the unit matrix, The diagonal elements are The covariance matrix of .

[0193] Multiple fragments are diffused to form a Markov chain, as follows:

[0194]

[0195] in, β p =1-α p , β p Control the size of the additional noise, q(g p |g p-1 ) represents g p-1 The probability of the current segment appearing under the condition of the previous segment, V represents the variance of the Gaussian distribution.

[0196] In the second step, the denoising process is modeled and the corresponding noise variables are reconstructed through the inverse diffusion process, which is defined by another Markov chain as follows:

[0197]

[0198] in,

[0199]

[0200] Among them, ∈ θ (g p ,p) is the noise term predicted based on the trajectory segment and position, p θ is the distribution estimate of q above, g 0:P represents the trajectory segment from position 0 to position p, g p is the trajectory segment at position p, g p-1 is the previous trajectory segment, ∈ θ is the actual added trainable noise term in the distribution process, β p Controls the size of the additional noise, V represents the variance of the Gaussian distribution, μ θ (g p ,p) means that at position p, from the noisy trajectory segment g p Infer the previous segment g p-1 The mean of α i is the signal retention strength at position i, p is the position, ∑ q (p) represents the position p, according to the noisy trajectory segment g p Infer the previous step fragment g p-1 The variance of .

[0201] The third step is to construct the optimization function as follows:

[0202]

[0203] Among them, Loss is the loss value, Indicates that in g0~q(g0), p~Uniform condition, g0~q(g0) means g0 is extracted from q(g0), Uniform means uniform distribution, ∈ θ (g p ,p) is the model prediction noise term, the noise vector predicted according to the current trajectory segment and position, and ∈ is the data noise actually added during the diffusion process.

[0204] The fourth step is to accelerate reasoning. The lack of parallelism in DDPM leads to slow reasoning. The forward process is modified to a non-Markov process as follows:

[0205]

[0206] Where σ represents the degree of randomness. σ (g 1:P |g0) means that under the condition of the initial segment g0, g1:P The distribution of g 1:P represents all trajectory segments from position 1 to position P, q σ (g P |g0) means that under the condition of the initial segment g0, g P The distribution of q σ (g p-1 ∣g p ,g0) indicates that between the initial segment g0 and the segment g p Under the condition of g P-1 distribution.

[0207] q σ (g p-1 ∣g p ,g0) is parameterized by σ, when setting σ for all steps p =∑ q (p), the forward process collapses to Markov, and the denoising process becomes:

[0208]

[0209] Among them, ∈ θ (g p ,p) is the noise term predicted based on the trajectory segment and position, g p is the trajectory segment at position p, ∈ θ is the actual added trainable noise term in the distribution process, β p Control the size of the additional noise, μ θ (g p ,p) means that at position p, from the noisy trajectory segment g p Infer the previous segment g p-1 The mean of α i is the signal retention strength at position i, p is the position, Σ q (p) represents the position p, according to the noisy trajectory segment g p Infer the previous step fragment g p-1 The variance of .

[0210] Step 5: Track data editing: Use the diffusion strategy to build a data editing model and perform editing operations on vehicle track data, such as Figure 5 .

[0211]

[0212] in, represents the noise term predicted based on the current trajectory segment, position and condition vector, ω free represents the bootstrapping strength without predictor bootstrapping, c is the conditional vector, is a learnable zero vector, represents the noise term predicted under the unconditional vector, representing the overall distribution of the learned trajectory segments, ∈ θ (g p ,c) represents the predicted noise term given the conditional vector c, which represents the distribution of the learned conditional information.

[0213] In detail, first in the source domain G (s) During inference, the target domain To begin, operate on it to obtain the seed fragment: Then, we perform the inverse process on the seed segment to obtain the new segment in the target domain: P ′ For the editing step, the larger P ′ Make the generated data closer to the distribution of the source domain, and the smaller P ′ Make the generated data closer to the data of the target domain.

[0214] Step 6: Data evolution model construction: Using the MLP model, a data evolution model is constructed to predict the fragment pattern, length and amplitude.

[0215] Specifically, the principle of constructing a classification MLP is as follows:

[0216] z (1) =gW (1) +b (1)

[0217] a (1) =ReLU(z (1) )

[0218] z (2) =a (1) W (2) +b (2)

[0219]

[0220] Among them, z (l) represents the weighted input of the lth layer, a (l) represents the activation output of layer l, W (l) and b (l) Respectively represent the weight and bias of the lth layer, ReLU is a nonlinear activation function, and softmax represents the softmax activation function. Represents the final predicted output category.

[0221] Furthermore, the principles of softmax and ReLU are as follows:

[0222]

[0223] ReLU(x)=max(0,x)

[0224] The loss function is set as follows:

[0225]

[0226] Among them, L C represents the loss value, Represents the final predicted category, y i is the real category.

[0227] Specifically, Figure 6 , the steps to construct the time fusion Transformer are as follows:

[0228] The first step is to build a gated residual network as follows:

[0229] GRN ω (a,e)=LayerNorm(a+GLU ω (η1))

[0230] η1=W 1,ω η2+b 1,ω

[0231] η2=ELU(W 2,ω a+W 3,ω e+b 2,ω )

[0232] Among them, a is a main input, e is an optional context vector, η1 and η2 are intermediate layers, and W 1,ω represents the linear transformation matrix from the intermediate layer η2 to η1, W 2,ω represents the linear transformation matrix from the main input a to the intermediate layer η2, W 3,ω represents the linear transformation matrix from the context vector e to the intermediate layer η2, ω is the exponent representing weight sharing, b is the bias, and b 1,ω represents the bias vector from the middle layer η2 to η1, b 2,ω is the bias vector from the main input a and the context vector e to the intermediate layer η2, ELU is the exponential linear unit activation function, and GLU is the gated linear unit.

[0233] GLU ω (γ) = sig(W 4,ω γ+b 4,ω )⊙(W 5,ω γ+b 5,ω )

[0234] Where γ represents the input vector, sig is the sigmoid activation function, W and b are weights and biases, ⊙ is the Hadamard product of the matrix elements, and W 4,ωrepresents the linear transformation matrix from the input vector γ to the gating mechanism, W 5,ω represents the linear transformation matrix from the input vector γ to the dark star transformation part of xi, b 4,ω represents the bias vector from the input vector γ to the gating mechanism, b 5,ω Represents the bias vector from the input vector γ to the linear transformation part.

[0235] The second step is to build a variable selection network as follows:

[0236]

[0237] in, is the variable selection weight vector, e s The context vector generated from the static covariate encoder, Ξ t is the flattened vector of all past inputs.

[0238] At each time step, the input is fed through its own GRN as follows:

[0239]

[0240] is the jth feature in the input at time t, is the processed feature vector.

[0241]

[0242] in, For vector The jth element of m χ Represents the number of input variables.

[0243] The third step is to construct a static covariate encoder as follows:

[0244]

[0245] Among them, ζ is the output of the variable selection network.

[0246] The fourth step is to build an interpretable multi-head attention mechanism as follows:

[0247] Attention(Q,K,V)=A(Q,K)V

[0248] Among them, Q, K, V are query, key and value respectively, and A is the normalization function.

[0249]

[0250] Among them, d is the feature dimension, K T is the transpose of the key.

[0251]

[0252]

[0253] W is the weight, H is the head, Indicates the mth H The output matrix of the attention head, m H is the number of attention heads.

[0254]

[0255] Represents the attention weight matrix of all heads, W V is the value weight shared by all heads, W H For the final linear mapping, it is the linear transformation matrix, represents the attention weight matrix of all heads, and represents the h-th head query and key weight matrix.

[0256] Step 5: Construct a temporal fusion decoder.

[0257] (1) Construct the sequence-to-sequence layer as follows:

[0258]

[0259] φ(t,n) is the input of the decoder itself, n is the position index, represents the input feature vector after being processed by the variable selection network, represents the output of the gated linear unit, Represents the local feature vector after gated skip connection processing.

[0260] (2) The output of the sequence-to-sequence layer is input to the static enrichment layer. For a given position index n, the enrichment form is as follows:

[0261]

[0262] θ(t,n) represents the local feature vector after static enhancement, e s Context vector generated from the static covariate encoder.

[0263] (3) Perform self-attention operation. First, all statically enriched temporal features are combined into a matrix Φ(t) = [θ(t, -k), ..., θ(t, τ)] T , and then use the above multi-head attention mechanism at each prediction time, B(t) = InterpretableMultiHead(Φ(t),Φ(t),Φ(t)), to get the following:

[0264] B(t)=[β(t,-k),…,β(t,τ max )]

[0265] δ(t,n)=LayerNorm(θ(t,n)+GLU δ (β(t,n)))

[0266] β(t,-k) represents the feature vector after multi-head attention mechanism processing, time step is t, position is -k, GLU δ (β(t,n)) represents the output of the gated linear unit, and δ(t,n) represents the feature vector processed by the gated skip connection.

[0267] (4) Perform nonlinear processing on the output of the self-attention mechanism and apply gated residual connections as follows:

[0268] ψ(t,n)=GRN ψ (δ(t,n))

[0269]

[0270] Among them, ψ(t,n) represents the feature vector processed by the position-aware feedforward network, GRN ψ represents a gated residual network for position-aware feedforward networks, Represents the feature vector processed by the gated skip connection. The decoder mainly consists of a sequence-to-sequence layer for enhancing position attributes, a static enrichment layer, a temporal self-attention layer, and a position feed-forward layer.

[0271] Step 7: Trajectory generation: Input the edited data into the data evolution module to obtain the mode, length and amplitude of the next segment. Then, through data diffusion and data editing, new segments are obtained and merged to generate vehicle trajectories.

[0272] The learning of the data evolution module is as follows:

[0273]

[0274] Where r is the mode, l is the length, and f is the amplitude scaling factor. are the parameters after evolution, r n Indicates the current fragment mode, l n is the current segment length, f n The current clip amplitude scaling factor.

[0275] The optimization objectives of learning are as follows:

[0276]

[0277] in, is the cross entropy calculation, represents the expected value of all training segments. .

[0278] Through continuous learning, the learned fragments are combined together to generate vehicle trajectories.

[0279] The historical trajectory data is collected through the data acquisition module, and the greedy strategy is used to segment it to obtain the optimal trajectory segment length. Then, the diffusion model is built using the Transformer module, and data diffusion and data editing operations are performed on the segmented trajectory segments. Based on the DDPM and DDIM principles, the trajectory data is enriched. The data evolution model is built using a multi-layer perceptron and a time-fusion Transformer. The multi-layer perceptron is used to predict the next trajectory pattern, and the time-fusion Transformer is used to predict the amplitude and length of the next trajectory data. After obtaining the prediction information, new trajectory segments are obtained again through data diffusion and editing operations. This is repeated continuously to update the generated trajectory in real time.

[0280] Figure 7 This is a schematic diagram of an autonomous driving vehicle driving on the road shown in the figure. Figure 8 To generate a schematic diagram of the trajectory of an autonomous driving vehicle based on a diffusion model, first clarify that Figure 7 and Figure 8 The diagrams are merely examples and are not intended to limit the scope of the present application. Figure 8 The green lines and blue dots in front of the vehicle represent the generated vehicle trajectory, and the purple dots behind the vehicle represent the vehicle’s historical trajectory.

[0281] The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention. They are not intended to limit the scope of protection of the present invention. All equivalent methods or changes that do not deviate from the technical creation of the present invention should be included in the scope of protection of the present invention.

Claims

1. An autonomous driving vehicle trajectory generation method based on adaptive segmentation and data evolution of a diffusion model, characterized in that: The steps include: Step 1, input construction: collect trajectory data and driving data of surrounding vehicles and the vehicle itself as the original input of the diffusion model; Step 2, divide the optimal segment length: Use the greedy strategy to divide the segments and obtain the optimal trajectory length under different conditions; The specific implementation of step 2 includes: The length of the optimal segments is adaptively determined through a greedy segmentation strategy, and they are divided into K different clusters. After appropriate scaling in both duration and amplitude dimensions, the segments within the same cluster have similar shapes and trends, and the centroid of each cluster represents the invariant scale pattern in the trajectory sequence; Compare each assessment location Different candidate sequence lengths s∈[s min ,s max ], the length closest to the centroid is recorded as the best segmentation of the current segment Right now Where n is the total number of fragments, p δ is the candidate sequence for the δth segment, represents the optimal segment length determined by the greedy segmentation method, G p:p+s Represents the length of any segment, s * is the optimal segment length, C is the scale-invariant cyclic pattern, and r(·,·) is the distance metric; Dynamic Time Warping (DTW) is used to calculate the minimum cost of point-by-point alignment between two segments. DTW(s i ,s j )=min d∈D <d,Δ(s i ,s j )> Where d represents the consistency between two sequences in all possible permutations set D, Δ(s i ,s j ) are two sequences s i and j The point-wise distance matrix between ; Step 3, constructing a diffusion model: Based on the segment lengths divided in step 2, a diffusion model DiTransformer is constructed using Transformer; Step 4, model training: Use different vehicle behavior data to train the diffusion model DiTransformer; Step 5, trajectory data editing: based on the model training results of step 4, perform data editing operations on the vehicle trajectory data sequence; Step 6, Evolution model construction: Use multi-layer perceptron (MLP) and spatiotemporal fusion Transformer to build the trajectory data evolution model; Step 7, trajectory generation: Use the data edited in step 5 to learn through the trajectory data evolution model to obtain the pattern, length and amplitude of the next segment, and then obtain a new segment through diffusion and editing again, and combine it with the current data to synthesize the vehicle trajectory.

2. The method for generating autonomous driving vehicle trajectories based on adaptive segmentation and data evolution of a diffusion model according to claim 1, characterized in that: The step 1 also includes preprocessing the collected data, specifically including: (1) Data cleaning: Process missing values, outliers, and erroneous data to ensure data quality and integrity; (2) Feature selection: Selection refers to selecting features with higher importance and relevance, thereby reducing the dimensionality of features; (3) Encoding normalization: The collected data is represented by embedding so that the model can be used directly; normalization is to process the values ​​of different features to make them consistent in range.

3. The method for generating autonomous driving vehicle trajectories based on adaptive segmentation and data evolution of a diffusion model according to claim 1, characterized in that: The implementation of step 3 is to obtain a diffusion Transformer model by modifying the original Transformer module. The specific modifications are as follows: (1) Adding adaptive layer normalization (AdaLN) before the multi-head attention mechanism; (2) Adding adaptive layer normalization before the forward propagation layer; (3) Add parallel multi-layer perceptron (MLP) processing.

4. The method for generating autonomous driving vehicle trajectories based on adaptive segmentation and data evolution of a diffusion model according to claim 3, characterized in that: The steps of constructing the diffusion model DiTransformer in step 3 are as follows: Step 3.1, embed the input sequence I and add position information; I embedding =EmbeddingLookup(I)+PositionalEncoding Among them, I embedding is the sequence after embedding representation, EmbeddingLookup is the embedding query function, and PositionalEncoding is the position encoding function; Step 3.2, performing adaptive normalization operation on the input sequence; Among them, AdaLN(I embedding ) is the normalized result, γ and β are learnable parameters used to adjust the normalization scaling and bias, μ and σ are the mean and standard deviation of the input respectively; Step 3.3, put the input sequence into the self-attention layer to generate a new vector, and obtain three different vectors by multiplying different weight matrices, and perform self-attention calculation on the three different vectors; I attention =Attention(Q,K,V) Among them, I attention is the result of self-attention calculation, Attention is the self-attention algorithm, Q, K, and V are query, key, and value respectively; Step 3.4, put the generated self-attention vector into the multi-attention mechanism layer for calculation; MultiHead(Q,K,V)=Concat(I attention_1 ,...,I attention_h )W O Among them, W O is the weight matrix, I attention_1 ,...,I attention_h Represents the self-attention vectors of different heads, g represents the number of attention mechanism layers, MultiHead(Q,K,V) is the calculation result of multiple attention mechanism layers, and Concat represents the concatenation operation; Step 3.5: Make a residual connection between the input sequence and the output of the multi-attention mechanism and normalize them; I attention_i =I+I attention_i I attention_i =LayerNorm(I attention_i ) Where LayerNorm is the normalization function, i = 1, 2, ... h, and I is the original input sequence; Step 3.6, adaptive normalization calculation is performed again on the residual connection and normalized results; Step 3.7, input the output result of step 3.6 into the feedforward network; FFN(I attention_i )=max(0,I attention_i ×W1+b1)W2+b2 Among them, FFN is the forward propagation operation, W1 and W2 are the weights of the two fully connected layers, b1 and b2 are the biases of the two fully connected layers, and I attention_i is the self-attention vector of the i-th head; Step 3.8, perform residual connection and normalization operations on the output of the feedforward network and the output of step 3.4; The steps to build a parallel MLP are: Step 3.9, embed the input sequence and add position information; I embedding =EmbeddingLookup(I)+PositionalEncoding Among them, I embedding is the sequence after embedding representation, EmbeddingLookup is the embedding query function, and PositionalEncoding is the position encoding function; Step 3.10, pass the input sequence to the hidden layer, which is a fully connected layer, and the calculation is as follows: in, is the output of the fully connected layer, n (l-1) is the number of neurons in the previous layer, is the weight connecting the i-th upper layer neuron and the j-th hidden layer neuron, represents the output of the l-1th layer of neurons, is the bias of the jth hidden layer neuron, f(·) is the activation function of the hidden layer, is the final output; In step 3.11, the output of the hidden layer is passed to each layer in the Transformer according to different weights and biases.

5. The method for generating autonomous driving vehicle trajectories based on adaptive segmentation and data evolution of a diffusion model according to claim 1, characterized in that: The specific steps of step 4 for training the diffusion model include: Step 4.1: add noise to the data. The noise adding process is modeled as follows: in, represents a set of real numbers, n is the number of trajectory segments, s is the time step, and d is the factor dimension; g p is the segment of the trajectory at position p, g0 is the initial trajectory segment, α i is the signal retention strength at position i, p is the position, g is p Approximately is a Gaussian distribution, I represents the unit matrix, The diagonal elements are The covariance matrix of Step 4.2, accelerate sampling and model the denoising process as follows: in, Among them, p θ is the distribution estimate of q above, g p is the trajectory segment at position p, g p-1 is the previous trajectory segment, ∈ θ is the trainable noise term in the distribution process, β p Controls the size of the additional noise, V represents the variance of the Gaussian distribution, μ θ (g p ,p) means that at position p, from the noisy trajectory segment g p Infer the previous segment g p-1 The mean of α i is the signal retention strength at position i, p is the position, g represents the original trajectory segment, ∑ q (p) represents the position p, according to the noisy trajectory segment g p Infer the previous step fragment g p-1 The variance of Step 4.3, construct the optimization function as follows: Among them, Loss is the loss value, Indicated in p~Uniform condition, g0~q(g0) means g0 is extracted from q(g0), Uniform means uniform distribution, ∈ and ∈ θ represents the noise term, ∈ θ (g p ,p) is the model prediction noise term, the noise vector predicted according to the current trajectory segment and position, ∈ is the data noise actually added during the diffusion process; Step 4.4, use the DDIM principle to accelerate reasoning, as follows: Among them, σ represents the degree of random process, q σ (g 1:P |g0) means that under the condition of the initial segment g0, g 1:P The distribution of g 1:P represents all trajectory segments from position 1 to position P, q σ (g P |g0) means that under the condition of the initial segment g0, g P The distribution of q σ (g p-1 ∣g p ,g0) indicates that between the initial segment g0 and the segment g p Under the condition of g P-1 distribution.

6. The method for generating autonomous driving vehicle trajectories based on adaptive segmentation and data evolution of a diffusion model according to claim 1, characterized in that: The method for editing the trajectory data in step 5 is: in, represents the noise term predicted based on the current trajectory segment, position and condition vector, ω free represents the bootstrapping strength without predictor bootstrapping, ω free represents the case without predictor guidance, c is the conditional vector, is a learnable zero vector, represents the noise term predicted under the unconditional vector, representing the overall distribution of the learned trajectory segments, ∈ θ (g p ,c) represents the predicted noise term given the conditional vector c, which represents the distribution of the learned conditional information.

7. The method for generating autonomous driving vehicle trajectories based on adaptive segment division and data evolution of a diffusion model according to claim 1, characterized in that: The implementation of step 6 includes: The MLP model is constructed as follows: z (1) =gW (1) +b (1) and (1) =ReLU(from (1) ) z (2) =a (1) W (2) +b (2) Among them, z (l) represents the weighted input of the lth layer, a (l) represents the activation output of layer l, W (l) and b (l) They represent the weight and bias of the lth layer respectively, l = 1, 2, ReLU is a nonlinear activation function, and finally the hidden layer output is processed according to the task type; The spatiotemporal fusion Transformer is used to predict the trajectory of time series, and its construction steps are as follows: Step 6.1, construct the gated residual network GRN as follows: GRN ω (a,c)=LayerNorm(a+GLU ω (η1)) η1=W 1,ω η2+b 1,ω η2=ELU(W 2,ω a+W 3,ω c+b 2,ω ) Among them, a is a main input, e is an optional context vector, η1 and η2 are intermediate layers, and W 1,ω represents the linear transformation matrix from the intermediate layer η2 to η1, W 2,ω represents the linear transformation matrix from the main input a to the intermediate layer η2, W 3,ω represents the linear transformation matrix from the context vector e to the intermediate layer η2, ω is the exponent representing weight sharing, b is the bias, and b 1,ω represents the bias vector from the middle layer η2 to η1, b 2,ω is the bias vector from the main input a and the context vector e to the intermediate layer η2, ELU is the exponential linear unit activation function, and GLU is the gated linear unit; Step 6.2, construct the variable selection network as follows: in, represents the output of the gated residual network, which receives two inputs, is the variable selection weight vector, e s represents the context vector generated from the static covariate encoder, Ξ t is the flattened vector of all past inputs; Step 6.3, construct a static covariate encoder, the output is c s ,as follows: Among them, ζ is the output of the variable selection network; Step 6.4, construct an interpretable multi-head attention mechanism InterpretableMultiHead as follows: Among them, Q, K, V are key, query and value respectively, and W H is the weight, for all heads; Step 6.5, construct a temporal fusion decoder, which mainly includes a sequence-to-sequence layer, a static enrichment layer, a temporal self-attention layer, and a position feedforward layer.

8. The method for generating autonomous driving vehicle trajectories based on adaptive segmentation and data evolution of a diffusion model according to claim 1, characterized in that: In step 7, the learning process is as follows: Where φ is the learning network, r is the mode, l is the length, and f is the amplitude scaling factor. are the parameters after evolution, r n Indicates the current fragment mode, l n is the current segment length, f n is the current fragment amplitude scaling factor; The optimization objective of learning is converted into minimizing the loss function Loss(φ), as follows: in, is the cross entropy calculation, represents the expected value of all training segments.

9. A system for generating trajectory of an autonomous driving vehicle based on the method of adaptive segmentation and data evolution based on diffusion model according to claim 1, characterized in that: It includes data acquisition module, data preprocessing module, trajectory data partitioning module, data diffusion model, data editing model and data evolution module; Data acquisition module, including cameras, lidar and ultrasonic radar perception devices, used to collect vehicle trajectory data and driving data; The data preprocessing module cleans, selects features, and performs encoding normalization operations on the collected data; The trajectory data partitioning module divides the acquired trajectory data by length, and uses a greedy partitioning strategy to divide the acquired historical trajectory data into segments of variable length and group them into different clusters. The segments within the same cluster present similar shapes after appropriate duration and amplitude scaling. Then, the centroid of each cluster represents the scale-invariant pattern in the financial time series. Using the centroid initialization method, a segment is first randomly selected from all available segments of a pre-specified length as the first centroid, and then subsequent centroids are selected from the remaining segments. The selection weights are proportional to their distance to the nearest centroid in the selected set. The data diffusion model includes the denoising process and the denoising process. The denoising process follows the DDPM (Denoising Diffusion Probabilistic Models) principle, and gradually transforms the initial noise distribution into the conditional probability distribution of the target data through a series of diffusion steps. This process is achieved by maximizing the likelihood of the data. The denoising process follows the DDIM (Diffusion Deformable Implicit Models) principle. This process is an autoregressive model that starts with the initial noise data and gradually deforms the target data through multiple steps. In addition, there is a parallel MLP structure to initialize the model parameters to 0. At this time, the Transformer block becomes an identity function, and the input block is directly passed to the next layer. The structure of the data editing model is the same as that of the diffusion model. The number of noise addition steps in the actual editing process is less than the number of initialization steps. The data evolution module treats the modeling of the next segment pattern as a multi-classification problem, and the learning of the length scaling factor and the amplitude scaling factor as a regression problem. The state between consecutive segments is modeled through a fully connected neural network with multiple outputs, and the network is trained using the Adam optimizer; Then, the data diffusion model and the data editing model are used to generate the vehicle trajectory data, which is continuously appended to finally generate a real-time vehicle trajectory.

Citation Information

Patent Citations

  • Multi-target ship tracking method and system

    CN115719368A

  • Method and system for predicting surrounding vehicle behavior of automatic driving emergency rescue vehicle based on multi-intention guiding comparative learning

    CN118193953A

Cited By

  • Trajectory generation method based on diffusion model

    CN120123770A