Cultural tourist attraction people flow prediction and scheduling method based on machine learning
By constructing a hybrid attention model and combining BiLSTM and CNN/GCN networks for spatiotemporal feature extraction and data integration, the problems of insufficient data utilization and spatiotemporal modeling in existing crowd flow prediction are solved. This achieves high-precision prediction and dynamic resource scheduling, improving scenic area management efficiency and visitor experience.
Patent Information
- Application Number
- CN202511151425.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-11-18
AI Technical Summary
Existing pedestrian flow prediction methods have shortcomings in terms of insufficient data utilization, fragmented spatiotemporal modeling, and scheduling lag. They fail to effectively utilize multi-source heterogeneous data and spatiotemporal dependencies, and the prediction results cannot be applied to dynamic resource allocation in real time.
A hybrid attention model is constructed, which extracts spatiotemporal features through BiLSTM and CNN/GCN networks, combines multi-source heterogeneous data for data association and integration, uses a hybrid attention mechanism to enhance important features, outputs pedestrian flow prediction results, and implements dynamic scheduling strategies.
It improved the accuracy of visitor flow prediction, enabled real-time resource optimization and efficient diversion of tourists during peak periods, and enhanced the tourist experience.
Smart Images

Figure CN120975322A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of tourist attraction management, in particular to a cultural tourist attraction flow prediction and scheduling method based on machine learning. BACKGROUND
[0003] The scenic spot flow data can not only reflect the historical and current tourist carrying capacity and distribution of the scenic spot, but also provide data support for future decision-making of the manager and improve the operating efficiency. And making enough accurate flow prediction data and analysis in advance can help the scenic spot manager to provide important reference for reasonable control planning and facilitate timely taking some more targeted measures and schemes. With the development of artificial intelligence, there are more and more intelligent predictions of scenic spot flow. However, the existing flow prediction still has the following shortcomings:
[0004] 1. Insufficient data utilization: ignoring the relevance of multi-source heterogeneous data (such as search index, topological relationship);
[0005] 2. Spatio-temporal modeling fragmentation: traditional LSTM / CNN cannot simultaneously capture spatio-temporal dependence;
[0006] 3. Scheduling hysteresis: the prediction results are not applied to dynamic resource allocation in a closed loop. SUMMARY
[0007] To solve the above technical problems, the present application provides a cultural tourist attraction flow prediction and scheduling method based on machine learning.
[0008] The cultural tourist attraction flow prediction and scheduling method based on machine learning comprises the following steps:
[0009] Step 1, data collection and preprocessing: collecting multi-source heterogeneous data, cleaning and unifying the data format, correlating and integrating data of different dimensions, and finally generating a three-dimensional tensor format suitable for model input through time encoding and space encoding;
[0010] Step 2, construction and training of mixed attention model: the constructed mixed attention model includes a spatio-temporal feature extraction module and a mixed attention mechanism module;
[0011] The spatio-temporal feature extraction module uses BiLSTM network and CNN / GCN network for spatio-temporal feature extraction, and adjusts the fusion ratio of spatio-temporal features and channel attention through dynamic weight fusion;
[0012] The mixed attention mechanism module strengthens important feature channels through channel attention, focuses on key areas through spatial attention, captures important time segments through time attention, and fuses multi-source data through cross-modal attention;
[0013] The mixed attention model is trained using the preprocessed data, and model parameters are adjusted to optimize prediction performance;
[0014] Step 3, crowd flow prediction and result output: input real-time data into the trained mixed attention model to predict crowd flow, output crowd flow value in future period; and combine quantile regression technology to output confidence interval of crowd flow;
[0015] Step 4, dispatching strategy implementation: based on the prediction results, a dynamic heat map is constructed, and the crowd density level of different regions is marked in the heat map; real-time warning information is pushed to the administrator terminal and visitor terminal, and the security personnel deployment and transfer vehicle scheduling are dynamically adjusted according to the warning information, and the tour suggestion is sent to the visitors in advance.
[0016] Further, the multi-source heterogeneous data includes historical passenger flow data, real-time ticketing data, weather data, nearby traffic hub passenger flow data, camera and gate sensor data in the scenic area, topological relationship data between scenic spots, and Baidu search index data; the three-dimensional tensor format includes time dimension, space dimension and feature dimension.
[0017] Further, the time encoding converts the time information of historical passenger flow data, real-time ticketing data, weather data and nearby traffic hub passenger flow data into sine or cosine encoding, and ensures that the length and sampling frequency of different time series data are consistent; the space encoding converts the geographic location information of camera and gate sensor data in the scenic area and topological relationship between scenic spots into grid or graph structure data.
[0018] Further, the space encoding specifically includes:
[0019] Grid encoding: divide the scenic area into fixed size grids, and take the passenger flow density of each grid as the spatial feature;
[0020] Graph structure encoding: generate an adjacency matrix based on the topological relationship between scenic spots to represent the connection relationship between scenic spots, and the edge weight is determined by physical distance or visitor transfer probability.
[0021] Further, the BiLSTM network in the spatio-temporal feature extraction module models the time feature, specifically: forward propagation is performed on the historical passenger flow data to capture the influence of historical passenger flow on current passenger flow; backward propagation is performed on the real-time ticketing data to predict future passenger flow through real-time ticketing data; the hidden states of forward and backward are spliced to form a time feature sequence representation containing bidirectional dependency relationship;
[0022] CNN / GCN network models the spatial feature, specifically:
[0023] The camera and gate sensor data in the scenic area are subjected to feature extraction by a CNN network to obtain local features of the passenger flow density.
[0024] The GCN network processes the topological relationship data between the scenic spots, captures the passenger flow flow pattern between the scenic spots by aggregating the feature information of the nodes and their neighbors, and captures the multi-order neighborhood information by stacking multiple GCN layers.
[0025] Further, the dynamic weight fusion is specifically: the time feature and the space feature are spliced by channel latitude, and the space-time and channel attention weight are dynamically fused through a gating mechanism.
[0026] Further, the topological relationship between the scenic spots is abstracted as nodes by a graph theory method, and the association between the scenic spots is abstracted as edges, thereby constructing the mutual influence mechanism between the scenic spots, and the specific construction process is:
[0027] Constructing a spatial adjacency relationship: an adjacency matrix is constructed by geographic data to quantify the spatial proximity between the scenic spots by a traffic connectivity graph and a location similarity graph;
[0028] Constructing a behavior transition relationship: a behavior dependency network is constructed by a tourist movement rule;
[0029] Constructing a semantic association relationship: including classification homogeneity and grade matching, the classification homogeneity is automatic edge construction of the same type of scenic spots, and the grade matching is stronger association of the same level scenic spots.
[0030] Further, the association and integration of different dimensions of data in step 1 are specifically: based on deep learning, a self-encoder is used to extract and fuse features of multi-source data, and different dimension data is mapped to a unified hidden space.
[0031] Further, the multi-dimensional feature vector fused with space-time information extracted by the space-time feature extraction module in the channel attention of the mixed attention mechanism module generates channel statistics through global average pooling and maximum pooling, and then calculates the channel weight through a multi-layer perception to strengthen the key features;
[0032] The spatial feature map extracted by the CNN or GCN in the space-time feature extraction module is subjected to a convolution layer and a Sigmoid function to generate a spatial attention map, assigns a weight to each spatial position, multiplies the spatial attention map with the original feature map, and focuses on the key area;
[0033] The time slice weight is generated by a fully connected layer and a Softmax function for the time feature sequence extracted by the BiLSTM network, captures the time sequence dependency, multiplies the time slice weight with the original time sequence feature, and strengthens the influence of the key time period;
[0034] The cross-modal attention receives joint features of associated and integrated data of different dimensions, calculates the similarity between different modal features through a self-attention mechanism, and generates a cross-modal weight matrix; the cross-modal weight matrix is multiplied with the original features to realize information complementation between modes.
[0035] Further, the training of the hybrid attention model adopts an early stopping method to prevent overfitting, and adopts a model checkpoint to save optimal model parameters, uses Adam as an optimization algorithm, and combines a learning rate decay strategy for optimization.
[0036] The present application has the beneficial effects that the present application improves prediction accuracy through a hybrid attention mechanism, optimizes resources through real-time scheduling, improves the diversion efficiency of tourists during peak periods, and enables tourists to have a better tourism experience. BRIEF DESCRIPTION OF DRAWINGS
[0037] Figure 1 is a method flowchart of the present application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0039] Embodiment 1: Reference Figure 1 The present application provides a cultural tourism scenic spot flow prediction and scheduling method based on machine learning, comprising:
[0040] Step 1, data acquisition and preprocessing: collecting multi-source heterogeneous data (including historical passenger flow data, real-time ticketing data, weather data, nearby traffic hub passenger flow data, camera and gate sensor data in the scenic area, topological relationship data between scenic spots, and Baidu search index data),
[0041] The preprocessing process includes:
[0042] 1) cleaning and unifying the format of the data;
[0043] 2) associating and integrating data of different dimensions; based on deep learning, using an autoencoder to extract and fuse features of multi-source data, mapping different dimensional data to a unified hidden space to realize cross-modal association. For example, historical passenger flow and weather data may generate joint features through an encoder to capture the potential impact of weather on passenger flow.
[0044] 3) Finally generate a three-dimensional tensor format suitable for model input (containing time dimension, space dimension and feature dimension) through time encoding and space encoding; Time encoding converts the time information of historical passenger flow data, real-time ticketing data, weather data and nearby transportation hub passenger flow data into sine or cosine encoding, and ensures that the length and sampling frequency of different time series data are consistent; The space encoding converts the camera and gate sensor data within the scenic spot and the topological relationship geographical location information between scenic spots into grid or graph structure data. Grid encoding: divide the scenic spot into fixed size grids, and the passenger flow density of each grid is used as a spatial feature; Graph structure encoding: generate an adjacency matrix based on the topological relationship between scenic spots to represent the connection relationship between scenic spots, and the edge weight is determined by physical distance or tourist transfer probability.
[0045] Step 2, construction and training of mixed attention model: the constructed mixed attention model includes a spatio-temporal feature extraction module and a mixed attention mechanism module;
[0046] The spatio-temporal feature extraction module uses BiLSTM network and CNN / GCN network for spatio-temporal feature extraction, and adjusts the fusion ratio of spatio-temporal features and channel attention through dynamic weight fusion;
[0047] BiLSTM network: forward propagation of historical passenger flow data to capture the influence of historical passenger flow on current passenger flow; backward propagation of real-time ticketing data to predict future passenger flow through real-time ticketing data; concatenate the forward and backward hidden states to form a time feature sequence representation containing bidirectional dependency;
[0048] CNN network: feature extraction of camera and gate sensor data within the scenic spot (grid space data), local features of passenger flow density are obtained through convolution and pooling; Convolution operation: slide the convolution kernel on the spatial data to extract local features (such as edge, texture, etc. of passenger flow density). Pooling operation: reduce the data dimension, reduce the amount of calculation, and at the same time preserve important features (such as maximum pooling preserves the maximum value of regional passenger flow density).
[0049] GCN network: process topological relationship data between scenic spots, aggregate feature information of nodes and their neighbors to capture passenger flow flow patterns between scenic spots, and then stack multiple GCN layers to capture multi-order neighborhood information (indirect association between scenic spots).
[0050] Dynamic weight fusion specifically: concatenate time features and space features by channel latitude, and dynamically fuse spatio-temporal and channel attention weights through a gating mechanism:
[0051] g = σ(Wg·[F t ||F s ]+b g ),
[0052] wherein, Wg represents the gating weight matrix, which is a parameter automatically learned by the model through back propagation; F t , F s represent the features extracted by time attention and space attention respectively, and σ represents the Sigmoid activation function, which compresses the gating value into the interval [0, 1]; b g is the gating bias term, which is part of the learnable parameters, used to adjust the threshold offset of the gating activation; g represents the dynamic gating vector (dimension consistent with the input feature), which is used to weight the fusion of the two attention features.
[0053] The hybrid attention mechanism module strengthens important feature channels through channel attention, focuses on key regions through space attention, captures important time segments through time attention, and fuses multi-source data through cross-modal attention, as follows:
[0054] Channel attention:
[0055] The multi-dimensional feature vector extracted by the spatio-temporal feature extraction module, which fuses spatio-temporal information, generates channel statistics through global average pooling and max pooling, and then calculates channel weights through a multi-layer perceptron to strengthen key features; if the weight of historical passenger flow data on a certain channel is improved, the model may pay more attention to the time series pattern of that channel (such as the surge of passenger flow during holidays).
[0056] Space attention:
[0057] The spatial feature map extracted by CNN or GCN in the spatio-temporal feature extraction module generates a spatial attention map through a convolution layer and a Sigmoid function, assigns weights to each spatial position, multiplies the spatial attention map with the original feature map, and focuses on key regions;
[0058] Time attention:
[0059] The time feature sequence extracted by the BiLSTM network generates time segment weights through a fully connected layer and a Softmax function, captures temporal dependencies, multiplies the time segment weights with the original time series features, and strengthens the influence of key time periods;
[0060] Cross-modal attention:
[0061] Processes the joint features after the fusion of multi-source heterogeneous data (such as the association between Baidu search index data (text data) and passenger flow (numerical data));
[0062] Calculates the similarity between different modal features through self-attention mechanism, generates a cross-modal weight matrix (if the search volume of a keyword related to a scenic spot in the Baidu search index surges, the association weight between it and the real-time ticket sales data may be improved); multiplies the cross-modal weight matrix with the original features to achieve information complementation between modalities.
[0063] The mixed attention model is trained using the preprocessed data, and model parameters are adjusted to optimize prediction performance;
[0064] Step 3, crowd flow prediction and result output: input real-time data into the trained mixed attention model to predict crowd flow, output crowd flow values in future time periods; and combine quantile regression technology to output confidence intervals of crowd flow;
[0065] Step 4, dispatching strategy implementation: based on the prediction results, a dynamic heat map is constructed, and the crowd density levels of different regions are marked in the heat map; real-time warning information is pushed to administrator terminals and visitor terminals, and security personnel deployment and transfer vehicle scheduling are dynamically adjusted according to the warning information, and tour suggestions are sent to visitors in advance.
[0066] In this embodiment, the topological relationship between scenic spots is abstracted as nodes by graph theory method, and the association between scenic spots is abstracted as edges, so as to construct the mutual influence mechanism between scenic spots, and the specific construction process is as follows:
[0067] Constructing spatial adjacency relationship: constructing adjacency matrix through geographic data to quantify the spatial proximity between scenic spots;
[0068] Constructing behavior transition relationship: constructing behavior dependence network through visitor movement rules;
[0069] Constructing semantic association relationship: including classification homogeneity and level matching, the classification homogeneity is to automatically build edges between scenic spots of the same type, and the level matching is that the association between scenic spots of the same level is stronger.
[0070] The traffic connectivity graph takes the travel time between scenic spots as the edge weight, and the calculation formula is:
[0071]
[0072] Where, A c (i, j) is the edge weight of scenic spot i to j, D ij is the time distance between scenic spots i and j, and σ is the attenuation coefficient;
[0073] The location similarity graph is calculated by the cosine similarity of the POIs around the scenic spots:
[0074]
[0075] Where, A s (i, j) is the similarity of scenic spots i and j, P vi is the POI vector of scenic spot i, and P vi is the POI vector of scenic spot j.
[0076] The training of the mixed attention model adopts the early stopping method to prevent overfitting, saves the optimal model parameters by using the model checkpoint, uses Adam as an optimization algorithm, and optimizes by combining a learning rate decay strategy.
[0077] In the description of the embodiments of the application, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0078] In the description of the embodiments of the application, the term "and / or" herein merely describes an association relationship of associated objects, which means that three relationships can exist, for example, A and / or B can represent three cases of A existing alone, A and B existing together, and B existing alone. In addition, the character " / " herein generally represents an "or" relationship between the front and rear associated objects.
[0079] Although the embodiments of the application have been shown and described, it can be understood by those of ordinary skill in the art that various changes, modifications, replacements and variations can be made to the embodiments without departing from the principles and spirits of the application, and the scope of the application is defined by the appended claims and their equivalents.
Claims
1. A method for predicting and scheduling visitor flow at cultural tourism attractions based on machine learning, characterized in that: Includes the following steps: Step 1, Data Acquisition and Preprocessing: Collect heterogeneous data from multiple sources, clean and unify the data format, associate and integrate data from different dimensions, and finally generate a three-dimensional tensor format suitable for model input through time encoding and spatial encoding. Step 2, Construction and training of the hybrid attention model: The constructed hybrid attention model includes a spatiotemporal feature extraction module and a hybrid attention mechanism module; The spatiotemporal feature extraction module uses BiLSTM and CNN / GCN networks to extract spatiotemporal features, and adjusts the fusion ratio of spatiotemporal features and channel attention through dynamic weight fusion. The hybrid attention mechanism module enhances important feature channels through channel attention, focuses on key regions through spatial attention, captures important temporal segments through temporal attention, and fuses multi-source data through cross-modal attention; The hybrid attention model was trained using preprocessed data, and the model parameters were adjusted to optimize prediction performance. Step 3, Pedestrian Flow Prediction and Result Output: Input real-time data into the trained hybrid attention model to predict pedestrian flow and output the pedestrian flow value for the future period; and combine quantile regression technology to output the confidence interval of pedestrian flow. Step 4, Implementation of scheduling strategy: Construct a dynamic heat map based on the prediction results, and mark the population density level of different areas on the heat map; Real-time early warning information is pushed to the administrator terminal and the tourist terminal. Based on the early warning information, the deployment of security personnel and the scheduling of shuttle vehicles are dynamically adjusted, and the tourist suggestions are sent in advance.
2. The method for predicting and scheduling visitor flow at cultural tourism attractions based on machine learning according to claim 1, characterized in that, The multi-source heterogeneous data includes historical visitor flow data, real-time ticketing data, weather data, visitor flow data of nearby transportation hubs, data from cameras and gate sensors within the scenic area, topological relationship data between attractions, and Baidu search index data; the three-dimensional tensor format includes time dimension, spatial dimension, and feature dimension.
3. The method for predicting and scheduling visitor flow at cultural tourism attractions based on machine learning according to claim 2, characterized in that, The time encoding converts the time information of historical passenger flow data, real-time ticketing data, weather data, and passenger flow data of nearby transportation hubs into sine or cosine encoding, and ensures that the length and sampling frequency of different time series data are consistent; the spatial encoding converts the data of cameras and gate sensors in the scenic area and the geographical location information of topological relationships between attractions into gridded or graph structure data.
4. The method for predicting and scheduling visitor flow at cultural tourism attractions based on machine learning according to claim 3, characterized in that, The spatial encoding specifically includes: Grid coding: Divide the scenic area into grids of fixed size, and use the visitor flow density of each grid as a spatial feature; Graph structure encoding: An adjacency matrix is generated based on the topological relationships between attractions to represent the connection relationships between attractions. The edge weights are determined by physical distance or tourist transfer probability.
5. The method for predicting and scheduling visitor flow at cultural tourism attractions based on machine learning according to claim 2, characterized in that, In the spatiotemporal feature extraction module, the BiLSTM network performs time feature modeling. Specifically, it performs forward propagation on historical passenger flow data to capture the impact of historical passenger flow on current passenger flow; it performs backward propagation on real-time ticketing data to predict future passenger flow; and it concatenates the hidden states of the forward and backward propagation to form a time feature sequence representation containing bidirectional dependencies. CNN / GCN networks are used for spatial feature modeling, specifically: By using a CNN network to extract features from the data of cameras and gate sensors within the scenic area, local features of passenger flow density are obtained. GCN networks process topological relationship data between attractions, capture visitor flow patterns between attractions by aggregating the feature information of nodes and their neighbors, and capture multi-level neighborhood information by overlaying multiple layers of GCN.
6. The method for predicting and scheduling visitor flow at cultural tourism attractions based on machine learning according to claim 1, characterized in that, The dynamic weight fusion specifically involves splicing temporal and spatial features according to channel dimensions, and dynamically fusing spatiotemporal and channel attention weights through a gating mechanism.
7. The method for predicting and scheduling visitor flow at cultural tourism attractions based on machine learning according to claim 2, characterized in that, The topological relationships between attractions are abstracted as nodes using graph theory, and the connections between attractions are abstracted as edges, thereby constructing a mechanism for mutual influence between attractions. The specific construction process is as follows: Constructing spatial adjacency relationships: Constructing an adjacency matrix using geographic data, and quantifying the spatial proximity between attractions using traffic connectivity maps and location similarity maps; Constructing behavior transfer relationships: Building a behavior dependency network based on tourist movement patterns; Constructing semantic associations includes category homogeneity and level matching. Category homogeneity means automatically building edges for attractions of the same type, and level matching means stronger associations for scenic spots of the same level.
8. The method for predicting and scheduling visitor flow at cultural tourism attractions based on machine learning according to claim 1, characterized in that, In step 1, the association and integration of data from different dimensions specifically involves: using an autoencoder based on deep learning to extract and fuse features from multi-source data, and mapping data from different dimensions to a unified latent space.
9. The method for predicting and scheduling visitor flow at cultural tourism attractions based on machine learning according to claim 1, characterized in that, In the hybrid attention mechanism module, the channel attention of the spatiotemporal feature extraction module extracts a multidimensional feature vector that integrates spatiotemporal information. This vector is then processed by global average pooling and max pooling to generate channel statistics. Finally, the channel weights are calculated by a multilayer perceptron to enhance key features. Spatial attention maps are generated from the spatial feature maps extracted by CNN or GCN in the spatiotemporal feature extraction module through convolutional layers and the Sigmoid function. Weights are assigned to each spatial location, and the spatial attention map is multiplied with the original feature map to focus on key regions. Temporal attention generates time segment weights for the temporal feature sequences extracted by the BiLSTM network through fully connected layers and the Softmax function, capturing temporal dependencies. The time segment weights are then multiplied with the original temporal features to enhance the influence of key time periods. Cross-modal attention receives joint features from data of different dimensions, associates and integrates them, calculates the similarity between features of different modalities through a self-attention mechanism, and generates a cross-modal weight matrix. The cross-modal weight matrix is then multiplied with the original features to achieve intermodal information complementarity.
10. The method for predicting and scheduling visitor flow at cultural tourism attractions based on machine learning according to claim 1, characterized in that, The training of the hybrid attention model employs early stopping to prevent overfitting, uses model checkpoints to save optimal model parameters, uses Adam as the optimization algorithm, and combines it with a learning rate decay strategy for optimization.
Citation Information
Cited By
Method and system for predicting urban park visitor flow based on optimized CNN-LSTM model
CN121168766A
Tourism industry management planning method for climate health
CN121169047A
A tourism industry management planning method for climate health care
CN121169047B