A method and system for predicting population migration flow

By combining deep neural networks and XGBoost models, the deep gravity model is improved, which solves the problem of insufficient comprehensiveness and accuracy in the prediction of population migration flow in existing technologies, and realizes the generation of high-precision flow data in the absence of historical data.

CN120181288BActive Publication Date: 2026-03-13WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing methods for predicting population migration flows are insufficient in terms of comprehensiveness and accuracy, making it difficult to effectively capture the complexity and nonlinear characteristics of population migration flows, especially in the absence of historical data.

Method used

By combining deep neural networks and XGBoost models, an improved deep gravity model is constructed. Through feature selection and hyperparameter optimization, the "push-pull" factors of the origin and destination of migration are identified to predict the flow of population migration.

Benefits of technology

It improves the accuracy and generalization ability of population migration forecasting, can generate accurate migration data in the absence of historical data, reduces model error, and captures spatial dependence and dynamic complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120181288B_ABST
    Figure CN120181288B_ABST
Patent Text Reader

Abstract

This invention provides a method and system for predicting population migration flow, comprising: Step 1. Constructing an improved deep gravity model; Step 2. Combining the improved deep gravity model with an XGBoost model to construct an XGBoost-deep gravity model; Step 3. Constructing an indicator system affecting population migration flow; Step 4. Using each influencing factor in the indicator system as a raw feature, performing feature selection on the raw features to obtain the main influencing factors; Step 5. Training, validating, and screening the XGBoost-deep gravity model; Step 6. Predicting population migration flow based on the XGBoost-deep gravity model. This invention introduces Limiting Gradient Decision Tree (XGBoost) on the basis of improving the deep gravity model. It extracts important indicators through feature optimization and combines them with key variables to predict the scale, direction, and network structure of population migration flow, effectively reducing model error and improving model prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of population forecasting technology, specifically relating to a method and system for forecasting population migration flow. Background Technology

[0002] Since the beginning of the 21st century, population migration and flow have become more frequent and complex in various countries. Research on population migration and flow has increasingly attracted the attention of scholars and governments at all levels, both domestically and internationally. This is because population flow not only affects regional economies but also reshapes population distribution patterns and urban spatial structures, leading to the reallocation and organization of capital, resources, and other factors. As a concentrated manifestation of residents' economic and social activities in urban spaces, predicting the scale, trends, and distribution of population migration and flow can effectively foresee the future spatial structural characteristics of cities, more accurately grasp demand structures, urban-rural structures, and industrial structures, and thus help planners and policymakers identify the differences between development trends and planning goals, providing more precise quantitative guidance for planning decisions and promoting high-quality urban development. Existing prediction methods mainly include two types: one is to predict the amount of population migration and flow in a future period based on the past amount of population migration and flow in a certain region; the other is to first analyze the influencing mechanisms of population migration and flow and then predict the amount of population migration and flow based on the influencing factors. Research findings provide rich research results for understanding population migration and flow, and also confirm that spatial factors and residents' socioeconomic attributes are the main influencing factors, and that this influence also exhibits significant spatial heterogeneity.

[0003] Researchers have proposed various spatial interaction models for predicting population flows. While these models can predict with relatively good accuracy at specific spatiotemporal scales, their overall predictive effectiveness is limited and their generalizability is insufficient. Existing predictive research methods mostly employ linear or generalized linear models such as urban population density models, binary choice models, multiple linear regression models, and gravity models. However, the spatial processes of population migration and flow exhibit significant complexity and high nonlinearity. The influence of most factors is not constant but only produces significant effects within specific ranges, and the trends and relative effects of each factor may also differ significantly. Using traditional linear regression models may fail to uncover the complex nonlinear relationships that may exist among these influencing factors.

[0004] The "push-pull" theory posits that population migration is jointly determined by the "push" factor from the origin and the "pull" factor from the destination. Zipf's gravity model is a classic model for studying population flow, initially including only three variables: population size of the destination, population size of the origin, and migration distance. However, the extended gravity model, based on the "push-pull theory," utilizes the characteristics of both the origin and destination to explain the push and pull factors influencing population flow, and uses migration distance to explain the spatial attenuation effect of population flow, significantly improving the model's explanatory power for population movement. In recent years, numerous studies have proposed various modified gravity models by altering constraints. These improvements primarily address the one-sided effects, the influence of logarithmic forms, and heteroscedasticity inherent in traditional gravity models. However, the improved gravity models still have limitations in capturing the spatial dynamics of population migration, especially in predicting flow direction and volume under complex mechanisms. Summary of the Invention

[0005] The purpose of this invention is to introduce a limiting gradient decision tree based on the improvement of the deep gravity model, extract important indicators through feature optimization, and then combine key variables to predict the scale, direction and network structure of population migration, which can effectively reduce model error and improve model prediction accuracy.

[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0007] A method for predicting population migration flow includes the following steps:

[0008] Step 1. Construct an improved deep gravity model based on deep neural networks and the original deep gravity model;

[0009] Step 2. Combine the improved deep gravity model with the XGBoost model to construct the XGBoost-deep gravity model;

[0010] Step 3. Construct an indicator system to influence population migration and flow;

[0011] Step 4. Using each influencing factor in the indicator system of Step 3 as the original feature, the importance of each influencing factor is ranked based on the XGBoost model, and feature selection is performed on the original features to obtain the main influencing factors.

[0012] Step 5. Train, validate, and screen the XGBoost-deep gravity model;

[0013] Step 6. Based on the XGBoost-Deep Gravity model, predict population migration flow.

[0014] Furthermore, the improved deep gravity model in step 1 introduces nonlinear features by adding hidden layers to the deep neural network, and estimates the parameters in the nonlinear features using the maximum likelihood estimation method.

[0015] Furthermore, the improved deep gravity model in step 1 includes: a shuffling module, a multilayer perceptron, and a combination module.

[0016] Furthermore, the shuffling module scatters and mixes population migration flow data from multiple years, then statistically analyzes the data distribution, and finally performs stratified sampling based on the proportion of the data distribution; the combination module summarizes the results output by the original deep gravity model by year and performs residual processing with the total annual population migration flow.

[0017] Furthermore, step 4 also includes hyperparameter optimization of the XGBoost model based on the Optuna hyperparameter optimization framework.

[0018] Further, in step 4, the hyperparameter optimization range is set as follows: the number of trees constructed is set to 100 to 1000; the maximum depth of the trees is set to 3 to 9; the learning rate is set to 0.01 to 0.3; the sample ratio for training each weak learner is set to 0.3 to 0.9; the column sampling ratio when constructing each tree is set to 0.3 to 0.9; the minimum loss reduction required for further splitting of leaf nodes is set to 0 to 0.4; the minimum leaf node sample weight is set to 1 to 7; and the coefficients of L1 and L2 regularization terms are set to 0.001 to 1.

[0019] Further, step 5 includes:

[0020] Step 5.1 Compare the fitting ability and generalization ability of the XGBoost-Deep Gravity model on the training set and the test set respectively, and then evaluate the XGBoost-Deep Gravity model by comparing the training loss curve of the XGBoost-Deep Gravity model.

[0021] Step 5.2 Set the parameters for the XGBoost-Deep Gravity model.

[0022] Furthermore, the parameters set in step 5.2 include: optimizer, initial learning rate, early stopping setting, batch size, number of iterations, hidden layer, and activation function.

[0023] Further, step 6 includes:

[0024] Based on feature selection of the original features, the main influencing factors are obtained, and the corresponding influencing indicators for the year to be predicted are processed. Then, these important indicators are applied to the trained model to predict population migration flow.

[0025] On the other hand, the present invention provides a population migration flow prediction system, including...

[0026] The Deep Gravity Model Improvement Module is used to construct an improved deep gravity model based on deep neural networks and the original deep gravity model.

[0027] The XGBoost-Deep Gravity Model Building Module is used to combine the improved deep gravity model with the XGBoost model to build the XGBoost-Deep Gravity Model.

[0028] The indicator system construction module is used to construct an indicator system that influences population migration flows.

[0029] Feature selection module. It is used to take each influencing factor in the indicator system as the original feature, rank the importance of each influencing factor based on the XGBoost model, and perform feature selection on the original feature to obtain the main influencing factors;

[0030] The model training module is used for training, validating, and screening the XGBoost-Deep Gravity model.

[0031] The prediction module is used to predict population migration flows based on the XGBoost-Deep Gravity model.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] 1. The constructed XGBoost model is based on the GBDT model, with enhancements to the loss function and loss optimization process. It can not only explore the nonlinear effects of driving factors, but also has higher fitting accuracy than the traditional linear regression model, thus effectively identifying the population migration and flow mechanism.

[0034] 2. XGBoost controls the complexity of the tree by setting a regularization penalty term, which helps extract the optimal feature combination for subsequent predictions. This method of combining key variables for population flow prediction can effectively extract the main features (reducing redundant or irrelevant features), and reduce model dimensionality and noise interference, which helps reduce computational load and time, thereby improving model accuracy and performance.

[0035] 3. The improved deep gravity model combines the advantages of traditional gravity models and deep learning prediction models, introducing more features that reflect the "push and pull" forces at the outflow and inflow points, and introducing nonlinear features by adding hidden layers to the deep neural network. Furthermore, the improved deep gravity model has good generalization ability and can generate flow data for geographical areas where historical data is unavailable.

[0036] 4. The deep gravity model, used to generate migration probabilities, requires the total outflow of population from each location for prediction and only considers the attraction factor at the inflow point. In contrast, the improved deep gravity model considers the differences in "push-pull" factors at both the outflow and inflow points and can directly generate the amount of population migration between the two locations.

[0037] 5. A combined model of XGBoost and a modified deep gravity model is used. Features are extracted using the XGBoost model, and the most influential high-level features are selected and incorporated into the extraction rules of the modified deep gravity model. This establishes a complex mapping relationship between urban spatial factors, socioeconomic factors, and population migration and flow, which is then used to train the model. The combined model considers regional heterogeneity, temporal variation, and spatial correlation simultaneously, enabling it to more accurately capture the spatial dependence and dynamic complexity of population flow. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0039] Figure 1 This is a flowchart of the XGBoost-deep gravity model modeling process of the present invention;

[0040] Figure 2 This is a schematic diagram of the components of the improved deep gravity model of the present invention;

[0041] Figure 3 The following are training loss curves for migration in an embodiment of the present invention, where (a) is the training loss curve of the XGBoost-deep gravity model and (b) is the training loss curve of the improved deep gravity model.

[0042] Figure 4 This is a schematic diagram of the system error curve for predicting the total annual migration volume according to an embodiment of the present invention;

[0043] Figure 5 The following are training loss curves for the shift change in an embodiment of the present invention, where (a) is the training loss curve of the XGBoost-Deep Gravity model and (b) is the training loss curve of the improved Deep Gravity model.

[0044] Figure 6 This is a schematic diagram of the system error curve for predicting the total annual migration volume in an embodiment of the present invention.

[0045] Figure 7This is a network diagram illustrating the migration and movement between various residential centers in 2034-2035 according to an embodiment of the present invention.

[0046] Figure 8 This is a network diagram showing the job transfer between various employment centers in 2034-2035 according to an embodiment of the present invention. Detailed Implementation

[0047] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application are described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.

[0048] This invention provides a method for predicting population migration flow, comprising the following steps:

[0049] Step 1. Construct an improved deep gravity model based on deep neural networks and the original deep gravity model;

[0050] Furthermore, in step 1, the improved deep gravity model introduces nonlinear features by adding hidden layers to the deep neural network, and estimates the parameters in the nonlinear features using the maximum likelihood estimation method.

[0051] The deep gravity model combines the advantages of traditional gravity models and deep learning flow prediction models. It has good generalization ability, can generate flow data for geographical areas where no historical data is available, and introduces nonlinear features by adding hidden layers to the deep neural network.

[0052]

[0053] In the formula, O i It is the total outflow from the origin, p ij From position l i To position l j The probability of observing a trip, m j Is it the destination? j The attraction, β1 is a parameter, f(r) ij The function f(r) is called the attenuation function, and r is the attenuation coefficient. Typically, the attenuation function f(r) is... ij It can be an exponential function. Or it could be an exponential function. Here, β2 is another parameter. In both cases, the gravitational model can be formalized as a generalized linear model with a multinomial distribution. Due to the linear nature of the model, the parameters β1 and β2 can be efficiently estimated using the maximum likelihood estimation method, employing Newton's method to maximize the log-likelihood function of the model:

[0054]

[0055] In the formula, y is the observed flow matrix, β = [β1, β2] is the parameter vector, and the input feature vector x(l) is the input feature vector. i ,l j ) = concat[x j ,r ij ] Used for exponential decay function (x(l) i ,l j ) = concat[x j ,lnr ij [Used for power function decay function], where x j =lnm j .

[0056] However, the deep gravity model, used to generate migration probabilities, requires the total outflow of population from each location to make predictions, and only considers the attraction factor at the inflow end. This invention addresses these shortcomings of the deep gravity model by making relevant technical improvements. The improved deep gravity model considers the characteristic factors of the "push and pull" forces at both the outflow and inflow ends, and can directly generate the population migration flow between the two locations.

[0057] The deep gravity model was originally developed to supplement cross-sectional data on travel distribution. However, when applied to the dynamic prediction of population migration, it faces problems such as data skew and time drift. Therefore, this invention constructs an improved deep gravity model for long-term intra-city population migration.

[0058] Urban population migration flows exhibit severe data skewness and extremely uneven distribution. Using raw data for model training can lead to cognitive biases in the model; traditional deep gravity models tend to favor low-level population migration flows, neglecting key migration flows with few interactions and large-scale movement. This invention addresses this by implementing stratified sampling of the dataset based on the distribution of population migration flows. By balancing the sample distribution of the dataset, it corrects the cognitive biases of the model.

[0059] Long-term time-series forecasting of travel distribution still suffers from the drift problem common in time series analysis. Traditional deep gravity models only process distribution data at the same time point, failing to consider long-term dependency effects and overall drift phenomena in population migration. Their probability-based output format cannot meet the requirements for refined population migration forecasting. This invention adds "shuffling" and "combination" modules to the upstream and downstream of the existing deep gravity model. The "shuffling" module shuffles and mixes population migration data from multiple years, then statistically analyzes the data distribution, and finally performs stratified sampling based on the proportion of the data distribution. The shuffled data is then used for model training. The "combination" module summarizes the output of the deep gravity model by year and performs residual processing with the total annual population migration flow, correcting the overall drift of population migration data from the perspective of systematic error.

[0060] Finally, traditional deep gravity models require data preprocessing at the input layer to convert numerical population migration flows into probabilistic forms of travel proportions, with the final model output being the population flow probability. This invention adopts an "end-to-end" approach, directly outputting population migration flows, enabling the acquisition of long-term time-series population migration flows and calculating the total annual migration flow, ensuring effective input to the "combination" module, such as... Figure 2 As shown.

[0061] Step 2. Combine the improved deep gravity model with the XGBoost model to construct the XGBoost-deep gravity model;

[0062] For population migration forecasting, a combined model of XGBoost and deep gravity models offers advantages because it needs to consider the differences between emigration and immigration. XGBoost can effectively identify population migration mechanisms and the nonlinear relationships between influencing factors.

[0063] like Figure 1 As shown, this invention combines an improved deep gravity model with an XGBoost model, comprehensively considering important influencing indicators of both the origin and destination of migration, and utilizes deep neural networks to discover the nonlinear relationship between these indicators and population flow, forming a multi-input, single-output combined prediction model to predict population migration flows. The model construction consists of two stages. The first stage is feature selection, i.e., variable selection. Based on the importance ranking of each influencing factor obtained from the XGBoost layer, significant variables with higher scores are selected and connected to the input layer to obtain the input vector x(l i ,l j ) = concat[x i ,x j ,r i,j ], where j = 1,...,n: x i It is the place of origin.i eigenvectors; x j Is the destination j eigenvectors; r i,j This is the distance between the place of origin and the place of destination. For each origin point (e.g., l i ), create n input vectors x(l) i ,l j Each vector corresponds to a potential destination location within the study area; the second stage is prediction, which involves converting these input vectors x(l) into... i ,l j Simultaneously input into the same feedforward neural network, through model training, determine the hidden layer structure and dimensions of the model, and finally output the population flow between the two locations.

[0064] Step 3. Construct an indicator system that influences population migration flows;

[0065] Step 4. Using each influencing factor in the indicator system of Step 3 as the original feature, the importance of each influencing factor is ranked based on the XGBoost model, and feature selection is performed on the original features to obtain the main influencing factors.

[0066] By comprehensively selecting key influencing indicators from both the origin and destination regions, and using XGBoost to rank the importance of each influencing factor, the most significant variables with higher scores are selected. Feature selection typically employs three methods: filtering, wrapping, and embedded selection. Among these, embedded feature selection relies on algorithms for screening and offers advantages such as objectivity, accuracy, and adaptability. The feature selection method employed in this invention using XGBoost falls under the embedded approach. By setting a regularization penalty term in XGBoost to control the complexity of the tree, it helps extract the optimal feature combination for subsequent predictions.

[0067] XGBoost (eXtreme Gradient Boosting) is an extended version of Gradient Boosting Decision Tree (GBDT), with enhancements in the loss function and loss optimization process. Its calculation process is as follows: For the dataset D = {(x...} i ,y i It includes n samples and m features (|D|=n, x)}, which includes n samples and m features (|D|=n, x)}. i ∈R m The goal is to determine a variable that can be obtained from the input variable x. i The best function to estimate the response variable Its formula can be expressed as:

[0068]

[0069] In the formula, It refers to the number of people migrating or moving. It is the ultimate strong learner, f k (·) represents the weak learners generated by the decision tree (DT) method, where K is the number of weak learners, and α k This is the learning rate used to avoid overfitting. According to XGBoost, the loss function L(·) can be expressed as:

[0070]

[0071] In the formula, y i Indicates the prediction error. Let L(·) represent the true value of population flow, L(·) represent the actual training loss between the true and predicted values, and Ω(·) represent the complexity of the model, often referred to as the regularization term. L(·) and Ω(·) measure the model's fit to the data and its complexity, respectively. Generally, L(·) uses the squared loss function, and Ω(·) is represented by the L2 norm of the leaf node tree and leaf scores. That is:

[0072]

[0073] In the formula, T is the leaf node tree, ω k Here, f is the leaf fraction (or weight), and γ and λ are the regularization coefficients. Therefore, the goal is to find a suitable learner f. t The loss function minimized at each step t≤K is:

[0074]

[0075] Here, at step t, the objective can be rewritten as:

[0076]

[0077] In the formula, It predicts the value of the last step. Let be a constant. Considering the second-order Taylor expansion and neglecting the constant term, the objective loss function in the equation above can be further approximated as:

[0078]

[0079] In the formula, These are the first and second gradients of the loss function, respectively. (Term / Limit) It is a constant, so it can be removed during the minimization process. Meanwhile, the sample set i representing the leaves passes through I. j The goal can be simplified to:

[0080]

[0081] In the formula, Based on this loss function, after optimizing the weights and tree structure scores, we can deduce how to construct a tree, i.e.:

[0082]

[0083] In the formula, G l G R H L and H R These are the first and second gradients of the left and right nodes after the segmentation, respectively.

[0084] Since the performance of the XGBoost model largely depends on a suitable set of hyperparameters, hyperparameter optimization is a crucial step in improving the model's prediction accuracy. To find the optimal combination of hyperparameters, this invention employs the Optuna hyperparameter optimization framework, an automated hyperparameter optimization library. This framework offers three advantages: First, Optuna utilizes Bayesian optimization, a probabilistic optimization strategy. Compared to traditional grid search or random search, Bayesian optimization constructs a probabilistic model of hyperparameters to predict which set of parameters is likely to yield better performance, thus more efficiently deriving potential optimal solutions. This method is particularly suitable for high-dimensional spaces and complex evaluation functions, significantly reducing the required search time and computational resources. Second, Optuna can dynamically adjust its search strategy based on previous experimental results, further optimizing the search process. This adaptability makes Optuna more flexible and efficient in finding the optimal hyperparameters. Furthermore, it balances ease of use and flexibility; Optuna's API is simple and intuitive, easy to integrate and use. It supports multiple parameter types (such as integer, floating-point, and categorical parameters) and allows for the definition of complex search spaces to meet various optimization needs. In this invention, a series of search ranges for hyperparameters are defined, including the following:

[0085] `n_estimators`: Represents the number of trees constructed. More trees can increase model complexity, but may also lead to overfitting. Setting it to a range of 100 to 1000 is to find a balance between model complexity and generalization ability.

[0086] `max_depth`: The maximum depth of a tree controls the complexity of each tree. Deeper trees can capture the features of the data better, but also increase the risk of overfitting. By limiting the depth range to 3 to 9, this invention aims to limit model complexity while retaining sufficient learning capacity.

[0087] `learning_rate`: The learning rate determines the contribution of each tree to the final prediction. A smaller learning rate requires more trees to train the model but can improve the model's robustness. By setting the learning rate to a range of 0.01 to 0.3 using a log-uniform distribution, this invention aims to find the optimal balance between learning efficiency and model stability.

[0088] Other parameters such as subsample, colsample_bytree, gamma, min_child_weight, reg_alpha, and reg_lambda relate to the model's regularization level and the sampling method for the data. By adjusting these parameters, the model's generalization ability and sensitivity to specific data features can be controlled. Specifically:

[0089] subsample: The proportion of samples used to train each weak learner, ranging from 0.3 to 0.9.

[0090] colsample_bytree: The sampling ratio of columns when building each tree, ranging from 0.3 to 0.9.

[0091] gamma: Determines the minimum loss reduction required for a leaf node to split further, ranging from 0 to 0.4.

[0092] min_child_weight: Determines the minimum sum of weights for leaf node samples, with a range of 1 to 7.

[0093] reg_alpha and reg_lambda: The coefficients of the L1 and L2 regularization terms, respectively, are logarithmically uniformly distributed and range from 0.001 to 1.

[0094] This invention defines an objective function for training an XGBoost model based on a given hyperparameter configuration and evaluating its R-value on a test set. 2 Scoring. The optimization objective of the objective function is to maximize R. 2 Scoring involves finding the combination of hyperparameters that provides the highest prediction accuracy. Furthermore, to avoid overfitting while optimizing model performance, this invention employs the following measures:

[0095] Early stopping: This method involves stopping training if the model's performance on the validation set does not significantly improve within a certain number of iterations (e.g., 10 iterations). This effectively prevents overfitting and saves computational resources.

[0096] Cross-validation: By training and evaluating the model on different subsets of data, cross-validation can more accurately estimate the model’s performance on unseen data and ensure the model’s generalization ability.

[0097] Regularization parameter tuning: By adjusting the reg_alpha (L1 regularization) and reg_lambda (L2 regularization) parameters, the regularization of the model is also increased to reduce the risk of overfitting.

[0098] In summary, based on a meticulous hyperparameter optimization process, the optimal hyperparameter combination was obtained after 200 trials using Optuna. This not only improved the model's performance in analyzing the mechanisms of population migration and flow, but also ensured the model's generalization ability and robustness through various technical measures.

[0099] Step 5. Train, validate, and screen the XGBoost-deep gravity model;

[0100] In predictive models, error refers to the difference between the predicted value and the actual value. A smaller error indicates a more accurate and better-performing predictive model. Errors are unavoidable in both obtaining the actual value and calculating the predicted value. Various errors also arise in processes related to the predicted value, such as data source extraction, method selection, and standard determination. Based on an understanding of the advantages and disadvantages of different evaluation methods and the purpose of this invention, MAE, MSE, RMSE, MAPE, and R... 2 These five error evaluation metrics are combined for judgment. The feasibility and effectiveness of the established model are verified by comparing the training and testing results of the XGBoost-Deep Gravity model with optimized features and the Deep Gravity model with all input variables, under the same parameters. The specific comparison and verification steps are as follows:

[0101] First, by comparing the model's MAE, RMSE, and R on the training and test sets. 2 The value is used to determine the model's fitting ability and generalization ability on the training and test sets.

[0102] Then, compare the training loss curves of the model. The training loss curves can provide information about the changes in the loss function on the training set and the test set during the model training process, thereby evaluating the convergence of the model and determining whether the model's performance on the training set and the test set is consistent.

[0103] To more accurately evaluate the overall performance and training progress of the model, further analysis of the systematic error handling metrics and systematic error curves of the XGBoost-Deep Gravity model is needed. Comparing the actual values ​​and model predictions for each year reveals the model's prediction accuracy annually; MAPE is used to assess the changes in prediction accuracy across different years; RMSE, MSE, and MAE reveal the prediction error levels across different years; R... 2 The model's goodness of fit can be evaluated across different years. The systematic error curve depicts the model's performance variation under different systematic error offsets, with the vertical axis representing the MAPE value; a lower MAPE value indicates more accurate predictions. By observing the systematic error curves over the years, one can assess the model's progress and improvements, and also compare the model's performance changes over different time periods.

[0104] The mathematical definitions of these error evaluation indicators are as follows:

[0105] (1) Mean Absolute Error

[0106] MAE represents the average of the absolute values ​​of the errors between the predicted and actual values. MAE is suitable when the error is relatively significant. The value of MAE ranges from [0, +∞), and the larger the error, the larger the value of MAE. The formula for calculating MAE is as follows:

[0107]

[0108] (2) Mean square error and root mean square error

[0109] MSE and RMSE reflect the degree of deviation between model predictions and true values, and are two common error metrics. Their calculation formulas are as follows:

[0110]

[0111] (3)R 2

[0112] R 2 R is the most commonly used error evaluation metric. The numerator is the difference between the true value and the predicted value, representing the total amount of information that the model cannot obtain. The denominator is the amount of information carried in the true value. Therefore, R0 is the error rate. 2 R can represent the ratio of the amount of information that the model cannot obtain to the amount of information carried in the true value. 2 The closer to 1, the better. The calculation formula is as follows:

[0113]

[0114] (4) Mean Absolute Percentage Error (MAPE)

[0115]

[0116] MAPE statistically analyzes the relative error of each measurement, reducing the impact of absolute errors in individual discrete values. It is more effective than root mean square error when dealing with large sample sizes and numerous discrete values. This value increases with the overall error.

[0117] Model parameter settings

[0118] Currently, commonly used optimization algorithms for neural node connection weights include gradient descent and conjugate gradient descent. Common hidden layer activation functions include the Sigmoid function, tanh function, and ReLU function (Table 1). The program can automatically select the relatively optimal activation function and the number of hidden layer neurons. This invention selects the following parameter settings for the XGBoost and deep gravity combined model; the specific values ​​are determined by the prediction object and prediction purpose:

[0119] Optimizer: The Adam optimizer is used, which combines adaptive learning rate and momentum optimization features to update model parameters more effectively.

[0120] Initial Learning Rate: Choose an appropriate learning rate based on experimental experience and parameter tuning results to quickly converge to the optimal solution during training.

[0121] Early stopping (Dropout): Dropout is a commonly used regularization technique to reduce overfitting in a model. By randomly setting a certain percentage of neurons to zero, Dropout can make the model more robust and better at generalizing.

[0122] Batch size refers to the number of samples used to update model parameters in each iteration. Choosing an appropriate batch size can, to some extent, balance model training speed and memory consumption.

[0123] Epochs: An epoch refers to the number of iterations in which the entire training dataset is passed to the model once. By choosing an appropriate number of epochs, the model can be trained sufficiently and better predictive performance can be achieved.

[0124] Hidden Layers: The settings for hidden layers are adjusted based on the model complexity and dataset size to balance the model's expressive power and computational efficiency.

[0125] Activation Function: The activation function for all hidden layers is set to LeakyReLU. LeakyReLU introduces a small slope over negative input values, which can alleviate the vanishing gradient problem and improve the model's training performance.

[0126] By setting the above parameters, this invention aims to construct an efficient and accurate XGboost-deep gravity model. The selection of these parameters requires sufficient experimentation and tuning to ensure that the model has good performance and generalization ability in population migration and flow prediction.

[0127] Table 1 Commonly Used Activation Functions

[0128]

[0129]

[0130] Step 6. Based on the XGBoost-Deep Gravity model, predict population migration flow.

[0131] Based on feature selection of the original features, the main influencing factors are obtained, and the corresponding influencing indicators for the year to be predicted are processed. Then, these important indicators are applied to the trained model to predict population migration flow.

[0132] Example 1

[0133] This embodiment focuses on predicting intra-city migration and job mobility—taking the urban development zone of City A as an example.

[0134] Migration is generally considered to be the behavior of residents within a single housing market, a process by which residents adjust their place of residence based on the gap between their current housing conditions and their housing needs or expectations. Job rotation refers to the change of employment from one region to another, involving the inflow and outflow of employed persons in a region, as well as the specific migration directions and spatial distribution of employment, and is an important aspect of urban population and employment changes.

[0135] This embodiment studies the urban development area (including the main urban area) of City A in a certain country. It primarily identifies residents' relocation and job rotation behaviors through mobile phone signaling data. This data records a user's spatial residence information in a spatial grid format; its accuracy is affected by the density of base station distribution. Grid units are typically 250m-2000m in size. Furthermore, considering the size of a 15-minute community living circle and the fact that intra-city relocation and job rotation often occur between certain spatial clusters, the urban development area is further divided into 1000m*1000m grids as the basic unit for exploring the mechanisms of intra-city relocation and job rotation and predicting future relocation and job rotation.

[0136] The specific operation process of this embodiment is as follows: First, an indicator system is constructed based on multi-source big data such as mobile phone signaling data, land use data, POI data, and building outline data of urban development areas from 2017 to 2023; then, the indicator system is input into the combined model to select the main influencing factors and train the combined model; then, based on the 11 main influencing factors selected in the previous step of model training, the relevant indicators for 2034-2035 are processed; finally, these important indicators are applied to the trained model to calculate the predicted values ​​of the number of people migrating and changing jobs between grids in 2034-2035.

[0137] First, an indicator system of 23 variables was constructed based on spatial factors such as the built environment and the socio-economic attributes of residents. The data processing and related indicator calculations are as follows:

[0138] (1) Mobile signaling data

[0139] The mobile signaling data used in this embodiment comes from a certain footprinting platform, specifically covering June of each year from 2017 to 2023 (excluding 2020). Each year, over 3 million mobile signaling data entries are generated, representing approximately one-third of the total population of City A. The mobile signaling data records anonymized unique user identifiers, location latitude and longitude, basic user attributes, and location point types (Table 2). The location point types include residence, employment, and visit. Referring to existing research, core users are extracted based on dwell time and frequency. The location where the user spends the longest time between 9 PM and 8 AM the following day is identified as their residence. Users who stay in City A for 10 days or more in a given month are selected as the core target to obtain their residence location for that year. Similarly, the residence and employment information of the core target within the urban development area of ​​City A for other years is obtained.

[0140] Table 2 Mobile Signaling Data Structure

[0141]

[0142] a. Relocation and Job Change Identification: First, the user's residential location in 2017 and 2018 is identified based on their user identification number. Second, the pre-defined basic grid units within Urban Development Zone A are spatially overlaid with the residential locations from 2017 and 2018, ensuring that the same user's residence in both years bears the Urban Development Zone grid unit number. By comparing these numbers, it can be determined whether the user relocated during that period. Finally, by summarizing the grid numbers, the number of people moving in and out of each grid unit during 2017-2018 can be obtained. Similarly, the number of job changes for other time periods and each grid unit can be obtained.

[0143] b. Population density calculation: First, based on the distribution data of the residential and employed population of the core objects in the A urban development area in each year, the data is spatially overlaid with the grid units of the urban development area, so that each user's residence and employment location have their own assigned grid unit (with grid number); Second, the population in each grid unit is summarized and counted according to the grid number, so as to obtain the number of residential / employed people in each grid unit of the A urban development area in each year. Dividing the population density by the area of ​​the grid unit gives the population density of the residential / employed population in the grid.

[0144] c. Calculation of migration distance for relocation and job change: Referring to the calculation method for commuting distance, the migration distance for relocation and job change in each grid unit is calculated based on the identified data. First, based on the identified relocation and job change sample data, the centroid of the grid where the resident's residence is located in the two years prior is taken as points O and D. The Euclidean distance between the two points is calculated as the user's migration distance. Then, based on the grid unit number to which the user's residence belongs, the average migration distance of that grid unit is summarized and statistically obtained. Similarly, the average migration distance of each grid unit to which the user's employment location belongs can be obtained.

[0145] d. Calculation of distances from the city center and sub-centers: First, referring to existing research, the centroid of urban development zone A is selected as the city center, and five employment centers—Hankou, Zhongnan-Han Street, Luxiang, Xudong, and Wangjiawan—are selected as the city sub-centers. Second, with the centroid of each grid unit in the urban development zone as point O and the location of each city center as point D, the Euclidean distance between the two points is calculated as the distance of the grid unit from each city center. Finally, the distances of the grid unit from the five sub-centers are compared, and the minimum value is selected as the determined value of the distance of the grid unit from the city sub-center.

[0146] (2) Land use data

[0147] The land use data used in this embodiment comes from the Natural Resources and Planning Management Department of City A, covering the period from 2017 to 2023 (excluding 2020). Using a 1000m*1000m grid as the basic research unit, and through overlay and statistical operations, the land area of ​​public management and public service facilities (A), commercial service facilities (B), industrial land (M), residential land (R), and green space and plaza land (G) in each grid unit for each year is obtained. The land use entropy index method is then used to calculate the land use mixing degree of each grid, and the calculation formula is as follows:

[0148]

[0149] In the formula, k is the number of land use types in the grid cell, with a value of 5; P kiThis represents the proportion of the area occupied by the k-th land use type. A higher Landuse value indicates a higher degree of land use mixing, and vice versa.

[0150] (3) Building outline data

[0151] The building outline data for City A used in this embodiment comes from the Localspace Viewer software platform, covering the period from 2017 to 2023 (excluding 2020), and includes information such as building extent and number of floors. Using a 1000m*1000m grid as the basic research unit, the land development intensity, i.e., the floor area ratio, within each grid unit is calculated by matching the building outline data with land use data. The calculation formula is as follows:

[0152]

[0153] In the formula, S a S represents the total building area within the grid cell; l This represents the total construction land area within the grid cell. A higher Plot ratio value indicates a higher intensity of land development.

[0154] (4) POI data

[0155] The POI data for City A used in this study comes from the Gaode Map website, covering the period from 2017 to 2023 (excluding 2020). Each POI data includes attribute information such as feature name, main type, detailed address, and latitude and longitude. Overlaying the POI data with the grid cells of the urban development area in the ArcGIS platform yields the total number of POIs, the number of universities, key middle schools, key primary schools, top-tier hospitals, sports facilities, shopping centers, parks, and squares for each grid cell. The total number of POIs is used to measure the overall attractiveness of public service facilities within the grid cell. Excluding facilities such as transportation services that have already been analyzed separately, the facility categories used for calculation mainly include seven categories: catering services, public facilities, shopping services, science, education and culture, finance and insurance, sports and leisure, and healthcare.

[0156] (5) Distribution data of roads and transportation facilities

[0157] The road and traffic facility distribution data used in this embodiment comes from the A City Planning Institute (A City Transportation Development Strategy Research Institute), covering the period from 2017 to 2023 (excluding 2020). Specifically, it includes data on subway stations and bus stops. Road intersection data is obtained from single-line road data processed in the ArcGIS platform. Through statistical analysis overlaid with grid cells, the characteristics of road traffic facilities under each grid cell are obtained.

[0158] It is worth noting that migration and job rotation are influenced by relevant factors within the same grid unit of both the origin and destination. Therefore, the difference between relevant factors within the grid unit of the origin and destination is selected as the independent variable to better reflect which differences in factors between the origin and destination lead to residents' migration and job rotation behavior.

[0159] First, the XGboost model was used to extract variables strongly correlated with migration and job mobility. The 10 most influential factors were selected, along with migration distance, for a total of 11 factors used in the subsequent prediction model. The 11 significant influencing factors for migration mobility are: migration distance, difference in total number of POIs, difference in residential population density, difference in area of ​​Class A land use, difference in number of universities, difference in area of ​​Class R land use, difference in employment population density, difference in distance from city center, difference in distance from secondary city center, difference in plot ratio, and difference in land use mix. The 11 significant influencing factors for job mobility are: migration distance, difference in employment population density, difference in total number of POIs, difference in area of ​​Class B land use, difference in distance from city center, difference in area of ​​Class M land use, difference in shopping volume, difference in residential population density, difference in area of ​​Class G land use, difference in plot ratio, and difference in area of ​​Class R land use. The mobile signaling data used in this embodiment is one of the most accurate and extensive information datasets currently available. However, the actual values ​​originate from the calculation and redistribution of base station data, a process that also contains various errors. Given the modeling and prediction of millions of pedestrian flows, a highly complex error component and a relatively high error rate are foreseeable. This invention uses migration and job-changing data between grids from 2017 to 2023 as the training and testing sets. Due to the large sample size and significant long-tail distribution, downsampling was performed to balance the sample data and reduce interference with model learning. First, low-value samples with migration numbers of 0 and 1 were extracted and downsampled to 400,000, effectively reducing the number of low-value samples. Then, the processed low-value samples were integrated with the remaining samples with migration numbers greater than 1 to obtain a processed sample dataset. The downsampled sample dataset retains most of the important sample information, making the overall dataset more balanced and representative. Simultaneously, to ensure the reliability of the results, a random number table method was used to divide the processed dataset into training and testing samples in an 8:2 ratio. Training samples are used for modeling and training, while test samples are used to verify the model's generalization ability. Ultimately, the migration model had 1,019,456 training samples and 254,864 test samples. The job rotation model had 828,868 training samples and 207,218 test samples. This sample processing helps improve the model's learning effectiveness and ensures its performance in real-world scenarios. This invention uses Python for training and modeling, and utilizes the trained model to predict the number of people migrating and rotating between grids in 2034-2035. The modeling variables are the number of people migrating and rotating between grids as the target output variable, and 23 factors, including macro-level social spatial factors and micro-level individual socioeconomic attributes, as modeling input variables.

[0160] To demonstrate the effectiveness of the constructed XGBoost-Deep Gravity model in long-term population migration prediction, this invention compares the training and testing results of the XGBoost-Deep Gravity model with optimized features and the Deep Gravity model with all input variables under the same parameters in population migration prediction from 2017 to 2023. The XGBoost-Deep Gravity model first selected 10 significant influencing factors, which correspond to 20 variables at the emigration and immigration ends, plus the migration distance variable, for a total of 21 variables. The Deep Gravity model, on the other hand, used all 23 factors affecting population migration, also corresponding to the emigration and immigration ends, minus the duplicated migration distance variable, for a total of 45 variables. To evaluate the accuracy and predictive performance of the different models, this invention uses the following five basic evaluation metrics: MAE, MSE, RMSE, MAPE, and R. 2 .

[0161] Table 3 shows the error evaluation metrics for the Deep Gravity model and the XGBoost-Deep Gravity model when predicting inter-grid migration populations. First, by comparing the MAE and RMSE error evaluation metrics of the models on the training and test sets, it can be found that on the training set, the Deep Gravity model has a smaller RMSE than the XGBoost-Deep Gravity model, but a slightly larger MAE. On the test set, both error metrics of the Deep Gravity model are larger than those of the XGBoost-Deep Gravity model. Meanwhile, the XGBoost-Deep Gravity model's RSE on the training set... 2 The result is smaller than the Deep Gravity model on the training set, but larger on the test set. This indicates that the Deep Gravity model has a better fitting ability on the training set, while the XGBoost-Deep Gravity model has a better generalization ability on the test set. The Deep Gravity model may also be overfitting on the training set.

[0162] Table 3 Comparison of Model Training Evaluation Indicators (Inter-grid Migration Number Prediction)

[0163]

[0164] A training loss curve can provide information about how the loss function changes on the training and test sets during model training. By comparing the training loss curves of two models ( Figure 3As can be seen, the training loss curves of both models exhibit continuous small fluctuations, but the decline in the curves is relatively smooth. Despite these fluctuations, the mean squared error continues to decrease with increasing iterations, indicating that the model gradually improves its prediction accuracy during training. The small fluctuations may be due to factors such as learning rate, regularization parameters, data noise, or data complexity. Specifically, the XGboost-Deep Gravity model initially shows a consistent trend between its training and test set loss curves, with the curves almost overlapping. After more than 100 iterations, the test set loss curve stabilizes, while the training set error curve continues to decline slowly, but the difference between it and the test set error value is not significant. This indicates that the model can learn the training data well and reduce prediction errors, gradually converging to a lower loss value during training. In contrast, the Deep Gravity model's test and training set loss curves also initially show a similar trend. However, after 40 iterations, the difference gradually increases, the training set error curve continues to decline, and the difference between it and the test set error value continues to widen, causing the two loss curves to diverge further, indicating overfitting. Therefore, the XGBoost-Deep Gravity model has better convergence and its performance on the training and test sets is relatively consistent, while the Deep Gravity model has a certain degree of overfitting on the training set. It is preliminarily believed that the XGBoost-Deep Gravity model has better performance in predicting the number of migrants.

[0165] To more accurately evaluate the overall performance and training progress of the model, the relevant indicators and system error curves of the XGBoost-Deep Gravity model's system error handling were further analyzed. The system error handling table provides the specific changes of these indicators over the years. Table 4 shows that the difference between the predicted values ​​and the true values ​​is relatively small over the years, MAPE is low, and RMSE, MSE, and MAE are also relatively small, while R... 2 The values ​​can also explain most of the variation in the dependent variable; therefore, the model's predictive performance for 2017-2023 is relatively good.

[0166] Table 4. System Error Handling for XGBoost-Deep Gravity Model (Inter-grid Migration Population Prediction)

[0167]

[0168] The system error curve describes the performance variation of the model under different system error offsets. Figure 4The graph shows the systematic error curves for multiple years. Overall, the error curves remain relatively stable across different years, indicating that the model's performance is relatively consistent. Specifically, as the systematic error offset increases, the MAPE value initially decreases rapidly, meaning that the model has higher prediction accuracy within a smaller systematic error offset range. This indicates that the model can capture patterns and correlations in the data well, resulting in smaller prediction errors. As the systematic error offset increases further, the MAPE reaches a low peak, indicating that the model can predict more accurately within a specific systematic error offset range. After exceeding the peak, the MAPE begins to increase slowly and then stabilizes, meaning that the model's prediction accuracy no longer improves significantly with increasing systematic error offset, and the model's performance tends to stabilize.

[0169] Based on model comparison, training, and overall performance evaluation, this embodiment concludes that the XGBoost-Deep Gravity model can effectively predict long-term migration flows.

[0170] Regarding the prediction of the number of workers changing shifts between grids, the comparison of the evaluation indicators in Table 5 shows that, consistent with the performance of the two models in predicting the number of migrants, the Deep Gravity model has a smaller RMSE than the XGBoost-Deep Gravity model on the training set, but a slightly larger MAE. On the test set, however, both error indicators of the Deep Gravity model are larger than those of the XGBoost-Deep Gravity model. Meanwhile, the XGBoost-Deep Gravity model has a lower RSE on the training set. 2 The result is smaller than the Deep Gravity model on the training set, but larger on the test set. This indicates that the Deep Gravity model has a better fitting ability on the training set, while the XGBoost-Deep Gravity model has a better generalization ability on the test set. The Deep Gravity model may also be overfitting on the training set.

[0171] Table 5 Comparison of Model Training Evaluation Indicators (Prediction of the Number of Shift Workers Between Grids)

[0172]

[0173] By comparing the training loss curves of the two models ( Figure 5As can be seen, the training loss curves of both models generally show a downward trend, but the training set loss curve exhibits denser fluctuations with larger amplitudes, while the test set fluctuations are relatively stable. This indicates that the model gradually improves its prediction accuracy during training, and the fluctuations may be due to noise in the data or randomness during training. Small fluctuations are normal in the early and middle stages of training and usually do not significantly affect the overall performance of the model. Specifically, the training and test set loss curves of the XGboost-Deep Gravity model show a basically consistent trend with increasing iterations, and the difference in their error values ​​is not significant, indicating that the model can learn the training data well and reduce prediction errors, demonstrating good convergence. In contrast, the test set and training set loss curves of the Deep Gravity model were initially also basically consistent, but the difference gradually increased after 60 iterations, and the two loss curves became increasingly separated, indicating that the model experienced overfitting. Therefore, the XGBoost-Deep Gravity model has better convergence and its performance on the training and test sets is relatively consistent, while the Deep Gravity model has a certain degree of overfitting on the training set. It is preliminarily believed that the XGBoost-Deep Gravity model has better performance in predicting the number of shift workers.

[0174] Next, we analyze the systematic error handling indicators of the XGBoost-Deep Gravity model. Table 6 provides the specific values ​​of these indicators over the years. From the table, we can see that the difference between the predicted and true values ​​is relatively small, MAPE is low, and RMSE, MSE, and MAE are also relatively small. 2 Although the value is not high, existing research shows that urban population flow prediction cannot be 100% accurate. The population flow prediction model constructed in this paper has a higher R-value compared to existing research. 2 This is already quite high, therefore, the model's prediction performance for 2017-2023 is relatively good.

[0175] Table 6. System Error Handling for XGBoost-Deep Gravity Model (Inter-grid Job Rotation Prediction)

[0176]

[0177]

[0178] Figure 6The system error curves for multiple years are shown. Similar to the model's performance in predicting migration numbers, the error curves remain relatively stable across different years, indicating that the model's performance is relatively consistent. As the system error offset increases, the MAPE value first decreases rapidly, then reaches a low peak, and after exceeding the peak, begins to increase slowly, eventually stabilizing. This indicates that the model can achieve high prediction accuracy within a small system error offset range, with the highest prediction accuracy when the system error offset is between 2 and 3. As the system error offset further increases, the model performance tends to stabilize.

[0179] In summary, the XGBoost-Deep Gravity model demonstrates higher accuracy and predictive ability compared to the Deep Gravity model. During training, the model effectively leverages the strengths of both XGBoost and Deep Gravity models, employing appropriate datasets, loss functions, and iterative algorithms. Through repeated adjustments to model parameters and hyperparameters, it effectively captures the complex relationships and dynamic changes in population flows. In overall performance evaluation, the model exhibits low error and high stability. Based on the comprehensive evaluation results, the XGBoost-Deep Gravity model is deemed effective in predicting long-term population flow.

[0180] After multiple rounds of experimentation and parameter tuning, this invention selected the following parameter settings for the XGBoost and Deep Gravity combined model to ensure good performance and generalization ability in migration and job change prediction. First, the Adam optimizer was used, with the initial learning rate set to 0.0001, dropout set to 0.35, and batch size set to 512. Then, the epochs for the migration prediction model were set to 155, and the epochs for the job change prediction model were set to 160. Furthermore, this invention designed 15 hidden layers, with the first five layers having a dimension of 256 and the last ten layers having a dimension of 128. The activation function for all hidden layers was set to the LeakyReLU function.

[0181] Based on 11 key influencing factors selected through indicator optimization, relevant indicators for 2034-2035 were processed. These key indicators were then applied to the trained model to predict inter-grid migration and job rotation in 2034-2035. To evaluate the reasonableness of the predictions, the results were compared with migration and job rotation data from the past decade.

[0182] From the perspective of migration and job mobility characteristics, migration and job mobility are more frequent and more balanced in City A. The residential network remains dominated by the main urban area, with the most concentrated connections still occurring along the Hankou, Zhongnan-Han Street, Luxiang, and Guanshan axis. These areas, due to their geographical location and excellent transportation and public service facilities, have developed into the most closely connected residential areas with surrounding areas. However, residential connections in the suburban clusters are relatively weak. This corresponds to existing research, which suggests that geographical isolation and transportation accessibility can hinder connections between regions. Figure 7 In comparison, employment connections are more frequent. Although Luxiang and Guanshan, as well as Xudong and Zhongnan-Han Street and Hankou, are the two areas with the closest connections within the Third Ring Road, the network connections between the main urban area and the suburbs are also very close. Employment network connections have formed regional network connections in the suburbs, especially within the various suburban clusters, where relatively close connections have also been formed. Figure 8 This corresponds to the industrial layout of City A, where employment is more suburbanized, and there are similar industries within each cluster, which makes it easier for residents to change jobs nearby.

[0183] Empirical analysis shows that the machine learning and deep learning combined prediction model constructed in this invention is reliable and reasonable for predicting migration and job change flows. The model has a good fit and high accuracy, and can effectively predict population migration flows.

[0184] Example 2

[0185] A specific embodiment of the present invention also provides a population migration flow prediction system, comprising:

[0186] The Deep Gravity Model Improvement Module is used to construct an improved deep gravity model based on deep neural networks and the original deep gravity model.

[0187] The XGBoost-Deep Gravity Model Building Module is used to combine the improved deep gravity model with the XGBoost model to build the XGBoost-Deep Gravity Model.

[0188] The indicator system construction module is used to construct an indicator system that influences population migration flows.

[0189] Feature selection module. It is used to take each influencing factor in the indicator system as the original feature, rank the importance of each influencing factor based on the XGBoost model, and perform feature selection on the original feature to obtain the main influencing factors;

[0190] The model training module is used for training, validating, and screening the XGBoost-Deep Gravity model.

[0191] The prediction module is used to predict population migration flows based on the XGBoost-Deep Gravity model.

[0192] The above description is merely a preferred embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

[0193] It should be understood that any parts not described in detail in this specification belong to the prior art.

[0194] It should be understood that the above description of the preferred embodiments is quite detailed, but it should not be considered as a limitation on the scope of protection of this invention. Those skilled in the art, under the guidance of this invention, can make substitutions or modifications without departing from the scope of protection of the claims of this invention, and all such substitutions or modifications fall within the scope of protection of this invention. The scope of protection of this invention should be determined by the appended claims.

Claims

1. A method for predicting population migration flow, characterized in that, Includes the following steps: Step 1. Construct an improved deep gravity model based on a deep neural network and the original deep gravity model; the improved deep gravity model adds a hidden layer to the deep neural network to introduce nonlinear features, and estimates the parameters in the nonlinear features using the maximum likelihood estimation method; The improved deep gravity model includes a shuffling module, a multilayer perceptron, and a combination module. The shuffling module shuffles and mixes population migration flow data from multiple years, then statistically analyzes the data distribution, and finally performs stratified sampling based on the proportion of the data distribution. The combination module summarizes the results output by the original deep gravity model by year and performs residual processing with the total annual population migration flow. Step 2. Combine the improved deep gravity model with the XGBoost model to construct the XGBoost-deep gravity model; Step 3. Construct an indicator system to influence population migration and flow; Step 4. Using the influencing factors in the indicator system from Step 3 as the original features, the importance of each influencing factor is ranked based on the XGBoost model, and feature selection is performed on the original features to obtain the main influencing factors; this also includes hyperparameter optimization of the XGBoost model based on the Optuna hyperparameter optimization framework: Step 5. Train, validate, and screen the XGBoost-deep gravity model; Step 6. Based on the XGBoost-Deep Gravity model, predict population migration flow.

2. The method for predicting population migration flow according to claim 1, characterized in that, Step 4 sets the hyperparameter optimization range, including: the number of trees to be constructed is set to 100 to 1000; the maximum depth of the trees is set to 3 to 9; the learning rate is set to 0.01 to 0.3; the sample ratio for training each weak learner is set to 0.3 to 0.9; the column sampling ratio when constructing each tree is set to 0.3 to 0.9; the minimum loss reduction required for further splitting of leaf nodes is set to 0 to 0.4; the minimum leaf node sample weight is set to 1 to 7; and the coefficients of L1 and L2 regularization terms are set to 0.001 to 1.

3. The method for predicting population migration flow according to claim 1, characterized in that, Step 5 includes: Step 5.1 Compare the fitting ability and generalization ability of the XGBoost-Deep Gravity model on the training set and the test set respectively, and then evaluate the XGBoost-Deep Gravity model by comparing the training loss curve of the XGBoost-Deep Gravity model. Step 5.2 Set the parameters for the XGBoost-Deep Gravity model.

4. The method for predicting population migration flow according to claim 3, characterized in that, The parameters set in step 5.2 include: optimizer, initial learning rate, early stopping setting, batch size, number of iterations, hidden layer, and activation function.

5. The method for predicting population migration flow according to claim 1, characterized in that, Step 6 includes: Based on feature selection of the original features, the main influencing factors are obtained, and the corresponding influencing indicators for the year to be predicted are processed. Then, these important indicators are applied to the trained model to predict population migration flow.

6. A population migration flow prediction system, characterized in that, include: The Deep Gravity Model Improvement Module is used to construct an improved deep gravity model based on deep neural networks and the original deep gravity model. The XGBoost-Deep Gravity Model Building Module is used to combine the improved deep gravity model with the XGBoost model to build the XGBoost-Deep Gravity Model. The indicator system construction module is used to construct an indicator system that influences population migration flows. Feature selection module. It is used to take each influencing factor in the indicator system as the original feature, rank the importance of each influencing factor based on the XGBoost model, and perform feature selection on the original feature to obtain the main influencing factors; The model training module is used for training, validating, and screening the XGBoost-Deep Gravity model. Prediction module. It is used to predict population migration flow based on the XGBoost-deep gravity model. The population migration flow prediction system is used to perform the steps in the population migration flow prediction method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Land utilization / covering information space-time monitoring method based on priori knowledge

    CN110263111A

  • Multivariable prediction method fusing population and electrical load

    CN115481783A