A trajectory prediction method and device based on semantic consistency
The characteristics of agent trajectories and scene images are mapped to the public space through the context-aware module and convolutional neural network, which solves the problem of differences in trajectory prediction, achieves more accurate and consistent trajectory prediction, and satisfies social rules and physical constraints.
Patent Information
- Application Number
- CN202210354433.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-06
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-04-06
AI Technical Summary
Existing trajectory prediction methods fail to effectively eliminate the differences between the agent and the physical environment of the scene, the social interaction relationship, and the scene interaction, causing the performance of the prediction model to be affected.
The context-aware module is used to encode the agent trajectory and scene image through the physical migration sub-module and the social migration sub-module, obtain activity semantics and social interaction relationships, map different modal features to the public space through the convolutional neural network, and use context decoding after fusion The machine generates predicted trajectories and uses the loss function for end-to-end training to ensure that the predicted trajectories comply with social rules and physical constraints.
It effectively eliminates the differences in scene physical environment, social interaction relationships and scene interaction, improves the accuracy and consistency of trajectory prediction, satisfies social rules and physical constraints, and improves the performance of the prediction model.
Smart Images

Figure CN114882426B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of trajectory prediction, and in particular to a trajectory prediction method and device based on semantic consistency. Background Art
[0002] Trajectory prediction is to predict the future trajectory coordinates based on the historical trajectory coordinates of the intelligent agent and the dynamic changes of the surrounding physical environment. Trajectory prediction is widely used in the fields of behavior understanding and analysis, target detection and tracking, and unmanned driving.
[0003] The existing technology is mainly based on the characterization of interactions. In the trajectory prediction task, interaction refers to a feedback of the target agent (prediction object) on the influence of other external factors (other agents, physical environment, etc.), such as: the motion state of other agents will affect the future behavior of the target agent. Similarly, the topological structure of the scene (for example: the distribution of buildings) will also affect the motion trajectory of the agent. Therefore, the interaction relationship mainly includes social interaction (Social Interaction) relationship and scene interaction (Scene Interaction) relationship. The interaction between agents is usually called social interaction, and the interaction between agents and the physical environment is called scene interaction.
[0004] Methods based on social interaction only consider the influence of agents, mainly including: S-LSTM, S-Att, CIDNN, STGCNN, S-BiGAT. Among them, S-LSTM introduces "Social-Pooling" and uses the Long Short-Term Memory (LSTM) network to share the spatial location information between agents to learn local social interaction relationships. However, S-LSTM does not distinguish the importance of other agents' influence on the target agent. S-Att and CIDNN use soft attention mechanism and spatial affinity respectively to measure the importance of other agents' influence on the target agent, and further learn the social interaction relationship in the scene. Another type of method uses Graph Neural Network (GNN) to describe the social interaction relationship between agents. For example, STGCNN uses a spatiotemporal graph convolutional network, and S-BiGAT uses a spatiotemporal graph attention network.
[0005] In addition to considering social interaction, methods based on social interaction and scene interaction focus more on how to obtain scene semantics from scene images, mainly including: Sophie, NEXT. Sophie extracts visual features from scene images through convolutional neural networks (CNN) to obtain scene semantics. NEXT uses semantic segmentation technology to obtain segmentation maps of scene images to obtain pixel-level semantic categories. These methods characterize the scene interaction relationship between the intelligent agent and the physical environment through scene semantics.
[0006] Although existing methods use two different modal data, trajectory and image, to jointly describe the impact of social interaction and obtain the future trajectory coordinates of the target agent in this way, most methods do not semantically unify the two different modal features. Therefore, there is a "gap" when modeling the influencing factors of different modalities in the above methods. There are mainly three types of gaps. Specifically, they include (1) Physical Gap: The changes in the prediction scene are flexible and changeable. Factors such as the density of pedestrian and vehicle traffic, the appearance and distribution of buildings vary greatly. At the same time, even the same scene objects may play different roles in different prediction scenes. These differences will make the modeling of scene interactions difficult. (2) Social Gap: Different types of agents (such as adults, children, cyclists, and vehicles) have their own activity styles, resulting in differences in interaction preferences. On the other hand, even agents of the same type may exhibit different interactive behaviors when facing different scenes. For example, the interaction mode of students in school may be different from their interaction mode in the park. In addition, the scale differences and coordinate transformation relationships of trajectory data in different datasets also bring challenges to the description and analysis of social behaviors across datasets. (3) Semantic Gap: There is a difference in semantics between scene interaction features (mainly obtained from images) and social interaction features (mainly obtained from trajectory coordinates). For example, walking and resting are allowed on the lawns in the park, but few people do so on the lawns by the roadside, which indicates that there is a gap between theoretical meaning and actual behavior, and it also exists in social interaction and scene interaction. Social interaction and scene interaction reflect the same thing from different perspectives, and the common representation of the two interactions is conducive to the construction of intelligent agent interaction models. However, most methods use modal features such as different trajectories, images or videos to describe these interaction behaviors without any normalization or standardization operations. In addition, few methods further align the features of these different modalities semantically, further exacerbating the "gap" and thus affecting the performance of the prediction model.
[0007] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in the field of this technology. Summary of the invention
[0008] The technical problem to be solved by the present invention is how to eliminate the differences in the physical environment of the intelligent agent scene, the differences in social interaction relationships, and the differences in interaction and scene interaction in the process of predicting the future trajectory of the intelligent agent, so as to obtain a future trajectory prediction model that meets the constraints of social rules and physical environment.
[0009] The present invention adopts the following technical solution:
[0010] In a first aspect, the present invention provides a trajectory prediction method based on semantic consistency, comprising:
[0011] Obtain the historical trajectory coordinates and scene images of the intelligent agent;
[0012] Encoding the trajectory coordinates and the scene image of the agent through a context perception module to obtain a migration image of the agent, and then extracting context features of the migration image through a first convolutional neural network;
[0013] The long short-term memory network module is used to extract the historical trajectory features of the intelligent agent, and the extracted historical trajectory features are fused with the context features, and decoded by the context decoder to obtain the predicted trajectory of the intelligent agent.
[0014] Preferably, the context perception module includes a physical migration submodule and a social migration submodule, wherein the physical migration submodule is used to obtain the activity semantics of the intelligent agent from the scene image, and the social migration submodule is used to obtain the social interaction relationship of the intelligent agent.
[0015] Preferably, the step of obtaining the activity semantics of the agent from the scene image comprises:
[0016] In specific scenarios, the probability density of trajectories in the data set is obtained by the kernel density estimation method;
[0017] The scene image of the agent is gridded using a mapping function to obtain the supervision label of the activity semantics of each grid;
[0018] The activity semantics of the gridded scene image is acquired through a second convolutional neural network within the physical transfer submodule.
[0019] Preferably, the social interaction relationship of the intelligent agent is described from the energy perspective, and the steps of obtaining the social interaction relationship of the intelligent agent include:
[0020] Select a target intelligent agent and obtain the influencing factor of the target intelligent agent's energy;
[0021] Through the influencing factor of the target agent's energy, the social interaction energy function of the target agent is defined, and the expression of the social interaction relationship energy function of the target agent is obtained.
[0022] Preferably, the expression of the social interaction relationship energy function is:
[0023]
[0024] Among them, E i represents the social interaction energy of agent i, f represents the energy function, is the initial energy function, j represents the agent around i, X i represents the trajectory of agent i, represents the trajectory of j, The superscript “ / i” in the figure represents the surrounding agents other than i. x ,g y ) represents the grid coordinate of i, represents the grid coordinate of j, P 0 is the prior predictor, θ ij represents the relative energy growth factor between agents i and j, {h 1 ,h 2 ,h 3} is the bandwidth of the energy function f, {λ 1 ,λ 2 ,λ 3} is a hyperparameter.
[0025] Preferably, the influencing factors of the agent energy include: one or more of the influence of the target agent's subjective consciousness, the influence of surrounding agents on the target agent, and the influence of the social distance between the surrounding agents and the target agent.
[0026] Preferably, after obtaining the predicted trajectory of the intelligent agent, the entire network loss is trained end-to-end using the loss function to obtain a trajectory that satisfies social rules and physical constraints, specifically:
[0027] The loss function trains the entire network, compensates for the predicted trajectory error of the agent through training, and obtains a reasonable trajectory value for the agent;
[0028] The loss function trains the second convolutional neural network in the physical transfer submodule by minimizing the error between the agent activity semantic supervision label and the agent activity semantics inferred from the scene image;
[0029] Under the condition of transferring images, the loss function trains the entire network, and the training ensures that the entire network prediction has lower social interaction energy.
[0030] Preferably, the step of gridding the scene image of the agent by using a mapping relationship function specifically includes:
[0031] Get the trajectory coordinates of the agent;
[0032] The conversion relationship of the intelligent body coordinates is used to convert the intelligent body trajectory coordinates into the intelligent body's grid coordinates.
[0033] Preferably, the loss function is:
[0034]
[0035]
[0036]
[0037]
[0038] in, represents the trajectory average distance loss function, represents the migration loss function, represents the context consistency loss function, {μ 1 ,μ 2 ,μ 3} is a set of equilibrium parameters, Y i represents the future real-time trajectory of agent i, represents the predicted trajectory of agent i in the future, T i represents the activity semantic supervision label of agent i, The activity probability of agent i given by the trainable convolutional neural network, C i represents the migration image, represents the grid coordinates predicted by agent i, m p→g and m represent the coordinate conversion factor.
[0039] In a second aspect, the present invention further provides a trajectory prediction device based on semantic consistency, which is used to implement the trajectory prediction method based on semantic consistency described in the first aspect, and the device includes:
[0040] At least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the trajectory prediction method based on semantic consistency described in the first aspect.
[0041] In a third aspect, the present invention further provides a non-volatile computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors to complete the trajectory prediction method based on semantic consistency described in the first aspect.
[0042] The present invention uses a context-aware module (composed of a physical migration submodule and a social migration submodule) to encode the trajectory coordinates and images of the agent, obtain the intermediate features of the agent (the activity semantics under the scene image and the social interaction relationship described by energy), and then map the intermediate features of different modes of different distributions of the agent to a common space (corresponding to the migration image), and then form context features after being fused with the historical trajectory features through a convolutional neural network, and decode the context features through a context decoder to obtain the predicted trajectory of the agent. After obtaining the intermediate features of the agent, the present invention maps the intermediate features of different modes to the migration image to align these features at the semantic level, thereby eliminating the differences in the physical environment of the scene, the differences in social interaction relationships, and the differences between social interaction and scene interaction; the entire network of the agent trajectory prediction is trained through a loss function to obtain a prediction trajectory model that is more in line with social rules and physical constraints. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 is a flow chart of a trajectory prediction method based on semantic consistency provided by an embodiment of the present invention;
[0045] Figure 2 is a flow chart of a trajectory prediction method based on semantic consistency provided by an embodiment of the present invention;
[0046] Figure 3 is a flow chart of a trajectory prediction method based on semantic consistency provided by an embodiment of the present invention;
[0047] Figure 4 is a flow chart of a trajectory prediction method based on semantic consistency provided by an embodiment of the present invention;
[0048] Figure 5 is a flow chart of a trajectory prediction method based on semantic consistency provided by an embodiment of the present invention;
[0049] Figure 6 It is a network overall framework diagram of a trajectory prediction method based on semantic consistency provided by an embodiment of the present invention;
[0050] Figure 7 It is a structural schematic diagram of a trajectory prediction device based on semantic consistency provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0052] In the description of the present invention, the terms "inside", "outside", "longitudinal", "lateral", "upper", "lower", "top", "bottom" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and do not require that the present invention must be constructed and operated in a specific orientation. Therefore, they should not be understood as limitations on the present invention.
[0053] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0054] Embodiment 1:
[0055] Embodiment 1 of the present invention provides a trajectory prediction method based on semantic consistency, such as Figure 1 As shown, including:
[0056] Step 201: Obtain the historical trajectory coordinates and scene image of the intelligent agent;
[0057] Among them, intelligent agents include but are not limited to all entities that can think independently and interact with the physical environment, such as humans, robots, and vehicles. Intelligent entities (including hardware or software entities that can move autonomously) also belong to the category of intelligent agents. The embodiment of the present invention mainly studies the impact of the interaction between intelligent agents on the future trajectory of the intelligent agent, and then predicts the future action trajectory of the intelligent agent. In the specific embodiment scenario, to obtain the future predicted trajectory of the intelligent agent, it is usually necessary to select a target intelligent agent and obtain the historical trajectory coordinates of the target intelligent agent at each moment in the specific scene. In addition, the future trajectory of the target intelligent agent will also be affected by the surrounding intelligent agents and the specific scene environment. The impact of the surrounding intelligent agents on the target intelligent agent is mainly reflected in: the impact of the interaction between the surrounding intelligent agents and the target intelligent agent, and the positional relationship (distance) between the surrounding intelligent agents and the target intelligent agent; the impact of the specific scene environment on the target intelligent agent is mainly reflected in: the different physical scenes caused by different locations (for example: the distribution of buildings and trees in different geographical locations is different), and the different physical scenes caused at different times (for example: the street at rush hour and the street at midnight) on the target intelligent agent. In view of this, the present invention also needs to obtain the historical trajectory coordinates of the surrounding agents (other agents that affect the future trajectory of the target agent) at each moment and the scene images of the agents (including the target agent and the surrounding agents) at each moment.
[0058] Step 202: Encode the trajectory coordinates and scene image of the agent through a context perception module to obtain a migration image of the agent, and then extract context features of the migration image through a first convolutional neural network;
[0059] The embodiment of the present invention inputs the trajectory coordinates and scene image of the intelligent body into the context perception module for encoding, and obtains the social interaction features and scene interaction features of the intelligent body, wherein the social interaction features of the intelligent body are obtained by encoding the trajectory coordinates of the intelligent body, and the scene image of the encoded intelligent body corresponds to the scene interaction features of the intelligent body. The social interaction features and the scene interaction features are then mapped together in the migration image, and the features are fused to obtain the fused features; the migration image can be understood as a public space, and the social interaction features and the scene interaction features enter the migration image for free interaction, and then the fused features after the interaction are passed through the first convolutional neural network to obtain the contextual features that can be parsed.
[0060] Step 203: Use the long short-term memory network module to extract the historical trajectory features of the intelligent agent, and fuse the extracted historical trajectory features with the context features, decode them through the context decoder, and obtain the predicted trajectory of the intelligent agent.
[0061] Among them, the full name of the long short-term memory network is the long short-term memory artificial neural network (Long-Short-Term-Memory, LSTM). Through the long short-term memory network, the spatial location information of the agent can be shared, and local social interaction relationships can be learned. The historical trajectory features of the agent are obtained through the long short-term memory network module and then fused with the context features. The fusion process can be understood as an interaction, putting different features into a common space. In the public space, the fusion process of different features needs to share the rules of the public space, so that the predicted trajectory of the agent obtained by decoding the context decoder is reasonable. It is worth noting that the context decoder decodes the joint features after the fusion of the historical trajectory features and the context features, and does not decode the historical trajectory features and context features of the agent separately.
[0062] The embodiment of the present invention utilizes a context-aware module to encode the historical trajectory coordinates and scene images of the intelligent agent, obtains the activity semantics and energy relationship characteristics of social interaction under the intelligent agent scene image, and then maps these features at different times to a common migration image space. The fusion process of different features shares the rules of the common space to align these features at the semantic level, thereby achieving the purpose of eliminating the differences in the physical environment of the scene, the differences in social interaction relationships, and the differences between social interaction and scene interaction in the prediction of the intelligent agent trajectory.
[0063] In order to show the complete solution of the embodiment of the present invention, the embodiment of the present invention is further described below. The up-down perception module includes a physical migration submodule and a social migration submodule, wherein the physical migration submodule is used to obtain the activity semantics of the intelligent agent from the scene image, and the social migration submodule is used to obtain the social interaction relationship of the intelligent agent.
[0064] The purpose of the up-down perception module is to convert the historical trajectory coordinates and scene images of the agent into a migration image. The migration image of the agent, the activity semantics of the agent's scene image, and the social interaction energy relationship of the agent need to correspond to the same moment to ensure the rationality of the trajectory prediction of the target agent.
[0065] Furthermore, the activity semantics of the agent is obtained from the scene image, such as Figure 2 As shown, the specific steps include:
[0066] Step 301: In a specific scenario, the probability density of trajectories in the data set is obtained by a kernel density estimation method;
[0067] Among them, for the agent, the preferences (personal wishes) of each agent and the different distributions of the physical environment at different locations will affect the probability of the agent going to different places. When predicting the target agent, all available trajectories of the agent in the scene are required as supervision information to ensure the rationality of the agent trajectory prediction.
[0068] Step 302: gridding the scene image of the agent using a mapping function, thereby obtaining a supervision label of the activity semantics of each grid;
[0069] Among them, gridding is actually the operation of normalizing the trajectory coordinates of the agent on the scene image, and the process of converting the coordinates of different units of the agent into the grid coordinates of the agent. The supervised label of the activity semantics of each grid actually corresponds to the probability of the agent appearing in the corresponding grid of the scene image.
[0070] Step 303: Acquire the activity semantics of the gridded scene image through the second convolutional neural network in the physical transfer submodule.
[0071] In order to distinguish it from the first convolutional neural network, the convolutional neural network here is defined as the second convolutional neural network. When training the model, the activity semantic label is used to supervise the grid image, and a trainable convolutional neural network is introduced to generate the corresponding grid network, and then the error of the activity semantic label and the pixel-level error of the supervised grid image corresponding network are minimized, thereby ensuring that the corresponding activity semantics can be directly obtained by relying on the scene image during network testing.
[0072] In order to explain this solution more clearly, step 302 is further refined, as follows: Figure 3 As shown, the corresponding refinement steps are:
[0073] Step 3021: Obtain the trajectory coordinates of the intelligent body;
[0074] The trajectory coordinates of the agent include world coordinates, pixel coordinates and grid coordinates. World coordinates represent the three-dimensional space coordinates of the real world. It is a three-dimensional coordinate system, and meters are usually used to represent the unit of world coordinates. The image formed by discrete sampling of the projected image coordinates is a two-dimensional coordinate system. This coordinate is the pixel coordinate, and pixels are usually used to represent the unit of pixel coordinates. Grid coordinates can be understood as consisting of grids, and the unit of grid coordinates is 1.
[0075] Step 3022: Using the conversion relationship of the agent coordinates, the agent trajectory coordinates are converted into the agent's grid coordinates.
[0076] Among them, when the intelligent agent performs trajectory prediction, the units of the historical trajectory coordinates of the intelligent agent need to be unified. Based on the training module used in the embodiment of the present invention, the historical trajectory coordinates of the intelligent agent need to be converted into grid coordinates, and the future trajectory prediction of the intelligent agent is realized under the corresponding training module. It is worth noting that no matter what form the trajectory coordinates are expressed in, a reference coordinate point needs to be selected as a reference (0 coordinate point). Different reference coordinate points will result in different coordinate display values of the intelligent agent.
[0077] Furthermore, the embodiment of the present invention describes the social interaction relationship of the intelligent agent from the perspective of energy, and the social interaction relationship of the intelligent agent is obtained, such as Figure 4 As shown, the specific steps include:
[0078] Step 401: Select a target agent and obtain an influencing factor of the target agent's energy;
[0079] Among them, the influencing factors of the agent energy include: the influence of the subjective consciousness of the target agent, the influence of the surrounding agents on the target agent, and the influence of the social distance between the surrounding agents and the target agent. The influence of the subjective consciousness of the target agent can also be understood as the potential intention of the agent, that is, the possible destination of the agent in the future; the influence of the surrounding agents on the target agent actually describes the interaction relationship between the surrounding agents and the target agent; the influence of the social interaction distance between the surrounding agents and the target agent describes the social intimacy between the target agent and the surrounding agents. After determining the influencing factors of the agent energy, the social interaction relationship of the agent is controlled by obtaining the social interaction energy function of the agent.
[0080] Step 402: Define the social interaction energy function of the target agent through the influencing factor of the target agent's energy, and obtain the expression of the social interaction relationship energy function of the target agent.
[0081] Among them, when the influencing factors of the target agent's energy are clarified, the social interaction energy function of the target agent can be represented by setting the corresponding coefficients (hyperparameters) and using the energy function corresponding to the influencing factors and the set coefficients. Then, through data training, the value of the coefficient or the relationship between the coefficient and the agent coordinates is obtained. It is worth noting that the embodiment of the present invention describes the social interaction relationship between agents from the perspective of energy, rather than describing the social interaction relationship between agents through historical trajectories.
[0082] Furthermore, the context decoder decodes the comprehensive features of the historical trajectory features and the context features to obtain the predicted trajectory of the intelligent agent. After obtaining the predicted trajectory of the intelligent agent, it is necessary to use the loss function to perform end-to-end training on the entire network loss to obtain a trajectory that meets social rules and physical constraints. Figure 5 As shown, the loss function for the training of the entire network includes the following parts:
[0083] Step 501: The loss function trains the entire network, and compensates for the predicted trajectory error of the intelligent agent through training to obtain a reasonable trajectory value of the intelligent agent;
[0084] The prediction of the trajectory of the agent at a certain moment actually reflects the most likely place for the agent to go. Errors are inevitable in the prediction of the trajectory of the agent. In order to make the predicted value closer to the truth, it is usually necessary to train the trajectory predicted by the agent using a loss function, so as to achieve a smaller error in the prediction of the trajectory of the agent through training.
[0085] Step 502: The loss function trains the second convolutional neural network in the physical transfer submodule by minimizing the error between the agent activity semantic supervision label and the agent activity semantics inferred from the scene image;
[0086] On the one hand, before making a decision, the agent always conducts a comprehensive analysis of the scene information within a certain area, so that the probability distribution at the pixel level is not enough to fully reflect their future choices. On the other hand, when the number of agents that can be used to estimate the activity area is insufficient, the pixel-level activity labels will show huge quantization errors, which will lead to label contamination in the training samples, and thus affect the accuracy of the model in inferring the activity semantics from the scene image. Therefore, the embodiment of the present invention collects pixel-level activity information within a certain range and then constructs a low-resolution histogram. Depending on the purpose, the second convolutional neural network uses a trainable neural network. By training the second convolutional neural network, this part of the network can infer the agent activity semantics from the scene image and the agent activity semantic label T obtained by the kernel density estimation method, which is sufficiently similar, thereby making the predicted trajectory of the agent more accurate.
[0087] Step 503: Under the condition of the transferred image, the loss function trains the entire network, and the training ensures that the prediction of the entire network has lower social interaction energy.
[0088] The predicted area has a high possibility of action for all agents. In the specific scenario implementation, in order to ensure that the trajectory prediction of the target agent is closer to the actual trajectory value as much as possible, it is necessary to eliminate the interaction effect of the surrounding agents on the target agent. During training, the predicted trajectory of the target agent is made closer to the actual value by reducing the interaction energy between the target agent and the surrounding agents.
[0089] After obtaining the predicted trajectory model of the target intelligent agent through the embodiment of the present invention, the predicted trajectory needs to be trained. The embodiment of the present invention uses the loss function to perform end-to-end training on the entire network to obtain a trajectory that meets social rules and physical constraints.
[0090] Embodiment 2:
[0091] Based on Example 1, this embodiment of the present invention further provides a specific implementation method of a trajectory prediction model based on semantic consistency. Figure 6 As shown, in the model of the embodiment of the present invention, the historical trajectory and scene image of the intelligent agent are input, and then the migration image is obtained through the context perception module, and then the historical trajectory features are fused through the convolutional neural network, and then the fused features are decoded by the context decoder to obtain the future predicted trajectory. Finally, the entire model network is trained through the loss function to obtain the predicted trajectory that meets social rules and physical constraints.
[0092] Problem definition: If N (N ≥ 1) agents observe at time T o ={t 1 ,t 2 ,…,to The observation trajectory coordinates in} are in, Represents agent i at observation time T o The purpose of trajectory prediction is to predict the future time T p ={t o +1,t o +2,…,t o +t p}, where Represents agent i at the future time T p Note that for a simpler presentation, the time footnotes (T o , t, etc.).
[0093] In addition, the scene image at time t is recorded as I t In the subsequent model derivation process, the trajectory coordinates of the agent need to be normalized to a unified unit. The trajectory coordinates of the agent can be expressed in world coordinates, pixel coordinates, or grid coordinates, where (x, y) is the world coordinate (in meters), (p x ,p y ) is the coordinates in pixels (in pixels), (g x ,g y ) is the grid coordinate (unit is 1). When the trajectory coordinates of the agent are encoded to form a migration image, the unit on the image is pixel. Before encoding, the trajectory coordinates need to be converted into pixel coordinates. The mapping relationship between world coordinates and pixel coordinates is (p x ,p y )=m(x,y), where m represents the conversion factor between world coordinates and pixel coordinates.
[0094] In this embodiment, the proposed network focuses more on modeling the common parts of social and scene interactions in different scenes, so we propose a context-aware module. The context-aware module of the embodiment of the present invention consists of a physical transfer submodule and a social transfer submodule. Through two independent submodules, the observation trajectory and scene image are transferred to a target domain (transfer image) that focuses on semantic alignment.
[0095] Physical transfer submodule: When training on a dataset, all available trajectories in a scene are used as supervisory information to establish a connection between scene images and agent activities. First, the kernel density estimation method is used to obtain the trajectory probability density (in pixels) in a dataset, as follows:
[0096]
[0097] Among them, R represents the number of coordinates of the location of the agent recorded in the data set, h represents the bandwidth of the kernel function, (x, y) represents the world coordinates, K(x, y) represents the kernel density function, (p x i ,p y i ) represents the pixel coordinates of the corresponding i (which should be strictly distinguished from agent i, where i only represents the number i) in the dataset. In order to speed up the calculation, in this scheme,
[0098] Secondly, using the mapping function (g x ,g y )=m p→g (p x ,p y ) divides the scene image into H×W grids, thereby obtaining the supervised label l[I(g x ,g y )],as follows:
[0099]
[0100] Where D = {(x,y)|m p→g (x,y)=g x ,g y )} represents the set of pixel coordinates covered by the grid, m p→g represents the conversion factor between grid coordinates and pixel coordinates, so the supervised label l[I(g x ,g y )] and scene image I(g x ,g y ).
[0101] Then, a trainable convolutional neural network (denoted as G(·)) is introduced to generate the corresponding gridded agent activity probability distribution Where R H×W Represents a gridded scene image as follows:
[0102]
[0103] In this scheme, the activity semantic label l[I(g x ,g y )] and the agent activity probability prediction given by a trainable convolutional neural network This ensures that the network relies only on scene images during testing. Directly obtain activity semantics
[0104] Social migration submodule: Given a grid Ei ∈R H×W , the trajectory of agent i is X i , its surrounding agents (denoted as J, J represents the set of all agents around i), the trajectory is Define the social interaction energy E of agent i i And the energy function f is as follows:
[0105]
[0106] Among them, E i represents the social interaction energy of agent i, f represents the energy function, is the initial energy function, j represents the agent around i, X i represents the trajectory of agent i, represents the trajectory of j ( The superscript “ / i” in the figure indicates surrounding agents other than i), (g x ,g y ) represents the grid coordinate of i, represents the grid coordinate of j, P 0 is the prior predictor (output is grid coordinates), θ ij represents the relative energy growth factor between agents i and j, {h 1 ,h 2 ,h 3} is the bandwidth of the energy function f, {λ 1 ,λ 2 ,λ 3} is a hyperparameter.
[0107] Social interaction energy E i It is composed of three sub-energies. The first sub-energy represents the potential intention of agent i, that is, the possible future destination, where represents the interaction between agent i and itself; the second sub-energy Describe the interaction relationship between agent i and other agents J around it (J represents the set of all agents around i), let represents the displacement direction of agent i during the observation time, so the relative energy growth factor can be expressed as follows:
[0108]
[0109] The third sub-energy Characterize social intimacy (safe social distance) to restrict the activities of agent i.
[0110] Therefore, from the perspective of energy, ε={E i} represents social interactions rather than historical trajectories
[0111] Contextual features: The physical transfer submodule obtains activity semantics from scene images The social migration submodule uses the energy perspective ε={E i}Describe social interaction relationships. Transfer image (fusion representation of social interaction and scene interaction) represents the synergistic effect of social interaction and scene interaction on the future trajectory planning of the agent, then C i is defined as:
[0112]
[0113] Then, a convolutional neural network is introduced to extract context features as follows:
[0114]
[0115] Historical trajectory features: In this scheme, LSTM is used to extract historical trajectory features, so the historical trajectory features of agent i are as follows:
[0116]
[0117] Context decoder: Use context decoder D to decode the context features of agent i Characteristics of historical trajectory The joint representation of , obtains the future prediction trajectory as follows:
[0118]
[0119] Among them, [·,·] is a concatenation operation.
[0120] Loss function: In order to train the entire network end-to-end, the following loss function is used:
[0121]
[0122]
[0123]
[0124]
[0125] in, represents the trajectory average distance loss function, represents the migration loss function, represents the context consistency loss function, {μ 1 ,μ2 ,μ 3} is a set of equilibrium parameters, Y i represents the future real-time trajectory of agent i, represents the predicted trajectory of agent i in the future, T i represents the activity semantic supervision label of agent i, represents the activity probability of agent i given by the trainable convolutional neural network, C i represents the migration image, represents the grid coordinates predicted by agent i, m p→g and m represent the coordinate conversion factor.
[0126] The entire network is trained to produce reasonable trajectories that are close to the ground truth.
[0127] Train the convolutional neural network G(·) in the physical transfer submodule so that this part of the network can infer the semantics of the agent’s activities from the scene image I It is similar enough to the agent activity semantic label T obtained by the kernel density estimation method.
[0128] Training the entire network can make the network predictions consistent with the transfer image (The transfer image is a constraint on the agent activity context in a consistent interaction representation similar to eliminating the semantic differences between social interaction and scene interaction; thereby ensuring that the trajectory given by the network has a lower value in the transfer image grid, ensuring the consistency of the network predicted trajectory in the agent activity semantics and interaction energy description, and ultimately achieving trajectory prediction based on the agent activity context.
[0129] In summary, the embodiment of the present invention describes the process of establishing a model for predicting the trajectory of an intelligent agent from the perspective of predicting the trajectory of an intelligent agent. Through the trajectory prediction model of the intelligent agent, the purpose of eliminating the differences in the physical environment of the scene, the differences in social interaction relationships, and the differences between social interaction and scene interaction in the prediction of the trajectory of the intelligent agent is achieved. In addition, the prediction model of the acquired intelligent agent is trained end-to-end using a loss function, and a trajectory that satisfies social rules and physical constraints is obtained through training.
[0130] Embodiment 3:
[0131] like Figure 7 , which is a schematic diagram of the architecture of a trajectory prediction device based on semantic consistency according to an embodiment of the present invention. The trajectory prediction device based on semantic consistency according to this embodiment includes one or more processors 21 and a memory 22. Figure 7 A processor 21 is taken as an example.
[0132] The processor 21 and the memory 22 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0133] The memory 22 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs and non-volatile computer executable programs, such as the trajectory prediction method based on semantic consistency in Example 1. The processor 21 executes the trajectory prediction method based on semantic consistency by running the non-volatile software programs and instructions stored in the memory 22.
[0134] The memory 22 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 22 may optionally include a memory remotely arranged relative to the processor 21, and these remote memories may be connected to the processor 21 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0135] The program instructions / modules are stored in the memory 22, and when executed by the one or more processors 21, the trajectory prediction method based on semantic consistency in the above embodiment 1 is executed, for example, the above described Figure 1-6 The steps shown.
[0136] It is worth noting that the information interaction, execution process, etc. between the modules and units within the above-mentioned devices and systems are based on the same concept as the processing method embodiment of the present invention. The specific contents can be found in the description of the method embodiment of the present invention and will not be repeated here.
[0137] A person skilled in the art may understand that all or part of the steps in the various methods of the embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0138] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A trajectory prediction method based on semantic consistency, characterized in that: include: Obtain the historical trajectory coordinates and scene images of the intelligent agent; Encoding the trajectory coordinates and the scene image of the agent through a context perception module to obtain a migration image of the agent, and then extracting context features of the migration image through a first convolutional neural network; The historical trajectory features of the agent are extracted by using a long short-term memory network module, and the extracted historical trajectory features are fused with the context features, and decoded by a context decoder to obtain the predicted trajectory of the agent; The context perception module includes a physical migration submodule and a social migration submodule, wherein the physical migration submodule is used to obtain the activity semantics of the intelligent agent from the scene image, and the social migration submodule is used to obtain the social interaction relationship of the intelligent agent; The expression of the social interaction relationship energy function is: in, Representing an Agent The energy of social interaction, represents the energy function, is the initial energy function, express The surrounding intelligent agents, Representing an Agent The trajectory of express The trajectory of The superscript " " means except External surrounding agents, express The grid coordinates of express The grid coordinates of is the a priori predictor, Representing an Agent and The relative energy growth factor between is the energy function bandwidth, is a hyperparameter.
2. The trajectory prediction method based on semantic consistency according to claim 1, characterized in that: The specific steps of obtaining the activity semantics of the intelligent agent from the scene image include: In specific scenarios, the probability density of trajectories in the data set is obtained by the kernel density estimation method; The scene image of the agent is gridded using a mapping function to obtain the supervision label of the activity semantics of each grid; The activity semantics of the gridded scene image is acquired through a second convolutional neural network within the physical transfer submodule.
3. The trajectory prediction method based on semantic consistency according to claim 1, characterized in that: The social interaction relationship of the intelligent agent is described from the energy perspective. The specific steps of obtaining the social interaction relationship of the intelligent agent include: Select a target intelligent agent and obtain the influencing factor of the target intelligent agent's energy; Through the influencing factor of the target agent's energy, the social interaction energy function of the target agent is defined, and the expression of the social interaction relationship energy function of the target agent is obtained.
4. The trajectory prediction method based on semantic consistency according to claim 3, characterized in that: The influencing factors of the agent energy include: the influence of the subjective consciousness of the target agent, the influence of the surrounding agents on the target agent, and the influence of the social distance between the surrounding agents and the target agent.
5. The trajectory prediction method based on semantic consistency according to claim 3, characterized in that: After obtaining the predicted trajectory of the intelligent agent, the entire network loss is trained end-to-end using the loss function to obtain a trajectory that satisfies social rules and physical constraints. Specifically: The loss function trains the entire network, compensates for the predicted trajectory error of the agent through training, and obtains a reasonable trajectory value for the agent; The loss function trains the second convolutional neural network in the physical transfer submodule by minimizing the error between the agent activity semantic supervision label and the agent activity semantics inferred from the scene image. Under the condition of transferring images, the loss function trains the entire network, and the training ensures that the entire network prediction has lower social interaction energy.
6. The trajectory prediction method based on semantic consistency according to claim 2, characterized in that: The method of gridding the scene image of the agent by using the mapping relationship function specifically includes: Get the trajectory coordinates of the agent; The conversion relationship of the intelligent body coordinates is used to convert the intelligent body trajectory coordinates into the intelligent body's grid coordinates.
7. The trajectory prediction method based on semantic consistency according to claim 5, characterized in that: The loss function is: in, represents the trajectory average distance loss function, represents the migration loss function, represents the context consistency loss function, is a set of equilibrium parameters, Representing an Agent Real-time trajectory of the future, Represents the agent The predicted trajectory for the future, Representing an Agent The activity semantic supervision label of Agents given by trainable convolutional neural networks Activity probability, represents the migration image, Representing an Agent The predicted grid coordinates, and Represents the coordinate conversion factor.
8. A trajectory prediction device based on semantic consistency, characterized in that: include: at least one processor; at least one memory; The at least one processor and the at least one memory are communicatively connected to each other, the at least one memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the trajectory prediction method based on semantic consistency provided in any one of claims 1 to 7.
