CN112561188A - People flow prediction method and device - Google Patents
People flow prediction method and device Download PDFInfo
- Publication number
- CN112561188A CN112561188A CN202011531911.9A CN202011531911A CN112561188A CN 112561188 A CN112561188 A CN 112561188A CN 202011531911 A CN202011531911 A CN 202011531911A CN 112561188 A CN112561188 A CN 112561188A
- Authority
- CN
- China
- Prior art keywords
- data
- value
- predicted
- training
- calculating
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 33
- 230000015654 memory Effects 0.000 claims abstract description 42
- 230000007787 long-term memory Effects 0.000 claims abstract description 10
- 230000006403 short-term memory Effects 0.000 claims abstract description 10
- 230000003044 adaptive effect Effects 0.000 claims description 30
- 230000006870 function Effects 0.000 claims description 10
- 210000002569 neuron Anatomy 0.000 claims description 9
- 238000004590 computer program Methods 0.000 description 6
- 238000003064 k means clustering Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 1
- 230000004913 activation Effects 0.000 description 1
- 230000002411 adverse Effects 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/049—Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/10—Services
- G06Q50/26—Government or public services
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Strategic Management (AREA)
- Tourism & Hospitality (AREA)
- Human Resources & Organizations (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Economics (AREA)
- Development Economics (AREA)
- Marketing (AREA)
- General Business, Economics & Management (AREA)
- Game Theory and Decision Science (AREA)
- Evolutionary Biology (AREA)
- Entrepreneurship & Innovation (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Educational Administration (AREA)
- Primary Health Care (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a people flow prediction method and a device, wherein the method comprises the following steps: acquiring training data; the training data consists of a plurality of groups of data, wherein each group of data comprises time, day type, indoor temperature, outdoor temperature and pedestrian volume; performing cluster training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, and selecting the K value with the minimum DB index as the K value of the self-adaptive unsupervised clustering model; establishing K long-short term memory network models, training the kth long-short term memory network model by using the clustered kth class data set respectively, wherein K belongs to [1, K ], and obtaining K trained long-short term memory network models; inputting data to be predicted into a trained self-adaptive unsupervised clustering model to obtain a category corresponding to the data to be predicted; and inputting the data to be predicted into the long-term and short-term memory network model corresponding to the category to obtain the predicted pedestrian volume. The invention does not need to manually set the K value and has high accuracy of people flow prediction.
Description
Technical Field
The invention belongs to the technical field of people flow prediction, and particularly relates to a people flow prediction method and a people flow prediction device.
Background
Through the people flow prediction, the people flow quantity in the current area can be accurately mastered, various adverse events such as treading, stealing and the like can be avoided, and meanwhile, the queuing waiting time of personnel can be reasonably reduced and the use pressure of public facilities can be relieved.
At present, a relatively universal method is people flow prediction based on unsupervised learning algorithms such as K-MEANS and the like, the principle of the method is relatively simple, but when a K value is set, the algorithm is adjusted manually to ensure the accuracy of the algorithm under different data, and the method is only suitable for places with relatively fixed people flow.
Disclosure of Invention
The invention provides a people flow prediction method and a people flow prediction device, which aim to solve the problem that unsupervised learning algorithms such as K-MEANS and the like need to manually set a K value.
In a first aspect, an embodiment of the present invention provides a people flow prediction method, including:
acquiring training data; the training data consists of a plurality of groups of data, and each group of data comprises time, a day type corresponding to the time, indoor temperature, outdoor temperature and pedestrian volume;
performing cluster training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, and selecting the K value with the minimum DB index as the K value of the self-adaptive unsupervised clustering algorithm to obtain a trained self-adaptive unsupervised clustering model;
establishing K long-short term memory network models, training the kth long-short term memory network model by using the clustered kth class data set respectively, wherein K belongs to [1, K ], and obtaining K trained long-short term memory network models;
inputting data to be predicted into a trained self-adaptive unsupervised clustering model to obtain a category corresponding to the data to be predicted; the data to be predicted comprises time to be predicted, a day type corresponding to the time to be predicted, indoor temperature and outdoor temperature;
and inputting the data to be predicted into the long-term and short-term memory network model corresponding to the category for prediction to obtain the predicted pedestrian volume.
Preferably, if each set of data is in the form of Z ═ Z (D, T', Time, scope), then the training data is in the form of [ Z ═ Z1Z2…Zn](ii) a Wherein D is a day type, T is an indoor temperature, T' is an outdoor temperature, Time is Time, and peoples are human traffic;
performing cluster training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, selecting the K value with the minimum DB index as the K value of the adaptive unsupervised clustering algorithm, and obtaining a trained adaptive unsupervised clustering model, wherein the method specifically comprises the following steps:
step 11: from the training data [ Z1 Z2…Zn]In randomly selecting K points ui,i∈[1,K]As a clustering center, K has an initial value of K ═ 1;
step 12: finding the cluster center uiAll points Z within radius hm,Zm∈{Z1,Z2...,ZnAll ZmPoints of (A) are denoted as set Si;
Step 13: calculating each of the cluster centers uiTo the set SiOffset M of (a);
step 14: clustering the center uiMove by an offset M;
step 15: repeating the steps 12-14 until the cluster center uiConvergence no longer moves; wherein, in the convergence process, the [ Z ] is1 Z2…Zn]The n points are clustered into the center u according to different clustersiFrequency of access, u with highest frequency of accessiI.e. the final cluster center to which it belongs, the centerPoint uiAll points Z belong to one class;
step 16: calculating a DB index at the K value;
and step 17: updating the K value by K + 1;
step 18: the step 11-17 is circulated until the K value reaches a preset maximum value;
step 19: and selecting the value K with the minimum BD index as the K value of the adaptive unsupervised clustering algorithm to obtain the trained adaptive unsupervised clustering model.
Preferably, said calculating each of said cluster centers uiTo the set SiSpecifically, the offset M of (a) includes:
according to the formulaCalculating each of the cluster centers uiTo the set SiOffset M of (3), wherein p is SiThe number of interior points.
Preferably, the calculating the DB index under the K value specifically includes:
according to the formulaCalculating BD index I at the K valueDB(ii) a Wherein, CoAnd CuThe distances from the sample o and the sample u to the corresponding cluster center are respectively expressed in the formula; fi,jRepresenting the Euclidean distance between the center of cluster i to cluster j, i ∈ [1, K ∈],j∈[1,K]。
Preferably, the training of the kth long-short term memory network model by using the clustered kth class data set specifically includes:
determining parameters of a kth long-short term memory network model, the parameters comprising: the number of hidden layer neurons, the number of output layer neurons, Dropout, batch _ size, and epochs;
training a kth long-short term memory network model by adopting the clustered kth class data set according to the parameters; wherein, the loss function adopts an average absolute error loss function, and the optimizer adopts adaptive moment estimation.
Preferably, the day type is weekday, ordinary weekend, ordinary holiday or spring festival.
In a second aspect, an embodiment of the present invention provides a people flow rate obtaining apparatus, including:
an acquisition unit configured to acquire training data; the training data consists of a plurality of groups of data, and each group of data comprises time, a day type corresponding to the time, indoor temperature, outdoor temperature and pedestrian volume;
the K value calculating unit is used for carrying out clustering training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, and selecting the K value with the minimum DB index as the K value of the self-adaptive unsupervised clustering algorithm to obtain a trained self-adaptive unsupervised clustering model;
the long-short term memory network model training unit is used for establishing K long-short term memory network models, training the kth long-short term memory network model by using the clustered kth class data set respectively, and obtaining K trained long-short term memory network models, wherein K belongs to [1, K ];
the class acquisition unit is used for inputting data to be predicted into a trained self-adaptive unsupervised clustering model to acquire a class corresponding to the data to be predicted; the data to be predicted comprises time to be predicted, a day type corresponding to the time to be predicted, indoor temperature and outdoor temperature;
and the people flow prediction unit is used for inputting the data to be predicted into the long-term and short-term memory network model corresponding to the category for prediction to obtain the predicted people flow.
Preferably, if each set of data is in the form of Z ═ Z (D, T', Time, scope), then the training data is in the form of [ Z ═ Z1Z2…Zn](ii) a Wherein D is a day type, T is an indoor temperature, T' is an outdoor temperature, Time is Time, and peoples are human traffic;
performing cluster training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, selecting the K value with the minimum DB index as the K value of the adaptive unsupervised clustering algorithm, and obtaining a trained adaptive unsupervised clustering model, wherein the method specifically comprises the following steps:
step 11: from the training data [ Z1 Z2…Zn]In randomly selecting K points ui,i∈[1,K]As a clustering center, K has an initial value of K ═ 1;
step 12: finding the cluster center uiAll points Z within radius hm,Zm∈{Z1,Z2...,ZnAll ZmPoints of (A) are denoted as set Si;
Step 13: calculating each of the cluster centers uiTo the set SiOffset M of (a);
step 14: clustering the center uiMove by an offset M;
step 15: repeating the steps 12-14 until the cluster center uiConvergence no longer moves; wherein, in the convergence process, the [ Z ] is1 Z2…Zn]The n points are clustered into the center u according to different clustersiFrequency of access, u with highest frequency of accessiI.e. the final cluster center to which it belongs, the central point uiAll points Z belong to one class;
step 16: calculating a DB index at the K value;
and step 17: updating the K value by K + 1;
step 18: the step 11-17 is circulated until the K value reaches a preset maximum value;
step 19: and selecting the value K with the minimum BD index as the K value of the adaptive unsupervised clustering algorithm to obtain the trained adaptive unsupervised clustering model.
Preferably, said calculating each of said cluster centers uiTo the set SiSpecifically, the offset M of (a) includes:
preferably, the calculating the DB index under the K value specifically includes:
according to the formulaCalculating BD index I at the K valueDB(ii) a Wherein, CoAnd CuThe distances from the sample o and the sample u to the corresponding cluster center are respectively expressed in the formula; fi,jRepresenting the Euclidean distance between the center of cluster i to cluster j, i ∈ [1, K ∈],j∈[1,K]。
Compared with the prior art, the embodiment of the invention obtains the training data; the training data consists of a plurality of groups of data, and each group of data comprises time, a day type corresponding to the time, indoor temperature, outdoor temperature and pedestrian volume; performing cluster training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, selecting the K value with the minimum DB index as the K value of the adaptive unsupervised clustering algorithm to obtain a trained adaptive unsupervised clustering model, establishing K long-short term memory network models, respectively training a kth long-short term memory network model by using a clustered kth category data set, and obtaining K trained long-short term memory network models, wherein K belongs to [1, K ]; inputting data to be predicted into a trained self-adaptive unsupervised clustering model to obtain a category corresponding to the data to be predicted; the data to be predicted comprises time to be predicted, a day type corresponding to the time to be predicted, indoor temperature and outdoor temperature; and inputting the data to be predicted into the long-term and short-term memory network model corresponding to the category for prediction to obtain the predicted pedestrian volume. Thus, the set K value is not required to be considered, and the people flow prediction is accurate.
Drawings
FIG. 1 is a schematic flow chart diagram of a preferred embodiment of a people flow prediction method provided by the present invention;
fig. 2 is a schematic structural diagram of a preferred embodiment of the human flow prediction device provided by the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the invention provides a people flow prediction method, including:
s1, acquiring training data; the training data is composed of a plurality of groups of data, and each group of data comprises time, a day type corresponding to the time, indoor temperature, outdoor temperature and pedestrian volume.
In the embodiment of the present invention, the flow rate of people is a label corresponding to a sample, and the sample is time, a day type corresponding to the time, an indoor temperature, and an outdoor temperature.
Preferably, the day type is weekday, ordinary weekend, ordinary holiday or spring festival. The time is specifically the current time.
It should be noted that the number of sets constituting the training data is set according to actual requirements, and the present invention is not limited herein, and may be at least 1000 sets, for example. In addition, the ratio of the number of groups to the total number of groups for different types of days is set according to actual requirements, and the invention is not limited, for example, the number of groups for different types of days is at least 10% of the total number of groups.
For example, when the training data is composed of 1000 groups of data, the day type includes weekday, ordinary weekend, ordinary holiday and spring festival, the number of groups corresponding to weekday is at least 100, the number of groups corresponding to ordinary weekend is at least 100, the number of groups corresponding to ordinary holiday is at least 100, the number of groups corresponding to spring festival is at least 100, and the total number is equal to 1000.
And S2, performing cluster training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, and selecting the K value with the minimum DB index as the K value of the self-adaptive unsupervised clustering algorithm to obtain a trained self-adaptive unsupervised clustering model.
The K-means clustering algorithm is also called as K-means clustering algorithm, belongs to unsupervised clustering algorithm, and is a clustering algorithm based on distance. The distance is used as an evaluation index of similarity, namely the closer the distance between two objects is, the greater the similarity of the two objects is. The algorithm considers that class clusters are composed of closely spaced objects, and therefore the resulting compact and independent clusters are the final target.
Specifically, the K-means clustering algorithm is an iterative solution clustering analysis algorithm, and the steps of the algorithm are that K objects are randomly selected as initial clustering centers, then the distance between each object and each seed clustering center is calculated, and each object is allocated to the nearest clustering center. The cluster centers and the objects assigned to them represent a cluster. The cluster center of a cluster is recalculated for each sample assigned based on the objects existing in the cluster. This process will be repeated until some termination condition is met. The termination condition may be that no (or minimum number) objects are reassigned to different clusters, no (or minimum number) cluster centers are changed again, and the sum of squared errors is locally minimal.
S3, establishing K long and short term memory network models, and respectively training the kth long and short term memory network model L by using the clustered kth class data setk,k∈[1,K]And obtaining K long-term and short-term memory network models.
In the embodiment of the present invention, it should be noted that K is K with the smallest DB index.
S4, inputting the data to be predicted into the trained self-adaptive unsupervised clustering model to obtain the corresponding category of the data to be predicted; the data to be predicted comprises time to be predicted, a day type corresponding to the time to be predicted, indoor temperature and outdoor temperature.
And S5, inputting the data to be predicted into the long-short term memory network model corresponding to the category to obtain the predicted pedestrian volume.
As an example of the embodiment of the present invention, if each set of data is in the form of Z ═ D, T', Time, scope, then the training data is in the form of [ Z ═ Z1 Z2…Zn]Wherein D is a day type, T is an indoor temperature, T' is an outdoor temperature, Time is Time, and people is human traffic; then the unsupervised clustering algorithm is used to pair the training dataPerforming clustering training, calculating DB indexes under different K values, selecting the K value with the minimum DB index as the K value of the self-adaptive unsupervised clustering algorithm, and obtaining a trained self-adaptive unsupervised clustering model, which specifically comprises the following steps:
s11: from the training data [ Z1 Z2…Zn]In randomly selecting K points ui,i∈[1,K]As a clustering center, K has an initial value of K ═ 1;
s12: finding the cluster center uiAll points Z within radius hm,Zm∈{Z1,Z2...,ZnAll ZmPoints of (A) are denoted as set Si;
S13: calculating each of the cluster centers uiTo the set SiOffset M of (a);
s14: clustering the center uiMove by an offset M;
s, step 15: repeating the steps 12-14 until the cluster center uiConvergence no longer moves; wherein, in the convergence process, the [ Z ] is1 Z2…Zn]The n points are clustered into the center u according to different clustersiFrequency of access, u with highest frequency of accessiI.e. the final cluster center to which it belongs, the central point uiAll points Z belong to one class;
s16: calculating a DB index at the K value;
s17: updating the value K by K +1,
s18: circulating S11-S17 until the K value reaches a preset maximum value;
s19: and selecting the value K with the minimum BD index as the K value of the adaptive unsupervised clustering algorithm to obtain the trained adaptive unsupervised clustering model.
In the embodiment of the present invention, it is preferable that the K value does not exceed 15.
As an example of the embodiment of the present invention, the calculating of each clustering center u is describediTo the set SiSpecifically, the offset M of (a) includes:
according to the formulaCalculating each of the cluster centers uiTo the set SiIs offset by M, wherein p is SiThe number of interior points.
As an example of the embodiment of the present invention, the calculating the DB index under the K value specifically includes:
according to the formulaCalculating BD index I at the K valueDB(ii) a Wherein, CoAnd CuThe distances from the sample o and the sample u to the corresponding cluster center are respectively expressed in the formula; fi,jRepresenting the Euclidean distance between the center of cluster i to cluster j, i ∈ [1, K ∈],j∈[1,K]。
As an example of the embodiment of the present invention, the training of the kth long-short term memory network model by using the clustered kth class data set specifically includes:
determining parameters of a kth long-short term memory network model, the parameters comprising: the number of hidden layer neurons, the number of output layer neurons, Dropout, batch _ size, and epochs;
training a kth long-short term memory network model by adopting the clustered kth class data set according to the parameters; wherein, the loss function adopts an average absolute error loss function, and the optimizer adopts adaptive moment estimation.
It should be noted that, the values of Dropout, batch _ size and epochs are set according to actual requirements, and the invention is not limited thereto. For example, Dropout may have a value of 0.5, batch _ size may be 100, epochs may have a value of 500.
In the embodiment of the present invention, it should be understood that the Mean Absolute Error (MAE) is a loss function for the regression model, and the MAE is the sum of absolute values of the difference between the target value and the predicted value, and is used to represent the difference degree between the predicted value and the actual data. Adam is an optimizer of a loss function in a ladder process, comprehensively considers first moment estimation of a gradient, namely mean value of the gradient and second moment estimation, namely un-centralized variance of the gradient, calculates an updating step length, and is very suitable for being applied to large-scale data and parameter scenes. Dropout of 0.5 means that randomly stopping the activation of a neuron with a probability of 0.5 as the neural network propagates forward can make the model more generalized since it is less dependent on some local features. A batch _ size of 100 indicates the number of samples selected for a training session, i.e., 100 sets of data are taken from 1000 sets of data (assuming the sample data consists of 1000 sets of data) for each training session to train the LSTM network. An epoch of 500 indicates a total number of training sessions.
Compared with the prior art, the embodiment of the invention obtains the training data; the training data consists of a plurality of groups of data, and each group of data comprises time, a day type corresponding to the time, indoor temperature, outdoor temperature and pedestrian volume; performing cluster training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, selecting the K value with the minimum DB index as the K value of the adaptive unsupervised clustering algorithm to obtain a trained adaptive unsupervised clustering model, establishing K long-short term memory network models, respectively training a kth long-short term memory network model by using a clustered kth category data set, and obtaining K trained long-short term memory network models, wherein K belongs to [1, K ]; inputting data to be predicted into a trained self-adaptive unsupervised clustering model to obtain a category corresponding to the data to be predicted; the data to be predicted comprises time to be predicted, a day type corresponding to the time to be predicted, indoor temperature and outdoor temperature; and inputting the data to be predicted into the long-term and short-term memory network model corresponding to the category for prediction to obtain the predicted pedestrian volume. Thus, the set K value is not required to be considered, and the people flow prediction is accurate.
Example 2:
referring to fig. 2, an embodiment of the present invention provides a people flow rate obtaining apparatus, including:
an acquisition unit 1 for acquiring training data; the training data consists of a plurality of groups of data, and each group of data comprises time, a day type corresponding to the time, indoor temperature, outdoor temperature and pedestrian volume;
the K value calculating unit 2 is used for carrying out clustering training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, and selecting the K value with the minimum DB index as the K value of the self-adaptive unsupervised clustering algorithm to obtain a trained self-adaptive unsupervised clustering model;
the long-short term memory network model training unit 3 is used for establishing K long-short term memory network models, training the kth long-short term memory network model by using the clustered kth class of data sets respectively, and obtaining K trained long-short term memory network models, wherein K belongs to [1, K ];
the category acquisition unit 4 is used for inputting data to be predicted into a trained self-adaptive unsupervised clustering model to acquire a category corresponding to the data to be predicted; the data to be predicted comprises time to be predicted, a day type corresponding to the time to be predicted, indoor temperature and outdoor temperature;
and the people flow predicting unit 5 is used for inputting the data to be predicted into the long-short term memory network model corresponding to the category for prediction to obtain the predicted people flow.
As an example of the embodiment of the present invention, if each set of data is in the form of Z ═ D, T', Time, scope, then the training data is in the form of [ Z ═ Z1 Z2…Zn](ii) a Wherein D is a day type, T is an indoor temperature, T' is an outdoor temperature, Time is Time, and peoples are human traffic;
performing cluster training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, selecting the K value with the minimum DB index as the K value of the adaptive unsupervised clustering algorithm, and obtaining a trained adaptive unsupervised clustering model, wherein the method specifically comprises the following steps:
s11: from the training data [ Z1 Z2…Zn]In randomly selecting K points ui,i∈[1,K]As a clustering center, K has an initial value of K ═ 1;
s12: finding the cluster center uiAll points Z within radius hm,Zm∈{Z1,Z2...,ZnAll ZmPoints of (A) are denoted as set Si;
S13: calculating each of the cluster centers uiTo the set SiOffset M of (a);
s14: clustering the center uiMove by an offset M;
s15: repeating the steps 12-14 until the cluster center uiConvergence no longer moves; wherein, in the convergence process, the [ Z ] is1 Z2…Zn]The n points are clustered into the center u according to different clustersiFrequency of access, u with highest frequency of accessiI.e. the final cluster center to which it belongs, the central point uiAll points Z belong to one class;
s16: calculating a DB index at the K value;
s17: updating the K value by K + 1;
s18: the step 11-17 is circulated until the K value reaches a preset maximum value;
s19: and selecting the value K with the minimum BD index as the K value of the adaptive unsupervised clustering algorithm to obtain the trained adaptive unsupervised clustering model.
As an example of the embodiment of the present invention, the calculating of each clustering center u is describediTo the set SiSpecifically, the offset M of (a) includes:
according to the formulaCalculating each of the cluster centers uiTo the set SiOffset M of (3), wherein p is SiThe number of interior points.
As an example of the embodiment of the present invention, the calculating the DB index under the K value specifically includes:
according to the formulaCalculating BD index I at the K valueDB(ii) a Wherein, CoAnd CuIn which the samples o and u are represented into corresponding clustersThe distance of the heart; fi,jRepresenting the Euclidean distance between the center of cluster i to cluster j, i ∈ [1, K ∈],j∈[1,K]。
As an example of the embodiment of the present invention, the training of the kth long-short term memory network model by using the clustered kth class data set specifically includes:
determining parameters of a kth long-short term memory network model, the parameters comprising: the number of hidden layer neurons, the number of output layer neurons, Dropout, batch _ size, and epochs;
training a kth long-short term memory network model by adopting the clustered kth class data set according to the parameters; wherein, the loss function adopts an average absolute error loss function, and the optimizer adopts adaptive moment estimation.
As an example of the embodiment of the present invention, the day type is weekday, ordinary weekend, ordinary holiday or spring festival.
It should be noted that, all or part of the flow in the method according to the above embodiments of the present invention may also be implemented by a computer program instructing related hardware, where the computer program may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above embodiments of the method may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be further noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.
Claims (10)
1. A people flow prediction method is characterized by comprising the following steps:
acquiring training data; the training data consists of a plurality of groups of data, wherein each group of data comprises time, a day type corresponding to the time, indoor temperature, outdoor temperature and pedestrian volume;
performing cluster training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, and selecting the K value with the minimum DB index as the K value of the self-adaptive unsupervised clustering algorithm to obtain a trained self-adaptive unsupervised clustering model;
establishing K long-short term memory network models, training the kth long-short term memory network model by using the clustered kth class data set respectively, wherein K belongs to [1, K ], and obtaining K trained long-short term memory network models;
inputting data to be predicted into a trained self-adaptive unsupervised clustering model to obtain a category corresponding to the data to be predicted; the data to be predicted comprises time to be predicted, a day type corresponding to the time to be predicted, indoor temperature and outdoor temperature;
and inputting the data to be predicted into the long-term and short-term memory network model corresponding to the category for prediction to obtain the predicted pedestrian volume.
2. The people flow prediction method according to claim 1, wherein if each set of data is in the form of Z ═ Z (D, T', Time, scope), then the training data is in the form of [ Z ═ Z1 Z2 … Zn](ii) a Wherein D is a day type, T is an indoor temperature, T' is an outdoor temperature, Time is Time, and peoples are human traffic;
performing cluster training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, selecting the K value with the minimum DB index as the K value of the adaptive unsupervised clustering algorithm, and obtaining a trained adaptive unsupervised clustering model, wherein the method specifically comprises the following steps:
step 11: from the training data [ Z1 Z2 … Zn]In randomly selecting K points ui,i∈[1,K]As a clustering center, K has an initial value of K ═ 1;
step 12: finding the cluster center uiAll points Z within radius hm,Zm∈{Z1,Z2...,ZnAll ZmPoints of (A) are denoted as set Si;
Step 13: calculating each of the cluster centers uiTo the set SiOffset M of (a);
step 14: clustering the center uiMove by an offset M;
step 15: repeating the steps 12-14 until the cluster center uiConvergence no longer moves; wherein, in the convergence process, the [ Z ] is1 Z2 … Zn]The n points are clustered into the center u according to different clustersiFrequency of access, u with highest frequency of accessiI.e. the final cluster center to which it belongs, the central point uiAll points Z belong to one class;
step 16: calculating a DB index at the K value;
and step 17: updating the K value by K + 1;
step 18: the step 11 to the step 17 are circulated until the K value reaches a preset maximum value;
step 19: and selecting the value K with the minimum BD index as the K value of the adaptive unsupervised clustering algorithm to obtain the trained adaptive unsupervised clustering model.
3. The method of predicting human traffic according to claim 2, wherein said calculating each of said clustering centers uiTo the set SiSpecifically, the offset M of (a) includes:
4. The people flow prediction method according to claim 2, wherein the calculating the DB index under the K value specifically includes:
according to the formulaCalculating BD index I at the K valueDB(ii) a Wherein, CoAnd CuThe distances from the sample o and the sample u to the corresponding cluster center are respectively expressed in the formula; fi,jRepresenting the Euclidean distance between the center of cluster i to cluster j, i ∈ [1, K ∈],j∈[1,K]。
5. The people flow prediction method according to claim 1, wherein the training of the kth long-short term memory network model by using the clustered kth class data set specifically comprises:
determining parameters of a kth long-short term memory network model, the parameters comprising: the number of hidden layer neurons, the number of output layer neurons, Dropout, batch _ size, and epochs;
training a kth long-short term memory network model by adopting the clustered kth class data set according to the parameters; wherein, the loss function adopts an average absolute error loss function, and the optimizer adopts adaptive moment estimation.
6. The people flow prediction method according to claim 1, wherein the day type is weekday, ordinary weekend, ordinary holiday, or spring festival.
7. A pedestrian flow rate acquisition apparatus, comprising:
an acquisition unit configured to acquire training data; the training data consists of a plurality of groups of data, and each group of data comprises time, a day type corresponding to the time, indoor temperature, outdoor temperature and pedestrian volume;
the K value calculating unit is used for carrying out clustering training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, and selecting the K value with the minimum DB index as the K value of the self-adaptive unsupervised clustering algorithm to obtain a trained self-adaptive unsupervised clustering model;
the long-short term memory network model training unit is used for establishing K long-short term memory network models, training the kth long-short term memory network model by using the clustered kth class data set respectively, and obtaining K trained long-short term memory network models, wherein K belongs to [1, K ];
the class acquisition unit is used for inputting data to be predicted into a trained self-adaptive unsupervised clustering model to acquire a class corresponding to the data to be predicted; the data to be predicted comprises time to be predicted, a day type corresponding to the time to be predicted, indoor temperature and outdoor temperature;
and the people flow prediction unit is used for inputting the data to be predicted into the long-term and short-term memory network model corresponding to the category for prediction to obtain the predicted people flow.
8. The people flow prediction device of claim 7, wherein if each set of data is in the form of Z ═ Z (D, T, T', Time, scope), then the training data is in the form of [ Z ═ Z [1 Z2 … Zn](ii) a Wherein D is a day type, T is an indoor temperature, T' is an outdoor temperature, Time is Time, and peoples are human traffic;
performing cluster training on the training data by adopting an unsupervised clustering algorithm, calculating DB indexes under different K values, selecting the K value with the minimum DB index as the K value of the adaptive unsupervised clustering algorithm, and obtaining a trained adaptive unsupervised clustering model, wherein the method specifically comprises the following steps:
step 11: from the training data [ Z1 Z2 … Zn]In randomly selecting K pointsui,i∈[1,K]As a clustering center, K has an initial value of K ═ 1;
step 12: finding the cluster center uiAll points Z within radius hm,Zm∈{Z1,Z2...,ZnAll ZmPoints of (A) are denoted as set Si;
Step 13: calculating each of the cluster centers uiTo the set SiOffset M of (a);
step 14: clustering the center uiMove by an offset M;
step 15: repeating the steps 12-14 until the cluster center uiConvergence no longer moves; wherein, in the convergence process, the [ Z ] is1 Z2 … Zn]The n points are clustered into the center u according to different clustersiFrequency of access, u with highest frequency of accessiI.e. the final cluster center to which it belongs, the central point uiAll points Z belong to one class;
step 16: calculating a DB index at the K value;
and step 17: updating the K value by K + 1;
step 18: the step 11-17 is circulated until the K value reaches a preset maximum value;
step 19: and selecting the value K with the minimum BD index as the K value of the adaptive unsupervised clustering algorithm to obtain the trained adaptive unsupervised clustering model.
9. The people flow prediction device of claim 7, wherein the calculating each of the cluster centers uiTo the set SiSpecifically, the offset M of (a) includes:
10. The people flow rate prediction device according to claim 7, wherein the calculating the DB index at the K value specifically includes:
according to the formulaCalculating BD index I at the K valueDB(ii) a Wherein, CoAnd CuThe distances from the sample o and the sample u to the corresponding cluster center are respectively expressed in the formula; fi,jRepresenting the Euclidean distance between the center of cluster i to cluster j, i ∈ [1, K ∈],j∈[1,K]。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011531911.9A CN112561188A (en) | 2020-12-22 | 2020-12-22 | People flow prediction method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011531911.9A CN112561188A (en) | 2020-12-22 | 2020-12-22 | People flow prediction method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112561188A true CN112561188A (en) | 2021-03-26 |
Family
ID=75032151
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011531911.9A Pending CN112561188A (en) | 2020-12-22 | 2020-12-22 | People flow prediction method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112561188A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113487327A (en) * | 2021-07-27 | 2021-10-08 | 中国银行股份有限公司 | Transaction parameter setting method and device based on clustering algorithm |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110263860A (en) * | 2019-06-21 | 2019-09-20 | 广东工业大学 | A kind of freeway traffic flow prediction technique and device |
CN111598333A (en) * | 2020-05-14 | 2020-08-28 | 北京轨道交通路网管理有限公司 | Passenger flow data prediction method and device |
CN111815046A (en) * | 2020-07-06 | 2020-10-23 | 北京交通大学 | Traffic flow prediction method based on deep learning |
CN111882114A (en) * | 2020-07-01 | 2020-11-03 | 长安大学 | Short-term traffic flow prediction model construction method and prediction method |
-
2020
- 2020-12-22 CN CN202011531911.9A patent/CN112561188A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110263860A (en) * | 2019-06-21 | 2019-09-20 | 广东工业大学 | A kind of freeway traffic flow prediction technique and device |
CN111598333A (en) * | 2020-05-14 | 2020-08-28 | 北京轨道交通路网管理有限公司 | Passenger flow data prediction method and device |
CN111882114A (en) * | 2020-07-01 | 2020-11-03 | 长安大学 | Short-term traffic flow prediction model construction method and prediction method |
CN111815046A (en) * | 2020-07-06 | 2020-10-23 | 北京交通大学 | Traffic flow prediction method based on deep learning |
Non-Patent Citations (9)
Title |
---|
JASON_CHEUNGM: ""均值漂移(Meanshift)算法"", 《HTTPS://BLOG.CSDN.NET/QWERASDF_1_2/ARTICLE/DETAILS/54577336》 * |
凤少伟等: ""基于K-means 与GRU的短时交通流预测研究"", 《计算机技术与发展》 * |
刘京麦野 等: ""基于循环神经网络的语义完整性分析"", 《计算机系统应用》 * |
周子昂 等: ""沪深300高频波动率的预测及应用——基于深度学习的方法"", 《上海立信会计金融学院学报》 * |
梁京章等: "基于KPCA和改进K-means的电力负荷曲线聚类方法", 《华南理工大学学报(自然科学版)》 * |
谭宇宁 等: ""基于SATLSTM 的Web 系统老化趋势预测"", 《计算机应用与软件》 * |
邱艺铭等: ""基于残差回归网络的复杂背景下海界线检测"", 《舰船电子工程》 * |
陈立伟等: ""基于均值漂移聚类的端元束提取"", 《应用科技》 * |
陈维亚等: ""基于K-means 聚类组合模型的公交线路客流短时预测"", 《华南理工大学学报(自然科学版)》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113487327A (en) * | 2021-07-27 | 2021-10-08 | 中国银行股份有限公司 | Transaction parameter setting method and device based on clustering algorithm |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109408731B (en) | Multi-target recommendation method, multi-target recommendation model generation method and device | |
CN113140254A (en) | Meta-learning drug-target interaction prediction system and prediction method | |
CN112163637B (en) | Image classification model training method and device based on unbalanced data | |
CN111813954B (en) | Method and device for determining relationship between two entities in text statement and electronic equipment | |
CN110796175A (en) | Electroencephalogram data online classification method based on light convolutional neural network | |
CN115238731A (en) | Emotion identification method based on convolution recurrent neural network and multi-head self-attention | |
CN112561188A (en) | People flow prediction method and device | |
CN117575745B (en) | Course teaching resource individual recommendation method based on AI big data | |
CN118488180A (en) | Projector automatic dimming method, device, equipment and storage medium | |
CN110188958A (en) | A kind of method that college entrance will intelligently makes a report on prediction recommendation | |
JP2024109536A (en) | Method, device and equipment for training a brain activity state classification model | |
CN111507396B (en) | Method and device for relieving error classification of unknown class samples by neural network | |
CN116522988B (en) | Federal learning method, system, terminal and medium based on graph structure learning | |
CN117034060A (en) | AE-RCNN-based flood classification intelligent forecasting method | |
CN117216375A (en) | Training method and system for information recommendation, storage medium and server | |
CN114936890A (en) | Counter-fact fairness recommendation method based on inverse tendency weighting method | |
CN115376214A (en) | Emotion recognition method and device, electronic equipment and storage medium | |
CN114398991A (en) | Electroencephalogram emotion recognition method based on Transformer structure search | |
CN110941994B (en) | Pedestrian re-identification integration method based on meta-class-based learner | |
Paulavičius et al. | Client tuned federated learning for rssi-based indoor localisation | |
CN114329026A (en) | Image retrieval method, image retrieval device, electronic equipment and computer-readable storage medium | |
CN115731946A (en) | Speech emotion recognition method, device, equipment and storage medium | |
CN112329715A (en) | Face recognition method, device, equipment and storage medium | |
US12020789B1 (en) | Systems and methods enabling baseline prediction correction | |
CN115358367B (en) | Dynamic self-adaptive brain-computer interface decoding method based on multi-model learning integration |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210326 |