A method for predicting population density in key areas based on big data
By using adaptive graph attention network and heterogeneous graph convolutional neural network to process population behavior data in population density prediction, the problem of single data sources and low dimensions in the prior art is solved, and more accurate and robust population density prediction is achieved.
Patent Information
- Application Number
- CN202410721670.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2044-06-05
AI Technical Summary
The existing population density prediction has defects such as a single data source and low data dimensions, and it is difficult to use massive complex and multi-dimensional population movement data for accurate predictions.
The population density prediction method based on big data is adopted to align, fusion, data augmentation and multi-scale feature representation learning of population behavior data through adaptive graph attention network and heterogeneous graph convolution neural network to generate multi-dimensional feature representation for density prediction.
It improves the accuracy of population density prediction, enhances the robustness of the model, can better capture complex relationships and patterns between data, and reduces the error caused by single data characteristics.
Smart Images

Figure CN118690133B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of crowd density prediction, and particularly relates to a method for predicting crowd density in key areas based on big data. Background Art
[0002] With the rapid development of information technology, big data technology has become an important tool for extracting insights from large-scale data. At the same time, with the popularization of mobile devices and the increasing accuracy of positioning systems, people's location data is more easily obtained. Therefore, how to process massive crowd movement data to determine the changes and trends of crowd density has become increasingly important.
[0003] Accurate crowd density prediction can help optimize various aspects and improve people's quality of life. For example, in urban planning, it helps to plan urban infrastructure, housing layout, and the location of public service facilities. In security monitoring, it helps to better arrange surveillance cameras to detect and respond to security risks in a timely manner. In traffic management, it helps to better plan road traffic and improve urban transportation efficiency. In business decision-making, it helps merchants choose better store locations to increase sales and customer satisfaction, etc. Existing crowd density predictions have defects such as single data source and low data dimension. How to use massive, complex, and multi-dimensional crowd movement data, combined with advanced machine learning and deep learning technologies, to establish a model for accurately predicting crowd density and thus accurately predict crowd density has become a key issue at present. Summary of the Invention
[0004] In view of the deficiencies of the existing technology, the present invention proposes a method for predicting crowd density in key areas based on big data. The method includes: collecting crowd behavior data and inputting it into a trained crowd density prediction model for processing to obtain a crowd density prediction result;
[0005] The training process of the crowd density prediction model includes:
[0006] S1: Obtain training crowd behavior data, and use an adaptive graph attention network to align and fuse the crowd behavior data to obtain fused crowd behavior features;
[0007] S2: Perform data augmentation on the fused crowd behavior features to obtain augmented data;
[0008] S3: Perform multi-scale convolution, fusion, and mapping processing on the augmented data to obtain multi-scale feature representations;
[0009] S4: Use a heterogeneous graph convolutional neural network to perform feature representation learning on the multi-scale feature representations to obtain multi-dimensional feature representations;
[0010] S5: Input the multi-dimensional feature representation into the density prediction module for processing to obtain the crowd density prediction result;
[0011] S6: Calculate the total model loss and adjust the model parameters according to the total model loss to obtain the trained crowd density prediction model.
[0012] Preferably, in step S1, the process of aligning and fusing the crowd behavior data includes:
[0013] S11: Represent the crowd behavior data as a dynamic graph, and obtain the node features and adjacency matrix of the dynamic graph;
[0014] S12: Iteratively normalize the adjacency matrix according to the node features;
[0015] S13: Use an adaptive feature learning network to extract behavior features from the adjacency matrix; map the behavior features into high-dimensional feature vectors;
[0016] S14: Use a non-linear transformation function and a mapping matrix to perform semantic space mapping on the high-dimensional feature vectors to obtain the initial semantic features;
[0017] S15: Use a multi-layer perceptron to perform transformation operations on the initial semantic features to obtain extended semantic features;
[0018] S16: Calculate the similarity scores between different extended semantic features, divide the features with similarity scores greater than the threshold into the same category features, and integrate the same category features to generate the feature matrix Y;
[0019] S17: Calculate the attention weight sequence of the feature matrix Y, and perform fusion processing on the feature matrix Y according to the attention weight sequence to obtain the fused feature vector;
[0020] S18: Calculate the gating mechanism vector according to the current fused feature vector, and use the gating mechanism vector to perform recursive fusion on the current fused feature vector to obtain the fused crowd behavior features.
[0021] Furthermore, the formula for calculating the similarity score is:
[0022]
[0023] where match represents the similarity score, L represents the number of layers of the attention matrix, W l is the learning weight matrix of the l-th layer, b l is the bias vector of the l-th layer, represents heterogeneous pattern similarity calculation, sim(·) is the similarity function, and σ(·) is the activation function; respectively represent the i-th extended semantic feature and the j-th extended semantic feature.
[0024] Preferably, in step S2, the process of data augmentation for the fused population behavior characteristics includes: using a generator and a discriminator for alternating adversarial training to process the fused population behavior characteristics to obtain augmented data.
[0025] Preferably, in step S3, the process of obtaining the multi-scale feature representation includes:
[0026] S31: Performing a convolution operation on the augmented data with convolution kernels of different scales to obtain multi-scale feature maps;
[0027] S32: Performing an average pooling operation on the multi-scale feature maps to obtain the pooled feature maps;
[0028] S33: Processing the pooled feature maps using multiple channels to obtain multiple feature tensors;
[0029] S34: Using a linear mapping to map the multiple feature tensors to a new space, and calculating attention weights based on the multiple mapped feature tensors;
[0030] S35: Fusing the multi-scale feature maps according to the attention weights to obtain the multi-scale feature representation.
[0031] Preferably, in step S4, the process of obtaining the multi-dimensional feature representation includes:
[0032] S41: Representing the multi-scale feature representation as a heterogeneous graph;
[0033] S42: Aggregating information of the nodes in the heterogeneous graph to obtain the first aggregated features of each node; performing a weighted sum and convolution operation on the first aggregated features of the neighbor nodes of the nodes to obtain the second aggregated features of the nodes;
[0034] S43: Using a feature extractor to process the second aggregated features to obtain the extracted features of the nodes;
[0035] S44: Using an adaptive attention mechanism to process the extracted features of the nodes to obtain the multi-dimensional feature representation.
[0036] Preferably, in step S5, the process of obtaining the crowd density prediction result includes:
[0037] S51: Performing a convolution operation on the multi-dimensional feature representation to obtain a multi-dimensional feature map;
[0038] S52: Performing a max pooling operation on the multi-dimensional feature map to obtain the pooled multi-dimensional feature map;
[0039] S53: Inputting the pooled multi-dimensional feature map into a fully connected layer for processing to obtain the crowd density prediction result.
[0040] Preferably, the formula for calculating the total loss of the model is:
[0041]
[0042] Among them, L represents the total loss of the model, N represents the total number of samples, y i represents the i-th true result, θ t represents the prediction parameter, ign(·) represents the sign function, represents the i-th prediction result, ∈ represents a small constant, β represents the adjustment parameter, L align represents the heterogeneous graph convolution loss, and Myloss represents the data augmentation loss.
[0043] The beneficial effects of the present invention are as follows:
[0044] 1. For some data with a small amount, the present invention adopts a dual-network of a generator and a discriminator for alternating adversarial training to increase the amount of data, making the prediction effect better;
[0045] 2. The present invention adopts a series of models such as an adaptive graph attention network and a heterogeneous graph convolution neural network, which can better realize the alignment and fusion of heterogeneous data;
[0046] 3. Using multi-dimensional feature representation as the input of the prediction model can provide richer features for prediction, better capture the complex relationships and patterns between data, thereby reducing the error caused by a single data feature and enhancing the robustness of the model. Description of the Drawings
[0047] Figure 1 is the training flow chart of the crowd density prediction model in the present invention. Detailed Embodiments
[0048] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0049] The present invention proposes a method for predicting the crowd density in key areas based on big data, as Figure 1 shown, the method includes the following content:
[0050] Collect crowd behavior data and input it into the trained crowd density prediction model for processing to obtain the crowd density prediction result.
[0051] The training process of the crowd density prediction model includes:
[0052] S1: Obtain crowd behavior data, and use an adaptive graph attention network to align and fuse the crowd behavior data to obtain fused crowd behavior features.
[0053] Obtain crowd behavior data, including device location data, video surveillance data, traffic flow data, crowd statistics, etc. at the current moment in multiple key areas.
[0054] Use an adaptive graph attention network to align and fuse the crowd behavior data. Specifically:
[0055] S11: Represent the crowd behavior data as a dynamic graph, and obtain the node features and adjacency matrix of the dynamic graph.
[0056] In the dynamic graph, nodes represent regional positions, edges represent the connection strength between regions, node features are the crowd behavior data in the regions, and the value of each element in the adjacency matrix represents the weight value of the edge, that is, the connection strength.
[0057] Among them, the calculation rule of the connection strength w′ is as follows:
[0058]
[0059] Among them, T ij represents the weighted sum of the crowd behavior feature values used in the calculation of nodes i and j; α ij represents the crowd behavior feature weight value between nodes i and j, and can change according to the selected T ij for variation.
[0060] S12: Iteratively normalize the adjacency matrix according to the node features.
[0061] The normalize normalization calculation rule is as follows:
[0062]
[0063] Among them, k is the number of iteration rounds, and are learnable weight matrices, LeakyReLU is the activation function, ReLU is the rectified linear unit, X is the input node feature matrix, A (k) is the adjacency matrix after the k-th round of normalization, and A (0) is the original adjacency matrix.
[0064] S13: Use an adaptive feature learning network to extract behavior features from the adjacency matrix; map the behavior features to high-dimensional feature vectors.
[0065] Using an adaptive feature learning network to extract behavior features from the adjacency matrix is expressed as:
[0066]
[0067] Among them, F i represents the behavioral feature extracted from the i-th data x in the adjacency matrix. σ(·) is the activation function, and T is the total number of data in the adjacency matrix; W and b are the weight and bias parameters of the adaptive feature learning network, and x i represents the k-th data in the adjacency matrix, and α k represents the association weight between x k and other data samples x i , that is, the weight value of these two data in the adjacency matrix. γ k represents the self-weight of the sample, that is, the weight value of this data on the diagonal of the adjacency matrix, which is 1. i The behavioral features are mapped into high-dimensional feature vectors by using a multi-layer neural network.
[0068] S14: Use a non-linear transformation function and a mapping matrix to perform semantic space mapping on the high-dimensional feature vectors to obtain initial semantic features.
[0069] The mapping calculation is expressed as:
[0070] Among them,
[0071]
[0072] represents the i-th initial semantic feature of the l-th layer, represents the mapping matrix, and v s (F(F i ) represents the high-dimensional feature vector of F i , and φ(·) is the non-linear transformation function.
[0073] S15: Use a multi-layer perceptron to perform a transformation operation on the initial semantic features to obtain extended semantic features.
[0074]
[0075] Among them, represents the i-th extended semantic feature of the (l + 1)-th layer, is the weight connecting the (l + 1)-th layer and the l-th layer, f(·) is the activation function, is the bias term of the l-th layer, and L is the number of perceptron layers.
[0076] S16: Calculate the similarity scores between different extended semantic features, divide the features with similarity scores greater than the threshold into the same category of features, and integrate the same category of features to generate the feature matrix Y.
[0077] The calculation rule of the similarity score match is as follows:
[0078]
[0079] Among them, match represents the similarity score, L represents the number of layers of the attention matrix, and W l is the learning weight matrix of the l-th layer, and b l is the bias vector of the l-th layer. represents the heterogeneous pattern similarity calculation, sim(·) is the similarity function, and σ(·) is the activation function; respectively represent the i-th extended semantic feature and the j-th extended semantic feature.
[0080] Align the features with similarity scores greater than the threshold θ and divide them into the same type of features, and integrate the same type of features to generate the feature matrix Y (during the integration process, duplicate features are deleted).
[0081] S17: Calculate the attention weight sequence of the feature matrix Y, and perform fusion processing on the feature matrix Y according to the attention weight sequence to obtain the fused feature vector.
[0082] The calculation rule of the attention weight sequence is as follows:
[0083]
[0084] Among them, a i represents the attention weight of the i-th feature vector in the feature matrix Y, ReLU(·) is the rectified linear unit, W and b are the weight and bias parameters of the attention model, w is the learnable attention weight vector, the softmax function is used for normalization, N is the number of feature vectors in the feature matrix Y, and y i is the i-th feature vector in the aligned feature matrix Y.
[0085] Use the adaptive gating attention unit to perform fusion processing on the feature matrix Y according to the attention weight sequence, which is expressed as:
[0086]
[0087] Among them, represents the fused feature matrix, and S is the attention matrix composed of the attention weights of each element in the feature matrix Y.
[0088] S18: Calculate the gating mechanism vector according to the current fused feature vector, and use the gating mechanism vector to perform recursive fusion on the current fused feature vector to obtain the fused crowd behavior feature.
[0089] The calculation rule of the gating mechanism vector g is as follows:
[0090]
[0091] Among them, σ(·) is the sigmoid function, Wg is the weight matrix of the gating mechanism after Gaussian distribution processing combined with the input feature matrix , and b g is the bias parameter of the gating mechanism, represents the fused feature matrix at the current time step
[0092] Perform a recursive fusion on the current fused feature vector using the gating mechanism vector:
[0093]
[0094] where σ(·) is the sigmoid function, and α t is the weight parameter at the current time step, that is, the attention matrix S at the current time step. After the recursive fusion is completed, the obtained is used as the fused crowd behavior feature.
[0095] S2: Perform data augmentation on the fused crowd behavior feature to obtain augmented data.
[0096] The present invention uses the generator and discriminator of alternating adversarial training to perform data augmentation on the fused crowd behavior feature, including:
[0097] Step 1: Send the fused crowd behavior feature after alignment and fusion into the generator network to output the generated data sample
[0098] Step 2: Send the real data and the generated data into the discriminator network, and finally output which represents the probability of the authenticity of the data generated by the generator;
[0099] The calculation rule of
[0100]
[0101] is as follows: where k represents the number of network layers, and W i represents the weight value of the i-th generated data, which is obtained by calculating the attention coefficient, and b i represents the bias term of the i-th layer, and σ i (·) represents the activation function of the i-th layer, represents the i-th generated data.
[0102] Step 3: Alternately and adversarially train the generator and discriminator, continuously update the training parameters according to the Myloss function, that is, the data augmentation loss, and finally make the fidelity of the samples generated by the generator continuously improve to achieve the purpose of data augmentation.
[0103]
[0104] Among them, N is the number of samples, and i and j represent the indices of the samples. and are the i-th and j-th samples in the real data. and are the i-th and j-th samples in the generated samples. ||·|| 2 represents the Euclidean norm, and cosine_sim(·) represents the cosine similarity.
[0105] S3: Perform multi-scale convolution, fusion, and mapping processing on the augmented data to obtain a multi-scale feature representation.
[0106] S31: Convolve the augmented data with convolution kernels of different scales to obtain multi-scale feature maps.
[0107] The calculation rule of the convolution kernel is as follows:
[0108]
[0109] where σ S is the standard deviation of the Gaussian kernel with scale S, Q S is the feature map at scale S, is the input data, i.e., the augmented data, (i, j, k) represents the pixel position and channel index in the feature map, and m, n, and l represent the offsets in three dimensions.
[0110] The number of convolution kernels is the same as the number of regions, that is, feature maps with the same number of scales as the number of regions are obtained.
[0111] S32: Perform average pooling operation on the multi-scale feature maps to obtain the pooled feature maps.
[0112] The calculation rule of the average pooling operation is as follows:
[0113]
[0114] where M is the pooled feature map, Q is the input feature map, (i, j, k) represents the pixel position and channel index in the feature map, m and n represent the size of the pooling layer, and p and q represent the offsets of the pooling window in the vertical and horizontal directions, respectively.
[0115] S33: Process the pooled feature maps using multiple channels to obtain multiple feature tensors.
[0116] Divide the feature map into multiple small feature maps M according to the number of channels c , and the calculation rule for obtaining the feature tensor is as follows:
[0117]
[0118] Among them, σ is a non-linear activation function, D is the number of convolutional layers, k is a calculation parameter, and W c,i is the parameter of the i-th convolutional kernel, and b c,i is the i-th bias term, and P c represents the c-th feature tensor.
[0119] S34: Use linear mapping to map multiple feature tensors to a new space, and calculate the attention weights according to the multiple mapped feature tensors.
[0120] The calculation rule of the attention weights is as follows:
[0121]
[0122] Among them, P 1 P 2 …P C are feature tensors, W is the parameter of the learnable weight matrix, is the corresponding mapped feature tensor, C is the number of feature tensors, softpromax(·) is a multi-class classifier, and d k represents the dimension of the attention key, and N represents the number of samples.
[0123] S35: Fuse the multi-scale feature maps according to the attention weights to obtain a multi-scale feature representation.
[0124] The calculation rule for obtaining the multi-scale feature representation is as follows:
[0125]
[0126] Among them, Q′ is the obtained multi-scale feature representation, σ is the activation function, W′ is the matrix composed of attention weights, and β i is the attention weight of the feature map at the i-th scale, Q i is the feature map representation at the i-th scale, b is the bias term, and N is the number of scales.
[0127] S4: Use a heterogeneous graph convolutional neural network to perform feature representation learning on the multi-scale feature representation to obtain a multi-dimensional feature representation.
[0128] S41: Represent the multi-scale feature representation as a heterogeneous graph.
[0129] In the heterogeneous graph, the nodes V = {v 1 , v 2 , ……, v N} represent the feature representations at different scales, and the edges E = {e 1 , e 2 , ……, e M} represents the correlation between features.
[0130] Calculate the correlation sim_value between nodes, and connect the nodes with values greater than the threshold θ. The similarity calculation rule is as follows:
[0131]
[0132] where sim(·) is the similarity function, σ(·) is the activation function, v i and v j are the feature representations of nodes i and j, and b is the bias term.
[0133] S42: Aggregate the information of the nodes in the heterogeneous graph to obtain the first aggregated feature of each node; perform a weighted sum and convolution operation on the first aggregated features of the neighbor nodes of the nodes to obtain the second aggregated feature of the nodes.
[0134] The calculation rule for implementing information aggregation is as follows:
[0135]
[0136] where W″ represents the weight tensor, obtained from sim_value, and softmax(v i ·W″) ij represents normalizing the weights between node i and its neighbor node j, v i represents the feature representation of the i-th node in the heterogeneous graph, v j represents the feature representation of the j-th node in the heterogeneous graph, h i ′ represents the first aggregated feature of the i-th node obtained after information aggregation.
[0137] Perform a weighted sum and convolution operation on the first aggregated features of the neighbor nodes of the nodes:
[0138]
[0139] where, represents the second aggregated feature of the i-th node in the l-th layer, N(v i ) represents the set of neighbor nodes of node v i , t(e i ) represents the set of connection strength values corresponding to the edges connected to node i, w′ k represents the weight value of the k-th edge, obtained from sim_value, σ represents the activation function, is the first aggregated feature of the j-th neighbor node of the i-th node v i .
[0140] The final second aggregated feature of the nodes is obtained through multiple layers of aggregation.
[0141] S43: Process the second aggregated feature using a feature extractor to obtain the extracted feature of the node.
[0142] The calculation rule of the feature extractor is as follows:
[0143]
[0144] Among them, is the second aggregated feature of node i at the l-th layer, and σ i is the activation function, and are the weight and bias of node i at the l-th layer, and the weight is obtained by calculating the attention coefficient; F i (l) is the extracted feature of node i.
[0145] S44: Process the extracted feature of the node using an adaptive attention mechanism to obtain a multi-dimensional feature representation.
[0146] Process the extracted feature of the node using an adaptive attention mechanism:
[0147]
[0148] Among them, and are the query and key weight matrices at the l-th layer, softpromax(·) is a multi-class classifier, represents the input extracted feature of node i, N represents the total number of nodes, and F (l) represents the matrix composed of the extracted features of all nodes, and H (l) is the multi-dimensional feature representation.
[0149] Calculate the heterogeneous graph convolution loss L align :
[0150]
[0151] Among them, λ align represents the calculation parameter value, λ align ∈{1, 2, ……, N}, and represent the i-th and j-th multi-dimensional feature vectors in the multi-dimensional matrix.
[0152] S5: Input the multi-dimensional feature representation into the density prediction module for processing to obtain the crowd density prediction result.
[0153] S51: Perform a convolution operation on the multi-dimensional feature representation to obtain a multi-dimensional feature map.
[0154] The calculation rule of the convolution kernel is as follows:
[0155]
[0156] Among them, σ is the standard deviation, G is the feature map, is the input data, i.e., the multi-dimensional feature representation H (l) , (i, j, k) represents the pixel position and channel index in the feature map, and m, n, and l represent the offsets in three dimensions.
[0157] S52: Perform a max pooling operation on the multi-dimensional feature map to obtain the pooled multi-dimensional feature map.
[0158] The calculation rule of the max pooling operation is as follows:
[0159] G′(i, j, k) = max G(i × m + p, j × n + q, k)
[0160] Among them, G′ is the pooled multi-dimensional feature map, G is the input feature map, (i, j, k) represents the pixel position and channel index in the feature map, m and n represent the size of the pooling layer, and p and q represent the offsets of the pooling window in the vertical and horizontal directions, respectively.
[0161] S53: Input the pooled multi-dimensional feature map into the fully connected layer for processing to obtain the crowd density prediction result.
[0162] The calculation representation for obtaining the prediction result is:
[0163]
[0164] Among them, represents the i-th prediction result, i.e., the predicted value of the crowd density in region i, y i is the i-th feature vector in the multi-dimensional feature map G′, W * is the weight matrix of the fully connected layer, b * is the bias vector, and ReLU(·) is the activation function.
[0165] S6: Calculate the total loss of the model and adjust the model parameters according to the total loss of the model to obtain the trained crowd density prediction model.
[0166] Send the model prediction result into the multi-dimensional loss optimizer to calculate the loss, and perform iterative training. Retain the set of parameters with the minimum loss to obtain the trained crowd density prediction model.
[0167] The formula for calculating the total loss of the model is:
[0168]
[0169] Among them, L represents the total loss of the model, N represents the total number of samples, y i represents the i-th true result, θt represents the prediction parameter, and ign(·) represents the sign function. represents the i-th prediction result, ∈ represents a small constant, β represents the adjustment parameter, and L align represents the heterogeneous graph convolution loss, and Myloss represents the data augmentation loss.
[0170] Collect crowd behavior data and input it into the trained crowd density prediction model for processing to obtain the crowd density prediction result.
[0171] The present invention effectively solves the problem of inaccurate crowd density prediction by using the crowd density prediction model, improves the accuracy of the prediction result, helps relevant staff quickly obtain the information of the occurrence location and the personnel flow situation in the area, and quickly formulate solutions.
[0172] The above-mentioned embodiments further elaborate on the purpose, technical solution, and advantages of the present invention. It should be understood that the above-mentioned embodiments are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made to the present invention within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for predicting population density in key areas based on big data, characterized in that: include: Collect crowd behavior data and input it into the trained crowd density prediction model for processing to obtain crowd density prediction results; The training process of the crowd density prediction model includes: S1: Obtain training crowd behavior data, use adaptive graph attention network to align and fuse the crowd behavior data, and obtain fused crowd behavior features; the process of aligning and fusing crowd behavior data includes: S11: Represent the crowd behavior data as a dynamic graph, and obtain the node features and adjacency matrix of the dynamic graph; S12: iteratively normalize the adjacency matrix according to node features; S13: Extract behavioral features from the adjacency matrix using an adaptive feature learning network; map the behavioral features into high-dimensional feature vectors; S14: Use nonlinear transformation function and mapping matrix to map the high-dimensional feature vector into semantic space to obtain initial semantic features; S15: Use a multi-layer perceptron to transform the initial semantic features to obtain extended semantic features; S16: Calculate similarity scores between different extended semantic features, classify features with similarity scores greater than a threshold into similar features, and integrate similar features to generate a feature matrix Y; S17: Calculate the attention weight sequence of the feature matrix Y, and fuse the feature matrix Y according to the attention weight sequence to obtain a fused feature vector; S18: Calculate a gating mechanism vector according to the current fused feature vector, and use the gating mechanism vector to recursively fuse the current fused feature vector to obtain a fused crowd behavior feature; S2: Perform data enhancement on the fused crowd behavior features to obtain enhanced data; S3: Perform multi-scale convolution, fusion and mapping on the enhanced data to obtain multi-scale feature representation; S4: Use heterogeneous graph convolutional neural network to learn multi-scale feature representation and obtain multi-dimensional feature representation; S5: Input the multi-dimensional feature representation into the density prediction module for processing to obtain the crowd density prediction result; S6: Calculate the total model loss and adjust the model parameters according to the total model loss to obtain a trained crowd density prediction model.
2. According to the method for predicting population density in key areas based on big data in claim 1, it is characterized in that: The formula for calculating the similarity score is: Among them, match represents the similarity score, L represents the number of attention matrix layers, and W l is the learning weight matrix of the lth layer, b l is the bias vector of the lth layer, represents the similarity calculation of heterogeneous patterns, sim(·) is the similarity function, and σ(·) is the activation function; They represent the i-th extended semantic feature and the j-th extended semantic feature respectively.
3. The method for predicting population density in key areas based on big data according to claim 1, characterized in that: In the step S2, the process of data enhancement of the fused crowd behavior features includes: using a generator and a discriminator of alternating adversarial training to process the fused crowd behavior features to obtain enhanced data.
4. The method for predicting population density in key areas based on big data according to claim 1 is characterized in that: In step S3, the process of obtaining the multi-scale feature representation includes: S31: Convolve the enhanced data with convolution kernels of different scales to obtain multi-scale feature maps; S32: Perform an average pooling operation on the multi-scale feature map to obtain a pooled feature map; S33: Use multiple channels to process the pooled feature map to obtain multiple feature tensors; S34: Use linear mapping to map multiple feature tensors to a new space, and calculate attention weights based on the mapped feature tensors; S35: Fuse the multi-scale feature maps according to the attention weights to obtain a multi-scale feature representation.
5. The method for predicting population density in key areas based on big data according to claim 1 is characterized in that: In step S4, the process of obtaining the multi-dimensional feature representation includes: S41: Representing multi-scale features as heterogeneous graphs; S42: Aggregate information of nodes in the heterogeneous graph to obtain a first aggregate feature of each node; perform a weighted and convolution operation on the first aggregate features of neighboring nodes of the node to obtain a second aggregate feature of the node; S43: using a feature extractor to process the second aggregated feature to obtain an extracted feature of the node; S44: Adopt adaptive attention mechanism to process the extracted features of nodes and obtain multi-dimensional feature representation.
6. The method for predicting population density in key areas based on big data according to claim 1, characterized in that: In step S5, the process of obtaining the crowd density prediction result includes: S51: performing a convolution operation on the multi-dimensional feature representation to obtain a multi-dimensional feature map; S52: performing a maximum pooling operation on the multidimensional feature map to obtain a pooled multidimensional feature map; S53: Input the pooled multi-dimensional feature map into the fully connected layer for processing to obtain the crowd density prediction result.
7. The method for predicting population density in key areas based on big data according to claim 1, characterized in that: The formula for calculating the total loss of the model is: Among them, L represents the total loss of the model, N represents the total number of samples, and y i represents the i-th true result, θ t represents the prediction parameter, sign(·) represents the sign function, represents the i-th prediction result, ∈ represents a small constant, β represents the adjustment parameter, L align represents heterogeneous graph convolution loss, and Myloss represents data enhancement loss.
Citation Information
Patent Citations
Node classification method for realizing heterogeneous primitive path aggregation based on graph convolution and self-attention mechanism
CN115828143A
Heterogeneous graph node relation prediction method based on graph transformation network and graph decomposition
CN117524299A