A city passenger flow prediction method based on city interest point spatio-temporal data set

By processing urban point of interest data through hierarchical perceptual attention fusion and spherical convolutional coding, and combined with business hours constraints, more accurate pedestrian flow prediction is achieved, solving the problems of cross-regional error and poor training stability in traditional methods.

CN120821893BActive Publication Date: 2026-07-03CHENGDU SHENTUO DIGITAL TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU SHENTUO DIGITAL TECHNOLOGY CO LTD
Filing Date
2025-08-07
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Traditional methods for predicting pedestrian traffic struggle to fully utilize diverse urban information, ignore cross-regional errors caused by the curvature of the Earth, fail to consider business hours constraints, exhibit poor training stability, and perform poorly in sparse areas.

Method used

A hierarchical perceptual attention fusion mechanism is used to process text modal features, spherical convolutional coding is used to model spatial dependencies, a periodic mask generator is used to constrain business hours, and multi-task sharing is combined to predict and generate pedestrian flow.

Benefits of technology

It improves the accuracy and generalization ability of pedestrian flow prediction, solves the problems of cross-regional modeling distortion and business hours constraints, and enhances the training stability and sparse region performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120821893B_ABST
    Figure CN120821893B_ABST
Patent Text Reader

Abstract

This invention relates to the field of pedestrian flow prediction technology and discloses a method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest (POIs). The method includes: acquiring the spatiotemporal dataset of urban POIs; dynamically fusing multimodal features using a hierarchical perceptual attention fusion mechanism to obtain POI feature vectors; performing spherical spatial dependency modeling using a region-adaptive spherical convolutional coding method to obtain spatial coding vectors; performing business hour constraint coding using a periodic mask generator to obtain temporal feature vectors; extracting spatiotemporal coupling features based on the POI feature vectors, spatial coding vectors, and temporal feature vectors; performing region-aware temporal series modeling on the spatiotemporal coupling features; and generating predicted pedestrian flow values ​​and congestion level probability distributions through multi-task shared prediction. This invention improves the performance of urban pedestrian flow prediction by employing a method based on a spatiotemporal dataset of urban POIs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pedestrian flow prediction technology, specifically to a method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest. Background Technology

[0002] With the acceleration of urbanization and the advancement of smart city construction, the demand for high-precision pedestrian flow forecasting in urban management and operation is increasing. Pedestrian flow, as a crucial indicator of urban operation, is widely used in areas such as public safety early warning, commercial site selection optimization, traffic management and scheduling, and public resource allocation. Traditional pedestrian flow forecasting methods often rely on single data sources, such as historical pedestrian flow records, traffic sensor data, or mobile signaling data. Modeling methods are also primarily based on time series analysis, making it difficult to fully utilize the rich and diverse structured and unstructured information within cities, thus limiting forecast accuracy and generalization ability.

[0003] Chinese invention patent CN119848365A proposes a method and system for recommending points of interest based on the fusion of subjective and objective factors. It utilizes Gaussian distribution and two-hop information to capture movement patterns and simulate user travel decisions. Simultaneously considering both subjective and objective factors, when considering subjective preferences, points of interest are embedded as low-dimensional vectors, using Mahalanobis distance as the distance metric, making the embedding space non-flat and stable, thus expressing the asymmetric relationship of points of interest. When considering objective factors, two-hop information is mined through a global trajectory map to reflect the correlation between points of interest and user movement. By combining subjective and objective factors, user behavior patterns can be more accurately mined.

[0004] Chinese invention patent CN114969007B proposes a method for identifying urban functional zones based on functional mixing degree and ensemble learning, belonging to the field of digital information technology. The method performs the following steps: 1) data collection and preprocessing; 2) constructing 10 indicator features for the identification system of urban functional zones; 3) structuring indicators; statistically analyzing the 10 indicator feature data corresponding to each land parcel using spatial statistical tools; 4) constructing the independent variable dataset; 5) labeling the response variable; 6) dividing the training dataset into several sub-training sets according to functional mixing degree; 7) ensemble learning training based on the Stacking strategy; 8) completing the functional zone identification of the land parcel by connecting attribute tables. This invention provides a relatively accurate method for mining the correlation between urban functional zone types and urban characteristics, and realizing the identification of urban functional zone types by mapping urban features to urban features, by separating the training set through hierarchical functional mixing degree and allowing the prediction set data to predict according to the corresponding functional mixing degree.

[0005] The above technical solution has the following problems that still need to be addressed:

[0006] 1. Traditional methods often employ static splicing or simple embedding, which makes it difficult to uncover the hierarchical semantic structure in text modalities and cannot cope with the unbalanced expression caused by text features of different lengths.

[0007] 2. Existing methods typically use Euclidean distance to model geographic relationships, without considering the curvature of the Earth, which leads to significant errors when applied at city boundaries or across regions, resulting in distorted spatial dependencies.

[0008] 3. Traditional models only use timestamps as numerical inputs, ignoring the hard constraints of business hours on pedestrian flow, which can easily lead to incorrect positive predictions during non-business hours such as late at night.

[0009] 4. Conventional loss functions do not take into account the spatial distribution differences of interest points, resulting in poor performance in sparse regions. At the same time, a uniform learning rate cannot adapt to the gradient characteristics of each parameter, leading to poor training stability and slow convergence. Summary of the Invention

[0010] To address the aforementioned shortcomings in existing technologies, this invention provides a method for predicting urban pedestrian traffic based on a spatiotemporal dataset of urban points of interest.

[0011] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows:

[0012] A method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest includes the following steps:

[0013] Obtain the spatiotemporal dataset of city points of interest; the spatiotemporal dataset of city points of interest includes name text, address text, classification code, latitude and longitude coordinates, current timestamp and business hours information;

[0014] A hierarchical perceptual attention fusion mechanism is used to dynamically fuse multimodal features of the name text, address text, and classification coding information of urban points of interest to obtain feature vectors of points of interest;

[0015] A regional adaptive spherical convolutional coding method is used to perform spherical spatial dependency modeling on the latitude and longitude coordinates of urban points of interest to obtain spatial coding vectors.

[0016] A periodic mask generator is used to encode the current timestamp and business hours information of urban points of interest using business hours constraints, resulting in a time feature vector.

[0017] Spatiotemporal coupling features are extracted based on the feature vectors of points of interest, spatial encoding vectors, and temporal feature vectors. Regional perception temporal modeling is performed on the spatiotemporal coupling features, and predicted pedestrian flow and crowding level probability distribution are generated through multi-task shared prediction.

[0018] The present invention has the following beneficial effects:

[0019] (1) This invention strengthens the semantic expression of spatial hierarchy by dynamically identifying the semantic relationship between the name, address and classification code of points of interest, and solves the modeling difficulties caused by inconsistent text length.

[0020] (2) This invention uses the semi-sine formula to accurately calculate the spherical distance between the point of interest and the administrative center, and combines the transformation matrix of multi-level administrative regions to solve the problem of distortion in cross-regional spatial relationship modeling caused by the curvature of the earth.

[0021] (3) The present invention adopts business time mask and sine and cosine time period coding for joint modeling, automatically suppresses the prediction output during non-business hours, and explicitly models business time constraints and the periodicity of pedestrian flow.

[0022] (4) This invention obtains higher training weights for sparse region samples through kernel density estimation, and at the same time adopts sensitivity-driven asynchronous learning rate allocation for model parameters to achieve joint optimization of data imbalance and training instability. Attached Figure Description

[0023] Figure 1 This is a schematic diagram of a method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest.

[0024] Figure 2 This is a schematic diagram of the attention weight distribution for multimodal features;

[0025] Figure 3 This diagram illustrates the impact of address text length on prediction accuracy.

[0026] Figure 4 This is a comparative diagram of spatial coding methods;

[0027] Figure 5 This is a diagram illustrating the effect of coding for business hours constraints.

[0028] Figure 6 This is a schematic diagram of the spatiotemporal coupling feature tensor.

[0029] Figure 7 This is a schematic diagram illustrating the impact of residual connections on deep network training.

[0030] Figure 8 A schematic diagram illustrating the prediction effect of a region-aware gating mechanism;

[0031] Figure 9 This is a schematic diagram illustrating the dynamic behavior of the gating mechanism.

[0032] Figure 10 This is a schematic diagram of the spatial distribution of shared features across multiple tasks.

[0033] Figure 11 A schematic diagram showing the comparison of spatial density weighting effects;

[0034] Figure 12 This is a schematic diagram illustrating the training effect of the gradient-sensitive optimizer. Detailed Implementation

[0035] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0036] like Figure 1 As shown in the figure, an embodiment of the present invention provides a method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest, comprising the following steps S1 to S5:

[0037] S1. Obtain the spatiotemporal dataset of city points of interest; the spatiotemporal dataset of city points of interest includes name text, address text, classification code, latitude and longitude coordinates, current timestamp and business hours information;

[0038] In an optional embodiment of the present invention, step S1 first receives new input data for the target point of interest, including name text, address text, classification code, latitude and longitude coordinates, current timestamp, and business hours information. For example, the name text is "Starbucks Coffee", the address text is a complete street description, the classification code is a predefined category index, and the timestamp is in hours, such as t=14 indicating 2 pm. The model then performs feature processing and inference step by step.

[0039] In an optional embodiment of the present invention, the training dataset is integrated from multiple authoritative sources, mainly including basic attribute data of urban points of interest, spatial location data, time-related data, and pedestrian flow annotation data.

[0040] The data sources cover public map service platforms, urban public data open platforms, and IoT sensors deployed around points of interest. This data is acquired in batches through API interfaces or regularly crawled and updated through web crawling technology to ensure the timeliness and breadth of coverage of the data.

[0041] The core attributes of the dataset include the name text of the points of interest, the address text, the classification code, the latitude and longitude coordinates, the business hours information, and the pedestrian flow label.

[0042] Both the name text and the address text are string types. For example, the name might be "Starbucks Coffee" and the address might be "No. 666, Middle Section of Tianfu Avenue, Wuhou District, Chengdu".

[0043] The classification coding adopts a predefined category system, such as catering, shopping, tourism, transportation, office, etc. Each category is assigned a unique integer index, such as index 0 for catering;

[0044] Latitude and longitude coordinates are stored as floating-point numbers, accurate to six decimal places, used to represent the geographical location of points of interest. Business hours include start and end times, stored in hourly format, such as 09:00 and 17:00;

[0045] The pedestrian flow data includes continuous values ​​(such as the number of people per hour) and discrete crowding levels (loose, normal, crowded, and full), which are generated through historical sensor data or manual verification.

[0046] During the data collection process, name text, address text, and category code are obtained directly through the map API, while latitude and longitude coordinates are converted through GPS devices or geocoding services; business hours information comes from the details page of points of interest or self-reported by merchants.

[0047] The labeling method adopts a semi-automatic process. Specifically, the pedestrian flow data is collected in real time by sensors and aggregated into hourly data. Then, it is converted into a congestion level through a threshold method. For example, pedestrian flow <100 is loose, 100-500 is normal, 500-1000 is crowded, and >1000 is overcrowded.

[0048] All data has been cleaned and standardized, such as removing duplicate points of interest, filling in missing values, and converting the text to UTF-8 encoding.

[0049] The dataset is organized around the spatiotemporal dimension. Each point of interest stores data for multiple days in a time series. Specifically, the data is divided by day, with each point of interest containing 24 time point records per day, and each record covering all the aforementioned attributes.

[0050] Alternatively, open-source point-of-interest datasets can be used to construct training data, such as the Foursquare dataset, which contains more than 1 million points of interest worldwide and 22 million check-in records with latitude, longitude, category, and timestamp.

[0051] The Gowalla dataset contains 640,000 check-in records (user ID, time, latitude and longitude, point of interest ID) and 950,000 social relationships;

[0052] The LibCity dataset integrates more than 30 urban spatiotemporal datasets (traffic, pedestrian flow, points of interest, etc.) into an easy-to-use format.

[0053] It should be noted that the design of this invention is decoupled. If the open-source dataset does not contain the attribute data specifically selected in this invention, the attribute can be uniformly encoded. For example, if an open-source dataset does not contain latitude and longitude, the latitude and longitude attribute can be uniformly encoded as "0" to adapt to the data processing flow and model framework of this invention.

[0054] S2. A hierarchical perceptual attention fusion mechanism is used to dynamically fuse the name text, address text, and classification coding information of urban points of interest to obtain the feature vector of the points of interest.

[0055] In an optional embodiment of the present invention, step S2 performs multimodal feature dynamic fusion. Specifically, the name text and address text are converted into fixed-dimensional vectors through a pre-trained text embedding layer, and the classification encoding is processed by one-hot encoding and projection layer. Then, the hierarchical perception attention mechanism dynamically calculates the weights of each modality to generate a unified interest point feature vector.

[0056] City point of interest data contains multimodal features such as textual information and classification codes. Conventional methods usually use static splicing or simple embedding techniques to process these features, but it is difficult to effectively capture the dynamic relationship between different modal features, and it cannot identify the spatial hierarchical semantic structure contained in the address text. At the same time, it is difficult to perform robust feature representation when the length of the address description text varies greatly.

[0057] This invention employs a hierarchical perceptual attention fusion mechanism to dynamically assign weights to and fuse features from different modalities. Specifically, firstly, feature representations are generated for the name text, address text, and classification code of the point of interest, producing vectors of fixed dimensions. Then, using an attention mechanism, the importance weights of each modality are dynamically calculated based on the semantic association between the name and address texts. Finally, these weights are used to weight and fuse the feature vectors of each modality to generate a unified feature vector for the point of interest, thereby strengthening the spatial semantic association and alleviating the problem of ineffective feature representation caused by differences in address text length. The specific steps are as follows:

[0058] S201, Multimodal Feature Embedding and Concatenation

[0059] The name text, address text, and classification code of the point of interest are represented by features. Specifically, the name text and address text are converted into fixed-dimensional vectors through independent text embedding layers, and the classification code is projected onto the same dimension after one-hot encoding. Then, the name embedding vector, address embedding vector, and classification projection vector are concatenated column-wise to form the initial feature matrix, represented as follows:

[0060]

[0061] In the formula, Let be the initial feature matrix for the p-th interest point, with dimensions D×M; D is the embedding dimension; M represents the number of modalities, e.g., M=3, name / address / category; Embed1(·) is the first text embedding layer; Embed2(·) is the second text embedding layer; name p addr is the name text for the p-th point of interest; p The address text of the p-th point of interest; cat p Let p be the classification code for the p-th interest point; p is the index of the interest point; OneHot(·) represents the one-hot encoding of the classification feature; [·;·;·] represents the vector concatenation operation.

[0062] It should be noted that Embed1(·) and Embed2(·) serve as text embedding layers, converting the text into a fixed-dimensional vector with an embedding dimension of D. OneHot(·) serves as a one-hot encoding of the classification features, generating a vector with a category dimension. The final matrix dimension is D×M.

[0063] It should also be noted that OneHot(cat) p The output of ) is a vector of category dimension. Assuming the number of categories is C, C may not be equal to D, but a D×M matrix must be formed. Therefore, in actual implementation, the one-hot encoding needs to be projected to the D dimension, for example, by projecting through a learnable fully connected layer.

[0064] In one embodiment, assuming a point of interest is a coffee shop, the specific parameters are set as follows: embedding dimension D = 64, number of modalities M = 3, and there are 5 categories, such as index 0: "dining", 1: "shopping", 2: "tourism", 3: "transportation", 4: "office"); therefore, C = 5.

[0065] The text embedding layer uses pre-trained word embeddings, such as Word2Vec word embeddings, and outputs a D-dimensional vector.

[0066] Point of interest data is: name p "Starbucks Coffee", address: addr p "No. 666, Middle Section of Tianfu Avenue, Wuhou District, Chengdu", categorized as cat p "Catering", corresponding to category index 0;

[0067] When constructing the initial multimodal feature matrix, for the input text "Starbucks Coffee", it may first be segmented into ["Starbucks", "Coffee"]. Then, the vector of each word is obtained through the embedding layer, and a D=64-dimensional vector is output, such as Embed1("Starbucks Coffee")=[0.15,-0.22,0.31,…,0.08] (64 elements) (Note: The actual values ​​are learned by the model, and this is only for illustration; the vector element range is usually around [-1,1]).

[0068] Furthermore, for the input text "No. 666, Middle Section of Tianfu Avenue, Wuhou District, Chengdu", since the address text is relatively long, the embedding layer can use average pooling to process the long sequence and output a D=64-dimensional vector, such as Embed2("No. 666, Middle Section of Tianfu Avenue, Wuhou District, Chengdu") = [-0.18, 0.25, 0.12, ..., -0.05] (64 elements) (Note: The actual values ​​are learned by the model, and this is only for illustration; the vector element range is usually around [-1, 1]).

[0069] Furthermore, given the input category "catering" with a category index of 0, a C=5 dimensional vector is generated using one-hot encoding, specifically OneHot("catering") = [1,0,0,0,0]. This vector is then projected to D dimensions. Since one-hot encoding is 5 dimensional, and the matrix requires D×M (each column must be D dimensional), a learnable fully connected layer is needed to project it to 64 dimensions, represented as v. cat =W proj OneHot (cat) p )+b proj Among them, W proj It is a 64×5 weight matrix, where b is the learnable parameter. proj If the bias vector is 64-dimensional and the parameters are learnable, then the example output is v. cat = [0.10, -0.30, 0.05, ..., 0.20] (64 elements) (Note: The actual values ​​are learned by the model and are only for illustration; the vector element range is usually around [-1, 1]);

[0070] Furthermore, construct the initial feature matrix. Concatenate the vectors of the three modes as columns, and represent it as follows: The first column represents the name modality feature, the second column represents the address modality feature, and the third column represents the classification modality feature.

[0071] S202, Attention-Weighted Feature Fusion

[0072] Query vectors are generated based on semantic associations of name and address modalities. Attention weights for each modality are calculated. Then, these weights are used to weight and sum the feature column vectors of each modality in the initial feature matrix, multiplying the sum by the projection matrix of the corresponding modality. This results in the fusion of these sums to generate interest point feature vectors, thereby dynamically adjusting the contribution of different modalities. This strengthens spatial semantic associations and addresses the issue of address text length discrepancies. This can be represented as:

[0073]

[0074] In the formula, V p Let p be the feature vector of the fused interest point; The attention weight for the p-th interest point and the m-th modality is calculated as follows: W m Let be the projection matrix of the m-th mode, which is a learnable parameter; m is the mode index. for The feature column vector corresponding to the m-th mode; exp(·) is the natural exponential function; q p Let p be the query vector for the p-th interest point, generated by a multilayer perceptron, and represented as... for The feature column vectors corresponding to the name modality, that is, the name embedding vectors extracted from the initial feature matrix; for The feature column vector corresponding to the address mode is the address embedding vector extracted from the initial feature matrix; MLP(·) represents a multilayer perceptron, i.e., a multilayer fully connected neural network. For q p transpose; k m Let k be the key vector of the m-th mode, and k is a learnable parameter. j Let be the key vector of the j-th mode, and be a learnable parameter; d k The key vector dimension, the specific value of which can be adjusted according to the embedding dimension D, such as d k =D, or take an empirical value, such as d k =64.

[0075] It should be noted that attention weights are used... Dynamically adjusting the contributions of name, address, and classification modalities can solve the feature imbalance problem caused by differences in address text length. Simultaneously, it utilizes the query vector q... p Explicitly capture the semantic association between names and addresses to enhance spatial hierarchy semantics.

[0076] It should also be noted that the query vector It can capture the semantic relationship between names and addresses, rather than statically concatenating them, and it uses attention weights. Modal importance is dynamically calculated by scaling the dot product. To prevent gradient vanishing, the feature column vectors of long address text should be optimized. It can adjust weights based on semantic associations, thus alleviating the problem of imbalanced feature representations caused by differences in text length.

[0077] S3. The latitude and longitude coordinate information of urban points of interest is modeled using the regional adaptive spherical convolutional coding method to obtain the spatial coding vector.

[0078] In an optional embodiment of the present invention, step S3 performs spherical spatial dependency modeling. Specifically, based on the latitude and longitude coordinates of the point of interest, the spherical distance from it to the center of the multi-level administrative region is accurately calculated using the semi-sine formula to eliminate the distortion caused by the curvature of the earth. Then, a spatial encoding vector is generated by distance-aware weighted fusion to accurately capture cross-regional spatial dependencies.

[0079] The latitude and longitude coordinates of points of interest imply spatial dependence. Conventional methods usually use Euclidean distance to calculate spatial relationships. However, in geographic space, especially in cross-regional scenarios, Euclidean distance will produce significant distortion due to ignoring the curvature of the earth, resulting in increased errors in the encoding of spatial relationships near regional boundaries and failing to accurately reflect the true geographic distance.

[0080] This invention employs a region-adaptive spherical convolutional coding method. First, it uses the semi-sine formula to accurately calculate the spherical distance from the point of interest to the center of each level of administrative region, thus eliminating distance calculation distortion caused by the curvature of the Earth. Then, based on these calculated spherical distances, it performs distance-aware weighted fusion of the transformation matrices unique to each administrative region. Finally, it generates the final spatial coding vector through activation function processing, thereby accurately modeling the spatial dependencies under multi-level regional coverage and solving the problem of cross-regional spatial modeling distortion. The specific steps are as follows:

[0081] S301, Spherical Distance Calculation

[0082] The spherical distance from a point of interest to the center of each administrative region is calculated using the semi-sine versine formula. Specifically, the input parameters are the latitude and longitude coordinates of the point of interest and the latitude and longitude coordinates of the center of the target region. The output is a scalar distance value through the semi-sine versine distance. By considering the influence of the Earth's curvature, the distance distortion when crossing regions is eliminated, and it is expressed as:

[0083]

[0084] In the formula, ΔDist p,r Let be the spherical distance from the p-th point of interest to the center of the r-th region, measured in kilometers, but as a scalar, the unit is not substituted during calculation; lon p Let lat be the longitude coordinate of the p-th point of interest; p Let p be the latitude coordinates of the p-th point of interest; Let r be the longitude coordinates of the center of the r-th administrative region; Here, represents the latitude coordinates of the center of the r-th administrative region; r is the index of the administrative region; Ha(·) represents the semi-sine distance, and its inputs are defined as x1, x2, x3, x4, where x1 is the first parameter of the semi-sine distance, corresponding to lon in this invention. p x2 is the second parameter of the semi-sine distance, corresponding to lat in this invention. p x3 is the third parameter of the semi-sine distance, corresponding to the parameter in this invention. x4 is the fourth parameter of the semi-sine distance, corresponding to the parameter in this invention. The calculation method for the semi-versus distance is expressed as follows: R is the Earth's radius, approximated as 6371, measured in kilometers. However, as a scalar, it is not included in the unit during calculation.

[0085] It should be noted that the spherical distance ΔDist p,r The semi-versus formula containing arcsin and trigonometric function terms is used to accurately calculate the distance across the Earth's surface, replacing the Euclidean distance and solving the problem of distance distortion across regions.

[0086] S302, Multi-level Spatial Coding Generation

[0087] Based on the spherical distance from points of interest to multi-level administrative regions, distance normalization weights are calculated. Then, these weights are used to weight and sum the transformation matrices specific to each region. After processing with an activation function, spatial encoding vectors are generated to achieve spatial dependency modeling of multi-level regional coverage. The distance attenuation effect is controlled by a distance-sensitive factor, as expressed below:

[0088]

[0089] In the formula, S p The spatial encoding vector for the p-th interest point; Let β be the set of K administrative regions to which the p-th point of interest belongs, encompassing multiple levels of regions including provinces, cities, and districts / counties; s As a distance-sensitive factor, it controls the steepness of distance decay, such as β. s =0.5; Soft(-β) s ΔDist p,r ) represents normalized weights based on negative distance; the closer the distance, the greater the weight. r is the transformation matrix unique to the r-th administrative region, and is a learnable parameter; Ge(·) is the GeLU activation function.

[0090] It needs to be explained that when calculating the spatial encoding vector, multi-level regional coverage is achieved through Softmax weighting. For example, tourist attractions are affected by both the county / district where they are located and the city above them. Furthermore, Soft(-β) s ΔDist p,r The term uses exponential decay based on negative distance to achieve normalized weights; the closer the distance, the greater the weight. The distance sensitivity factor β... s Precisely control the distance attenuation effect and adaptively adjust the influence intensity of multi-level regions (province / city / district) to solve the problem of distortion in cross-regional spatial modeling.

[0091] S4. Use a periodic mask generator to encode the current timestamp and business hours information of urban points of interest using business hours constraints to obtain time feature vectors;

[0092] In an optional embodiment of the present invention, step S4 performs business hours constraint encoding. Specifically, the start and end times of business hours are linearly transformed to generate a mask vector, which is then combined with the sine-cosine periodic signal of the current timestamp to construct a time feature vector, ensuring that the output during non-business hours approaches zero.

[0093] The operating hours of a place of interest often result in zero foot traffic during non-operating hours. Conventional models directly use timestamps as input features, which cannot explicitly model this hard constraint brought about by operating hours. This leads to the model predicting non-zero values ​​during non-operating hours and makes it difficult to effectively capture the periodic changes in foot traffic over time.

[0094] This invention employs a periodic mask generator. First, the start and end times of business hours are encoded into learnable vectors. Then, an activation function generates a business state mask vector. This vector automatically learns the characteristic of outputs approaching zero during non-business hours during training. Next, time features of sine and cosine periodic signals containing hourly timestamps are constructed to encode the 24-hour periodicity. Finally, the business state mask vector is concatenated with the periodic time signal to form the final time feature vector, thereby constraining the predicted output during non-business hours and integrating time periodic information. The specific steps are as follows:

[0095] S401, Business Status Mask Generation

[0096] The one-hot encodings of the start and end times of business hours are multiplied by their corresponding weight matrices, and then combined with the bias vector as input to a linear rectified activation function to generate a business state mask vector. This automatically learns the constraints of business hours, causing the output during non-business hours to approach zero, as shown below:

[0097]

[0098] In the formula, M p,t This represents the business status mask vector of the p-th point of interest at time t. The one-hot encoding of the opening time of the p-th point of interest, for example, 09:00 corresponds to the 9th element being 1; The one-hot encoding of the closing time of the p-th point of interest, for example, 17:00 corresponds to the 17th element being 1; W open ∈ is the weight matrix for the start time of business, and it consists of learnable parameters; W close The weight matrix for closing times is a learnable parameter; b mis the business state bias vector, which is a learnable parameter; ReLU(·) is the linear rectified activation function.

[0099] It should be noted that, The program uses a linear subtraction design to output negative values ​​during non-business hours, which are then reset to zero by the ReLU activation function, forcing the learning of the "zero traffic during store closure" characteristic.

[0100] S402, Construction of Periodic Time Features

[0101] The sine and cosine periodic signals of the hourly timestamps are concatenated with the business status mask vector to form a time feature vector. The sine and cosine signals encode the 24-hour periodic pattern, which, together with the business mask, addresses the prediction bias problem during non-business hours. This is represented as:

[0102] T p,t =[sin(2πt / 24); cos(2πt / 24); M p,t ]

[0103] In the formula, T p,t Let be the time feature vector of the p-th point of interest at time t; t is the time index, representing the hourly timestamp of a day, and t∈{0,1,…,23}; [·;·;·] represents the vector concatenation operation.

[0104] It should be noted that the (2πt / 24) term maps hourly time to the angular domain, 2π radians correspond to a 24-hour period, sin(2πt / 24) is the sine periodic signal at time t, and cos(2πt / 24) is the cosine periodic signal at time t.

[0105] It should also be noted that, through the business status mask vector M p,t During training, the system automatically learns business hours constraints, such as the output approaching zero after 17:01. It combines sine / cosine periodic signals to model time patterns and solve the problems of "prediction deviation during non-business hours" and "time periodicity".

[0106] S5. Extract spatiotemporal coupling features based on the feature vector of interest points, spatial encoding vector and temporal feature vector, perform regional perception time series modeling on the spatiotemporal coupling features, and generate predicted pedestrian flow values ​​and congestion level probability distributions through multi-task shared prediction.

[0107] In an optional embodiment of the present invention, step S5 first performs spatiotemporal coupling feature extraction. Specifically, the dynamic fusion feature, spatial encoding vector and temporal feature vector are concatenated into an initial feature tensor. Features are jointly extracted in the spatiotemporal neighborhood (such as the first 3 hours and a 3×3 spatial grid) using a three-dimensional convolution kernel, and residual connections are used to enhance stability.

[0108] Then, the feature sequence is processed through region-aware temporal modeling. Specifically, the region memory vector adjusts the gating mechanism, the update gate enhances the sensitivity of regional characteristics (such as peak weekend times in scenic areas), the reset gate suppresses excessive reset of historical information, and finally outputs the hidden state vector.

[0109] Finally, the results are generated through multi-task shared prediction. Specifically, after the hidden state vector is mapped by a shared projection layer, the separate linear layers output the predicted pedestrian flow (continuous regression) and the probability distribution of crowding level (discrete classification), respectively. The entire inference process is efficient and automated, requiring no manual intervention.

[0110] The prediction results are output in a structured form, including the number of people at each point of interest at a specified time (e.g., predicted passenger flow of 350 people) and the crowding probability distribution (e.g., loose: 0.1, normal: 0.7, crowded: 0.2, full: 0.0).

[0111] The specific steps for building and training an urban pedestrian flow prediction model are as follows:

[0112] S501, Spatiotemporal Coupling Feature Extraction

[0113] Pedestrian traffic is simultaneously affected by local spatial clustering effects and short-term temporal fluctuations, and there is a coupling relationship between the two. Conventional convolutional neural networks usually process the spatial or temporal dimensions separately, ignoring the cross-interaction between spatiotemporal features, which makes it impossible to capture spatiotemporal coupling effects such as the overflow of passenger flow from subway stations to surrounding business districts during the morning rush hour.

[0114] This invention constructs a spatiotemporally interleaved convolutional block. First, dynamically fused multimodal features, spatial encoding vectors, and temporal feature vectors are concatenated to form an initial spatiotemporal feature representation. Then, a three-dimensional convolutional kernel is used to perform a convolution operation on a spatiotemporal cube composed of spatial neighborhood points and nearby time points, thereby simultaneously extracting joint features within the spatial neighborhood and the temporal window. The convolution result is then processed by an activation function and layer normalization before being superimposed with the input features through residual connections. This directly captures the coupling effect between the spatial neighborhood and the temporal window, and the residual connections ensure the training stability of the deep network. This is represented as follows:

[0115] 1) Initialization of spatiotemporal feature tensors

[0116] The multimodal feature vector, spatial encoding vector, and temporal feature vector generated by dynamic attention fusion are concatenated to form the initial feature vector, represented as:

[0117]

[0118] In the formula, Let p be the initial feature vector of the p-th interest point at time t; [·; ·; ·] represents the vector concatenation operation.

[0119] 2) Joint feature extraction via 3D convolution

[0120] In a three-dimensional spatiotemporal neighborhood, a three-dimensional convolution operation is performed on the feature tensors of all points within the neighborhood. The convolution result is processed by an activation function and layer normalization, and then the input features are superimposed through residual connections. This directly captures the coupling effect between the spatial neighborhood and the temporal window, while using residual connections to ensure the stability of the deep network. This is represented as:

[0121]

[0122] In the formula, Let L be the feature vector output by the p-th interest point in the l-th convolutional block layer; l is the convolutional block layer index, and the total number of convolutional blocks is set to L, for example, L is set to 5 layers. The spatiotemporal neighborhood of the p-th point of interest includes spatial neighborhood and temporal neighborhood. The spatial neighborhood is a 3×3 grid of neighboring points selected according to latitude and longitude k. The temporal neighborhood is the time window of the previous 3 hours, that is, the time interval of (t-2, t-1, t). U represents the feature tensor of all points in the spatiotemporal neighborhood of the p-th interest point at layer l-1; (l) It is a 3D convolutional kernel with a spatial size of 3×3 and a temporal depth of 3; ★ 3D This represents a 3D convolution operation; Sw(·) is the Swish activation function; Lay(·) is the layer normalization operation; This is the feature vector output by the p-th interest point in the (l-1)th convolutional block layer.

[0123] It should be noted that by simultaneously sliding the 3×3 spatial grid and the first 3 hours of the time sequence window through the 3D convolution kernel, the "spatiotemporal coupling effect" is directly captured, such as the impact of subway stations on the overflow of passenger flow to surrounding business districts during the morning rush hour. The residual connection ensures the stability of the deep network.

[0124] It should also be noted that the 3×3 spatial size corresponds to a 3×3 spatial grid neighborhood, and the time series window for the first 3 hours corresponds to a time series depth of 3, thereby effectively capturing local spatiotemporal coupling effects, such as the overflow of customers in the business district during peak hours, while maintaining computational efficiency.

[0125] It should also be noted that spatiotemporally interleaved convolutional blocks directly model local spatiotemporal coupling effects, and the 3D convolutional kernel U (l) Simultaneously, by sliding across a 3×3 spatial grid and a temporal window from t-2 to t, joint features such as "passenger overflow from subway stations to commercial areas during morning rush hour" are directly extracted, along with the feature vector. Perform residual connections to ensure the stability of deep networks and avoid gradient vanishing.

[0126] S502, Temporal Modeling of Area Awareness

[0127] There are significant differences in pedestrian flow patterns in different areas. Conventional gating loop units use fixed gating mechanisms and lack the ability to adapt to regional characteristics, making it difficult for the model to accurately capture the unique temporal patterns of different areas, such as weekend peaks in tourist attractions or weekday commuting peaks in office areas.

[0128] To address the issue of regional heterogeneity, this invention improves the gating mechanism to a region-aware gating recurrent unit. It incorporates a learnable regional memory vector to adjust the gating sensitivity. During the calculation of the update and reset gates, this regional memory vector participates in the calculation in different ways. Specifically, it is directly added to the update gate to enhance sensitivity to region-specific patterns, while in the reset gate, it participates through a negative suppression term to reduce the excessive reset effect of historical information by prior regional knowledge. After the gating calculation is completed, the hidden state is updated according to the standard gating mechanism, enabling the model to adaptively integrate regional characteristics and more accurately capture the unique temporal dynamics of the region. The specific steps are as follows:

[0129] 1) Region-sensitive update gate calculation

[0130] The feature vector output by the spatiotemporally interleaved convolution is linearly transformed with the hidden state at the previous time point, and then a region memory vector and a bias term are superimposed. Finally, an update gate vector is generated through the Sigmoid activation function, thereby dynamically controlling the update intensity of historical information, as shown below:

[0131]

[0132] In the formula, z p,t W is the update gate vector for the p-th interest point at time t; Sig(·) is the Sigmoid activation function; z The parameters used to update the gate feature weight matrix are trainable parameters. U is the output feature vector of the p-th interest point at time t after passing through L layers of spatiotemporally interleaved convolution; z The hidden state weight matrix for updating the gate is a trainable parameter; h p,t-1 Let b be the hidden state of the p-th interest point at time t-1; z To update the gate bias vector, are trainable parameters; C r Let be the memory vector of the r-th region, and be the learnable parameters.

[0133] It should be noted that updating the gate vector z p,t The intensity of historical information updates is dynamically controlled; when the value approaches 1, the influence of new features is strengthened, and when the value approaches 0, more historical states are retained. The memory vector C... rCustomize the gating sensitivity for different regions to enhance the model's ability to capture regional heterogeneous temporal patterns.

[0134] 2) Historical Reset Gate Calculation

[0135] After linearly combining the spatiotemporal feature vector with the hidden state at the previous time point, subtracting the suppression term of the regional memory vector, and generating a reset gate vector through an activation function, the suppression term further reduces the excessive resetting of historical information by the regional prior, expressed as:

[0136]

[0137] In the formula, r p,t W is the reset gate vector for the p-th interest point at time t; r U is the reset gate feature weight matrix, which consists of trainable parameters; r b is the hidden state weight matrix for the reset gate, which is a trainable parameter; r γ is the reset gate bias vector, which is a trainable parameter; γ is the reset gate region suppression coefficient, γ>0, such as γ=0.3.

[0138] It should be noted that the memory vector C r Encoding regions with prior knowledge, such as peak weekend patterns in tourist attractions, might lead to excessive resetting of historical information if used directly. Therefore, adding `-γC` is recommended. r The term, as a suppression term, can reduce the influence of regional priors. The low regional prior intensity on historical information resets the model and prevents it from ignoring long-term temporal dependencies.

[0139] 3) Candidate state fusion

[0140] The reset gate vector is element-wise multiplied with the hidden state at the previous time point to control the intensity of the historical information flow, and then linearly combined with the current spatiotemporal feature vector. An activation function is then used to generate a candidate hidden state vector, expressed as:

[0141]

[0142] In the formula, Let W be the candidate hidden state vector of the p-th interest point at time t; tanh(·) is the hyperbolic tangent activation function; h U is the candidate feature weight matrix, which consists of trainable parameters. h is the candidate hidden state weight matrix, which are trainable parameters; ⊙ represents element-wise multiplication, i.e., the Hadamard product operation.

[0143] It should be noted that the reset gate vector r (p,t) The degree to which historical information is retained, r p,t ⊙h p,t-1 The term resets the gate vector r through element-wise multiplication.(p,t) Historical information is reset when it approaches 0 and retained when it approaches 1, thereby controlling the information flow and the retention ratio of historical information.

[0144] 4) Gating status update

[0145] By updating the gate vector and performing a weighted summation of the hidden state and candidate hidden states at the previous time point, the resulting hidden state vector with fused region characteristics is output as follows:

[0146]

[0147] In the formula, h p,t Let be the hidden state vector of the fused region characteristics of the p-th interest point at time t.

[0148] It should be noted that updating the gate vector z (p,t) Control the proportion of new information, (1-z (p,t) The term (1-z) represents the proportion of old information. p,t )⊙h p,t-1 The item directly retains part of the historical state. The term represents the proportion of newly added candidate information, and the candidate hidden state vector is... Update gate vector z (p,t) The proportion is added to generate new information to update the status.

[0149] It should also be noted that, through the region memory vector C r Encoding region priors, such as the weekend peak season mode in scenic areas, involve adding a memory vector C to the update gate. r Enhanced region sensitivity by adding -γC to the reset gate r This measure aims to prevent excessive resetting of historical information and address the issue of "regional heterogeneity."

[0150] It should also be noted that the update gate and the reset gate together achieve adaptive fusion of region timing patterns, and the update gate adds the region memory vector C. r To enhance sensitivity to regional characteristics such as weekend peak hours in scenic areas, the reset gate adopts -γC r The term acts as a suppression term to prevent excessive resetting of historical information in the region's prior knowledge, thus balancing long-term dependence and regional heterogeneity.

[0151] S503, Multi-task Shared Prediction

[0152] The prediction target needs to output both continuous pedestrian flow values ​​and discrete congestion levels. Conventional single-task designs train independent models or output layers for the two tasks, ignoring the inherent relationship between tasks. This can easily lead to low utilization of model parameters and may cause conflicts due to differences in task objectives, thus reducing the overall prediction accuracy.

[0153] This invention employs a shared representation multi-task head. First, the hidden state vector output by the region-aware gating network is mapped to a common feature space through a shared projection layer, extracting the feature representations common to both tasks. Then, based on these shared features, independent linear layers are used for subsequent processing. Specifically, one linear layer is responsible for the regression task, directly outputting the predicted pedestrian flow value, while the other linear layer is responsible for the classification task, outputting the probability distribution of the congestion level. Furthermore, the shared layer leverages the correlation between tasks to improve generalization ability, while the separate output layers adapt to the different characteristics of the regression and classification tasks. The specific steps are as follows:

[0154] 1) Shared feature projection

[0155] The hidden state vector output by the region-aware gating network is mapped to a shared feature space through a shared projection matrix and activation function. This extracts the common feature representations for the pedestrian flow and congestion tasks, resulting in a shared feature vector, expressed as follows:

[0156]

[0157] In the formula, W is the shared feature vector at time point t; share For the shared projection matrix, there are trainable parameters.

[0158] 2) Return of pedestrian traffic

[0159] A linear transformation is performed on the shared feature vectors to output the predicted pedestrian flow, completing the continuous regression task, as shown below:

[0160]

[0161] In the formula, w represents the predicted pedestrian flow at the p-th point of interest at time t. flow The regression weight vector consists of trainable parameters; It is w flow transpose; b flow The regression bias term is a trainable parameter.

[0162] 3) Crowding classification output

[0163] After performing a linear transformation and normalization on the shared feature vectors, the probability distribution of crowding levels is output to complete the discrete classification task, as shown below:

[0164]

[0165] In the formula, W represents the probability distribution vector of the congestion level of the p-th point of interest at time t, corresponding to four levels: loose / normal / crowded / full. crowdThis is the classification weight matrix.

[0166] It should be noted that, through the shared projection matrix W share By extracting common features representing pedestrian flow and congestion, we can improve generalization by leveraging the correlation between tasks and adapt to different task characteristics by separating the output layer.

[0167] It should also be noted that the shared layer and the separate output layer learn related tasks in a collaborative manner. The shared layer extracts common features of pedestrian flow and congestion to improve parameter utilization, while the regression and classification calculations of the separate output layer are adapted to different task characteristics to avoid target conflicts.

[0168] S504, Spatial Density Weighted Training

[0169] Urban points of interest are highly unevenly distributed in space. Conventional mean squared error loss functions treat the prediction error of all points of interest equally, which easily ignores the differences in spatial density. This leads to the model training process being overly biased towards densely populated areas of interest, such as the city center, while its ability to predict points of interest in sparse areas such as the suburbs is insufficient.

[0170] To address the issue of uneven spatial distribution, this invention employs kernel density estimation weighted loss. First, a spatial density weight is calculated for each point of interest based on a Gaussian kernel function. This weight reflects the distribution density of points of interest in the local area where the point is located; dense areas have higher weights, and sparse areas have lower weights. Then, a power-law decay transformation is applied to this spatial density weight, allowing samples in sparse areas to obtain higher relative weights in the loss function. Finally, the transformed weights are used to simultaneously weight the losses of both the pedestrian flow regression task and the crowding classification task, thereby balancing the impact of uneven spatial distribution and improving the predictive ability for points of interest in low-density areas. This can be expressed as:

[0171] 1) Kernel density weight calculation

[0172] The spatial density weight of each interest point is calculated based on the Gaussian kernel function. Specifically, the number of neighboring interest points is counted within a region centered on the target point and with a fixed bandwidth as the radius. The spatial distribution density is quantified using the kernel function, as follows:

[0173]

[0174] In the formula, KDE(p) represents the spatial density weight of the p-th interest point; n p Let be the number of interest points in the neighborhood of the p-th interest point, specifically calculated through spatial query, i.e., loc. p Centered on p, count the number of other interest points within a region with a radius equal to the kernel function bandwidth h; h is the kernel function bandwidth, e.g., 0.05 times the spatial range of the dataset; N is the total number of interest points in the dataset; q is the index of the interest point that distinguishes it from p; loc pLet loc be the latitude and longitude coordinate vector of the p-th point of interest; q Let q be the latitude and longitude coordinate vector of the qth point of interest; ‖·‖ represents the L2 norm, which is the same as the Euclidean distance calculation method; Ks(·) is the Gaussian kernel function.

[0175] 2) Multi-task loss weighting

[0176] After applying a power-law decay to the spatial density weights, the weighted pedestrian flow regression loss and crowding classification loss are combined. By assigning higher weights to sparse regions, the problem of uneven spatial distribution is balanced, as expressed below:

[0177]

[0178] In the formula, Loss is the total loss; c a This is the weight decay index. The term c represents the spatial density weight of the p-th interest point. a The power represents the spatial weight term, such as... Let be the actual pedestrian flow value of the p-th point of interest at time t; δ1 is the one-hot encoding of the true congestion label of the p-th interest point at time t; δ1 is the first task weight, used to adjust the importance of the traffic flow regression task, e.g., δ1 = 0.6; δ2 is the second task weight, used to adjust the importance of the congestion classification task, e.g., δ2 = 0.4; Hc(·,·) is the cross-entropy loss; Σ p,t • This represents the summation over all points of interest and time points.

[0179] It should be noted that, through The term assigns higher loss weights to sparse regions to balance the problem of uneven spatial distribution and improve the model's predictive ability in low-density regions.

[0180] It should also be noted that the weight decay index c a It should be set to a value less than 1 to ensure that sparse regions with low spatial density weights receive higher loss weights, but with a gradual decay to avoid overweighting. Preferably, the weight decay exponent c is... a The adjustable range is 0.5-0.8 to balance the uneven spatial distribution.

[0181] S505, Gradient-Sensitive Parameter Optimization

[0182] Conventional pedestrian flow prediction models have a large number of parameters, and the magnitude of gradients generated by different tasks varies significantly. Conventional optimizers use a uniform learning rate for all model parameters, which can easily lead to unstable training of parameters that are sensitive to gradient fluctuations, slow convergence speed, and easy getting stuck in local optima.

[0183] To improve training stability and efficiency, this invention employs a parameter-sensitivity-driven asynchronous optimizer. First, during training, the gradient vectors of all model parameters in the most recent iterations are calculated. Then, the volatility of these gradient vectors is analyzed as an indicator of parameter sensitivity. Next, the learning rate is dynamically allocated based on the parameter sensitivity ratio: a smaller learning rate is allocated to parameters with high volatility for stable updates, while a larger learning rate is allocated to parameters with low volatility to accelerate convergence. Finally, based on the basic optimizer update rules, the calculated adaptive learning rate is used to update the parameters, thereby performing differentiated optimization based on the gradient characteristics of the parameters themselves. This effectively improves the stability and convergence speed of the training process. The specific steps are as follows:

[0184] 1) Parameter gradient statistics

[0185] Using the backpropagation algorithm, the gradient vectors of all trainable parameters of the model in the current training iteration are calculated, and expressed as:

[0186]

[0187] In the formula, Let θ be the gradient vector of the parameter θ in the k-th iteration; θ is the trainable parameters of the model, which are in set form; k is the index of the current training iteration number. This represents the gradient operator with respect to the parameter θ. This represents the gradient of the loss function with respect to the parameter θ, calculated using the backpropagation algorithm.

[0188] 2) Sensitivity-adaptive learning rate allocation

[0189] Sensitivity is calculated based on the gradient volatility of the parameter in the most recent iteration. The learning rate is then allocated proportionally to the sensitivity, with a smaller learning rate assigned to parameters with high volatility and a larger learning rate assigned to parameters with low volatility. This is expressed as follows:

[0190]

[0191] In the formula, η θ η is the adaptive learning rate; η0 is the base learning rate, e.g., η0 = 0.001; std(·) represents the standard deviation calculation; Ta is the preset number of the most recent iterations, e.g., Ta = 10; Θ is the set of all trainable parameters of the model; log(·) is the logarithmic function, with the default base being the natural constant.

[0192] It should be noted that, The standard deviation is used to measure the degree of fluctuation in the gradient.

[0193] It should also be noted that the adaptive learning rate η θ In the calculation method, a logarithmic function is used to compress the difference in magnitude and avoid the influence of extreme values.

[0194] 3) Asynchronous parameter update

[0195] An adaptive learning rate is used instead of the base learning rate. Parameters are updated according to the optimizer's internal rules, and the training process is stabilized through a gradient correction term. This achieves small-step updates for parameters with high volatility and large-step updates for parameters with low volatility, as expressed below:

[0196]

[0197] In the formula, θ (k) θ represents the value of the trainable parameters of the model in the k-th iteration. (k+1) Let A be the value of the trainable parameters of the model in the (k+1)th iteration; Ada(·) represents the update rule of the Adam optimizer, implemented as follows: For the first-order moment correction term in the k-th iteration, it is an intermediate statistic in the Adam optimization process; is the second-order moment correction term in the k-th iteration, which is an intermediate statistic in the Adam optimization process; ∈ is a numerical stability constant used to prevent the denominator from being 0, such as ∈=0.00001.

[0198] It should be noted that std(‖g θ The term ‖ represents the degree of gradient fluctuation, and thus quantifies parameter sensitivity. A smaller learning rate is assigned to parameters with high fluctuation to stabilize training, and a larger learning rate is assigned to parameters with low fluctuation to accelerate convergence.

[0199] It should also be noted that the internal mechanism of the Adam optimizer involves a first-order moment correction term. and second-order moment correction term Both are based on the exponential moving average of the gradient and undergo bias correction to stabilize training. and It provides adaptive gradient scaling, with small update step size when the variance is large, combined with an adaptive learning rate η. θ The high-fluctuation parameters and small learning rate work together to adaptively adjust the parameter update step size, providing a double guarantee for improving training stability.

[0200] In one embodiment, the dynamic fusion effect of multimodal features is analyzed to verify the effectiveness of the hierarchical perception attention mechanism in fusing multimodal features, to evaluate the robustness of the present invention to address text length differences, and to compare the spatial modeling accuracy of spherical distance encoding with that of traditional Euclidean distance.

[0201] Regarding attention weight allocation, compared with the conventional static splicing method and the dynamic weight allocation mechanism of this invention, such as... Figure 2As shown in the attention weight distribution diagram, the present invention significantly increases the weight ratio of the address modality (approximately 45%), indicating that the attention mechanism can effectively identify the spatial hierarchical semantic structure contained in the address text and solve the defect of conventional methods that treat each modality feature equally.

[0202] Regarding the impact of address text length, the influence of different address text lengths on prediction error is analyzed, such as... Figure 3 As shown in the address text length influence diagram, the prediction error curve of the present invention has a gentler slope, and the error increase is reduced by 60% in the high text length region (>60 characters), proving that the hierarchical perception mechanism effectively alleviates the problem of imbalance in long text feature representation.

[0203] Regarding spatial coding methods, the coding errors of Euclidean distance and spherical distance in cross-regional scenarios are compared, such as... Figure 4 As shown in the comparison diagram, the spatial coding clearly demonstrates that as the distance increases, the error growth rate of spherical distance coding is significantly lower than that of Euclidean distance coding. In a cross-regional scenario of 100 kilometers, the error is reduced by more than 40%, verifying the effectiveness of the semi-versus formula in eliminating Earth curvature distortion.

[0204] Regarding operating hours constraints, the effectiveness of time-constrained coding in improving the prediction of non-operating hours was verified, such as... Figure 5 As shown in the business hours constraint diagram, the predicted values ​​of this invention are strictly zero during non-business hours (0-9 am and 22-24 pm), while conventional methods produce incorrect predictions, proving that the masking mechanism successfully learns the "zero traffic during closing hours" characteristic. The sine / cosine periodic signals in the time features accurately capture the fluctuations in customer flow during the midday and evening peak hours.

[0205] In another embodiment, the spatiotemporal coupling feature extraction effect is analyzed to verify the ability of 3D spatiotemporal convolution to capture local spatiotemporal coupling effects, and the effect of residual connections on improving the stability of deep networks is analyzed.

[0206] Regarding spatiotemporal feature structure, the feature activation patterns within the spatiotemporal cube are visualized, such as... Figure 6 As shown in the spatiotemporal feature tensor heatmap, the features exhibit regular activation patterns in the spatial dimension (9 grid points) and the temporal dimension (6 time steps), such as the strong activation (red) in the central area during the morning rush hour (t-1), proving that the three-dimensional convolution successfully extracts spatiotemporal coupling effects such as "subway station overflow to business district".

[0207] Regarding residual connections, the training stability of deep networks with and without residual connections is compared, such as... Figure 7 As shown in the residual connection effect diagram, the training loss of the present invention (with residual) continues to decrease with the increase of network depth, while the baseline method rebounds after layer 2, proving that residual connection effectively solves the gradient vanishing problem, enables stable training of 5-layer deep networks, and reduces the error by 40%.

[0208] In another embodiment, the effect of region-aware temporal modeling is analyzed to verify the enhancing effect of region memory vectors on temporal modeling and to analyze the adaptability of gating mechanisms to regional heterogeneity patterns.

[0209] Regarding regional time-series patterns, the prediction effects of visitor flow in scenic areas and office areas were compared, such as... Figure 8 As shown in the regional prediction effect diagram, the prediction curves of this invention for the morning peak (8-10 am) and evening peak (17-19 pm) in the scenic area and the office area almost coincide with the actual values, while the conventional method shows a significant lag in prediction for the weekend peak in the scenic area, proving that the regional memory vector successfully enhances the model's sensitivity to heterogeneous patterns.

[0210] Regarding the gating mechanism, the dynamic behaviors of updating and resetting the door are demonstrated, such as... Figure 9 As shown, the gating behavior analysis reveals that the update gate increases significantly (>0.7) during periods of drastic passenger flow changes (such as 7:00 AM), enhancing the impact of new features, while the reset gate remains at a high level (>0.8) during stable periods (such as early morning), protecting historical information and dynamically balancing the contradiction between "regional heterogeneity" and "long-term dependence".

[0211] In another embodiment, a multi-task prediction and optimization strategy effect analysis is performed to verify the effectiveness of the shared representation multi-task head and evaluate the performance improvement of spatial density weighting and gradient-sensitive optimization.

[0212] Regarding the distribution of feature space, the relationship between shared features and task-specific features can be visualized, such as... Figure 10 As shown, in the multi-task feature space map, the pedestrian flow feature (blue) and the crowding feature (red) are closely distributed around the shared feature (green), with an overlap of 70%, proving that the shared projection layer effectively extracts the common representation of the task and improves the parameter utilization rate.

[0213] Regarding spatial density weighting, the improvement effect of density weighting on the prediction of sparse regions is analyzed, such as... Figure 11 As shown, in the spatial density weighted map, the accuracy of the present invention in low-density areas (weight < 0.4) is 25% higher than that of the unweighted method, and the overall curve is flatter, indicating that the kernel density weighted strategy successfully balances the problem of uneven spatial distribution and improves the prediction ability of sparse areas such as suburbs.

[0214] In terms of optimizer performance analysis, the training convergence speed and stability are compared, such as... Figure 12 As shown in the optimizer effect diagram, the gradient-sensitive optimizer's loss curve converges at twice the speed and maintains a steady decline in the later stages of iteration without oscillation. The adaptive learning rate mechanism assigns a small learning rate to parameters with high volatility (to prevent divergence) and a large learning rate to parameters with low volatility (to accelerate convergence), achieving efficient and stable training.

[0215] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0216] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0217] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0218] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

[0219] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.

Claims

1. A method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest, characterized in that, Includes the following steps: Obtain the spatiotemporal dataset of city points of interest; the spatiotemporal dataset of city points of interest includes name text, address text, classification code, latitude and longitude coordinates, current timestamp and business hours information; A hierarchical perceptual attention fusion mechanism is used to dynamically fuse multimodal features of the name text, address text, and classification coding information of urban points of interest to obtain feature vectors of points of interest; The region-adaptive spherical convolutional coding method is used to perform spherical spatial dependency modeling on the latitude and longitude coordinates of urban points of interest, resulting in a spatial coding vector, including: The spherical distance from the point of interest to the center of each region is calculated using the semi-versus formula; expressed as: In the formula, The spherical distance from the p-th point of interest to the center of the r-th region is measured in kilometers, but as a scalar, the unit is not substituted during calculation. Let p be the longitude coordinates of the p-th point of interest; Let p be the latitude coordinates of the p-th point of interest; Let r be the longitude coordinates of the center of the r-th administrative region; Let r be the latitude coordinate of the center of the r-th administrative region; r is the index of the administrative region. Let the semi-sine distance be represented, and its inputs be defined as follows: , The first parameter of the semi-sine distance corresponds to: , The second parameter of the semi-sine distance corresponds to: , The third parameter of the semi-sine distance corresponds to: , The fourth parameter of the semi-sine distance corresponds to: The calculation method for the semi-versus distance is expressed as follows: ; For the Earth's radius, Based on the spherical distance from the point of interest to the center of each region, the transformation matrix of each region is weighted and fused with distance awareness, and a spatial encoding vector is generated through an activation function; Calculate the distance normalization weights based on the spherical distances from the points of interest to the centers of each region; The transformation matrices corresponding to each region are weighted and summed using distance normalization weights and distance sensitivity factors, and then processed by an activation function to generate a spatial encoding vector; represented as: In the formula, The spatial encoding vector for the p-th interest point; The p-th point of interest belongs to A collection of administrative regions, including provinces, cities, districts and counties at multiple levels; As a distance-sensitive factor, it controls the steepness of distance decay; is the transformation matrix unique to the r-th administrative region, and is a learnable parameter; Use the GeLU activation function; Let p be the feature vector of the fused interest point; A periodic mask generator is used to encode the current timestamp and business hours information of urban points of interest using business hours constraints, resulting in a time feature vector. Spatiotemporal coupling features are extracted based on the feature vectors of points of interest, spatial encoding vectors, and temporal feature vectors. Regional perception temporal modeling is performed on the spatiotemporal coupling features, and predicted pedestrian flow and crowding level probability distribution are generated through multi-task shared prediction.

2. The method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest according to claim 1, characterized in that, A hierarchical perceptual attention fusion mechanism is employed to dynamically fuse multimodal features from the name text, address text, and classification coding information of urban points of interest, resulting in a feature vector for the points of interest, including: The name text, address text, and classification code of the points of interest are represented by features to form an initial feature matrix; An attention mechanism is used to dynamically calculate the importance weights of each modality based on the semantic association between the name text and the address text. The feature vectors of each modality are then weighted and fused using the importance weights to generate interest point feature vectors.

3. The method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest according to claim 2, characterized in that, An attention mechanism is used to dynamically calculate the importance weights of each modality based on the semantic association between the name text and the address text. The feature vectors of each modality are then weighted and fused using these importance weights to generate interest point feature vectors, including: Generate query vectors based on the semantic association between name text and address text, and calculate attention weights for each modality; The feature column vectors of each modality in the initial feature matrix are weighted and summed using the attention weights of each modality, and then multiplied by the projection matrix of the corresponding modality to generate interest point feature vectors.

4. The method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest according to claim 1, characterized in that, A periodic mask generator is used to encode the current timestamp and business hours information of urban points of interest using business hours constraints, resulting in a time feature vector, including: The start and end times of business operations are encoded into learnable vectors, and an activation function is used to generate a business state mask vector. Construct time features of sine and cosine periodic signals containing hourly timestamps, and concatenate the business status mask vector with the time features of the periodic signals to generate a time feature vector.

5. The method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest according to claim 1, characterized in that, Spatiotemporal coupling features are extracted based on interest point feature vectors, spatial encoding vectors, and temporal feature vectors, including: The interest point feature vector, spatial encoding vector, and temporal feature vector are concatenated to form the initial spatiotemporal feature representation; On a spatiotemporal cube composed of spatial neighborhood points and nearby time points, a three-dimensional convolution kernel is used to perform convolution operations. After the convolution results are processed by activation functions and layer normalization, they are superimposed with the input features through residual connections to obtain spatiotemporal coupled features.

6. The method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest according to claim 1, characterized in that, Region-aware temporal modeling of spatiotemporal coupling features includes: The spatiotemporal coupling features and the hidden state at the previous time point are linearly transformed respectively. After superimposing the region memory vector and the bias term, the update gate vector is generated through the activation function. After linearly combining the spatiotemporal coupling features with the hidden state at the previous time point, the suppression term of the regional memory vector is subtracted, and a reset gate vector is generated through an activation function. The reset gate vector is multiplied element-wise with the hidden state at the previous time point, and then linearly combined with the spatiotemporal coupling feature to generate a candidate hidden state vector through an activation function. By updating the gate vector, the hidden state and candidate hidden states at the previous time point are weighted and summed to output a hidden state vector that integrates the characteristics of the fused region.

7. The method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest according to claim 1, characterized in that, The system generates predicted pedestrian flow values ​​and congestion level probability distributions through multi-task shared prediction, including: The hidden state vector obtained by region-aware temporal modeling is mapped to a common feature space through a shared projection layer to extract shared feature representations; Independent linear layers are used to perform regression and classification tasks on the shared feature representations, outputting predicted pedestrian flow and probability distribution of crowding level.

8. The method for predicting urban pedestrian flow based on a spatiotemporal dataset of urban points of interest according to claim 1, characterized in that, During training, the spatial density weight of each interest point is calculated based on the Gaussian kernel function. Then, the spatial density weight of each interest point is subjected to a power decay transformation. Finally, the transformed spatial density weight is used to simultaneously weight the loss of the pedestrian flow regression task and the loss of the crowding classification task. And / or during training, calculate the gradient vectors of all model parameters in the most recent iterations, then use the fluctuation of the gradient vectors as an indicator of parameter sensitivity, dynamically allocate the learning rate according to the parameter sensitivity ratio, and finally update the parameters using the calculated adaptive learning rate based on the basic optimizer update rules.