A Pedestrian Collision Warning Method Based on Trajectory Prediction
By encoding and latent space coding of pedestrians' historical trajectories, predicting the end of the trajectory, the problem of pedestrian collision warning is solved, and efficient collision warning and accident prevention is achieved.
Patent Information
- Application Number
- CN202210537823.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-05-17
AI Technical Summary
With the popularity of population density and pedestrian facilities, the probability of pedestrian collision increases, resulting in personnel conflicts and injuries, and it is difficult for existing technology to effectively conduct real-time collision detection and early warning.
By analyzing the pedestrian's historical trajectory, the trajectory information is encoded using the historical trajectory encoder and the trajectory end point encoder, and combining the latent space encoder and decoder, the trajectory end point is predicted to perform collision warning.
It effectively reduces the probability of pedestrian collision accidents, improves the accuracy and accuracy of collision warnings, and is suitable for intensive flow of people.
Smart Images

Figure CN115017245B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of trajectory prediction, and in particular relates to a pedestrian collision warning method based on trajectory prediction. Background Art
[0002] With the increase in population density and the popularization of pedestrian facilities in my country, the density of pedestrians in places such as pedestrian streets and playgrounds has increased rapidly. In addition, the impact of smartphones on pedestrians has increased the probability of collisions between pedestrians, leading to more conflicts between people, and in serious cases, injuries caused by collisions, which in turn lead to civil disputes.
[0003] Therefore, there is an urgent need for a method that can detect possible collisions in real time, effectively warn of collisions, and reduce the probability of accidents. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention provides a pedestrian collision warning method based on trajectory prediction, which can effectively warn of collisions and reduce the probability of accidents by analyzing the historical trajectories of pedestrians and predicting the pedestrian trajectories and destinations in advance.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] The embodiment of the present invention provides a pedestrian collision warning method based on trajectory prediction, and the warning method comprises the following steps:
[0007] S1, filter out the data with collision and trajectory overlap in the dense crowd flow dataset to generate a trajectory collision dataset;
[0008] S2, for each sample in the trajectory collision dataset, extract the corresponding pedestrian's historical trajectory, where pedestrian p j With p k The historical trajectories of and The end points of the trajectories are set to and
[0009] S3, using the historical trajectory encoder E past Encode the historical trajectory of the pedestrian extracted in step S2 and convert the image information into an array to obtain and Using track end encoder E end Encode the end point of the trajectory and get and
[0010] S4, the above step S3 obtained and Cascade, input to the latent space encoder E latent , we get the latent variables that characterize the variational autoencoder The specific calculation method of the parameters is as follows:
[0011]
[0012]
[0013] S5, sample the possible trajectory endpoints according to the latent variable parameters, and compare the sampling results with After cascading, it is sent to the latent space decoder D latent , get the prediction of the end point of the trajectory;
[0014] S6: Provide a collision warning to the pedestrian based on the predicted trajectory and destination.
[0015] Furthermore, in step S1, the specific steps of generating the trajectory collision data set are as follows:
[0016] S11: within the comparison range L, preset the collision warning distance DT1 and the collision safety distance DT2, and input the trajectory data set Perform trajectory calculation, where
[0017] S12, generate trajectory collision dataset
[0018] in,
[0019]
[0020] Furthermore, in step S5, the specific steps of predicting the trajectory endpoint are as follows:
[0021] S51, sampling the possible trajectory endpoints according to the latent variable parameters, and sampling the pedestrian p j With p k The end point of the trajectory and To make a prediction, the calculation formula is as follows:
[0022]
[0023]
[0024] S52, the trajectory end point obtained in the above step S51 and Respect and historical trajectory and Cascade to get collision prediction for the endpoint constraint and
[0025] S53, the collision prediction value obtained according to the above steps and Cascade and send to the collision label prediction subnetwork P label , predict the collision label and collision center coordinates of the endpoint constraint, and get the collision label of the predicted endpoint constraint The coordinates of the collision center with the endpoint constraint The calculation formula is as follows:
[0026]
[0027]
[0028] Among them, in order to perform end-to-end training of the complete network, the loss function is designed as follows:
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035] Among them, KLD is the divergence term used to train the variational autoencoder; AEL is the trajectory endpoint error term used to train the trajectory endpoint encoder E end , History track encoder E past , latent space encoder E latent , Latent Space Decoder D latent ;ATL is the trajectory prediction loss term used to train the trajectory prediction subnetwork P future and related pre-processing modules; CLL is the collision label prediction loss term used to train the collision label prediction subnetwork P label and related pre-processing modules; CCL is the collision center coordinate prediction loss term used to train the collision center coordinate prediction subnetwork P coord And related pre-processing modules.
[0036] Furthermore, the collision detection index includes precision, accuracy, recall rate, F1 score and collision center coordinate prediction error; wherein the collision center coordinate error is the l2-distance between the predicted collision center coordinate and the true collision center coordinate, and the specific calculation formula is as follows:
[0037]
[0038]
[0039]
[0040]
[0041]
[0042] Beneficial effects:
[0043] First, the pedestrian collision warning method based on trajectory prediction proposed in the present invention can effectively warn of collisions and reduce the probability of accidents by analyzing sample data sets, obtaining the historical trajectories of pedestrians, and predicting pedestrian trajectories and endpoints.
[0044] Second, the pedestrian collision warning method based on trajectory prediction proposed in the present invention avoids unnecessary calculations by screening out data clusters with collisions and trajectory overlaps in dense pedestrian flow data sets to meet the scenarios and environments studied by the algorithm, while excluding some interference items and improving the accuracy of parameters.
[0045] Third, the pedestrian collision warning method based on trajectory prediction proposed in the present invention ensures the accuracy and precision of the data by performing pedestrian collision detection on the predicted trajectory and the end point twice. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 The figure is a schematic diagram of an algorithm flow of a pedestrian collision warning method based on trajectory prediction according to an embodiment of the present invention.
[0047] Figure 2 Schematic diagram of a data set algorithm flow of a pedestrian collision warning method based on trajectory prediction according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following examples will enable those skilled in the art to more fully understand the present invention, but are not intended to limit the present invention in any way.
[0049] Figure 1 Schematic diagram of the algorithm flow of a pedestrian collision warning method based on trajectory prediction according to an embodiment of the present invention. This embodiment proposes a pedestrian collision warning method based on trajectory prediction, which includes the following steps:
[0050] S1, filter out the data with collision and trajectory overlap in the dense crowd flow dataset to generate a trajectory collision dataset.
[0051] S2, for each sample in the trajectory collision dataset, extract the corresponding pedestrian's historical trajectory, where pedestrian pj With p k The historical trajectories of and The end points of the trajectories are set to and
[0052] S3, using the historical trajectory encoder E past Encode the historical trajectory of the pedestrian extracted in step S2 and convert the image information into an array to obtain and Using track end encoder E end Encode the end point of the trajectory and get and
[0053] S4, the above step S3 obtained and Cascade, input to the latent space encoder E latent , we get the latent variables that characterize the variational autoencoder The specific calculation method of the parameters is as follows:
[0054]
[0055]
[0056] S5, sample the possible trajectory endpoints according to the latent variable parameters, and compare the sampling results with After cascading, it is sent to the latent space decoder D latent , and obtain the prediction of the end point of the trajectory.
[0057] S6: Provide a collision warning to the pedestrian based on the predicted trajectory and destination.
[0058] 1. Obtaining sample data sets
[0059] The detection area is selected, and the data with collision and trajectory overlap in the dense crowd flow data set are screened out to generate the corresponding sample data set.
[0060] 2. Extracting Pedestrians’ Historical Trajectory
[0061] Figure 2 The data set algorithm flow diagram of the pedestrian collision warning method based on trajectory prediction according to an embodiment of the present invention is shown in FIG. In this embodiment, within the comparison range L, a collision warning distance DT1 and a collision safety distance DT2 are set.
[0062] By performing data advance on each sample in the dataset, we set the pedestrian p j With p k The historical track Trace and End of track and
[0063] Input: Trajectory dataset in
[0064] Output: trajectory collision dataset in
[0065] The historical trajectory data is obtained through the above calculation.
[0066] 3. Coding
[0067] Through the historical trajectory encoder, we can convert the trajectory information of people in the video into parameters that can be recognized by the latent space encoder. That is, the image information is converted into an array to facilitate the input of the latent space encoder. past Encode the historical trajectory and get and
[0068] Encode the filtered endpoint information and use the endpoint track encoder to encode the endpoint coordinates. end Encode the end point of the trajectory and get and
[0069] 4. Obtaining the parameters of latent variables
[0070] The parameters generated according to the above steps are cascaded into the latent space encoder. and and Cascaded into the latent space encoder E latent , we get the latent variables that characterize the variational autoencoder The specific calculation method is as follows:
[0071]
[0072]
[0073] 5. Predicting trajectory and endpoint
[0074] The possible endpoint trajectories are sampled according to the latent variable parameters and sent to the decoder to obtain the prediction of the trajectory endpoint. After cascading, it is sent to the latent space decoder D latent , and obtain the prediction of the end point of the trajectory.
[0075]
[0076]
[0077] Get the pedestrian p j With p k The trajectory endpoint prediction Then, they are respectively compared with the historical trajectory Cascade to get the collision prediction input of the end point constraint
[0078] Will After cascading, it is sent to the collision label prediction subnetwork P label , get the collision label prediction of the endpoint constraint:
[0079]
[0080] Will After cascading, it is sent to the collision center coordinate prediction subnetwork P coord , get the prediction of the collision center coordinates of the endpoint constraint:
[0081]
[0082] For end-to-end training of the complete network, the loss function is designed as follows:
[0083]
[0084] Among them, KLD is the divergence term used to train the variational autoencoder; AEL is the trajectory endpoint error term used to train the trajectory endpoint encoder E end , History track encoder E past , latent space encoder E latent , Latent Space Decoder D latent ;ATL is the trajectory prediction loss term used to train the trajectory prediction subnetwork P future and related pre-processing modules; CLL is the collision label prediction loss term used to train the collision label prediction subnetwork P label and related pre-processing modules; CCL is the collision center coordinate prediction loss term used to train the collision center coordinate prediction subnetwork P coord And related pre-processing modules, the specific calculation formula is as follows:
[0085]
[0086]
[0087]
[0088]
[0089]
[0090] Among them, the collision detection indicators are as follows:
[0091]
[0092]
[0093]
[0094]
[0095]
[0096] Accuracy is accuracy; Precision is accuracy; Recall is recall rate; F1-score is F1 score; Coord Error is the prediction error of the collision center coordinates, that is, the l2-distance between the predicted collision center coordinates and the actual collision center coordinates.
Claims
1. A pedestrian collision warning method based on trajectory prediction, characterized in that: The early warning method comprises the following steps: S1, filter out the data with collision and trajectory overlap in the dense crowd flow dataset to generate a trajectory collision dataset; S2, for each sample in the trajectory collision dataset, extract the corresponding pedestrian's historical trajectory, where pedestrian p j With p k The historical trajectories of and The end points of the trajectories are set to and S3, using the historical trajectory encoder E past Encode the historical trajectory of the pedestrian extracted in step S2 and convert the image information into an array to obtain and Using track end encoder E end Encode the end point of the trajectory and get and S4, the above step S3 obtained and Cascade, input to the latent space encoder E latent , we get the latent variables that characterize the variational autoencoder The specific calculation method of the parameters is as follows: S5, sample the possible trajectory endpoints according to the latent variable parameters, and compare the sampling results with After cascading, it is fed into the latent space decoder d latent , get the prediction of the end point of the trajectory; S6, providing collision warning to pedestrians based on the predicted trajectory and destination; In step S5, the specific steps for predicting the trajectory endpoint are as follows: S51, sampling the possible trajectory endpoints according to the latent variable parameters, and sampling the pedestrian p j With p k The end point of the trajectory and To make a prediction, the calculation formula is as follows: S52, the trajectory end point obtained in the above step S51 and Respect and historical trajectory and Cascade to get collision prediction for the endpoint constraint and S53, based on the collision prediction value obtained in the above steps and Cascade and send to the collision label prediction subnetwork P label , predict the collision label and collision center coordinates of the endpoint constraint, and get the collision label of the predicted endpoint constraint The coordinates of the collision center with the endpoint constraint The calculation formula is as follows: Among them, in order to perform end-to-end training of the complete network, the loss function is designed as follows: Among them, KLD is the divergence term used to train the variational autoencoder; AEL is the trajectory endpoint error term used to train the trajectory endpoint encoder E end , History track encoder E past , latent space encoder E latent , Latent Space Decoder D latent ;ATL is the trajectory prediction loss term used to train the trajectory prediction subnetwork P future and related pre-processing modules; CLL is the collision label prediction loss term used to train the collision label prediction subnetwork P label and related pre-processing modules; CCL is the collision center coordinate prediction loss term used to train the collision center coordinate prediction subnetwork P coord And related pre-processing modules.
2. The pedestrian collision warning method based on trajectory prediction according to claim 1, characterized in that: In step S1, the specific steps of generating the trajectory collision data set are as follows: S11: within the comparison range L, preset the collision warning distance DT1 and the collision safety distance DT2, and input the trajectory data set Perform trajectory calculation, where S12, generate trajectory collision dataset in, 3. The pedestrian collision warning method based on trajectory prediction according to claim 1, characterized in that: The collision detection indicators include precision, accuracy, recall rate, F1 score and collision center coordinate prediction error; wherein the collision center coordinate error is the l2-distance between the predicted collision center coordinate and the true collision center coordinate, and the specific calculation formula is as follows:
Citation Information
Patent Citations
Video-based real-time early warning method and system for ship-bridge and inter-ship collision
CN112581795A
Pedestrian trajectory prediction method, apparatus and device, and storage medium
CN114155270A