## 一种考虑时空关联的深度学习短时交通流预测方法

1 福建工程学院交通运输学院，福建 福州 350118

2 福建工程学院土木工程学院，福建 福州 350118

## A deep learning short-term traffic flow prediction method considering spatial-temporal association

ZHANG Yang1, HU Yue1, XIN Dongrong2

1 School of Transportation, Fujian University of Technology, Fuzhou 350118, China

2 School of Civil Engineering, Fujian University of Technology, Fuzhou 350118, China

 基金资助: 国家自然科学基金资助项目.  51678077福建省自然科学基金资助项目.  2019J01781福建省自然科学基金资助项目.  2020J05194福建省财政厅科技计划项目.  GY-Z21001

Revised: 2021-03-02   Online: 2021-06-15

 Fund supported: The National Natural Science Foundation of China.  51678077The Natural Science Foundation of Fujian Province.  2019J01781The Natural Science Foundation of Fujian Province.  2020J05194Fujian Finance Department Science Foundation.  GY-Z21001

Abstract

The short-term traffic flow prediction is too dependent on the time correlation characteristics, which due to the problems that the correlation factors of the spatial correlation characteristics are too complicated and difficult to quantify.In response to this defect, a deep learning short-term traffic flow prediction method considering spatial-temporal association was proposed.Firstly, by constructing a spatial association measurement function that simultaneously considers distance, flow similarity, and speed similarity, the spatial correlation between the target road segment and the surrounding associated road segments was quantified and predicted.Then, a convolutional neural network model with long short-term memory neurons embedded was constructed.The long short-term memory neurons were used to extract the temporal correlation characteristics between the data, and the spatial correlation metric and the convolution transmission of traffic data were used to extract the spatial correlation characteristics between the data, so as to realize the traffic flow prediction considering the spatial-temporal association.The experimental results show that the proposed method can adapt to short-term forecasting under different traffic flow characteristics such as weekdays and weekends, and the prediction accuracy is better than that of the classical methods.In weekdays and weekends, the forecast bias are 10.45% and 12.35% respectively.

Keywords： deep learning ; intelligent transportation ; traffic prediction ; long short-term memory neural network ; convolu-tional neural network

ZHANG Yang. A deep learning short-term traffic flow prediction method considering spatial-temporal association. Chinese Journal of Intelligent Science and Technology[J], 2021, 3(2): 172-178 doi:10.11959/j.issn.2096-6652.202117

## 2 空间关联性度量函数

### 图1

${X}_{0}\left(t\right)=\left[{x}_{0}\left(t-T\right),{x}_{0}\left(t-T+1\right),\cdots ,{x}_{0}\left(t\right)\right] \left(1\right)$

${X}_{n}\left(t\right)=\left[{x}_{n}\left(t-T\right),{x}_{n}\left(t-T+1\right),\cdots ,{x}_{n}\left(t\right)\right],n=\text{1,2,}\cdots \text{,}N \left(2\right)$

${\text{dq}}_{n}={‖{X}_{0}\left(t\right)-{X}_{n}\left(t\right)‖}_{2}=\sqrt{\sum _{t}\left({x}_{0}\left(t\right)-{x}_{n}\left(t\right)\right){\text{\hspace{0.17em}}}^{2}} \left(3\right)$

${V}_{0}\left(t\right)=\left[{v}_{0}\left(t-T\right),{v}_{0}\left(t-T+1\right),\cdots ,{v}_{0}\left(t\right)\right] \left(4\right)$

${V}_{n}\left(t\right)=\left[{v}_{n}\left(t-T\right),{v}_{n}\left(t-T+1\right),\cdots ,{v}_{n}\left(t\right)\right],n=\text{1,2,}\cdots \text{,}N \left(5\right)$

${\text{dv}}_{n}=\frac{\text{Cov}\left({V}_{0}\left(t\right),{V}_{n}\left(t\right)\right)}{\sqrt{D{V}_{0}\left(t\right)}\sqrt{D{V}_{n}\left(t\right)}}=$

$\frac{{\sum }_{i=t-T}^{t}\left({v}_{0}\left(i\right)-\overline{v}\right)\left({v}_{n}\left(i\right)-{\overline{v}}_{n}\right)}{\sqrt{{\sum }_{i=t-T}^{t}\left({v}_{0}\left(i\right)-\overline{v}\right){\text{\hspace{0.17em}}}^{2}{\sum }_{i=t-T}^{t}\left({v}_{n}\left(i\right)-{\overline{v}}_{n}\right){\text{\hspace{0.17em}}}^{2}}} \left(6\right)$

${\text{corr}}_{n}=\frac{{\sum }_{n=1}^{N}{S}_{n}{\text{dq}}_{n}{\text{dv}}_{n}}{{S}_{n}{\text{dq}}_{n}{\text{dv}}_{n}} \left(7\right)$

## 3 内嵌LSTM神经元的CNN短时交通流预测模型

CNN卷积预测算法具有良好的空间特性提取性能[11-12]，而LSTM拥有优越的时间特性分析和学习能力[13-14]。本文在 CNN 卷积预测算法框架下，将LSTM 内嵌至 CNN 卷积隐层结构的神经元，使其同时具备良好的时空特性学习能力。

### 图2

${I}^{t}=\sigma \left({W}_{xi}\ast {x}^{t}+{W}_{hi}\ast {h}^{t-1}+{W}_{ci}\circ {C}^{t-1}+{b}_{i}\right) \left(8\right)$

${F}^{t}=\sigma \left({W}_{xf}\ast {x}^{t}+{W}_{hf}\ast {h}^{t-1}+{W}_{cf}\circ {C}^{t-1}+{b}_{f}\right) \left(9\right)$

${C}^{t}={F}^{t}\circ {C}^{t-1}+{I}^{t}\circ \mathrm{tanh}\left({W}_{xc}\ast {x}^{t}+{W}_{hc}\ast {h}^{t-1}+{b}_{c}\right) \left(10\right)$

${O}^{t}=\sigma \left({W}_{xo}\ast {x}^{t}+{W}_{ho}\ast {h}^{t-1}+{W}_{co}\circ {C}^{t}+{b}_{o}\right) \left(11\right)$

${h}^{t}={O}^{t}\circ \mathrm{tanh}\left({C}^{t}\right) \left(12\right)$

## 4 实验结果与分析

### 4.2 预测算法性能指标的选取

$\text{MRE}=\frac{1}{n}\sum _{i=1}^{n}\frac{|{y}_{i}-{\stackrel{˜}{y}}_{i}|}{{y}_{i}} \left(13\right)$

$\text{MAE}=\frac{1}{n}\sum _{i=1}^{n}|{y}_{i}-{\stackrel{˜}{y}}_{i}| \left(14\right)$

$\text{RMSE}=\sqrt{\frac{1}{n}\sum _{i=1}^{n}{\left({y}_{i}-{\stackrel{˜}{y}}_{i}\right)}^{2}} \left(15\right)$

### 图4

 评价指标 S-LSTM-CNN LSTM-CNN MAE 22.421 34.584 MRE 10.45% 14.85% RMSE 32.435 37.488

 评价指标 S-LSTM-CNN LSTM-CNN MAE 24.362 37.578 MRE 12.35% 16.76% RMSE 36.273 8 40.566

### 图5

 评价指标 S-LSTM-CNN IWPA-LSTM DBN-SVR MAE 22.421 28.031 35.062 MRE 10.45% 13.69% 15.81% RMSE 32.435 37.023 41.238

 评价指标 S-LSTM-CNN IWPA-LSTM DBN-SVR MAE 24.362 32.372 39.891 MRE 12.35% 16.93% 20.45% RMSE 36.273 8 46.129 52.431

## 参考文献 原文顺序 文献年度倒序 文中引用次数倒序 被引期刊影响因子

[J]. 大数据, 2019,5(4): 113-120.

ZHANG Z , HUANG Q Y , FENG C .

Research and practice on traffic big data application system of urban intelligent transportation in Guangzhou

[J]. Big Data Research, 2019,5(4): 113-120.

JONATHAN M , JOHN F , ROCCO Z .

An evaluation of HTM and LSTM for short-term arterial traffic flow prediction

[J]. IEEE Transactions on Intelligent Transportation Systems, 2019,20(5): 1847-1857.

[J]. 交通运输系统工程与信息, 2017,17(5): 68-74.

LUO W H , DONG B T , WANG Z S .

Short-term traffic flow prediction based on CNN-SVR hybrid deep learning model

[J]. Journal of Trans-portation Systems Engineering and Information Technology, 2017,17(5): 68-74.

ZHANG Y Y , HUANG G .

Traffic flow prediction model based on deep belief network and genetic algorithm

[J]. IET Intelligent Transport Systems, 2018,12(6): 533-541.

[J]. 软件学报, 2019,30(3): 759-769.

FENG N , GUO S N , SONG C ,et al.

Multi-component spatial-temporal graph convolution networks for traffic flow forecasting

[J]. Journal of Software, 2019,30(3): 759-769.

SUN B , CHENG W , PRASHANT G ,et al.

Short-term traffic forecasting using self-adjusting k-nearest neighbours

[J]. IET Intelligent Transport Systems, 2018,12(1): 41-48.

WU Y K , TAN H C , QIN L Q ,et al.

A hybrid deep learning based traffic flow prediction method and its understanding

[J]. Transportation Research Part C:Emerging Technologies, 2018: 166-180.

CUI Z Y , KE R M , WANG Y H .

Traffic graph convolutional recurrent neural network:a deep learning framework for network-scale traffic learning and forecasting

[J]. IEEE Transactions on Intelligent Transportation Systems, 2020,21(11): 4883-4894.

HAO P , WANG H F , DU B W ,et al.

Spatial temporal incidence dynamic graph neural networks for traffic flow forecasting

[J]. Information Sciences, 2020,521: 277-290

[J]. 大数据, 2020,6(6): 105-118.

CHEN X , WANG Y H , DAI Z ,et al.

Research on demand identifica-tion for customized bus based on multi-source mobility data

[J]. Big Data Research, 2020,6(6): 105-118.

HU Y C , LU X B .

Learning spatial-temporal features for video copy detection by the combination of CNN and RNN

[J]. Journal of Visual Communication and Image Representation, 2018,12(6): 533-541.

[J]. 智能科学与技术学报, 2019,1(4): 392-399.

LIU W H , LI Y D , WANG T ,et al.

Transportation scene recognition based on high level feature representation

[J]. Chinese Journal of Intel-ligent Science and Technology, 2019,1(4): 392-399.

[J]. 计算机研究与发展, 2020,57(8): 1715-1728.

DU S D , LI T R , YANG Y ,et al.

A sequence-to-sequence spa-tial-temporal attention learning model for urban traffic flow predic-tion

[J]. Journal of Computer Research and Development, 2020,57(8): 1715-1728.

MA X L , TAO Z M , WANG Y H ,et al.

Long short-term memory neural network for traffic speed prediction using remote microwave sensor data

[J]. Transportation Research Part C:Emerging Technologies, 2015,54: 187-197.

ZHANG Y , XIN D R .

Dynamic optimization long short-term memory model based on data preprocessing for short-term traffic flow prediction

[J]. IEEE Access, 2020: 91510-91520.

GA-LSTM 模型在高速公路交通流预测中的应用

[J]. 哈尔滨工业大学学报, 2019,51(9): 81-87,95.

WEN H Y , ZHANG D R , LU S Y .

Application of GA-LSTM model in highway traffic flow prediction

[J]. Journal of Harbin Institute of Technology, 2019,51(9): 81-87,95.

ZHANG L Z , NAWAF R A , LUO G C ,et al.

A hybrid forecasting framework based on support vector regression with a modified genetic algorithm and a random forest for traffic flow prediction

[J]. Tsinghua Science and Technology, 2018,23(4): 479-492.

[J]. 交通运输系统工程与信息, 2020,20(2): 204-210.

ZHANG Y , YANG S M , XIN D R .

Short-term traffic flow forecast based on improved wavelet packet and long short-term memory com-bination model

[J]. Journal of Transportation Systems Engineering and Information Technology, 2020,20(2): 204-210.

[J]. 交通运输系统工程与信息, 2019,19(4): 130-134,148.

FU C H , YANG S M , ZHANG Y .

Promoted short-term traffic flow prediction model based on deep learning and support vector regres-sion

[J]. Journal of Transportation Systems Engineering and Informa-tion Technology, 2019,19(4): 130-134,148.

/

 〈 〉