Nothing Special   »   [go: up one dir, main page]

Review Paper On Traffic Flow Simulation On Python

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

A review of Traffic Flow Simulation on Python

Ishant Saugat

Abstract—Traffic flow prediction has a wide range of applications in urban transportation and area
management. It is extremely difficult to regulate traffic in large cities. However, predictions that take
into account some physical aspects of the environment and weather are proven to be more successful.
In this work, we created a traffic flow prediction system model to forecast traffic data from 1 hour to
24 hours. The prediction algorithms have been employed for research in the past, but there aren't
many sites where general users may easily get traffic flow prediction. The system is intended to
address the issues related with historical and time series data. Past Traffic data set was obtained from
an open source and cleansed as needed. A system is built utilising Machine learning algorithms that
collects data from the highways using Vehicle detection sensors and saves it in a database for future
predictions. To obtain weather data, we also incorporated the API of weather services. This traffic
flow prediction model is intended to employ the two most common machine learning prediction
methods, Artificial Neural Network (ANN) and Support Vector Machine (SVM) (SVM).  The
outcomes of the trials were compared to the actual data to determine the correctness of the algorithms.
We discovered two algorithms that are more beneficial to our planned system. Long-term data
prediction is aided by artificial neural networks. In short-term prediction scenarios, Support Vector
Machine (SVM) can aid. However, a shorter time frame produces more accurate findings. The traffic
data is collected hourly from 1 hour to 24 hours. This technology, which is based on vehicle detecting
sensors that collect data from the roadways, may also provide live traffic statistics. The algorithm
examines data from all routes to find the city's most populous roads.
Keywords — Artificial Intelligence, ANN (Artificial Neural Network), LSTM (Long short-term
memory), Machine Learning, SVM (Support Vector Machine).

--------------------- ♦ ---------------------
1. INTRODUCTION the spot and helps the users to plan their
routes according to the situations on the
The prediction of traffic flow has been
road but the main problem to get
explored multiple times using various
information about traffic flow which are
machine learning algorithms. In this study,
not well equipped with traffic sensors. In
we conducted a survey of many
general, there are two types of traffic flow
researchers and the approaches utilised for
prediction: short term and long term. Long
prediction. Many algorithms perform
term algorithms may not provide accurate
admirably on the supplied data sets. These
prediction results because they predict on
data sets were gathered from various
an hourly basis, such as 12 hours or 24
sources.
hours data results, whereas short term
Many applications have been introduced to mechanisms provide better results because
guide the public on the road to get accurate they provide results in terms of minutes,
information about current and future traffic such as 5 to 15 minutes or 30 to 50
flow such as vehicle navigation devices, minutes. As a consequence, our model was
congestion management, vehicle routing, trained at a maximum time period of one
and many more application have been hour to provide prediction results. We used
introduced to guide the public on the road several scholars' contributions in this
but the problem is to get real-time data on machine learning domain to train our
prediction model, which we detailed in the significant advances in recent years. By
literature review section. To address all of utilising modern technology, intelligent
these issues, numerous researchers use transportation systems aid in increasing the
various machine learning techniques to capacity of the road traffic system and
forecast traffic flow. resolving all traffic difficulties. To obtain
increased mobility, ITS must apply for
usable transportation infrastructure. One of
1.1 Purpose of Traffic Flow Prediction the most important demands of ITS is the
ability to forecast traffic. There are three
The majority of traffic data reports are sorts of data in a traffic system: historical
real-time, but this is not always the case data, current data, and short-term
since we need this report to decide which computed data. [2] the capacity to forecast
route to take. Assume we are travelling to transportation parameters such as speed,
the office during working hours and we journey duration, or flow based on real-
look at traffic statistics to choose the best time and historical data acquired by
or shortest route to our destination, but different vehicle detector sensors Traffic
traffic congestion occurs. When the factors such as volume, speed, density,
problem of getting real-time traffic travel duration, headways, and so on must
information arises, how might forecasting be predicted in traffic planning and design
help to address it? It may be excellent, but operations. In the literature, several
what factors might influence traffic approaches for predicting traffic
conditions? We must investigate. Many parameters have been published, including
factors can have an impact on traffic time series analysis, real-time methods,
conditions. The current and ancient traffic historical methods, statistical methods, and
conditions can be considered to predict machine learning, among others. It is
these suggestions are very simple, if traffic critical to understand the working process
is so heavy right now, it is also acceptable behind each of these strategies in order to
that after ten or twenty minutes the traffic comprehend their limitations and benefits.
situation would be the same ancient traffic [3]. With the use of information
situation, we have indicated the traffic technology, transportation management
situation on the same day and time, for and crowded areas of the municipal
example, traffic condition on two Mondays management department have taken a keen
remains the same at 9 o'clock. Different interest in traffic flow forecast. [4] The
weekdays and weekends may react purpose of traffic flow forecasting is to
differently in traffic scenarios, and they provide real-time transportation data.
may also have an impact on traffic Whatever the optimization, traffic on city
conditions. There have been several roads becomes complicated and difficult to
collaborative attempts to improve and handle, so such systems are insufficient for
alleviate traffic congestion; nonetheless, prediction; consequently, traffic flow
there are still many opportunities for prediction research is crucial in ITS
development. A dedicated traffic routing systems and traffic management systems.
system in cooperation might help to reduce
traffic congestion and transportation costs.
With the rising expense of petroleum, an
effective routing system to alleviate traffic
1.2 Problem statement
congestion is critical. [1]. Intelligent To overcome the issues associated with
transportation systems (ITS) have made historical and time series data, we
developed a traffic flow prediction model outperforms shallow machine learning
using machine learning approaches such as methods.
SVM and ANN. Using these algorithms,
we created a UML-based prediction
system in which users can interact with the 2.2 Artificial neural network
system and collect information about the (ANN) in traffic flow prediction.
current traffic situation as well as check
the traffic flow from 1 to the next 24 hours It is difficult to overcome the limits of
of a day with a 1-h time interval. In this constant models due to the random and
way, they can learn about the weather nonlinear properties of traffic flow.
effects and road conditions, as well as how Statistic machine learning methods
much traffic will be on which road in the eventually become the norm. The most
next 24 hours. They can also see accident prominent and currently used approach in
records of how many vehicles have been analysis is the non-constant technique.
involved in accidents on which road, so Artificial neural networks (NN) are
our system can help them plan which route commonly used to address this issue,
or road to take to make their travel easier. which may be thought of as the general
pattern of a machine learning system in
traffic engineering. Smith and Demetsky
2 Related works created a NN model that was compared to
traditional prediction methods, and their
A great deal of effort has been done in results show that the NN outperforms
traffic flow prediction using various other models at peak conditions.
methodologies and technology. Many Dougherty et al. investigated the back-
scenarios have been covered in this study propagation neural network (BPNN) for
in conjunction with the related work of traffic flow, speed, and occupancy
machine learning techniques. prediction, and the findings indicate some
promise. Since then, NN methods have
often been employed to forecast traffic
2.1 Machine learning approaches flow. Several hybrid NN models are also
proposed to boost performance.
Someone has created LSTM-based Alternative statistical methods, such as -
prediction models utilising machine nearest neighbour (NN) models and
learning methodologies that include support vector regression, have also been
structure design or network training investigated [11]. Kunde, Felix Alexander
design, prediction, and prediction
Hartenstein and others .[12] Feed device
implication. Another objective is to use
knowledge to an Artificial Neural Network
deep learning approaches to cope with
(ANN), although some researchers utilise
prediction mistakes that may occur
ANN with entirely distinct spatial and
throughout the prediction process.
temporal holdups to seek out an ideal
The stated approach was used to large configuration for a full municipality. They
amounts of data obtained from the must operate on a sensor network that is
performance measurement system scattered throughout a city and obtain the
(PEMS). The trials reveal that the LSTM simplest findings after all sensors'
model has a wide range of capabilities and measurements are encapsulated. When
combined with sequencing data, the
prediction improved just significantly. to remember that long-term learning is a
Working with RNNs is ideal for statistical normal behaviour of LSTM. It is not a
analysis due to their ability to tell short and capability to pay at a premium. [18].
lengthy sequences. [13]
3 Methodologies
2.3 Deep Learning models based
Many strategies have been examined over
on machine learning approaches time, however in this study, we employ
Many research show that the LSTM model two existing methods for traffic flow
is more competent and workable than prediction. The first is called a support
shallow machine learning prediction vector machine (SVM), while the second
models. Machine learning has made is called an artificial neural network
several contributions to big data, a few of (ANN) (ANN).
which are listed here
4 Coding
1. Machine learning is used to solve large
Pygame Installation
data prediction challenges. Machine
learning has been used in image Python 3.1+ must be installed on your
identification, medical diagnosis, financial system before installing PyGame. Python
analysis, and a variety of other domains. It may be downloaded from this page. Pip is
is possible to rely on computational tools the simplest way to install Pygame. Simply
to learn and forecast traffic flow run the command below in cmd/Terminal.
components. Big data theory has the
$ pip install pygame
potential to supply sample data sources for
machine learning. Real-time traffic flow Importing the necessary libraries
may be forecasted using a large number of
We begin by creating a file called
data samples. [18].
'simulation.py' and importing the libraries
2. For the first time, machine learning- needed to construct this simulation.
based learning is being used to big data-
import randomimport
driven traffic flow prediction. Prior to this
timeimport
method, the shallow conducted several threadingimport
experiments for short-term traffic flow pygameimport sys
forecast. However, predicting performance
may vary due to the continuous undefined
data sample. Deep learning's stability and Defining constants
convergence reigned supreme. [18]. Next, we specify certain constants that
3. The deep learning-based LSTM network will be utilised in the simulation's car
topology varies from deep learning movement and control of traffic light
models. RNN may be used to transmit timings.
earlier information to the current situation, # Signal timer default values
but if information gaps widen, it may lose in seconds
the capacity to learn broad data. In
comparison to RNN, LSTM can learn green default = 0:20, 1:20,
long-term dependent data, and LSTM can 2:20, 3:20
avoid long-term dependency difficulties
through suitable structuring. It is important standardRed = 150
standardYellow = 5 It has been determined in the system that
we create the traffic flow prediction
[] signals system utilising a traffic flow prediction
algorithm. By combining two current
numberOfSignals = 4
prediction algorithms, ANN and SVM. We
current Green = 0 # Indicates
attempt to use these models in our system
which signal is now green.
in order to provide the best prediction
result on the built system.
currentGreen + The public may gain various benefits from
(currentGreen+1)%noOfSignals utilising this technology since users can
nextGreen see what the present traffic flow situation
is and what the traffic flow situation will
be after one hour.
Yellow = 0 # Indicates
This device also assists in monitoring the
whether the yellow signal is
road's meteorological conditions. In
turned on or off.
addition, users may look at accident
records to see how many accidents have
happened on certain roads and which are
speeds = 2.25 for a vehicle,
safe for future drives. In the future, we
1.8 for a bus, 1.8 for a
may enhance this system by predicting
truck, and 2.5 for a bike #
traffic congestion, and many other aspects
Average vehicle speeds
that impact management and traffic flow
and more… can be considered by applying many
different deep learning approaches, as well
as the user, who can use the system to
Running the code discover the shortest route to their
It's finally time to check the findings. destination. The system can make
Open a command prompt/terminal and suggestions to the user based on their
enter the following command: search.

6 References
[1] Traffic Flow Prediction Parameter
Identification Department of Industrial
Engineering, Kasetsart University, Thailand,
Anuchit Ratanaparadorn
AnuchitRatanaparadorn,SasivimolMeeampol,
ThaneeratSiripachana,Pornthep,Anussornnitis
a rn,19-21-2013,Croatia,international
conference

[2] A. Krizhevsky, I. Sutskever, and G. E.


Hinton, "Imagenet categorization using deep
convolutional neural networks," NIPS 2012,
pp. 1097-1105.
5 Conclusion
[3] H. Mliki, L. Chaari, L. Kamoun, and B. Science and Information Engineering, National
Cousin. For multicast communication, an Taiwan University of Science and Technology,
improved ethernet congestion control system Taipei
is used. Trans Emerging Telecommunications
[11] Traffic Flow Prediction with Rainfall
Technology. 2016;27(11):1563-1579.
Impact Using a Deep Learning Method, Yuhan
[4] Azzouni, A., and G. Pujolle. A long short- Jia, Jianping Wu, and Ming Xu, Journal of
term memory recurrent neural network Advanced Transportation, 2017.
architecture for network traffic matrix
Felix Kunde [12] Hartenstein, Alexander
prediction. Comput Sci. 3(6):18-27, 2017.
Pieper, Stephan Mrs. Petra Sauer, CEUR-
[5] G. E. Hinton, S. Osindero, and Y. W. Teh, "A WS.org, 2017. Traffic forecast using a Deep
rapid learning method for deep belief Learning paradigm.
networks," Neural Computation, vol. 18, no. 7,
[13] E. I. Vlahogianni, M. G. Karlaftis, and J. C.
pp. 1527-1554, 2006.
Golias. A Genetic Approach to Optimized and
[6] Shaohua, Xu, XueJiwei, and Li Xuegui, "A Meta-Optimized Neural Networks for Short-
Sparse Auto Encoder Deep Process Neural Term Traffic Flow Prediction. Part C: Emerging
Network Model and its System," International Technologies, Transportation Research Part
Journal of Computational Intelligence 13, No. 3, 2005, pp. 211-234.
Systems, vol. 10, no. 1, pp. 1116-1131, 2017.
[14] A Survey of Big Data-Based Vehicle Traffic
[7] G. Bao, Z. Zeng, and Y. Shen. Memristive Flow Prediction Algorithms Using Deep
recurrent neural network region stability Learning S.Narmadha1, Dr.V.Vijaya Kumar2,
study and tracking control. Neural Networks Sri Ramakrishna College of Arts and Science
5(1):74-89, 2017. (Autonomous), 2017.

[8] Deep learning for detecting routing threats [15] X. Jiang and H. Adeli. Dynamic Wavelet
in the internet of things. Yavuz F Y, ünal D, Gül Neural Network Model for Forecasting Traffic
E. International Journal of Computational Flow 771-779 in Journal of Transportation
Intelligence Systems, Vol. 12, No. 1, pp. 39-58, Engineering, Vol. 131, No. 10, 2005.
2018.
[16] E. I. Vlahogianni, M. G. Karlaftis, and J. C.
[9] Peiqin Li, JianbinXie, Wei Yan, Zhen Li, and Golias. A Nonlinear Dynamics Approach to the
GangyaoKuang, "Living Face Verification Using Temporal Evolution of Short-Term Urban
Multi-CNNs," International Journal of Traffic Flow 536-548 in Computer-Aided Civil
Computational Intelligence Systems, 12(1): and Infrastructure Engineering, Vol. 23, No. 7,
183-189, 2018. 2008.

[10] A Hybrid Method for Forecasting Traffic [17] A Machine Learning Approach to
Flows Using Multimodal Deep Learning Predicting Short-Term Traffic Congestion in a
ShengdongDu1, Tianrui Li1,*, Xun Gong1, and Connected Environment National Academy of
Shi-Jinn Horng2 1 School of Information Sciences: Transportation Research Board
Science and Technology, National Engineering 2018. AmrElfar1, Alireza Talebpour2, and Hani
Laboratory of Integrated Transportation Big S. Mahmassani1.
Data System Technology, Southwest Jiaotong
[18] Traffic flow prediction using big data and
University, Chengdu 611756, China 2
machine learning 2018 Fanhui Kong1, Jian Li1,
Department of Computer Science and
Bin Jiang2, Tianyuan Zhang3, Houbing Song3.
Information Engineering, National Taiwan
University of Science and Technology, Taipei
10607, Taiwan 3 Department of Computer

You might also like