CN116721537A - Urban short-time traffic flow prediction method based on GCN-IPSO-LSTM combination model - Google Patents

Urban short-time traffic flow prediction method based on GCN-IPSO-LSTM combination model Download PDF

Info

Publication number
CN116721537A
CN116721537A CN202310437213.XA CN202310437213A CN116721537A CN 116721537 A CN116721537 A CN 116721537A CN 202310437213 A CN202310437213 A CN 202310437213A CN 116721537 A CN116721537 A CN 116721537A
Authority
CN
China
Prior art keywords
model
traffic flow
lstm
representing
ipso
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
Application number
CN202310437213.XA
Other languages
Chinese (zh)
Inventor
张�浩
华奇凡
董锴龙
张格�
高尚兵
梁坤
孔德财
周桂良
朱红兰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huaiyin Institute of Technology
Original Assignee
Huaiyin Institute of Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huaiyin Institute of Technology filed Critical Huaiyin Institute of Technology
Priority to CN202310437213.XA priority Critical patent/CN116721537A/en
Publication of CN116721537A publication Critical patent/CN116721537A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • G06N3/0442Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • G08G1/0129Traffic data processing for creating historical data or processing based on historical data
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • G08G1/0133Traffic data processing for classifying traffic situation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Business, Economics & Management (AREA)
  • Analytical Chemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Strategic Management (AREA)
  • Human Resources & Organizations (AREA)
  • Economics (AREA)
  • Game Theory and Decision Science (AREA)
  • Development Economics (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • General Business, Economics & Management (AREA)
  • Algebra (AREA)
  • Databases & Information Systems (AREA)
  • Marketing (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a city short-time traffic flow prediction method based on a GCN-IPSO-LSTM combination model, which comprises the steps of firstly obtaining city traffic flow data, carrying out data preprocessing and data segmentation, and dividing the data into a training set and a testing set; then, optimizing parameters of the LSTM model by using an improved particle swarm optimization algorithm IPSO; then sequentially constructing a graph convolution GCN model and an LSTM model after IPSO optimization, and respectively extracting spatial features and temporal features in traffic flow data; and finally training the constructed CGN-IPSO-LSTM combination model and predicting the test set. The invention overcomes the defect of insufficient space-time characteristic extraction of traffic flow by a single prediction model; and nonlinear inertia weight, self-adjusting learning factor and self-adaptive mutation operation are introduced into the traditional particle swarm algorithm to improve the particle swarm algorithm, and the improved particle swarm algorithm is used for optimizing the parameters of the LSTM model, so that the optimal parameter combination can be found more quickly and accurately, and the generalization capability and the prediction accuracy of the model are further improved.

Description

Urban short-time traffic flow prediction method based on GCN-IPSO-LSTM combination model
Technical Field
The invention belongs to the technical field of intelligent urban traffic prediction, and relates to a urban short-time traffic flow prediction method based on a GCN-IPSO-LSTM combined model.
Background
With the rapid development of society and economy, china is continuously pushing the construction of smart cities, and intelligent traffic is an extremely important ring in the construction of smart cities. At present, the urban population number of China is increasing year by year, and the corresponding traffic travel demands are also greatly increased, so that the problem of long-time and large-range congestion on urban roads is more frequent. Accurate and timely traffic flow prediction can help traffic management departments to better conduct traffic guidance, relieve traffic jams and reduce traffic accidents; the reasonable planning and selection of the travel path of the traveler are facilitated, the passing time is saved, and the travel efficiency is improved; meanwhile, in the current 5G age, traffic flow prediction plays a very important role in the fields of automatic driving and the like.
Traffic flow data is typical spatiotemporal data, and in the time dimension, traffic flow has periodicity and can dynamically change along with time change; in the spatial dimension, the change of traffic flow data is affected by the road traffic network structure, for example, the congestion of a certain road section often affects the traffic flow of the road section adjacent to the road section and the road section downstream of the road section.
So far, the traffic flow prediction problem based on urban roads has been widely studied, traffic flow prediction models are various in total types, and research at home and abroad has a great deal of research results. The following four types can be classified into a model based on statistical analysis, a neural network model, a deep learning model, and a combination model, respectively. The model based on statistical analysis mainly adopts a traditional mathematical statistics method to carry out modeling analysis on historical data so as to obtain prediction data, and the model has mature theory, simple structure and higher operation speed, but has low precision and interference resistance intersection, and is generally applicable to road sections with stable traffic conditions. The neural network model and the deep learning model are the main directions of current research, the models can learn the space-time characteristics of more complex traffic flow data, the combined prediction model can complement the advantages of several different models, and compared with a single prediction model, the combined prediction model has higher prediction precision in traffic flow prediction.
Particle swarm optimization (Particle Swarm Optimization, PSO) is a commonly used global optimization algorithm that finds the optimal solution in a collaborative search by simulating the birdset feeding process. In traffic flow prediction, particle swarm optimization can be used to optimize parameters of LSTM model to improve prediction accuracy and model stability. However, the conventional particle swarm algorithm has some drawbacks, such as when optimizing complex problems, the particle swarm algorithm is easy to fall into a local optimal solution, so that the search space is limited to a local range, and a global optimal solution cannot be obtained. And the values of the inertia weight and the learning factor in the algorithm formula are usually static, so that the dynamic change of the optimization problem is difficult to adapt.
Disclosure of Invention
The invention aims to: the invention provides a city short-time traffic flow prediction method based on a GCN-IPSO-LSTM combination model, which can process a large-scale and complex city traffic network, can flexibly adjust according to specific data conditions and is suitable for different traffic prediction tasks.
The technical scheme is as follows: the invention provides a city short-time traffic flow prediction method based on a GCN-IPSO-LSTM combination model, which comprises the following steps:
(1) Carrying out data preprocessing and data segmentation on the pre-acquired urban road traffic flow data;
(2) Introducing nonlinear inertia weight, self-adjusting learning factor and self-adaptive mutation operation to improve a particle swarm algorithm, and optimizing parameters of an LSTM model by using the improved particle swarm algorithm;
(3) Constructing a graph convolutional neural network GCN model to extract the spatial characteristics of traffic flow data;
(4) Constructing an LSTM model to extract the time characteristics of traffic flow data, and inputting the optimized parameters in the step (2) into the model to complete the construction of the GCN-IPSO-LSTM model;
(5) And training a GCN-IPSO-LSTM model, and inputting a test data set into the trained model to obtain a predicted value of the required traffic flow.
Further, the traffic flow data in the step (1) includes distance information among monitoring devices of the road network and speed data collected by the monitoring points at different time points.
Further, the implementation process of the step (1) is as follows:
carrying out minimum-maximum normalization processing on traffic flow data, wherein the normalized numerical value is between 0 and 1;
constructing a speed matrix according to the collected speed data of each monitoring pointWherein the elements x in the matrix st Indicating that the s-th monitoring point is at the t-th momentTraffic flow;
constructing a distance matrix according to the collected distance information among the monitoring pointsWherein element d in the matrix ij Representing the distance value between the ith and jth monitoring points, and then calculating a weighted adjacency matrix from the distance matrix>Element w in the matrix ij Calculated by the following formula:
wherein ,wij Representing the weight of an edge, the weight being defined by the distance d between monitoring points i and j ij Determining; sigma and e are thresholds for controlling the distribution and sparsity of matrix W.
Further, the implementation process of the step (2) is as follows:
(21) Initializing particle swarm parameters, comprising: determining the population quantity and iteration times of the particle swarm, and determining the value range of the particle speed;
(22) Randomly initializing a total group: randomly initializing the position and velocity of particles, i.e. randomly generating a population of particles X i,0 (h 1 ,h 2 Epsilon, n), where i denotes the number of the particle, 0 denotes the initial moment, i.e. currently the 0 th iteration, h 1 Indicating the number of neurons of the hidden layer of the first layer, h 2 Expressing the number of neurons of the hidden layer of the second layer, wherein epsilon represents the learning rate of the LSTM model, and n represents the iteration times of the LSTM model;
(23) Determining a fitness function of the particles: assigning LSTM network parameters to the particles X obtained in step (22) i,0 Dividing the preprocessed data into a training set and a testing set again, inputting the training set into a model for training, and obtaining a model training after the model reaches a preset maximum iteration numberA training output value; the definition of the fitness function fit of the particles is as follows:
wherein ,yi Representing the true value of the sample,representing predicted values of the samples, M representing the total number of samples;
(24) Calculate each particle X i According to the fitness value of the initial particles, determining an individual extremum and a population extremum, and taking the best position of each particle as the historical best position;
(25) In each iterative update, the speed and position information of the particles are updated by using formulas (4) to (8), the fitness of the new position is calculated, then the fitness of the new particles is compared with the old fitness, and the optimal position and the optimal fitness are updated:
introducing nonlinear inertial weight, self-adjusting learning factor and self-adaptive variation function,
wherein , and />Respectively representing the speed and position of the ith particle during the kth iteration; /> and gbest Respectively representing an individual extremum and a global optimal solution; rand is a random number function used to generate random numbers between 0 and 1; prob represents an adaptive variation function for controlling the randomness of the particles; lambda is the velocity coefficient; c 1 and c2 Is a learning factor, an important parameter for controlling the speed of movement of particles in the search space; w is the inertial weight, w max and wmin Respectively representing the maximum value and the minimum value of the inertia weight; t and t max Respectively representing the number of current iterations and the maximum number of particle iterations; c 1s and c2s C respectively 1 and c2 Initial value of c 1c and c2c C respectively 1 and c2 A final value of (2);
(26) Judging whether the maximum iteration number of the particle swarm is reached, and returning to the step (24) if the maximum iteration number is not reached; and if the maximum number of times is reached, determining the optimal particles according to the fitness function value of each particle in the current population.
Further, the implementation process of the step (3) is as follows:
two layers of graph-volume stacking are employed to extract spatial features in the data:
wherein ,H(2) Representing the characteristic matrix of the output node after convolution operation of the two-layer graph convolution neural network, H (0) Characteristic moment representing input nodeAn array; w (W) (0) and W(1) Respectively representing weight matrices of the first layer and the second layer;representing the adjacent matrix A plus the matrix obtained from the loop, I N Is an n×n identity matrix; />Is->Degree matrix of->σ represents a nonlinear activation function.
Further, the implementation process of the step (4) is as follows:
f t =σ(W f ·[h t-1 ,x t ]+b f ) (11)
i t =σ(W i ·[h t-1 ,x t ]+b i ) (12)
o t =σ(W o ·[h t-1 ,x t ]+b o ) (15)
h t =o t *tanh(C t ) (16)
wherein ,ft 、i t 、o t Respectively representing the outputs of the forget gate, the input gate and the output gate at the current moment; w (W) f 、W i 、W C and Wo Representing a weight coefficient matrix in the process of updating the LSTM cell state; b f 、b i 、b C and bo The bias term during the cell state update is shown; h is a t-1 Representing input of previous time, x t A test set representing the input of the current moment, i.e. traffic flow data; c (C) t-1 Representing the state of the memory cell at the previous time, C t Indicating the state of the memory cell at the current time,representing the content to be updated in the memory cell, h t Is a predicted traffic flow sequence; sigma is a sigmoid activation function and tanh is an activation function.
Further, the training GCN-IPSO-LSTM model of step (5) uses a square loss function with the following formula:
wherein n represents the total number of predicted samples, y st and xst Respectively representing the predicted value and the actual value of the s-th monitoring point at the time t.
Compared with the prior art, the invention has the following beneficial effects:
1. the LSTM and GCN combined model is used, so that the information of the space and time dimension of the traffic flow can be comprehensively considered, and the characteristics of the urban traffic flow can be more comprehensively extracted; the LSTM model is excellent in processing sequence data, can capture the change trend in the time dimension, and the GCN model can effectively mine the spatial relationship of the traffic network and capture the dependency relationship among different road segments; the combination of the two models enables the models to better understand the space-time characteristics of traffic flow, thereby improving the accuracy of prediction; the combined model has the advantages of being capable of processing large-scale and complex urban traffic networks, flexibly adjusting according to specific data conditions, and being suitable for different traffic prediction tasks;
2. the traditional particle swarm algorithm has the problems of low precision, low convergence speed and the like, and the performance of the algorithm can be effectively improved by introducing improved measures such as nonlinear inertia weight, self-adjusting learning factors and self-adaptive variation operation; the nonlinear inertia weight and the self-adjusting learning factor can improve the global searching capability of the particle swarm algorithm and avoid the algorithm from sinking into a local optimal solution, and the adaptive mutation operation can increase the diversity of the algorithm to realize uniform distribution of particles; by applying the improved particle swarm algorithm to the parameter optimization of the LSTM model, the optimal parameter combination can be found more quickly and accurately, and the generalization capability and the prediction accuracy of the model are improved.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a graph of the spatial thermodynamic diagram of the distribution of monitoring points in an example of the invention;
FIG. 3 is a graph of fitness function for improving particle swarm algorithm and original algorithm;
FIG. 4 is a graph comparing predicted and actual values using the present invention.
Detailed Description
The invention is described in further detail below with reference to the accompanying drawings.
The invention provides a city Short-time traffic flow prediction method based on a GCN-IPSO-LSTM combination model, which combines a graph convolution neural network (Graph Convolutional Network, GCN) and a Long Short-Term Memory neural network (LSTM), extracts the space-time characteristics of traffic flow from two dimensions of space and time respectively, optimizes the parameters of the LSTM model by utilizing an improved particle swarm algorithm, and optimizes the problem that the values of inertia weights and learning factors in the traditional particle swarm algorithm are usually static by introducing nonlinear inertia weights and self-adjusting learning factors; and the self-adaptive mutation operation is introduced to endow the particles with the capability of jumping out of a local range, so that the uniform distribution of the particles is realized, and the global searching capability of an algorithm is improved. As shown in fig. 1, the method specifically comprises the following steps:
step 1: and carrying out data preprocessing and data segmentation on the pre-acquired urban road traffic flow data.
The data set of the embodiment is derived from a PeMS-M data set published by the California State administration Performance measurement System (Caltrans Performance Measurement System, peMS), and the data set contains key attributes of traffic observation data and corresponding monitoring point position information. Specifically, the invention selects a specific road network in the data set, wherein the data is traffic speed information measured by each monitoring point on the road every 5 minutes and position data among the monitoring points in the period of 5 months to 6 months in 2012, the total number of the traffic speed information is 228 monitoring points, the speed information measured by each monitoring point is 1000, and the total number of the traffic speed information is 288000 sample data.
In order to make the training process more stable, the collected traffic flow data is subjected to minimum-maximum normalization (Min-Max Normalization), and the normalized value is between [0,1], and the formula is as follows:
wherein Xmax Representing the maximum value of traffic speed in a dataset, X min Representing the minimum value of traffic speed in the data set, x represents the measured traffic speed value of the monitoring point at a certain moment, x scale Represents the value of x after the min-max normalization process.
Constructing a speed matrix according to the collected speed data of each monitoring pointWherein the elements x in matrix V st And the traffic flow of the s-th monitoring point at the t-th moment is represented.
Constructing a distance matrix according to the collected distance information among the monitoring pointsWherein element d in the matrix ij Representing the distance value between the i-th monitoring point and the j-th monitoring point. The thermodynamic diagram of the space of the monitoring point distribution is shown in fig. 2.
Next, a weighted adjacency matrix is calculated according to the distance matrixElement w in the matrix ij The calculation can be performed by the following formula:
wherein ,wij Representing the weight of an edge, the weight being defined by d ij (i.e., the distance between monitoring points i and j); sigma and e are thresholds for controlling the distribution and sparsity of matrix W. The velocity matrix is processed according to 7:3, wherein the first 70% of data is used as training set and the last 30% of data is used as test set.
Step 2: and introducing nonlinear inertia weight, self-adjusting learning factor and self-adaptive mutation operation to improve a particle swarm algorithm, and optimizing parameters of the LSTM model by using the improved particle swarm algorithm.
First, the LSTM model network structure and parameters to be optimized are determined. The method specifically comprises the following steps: selecting a proper LSTM model structure according to the scale of the problem and the characteristics of the data set; parameters to be optimized in the LSTM model, such as learning rate, batch size (batch size), iteration times, the number of LSTM hidden layer neurons and the like, which influence the performance of the model are determined, and the value range of the parameters is set.
The LSTM model selected in the embodiment is provided with two hidden layers, four parameters to be optimized of the LSTM model are selected, and the parameters are the neuron number h of the two hidden layers of the LSTM model 1 and h2 The learning rate epsilon and the iteration number n of the model. h is a 1 ,h 2 The value ranges of epsilon and n are respectively set as [1, 100],[1,100],[0.0001,0.01]And [100, 1000]. Initializing particle swarm parameters: in this example, the population number of particle swarm is 10, the iteration number is 50, and the value range of particle speed is [ -5,5 respectively],[-5,5],[0.000 5,0.000 5]And [ -10, 10]。
Randomly initializing a total group: randomly initializing the position and velocity of particles, i.e. randomly generating a population of particles X i,0 (h 1 ,h 2 ,ε,n) Where i denotes the number of the particle, 0 denotes the initial moment, i.e. currently the 0 th iteration, h 1 Indicating the number of neurons of the hidden layer of the first layer, h 2 Representing the number of neurons of the hidden layer of the second layer, epsilon represents the learning rate of the LSTM model, and n represents the iteration number of the LSTM model.
An fitness function of the particles is determined. Assigning LSTM network parameters to particle X i,0 Dividing the preprocessed data into a training set and a testing set again, inputting the training set into a model for training, and obtaining an output value of model training after the model reaches a preset maximum iteration number. The definition of the fitness function fit of the particles is as follows:
wherein ,yi Representing the true value of the sample,representing the predicted value of the samples, and M represents the total number of samples.
Calculate each particle X i And determining individual extremum and population extremum according to the fitness value of the initial particle, and taking the best position of each particle as the historical best position.
In each iterative update, the speed and position information of the particles are updated using formulas (4) to (8), and the fitness of the particles at the new position is calculated, and then the new particle fitness is compared with the old fitness, and the optimal position and the optimal fitness are updated.
in the formula , and />Respectively representing the speed and position of the ith particle during the kth iteration; /> and gbest Respectively representing an individual extremum and a global optimal solution; rand is a random number function used to generate random numbers between 0 and 1; lambda is the velocity coefficient; w is inertia weight, and the function of the inertia weight is to balance the local searching and global searching capacity of particles so as to achieve the purposes of accelerating algorithm convergence and improving searching performance; c 1 and c2 Is a learning factor and is an important parameter for controlling the speed of movement of particles in the search space.
The improved particle swarm algorithm optimizes the problem that the values of the inertia weight and the learning factor in the traditional particle swarm algorithm are usually static by defining the nonlinear inertia weight and the self-adjusting learning factor, introduces the self-adaptive mutation operation to endow the particles with the ability of jumping out of a local range, realizes uniform distribution of the particles, and improves the global searching ability of the algorithm. The correlation formula is as follows:
nonlinear inertial weight:
wherein ,wmax and wmin Respectively represent the maximum value and the minimum value of the inertia weight, and t max The number of current iterations and the maximum number of particle iterations are represented, respectively. As the iteration t increases, the value of w decreases gradually and non-linearly. In the initial stage of optimization, the value of the inertia weight of the particles is larger, which is favorable for the algorithm to quickly explore the search space and improve the global search capability, and in the later stage of the algorithm, the inertia weight of the particles is gradually reduced, which is favorable for the algorithm to search the local optimal solution more finely.
Self-adjusting learning factor:
wherein ,c1s and c2s C respectively 1 and c2 Initial value of c 1c and c2c C respectively 1 and c2 And t max The number of current iterations and the maximum number of particle iterations are represented, respectively. Conventional learning factors are typically static in value and may cause the algorithm to fall into a locally optimal solution or prematurely converge to a locally optimal solution during the search. Specifically, c in formula (7) 1 and c2 The number of iterations t is reduced continuously, so that the particles are more focused on global searching in the early stage of the algorithm and more focused on local searching in the later stage of the algorithm. This effectively balances the global and local search capabilities of the algorithm, helping to find a better solution.
Adaptive variation function:
the Prob is increased along with the increase of the iteration times t, so that particles can jump out of a local optimal solution, uniform distribution of the particles is realized, and the global searching capability of an algorithm is improved.
After completing one complete iteration update, the iteration times are judged. Judging whether the maximum iteration number of the particle swarm is reached, and if the maximum iteration number is not reached, continuing to carry out iteration updating. If the maximum number of times is reached, determining optimal particles according to the fitness function value of each particle in the current population, wherein the optimal particles respectively correspond to the neuron number h of the two hidden layers of the LSTM 1 and h2 The learning rate epsilon and the iteration number n of the LSTM model.
The improved particle swarm algorithm has better optimizing capability, and the extremum of the 5-dimensional sphere function is optimized by utilizing the improved particle swarm algorithm and the non-improved algorithm, and the result is shown in figure 3. Analysis of fig. 3 shows that the PSO algorithm, after about 30 iterations, falls into a locally optimal solution with a final value of about 0.4. In contrast, the IPSO algorithm greatly enhances its optimizing ability, and after 1000 iterations, it can still continue to find a better solution, with an extremum of about 10A-8. Therefore, the improved particle swarm algorithm of the invention has better optimizing capability.
Step 3: and constructing a graph convolutional neural network GCN model to extract the spatial characteristics of traffic flow data.
GCN is a convolutional neural network that can directly act on the graph and make use of its structural information, with the model input being an adjacency matrix and a feature matrix. The GCN uses the concept of spectral theory, by performing spectral decomposition on the adjacency matrix, so that the convolution operation can be performed in the frequency domain, thereby capturing the spatial features between nodes more efficiently. The propagation mode between layers of the GCN is as follows:
wherein ,H(l) Representing a feature matrix of the first layer; w (W) (l) A weight matrix representing a first layer;representing the adjacent matrix A plus the matrix obtained from the loop, I N Is an n×n identity matrix; />Is->Degree matrix of->σ represents a nonlinear activation function. In order to increase the nonlinearity of the model and prevent overfitting, the invention adopts two picture convolution layers to extract the spatial characteristics in the data, and the formula is as follows:
wherein ,H(2) Representing the characteristic matrix of the output node after convolution operation of the two-layer graph convolution neural network, H (0) A feature matrix representing the input nodes; w (W) (0) and W(1) Representing the weight matrices of the first layer and the second layer, respectively.
Step 4: and (3) constructing an LSTM model, extracting the time characteristics of traffic flow data, and inputting the optimized parameters in the step (2) into the model to complete the construction of the GCN-IPSO-LSTM model.
The LSTM model is constructed as follows:
f t =σ(W f ·[h t-1 ,x t ]+b f ) (11)
i t =σ(W i ·[h t-1 ,x t ]+b i ) (12)
0 t =σ(W o ·[h t-1 ,x t ]+b o ) (15)
h t =o t *tanh(C t ) (16)
in the above formulas (11) to (16), f t 、i t 、o t Respectively representing the outputs of the forget gate, the input gate and the output gate at the current moment; w (W) f 、W i 、W C and Wo Representing a weight coefficient matrix in the process of updating the LSTM cell state; b f 、b i 、b C and bo The bias term during the cell state update is shown; h is a t-1 Representing input of previous time, x t A test set representing the input of the current moment, i.e. traffic flow data;C t-1 representing the state of the memory cell at the previous time, C t Indicating the state of the memory cell at the current time,representing the content to be updated in the memory cell, h t Is a predicted traffic flow sequence; sigma is a sigmoid activation function and tanh is an activation function. Specifically, the input gate affects the state of the LSTM cell by controlling the update of the current time input information; the forget gate is responsible for controlling the memorization of the LSTM unit, namely, deciding which historical information should be reserved and which should be forgotten; the output gate controls the output of the LSTM unit at the current moment, thereby affecting the hidden state of the LSTM unit. The three gates are mutually matched to jointly determine the updating mode of the LSTM unit state, so that the LSTM model can better process the sequence data. Defining relevant parameters of the LSTM model, and specifically inputting the parameters after IPSO optimization into the LSTM model.
Step 5: and training a GCN-IPSO-LSTM model, and inputting a test data set into the trained model to obtain a predicted value of the required traffic flow.
The output of the IPSO-LSTM model is processed as an input to the full connection layer Dense. Iterative training of the GCN-IPSO-LSTM model is performed, and a square loss function is used, wherein the formula is as follows:
wherein n represents the total number of predicted values, y st and xst Respectively representing the predicted value and the actual value of the s-th monitoring point at the time t.
After the GCN-IPSO-LSTM model is trained through the steps, a monitoring point is selected in the test data set, the data of the monitoring point is input into the model, and finally the predicted value of the required traffic flow is obtained.
In the embodiment, three indexes of MAE, MSE and MAPE are selected as indexes for measuring prediction precision, and the index formula is as follows:
average absolute error:
mean square error:
mean square absolute percentage error:
wherein n represents the total number of prediction samples, Y t and Xt The predicted value and the actual value of the s-th monitoring point at the time t are respectively represented, and the smaller the value of the evaluation index is, the better the prediction effect of the model is.
In order to verify the prediction effect of the GCN-IPSO-LSTM combined model, the prediction experimental results of different models are compared and analyzed, and as shown in the table 1, the prediction effect of the LSTM model optimized by using the improved particle swarm is superior to that of the traditional LSTM model; the prediction result of the GCN and LSTM combined model is better than that of a single model; the evaluation indexes MAE, MSE and MAPE of the GCN-IPSO-LSTM combined model provided by the invention are 6.336, 1.717 and 3.652 respectively, and the prediction performance of the model is superior to that of other models of the same kind.
Table 1 comparison of evaluation index of different prediction models
FIG. 4 is a graph showing the predicted value of the LSTM model compared with the actual value, and the lower graph is a graph showing the predicted value of the GCN-IPSO-LSTM model compared with the actual value. The two can be compared, the GCN-IPSO-LSTM model adopted by the invention has better performance than the traditional LSTM model, and the prediction precision is effectively improved.
The above description is merely of preferred embodiments of the present invention, and it should be noted that the present invention is not limited to the above embodiments, and it should be understood that various changes, modifications and variations can be made by those skilled in the art without departing from the technical principles of the present invention, and these modifications and variations should also be regarded as the scope of the invention.

Claims (7)

1. A city short-time traffic flow prediction method based on a GCN-IPSO-LSTM combination model is characterized by comprising the following steps:
(1) Carrying out data preprocessing and data segmentation on the pre-acquired urban road traffic flow data;
(2) Introducing nonlinear inertia weight, self-adjusting learning factor and self-adaptive mutation operation to improve a particle swarm algorithm, and optimizing parameters of an LSTM model by using the improved particle swarm algorithm;
(3) Constructing a graph convolutional neural network GCN model to extract the spatial characteristics of traffic flow data;
(4) Constructing an LSTM model to extract the time characteristics of traffic flow data, and inputting the optimized parameters in the step (2) into the model to complete the construction of the GCN-IPSO-LSTM model;
(5) And training a GCN-IPSO-LSTM model, and inputting a test data set into the trained model to obtain a predicted value of the required traffic flow.
2. The method for predicting urban short-time traffic flow based on a GCN-IPSO-LSTM combination model according to claim 1, wherein the traffic flow data in step (1) includes distance information between monitoring devices of the road network and speed data collected by the monitoring points at different time points.
3. The urban short-time traffic flow prediction method based on the GCN-IPSO-LSTM combination model according to claim 1, wherein the implementation process of the step (1) is as follows:
carrying out minimum-maximum normalization processing on traffic flow data, wherein the normalized numerical value is between 0 and 1;
constructing a speed matrix according to the collected speed data of each monitoring pointWherein the elements x in the matrix st Representing the traffic flow of the s-th monitoring point at the t moment;
constructing a distance matrix according to the collected distance information among the monitoring points Wherein element d in the matrix ij Representing the distance value between the ith and jth monitoring points, and then calculating a weighted adjacency matrix from the distance matrix>Element w in the matrix ij Calculated by the following formula:
wherein ,wij Representing the weight of an edge, the weight being defined by the distance d between monitoring points i and j ij Determining; sigma and e are thresholds for controlling the distribution and sparsity of matrix W.
4. The urban short-time traffic flow prediction method based on the GCN-IPSO-LSTM combination model according to claim 1, wherein the implementation process of the step (2) is as follows:
(21) Initializing particle swarm parameters, comprising: determining the population quantity and iteration times of the particle swarm, and determining the value range of the particle speed;
(22) Randomly initializing a total group: randomly initializing the position and velocity of particles, i.e. randomly generating a population of particles X i,0 (h 1 ,h 2 Epsilon, n), where i denotes the number of the particle, 0 denotes the initial moment, i.e. currently the 0 th iteration, h 1 Indicating the number of neurons of the hidden layer of the first layer, h 2 Representing the secondThe number of neurons of the hidden layer of the layer epsilon represents the learning rate of the LSTM model, and n represents the iteration times of the LSTM model;
(23) Determining a fitness function of the particles: assigning LSTM network parameters to the particles X obtained in step (22) i,0 Dividing the preprocessed data into a training set and a testing set again, inputting the training set into a model for training, and obtaining an output value of model training after the model reaches a preset maximum iteration number; the definition of the fitness function fit of the particles is as follows:
wherein ,yi Representing the true value of the sample,representing predicted values of the samples, M representing the total number of samples;
(24) Calculate each particle X i According to the fitness value of the initial particles, determining an individual extremum and a population extremum, and taking the best position of each particle as the historical best position;
(25) In each iterative update, the speed and position information of the particles are updated by using formulas (4) to (8), the fitness of the new position is calculated, then the fitness of the new particles is compared with the old fitness, and the optimal position and the optimal fitness are updated:
introducing nonlinear inertial weight, self-adjusting learning factor and self-adaptive variation function,
wherein , and />Respectively representing the speed and position of the ith particle during the kth iteration; /> and gbest Respectively representing an individual extremum and a global optimal solution; rand is a random number function used to generate random numbers between 0 and 1; orob represents an adaptive variation function for controlling the randomness of particles; lambda is the velocity coefficient; c 1 and c2 Is a learning factor, an important parameter for controlling the speed of movement of particles in the search space; w is the inertial weight, w 6ax and w6in Respectively representing the maximum value and the minimum value of the inertia weight; t and t 6ax Respectively representing the number of current iterations and the maximum number of particle iterations; c 1s and c2s C respectively 1 and c2 Initial value of c 1c and c2c C respectively 1 and c2 A final value of (2);
(26) Judging whether the maximum iteration number of the particle swarm is reached, and returning to the step (24) if the maximum iteration number is not reached; and if the maximum number of times is reached, determining the optimal particles according to the fitness function value of each particle in the current population.
5. The urban short-time traffic flow prediction method based on the GCN-IPSO-LSTM combination model according to claim 1, wherein the implementation process of the step (3) is as follows:
two layers of graph-volume stacking are employed to extract spatial features in the data:
wherein ,H(2) Representing the characteristic matrix of the output node after convolution operation of the two-layer graph convolution neural network, H (0) A feature matrix representing the input nodes; w (W) (0) and W(1) Respectively representing weight matrices of the first layer and the second layer;representing the adjacent matrix A plus the matrix obtained from the loop, I A Is an n×n identity matrix; />Is->Degree matrix of->σ represents a nonlinear activation function.
6. The urban short-time traffic flow prediction method based on the GCN-IPSO-LSTM combination model according to claim 1, wherein the implementation process of the step (4) is as follows:
f t =σ(W f ·[h t-1 ,x t ]+b f ) (11)
i t =σ(W i ·[h t-1 ,x t ]+b i ) (12)
o t =σ(W o ·[h t-1 ,x t ]+b o ) (15)
h t =o t *tanh(C t ) (16)
wherein ,ft 、i t 、o t Respectively representing the outputs of the forget gate, the input gate and the output gate at the current moment; w (W) f 、W i 、W C and Wo Representing a weight coefficient matrix in the process of updating the LSTM cell state; b f 、b i 、b C and bo The bias term during the cell state update is shown; h is a t-1 Representing input of previous time, x t A test set representing the input of the current moment, i.e. traffic flow data; c (C) t-1 Representing the state of the memory cell at the previous time, C t Indicating the state of the memory cell at the current time,representing the content to be updated in the memory cell, h t Is a predicted traffic flow sequence; sigma is a sigmoid activation function and tanh is an activation function.
7. The urban short-time traffic flow prediction method based on a GCN-IPSO-LSTM combination model according to claim 1, wherein the training GCN-IPSO-LSTM model in step (5) uses a square loss function with the following formula:
wherein n represents the total number of predicted samples, y st and xst Respectively representing the predicted value and the actual value of the s-th monitoring point at the time t.
CN202310437213.XA 2023-04-21 2023-04-21 Urban short-time traffic flow prediction method based on GCN-IPSO-LSTM combination model Pending CN116721537A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310437213.XA CN116721537A (en) 2023-04-21 2023-04-21 Urban short-time traffic flow prediction method based on GCN-IPSO-LSTM combination model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310437213.XA CN116721537A (en) 2023-04-21 2023-04-21 Urban short-time traffic flow prediction method based on GCN-IPSO-LSTM combination model

Publications (1)

Publication Number Publication Date
CN116721537A true CN116721537A (en) 2023-09-08

Family

ID=87863784

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310437213.XA Pending CN116721537A (en) 2023-04-21 2023-04-21 Urban short-time traffic flow prediction method based on GCN-IPSO-LSTM combination model

Country Status (1)

Country Link
CN (1) CN116721537A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117076872A (en) * 2023-10-17 2023-11-17 交通运输部公路科学研究所 Intelligent road equipment information acquisition testing method and system
CN117253365A (en) * 2023-11-17 2023-12-19 上海伯镭智能科技有限公司 Automatic detection method and related device for vehicle traffic condition
CN117373263A (en) * 2023-12-08 2024-01-09 深圳市永达电子信息股份有限公司 Traffic flow prediction method and device based on quantum pigeon swarm algorithm
CN117370877A (en) * 2023-12-06 2024-01-09 长春理工大学 Agricultural machinery fault prediction method based on multiple sensors and IPSO-GPR
CN117540265A (en) * 2023-10-09 2024-02-09 国网浙江省电力有限公司紧水滩水力发电厂 Concrete dam deformation prediction method based on IPSO-transducer model
CN117830047A (en) * 2024-01-15 2024-04-05 江苏科学梦创展科技有限公司 Operation pressure prediction and intelligent adjustment system for science and technology exhibition hall
CN117852701A (en) * 2024-01-05 2024-04-09 淮阴工学院 Traffic flow prediction method and system based on characteristic attention mechanism
CN117910329A (en) * 2024-03-19 2024-04-19 山东省计算中心(国家超级计算济南中心) Ocean time sequence data prediction method and system based on improved particle swarm optimization algorithm

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117540265A (en) * 2023-10-09 2024-02-09 国网浙江省电力有限公司紧水滩水力发电厂 Concrete dam deformation prediction method based on IPSO-transducer model
CN117076872B (en) * 2023-10-17 2023-12-26 交通运输部公路科学研究所 Intelligent road equipment information acquisition testing method and system
CN117076872A (en) * 2023-10-17 2023-11-17 交通运输部公路科学研究所 Intelligent road equipment information acquisition testing method and system
CN117253365A (en) * 2023-11-17 2023-12-19 上海伯镭智能科技有限公司 Automatic detection method and related device for vehicle traffic condition
CN117253365B (en) * 2023-11-17 2024-02-02 上海伯镭智能科技有限公司 Automatic detection method and related device for vehicle traffic condition
CN117370877B (en) * 2023-12-06 2024-04-26 长春理工大学 Agricultural machinery fault prediction method based on multiple sensors and IPSO-GPR
CN117370877A (en) * 2023-12-06 2024-01-09 长春理工大学 Agricultural machinery fault prediction method based on multiple sensors and IPSO-GPR
CN117373263A (en) * 2023-12-08 2024-01-09 深圳市永达电子信息股份有限公司 Traffic flow prediction method and device based on quantum pigeon swarm algorithm
CN117373263B (en) * 2023-12-08 2024-03-08 深圳市永达电子信息股份有限公司 Traffic flow prediction method and device based on quantum pigeon swarm algorithm
CN117852701A (en) * 2024-01-05 2024-04-09 淮阴工学院 Traffic flow prediction method and system based on characteristic attention mechanism
CN117852701B (en) * 2024-01-05 2024-08-09 淮阴工学院 Traffic flow prediction method and system based on characteristic attention mechanism
CN117830047A (en) * 2024-01-15 2024-04-05 江苏科学梦创展科技有限公司 Operation pressure prediction and intelligent adjustment system for science and technology exhibition hall
CN117910329A (en) * 2024-03-19 2024-04-19 山东省计算中心(国家超级计算济南中心) Ocean time sequence data prediction method and system based on improved particle swarm optimization algorithm
CN117910329B (en) * 2024-03-19 2024-09-13 山东省计算中心(国家超级计算济南中心) Ocean time sequence data prediction method and system based on improved particle swarm optimization algorithm

Similar Documents

Publication Publication Date Title
CN116721537A (en) Urban short-time traffic flow prediction method based on GCN-IPSO-LSTM combination model
CN109754113B (en) Load prediction method based on dynamic time warping and long-and-short time memory
CN109492822B (en) Air pollutant concentration time-space domain correlation prediction method
CN109142171B (en) Urban PM10 concentration prediction method based on feature expansion and fusing with neural network
CN113468803B (en) WOA-GRU flood flow prediction method and system based on improvement
CN115578852B (en) DSTGCN-based traffic prediction method
CN114781538B (en) Air quality prediction method and system for GA-BP neural network coupling decision tree
CN111861013B (en) Power load prediction method and device
CN113554466A (en) Short-term power consumption prediction model construction method, prediction method and device
CN115148019A (en) Early warning method and system based on holiday congestion prediction algorithm
CN113516304B (en) Regional pollutant space-time joint prediction method and device based on space-time diagram network
CN117494034A (en) Air quality prediction method based on traffic congestion index and multi-source data fusion
CN116542382A (en) Sewage treatment dissolved oxygen concentration prediction method based on mixed optimization algorithm
CN113947182B (en) Traffic flow prediction model construction method based on dual-stage stacked graph convolution network
CN110990718A (en) Social network model building module of company image improving system
CN117994986B (en) Traffic flow prediction optimization method based on intelligent optimization algorithm
CN115481788B (en) Phase change energy storage system load prediction method and system
CN113537539B (en) Multi-time-step heat and gas consumption prediction model based on attention mechanism
CN116797274A (en) Shared bicycle demand prediction method based on Attention-LSTM-LightGBM
CN116187835A (en) Data-driven-based method and system for estimating theoretical line loss interval of transformer area
CN115063972B (en) Traffic speed prediction method and system based on graph convolution and gating circulation unit
CN115907122A (en) Regional electric vehicle charging load prediction method
CN116826737A (en) Photovoltaic power prediction method, device, storage medium and equipment
CN116913098B (en) Short-time traffic flow prediction method integrating air quality and vehicle flow data
CN113762591B (en) Short-term electric quantity prediction method and system based on GRU and multi-core SVM countermeasure learning

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