Seq2Seq-AM model construction method and pedestrian trajectory prediction and safety risk early warning method

Through the Seq2Seq-AM model, combining sequence-to-sequence network, long-term memory network and attention mechanism, the characteristics of velocity components, Gaussian core local density and occupancy matrix are combined, and the accuracy of pedestrian trajectory prediction and safety risk assessment in the prior art is solved, and more accurate pedestrian trajectory prediction and population risk assessment are achieved.

CN119599208AActive Publication Date: 2025-03-11JIANGSU UNIV

Patent Information

Application Number
CN202411689330.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-11
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

In the pedestrian trajectory prediction and safety risk assessment, it is difficult to accurately capture pedestrian interactions and dynamic interactions, resulting in poor prediction results and inaccurate risk assessment.

Method used

The Seq2Seq-AM model is adopted, combining sequence-to-sequence network, long-term memory network and attention mechanism, and fusing the characteristics of velocity components, Gaussian core local density and occupancy matrix to achieve accurate prediction of pedestrian trajectory and real-time assessment of population risks.

Benefits of technology

It improves the accuracy of pedestrian trajectory prediction, can portray pedestrian dynamics more closely related to actual conditions, and provides accurate safety risk assessment and real-time early warning through detailed risk level classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119599208A_ABST
    Figure CN119599208A_ABST
Patent Text Reader

Abstract

The invention provides a Seq2Seq-AM model construction method and a pedestrian trajectory prediction and safety risk early warning method. Firstly, a Seq2Seq-AM model is constructed, and the Seq2Seq-AM model is composed of an encoder module, an attention mechanism module and a decoder module; the encoder module extracts context information of an input feature sequence, the attention mechanism module performs weighting processing on input at an important moment, the decoder module outputs a variable-length prediction sequence, and the model can adaptively pay attention to key features in a pedestrian trajectory. Pedestrians in the scene can be predicted by using the Seq2Seq-AM model. According to the method, a crowd pressure index is introduced, pressure value ranges of three typical pedestrian motion states are calculated based on a pedestrian prediction result, safety risks in crowd motion are graded, and low, medium and high risk levels are divided. Finally, real-time risk early warning of the crowd gathering area is realized through risk level division, and safety risk assessment support is provided for safety management in high-density scenes such as major activities and transportation hubs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent transportation, and in particular to a pedestrian trajectory prediction and safety risk warning method based on a sequence-to-sequence network (Seq2Seq), a long short-term memory network (LSTM) and an attention mechanism (Attention). Background Art

[0002] With the improvement of urbanization and the increase in people's travel frequency, large-scale and high-density crowds often gather in public places such as train stations, subway stations, and stadiums. If there is a lack of effective pedestrian management measures at this time, and the safety risks of the crowd cannot be assessed and warned in a timely and accurate manner, it is easy to cause tragic safety accidents. Therefore, in order to ensure the safe evacuation of the crowd in emergencies, it is very important to study the characteristics of pedestrian movement and establish a safety risk assessment mechanism.

[0003] At present, the research methods for crowd motion can be divided into three categories: pedestrian motion experiments, knowledge-driven (physical rules) pedestrian motion modeling, and data-driven pedestrian motion prediction models. Each method focuses on different research perspectives and represents different development stages of crowd motion characteristics research.

[0004] Pedestrian motion experiments usually record pedestrian motion videos through cameras and conduct quantitative analysis of video data to capture the movement characteristics of pedestrians under different environments and density conditions. The experimental scenarios cover typical spaces such as one-way flow, multi-directional flow, bottleneck channels, intersections, and stairs. By collecting and analyzing these data, researchers can measure indicators such as pedestrian speed, acceleration, density, and flow, and then reveal the flow characteristics of pedestrians under different spatial and behavioral conditions. Relevant experimental studies on pedestrian motion can provide a real and reliable data basis for subsequent modeling and prediction, but it is limited by experimental scenarios, cost, safety and other factors, making experiments under specific conditions difficult to implement. At the same time, due to the adaptability of individuals participating in the experiment to the environment, there may be deviations between the simulation results and the actual situation.

[0005] The modeling method based on knowledge-driven (physical rules) focuses on using physical rules and behavioral assumptions to simulate the movement patterns of pedestrians. The model attempts to theoretically explain the movement patterns of people in different scenarios by simulating the interaction between pedestrians, the avoidance behavior with obstacles, and the perception of the surrounding environment. Representative models include the social force model (SFM), the cellular automaton model (CA), and the agent-based model. The model simulates the movement behavior of pedestrians in emergency evacuation under different scenarios and density conditions by setting rules, such as the repulsion and attraction between pedestrians and the individual's preference for space. However, the knowledge-driven modeling method relies more on the support of specific experimental data in parameter selection, and the design of model rules is difficult to fully cover the behavior of pedestrians, and the generalization in multi-scenario applications will be subject to certain limitations.

[0006] In contrast, data-driven pedestrian motion prediction models fully rely on deep learning algorithms to learn the complex motion patterns contained in the data by training large-scale pedestrian trajectory data. The core of this type of method is to use deep neural network structures, such as long short-term memory networks (LSTM), gated recurrent units (GRU), and generative adversarial networks (GANs) to capture the spatiotemporal dependencies in pedestrian motion, thereby making accurate trajectory predictions. Data-driven models not only reduce the reliance on specific experimental scenarios and physical assumptions, but also have the ability to make predictions in high-dimensional environments, showing good adaptability in dynamic and high-density scenarios. However, most existing data-driven trajectory prediction studies tend to only focus on the historical trajectory characteristics of pedestrians, ignoring the influence of interactions between pedestrians during the motion process. In addition, relying solely on encoders cannot extract all motion features, resulting in the omission of some important information, making it difficult to fully reflect the dynamic interaction between pedestrians, which in turn affects the accurate prediction of pedestrian dynamics and the assessment and early warning of crowd risks. Summary of the invention

[0007] In view of the shortcomings of the prior art, the present invention proposes a Seq2Seq-AM model construction method and a pedestrian trajectory prediction and safety risk warning method. By combining a sequence to sequence network (Seq2Seq) and an attention mechanism (AM), the accurate prediction of pedestrian movement trajectories can be achieved, and crowd pressure and risk levels can be evaluated, thereby achieving real-time monitoring and early warning of crowd dynamics. This method is suitable for densely populated areas, especially in emergency evacuation, major events, and transportation hubs. It has a wide range of application value.

[0008] The following are the implementation steps of the present invention:

[0009] A method for constructing a Seq2Seq-AM model for pedestrian trajectory prediction. The construction process is as follows:

[0010] Step S1, constructing an encoder module of a Seq2Seq-AM model, where the encoder module is used to extract context information of an input feature sequence;

[0011] Step S2, constructing an attention mechanism module of the Seq2Seq-AM model, which performs weighted processing on the input of important moments;

[0012] Step S3, constructing a decoder module of the Seq2Seq-AM model, the decoder module outputs a variable length prediction sequence;

[0013] Step S4: training and reasoning the Seq2Seq-AM model constructed above.

[0014] Further, the method to construct the encoder module is:

[0015] Step S1.1, input feature sequence of continuous observation time series Among them, t s and t e Indicates the start and end time of the observation sequence, x t is the input feature at time t;

[0016] Step S1.2: The encoder generates the hidden state h at the current moment based on the input feature sequence and the hidden state at the previous moment. m , m = t s ,t s +1,…,t e ;

[0017] Step S1.3, the last moment t=t e The hidden state h te Contains the context information of the input sequence as the initial input state S0 of the decoder.

[0018] Furthermore, the method of constructing the attention mechanism module is:

[0019] Step S2.1, at each time t in the decoding process, calculate the encoder hidden state h m With the decoder's current hidden state S t-1 The relevance score

[0020] Step S2.2, score the relevance Normalize and get the attention weight a m,t ;

[0021] Step S2.3, based on the attention weight am,t The corresponding hidden state h m Calculate the dynamic semantic vector C t .

[0022] Further, the method of constructing the decoder module is:

[0023] Step S3.1: The decoder receives the inference output y generated at the previous moment t-1 , the hidden state S at the previous moment t-1 and dynamic semantic vector C t-1 ;

[0024] Step S3.2, based on the input of step S3.1, calculate the hidden state S at the current moment t ;

[0025] Step S3.3, the attention mechanism calculates the dynamic semantic vector C at the current time t t , and compare it with the current hidden state S t After concatenation, the fully connected layer (FC) is used to adjust the output dimension to the required value, and the predicted output y at the current time t is calculated. t .

[0026] A pedestrian trajectory prediction method comprises the following steps:

[0027] Step S1, collect the scene and the pedestrian trajectory data in the scene, extract the individual scale features and collective scale features, the individual scale features are used to describe the current motion state of the pedestrian, including the pedestrian horizontal speed v x and vertical velocity v y Components; the collective scale features include occupancy matrix and local density.

[0028] Step S2: Input the personal scale features and collective scale features extracted in step S1 into the Seq2Seq-AM model to predict the pedestrian trajectory.

[0029] Furthermore, the specific process of data collection and feature processing in step S1 includes:

[0030] Step S1.1, collecting the scene and the pedestrian trajectory data in the scene, and recording the pedestrian position coordinate information (x, y);

[0031] Step S1.2, extracting individual scale features and collective scale features based on the data;

[0032] Step S1.2.1, calculate the horizontal speed of pedestrian i at time t and vertical speed Components, constitute the velocity vector, and obtain the individual scale characteristics;

[0033] Step S1.2.2, gridding the scene, in which the grid where the target pedestrian is located is the occupancy unit (a, b) of the target pedestrian i, and an occupancy matrix is ​​constructed from several grid areas around the target pedestrian i with the target pedestrian i as the center; a discriminant function is used to determine whether pedestrian j is within the occupancy matrix range of the target pedestrian i; and the local density of the occupancy unit (α, b) where the target pedestrian i is located at time t is calculated;

[0034] Step S1.3, normalize the extracted personal scale features and collective scale features.

[0035] Furthermore, the discriminant function is expressed as follows:

[0036]

[0037] in, is the occupancy matrix discriminant function of pedestrian i in the occupied unit (a, b), 1 ab is the count value within the range, and N is the total number of pedestrians.

[0038] Furthermore, the local density calculation formula is as follows:

[0039]

[0040] Among them, the Gaussian kernel function f is the distance weight function that describes the influence of neighbor pedestrian j on target pedestrian i; and represents the position of pedestrian j and pedestrian i at time t; R is the distance parameter, N i Represents the total number of neighboring pedestrians in the neighborhood of the occupied unit (α, b) where the target pedestrian i is located.

[0041] Furthermore, in step S2, the process of using the constructed model to perform sequence reasoning to obtain the predicted trajectory is as follows:

[0042] Step S2.1: The encoder module receives the individual scale features and the collective scale features. The encoder generates the current hidden state h based on the input feature sequence and the hidden state at the previous moment. m ; Encode the three features of the individual scale and the collective scale separately, and concatenate all the temporal features into a potential representation And the potential representation of the last moment is passed to the decoder as the initial input S0;

[0043] Step S2.2, the attention mechanism module combines the encoder hidden state h m and the decoder's current hidden state S t-1 , calculate the attention weight α m,t , and generate the dynamic semantic vector C at the current momentt and the decoder’s hidden state S t ;

[0044] Step S2.3: The decoder receives the inference output y generated at the previous moment t-1 , the hidden state S at the previous moment t-1 and dynamic semantic vector C t-1 And splicing, adjusting the output dimension through the fully connected layer (FC), mapping to the output space, generating the current inference time t = t e +1 predicted output;

[0045] Step S2.4, calculate the pedestrian position based on the predicted output and update the current inference time t e +1 position, local density, and adjacency occupancy matrix will update t e The local density and adjacency occupancy matrix at the last moment of the sliding window are used as the input, and iterative reasoning is continued until the complete output sequence [y1,...,y t ].

[0046] A pedestrian safety risk early warning method comprises the following steps:

[0047] Step S1, calculating crowd pressure, determining pedestrian flow status and risk classification corresponding to pedestrian flow status based on crowd pressure, and completing safety risk assessment;

[0048] Step S2, conduct real-time risk warning based on the risk levels; when the risk is low, normal passage is allowed; when the risk is medium, precautions are prompted; when the risk is high, it is indicated that the potential risk is further aggravated and intervention measures are recommended.

[0049] Compared with the prior art, the beneficial results of the present invention are:

[0050] (1) Based on the Seq2Seq and attention mechanism method, the relative motion changes between pedestrians and their surroundings are effectively captured by fusing the feature inputs of velocity components, Gaussian kernel local density, and occupancy matrix, so that the model's portrayal of pedestrian dynamics is closer to the actual situation and can more accurately predict pedestrian trajectories.

[0051] (2) In terms of risk assessment, based on crowd pressure indicators, the crowd pressure ranges under three typical pedestrian movement states were determined, and the crowd risk was divided into three levels: low risk, medium risk, and high risk. The risk level division quantifies the degree of danger of crowd gathering and provides an accurate reference for safety management.

[0052] (3) Based on the risk level classification, the level indicators can be used to evaluate crowd risks in different scenarios. When the real-time detected time series risk fluctuation increases, it indicates that the risk of crowd accidents has increased significantly, reminding managers to take intervention measures to reduce safety risks. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 Schematic diagram of the model framework of Seq2Seq-AM.

[0054] Figure 2 Schematic diagram of the working mechanism of relevance scoring.

[0055] Figure 3 Schematic diagram of the entire process of model temporal reasoning.

[0056] Figure 4 A schematic diagram of the occupancy matrix. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical scheme and advantages of the present invention clearer, 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 used to limit the present invention, that is, the embodiments described are only part of the embodiments of the present invention, rather than all of the embodiments. Therefore, the following detailed description of the embodiments provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0058] Embodiment 1:

[0059] A method for constructing a Seq2Seq-AM model for pedestrian trajectory prediction. The Seq2Seq-AM model framework designed by the present invention is as follows: Figure 2 As shown in the figure, it consists of three modules: encoder, attention mechanism and decoder. The encoder module extracts the context information of the input feature sequence, the attention mechanism module performs weighted processing on the input of important moments, and the decoder module outputs a variable-length prediction sequence. This framework design enables the model to adaptively focus on the key features in the pedestrian trajectory and improve the accuracy of trajectory prediction.

[0060] More specifically, the construction process of the Seq2Seq-AM model is as follows:

[0061] Step S1, Encoder module, including:

[0062] Step S1.1, encoder input feature processing, input continuous observation time sequence input feature sequence Among them, t s and t e Indicates the start and end time of the observation sequence, x t is the input feature at time t.

[0063] Step S1.2, hidden state generation, at each time t, the encoder generates the current hidden state h based on the input feature sequence and the hidden state at the previous time m , m = t s ,t s +1,…,t e .

[0064] Step S1.3, context information storage, the last time t = t e The hidden state h te Contains the context information of the input sequence as the initial input state S0 of the decoder.

[0065] Step S2, Attention Mechanism module, including:

[0066] Step S2.1, correlation score calculation, see the schematic diagram Figure 2 , at each time t in the decoding process, calculate the encoder hidden state h m With the decoder's current hidden state S t-1 The relevance score Determine the importance and relevance scores of each hidden state The calculation formula is as follows:

[0067]

[0068] In which, each moment t of the decoding process is e +1 to t p , t e +1 and t p Indicates the start and end time of the model's temporal reasoning. V represents a trainable vector; w h , w s They represent the trainable weights of the encoder hidden state and the trainable weights of the decoder's current hidden state, respectively.

[0069] Step S2.2: Weight normalization, using Softmax function to score the correlation Normalize and get the attention weight a m,t , used to dynamically adjust the importance of input at each moment, the attention weight a m,t The calculation formula is as follows:

[0070]

[0071] Step S2.3, dynamic semantic vector generation, based on attention weight a m,t (t=t e ,t e +1,…,t p ) and the corresponding hidden state h m (m=t s ,t s +1,…,t e ), calculate the dynamic semantic vector C t , and its calculation formula is as follows:

[0072]

[0073] Dynamic semantic vector C t As decoding input, it can focus on the key moments in pedestrian movement.

[0074] Step S3, a decoder module, comprising:

[0075] Step S3.1, decoder input construction. During the decoding process, at each time t, the decoder receives the inference output y generated at the previous time t-1 , the hidden state S at the previous moment t-1 and dynamic semantic vector C t-1 .

[0076] Step S3.2, hidden state update, the decoder uses the above input vector to calculate the hidden state S at the current moment t , the calculation formula is as follows:

[0077]

[0078] Among them, tanh is the activation function, and its value range is (-1,1); L represents the LSTM unit; b s Represents a trainable offset.

[0079] Step S3.3, fully connected layer mapping, attention mechanism calculates the dynamic semantic vector C at the current time t t , and compare it with the current hidden state S t After concatenation, the fully connected layer (FC) is used to adjust the output dimension to the required value, and the predicted output y at the current time t is calculated. t , expressed as:

[0080] y t =w FC ·cat(C t ,St )+b FC

[0081] Among them, w FC , b FC denote trainable weights and offsets respectively; cat(·) denotes a vector concatenation operation.

[0082] Step S4, training and reasoning the above model, including:

[0083] The training data is divided into training set, validation set and test set in proportion (6:2:2), and the mean square error (MSE) is used as the loss function, and Adam is used to optimize the model parameters. The model is trained based on the Pytorch framework, and the model hyperparameters are tuned through the validation set, and finally the key hyperparameter settings such as batch size, hidden layer dimension, learning rate and iteration rounds are determined.

[0084] In this embodiment, in order to evaluate the prediction performance of the attention sequence to sequence network (Seq2Seq-AM) model, the average displacement error (Average Displacement Error, ADE) and the final displacement error (Final Displacement Error, FDE) are selected as evaluation indicators. The smaller the evaluation index value, the higher the prediction accuracy of the model. The calculation formula is as follows:

[0085]

[0086] in, and are the predicted and actual positions of pedestrian i at time t; N is the total number of pedestrians; T is the length of the inference time series; ||·|| represents the Euclidean distance.

[0087] When the evaluation effect of the Seq2Seq-AM model reaches the expected accuracy, the trained model is saved, and the pedestrians in different scenarios in the test set are used for trajectory prediction and risk warning.

[0088] Example 2

[0089] Based on the Seq2Seq-AM model constructed above, the present invention also proposes a pedestrian trajectory prediction method, which includes the following steps:

[0090] Step S1, collect the scene and the pedestrian trajectory data in the scene, extract the individual scale features and collective scale features, the individual scale features are used to describe the current motion state of the pedestrian, including the pedestrian horizontal speed (v x ) and vertical velocity (v y ) components; the collective scale features include occupancy matrix and local density.

[0091] Step S2: Input the personal scale features and collective scale features extracted in step S1 into the Seq2Seq-AM model to predict the pedestrian trajectory.

[0092] More specifically, the specific process of data collection and feature processing in step S1 includes:

[0093] Step S1.1, collect the scene and pedestrian trajectory data in the scene through cameras, sensors and other equipment, and record the pedestrian position coordinate information (x, y).

[0094] Step S1.2, feature classification of the collected data. The features of the data are divided into individual scale features and collective scale features. The individual scale features are used to describe the motion state of pedestrians, while the collective scale features are used to describe the impact of the surrounding environment on the target pedestrians. The method of extracting individual scale features and collective scale features based on the data is as follows:

[0095] Step S1.2.1, individual scale feature extraction.

[0096] The magnitude and direction of speed have an important impact on pedestrians' movement decisions. By calculating the horizontal speed of each pedestrian and vertical speed The components form a velocity vector, which is used to describe the current motion state of the pedestrian. The calculation formulas for the horizontal velocity component and the vertical velocity component of the target pedestrian i at time t are as follows:

[0097]

[0098] in, are the horizontal velocity component and vertical velocity component of pedestrian i at time t, respectively. and It represents the horizontal and vertical coordinate position of pedestrian i at time t, and Δt is the time change.

[0099] Step S1.2.2, collective scale feature extraction.

[0100] (1) Scene gridding: The study area is divided into m×n grids of size 0.5m×0.5m.

[0101] (2) Construction of occupancy matrix. Since pedestrians make decisions based on the observation of the surrounding environment information, such decisions are mainly limited to the local neighboring area. Therefore, in the above m×n grid area, the grid where the target pedestrian is located is the occupancy unit (a, b) of the target pedestrian i, and the 5×5 grid areas around the target pedestrian i are used as its neighboring environment range, thereby constructing a 5×5 occupancy matrix. The occupancy matrix can be used to determine the position of neighboring pedestrians, that is, the discriminant function is used to determine the coordinates of pedestrian j. Is it within the occupancy matrix range of the target pedestrian i? If pedestrian j is within this range, the corresponding index unit of the matrix is ​​recorded as 1, otherwise it is recorded as 0. See the schematic diagram for Figure 3 The discriminant function is expressed as follows:

[0102]

[0103] in, is the occupancy matrix discriminant function of pedestrian i in the occupied unit (a, b), 1ab is the count value in the range, and N is the total number of pedestrians.

[0104] (3) Local density calculation. The local density of the occupied unit (α, b) where the target pedestrian i is located at time t is The calculation formula is as follows:

[0105]

[0106] Among them, the Gaussian kernel function f is the distance weight function that describes the influence of neighbor pedestrian j on target pedestrian i; and represents the position of pedestrian j and pedestrian i at time t; set the distance parameter R = 1.77m, N i Represents the total number of neighboring pedestrians in the neighborhood of the occupied unit (α, b) where the target pedestrian i is located.

[0107] Step S1.3, normalize the personal scale features and collective scale features extracted in step S1.2 above, label data ( and ) maintains the original value to ensure the consistency of input and output data, improve the generalization ability of the model, and reduce the interference of feature scale differences on model training.

[0108] Step S2: This method uses a sliding window reasoning method to divide the time series into continuous window segments of equal length, and updates the feature input at the end of the window to gradually generate the prediction for the next moment. That is, based on the individual scale features and the collective scale features, the constructed model is used to perform sequence reasoning to obtain the prediction trajectory; the whole reasoning process can be seen in Figure 3 , the prediction process is as follows:

[0109] Step S2.1: The encoder module receives the individual scale features and the collective scale features. The encoder generates the current hidden state h based on the input feature sequence and the hidden state at the previous moment. m .

[0110] In the encoder module, the three features of the individual scale and the collective scale are encoded separately, and all temporal features are concatenated end to end into a latent representation. The calculation formula is as follows:

[0111]

[0112] in, is the LSTM encoder of the velocity component; is the LSTM encoder of the occupancy matrix; is the encoder of local density; is the hidden state of the velocity component encoder at time t-1; is the hidden state of the occupancy matrix encoder at time t-1; is the hidden state of the local density encoder at time t-1.

[0113] And the latent representation of the last moment is passed to the decoder as the initial input S0.

[0114] Step S2.2, the attention mechanism module is used as an intermediate layer, combined with the encoder hidden state h m and the decoder's current hidden state S t-1 (hidden state at the previous moment), calculate the attention weight α m,t , and generate the dynamic semantic vector C at the current moment t and the decoder’s hidden state S t .

[0115] Step S2.3: The decoder module predicts the current moment based on the output of the attention mechanism module and the encoder module. The decoder receives the inference output y generated at the previous moment. t-1 , the hidden state S at the previous moment t-1 and dynamic semantic vector C t-1 And splicing, adjusting the output dimension through the fully connected layer (FC), mapping to the output space, generating the current inference time t = t e +1 output The calculation formula is as follows:

[0116]

[0117] Among them, LSTM dec is the LSTM decoder; is the dynamic semantic vector of pedestrian i at time t-1; is the hidden state of pedestrian i at time t-1; The inference output generated by the i-th pedestrian at time t-1; is the predicted output of the i-th pedestrian at time t, that is and

[0118] The present invention is based on the prediction output of a single pedestrian at the current time t The overall predicted output y in the scene at time t can be obtained t .

[0119] Step S2.4, calculate the pedestrian position based on the predicted output and update the current inference time t e +1 position, local density, and adjacency occupancy matrix will update t e The local density and adjacency occupancy matrix at the last moment of the sliding window are used as the input, and iterative reasoning is continued until the complete output sequence [y1,...,y t ]. The location update calculation formula is as follows:

[0120]

[0121] in, and is the horizontal and vertical coordinates of pedestrian i at time t.

[0122] Example 3

[0123] In view of the pedestrian trajectory information predicted by the embodiment, the present invention also proposes a pedestrian safety risk warning method, comprising the following steps:

[0124] Step S1, security risk assessment, includes:

[0125] Step S1.1, crowd pressure calculation, introduces the crowd pressure index to evaluate the degree of crowd aggregation and its potential safety risks. The crowd pressure is quantified by calculating the product of the average density of pedestrians in the area and the speed variance. The calculation formula is as follows:

[0126]

[0127] Where (α, b) is the index of the occupied unit where the target pedestrian i is located; u i (a, b) is the average speed of the unit; T is the duration of the pedestrian in the unit; N is the total number of pedestrians in the unit; is the speed of pedestrian n in the unit at time t; is the speed of pedestrian i at time t; varv i t (a, b) is the velocity variance of the occupied unit at time t; P i t is the crowd pressure of target pedestrian i at time t; is the local density of pedestrian i in the occupied unit (a, b) at time t.

[0128] Step S1.2, flow state pressure range determination, based on the crowd pressure, further determine the pressure ranges of three typical pedestrian flow states; the pedestrian flow states are laminar flow, stop-and-go flow, and turbulent flow; the pressure range corresponding to each pedestrian flow state is 0-0.006s -2 , 0.006-0.02s -2 and ≥0.02s -2 .

[0129] Step S1.3, risk level classification, according to the pressure range of different pedestrian flow states identified, different risk levels are classified:

[0130]

[0131] Step S2: Perform real-time risk warning based on the risk levels:

[0132] Low risk: The pressure value is within the safe range and normal operation is allowed.

[0133] Medium risk: When the pressure value reaches the medium risk range, it is appropriate to remind people to take precautions to prevent further increase in the flow of people from causing traffic obstruction or creating safety hazards.

[0134] High risk: The pressure value exceeds the high risk threshold, indicating that the potential risk is further increased. Intervention measures are recommended, such as reducing speed fluctuations through route guidance or controlling pedestrian inflow to reduce crowd density to reduce safety risks.

[0135] The above embodiments are only used to illustrate the design ideas and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, any equivalent changes or modifications made based on the principles and design ideas disclosed by the present invention are within the protection scope of the present invention.

Claims

1. A method for constructing a Seq2Seq-AM model for pedestrian trajectory prediction, characterized in that: The build process is as follows: Step S1, constructing an encoder module of a Seq2Seq-AM model, where the encoder module is used to extract context information of an input feature sequence; Step S2, constructing an attention mechanism module of the Seq2Seq-AM model, which performs weighted processing on the input of important moments; Step S3, constructing a decoder module of the Seq2Seq-AM model, the decoder module outputs a variable length prediction sequence; Step S4: training and reasoning the Seq2Seq-AM model constructed above.

2. The method for constructing a Seq2Seq-AM model for pedestrian trajectory prediction according to claim 1, characterized in that: The method to build the encoder module is: Step S1.1, input feature sequence of continuous observation time series Among them, t s and t e Indicates the start and end time of the observation sequence, x t is the input feature at time t; Step S1.2: The encoder generates the hidden state h at the current moment based on the input feature sequence and the hidden state at the previous moment. m , m = t s ,t s +1,…,t e ; Step S1.3, the last moment t=t e The hidden state Contains the context information of the input sequence as the initial input state S0 of the decoder.

3. The method for constructing a Seq2Seq-AM model for pedestrian trajectory prediction according to claim 2, characterized in that: The method to construct the attention mechanism module is: Step S2.1, at each time t in the decoding process, calculate the encoder hidden state h m With the decoder's current hidden state S t-1 The relevance score Step S2.2, score the relevance Normalize and get the attention weight a m,t ; Step S2.3, based on the attention weight a m,t The corresponding hidden state h m Calculate the dynamic semantic vector C t .

4. The method for constructing a Seq2Seq-AM model for pedestrian trajectory prediction according to claim 3, characterized in that: The method to build the decoder module is: Step S3.1: The decoder receives the inference output y generated at the previous moment t-1 , the hidden state S at the previous moment t-1 and dynamic semantic vector C t-1 ; Step S3.2, based on the input of step S3.1, calculate the hidden state S at the current moment t ; Step S3.3, the attention mechanism calculates the dynamic semantic vector C at the current time t t , and compare it with the current hidden state S t After concatenation, the fully connected layer is used to adjust the output dimension to the required value, and the predicted output y at the current time t is calculated. t .

5. A pedestrian trajectory prediction method, characterized in that: The steps include: Step S1, collect the scene and the pedestrian trajectory data in the scene, extract the individual scale features and collective scale features, the individual scale features are used to describe the current motion state of the pedestrian, including the pedestrian horizontal speed v x and vertical velocity v y Components; the collective scale features include occupancy matrix and local density. Step S2: Input the personal scale features and collective scale features extracted in step S1 into the Seq2Seq-AM model to predict the pedestrian trajectory.

6. A pedestrian trajectory prediction method according to claim 5, characterized in that: The specific process of data collection and feature processing in step S1 includes: Step S1.1, collecting the scene and the pedestrian trajectory data in the scene, and recording the pedestrian position coordinate information (x, y); Step S1.2, extracting individual scale features and collective scale features based on the data; Step S1.2.1, calculate the horizontal speed of pedestrian i at time t and vertical speed Components, constitute the velocity vector, and obtain the individual scale characteristics; Step S1.2.2, gridding the scene, in which the grid where the target pedestrian is located is the occupancy unit (a, b) of the target pedestrian i, and an occupancy matrix is ​​constructed from several grid areas around the target pedestrian i with the target pedestrian i as the center; a discriminant function is used to determine whether pedestrian j is within the occupancy matrix range of the target pedestrian i; and the local density of the occupancy unit (α, b) where the target pedestrian i is located at time t is calculated; Step S1.3, normalize the extracted personal scale features and collective scale features.

7. A pedestrian trajectory prediction method according to claim 6, characterized in that: The discriminant function is expressed as follows: in, is the occupancy matrix discriminant function of pedestrian i in the occupied unit (a, b), 1 ab is the count value within the range, and N is the total number of pedestrians.

8. A pedestrian trajectory prediction method according to claim 6, characterized in that: The local density calculation formula is as follows: Among them, the Gaussian kernel function f is the distance weight function that describes the influence of neighbor pedestrian j on target pedestrian i; and represents the position of pedestrian j and pedestrian i at time t; R is the distance parameter, N i Represents the total number of neighboring pedestrians in the neighborhood of the occupied unit (α, b) where the target pedestrian i is located.

9. The pedestrian trajectory prediction method according to claim 5, characterized in that: Step S2 uses the constructed model to perform sequential reasoning to obtain the predicted trajectory as follows: Step S2.1: The encoder module receives the individual scale features and the collective scale features. The encoder generates the current hidden state h based on the input feature sequence and the hidden state at the previous moment. m ; Encode the three features of the individual scale and the collective scale separately, and concatenate all the temporal features into a potential representation And the potential representation of the last moment is passed to the decoder as the initial input S0; Step S2.2, the attention mechanism module combines the encoder hidden state h m and the decoder's current hidden state S t-1 , calculate the attention weight α m,t , and generate the dynamic semantic vector C at the current moment t and the decoder’s hidden state S t ; Step S2.3: The decoder receives the inference output y generated at the previous moment t-1 , the hidden state S at the previous moment t-1 and dynamic semantic vector C t-1 And splicing, adjusting the output dimension through the fully connected layer, mapping to the output space, generating the current inference time t = t e +1 predicted output; Step S2.4, calculate the pedestrian position based on the predicted output and update the current inference time t e +1 position, local density, and adjacency occupancy matrix will update t e The local density and adjacency occupancy matrix at the last moment of the sliding window are used as the input, and iterative reasoning is continued until the complete output sequence [y1,...,y t ].

10. A pedestrian safety risk early warning method, characterized in that: The steps include: Step S1, calculating crowd pressure, determining pedestrian flow status and risk classification corresponding to pedestrian flow status based on crowd pressure, and completing safety risk assessment; Step S2, performing real-time risk warning based on the divided risk levels; When the risk is low, traffic can proceed normally; when the risk is medium, people are reminded to take precautions; when the risk is high, the potential risk is further increased and intervention measures are recommended.

Citation Information

Patent Citations

  • Human movement mode speculation model based on variation track context perception, training method and speculation method

    CN110147892A

  • Attention mechanism-based pedestrian trajectory prediction method

    CN113160269A

  • Crowd trajectory prediction method based on multi-precision interaction

    CN113362367A

  • Motion track prediction method and device, equipment and storage medium

    CN114387313A

  • Variable-length pedestrian trajectory prediction method based on auto-encoder

    CN114782493A

Cited By

  • Multi-person redirection walking and position prediction method based on artificial potential field

    CN120407997A

  • Multi-person redirection walking and position prediction method based on artificial potential field

    CN120407997B

  • Individual risk dynamic assessment method and system based on space-time causal graph network

    CN120746796A

  • Individual risk dynamic assessment method and system based on spatiotemporal causal diagram network

    CN120746796B

  • Track invasion detection method based on attention enhancement and feature pyramid

    CN121904716A