VIETNAM NATIONAL UNIVERSITY HOCHIMINH CITY UNIVERSITY OF INFORMATION TECHNOLOGY ADVANCED PROGRAM IN INFORMATION SYSTEMS HOANG MINH PHAT CAO THANH NGAN TRAFFIC JAMS PREDICTION USING MACHINE LEARNING BACHELOR OF ENGINEERING IN INFORMATION SYSTEMS HO CHI MINH CITY, <2021> NATIONAL UNIVERSITY HOCHIMINH CITY UNIVERSITY OF INFORMATION TECHNOLOGY ADVANCED PROGRAM IN INFORMATION SYSTEMS HOANG MINH PHAT - 17520876 CAO THANH NGAN - 17521308 TRAFFIC JAMS PREDICTION USING MACHINE LEARNING BACHELOR OF ENGINEERING IN INFORMATION SYSTEMS THESIS ADVISOR Ph. DO TRONG HOP HO CHI MINH CITY, <2021> ASSESSMENT COMMITTEE The Assessment Committee is established under the Decision. " by Rector of the University of Information Technology —. - Member ACKNOWLEDGMENTS Firstly, our group would like to thank the university and the subject for creating the opportunity for us to study and work with the thesis, always creating the best conditions for students to complete the process well do the thesis.
Next, we would like to express my sincere thanks to Mr. Do Trong Hop, our thesis advisor. He has devotedly guided and instructed with clear directional analysis for the group during the progress of the thesis implementation, which is the premise for the group to complete the thesis stages on time. He also created the most favorable conditions possible with the necessary documents related, answering questions when the group encountered difficulties.
And finally, thank all members in the group for sharing the work, fulfilling the individual's responsibility throughout the implementation process with the guidance of the advisor. During one semester of the thesis, the team applied the accumulated foundations and combined them with learning and researching new knowledge. From there, make the best of what you have collected to complete a report of the best thesis. Although we have tried to complete the topic with all efforts, of course, we still make mistakes, shortcomings in the topic, hope to receive your sympathy and comments to help the group.
Ho Chi Minh City, December 2021 Hoang Minh Phat Cao Thanh Ngan cso ACKNOWLEDGMENTS. 5 5< << HH0 i TABLE OF CONTENTS. LIST OF FIGURES .cccesessssssesesessssscesesesscseeesesesessesesesesesaeseseseensesseseeesneneseeeeeeeeee iv ABSTRACT1. ccccsesssesesessssssesssssssscsessssssssssesesssssessesesssssssssesesassssesesesessseesesnessesersnseeas ix Chapter 1 PROBLEM STATEMENT.4 Aims and Objectiv Scope Of thesis.
The structure of the theSis.---- + +xec++c+ccr+ WN w Chapter 2 THEORETICAL BACKGROUND AND LITER REVIEW + 2. eects ¿+ ++x++keEkE+k+keEkeEkeEkekkrkerkrkkrkerkee Sesnou+x 2.1 Time series analysis.2 Time series prediction.1 Related work with the parametric methods.2 Related work with the non-parametric methods Chapter 3 METHODS »ơ 3.1 Autoregressive Integrated Moving Average (ARIMA) 3.2 Long short-term memory (LSTM). 0tr ưu Chapter 4 EXPERIMENT AND RESUL/T.- «5< se5se5ssessesses 22 4.3 Data pre-processing .1 Original dataset desCTIDtIOn.2 New dataset deSCTID(IONI. - 5 tt vn ưưn 44 ARIMA model.1 ARIMA model building.2, ARIMA model error metric 4.1 LSTM model building.2 LSTM model error metric.
The heat map.2 Heat map drawing.8 Applicability in Ho Chi Minh. ceceeseeeeneeeeseeseeseseeseeseseeeseeseencseesees Chapter 5 SUMMARY .ccssessesssssssssesscssesssssscsssencssessncssesscsncssessessnsessssceseesecsneensesceseeseesnees 60 iii LIST OF FIGURES cs Le Figure 1. Traffic jams on a highway [1]. A univariate time series dataset [2].
ce cececceseeseeseeeeeeececeeeeeeeeeeeeeeneeaes 5 Figure 2. A Multivariate time series dataset [2]. Structure Of RÌNN. k1 HT nh HH TT HH go nh nàng, 17 Figure 3.
Workings of LSTMs in RNN [7]. The forget gate layer [Í7],. ng ren 19 Figure 3. Update the value for the state cell [7] .- s6 <sxxsx+sesexsexseseesrses 19 Figure 3.
New status state 001. Adjust the output information through the tanh function [7]. General DFOC©SS. óc 2t 123 11191211911 11T HT HT TH HT ngàn 23 Figure 4.- -- ¿+ + + +24 E 1+3 E1 E11 1 TY HH ng giết 24 Figure 4.- --- c3 21111191111 1135 11 11 1 01 g1 HT nàn ràng, 25 Figure 4.
The average speed of ID 204 on 1 day before & after handling. The average speed of ID 204 on 1 week before & after handling. The average speed of ID 204 on 1 month before & after handling. Seasonal_decompose of ID 204.
--- 5s + ng re 3l Figure 4. ADF and KPSS of ID 244. --- 2+ + St E3 + EEkrekrkrerrerrrrrrree 31 Figure 4. ADF and KPSS after making a difference of ID 204.
The ACF and PACE of ID 204 ooo. Auto_arima results Of ID 204. ec cicsecsecseeeeeeseeseesecseceeeeeeeaeeneeseeaeens 33 Figure 4. ARIMA model summary after training of ID 204.
Forecast and Actual speed of ID 204 by ARIMA. Forecast and Actual speed in 30 minutes of ID 204 by ARIMA. Forecast and Actual speed in | hour of ID 204 by ARIMA. Forecast and Actual speed in 12 hours of ID 204 by ARIMA.
Forecast and Actual speed in 1 day of ID 204 by ARIMA. Forecast and Actual speed in 1 week of ID 204 by ARIMA. The ARIMA prediction errors in other times of ID 204. The ARIMA prediction error for 30 minutes in 5 areas.
The ARIMA prediction error for 1 hour in 5 areas. The ARIMA prediction error for 12 hours in 5 areas. The ARIMA prediction error for 1 day in 5 areas. The ARIMA prediction error for 1 week in 5 areas.
LSTM training processing. LSTM model summiaty. Prediction and Actual speed in 30 minutes of ID 204 by LSTM. Prediction and Actual speed in | hour of ID 204 by LSTM Figure 4.
Prediction and Actual speed in 12 hours of ID 204 by LSTM. Prediction and Actual speed in | day of ID 204 by LSTM. Prediction and Actual speed in 1 week of ID 204 by LSTM. The LSTM prediction errors in other times of ID 204.
The LSTM prediction error for 30 minutes in 5 areas. The LSTM prediction error for 1 hour in 5 areas. The LSTM prediction error for 12 hours in 5 areas. The LSTM prediction error for 1 day in 5 areas.
The LSTM prediction error for 1 week in 5 areas. The traffic density at an area of five IDs. The traffic density at an area of ID 204. The traffic density at an area of ID 205.
The traffic density at an area of ID 206. The traffic density at an area of ID 207 Figure 4. The traffic density at an area Of ID 208.------- --:-c+cc<ccece+ 7 LIST OE TABLES œELlb Table 4. Definition of the đataS€T.
- 5-5 St TH HH hờn 25 Table 4. ARIMA model library. The area has the least and most prediction error in 30 minutes. The area has the least and most prediction error in 1 hour.
The area has the least and most prediction error in 12 hours. The area has the least and most prediction error in 1 day. The area has the least and most prediction error in 1 week. Library of LSTM model.
Table of parameters of the LSTM modđel. The area has the least and most prediction error in 30 minutes. The area has the least and most prediction error in 1 hour. The area has the least and most prediction error in 12 hours.
The area has the least and most prediction error in | day. The area has the least and most prediction error in | week. 5Ö vi LIST OF ACRONYMS AND ABBREVIATIONS No. |Acronyms Meaning 1 ACF Automatic Correlation Function 2 ADF Augmented Dickey-Fuller test 3 AR Moving Average 4 ARMA Autoregression Moving Average 5 ARIMA | Autoregressive Integrated Moving Averages 6 CNN Convolutional Neural Network 7 ES Exponential Smoothing 8 GP Gaussian Process II ITS Intelligent Transportation System 12 KNN K-Nearest Neighbors 13 KPSS Kwiatkowski- Phillips- Schmidt- Shin 14 IACF Inverse Autocorrelation Function 15 LSTM Long-Short Term Memory model 16 MAE Mean Absolute Error 17 MAPE Mean Absolute Percentage Error 18 ML Machine Learning 19 MLP Multilayer Perceptron 20 PACF Partial Autocorrelation Function 21 RMSE Root Mean Square Error 22 RNN Recurrent Neural Networks Vii 23 | SARIMA | Seasonal Autoregressive Integrated Moving Average 24 SVM Support Vector Machine 25 SVR Support Vector Regression 26 TMC Traffic Management Cente Vili ABSTRACT Traffic congestion is a big problem that directly affects people's lives in big cities around the world.
Therefore, traffic speed prediction is known as an important but challenging problem. Moreover, forecasting traffic volume in a short time is also a premise for the sustainable development of the transport industry. Currently, applying basic machine learning to build models produces good accuracy, but more than that, we still need to apply deep learning to improve prediction accuracy even more. This report applies Autoregressive Integrated Moving Average models (ARIMA) and deep learning-based algorithm Long Short-Term Memory (LSTM).
The data was collected for the highway. In this study, to ensure the data quality to be trained in our models and increase the model performance, the mean method on the same hours has been used to calculate and substitute the zero values. This report proposes two models including the traditional Autoregressive Integrated Moving Average (ARIMA) and stacked LSTM for highway prediction. Two popular metrics, including Mean Absolute Percentage Errors (MAPE) and Root Mean Squared Error (RMSE), have been used to evaluate the prediction efficiency.
Finally, we show the density of traffic on the heat map. 1X Chapter l PROBLEM STATEMENT 1.1 Rationale In recent years, traffic prediction is a worrying problem in big cities. Traffic congestion causes people to waste time, fuel and become mentally tired. If this situation persists and the amount of congestion becomes larger and larger, it will affect the economy and cause environmental pollution.
The causes leading to traffic jams as accidents on the road, bad weather, unfinished infrastructure, etc. We want to mention the most important reason is the sharp decrease in vehicle speed and vehicle density increases rapidly in the network of major roads at fixed times of the day such as after working hours, holidays, etc. Traffic prediction, especially in the short term, is done by evaluating various traffic parameters. Most studies focus on historical data in traffic congestion forecasting.
Predictive models need real-time data sets collected by sensors fixed at major roads for better prediction performance. Understanding traffic congestion for vehicles is the key to efficient mobility and high-quality traffic safety and management systems. A more empirical approach tells us that road congestion occurs due to sudden breakdowns. Vehicle speed decreased sharply and vehicle density increased instead of the original road as a highway.
A traffic model is needed to explain the empirical characteristics of traffic incidents and consequent congestion. To explain this, a large number of models and theories have been developed.2 Aims and Objectives This thesis aims to study and discuss traffic flows using conventional machine learning and analytical techniques and build on them a more accurate, if ineffective, model to predict traffic flow and traffic congestion based on available data sets. We divide the implementation process into different phases. Firstly, we research based on general background knowledge about time series and prediction.
Secondly, we learn about methods and models that have been developed by researchers in the past. Next, we find and filter the dataset based on matching criteria. Then, we choose the appropriate technique and model to apply to our data set to predict and draw conclusions based on the prediction results. Finally, we display the results better on the heat map to clearly and visually show the results achieved.
From there, our objectives for each section are as follows: e Part 1: Understanding time series, forecasting time series. e Part 2: Learn predictive models including non-parametric, parametric, neural networks used in traffic prediction. e Part 3: The data set has at least the following intimate elements: The speed between the beginning and the end of the measurement point, the time series continuously updated by date, time, coordinates of the point used to measure the sensor, velocity. e Part 4: Choose two models to apply the prediction.
e Final part: Average speed is predicted, the better result is shown on the heat map.