A seq2seq-am model construction method and a pedestrian trajectory prediction and safety risk early warning method

By fusing individual and collective scale features through the Seq2Seq-AM model, accurate prediction of pedestrian trajectories and safety risk assessment are achieved, solving the problems of inaccurate prediction and insufficient risk assessment in existing technologies, and providing real-time safety risk warnings.

CN119599208BActive Publication Date: 2026-01-02JIANGSU UNIV
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively capture the interaction between pedestrians and their surroundings in pedestrian trajectory prediction, leading to inaccurate predictions and insufficient risk assessment, making it difficult to achieve real-time monitoring and early warning.

Method used

The Seq2Seq-AM model, which combines sequence-to-sequence networks and attention mechanisms, is used to predict pedestrian trajectories and assess safety risks by fusing individual-scale and collective-scale features, including velocity components, Gaussian kernel local density, and occupancy matrix, thereby achieving accurate prediction of pedestrian motion and risk level assessment.

Benefits of technology

It improves the accuracy of pedestrian trajectory prediction, quantifies the risk level of the crowd, and provides real-time safety risk warnings, making it suitable for emergency evacuation in densely populated areas and major event scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119599208B_ABST
    Figure CN119599208B_ABST
Patent Text Reader

Abstract

The application provides a Seq2Seq-AM model construction method and a pedestrian trajectory prediction and safety risk early warning method. First, a Seq2Seq-AM model is constructed, which is composed of an encoder, an attention mechanism and a decoder; the encoder module extracts the context information of the input feature sequence, the attention mechanism module performs weighted processing on the important time input, and the decoder module outputs a variable-length prediction sequence, and the model can adaptively focus on the key features in the pedestrian trajectory. The Seq2Seq-AM model can be used to predict pedestrians in the scene. The application also introduces a crowd pressure indicator, calculates the pressure value range of three typical pedestrian motion states based on the pedestrian prediction result, and classifies the safety risk in the crowd motion, and divides the risk level into low, medium and high. Finally, through the classification of the risk level, the real-time risk early warning of the crowd gathering area is realized, and the safety risk assessment support for the safety management in high-density scenes such as major activities and traffic hubs is provided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

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

[0002] With the improvement of urbanization level and the increase of people's travel frequency, large-scale and high-density crowd gathering often occurs in public places such as train stations, subway stations and stadiums. If there is a lack of effective pedestrian management measures at this time, the safety risk of the crowd cannot be assessed and warned in time and accurately, which is easy to cause serious safety accidents. Therefore, in order to ensure the safety evacuation of the crowd in emergency, it is crucial to study the characteristics of pedestrian movement and establish a safety risk assessment mechanism.

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

[0004] Pedestrian movement experiment usually records the movement video of pedestrians through camera, and quantitatively analyzes the video data to capture the movement characteristics of pedestrians under different environmental and density conditions. The experimental scene covers typical spaces such as one-way flow, multi-way flow, bottleneck channel, intersection and staircase. By collecting and analyzing these data, researchers can measure the speed, acceleration, density and flow of pedestrians, and further reveal the flow characteristics of pedestrians under different spatial and behavioral conditions. Through the related experimental research on pedestrian movement, real and reliable data basis can be provided for subsequent modeling and prediction, but it is limited by experimental scene, cost and safety, etc., so that the experiment under specific conditions is difficult to implement. At the same time, the individuals participating in the experiment may also cause deviation between simulation results and actual situation due to adaptability to the environment.

[0005] The modeling method based on knowledge driving (physical rules) focuses on simulating the motion pattern of pedestrians by using physical rules and behavior assumptions. The model tries to theoretically explain the motion law of the crowd in different scenes 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 motion behavior of pedestrians in different scenes and under different density conditions by setting rules such as repulsive force between pedestrians, attractive force and individual preference for space. However, the modeling method based on knowledge driving is relatively dependent on specific experimental data in parameter selection, and the design of model rules is difficult to comprehensively cover the behavior of pedestrians, and the generalization in multi-scene application will be limited.

[0006] In contrast, the data-driven pedestrian motion prediction model relies on deep learning algorithms, learns the complex motion rules contained in the data by training large-scale pedestrian trajectory data. The core of this method is to use deep neural network structures such as long short-term memory network (LSTM), gated recurrent unit (GRU) and generative adversarial network (GAN) to capture the spatio-temporal dependence in pedestrian motion, so as to make accurate trajectory prediction. The data-driven model not only reduces the dependence on specific experimental scenarios and physical assumptions, but also has the ability to predict in high-dimensional environments, and shows good adaptability in dynamic and high-density scenes. However, most of the existing data-driven trajectory prediction researches often only focus on the historical trajectory features of pedestrians, ignoring the influence of the interaction between pedestrians in the motion process. In addition, relying only on the encoder cannot extract all the motion features, resulting in some important information being missed, which is difficult to fully reflect the dynamic interaction between pedestrians, and thus affects the accurate prediction of pedestrian dynamics and the assessment and early warning of crowd risk. SUMMARY

[0007] In view of the deficiencies in the prior art, the present application proposes a Seq2Seq-AM model construction method and a pedestrian trajectory prediction and safety risk early warning method, which realizes accurate prediction of pedestrian motion trajectory by combining sequence to sequence network (Sequence to Sequence, Seq2Seq) and attention mechanism (Attention Mechanism, AM), evaluates the crowd pressure and risk level, and realizes real-time monitoring and early warning of crowd dynamics. This method is suitable for crowded areas, especially in emergency evacuation, major activities and transportation hubs, and has wide application value.

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

[0009] A method for constructing a Seq2Seq-AM model for pedestrian trajectory prediction is described below:

[0010] Step S1: Construct the encoder module of the Seq2Seq-AM model. The encoder module is used to extract the contextual information of the input feature sequence.

[0011] Step S2: Construct the attention mechanism module of the Seq2Seq-AM model. The attention mechanism module performs weighted processing on the input at important moments.

[0012] Step S3: Construct the decoder module of the Seq2Seq-AM model. The decoder module outputs a variable-length prediction sequence.

[0013] Step S4: Train and infer the constructed Seq2Seq-AM model.

[0014] Furthermore, the method for constructing the encoder module is as follows:

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

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

[0017] Step S1.3, the last time t = t e The hidden state h te It contains contextual information about the input sequence and serves as the initial input state S0 for the decoder.

[0018] Furthermore, the method for constructing the attention mechanism module is as follows:

[0019] Step S2.1: At each time t during the decoding process, calculate the encoder hidden state h. m With the decoder's current hidden state S t-1 correlation score

[0020] Step S2.2, relevance score Normalization is performed to obtain the attention weight a. m,t ;

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

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

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

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

[0025] Step S3.3, the attention mechanism calculates the dynamic semantic vector C t at the current time t, which is spliced with the current hidden state S t , and then adjusted to the required output dimension through the fully connected layer (FC), to calculate the predicted output y t at the current time t.

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

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

[0028] Step S2, input the individual scale features and the collective scale features extracted in step S1 into the Seq2Seq-AM model, and predict the pedestrian trajectory.

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

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

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

[0032] Step S1.2.1, calculate the horizontal velocity and the vertical velocity component of the pedestrian i at time t, form a velocity vector, and obtain the individual scale features;

[0033] Step S1.2.2, the scene is gridded, the grid where the target pedestrian is located is the occupation unit (a, b) of the target pedestrian i, and the occupation matrix is constructed by a number of grid regions around the target pedestrian i; the discrimination function is used to determine whether the pedestrian j is within the range of the occupation matrix of the target pedestrian i; and the local density of the target pedestrian i in the occupation unit (a, b) at time t is calculated;

[0034] Step S1.3, the extracted individual scale features and collective scale features are normalized.

[0035] Further, the discrimination function is expressed as follows:

[0036]

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

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

[0039]

[0040] wherein, the Gaussian kernel function f is a distance weight function describing the influence of the neighboring pedestrian j on the target pedestrian i; and represent the positions of the j pedestrian and the i pedestrian at time t; R is a distance parameter, and N i represents the total number of neighboring pedestrians within the neighborhood range of the occupation unit (a, b) of the target pedestrian i.

[0041] Further, the process of step S2 for obtaining the predicted trajectory by using the constructed model is as follows:

[0042] Step S2.1, the encoder module receives the individual scale features and the collective scale features, and the encoder generates the hidden state h m at the current time based on the input feature sequence and the hidden state at the previous time; the three features of the individual scale and the collective scale are encoded respectively, and all the time sequence features are spliced into latent representations at the end, and the latent representation at the last time is taken as the initial input S0 and transmitted to the decoder;

[0043] Step S2.2, the attention mechanism module combines the encoder hidden state h m and the current decoder hidden state S t-1 , calculates the attention weight a m,t , and generates the dynamic semantic vector C at the current time.t and the hidden state S of the decoder t ;

[0044] Step S2.3, the decoder receives the inference output y generated at the previous time t-1 , the hidden state S of the previous time t-1 and the dynamic semantic vector C t-1 and splices them, adjusts the output dimension through a fully connected layer (FC), maps to the output space, and generates the prediction output at the current inference time t = t e +1;

[0045] Step S2.4, the pedestrian position is calculated based on the prediction output, the position, local density and adjacency occupancy matrix at the current inference time t e +1 are updated, the local density and adjacency occupancy matrix at the time t e +1 are taken as the input at the last time of the sliding window, and the iterative inference is continued until the complete output sequence [y1,..., y t ] is generated.

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

[0047] Step S1, crowd pressure is calculated, the pedestrian flow state is determined based on the crowd pressure, and the risk classification corresponding to the pedestrian flow state is determined to complete the safety risk assessment.

[0048] Step S2, real-time risk warning is performed based on the divided risk level; normal passage is allowed when the risk is low; attention is prompted when the risk is medium; potential risk is displayed when the risk is high, and intervention measures are suggested.

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

[0050] (1) Based on the Seq2Seq and attention mechanism method, the relative motion change between the pedestrian and the surrounding environment is effectively captured by fusing the feature input of the speed component, the Gaussian kernel local density and the occupancy matrix, so that the model can more accurately predict the pedestrian trajectory.

[0051] (2) In the risk assessment aspect, the crowd pressure range under three typical pedestrian motion states is determined based on the crowd pressure index, and the crowd risk is divided into three levels of low risk, medium risk and high risk. The division of risk levels quantifies the danger degree of crowd gathering, and provides an accurate reference for safety management.

[0052] (3) Based on the risk level division, the level index can be used to evaluate the risk of the crowd in different scenarios. When the real-time detected time sequence risk fluctuation rises, it indicates that the accident risk of the crowd is significantly increased, prompting the management personnel to take intervention measures to reduce the safety risk. BRIEF DESCRIPTION OF DRAWINGS

[0053] Figure 1 The model framework of Seq2Seq-AM is shown in the figure.

[0054] Figure 2 The working mechanism of the correlation score is shown in the figure.

[0055] Figure 3 The whole process of model time sequence reasoning is shown in the figure.

[0056] Figure 4 The schematic diagram of the occupation matrix is shown in the figure. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and are not used to limit the present application, that is, the described examples are only a part of the examples of the present application, but not all the examples. Therefore, the detailed description of the examples provided in the drawings below is not intended to limit the scope of the claimed present application, but only represents selected examples of the present application. Based on the examples of the present application, all other examples obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0058] Example 1:

[0059] A construction method of a Seq2Seq-AM model for pedestrian trajectory prediction, the Seq2Seq-AM model framework designed by the present application is shown in Figure 2 The model is composed of three modules: an encoder (Encoder), an attention mechanism (Attention Mechanism) and a decoder (Decoder). Among them, the encoder module extracts the context information of the input feature sequence, the attention mechanism module weights the important input time, and the decoder module outputs the variable length prediction sequence. This framework design enables the model to adaptively focus on the key features in the pedestrian trajectory, improving the accuracy of trajectory prediction.

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

[0061] Step S1, the encoder (Encoder) module, comprising:

[0062] Step S1.1: Encoder input feature processing, input feature sequence of continuous observation time series. Among them, t s and t e Indicates the start and end times of the observation time series, x t Let t be the input features at time t.

[0063] Step S1.2, Hidden State Generation: At each time t, the encoder generates the hidden state h for the current time step based on the input feature sequence and the hidden state of the previous time step. m m = t s ,t s +1,…,t e .

[0064] Step S1.3, Context information storage, last time t=t e The hidden state h te It contains contextual information about the input sequence and serves as the initial input state S0 for the decoder.

[0065] Step S2, the Attention Mechanism module, includes:

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

[0067]

[0068] In this process, each time step t is from t e +1 to t p , t e +1 and t p This represents the start and end times of the model's temporal inference. V represents the trainable vector; w h w s These represent the trainable weights of the encoder in its hidden state and the trainable weights of the decoder in its current hidden state, respectively.

[0069] Step S2.2: Weight normalization, using the Softmax function to score the relevance. Normalization is performed to obtain the attention weight a. m,t This is used to dynamically adjust the importance of inputs at different times; the attention weight 'a' is used for this purpose. 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 ), the dynamic semantic vector C t is calculated, and the calculation formula is as follows:

[0072]

[0073] The dynamic semantic vector C t is taken as the decoding input, so that it can pay attention to the key moment in the pedestrian motion.

[0074] Step S3, decoder (Decoder) module, comprising:

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

[0076] Step S3.2, hidden state update, the decoder calculates the hidden state S t at the current time using the aforementioned input vector, and the calculation formula is as follows:

[0077]

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

[0079] Step S3.3, full connection layer mapping, the attention mechanism calculates the dynamic semantic vector C t at the current time t, which is spliced with the current hidden state S t , and then adjusted to the required output dimension through the full connection layer (Fully Connected Layer, FC), to calculate and generate the prediction output y t at the current time t, which is represented as:

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

[0081] wherein, w FC , b FC represent trainable weights and biases respectively; cat(·) represents vector concatenation operation.

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

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

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

[0085]

[0086] wherein, and are the predicted position and the actual position of the i pedestrian at t moment; N is the total number of pedestrians; T is the reasoning time sequence length; ||·|| represents the Euclidean distance.

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

[0088] Embodiment 2

[0089] Based on the Seq2Seq-AM model constructed above, the application further proposes a pedestrian trajectory prediction method, comprising the following steps:

[0090] Step S1, collecting scene and pedestrian trajectory data in the scene, extracting individual scale features and collective scale features, the individual scale features are used to describe the current motion state of the pedestrian, including horizontal velocity (v x ) and vertical velocity (v y ) components; the collective scale features include an occupancy matrix and a 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 devices, and record the pedestrian position coordinate information (x, y).

[0094] Step S1.2, classify the features of the collected data. The features of the data are classified into personal scale features and collective scale features. The personal scale features are used to describe the motion state of the pedestrian, and the collective scale features are used to describe the influence of the surrounding environment on the target pedestrian. The method of extracting personal scale features and collective scale features based on data is as follows:

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

[0096] The size and direction of the speed have an important influence on the motion decision of the pedestrian. By calculating the horizontal speed component and the vertical speed component of each pedestrian, a velocity vector is formed to describe the current motion state of the pedestrian. The calculation formula of the horizontal speed component and the vertical speed component of the target pedestrian i at time t is as follows:

[0097]

[0098] wherein and are the horizontal speed component and the vertical speed component of pedestrian i at time t, respectively, and are the horizontal and vertical coordinate positions 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 with a size of 0.5m×0.5m.

[0101] (2) Occupancy matrix construction. Since pedestrians will make decisions based on the observation of surrounding environment information, such decisions are mainly limited to the local neighborhood area. Therefore, in the above m×n grid area, the grid where the target pedestrian is located is the occupation unit (a, b) of the target pedestrian i, and the 5×5 grid area around the target pedestrian i is taken as its neighborhood environment range, thereby constructing a 5×5 occupation matrix. Based on the occupation matrix, the position of the neighboring pedestrian can be determined, i.e. using the judgment function to determine the coordinates Whether in the range of the occupation matrix of the target pedestrian i. If the pedestrian j is located in the range, the index unit corresponding to the matrix is recorded as 1, otherwise as 0, see the schematic diagram Figure 3 . The discriminant function is expressed as follows:

[0102]

[0103] wherein, is the occupation matrix discriminant function of the pedestrian i in the occupation 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 target pedestrian i in the occupation unit (a, b) at time t is The calculation formula is as follows:

[0105]

[0106] wherein, the Gaussian kernel function f is a distance weight function describing the influence of the neighboring pedestrian j on the target pedestrian i; and represent the positions of the j pedestrian and the i pedestrian at time t; the distance parameter R is set to 1.77 m, and N i represents the total number of neighboring pedestrians in the neighborhood range of the occupation unit (a, b) of the target pedestrian i.

[0107] Step S1.3, normalizing the individual scale features and collective scale features extracted in the above step S1.2, and keeping the label data (x, y) original value to ensure the consistency of the input and output data, improve the generalization ability of the model, and reduce the interference of feature scale difference on model training. and ).

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

[0109] Step S2.1, the encoder (Encoder) module receives the individual scale features and collective scale features, and the encoder generates the hidden state h m of the current moment based on the input feature sequence and the hidden state of the previous moment.

[0110] In the encoder module, the three features of the individual scale and the collective scale are encoded respectively, and all the time sequence features are spliced into latent representations The calculation formula is as follows:

[0111]

[0112] Wherein, is an LSTM encoder of the velocity component; is an LSTM encoder of the occupancy matrix; is an encoder of the 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 at the last moment is taken as the initial input S0 and is transmitted to the decoder.

[0114] Step S2.2, the attention mechanism module is taken as an intermediate layer, combines the encoder hidden state h m and the current hidden state S t-1 of the decoder (the hidden state at the previous moment), calculates the attention weight alpha m,t , and generates the dynamic semantic vector C t at the current moment and the hidden state S t of the decoder.

[0115] Step S2.3, the decoder module predicts the current moment according to the outputs of the attention mechanism module and the encoder module. The decoder receives the inference output y t-1 generated at the previous moment, the hidden state S t-1 at the previous moment and the dynamic semantic vector C t-1 , and is spliced, is adjusted in the output dimension through a fully connected layer (FC), is mapped to an output space, and generates the output e at the current inference moment t=t The calculation formula is as follows:

[0116]

[0117] Wherein, LSTM dec is an LSTM decoder; is the dynamic semantic vector of the i pedestrian at time t-1; is the hidden state of the i pedestrian at time t-1; is the inference output generated by the i pedestrian at time t-1; is the prediction output of the i pedestrian at time t, that is, and

[0118] The present application is based on the prediction output of a single pedestrian at the current moment t The prediction output y of the entire scene at time t can be obtained t .

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

[0120]

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

[0122] Embodiment 3

[0123] For the pedestrian trajectory information predicted by the embodiment, the application further proposes a pedestrian safety risk early warning method, comprising the following steps:

[0124] Step S1, safety risk assessment, comprising:

[0125] Step S1.1, crowd pressure calculation, introduce a crowd pressure index to evaluate the degree of crowd gathering and its potential safety risk, quantify the pressure situation of the crowd by calculating the product of the average density and the speed variance of the pedestrians in the region, and the calculation formula is as follows:

[0126]

[0127] wherein, (a,b) is the index of the occupancy unit where the target pedestrian i is located; u i (a,b) is the average speed of the unit; T is the duration length 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 speed variance of the occupancy unit at time t; P i t is the crowd pressure of the target pedestrian i at time t; is the local density of pedestrian i in the occupancy unit (a,b) at time t.

[0128] Step S1.2, flow state pressure range discrimination, further discriminate the pressure range of three typical pedestrian flow states based on the crowd pressure; the pedestrian flow states are respectively laminar flow, walk-stop-walk, 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 division, according to the pressure range of the different pedestrian flow states discriminated, different risk levels are divided:

[0130]

[0131] Step S2, real-time risk warning based on the divided risk level:

[0132] Low risk: the pressure value is in the safe range, and normal traffic is allowed.

[0133] Medium risk: the pressure value reaches the medium risk range, and it is appropriate to prompt attention to prevent the further increase of the pedestrian flow from causing traffic obstruction or safety hazards.

[0134] High risk: the pressure value exceeds the high risk threshold, indicating that the potential risk is further intensified, and it is suggested to take intervention measures, such as reducing speed fluctuation through path guidance or controlling the pedestrian flow to reduce the crowd density, so as to reduce the safety risk.

[0135] The above examples are only used to illustrate the design idea and characteristics of the present application, and its purpose is to enable those skilled in the art to understand the content of the present application and implement it, and the protection scope of the present application is not limited to the above examples. Therefore, any equivalent changes or modifications made according to the principles and design ideas disclosed by the present application are within the protection scope of the present application.

Claims

1. A method of pedestrian trajectory prediction, the method comprising: Comprising the following steps: Step S1, collect the scene and the pedestrian trajectory data in the scene, extract the individual scale feature and the collective scale feature, the individual scale feature is used to describe the current motion state of the pedestrian, including the horizontal velocity v x and the vertical velocity v y component of the pedestrian; the collective scale feature includes the occupation matrix and the local density; Step S2, input the personal scale features and the collective scale features extracted in step S1 into the Seq2Seq-AM model to predict the pedestrian trajectory; the process of sequence reasoning using the constructed model to obtain the predicted trajectory is as follows: Step S2.1, the encoder module receives the personal-scale features and the collective-scale features, and the encoder generates the hidden state h of the current time based on the input feature sequence and the hidden state of the previous time m ; encode the three features of the personal-scale and the collective-scale respectively, and concatenate all the time-series features into the latent representation and pass the latent representation of the last time as the initial input S0 to the decoder; Step S2.2, the attention mechanism module combines the encoder hidden state h m and the current decoder hidden state S t-1 to calculate the attention weight a m,t and generate the dynamic semantic vector C t and the hidden state S t of the decoder at the current time point; Step S2.3, the decoder receives the inference output y generated at the previous time t-1 , the hidden state S t-1 and the dynamic semantic vector C t-1 at the previous time, and performs splicing, adjusts the output dimension through a fully connected layer, maps to an output space, and generates a prediction output at the current inference time t = t e +1; Step S2.4, calculate pedestrian position based on prediction output, update current inference time t e +1, the local density and adjacency occupancy matrix at time t e +1, the local density and adjacency occupancy matrix at time t t ] as the input of the last time of the sliding window, continue to iterate the inference until the complete output sequence [y1,...,y 2. The method of claim 1, wherein, The specific process of data collection and feature processing in step S1 includes: Step S1.1, collect the scene and the pedestrian trajectory data in the scene, and record the position coordinate information (x, y) of the pedestrian; Step S1.2, extract the personal scale features and the collective scale features based on the data respectively; Step S1.2.1, calculating the horizontal velocity of the pedestrian i at time t and the vertical velocity component, constituting the velocity vector, obtaining the individual scale feature; Step S1.2.2, grid the scene, in the grid area, the grid where the target pedestrian is located is the occupation unit (a, b) of the target pedestrian i, and the occupation matrix is constructed by the target pedestrian i and the surrounding several grid areas; the discrimination function is used to determine whether the pedestrian j is within the occupation matrix range of the target pedestrian i; and the local density of the target pedestrian i in the occupation unit (a, b) at time t is calculated; Step S1.3, normalize the extracted personal scale features and collective scale features.

3. The method of claim 2, wherein, The discrimination function is as follows: wherein, is the occupancy matrix decision function for pedestrian i occupying cell (a, b), 1 ab is the count value within the range, N is the total number of pedestrians; and and represent the horizontal coordinate position and the vertical coordinate position of i pedestrian at time t, respectively.

4. The method of claim 2, wherein, The local density calculation formula is as follows: where the Gaussian kernel function f is a distance weight function describing the influence of the neighboring pedestrian j on the target pedestrian i; and denotes the position of the j pedestrian and the i pedestrian at time t; R is a distance parameter, N i denotes the total number of neighboring pedestrians within the neighborhood range of the occupancy cell (a, b) in which the target pedestrian i is located.

5. The method of claim 1, wherein, The construction process of the Seq2Seq-AM model is as follows: Step S1, construct the encoder module of the Seq2Seq-AM model, and the encoder module is used to extract the context information of the input feature sequence; Step S2, construct the attention mechanism module of the Seq2Seq-AM model, and the attention mechanism module performs weighted processing on the important time input; Step S3, construct the decoder module of the Seq2Seq-AM model, and the decoder module outputs a variable-length prediction sequence; Step S4, train and reason the Seq2Seq-AM model constructed above.

6. The method of claim 5, wherein, The method for constructing the encoder module is: Step S1.1, inputting an input feature sequence of a continuous observation time series where t s and t e denote the start and end time of the observation time series, x t is the input feature at time t. Step S1.2, the encoder generates the hidden state h of the current time based on the input feature sequence and the hidden state of the previous time m , m = t s , t s + 1,..., t e ; Step S1.3, 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.

7. The method of claim 5, wherein, The method for constructing the attention mechanism module is: Step S2.1, at each time instant t of the decoding process, compute the encoder hidden state h m the correlation score with the decoder current hidden state S t-1 ​ Step S2.

2. Normalizing the relevance scores to obtain attention weights a m,t ; Step S2.3, computing the dynamic semantic vector C based on the attention weights a m,t with the corresponding hidden state h m computing the dynamic semantic vector C t .

8. The method of claim 5, wherein, The method for constructing the decoder module is: Step S3.1, the decoder receives the inference output y generated at the previous time instant t-1 , the hidden state S at the previous time instant t-1 , and the dynamic semantic vector C t-1 ; Step S3.2, based on the input of step S3.1, compute the hidden state S at the current time instant t ; Step S3.3, the attention mechanism calculates the dynamic semantic vector C of the current time t t , and the current hidden state S t After splicing, adjust to the required output dimension through the full connection layer, calculate the predicted output y of the current time t t .

9. A method for pedestrian safety risk pre-warning, characterized in that, The pedestrian trajectory information predicted by the pedestrian trajectory prediction method based on claim 1 is used for pedestrian safety risk early warning, comprising the following steps: Step S1, calculate the crowd pressure, determine the pedestrian flow state and the risk classification corresponding to the pedestrian flow state based on the crowd pressure, and complete the safety risk assessment; Step S1.1, crowd pressure calculation, introduce the crowd pressure index to evaluate the crowd gathering degree and the potential safety risk, quantify the pressure situation of the crowd by calculating the product of the average density and the speed variance of the pedestrians in the region, and the calculation formula is as follows: where (a, b) is the index of the occupancy cell that the target pedestrian i is in; u i (a, b) is the average speed of the cell; T is the duration length of the pedestrian in the cell; N is the total number of pedestrians in the cell; is the speed of pedestrian n in the cell at time t; is the speed of pedestrian i at time t; is the speed variance of the occupancy cell at time t; is the crowd pressure of target pedestrian i at time t; is the local density of pedestrian i in occupancy cell (a, b) at time t; Step S1.2, flow state pressure range determination, further determine the pressure range of three typical pedestrian flow states based on the crowd pressure; the pedestrian flow states are laminar flow, walk-stop-walk, and turbulent flow; Step S1.3, risk level division, according to the pressure range of the different pedestrian flow states determined, different risk levels are divided; Step S2, real-time risk warning based on the divided risk level; low risk, normal traffic; medium risk, pay attention to prevention; high risk, display the potential risk further intensified, and suggest to take intervention measures.

Citation Information

Patent Citations

  • Crowd stampede risk assessment method, device and equipment and storage medium

    CN117237864A