A multimodal trajectory prediction method by paying attention to scene and state
By paying attention to the scene and agent status through mechanisms such as fully convolutional neural networks and Transformers, the accuracy and multi-modality problems of trajectory prediction in complex traffic scenes in autonomous driving are solved, the prediction accuracy and acceptability are improved, and the prediction accuracy and acceptability are improved. Multiple accurate trajectories and their probabilities.
Patent Information
- Application Number
- CN202210142283.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-16
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-02-16
AI Technical Summary
Existing autonomous driving trajectory prediction methods have insufficient accuracy and generalization capabilities in complex traffic scenarios, ignore environmental conditions and traffic rules, and cannot effectively capture the essence of multi-modal trajectories, resulting in inaccurate prediction results and poor social acceptability. .
Use a fully convolutional neural network to extract scene information and use affine transformation to focus on the target agent. Combined with Transformer and multi-head attention mechanism, it captures the relationship between the agent's historical state and scene information, and generates multiple accurate future trajectories and their probabilities. .
It improves the accuracy and social acceptability of trajectory prediction, avoids semantic annotation occlusion and data redundancy, and can generate multiple acceptable trajectories and their related probabilities in complex scenes.
Smart Images

Figure CN114707630B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of autonomous driving, and in particular relates to a method for predicting multimodal trajectories of an intelligent agent. Background Art
[0002] In recent years, artificial intelligence (AI) has achieved unprecedented development. Autonomous driving technology has now become one of the most promising applications in the field of artificial intelligence. It is believed that its impact on human society's production and lifestyle will be no less than the birth of the car a hundred years ago. At present, autonomous driving technology is not yet mature, and intelligent vehicles need to share the same traffic scenarios with human drivers. In order to drive safely and efficiently, intelligent vehicles must not only know what objects exist around them, but also predict the trajectory of the surrounding intelligent bodies (vehicles, cyclists, pedestrians, etc.). This is the trajectory prediction problem in the field of autonomous driving.
[0003] Trajectory prediction is an intermediate link between autonomous driving environment perception and decision-making planning. It accurately predicts the future trajectory of the intelligent agent in dynamic, interactive, and uncertain scenarios. It is of great significance for autonomous vehicles to deeply understand the surrounding environment and make decisions, and to ensure the stability, safety, and economy of vehicle driving. However, due to the randomness of the intelligent agent's movement, the complexity of the interaction, and the multimodality of the future trajectory distribution, trajectory prediction is a very challenging task. In order to solve the trajectory prediction problem, methods based on dynamics and kinematics were first proposed, but these methods have poor accuracy and generalization ability, so they are only suitable for short-term trajectory prediction in simple driving scenarios. In recent years, trajectory prediction methods based on deep learning have become popular. Among them, there are methods that only capture the interaction information between agents based on the historical trajectory of the agent and by designing various interaction mechanisms, but they ignore other important factors that affect the movement of the agent, such as environmental conditions and traffic rules, which may lead to unacceptable prediction results in complex traffic scenarios, and most methods only produce one predicted trajectory, which is not in line with the multimodal nature of future movement; there are also end-to-end methods that only use convolutional neural networks (CNNs) to extract the state information and scene information of the agent from sequence images. Although CNN is good at processing spatial dependencies, it lacks a mechanism for modeling sequence data, and trajectory prediction requires modeling the dependency of the state of the agent over time; there are also methods that use historical trajectories and scene information for trajectory prediction at the same time, but they do not use any attention mechanism, which makes it impossible for the model to accurately understand which are the most important factors affecting future movement, usually resulting in data redundancy and model spatial complexity, and ultimately inaccurate prediction results and poor social acceptability. Summary of the invention
[0004] In order to solve the above problems existing in the prior art, the present invention proposes a multimodal trajectory prediction method by paying attention to scenes and states, which can generate multiple socially acceptable trajectories and their related probabilities.
[0005] In order to achieve the above object, the specific technical solution of the present invention is as follows: A multimodal trajectory prediction method by paying attention to scenes and states comprises the following steps:
[0006] A. Fully convolutional neural network extracts scene information and uses affine transformation to focus on the target agent
[0007] A1. Construct a composite raster map. First, render the environment information on a high-definition map from a bird's-eye view to preserve the size and position of the agents and the geometric features of the roads, and ignore their textures. In order to reflect the dynamic interaction between agents and the environment, and to avoid semantic annotation occlusion and data redundancy, multiple continuous original rasterized high-precision maps are split and reassembled to obtain a composite raster map. H is the length of the composite grid image, W is the width of the composite grid image, and C is the number of channels.
[0008] A2: Fully convolutional neural network extracts scene information and interaction information. The composite grid map obtained from step A1 is obtained using a fully convolutional neural network (FCN). Learn representative topological information, semantic information and interaction information. The formula for extracting information using FCN is as follows:
[0009]
[0010] Where FCN(·) is a fully convolutional neural network, is a composite grid map, W s are the weights of the fully convolutional neural network.
[0011] In order to reduce model parameters, the convolutional neural network (CNN) inside FCN uses MobileNetV2. Using FCN can not only obtain scene and interaction information, but also keep the size of the input image consistent with the output feature map, so that the target agent is focused on according to its initial position.
[0012] A3. Focus on the target agent. Agents usually pay more attention to objects that are closer to them and more interactive, so the feature map is obtained in step A2. After that, a small feature map is cropped according to the position of the target agent Let's pay attention to it. After getting the small feature map Then, the affine transformation is used to rotate a certain angle according to the orientation of the agent to normalize the orientation of the agent. The formulas of the affine transformation and affine matrix are shown in equations (2) and (3):
[0013]
[0014]
[0015] Where Affine(·) is the affine transformation function, θ is the affine matrix, and h is the orientation of the agent.
[0016] B. Use Transformer to encode the historical state of the agent
[0017] Before using Transformer to encode the historical state information, the state information is first connected together, and then a multi-layer perceptron (MLP) is applied to embed the state information into a high-dimensional space to obtain f t With a fixed size, the final f t Embedded in a higher dimensional space to obtain F a , the formula for embedding state information into high-dimensional space using MLP and embedding into higher-dimensional space using embedding matrix is as follows:
[0018] f t =MPL(concat(x t ,y t ,v t ,sin(h),cos(h)) (4)
[0019] F a =f t ·W f (5)
[0020] In the formula, (x t ,y t ) is the position coordinate of the agent, v t is the speed of the agent, h is the orientation of the agent, concat(·) is the connection function, MPL(·) is the multilayer perceptron, and W f is the embedding matrix, t is the timestamp. The historical state information includes position, speed and orientation.
[0021] Transformer's "position encoding" is used to time encode each past time instant t. The position encoding formula is as follows:
[0022]
[0023]
[0024] I a =F a +P a (8)
[0025] Where d is the data dimension and D is the model embedding dimension.
[0026] In order to capture the inherent potential dependencies between the historical states of the agent, we first a Perform three linear projection transformations to obtain three matrices, namely Q a =W q I a ,K a =W k I a and V a =W v I a , where W q It's Q a The projection matrix, W k It's K a The projection matrix, W v Yes V a Then, the self-attention mechanism is used to obtain the intrinsic relationship between the historical states of the agent. Finally, the feedforward network is used to obtain the final representation E of the historical state of the agent a The self-attention mechanism formula (9) and the feedforward network formula (10) are as follows:
[0027]
[0028] E a =FFN(Att(Q a ,K a ,V a )) (10)
[0029] Where softmax(·) is the softmax function, Att(·) is the multi-head self-attention, FFN(·) is the feedforward network, It's K a Dimension.
[0030] C. Feature Fusion and Decoding
[0031] C1. Feature fusion. In step A3, the cropped feature map is obtained. After that, the scene information is further extracted using depthwise separable convolution, i.e. Where DSC(·) is a depth-separable convolution. Then, MLP is used to process the historical state E of the agent. a Dimensionality reduction is performed to obtain K′ and V′, as shown in formula (11). Finally, the multi-head attention mechanism is used to fuse the scene information Q′ extracted by the depth-separable convolution and the state information K′ and V′ after dimensionality reduction to obtain the fusion feature I, as shown in formulas (12) and (13), where formula (12) is an attention head function, and formula (13) is to connect 8 attention head functions. The formula is as follows:
[0032] K′=V′=MLP(E a ) (11)
[0033]
[0034] I=Concat(head1,…,head8) (13)
[0035] In the formula, MLP(·) is a multilayer perceptron, K′ is the key value of the state information after dimensionality reduction, V′ is the value of the state information after dimensionality reduction, and head i is the attention head, Softmax(·) is the softmax function, is the projection matrix of Q′, is the projection matrix of K′, is the projection matrix of V′, d K′ is the dimension of K′, and Concat(·) is the concatenation function.
[0036] C2. Fusion feature decoding. The fusion feature I is input into the regression branch and the classification branch respectively, and finally K predicted trajectories and their related probabilities are obtained. The formula of the regression branch is as follows (14), and the formula of the classification branch is as follows (15) and (16):
[0037]
[0038] logit=MLP2{Concat(OK ,reg ,MLP1(I))} (15)
[0039]
[0040] Where MLP1(·), MLP2(·) and MLP3(·) are 1-layer, 2-layer and 3-layer multilayer perceptrons respectively. is the kth predicted trajectory, is the probability of the kth predicted trajectory.
[0041] Compared with the prior art, the beneficial effects and benefits of the present invention are as follows:
[0042] 1. The present invention performs multimodal trajectory prediction by paying attention to the scene and state, and comprehensively considers the information of the scene context and the historical state information of the intelligent agent to generate multiple accurate and acceptable future trajectories and their probabilities.
[0043] 2. The present invention utilizes a unique scene representation method and affine transformation to avoid the problems of semantic annotation occlusion and data redundancy.
[0044] 3. The present invention combines three attention mechanisms (affine transformation, i.e., hard attention mechanism, Transformer's self-attention mechanism, and multi-head attention mechanism) to fuse scene information and state information. Compared with traditional trajectory prediction methods, it improves prediction accuracy and social acceptability.
[0045] 4. In summary, the present invention comprehensively considers the historical state information and surrounding environment information of the intelligent agent, and combines three attention mechanisms to extract and fuse these two types of information, namely, the self-attention mechanism of Transformer captures the potential relationship between historical states; the affine transformation cuts key positions from the feature map, namely the hard attention mechanism to focus on specific intelligent agents; the multi-head attention mechanism can effectively capture the interactive information between the state and the scene. Finally, a multimodal trajectory prediction method by paying attention to the scene and state is generated, which generates multiple socially acceptable trajectories and their related probabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The present invention has 4 attached sheets, among which:
[0047] Figure 1 Flowchart of the multimodal trajectory prediction method by paying attention to scene and state.
[0048] Figure 2 This is a model structure diagram of the multimodal trajectory prediction method by paying attention to the scene and state.
[0049] Figure 3 It is a composite raster map.
[0050] Figure 4 It is the structure diagram of the fully convolutional neural network FCN. DETAILED DESCRIPTION
[0051] The specific implementation of the present invention is described in detail below with reference to the accompanying drawings. Figure 1 As shown, a multimodal trajectory prediction method by paying attention to scenes and states includes the following steps:
[0052] A. Fully convolutional neural network extracts scene information and uses affine transformation to focus on the target agent
[0053] A1. Construct a composite grid map. Accurately predicting the trajectory of a target not only takes into account the historical state information of the target agent, but also the scene semantic information, such as Figure 2 As shown in the figure, the environment information is rendered on a high-definition map from a bird's-eye view. The advantage of this is the simplicity of representing context information, while retaining the size and position of the agent and the geometric features of the road, and ignoring their texture. In order to reflect the dynamic interaction between agents and the environment, and to avoid semantic annotation occlusion and data redundancy, the original rasterized high-precision map is split into Figure 3As shown, each image only takes the information of one channel, and finally stacks all the channels together to obtain a composite raster map. H=512 is the length of the composite grid image, W=512 is the width, and C=6 is the number of channels.
[0054] A2, fully convolutional neural network extracts scene information and interaction information. The fully convolutional neural network FCN can combine shallow and fine appearance information with deep and coarse semantic information to obtain a composite rasterized map from A1. Learn representative topological information, semantic information and interaction information, and use the formula of FCN to extract information as follows:
[0055]
[0056] In the formula, FCN(·) is a fully convolutional network, is a composite grid map, W s Weights of a fully convolutional network.
[0057] In order to reduce model parameters, the CNN network inside the fully convolutional neural network FCN chooses to use a lightweight network MobileNetV2 that not only has good performance but also has fewer parameters. The 7th, 14th, and 19th layers of MobileNetV2 are connected to the output of the deconvolution using skip connections to obtain feature maps. Specific visible Figure 4 Utilizing FCN not only obtains the interactions between agents and between agents and the environmental context, but more importantly, it keeps the size of the input composite grid map consistent with the output feature map, so that the target agent can be focused on according to its initial position.
[0058] A3. Focus on the target agent. Agents usually pay more attention to objects that are closer to them and more interactive, so most of the information in the entire map is useless to a single agent. After that, a small feature map is cropped according to the position of the target agent In addition, the orientation of the agent is also valuable information. Then, according to the orientation of the agent, the agent is rotated by a certain angle using affine transformation to unify the orientation of the agent. The formulas of affine transformation and affine matrix are as follows (2) and (3):
[0059]
[0060]
[0061] Where Affine(·) is the affine transformation function, θ is the affine matrix, and h is the orientation of the agent.
[0062] B. Use Transformer to encode the historical state of the agent
[0063] Before using Transformer to encode the historical state information of the target agent, i.e., position, speed, and orientation, all the state information is first connected together, and then a multi-layer perceptron (MLP) is applied to embed the state information into a high-dimensional space (16 dimensions) to obtain With a fixed input size, finally is embedded into a higher dimensional (64-dimensional) space to obtain F a , the formula for embedding state information into high-dimensional space using MLP and embedding into higher-dimensional space using embedding matrix is as follows:
[0064] f t =MPL(concat(x t ,y t ,v t ,sin(h),cos(h)) (4)
[0065] F a =f t ·W f (5)
[0066] In the formula, (x t ,y t ) is the position coordinate of the agent, v t is the speed of the agent, h is the orientation of the agent, concat(·) is the connection function, MPL(·) is the multilayer perceptron, and W f is the embedding matrix and t is the timestamp.
[0067] Transformer's "position encoding" is used to time-encode the state of each past time instant t. The formula for position encoding is as follows:
[0068]
[0069]
[0070] I a =F a +P a (8)
[0071] Where d = 64 is the data dimension and D = 512 is the model embedding dimension.
[0072] In order to capture the inherent potential dependencies between the historical states of the agent, we firsta Perform three linear projection transformations to obtain three matrices, namely Q a =W q I a ,K a =W k I a and V a =W v I a , where W q It's Q a The projection matrix, W k It's K a The projection matrix, W v Yes V a Then, the multi-head self-attention mechanism is used to obtain the intrinsic relationship between historical states. Finally, the feedforward network is used to obtain the representation E of the historical state a , the dimension is 2048. The self-attention mechanism formula and feedforward network formula are as follows:
[0073]
[0074] E a =FFN(Att(Q a ,K a ,V a )) (10)
[0075] Where softmax(·) is the softmax function, Att(·) is the multi-head self-attention, FFN(·) is the feedforward network, It's K a Dimension.
[0076] When encoding the historical state of the agent, three encoder layers of Transformer are used, each with 64 hidden units and 8 attention heads.
[0077] C. Feature Fusion and Decoding
[0078] C1, feature fusion. The cropped features are obtained in step A3. After that, the depth-wise separable convolution is used to further extract features to obtain scene information, that is, Where DSC(·) is a depth-wise separable convolution with 4 hidden layers. Then, MLP is used to analyze the historical state E of the agent. aThe dimension is reduced to 32 to obtain K′ and V′, as shown in formula (11). Finally, the multi-head attention mechanism is used to fuse the scene information Q′ extracted by the depthwise separable convolution and the state information K′ and V′ after dimensionality reduction to obtain the fusion feature I, as shown in formulas (12) and (13), where (12) is an attention head function and (13) is to connect 8 attention head functions. The formula is as follows:
[0079] K′=V′=MLP(E a ) (11)
[0080] ,i=1,…,8 (12)
[0081] I=Concat(head1,…,head8) (13)
[0082] In the formula, MLP(·) is a multilayer perceptron, K′ is the key value of the state information after dimensionality reduction, V′ is the value of the state information after dimensionality reduction, and head i is the attention head, Softmax(·) is the softmax function, is the projection matrix of Q′, is the projection matrix of K′, is the projection matrix of V′, d K′ =32 is the dimension of K′, and Concat(·) is the concatenation function.
[0083] C2. Fusion feature decoding. The fusion feature I is input into the regression branch and the classification branch respectively, and finally K predicted trajectories and their related probabilities are obtained. The formula of the regression branch is as follows (14), and the formula of the classification branch is as follows (15) and (16):
[0084]
[0085] logit=MLP2{Concat(O K,reg ,MLP1(I))} (15)
[0086]
[0087] Where, MLP1(·), MLP2(·) and MLP3(·) are 1-layer, 2-layer and 3-layer MLPs respectively. is the kth predicted trajectory, is the probability of the kth predicted trajectory.
[0088] The present invention is not limited to this embodiment, and any equivalent concepts or changes within the technical scope disclosed by the present invention are included in the protection scope of the present invention.
Claims
1. A multimodal trajectory prediction method by paying attention to scenes and states, characterized by: The following steps are involved: A. Fully convolutional neural network extracts scene information and uses affine transformation to focus on the target agent A1. Construct a composite raster map. First, render the environment information on a high-definition map from a bird's-eye view to retain the size and position of the agents and the geometric features of the roads, and ignore their textures. In order to reflect the dynamic interaction between agents and the environment, and to avoid semantic annotation occlusion and data redundancy, multiple continuous original rasterized high-precision maps are split and reassembled to obtain a composite raster map. H is the length of the composite grid image, W is the width of the composite grid image, and C is the number of channels; A2: Fully convolutional neural network extracts scene information and interaction information; the composite grid map obtained from step A1 is obtained using the fully convolutional neural network (FCN) Learn representative topological information, semantic information and interaction information. The formula for extracting information using FCN is as follows: Where FCN(·) is a fully convolutional neural network, is a composite grid map, W s is the weight of the fully convolutional neural network; In order to reduce model parameters, the convolutional neural network (CNN) inside FCN uses MobileNetV2. FCN can not only obtain scene and interaction information, but also keep the size of the input image consistent with the output feature map, so that the target agent can be focused on according to its initial position. A3, focus on the target agent; the agent usually pays more attention to those objects that are closer to itself and more interactive, so the feature map is obtained in step A2 After that, a small feature map is cropped according to the position of the target agent Let's pay attention to it; after getting the small feature map Then, the affine transformation is used to rotate a certain angle according to the orientation of the agent to normalize the orientation of the agent. The formulas of the affine transformation and affine matrix are shown in equations (2) and (3): Where Affine(·) is the affine transformation function, θ is the affine matrix, and h is the orientation of the agent; B. Use Transformer to encode the historical state of the agent Before using Transformer to encode the historical state information, the state information is first connected together, and then a multi-layer perceptron (MLP) is applied to embed the state information into a high-dimensional space to obtain f t With a fixed size, the final f t Embedded in a higher dimensional space to obtain F a , the formula for embedding state information into high-dimensional space using MLP and embedding into higher-dimensional space using embedding matrix is as follows: f t =MPL(concat(x t ,y t ,v t ,sin(h),cos(h)) (4) F a =f t ·W f (5) In the formula, (x t ,y t ) is the position coordinate of the agent, v t is the speed of the agent, h is the orientation of the agent, concat(·) is the connection function, MPL(·) is the multilayer perceptron, and W f is an embedding matrix, t is a timestamp; the historical state information includes position, speed and orientation; Transformer's "position encoding" is used to time encode each past time instant t. The position encoding formula is as follows: I a =F a +P a (8) Where d is the data dimension and D is the model embedding dimension; In order to capture the inherent potential dependencies between the historical states of the agent, we first a Perform three linear projection transformations to obtain three matrices, namely Q a =W q I a , K a =W k I a and V a =W v I a , where W q It's Q a The projection matrix, W k It's K a The projection matrix, W v Yes V a Then, the self-attention mechanism is used to obtain the intrinsic relationship between the historical states of the agent; finally, the feedforward network is used to obtain the final representation E of the historical state of the agent a ; The self-attention mechanism formula (9) and the feedforward network formula (10) are as follows: E a =FFN(Att(Q a ,K a ,V a )) (10) Where softmax(·) is the softmax function, Att(·) is the multi-head self-attention, FFN(·) is the feedforward network, It's K a Dimensions; C. Feature Fusion and Decoding C1, feature fusion; In step A3, we obtain the cropped feature map. After that, the scene information is further extracted using depthwise separable convolution, i.e. Where DSC(·) is a depth-separable convolution; then, MLP is used to process the historical state E of the agent. a Dimensionality reduction is performed to obtain K′ and V′, as shown in formula (11); finally, the multi-head attention mechanism is used to fuse the scene information Q′ extracted by the depthwise separable convolution and the state information K′ and V′ after dimensionality reduction to obtain the fusion feature I, as shown in formulas (12) and (13), where formula (12) is an attention head function, and formula (13) is to connect 8 attention head functions, as shown in the following formula: K′=V′=MLP(E a ) (11) I=Concat(head1,...,head8) (13) In the formula, MLP(·) is a multilayer perceptron, K′ is the key value of the state information after dimensionality reduction, V′ is the value of the state information after dimensionality reduction, and head i is the attention head, Softmax(·) is the softmax function, is the projection matrix of Q′, is the projection matrix of K′, is the projection matrix of V′, d K′ is the dimension of K′, Concat(·) is the concatenation function; C2, fusion feature decoding; the fusion feature I is input into the regression branch and the classification branch respectively, and finally K predicted trajectories and their related probabilities are obtained. The formula of the regression branch is as follows (14), and the formula of the classification branch is as follows (15) and (16): logit=MLP2{Concat(O K,reg ,MLP1(I))} (15) Where MLP1(·), MLP2(·) and MLP3(·) are 1-layer, 2-layer and 3-layer multilayer perceptrons respectively. is the kth predicted trajectory, is the probability of the kth predicted trajectory.
