Human body movement trajectory recovery method and device
Patent Information
- Application Number
- CN202410151786.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-02
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2044-02-02
AI Technical Summary
[0006]本发明提供一种人体移动轨迹恢复方法和装置,以解决现有技术中人体移动轨迹恢复的准确性较差,所恢复的轨迹与真实轨迹具有较大偏差的问题,提高轨迹恢复的准确性,降低所恢复的轨迹与真实轨迹的偏差
[0044]本发明提供的人体移动轨迹恢复方法,通过获取目标人体的个体当前轨迹,将所述目标人体的个体当前轨迹输入预先训练的轨迹扩散模型中,即可得到所述目标人体的恢复轨迹;其中,所述轨迹扩散模型是利用样本的轨迹移动特征和样本的当前轨迹进行训练得到的,所述样本的轨迹移动特征是利用样本的群体当前轨迹中的移动特征、个人历史轨迹的移动特征和群体历史轨迹的移动特征进行融合得到的。
Smart Images

Figure CN117992916B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and apparatus for restoring human movement trajectory. Background Technology
[0002] With the proliferation of mobile devices and location-based social networks, a vast amount of human mobility data has accumulated. However, due to low sampling rates of mobile data sampling devices or restrictions on user privacy, the collection of real trajectory data is extremely sparse, impairing the performance of downstream applications. For example, in urban planning and traffic management, the lack of individual location records makes it difficult to accurately estimate hourly crowd flow in a city, hindering timely scheduling and response. For recommendation systems, recommending appropriate points of interest becomes exceptionally difficult without sufficient trajectory records. Therefore, it is crucial to reconstruct individual movement trajectories by modeling human movement patterns in a fine-grained spatiotemporal dimension.
[0003] A common solution for human trajectory recovery is the model-based approach. These methods assume that human mobility can be modeled using a finite number of parameters with explicit physical meaning, describing key characteristics and patterns of human mobility, such as spatial continuity and temporal periodicity. Model-based trajectory recovery methods tend to simplify human movement, ignoring its complexities and failing to accurately simulate real-world movement. Another type of trajectory recovery solution is the data-driven approach, which can extract complex mobility features from large amounts of trajectory data. These methods build neural network-based trajectory recovery models, directly capturing the intrinsic characteristics of human movement, such as periodicity and repeatability, from real-world movement data. However, this purely learning paradigm does not utilize prior knowledge of human movement patterns, leading to inefficient training processes.
[0004] However, existing technologies use models that capture movement characteristics by tracking individual trajectory points, lacking joint distribution modeling of all trajectory points along the entire trajectory, resulting in the recovered trajectory ignoring a large number of characteristics. At the same time, existing technologies capture features such as periodicity from individual trajectories, but individual trajectories are often sparse and cannot accurately recover the trajectory. In addition, existing technologies lack the introduction of human movement patterns, resulting in low model training efficiency and difficulty in capturing hidden patterns in human trajectories.
[0005] Therefore, a method and apparatus for restoring human movement trajectory are provided to solve the problem that the accuracy of human movement trajectory restoration in the prior art is poor and the restored trajectory has a large deviation from the real trajectory, which has become an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0006] This invention provides a method and apparatus for restoring human movement trajectory, which solves the problems of poor accuracy in restoring human movement trajectory in the prior art and large deviation between the restored trajectory and the actual trajectory, thereby improving the accuracy of trajectory restoration and reducing the deviation between the restored trajectory and the actual trajectory.
[0007] This invention provides a method for recovering human movement trajectory, comprising:
[0008] Obtain the current trajectory of the target human body;
[0009] The current trajectory of the target human body is input into a pre-trained trajectory diffusion model to obtain the recovered trajectory of the target human body;
[0010] The trajectory diffusion model is trained using the trajectory movement features of the samples and the current trajectory of the samples. The trajectory movement features of the samples are obtained by fusing the movement features of the current trajectory of the group, the movement features of the individual historical trajectory, and the movement features of the group historical trajectory.
[0011] In some embodiments, the trajectory diffusion model is obtained by training using the trajectory movement features of the sample and the current trajectory of the sample, specifically including:
[0012] All trajectory data are obtained from the target database to construct a training set, wherein all data points in the trajectory data correspond one-to-one to constitute the sample;
[0013] Periodic features are extracted from the individual historical trajectories of each sample using an individual history processor; a group historical transition matrix is extracted from the group historical trajectory of each sample and a group current transition matrix is extracted from the group current trajectory of each sample using a Markov chain.
[0014] The periodic features and the group historical transition matrix are fused using a historical trajectory attention mechanism to obtain the historical trajectory;
[0015] The current transition matrix of the group is fused with the historical transition matrix of the group based on the inter-trajectory attention mechanism to obtain trajectory movement features;
[0016] The trajectory movement features are input into a pre-built diffusion model for training to obtain the trajectory diffusion model.
[0017] In some embodiments, a periodic feature is extracted from the individual historical trajectory of each sample using an individual history processor, specifically including:
[0018] Multiple individual trajectories are extracted from the sample, and the multiple individual trajectories are aggregated using a history aggregator to obtain an aggregated trajectory;
[0019] Embed the aggregated trajectory into the time slot;
[0020] Based on the similarity between time slots t and k under head h. For the t-th time slot of the p-th historical trajectory of sample u, the displacement-aware embedding is obtained by aggregating the similarity of information from all time slots of the p-th historical trajectory;
[0021] Standard residual connections are added to preserve current motion information, and displacement-aware embeddings for each time slot of the historical trajectory are obtained to obtain periodic feature vectors characterizing the motion properties of an individual's historical trajectory.
[0022] In some embodiments, the similarity between time slots t and k under header h is calculated using the first expression. The first expression is:
[0023]
[0024]
[0025] in, This indicates that sample u is in the t-th time slot of the p-th historical trajectory. This represents the k-th time slot of the p-th historical trajectory of sample u, where T represents the number of time slots, k represents the current time slot number, and φ (h) This means multiplying each time slot by its corresponding transformation matrix and then taking the inner product. They are respectively The corresponding transformation matrix, where <·> is the inner product function.
[0026] In some embodiments, the second expression is used to determine the similarity between time slots t and k under header h. For the p-th historical trajectory of sample u in the t-th time slot, the displacement-aware embedding is obtained by aggregating the similarity of information from all time slots of the p-th historical trajectory. The second expression is:
[0027]
[0028] in, It is a transformation matrix.
[0029] In some embodiments, Markov chains are used to extract the population history transition matrix from the population history trajectory of each sample and the population current transition matrix from the population current trajectory of each sample, specifically including:
[0030] The group's historical transition matrix is calculated using the third expression, and the group's current transition matrix is calculated using the fourth expression.
[0031] The third expression is:
[0032]
[0033] in, Let f(·) represent a Markov chain for all samples in the t-th time slot of the p-th historical trajectory, and M be the time slot of the Markov chain. p ,t For the group's historical transition matrix;
[0034] The fourth expression is:
[0035]
[0036] in, Let f(·) represent the time slot of all samples in the current trajectory, and M represent the Markov chain. n,t This is the current transition matrix for the group.
[0037] The present invention also provides a human movement trajectory recovery device, which further includes:
[0038] The trajectory acquisition unit is used to acquire the current trajectory of the target human body.
[0039] The trajectory recovery unit is used to input the current trajectory of the target human body into a pre-trained trajectory diffusion model to obtain the recovered trajectory of the target human body.
[0040] The trajectory diffusion model is trained using the trajectory movement features of the samples and the current trajectory of the samples. The trajectory movement features of the samples are obtained by fusing the movement features of the current trajectory of the group, the movement features of the individual historical trajectory, and the movement features of the group historical trajectory.
[0041] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the human movement trajectory recovery method described above.
[0042] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the human movement trajectory recovery method described above.
[0043] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the human movement trajectory recovery method described above.
[0044] The human movement trajectory recovery method provided by this invention obtains the current trajectory of a target human body and inputs it into a pre-trained trajectory diffusion model to obtain the recovered trajectory of the target human body. The trajectory diffusion model is trained using the trajectory movement features of the samples and the current trajectory of the samples. The trajectory movement features of the samples are obtained by fusing the movement features of the current trajectory of the group of samples, the movement features of the individual historical trajectory, and the movement features of the group historical trajectory.
[0045] Thus, the method provided by this invention enables the target human body to recover its trajectory under the guidance of movement patterns. It fully utilizes individual trajectories to capture historical periodicity and group trajectories to capture movement trends. Individual and group information are fused through an attentional mechanism, and movement patterns are modeled based on diffusion models, thereby achieving better trajectory recovery results. This solves the problem of poor accuracy in human movement trajectory recovery in existing technologies, where the recovered trajectory deviates significantly from the true trajectory, thus improving the accuracy of trajectory recovery and reducing the deviation between the recovered trajectory and the true trajectory. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0047] Figure 1 This is one of the flowcharts illustrating the human movement trajectory recovery method provided by the present invention;
[0048] Figure 2 This is the second flowchart of the human movement trajectory recovery method provided by the present invention;
[0049] Figure 3 This is a network architecture diagram of the migration model provided by the present invention;
[0050] Figure 4 This is the third flowchart of the human movement trajectory recovery method provided by the present invention;
[0051] Figure 5 This is the fourth flowchart of the human movement trajectory recovery method provided by the present invention;
[0052] Figure 6 This is the fifth flowchart of the human movement trajectory recovery method provided by the present invention;
[0053] Figure 7 This is the sixth flowchart of the human movement trajectory recovery method provided by the present invention;
[0054] Figure 8 This is a schematic diagram of the human movement trajectory recovery device provided by the present invention;
[0055] Figure 9 This is a schematic diagram of the structure of the electronic device provided by the present invention.
[0056] Figure label:
[0057] 810: Trajectory acquisition unit; 820: Trajectory recovery unit. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0059] The following is combined with Figures 1-7 The present invention describes a method for restoring human movement trajectory.
[0060] In one specific embodiment, the human movement trajectory recovery method provided by the present invention is a trajectory recovery method guided by movement laws based on a diffusion model, such as... Figure 1 As shown, the method includes the following steps:
[0061] S110: Obtain the current trajectory of the target human body. The target human body is the user whose trajectory needs to be recovered. For example, if it is necessary to determine the interests of a user on a social media platform, then the user is used as the target human body, and the user's current movement trajectory is obtained. The current trajectory of an individual can be obtained directly using a mobile terminal or social media software with location services enabled.
[0062] S120: The current trajectory of an individual human body is input into a pre-trained trajectory diffusion model to obtain the recovered trajectory of the target human body. The trajectory diffusion model is trained using the trajectory movement features of samples and their current trajectories. The trajectory movement features are obtained by fusing the movement features of the current trajectories of the sample group, the movement features of the individual's historical trajectories, and the movement features of the group's historical trajectories. In other words, after identifying a user as the target human body, the current trajectory of that target human body is input into the trajectory diffusion model to obtain the recovered trajectory based on the pre-trained model.
[0063] In some embodiments, such as Figure 2 As shown, the trajectory diffusion model is obtained by training using the trajectory movement features of the samples and the current trajectory of the samples, specifically including the following steps:
[0064] S210: Obtain all trajectory data from the target database to construct a training set. All data points in the trajectory data correspond one-to-one with the samples. The target database can be, for example, all trajectory data stored on a target platform, such as a social media platform or a shopping platform. The training set is constructed using the trajectory data stored on the target platform. Each data point in the trajectory data constitutes a sample. The sample data includes the individual historical trajectory of the target person, the group historical trajectory of a specific group containing the target person, and the group's current trajectory. The specific group can be divided according to different dimensions, such as occupational groups, age groups, or geographical groups, thereby supplementing and expanding the characteristics of the target individual based on the characteristics of these specific groups.
[0065] Specifically, based on the analysis of the correlation between trajectory features and motion data, when selecting features for trajectory data recovery for each sample (i.e., a data point), time and location are jointly embedded into a dense representation to integrate spatiotemporal correlation, serving as input for other modules. For each time slot t, its embedding is generated as follows:
[0066] e t (2i)=sin(t / 10000 2i / d )
[0067] e t (2i+1)=cos(t / 10000 2i / d )
[0068] Where i represents the i-th dimension, and the temporal embedding vector and the positional embedding vector have the same dimension d.
[0069] For the i-th time slot in the n-th trajectory of user u, its time-aware representation is obtained by calculating the sum of the time and position embedding vectors, denoted as .
[0070]
[0071] Since the generated vector is a lower-dimensional vector than the original one-hot vector, the computational cost of subsequent calculations can be effectively reduced, which is beneficial to the implementation of subsequent calculations.
[0072] S220: Extract periodic features from the individual historical trajectories of each sample using an individual history processor; extract the group historical transition matrix from the group historical trajectory of each sample and the group current transition matrix from the group current trajectory of each sample using a Markov chain;
[0073] S230: The periodic features and the group historical transition matrix are fused using a historical trajectory attention mechanism to obtain the historical trajectory;
[0074] S240: Based on the inter-trajectory attention mechanism, the current transition matrix of the group is fused with the historical transition matrix of the group to obtain trajectory movement features;
[0075] S250: Input the trajectory movement features into a pre-built diffusion model for training to obtain the trajectory diffusion model.
[0076] Specifically, when constructing a trajectory diffusion model for trajectory recovery, such as Figure 3 As shown, firstly, the current trajectory is embedded into a tensor with a K position and L time slots by splicing to identify conditional observations. and restore target value During the sampling phase, conditional observations All values are observations; during the training phase, sampling is performed using a random masking strategy. and To distinguish between conditional observations and the recovered target value, the trajectory diffusion model can be based on the architecture in Diff Wave, which consists of multiple residual layers and residual channels C. To obtain the temporal and spatial dependencies of the trajectory, a two-dimensional attention mechanism is used in each residual layer instead of a convolutional structure. Specifically, a temporal transformer layer and a location transformer layer are introduced. The temporal transformer layer learns the temporal dependencies by taking the tensor at each location as input, while the location transformer layer learns the temporal dependencies by taking the tensor at each time point as input.
[0077] In a specific application scenario, the overall workflow of the method provided by this invention is as follows: Figure 4 and Figure 5 As shown, training samples are constructed based on all known trajectory data stored on the platform. After preprocessing, the trajectory data is transformed into a time-series location sequence of the user within a day, specifically represented as a set of location points at fixed time intervals. When a location in a certain time slot is not observed, it is defined as a missing location.
[0078] Furthermore, it is necessary to mine the periodicity and regularity of trajectory data within the framework of the diffusion model, processing the historical and current trajectories of individuals and groups separately, and then integrating their characteristics to comprehensively determine the recovered location. Specifically, a trajectory embedding module is designed as a basic component of other modules, aiming to project sparse location and temporal representations into a dense vector with better computability. To extract periodic patterns, individual historical trajectories are input into a history processor for aggregation. Simultaneously, to obtain general movement patterns, the historical trajectories of the group are input into a Markov model to obtain transfer features. Finally, historical movement features are obtained by fully fusing the historical trajectory information of individuals and groups. Through the current group trajectory processing module, movement features in the current trajectory of the group are extracted to enhance the modeling of movement patterns. Finally, the integrated trajectory movement features are input together with the individual's current trajectory into the trajectory diffusion model to generate the recovered trajectory.
[0079] The model is trained on training data. The training loss consists of two parts: one part optimizes the recovered trajectory to be as close as possible to the real trajectory, and the other part is a generalized movement rule to optimize the spatial continuity of human movement. The principle is to encourage the model to limit the travel distance between adjacent movements and jumps. The trajectory diffusion model obtained after training can be used to recover the trajectory.
[0080] In some embodiments, such as Figure 6 As shown, the extraction of periodic features from the individual historical trajectories of each sample using an individual history processor specifically includes the following steps:
[0081] S610: Extract multiple individual trajectories from the sample, and aggregate the multiple individual trajectories using a history aggregator to obtain an aggregated trajectory;
[0082] S620: Embed the aggregated trajectory into the time slot;
[0083] S630: Based on the similarity between time slots t and k under head h For the p-th historical trajectory of sample u in the t-th time slot, the displacement-aware embedding is obtained by aggregating the similarity of information from all time slots of the p-th historical trajectory; wherein, the similarity between time slots t and k under the head h is calculated using the first expression. The first expression is:
[0084]
[0085] in, This indicates that sample u is in the t-th time slot of the p-th historical trajectory. This represents the k-th time slot of the p-th historical trajectory of sample u, where T represents the number of time slots, k represents the current time slot number, and φ (h)This means that each time slot is multiplied by its corresponding transformation matrix, and then the inner product is calculated.
[0086] In some embodiments, displacement-aware embedding is obtained using the second expression. The second expression is:
[0087]
[0088] in, It is a transformation matrix.
[0089] S640: Add standard residual connections to preserve current motion information and obtain displacement-aware embeddings for each time slot of the historical trajectory to obtain periodic feature vectors characterizing the motion properties of an individual's historical trajectory.
[0090] Specifically, a personal history processor is used to extract periodic features from an individual's historical trajectory, such as... Figure 7 As shown, the individual history processor includes a history aggregator, trajectory embedding, and an in-trajectory attention mechanism. The history aggregator is used to jointly utilize multiple sparse trajectories to overcome the problem that a single historical trajectory provides too little information to capture the periodicity of the trajectory. The specific design of the history aggregator is as follows:
[0091]
[0092] in, To extract the most frequently accessed locations within a given time period, the aggregated... Embedded into In the middle, each time slot is made by express.
[0093] An intra-trajectory attention mechanism is used to further fill in the locations of missing data points. If some users did not leave any records in this time slot, the historical aggregator still cannot recover the missing locations. Using the intra-trajectory attention mechanism, the missing locations can be inferred from their locations observed in other time slots; specifically, a multi-head attention network can be used to simulate the spatiotemporal relationships between trajectory points. The correlation between time slots t and k under head h is defined as follows:
[0094]
[0095]
[0096] in, Let be the transformation matrix, and <,> be the inner product function.
[0097] For the p-th historical trajectory of user u in the t-th time slot, we use the similarity of information from all time slots of the aggregated p-th historical trajectory. Obtain its displacement-aware embedding:
[0098]
[0099]
[0100] in, It is also a transformation matrix, | is the connection operator, and H is the total number of heads.
[0101] A standard residual connection is added to preserve current movement information, and the shift-aware embedding for each time slot of the historical trajectory is obtained as follows:
[0102]
[0103] Among them, w 1 ∈R d′H×d Let z be the projection matrix for the dimension mismatch case, and ReLU(z) = max(0,z) be the nonlinear activation function.
[0104] By employing an attention mechanism within historical trajectories, we can extract more complex movement features from historical trajectories. Utilizing the entire individual historical processor, we can obtain a vector representing the movement characteristics of an individual's historical trajectory.
[0105] In step S220, a Markov chain is used to extract the population history transition matrix from the population history trajectory of each sample and the population current transition matrix from the population current trajectory of each sample, specifically including:
[0106] The group's historical transition matrix is calculated using the third expression, and the group's current transition matrix is calculated using the fourth expression.
[0107] The third expression is:
[0108]
[0109] in, Let f(·) represent a Markov chain for all samples in the t-th time slot of the p-th historical trajectory, and M be the time slot of the Markov chain. p,t For the group's historical transition matrix;
[0110] The fourth expression is:
[0111]
[0112] in, Let f(·) represent the time slot of all samples in the current trajectory, and M represent the Markov chain. n,t This is the current transition matrix for the group.
[0113] To improve the effectiveness and accuracy of information fusion, this embodiment, when used for enhancing the fusion of group trajectory information to improve mobility characteristics, primarily utilizes three modules: Markov models, historical trajectory attention mechanisms, and inter-trajectory attention mechanisms. These modules integrate the group's historical and current information into the extracted individual information, further modeling the mobility features. An individual's historical trajectory often reflects their periodicity, while regularity in movement is prevalent within a group. This allows for an effective combination of the group's preference for mobility patterns and the attributes mined from individual trajectories, facilitating a more accurate inference of the trajectory to be recovered. Furthermore, the group's mobility characteristics can also help address the problem of not being able to recover trajectories solely from individual information when individual trajectories are too sparse.
[0114] Specifically, the population transition matrix is calculated using the population trajectory based on the Markov chain. The transition matrix contains the population's general movement patterns as follows:
[0115]
[0116] in, Let f(·) represent the Markov chain for the p-th historical trajectory of all users in the t-th time slot, and M be the time slot of the p-th historical trajectory. p ,t This is the historical transition matrix of the group.
[0117] Similarly, the input to the above formula can be obtained from... Change to The current transition matrix M of the group can then be obtained by calculating the current trajectories of all users according to the formula. n,t .
[0118] Furthermore, individual historical information is fused with group historical information through a historical trajectory attention mechanism. Specifically, historical trajectory attention is similar to the historical trajectory intra-attention mechanism in step S630. This involves representing individual historical characteristics. and the group history transition matrix M p,t A cross-attention mechanism was implemented, which has the same network structure as the historical trajectory intra-attention mechanism described in step S630 above, with the input and related projection matrices replaced, and is represented as follows: After the update, you will get a [something] from [something]. The enhanced historical trajectory is indicated.
[0119] The inter-trajectory attention mechanism module aims to fuse the current trajectory features of the group with the historical trajectory features of the entire group and individuals. Following the same principles as all previous attention mechanisms, it uses the same network structure, replacing the input with historical trajectory representations. and the current transition matrix M of the group n,t The relevant projection matrices are represented as follows: The final trajectory movement features can then be obtained.
[0120] Furthermore, the advancement and effectiveness of the proposed solution were verified through comparison with existing methods. The experiment used trajectory data collected by Microsoft Research Asia, randomly masking 20% of the observations in the dataset as the recovery target. The dataset was divided chronologically, with the first 70% used as the training set, the second 10% as the validation set, and the remaining 20% as the test set. The Recall metric was used for evaluation, and the proposed model achieved superior performance, as shown in Table 1.
[0121] Table 1
[0122] linear model 0.3624 Random Forest 0.2589 Long Short-Term Memory Network 0.2808 Bidirectional Long Short-Term Memory Network 0.3528 The method provided by this invention 0.4169
[0123] In the above specific embodiments, the human movement trajectory recovery method provided by the present invention obtains the current trajectory of the target human body by acquiring the current trajectory of the individual and inputting the current trajectory of the individual human body into a pre-trained trajectory diffusion model to obtain the recovered trajectory of the target human body; wherein, the trajectory diffusion model is trained using the trajectory movement features of the sample and the current trajectory of the sample, and the trajectory movement features of the sample are obtained by fusing the movement features in the current trajectory of the group of samples, the movement features of the individual historical trajectory, and the movement features of the group historical trajectory.
[0124] Thus, the method provided by this invention enables the target human body to recover its trajectory under the guidance of movement patterns. It fully utilizes individual trajectories to capture historical periodicity and group trajectories to capture movement trends. Individual and group information are fused through an attentional mechanism, and movement patterns are modeled based on diffusion models, thereby achieving better trajectory recovery results. This solves the problem of poor accuracy in human movement trajectory recovery in existing technologies, where the recovered trajectory deviates significantly from the true trajectory, thus improving the accuracy of trajectory recovery and reducing the deviation between the recovered trajectory and the true trajectory.
[0125] In addition to the methods described above, the present invention also provides a human movement trajectory recovery device, such as... Figure 8 As shown, the present invention also provides:
[0126] The trajectory acquisition unit 810 is used to acquire the current trajectory of the target human body.
[0127] The trajectory recovery unit 820 is used to input the current trajectory of the target human body into a pre-trained trajectory diffusion model to obtain the recovered trajectory of the target human body.
[0128] The trajectory diffusion model is trained using the trajectory movement features of the samples and the current trajectory of the samples. The trajectory movement features of the samples are obtained by fusing the movement features of the current trajectory of the group, the movement features of the individual historical trajectory, and the movement features of the group historical trajectory.
[0129] In some embodiments, the trajectory diffusion model is obtained by training using the trajectory movement features of the sample and the current trajectory of the sample, specifically including:
[0130] All trajectory data are obtained from the target database to construct a training set, wherein all data points in the trajectory data correspond one-to-one to constitute the sample;
[0131] Periodic features are extracted from the individual historical trajectories of each sample using an individual history processor; a group historical transition matrix is extracted from the group historical trajectory of each sample and a group current transition matrix is extracted from the group current trajectory of each sample using a Markov chain.
[0132] The periodic features and the group historical transition matrix are fused using a historical trajectory attention mechanism to obtain the historical trajectory;
[0133] The current transition matrix of the group is fused with the historical transition matrix of the group based on the inter-trajectory attention mechanism to obtain trajectory movement features;
[0134] The trajectory movement features are input into a pre-built diffusion model for training to obtain the trajectory diffusion model.
[0135] In some embodiments, a periodic feature is extracted from the individual historical trajectory of each sample using an individual history processor, specifically including:
[0136] Multiple individual trajectories are extracted from the sample, and the multiple individual trajectories are aggregated using a history aggregator to obtain an aggregated trajectory;
[0137] Embed the aggregated trajectory into the time slot;
[0138] Based on the similarity between time slots t and k under head h. For the t-th time slot of the p-th historical trajectory of sample u, the displacement-aware embedding is obtained by aggregating the similarity of information from all time slots of the p-th historical trajectory;
[0139] Standard residual connections are added to preserve current motion information, and displacement-aware embeddings for each time slot of the historical trajectory are obtained to obtain periodic feature vectors characterizing the motion properties of an individual's historical trajectory.
[0140] In some embodiments, the similarity between time slots t and k under header h is calculated using the first expression. The first expression is:
[0141]
[0142] in, This indicates that sample u is in the t-th time slot of the p-th historical trajectory. This represents the k-th time slot of the p-th historical trajectory of sample u, where T represents the number of time slots, k represents the current time slot number, and φ (h) This means that each time slot is multiplied by its corresponding transformation matrix, and then the inner product is calculated.
[0143] In some embodiments, the second expression is used to determine the similarity between time slots t and k under header h. For the p-th historical trajectory of sample u in the t-th time slot, the displacement-aware embedding is obtained by aggregating the similarity of information from all time slots of the p-th historical trajectory. The second expression is:
[0144]
[0145] in, It is a transformation matrix.
[0146] In some embodiments, Markov chains are used to extract the population history transition matrix from the population history trajectory of each sample and the population current transition matrix from the population current trajectory of each sample, specifically including:
[0147] The group's historical transition matrix is calculated using the third expression, and the group's current transition matrix is calculated using the fourth expression.
[0148] The third expression is:
[0149]
[0150] in, Let f(·) represent a Markov chain for all samples in the t-th time slot of the p-th historical trajectory, and M be the time slot of the Markov chain. p ,t For the group's historical transition matrix;
[0151] The fourth expression is:
[0152]
[0153] in, Let f(·) represent the time slot of all samples in the current trajectory, and M represent the Markov chain. n,t This is the current transition matrix for the group.
[0154] Figure 9An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 9 As shown, the electronic device may include a processor 910, a communication interface 920, a memory 930, and a communication bus 940, wherein the processor 910, the communication interface 920, and the memory 930 communicate with each other via the communication bus 940. The processor 910 can call logical instructions in the memory 930 to execute a human movement trajectory recovery method, which includes: acquiring the current trajectory of the target human body;
[0155] The current trajectory of the target human body is input into a pre-trained trajectory diffusion model to obtain the recovered trajectory of the target human body;
[0156] The trajectory diffusion model is trained using the trajectory movement features of the samples and the current trajectory of the samples. The trajectory movement features of the samples are obtained by fusing the movement features of the current trajectory of the group, the movement features of the individual historical trajectory, and the movement features of the group historical trajectory.
[0157] Furthermore, the logical instructions in the aforementioned memory 930 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0158] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being able to be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer is able to execute the human body movement trajectory recovery method provided by the above methods, the method including: obtaining the individual current trajectory of the target human body;
[0159] The current trajectory of the target human body is input into a pre-trained trajectory diffusion model to obtain the recovered trajectory of the target human body;
[0160] The trajectory diffusion model is trained using the trajectory movement features of the samples and the current trajectory of the samples. The trajectory movement features of the samples are obtained by fusing the movement features of the current trajectory of the group, the movement features of the individual historical trajectory, and the movement features of the group historical trajectory.
[0161] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the human body movement trajectory recovery method provided by the above methods, the method comprising: acquiring the current trajectory of the target human body;
[0162] The current trajectory of the target human body is input into a pre-trained trajectory diffusion model to obtain the recovered trajectory of the target human body;
[0163] The trajectory diffusion model is trained using the trajectory movement features of the samples and the current trajectory of the samples. The trajectory movement features of the samples are obtained by fusing the movement features of the current trajectory of the group, the movement features of the individual historical trajectory, and the movement features of the group historical trajectory.
[0164] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0165] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0166] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for recovering human movement trajectory, characterized in that, include: Obtain the current trajectory of the target human body; The current trajectory of the target human body is input into a pre-trained trajectory diffusion model to obtain the recovered trajectory of the target human body; The trajectory diffusion model is trained using the trajectory movement features of the samples and the current trajectory of the samples. The trajectory movement features of the samples are obtained by fusing the movement features of the current trajectory of the group, the movement features of the individual historical trajectory, and the movement features of the group historical trajectory. The trajectory diffusion model is obtained by training using the trajectory movement features of the samples and the current trajectory of the samples, specifically including: All trajectory data are obtained from the target database to construct a training set, wherein all data points in the trajectory data correspond one-to-one to constitute the sample; Periodic features are extracted from the individual historical trajectories of each sample using an individual history processor; a group historical transition matrix is extracted from the group historical trajectory of each sample and a group current transition matrix is extracted from the group current trajectory of each sample using a Markov chain; The periodic features and the group historical transition matrix are fused using a historical trajectory attention mechanism to obtain the historical trajectory; The current transition matrix of the group is fused with the historical transition matrix of the group based on the inter-trajectory attention mechanism to obtain trajectory movement features; The trajectory movement features are input into a pre-built diffusion model for training to obtain the trajectory diffusion model.
2. The method for restoring human movement trajectory according to claim 1, characterized in that, Extracting periodic features from the individual historical trajectories of each sample using an individual history processor, specifically including: Multiple individual trajectories are extracted from the sample, and the multiple individual trajectories are aggregated using a history aggregator to obtain an aggregated trajectory; Embed the aggregated trajectory into the time slot; Based on the similarity between slots 𝑡 and 𝑘 under the head ℎ For the nth time slot of the nth historical trajectory of sample n, displacement-aware embedding is obtained by aggregating the similarity of information from all time slots of the nth historical trajectory; Standard residual connections are added to preserve current motion information, and displacement-aware embeddings for each time slot of the historical trajectory are obtained to obtain periodic feature vectors characterizing the motion properties of an individual's historical trajectory.
3. The method for restoring human movement trajectory according to claim 2, characterized in that, The similarity between slots 𝑡 and 𝑘 under the header ℎ is calculated using the first expression. The first expression is: ; ; in, This indicates that sample 𝑢 is in the 𝑡th time slot of the 𝑝th historical trajectory. This indicates that sample 𝑢 is in the 𝑘-th time slot of the 𝑝-th historical trajectory. Indicates the number of time slots. Indicates the current timeslot number. This means multiplying each time slot by its corresponding transformation matrix and then taking the inner product. , They are respectively , The corresponding transformation matrix, It is an inner product function.
4. The method for restoring human movement trajectory according to claim 1, characterized in that, Using the second expression, based on the similarity between slots 𝑡 and 𝑘 under the header ℎ. For the nth time slot of the nth historical trajectory of sample n, the displacement-aware embedding is obtained by aggregating the similarity of information from all time slots of the nth historical trajectory. The second expression is: ; in, It is a transformation matrix.
5. The method for restoring human movement trajectory according to claim 1, characterized in that, Using Markov chains, the population history transition matrix is extracted from the population history trajectory of each sample, and the population current transition matrix is extracted from the population current trajectory of each sample. Specifically, this includes: The group's historical transition matrix is calculated using the third expression, and the group's current transition matrix is calculated using the fourth expression. The third expression is: ; in, For all samples, in the nth time slot of the nth historical trajectory, Represents a Markov chain. For the group's historical transition matrix; The fourth expression is: ; in, For all samples in the current trajectory time slot, Represents a Markov chain. This is the current transition matrix for the group.
6. A human movement trajectory recovery device, characterized in that, include: The trajectory acquisition unit is used to acquire the current trajectory of the target human body. The trajectory recovery unit is used to input the current trajectory of the target human body into a pre-trained trajectory diffusion model to obtain the recovered trajectory of the target human body. The trajectory diffusion model is trained using the trajectory movement features of the samples and the current trajectory of the samples. The trajectory movement features of the samples are obtained by fusing the movement features of the current trajectory of the group, the movement features of the individual historical trajectory, and the movement features of the group historical trajectory. The trajectory diffusion model is obtained by training using the trajectory movement features of the samples and the current trajectory of the samples, specifically including: All trajectory data are obtained from the target database to construct a training set, wherein all data points in the trajectory data correspond one-to-one to constitute the sample; Periodic features are extracted from the individual historical trajectories of each sample using an individual history processor; a group historical transition matrix is extracted from the group historical trajectory of each sample and a group current transition matrix is extracted from the group current trajectory of each sample using a Markov chain; The periodic features and the group historical transition matrix are fused using a historical trajectory attention mechanism to obtain the historical trajectory; The current transition matrix of the group is fused with the historical transition matrix of the group based on the inter-trajectory attention mechanism to obtain trajectory movement features; The trajectory movement features are input into a pre-built diffusion model for training to obtain the trajectory diffusion model.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the human movement trajectory recovery method as described in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the human movement trajectory recovery method as described in any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the human movement trajectory recovery method as described in any one of claims 1 to 5.