Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Research Work

Download as pdf or txt
Download as pdf or txt
You are on page 1of 171

ABSTRACT

Traffic congestion is a major problem in most cities all over the world and it influences
urban communities in diverse ways including loss of valuable time, delayed deliveries,
monetary losses, fuel wastage, vehicle wear and tear, and stress levels. Existing practice
of using hands to control traffic by Traffic warders/managers lacks analysis capabilities.
This study focused on developing predictive model for road traffic congestion for
effective traffic management on Nigeria roads.

The study utilized a multi-phase methodology, starting with identification of parameter


through consultations with traffic managers/warders. Subsequently, qualitative aspect
of dataset was collected from the Federal Road Safety Corps (FRSC) office while
quantitative aspect was collected by developing google form (sentiment approach) for
those that reside in those areas and road users that are plying those roads. The core
methodology featured sampling the dataset with SMOTE algorithm in order to
overcome overfitting problem posed by random oversampling; two machine learning
algorithms(ML): (Decision Tree and Random Forest) and two deep learning algorithms
(DL): (Long Short Term Memory Recurrent Neural Network and Deep Neural
Network) were used to formulate predictive models. The formulation and simulation of
the predictive models were carried out using Python Google Colab environment. All
models underwent evaluation using an 80-20 train-test split, with performance assessed
through multiple metrics including accuracy, precision, F1 score, recall, and specificity.

The results showed that LSTM-RNN model demonstrated superior overall


performance, achieving an accuracy of 99%, which was statistically significant (p <
0.05) compared to Deep Neural Network (98%), Random Forest (82%) and Decision
Tree (79%). Regarding the precision, the LSTM-RNN model had highest performance
compared to Deep Neural Network, Random Forest and Decision Tree models. With
respect to the recall, LSTM-RNN model had highest performance compared to Deep
Neural Network, Random Forest and Decision Tree models. In terms of F1-Score, the
Deep Neural Network model had highest performance compared to LSTM-RNN,
Random Forest and Decision Tree models. With regards to Specificity, Deep Neural
Network model had highest performance compared to Decision Tree, Random Forest
and Long Short Term Memory Recurrent Neural Network models. Decision Tree model
had fastest execution time compared to Random Forest, Deep Neural Network and
Long Short Term Memory Recurrent Neural Network models. Notably, both DNN with
SMOTE and LSTM-RNN with SMOTE outperformed other models in terms of
specificity scores.

It is concluded that the developed predictive model for road traffic congestion
effectively addressed the challenges of the situation in Nigeria. This was demonstrated
through prototype web and mobile applications for real-time transportation data
analyzing. It is therefore recommended that the model should be integrated into existing
traffic policies which would capture monitoring and tracking of information that are
1
associated with factors causing congestion. Finally, the implementation of this model
would provide valuable reference for decision-making in metropolitan traffic
congestion solutions.

Keywords: Traffic Congestion, Decision Tree, Random Forest, Deep Neural Network,
LSTM-RNN

Word Count: 490

2
CHAPTER ONE

INTRODUCTION

1.1 Background to the Study

Traffic management is a major concern in most cities of the world as a result of

incessant traffic congestion. Traffic congestion occurs when the number of vehicles

increase beyond the road capacity (Taiwo et al., 2023). This leads to loss of valuable

time, vehicle wear and tear, high consumption of fuel and accidents (Taiwo et al.,

2023). To decrease ongoing problem in real-time response, timely prediction

information is necessary. Traffic data are increasing daily, and their analysis is majorly

concerned with bringing out predictions of future data. One crucial step in the operation

of an intelligent transportation system (ITS) is an accurate traffic prediction system

because it will assist traffic managers in the area of route planning and traffic

regulations (Jiber et al., 2020). Ramchandra & Rajabhushanam (2021) described traffic

congestion as the condition in transport network that is characterized through slower

speed of vehicles.

According to Adetiloye (2018), traffic congestion is a state in transport network

wherein the expanded use of road by vehicles in traffic streams generates slower vehicle

speeds, time delays as well as a complete paralysis of the traffic network. As a result of

increase in population and the number of private cars in this contemporary age, traffic

congestion has turned out to be considerably worse, not only causing economic losses,

but also leading to environmental damages (Yinan et al.., 2017). Li et al. (2020)

asserted that the only remedy for traffic congestion is prevention, that is, to forecast the

changing trend of the traffic situation due to the current traffic flow information and

offer early caution of feasible congestion.

3
The increased number of vehicles each day has made traffic congestion in big

cities unavoidable most especially in peak hours. However, the improvements in

Artificial Intelligence (AI) techniques can solve this difficulty by analyzing and

learning the traffic flow patterns and forecasting traffic situation at any point in a given

time (Wafa et al., 2019). Zhu et al. (2016) noted that drivers need traffic information

that can affect their driving to a certain extent. This will assist them in traffic flow state

in the upstream and downstream of the road network. Whenever congestion occur in a

city traffic network, due to increasing traffic flow it will spread through road networks.

As rightly observed by Adekanmbi (2018), traffic congestion is one of the main severe

issues in any city, and can be predicted earlier with the aid of using traffic flow patterns.

Such predictions are feasible through means of analyzing the real-time transportation

data from correlative roads and vehicles.

By virtue of present developments in the AI discipline and an exponential

increase in traffic historical data, AI sub-discipline known as Machine Learning (ML)

and ML sub-field known as Deep Learning (DL) have particular set of algorithms that

could be used to predict traffic congestion. ML is a branch of Artificial Intelligence that

permits computers to ponder and analyze on their own (Jafar et al., 2018). Ravi et al.

(2021) described ML as the utilization of artificial intelligence during which computer

learns from the input data and makes predictions. According to Alqudah and Yaseen

(2020), ML means that without being programmed computer is capable of bringing out

a solution i.e. machines can learn consistently and address large datasets with the use

of classifiers and algorithms. The fundamental support of ML are classifiers that

categorize observations even as algorithms construct models of behaviours based on

new input data and make use of them for predictions (Wang et al., 2019). ML is used to

resolve diverse problems that require getting to know (learning) on the part of the

4
machine. Therefore, ML solutions are data driven and based on the data fed to the

model, it uses algorithms to forecast expected results (Andrew and Parvathi, 2020).

There are three features of learning problem. These include task that must be learnt, the

process of gaining experience and performance measure to be enhanced. Deep Learning

(DL) is a subfield of machine learning that makes use of algorithms called artificial

neural networks (ANNs) that are capable of self-learning and inspired by the structure

and function of the brain (Inzunza et al., 2020). It means training an artificial neural

network (ANN) with a huge amount of data. In deep learning, the network learns by

itself and thus requires humongous data for learning. It is a crucial tool for AI research

with applications in numerous areas. It uses several layers of nonlinear processing units

for feature extraction and transformation (Wafa et al., 2019). Each successive layer uses

the output from the previous layer as input.

Traffic prediction is needed to manage congestion in the transport system. For

instance, some intelligent transport systems react to present day traffic situations and

introduce measures to reduce the effect of congestion. These include variable speed

limits on busy motorways and urban traffic control systems that assist to manage traffic

in complicated urban environments (Carl et al., 2015).

1.2 Statement of the Problem

Due to serious increment in traffic congestion and persistent occurrence of

traffic accidents on roads, traffic management has become more problematic and

challenging nowadays. In response to the increase in traffic demand and the pressure

on transportation resources, the traditional way of traffic control and management using

hands by traffic managers are no longer effective and efficient. Existing literature

showed that a wide range of methods have been used for road traffic prediction

(Odesanya and Odesanya, 2021). However, none of these studies has identified features

5
which are peculiar to Nigerian roads especially with numerous features that may

influence traffic congestion, such as rain, faulty vehicle, potholes, poor drainage and

accident to mention a few. There is need to provide a predictive model for traffic

congestion based on knowledge about relevant factors, hence this study. Therefore, this

study proposed an adaptive prediction model that excellently incorporates different

types of traffic conditions for Lagos state road networks. Tensorflow machine learning

framework was used to model congestion prediction system. Moreover, the study

presented a comparative study between the two traditional machine learning algorithms

and two deep learning including decision tree, random forest, deep neural network, and

LSTM using confusion matrix, accuracy, precision, recall, and F1 score as metrics

which were used for validating the model.

1.3 Objectives of the Study

This study seeks to develop a model for predicting traffic congestion for

effective traffic management on Lagos roads while the specific objectives were to:

i. elicit variables causing traffic congestion in Lagos and collect relevant data;

ii. formulate model for predicting traffic congestion based on the variables

identified in (i);

iii. simulate the model formulated in (ii);

iv. validate the model;

v. prototype the validated model for web-based and mobile applications.

1.4 Significance of the Study

The work is significant as the outcome will provide model and theoretical

information which could serve as guide that can be used by traffic managers for a

coherent traffic congestion handling and management policy. It could be integrated into

an existing traffic policy for the early detection of traffic congestion following the

6
monitoring and tracking of information that are associated with factors causing

congestion. The implementation of a predictive model for effective traffic congestion

management will provide valuable reference for decision-making in metropolitan

traffic congestion solutions. The study will also serve as guide to others researchers in

this field as the outcome filled the gaps found in the literature.

1.5 Scope of the Study

The scope of the study covered eliciting variables causing traffic congestion in

Lagos, formulating model to predict traffic congestion in Lagos state of Nigeria based

on the variables identified, simulating the model using Google Colab environment,

validating the model using evaluation metrics such as Accuracy, Precision, Recall,

Specificity and F1 Score and implemented a web and mobile based prototype for the

model.

1.6 Overview of Methodology

In order to achieve the aforementioned objectives, the methodology adopted

were:

i. formal interviews were conducted with traffic managers (Federal Road

Safety Corps and road traffic warders) regarding factors causing traffic

congestion in Lagos in order to create dataset for the prediction;

ii. the predictive model for traffic congestion was formulated using

(Decision Tree and Random Forest) machine learning algorithms and

(Deep neural network and LSTM-RNN) deep learning algorithms on the

Python environment of Google Colab following the identification of

factors causing traffic congestion found in (i);

7
iii. the model was simulated using Python programming language to apply

a percentage split approach of the data into a training dataset for building

the predictive model and a testing dataset to validate the model;

iv. the model was validated using evaluation metrics such as Accuracy,

Precision, Recall, Specificity and F1 Score;

v. LSTM-RNN model was adopted for integration into both mobile and

web-based applications by implementing a front-end interface using the

Streamlit framework and Python programming language.

1.7 Operational Definition of Terms

Development: It involves the creation of algorithms, models and systems that can learn

and make predictions based on data.

Traffic congestion: It is a condition in transport that is characterized by slower speed,

longer trip times and increased vehicular queuing.

Artificial Intelligence: It is the branch of computer science that deals with the

techniques that can simulate the capabilities of the human mind.

Machine learning: It is a branch of artificial intelligence that enables computer to

learn, adapt and perform the desired functions on their own.

Deep Learning: It is a subset of machine learning that is based on learning and

improving on its own by examining computer algorithms.

Dataset: It is a collection of data aggregation in a unique form.

Prediction: It is the estimation of the execution time of a program on a computer.

Model: It represents what was learned by learning algorithms. It is the output of a

learning algorithm run on data.

Classifiers: They are learning algorithms used to assign a class label to a data input.

They categorize observations.

8
Algorithm: It constructs model of behaviours and makes use of them for predictions

based on input data.

Simulation: It is the imitation of the operation of a real-world process.

Data Preprocessing: It is a method of cleaning and organizing raw data to make it

suitable for building and training learning models.

Traffic Managers: They plan and control traffic from one location to another.

1.8 Organization of Thesis

Chapter One provided the background and rationale for the study. Chapter Two

offered a comprehensive literature review. Chapter Three detailed the research

methodology was adopted. Chapter Four presented the results and discussion. Chapter

5 presented summary, conclusion and recommendations.

9
CHAPTER TWO
LITERATURE REVIEW

This chapter offers a comprehensive literature review, exploring existing

literature from machine learning methods to more recent deep learning techniques. It

highlighted the limitations of previous studies and established the need for features that

are peculiar to Nigerian roads.

2.1 Traffic Flow

Traffic flow is the rate at which vehicles pass through a given point on the road,

and it is normally calculated in terms of vehicles per hour. It is the interactions between

travellers and infrastructure, with the aim of developing an optimal transport network

with efficient movement of minimal traffic congestion problems. They are two types of

traffic flow. These include uninterrupted and interrupted. Vehicles traveling on an

interstate motorway are taking part in uninterrupted flow. Interrupted flow is regulated

through an external means, which include a traffic signal.

They are two main parts of traffic flow modelling approaches (Gerlough and

Huber, 1975). The first entails the specific modelling of the general traffic system itself

with the aid of using simulations that take traffic parameters into consideration. This

approach is basically built on the traffic flow theory foundations in which traffic models

are developed from mathematical equations and scientific theories to derive

relationships among variables including signalling, congestion, traffic density and flow

(Minev et al., 2018). This method considers traffic control measures in the prediction

process and tried to quantify traffic conditions in road networks (FHWA, 2001).

However, this approach when it has to do with computational complexity of model

prediction parameters, calibration of mathematical equations and lack of flexibility has

numerous drawbacks (Sun et al., 2019). These models cannot inherently learn latent

10
traffic patterns from traffic datasets but their prediction quality largely lies on the

quality of inputs that are manually determined (Vlahogianni et al., 2014). This research

focuses on the second technique that is characterized by data driven methods for traffic

prediction such as statistical methods and machine learning. Machine Learning

techniques bring out useful information between input features and output features and

learn patterns in traffic datasets to predict variables such as traffic speed, volume, flow

etc (Xie et al., 2020; Akçelik et al., 2000).

Traffic is measured along x and y axes respectively. Kerner (2009) opined that

traffic flow, vehicle density and speed of vehicles are calculated at a given time as

mentioned in equations 2.1, 2.2 and 2.3.


𝑑
𝑞= (2.1)
𝐴

𝑡
𝑘= (2.2)
𝐴

𝑑
𝑣= (2.3)
𝑡

where:

q is the flow of vehicles on the portion of a road per unit of time.

k is the vehicle density i.e. number of vehicles per unit length km of the road.

v is the speed of the vehicle. It measures link-travel distance per unit of time.

d denotes total distance travelled by the vehicles.

t represents total time spent by vehicles on a particular road segment.

A typifies area covered by the vehicle.

2.1.2 Traffic Prediction

Prediction is the process of identifying unavailable or missing data for a new

observation. In prediction, the accuracy value of a predicated attribute for new data

depends on how well a given predictor can guess. In the modern professional world,

prediction has many areas of application. Some examples include earthquake

11
prediction, weather forecasting, stock market forecasting, and of course traffic

prediction. When historic data features do not exist, prediction is usually done through

intuition, logic and experience. This is referred to as qualitative forecasting and

performed by experts in a given field (Athanasopoulos & Hyndman, 2018). Conversely,

quantitative forecasting models are used to forecast future data based on existing

historic data.

2.1.3 Traffic Prediction Modelling

Traffic flow prediction approaches are categorized majorly as either parametric

or non-parametric approaches (Smith et al., 2002). Recent studies show that powerful

statistical results are performed by parametric models. However, data driven non-

parametric approaches have offered great advantages regarding handling of complexity

and this has motivated persisted investigations targeted on enhancing non-parametric

prediction models (Lam et al., 2006; Gravvanis et al., 2019).

2.1.4 Parametric Traffic Predicting Models

Parametric models are majorly mathematical based and algorithmic methods

(Tang et al., 2020). Parametric are usually derived from empirical data that its structure

is determined in advance by estimating a set of parameter values (Seymour et al., 1997).

Parametric models make use of conventional statistical notions to capture temporal

patterns and trends in time series data in order to perform traffic flow predictions (Smith

et al., 2002). Autoregressive Moving Average (ARMA) and the Kalman filter are

examples of such models that are largely considered to be classical time series

(Seymour et al., 1997). Other parametric models implemented in traffic prediction

include Historical averages (HA), Historical Mean (HM) and linear regression (LR)

(Zhang and Liu, 2009; Alghamdi et al., 2019). Parametric techniques are easy to

understand as well as implement with low model complexity and provide simplicity in

12
the modelling process (Gravvanis et al., 2019). However, road traffic is always

dynamically changing, and complex which parametric methods cannot learn because

they do not model uncertainty well (Fouladgar et al., 2017). Therefore, the performance

of the parametric approaches in traffic prediction is extensively influenced with the aid

of using underlaying external factors in traffic systems (Rzeszótko and Nguyen, 2012;

Smith et al., 2002).

2.1.5 Non-Parametric Traffic Predicting Models

Presently, researchers have put their efforts on harnessing non-parametric

approaches that are majorly machine learning methods to overcome the weakness of

classical statistical modelling approaches (Akçelik et al., 2000; Salott et al., 2018;

Rzeszótko and Nguyen, 2012). Non-parametric techniques are more intelligent

methods that rely largely on training big data to build the model structure (Zheng,

2015). They carry out to mine historic conditions which might just be like the conditions

at prediction stages (Sun et al., 2019). As a result of their flexible structure and great

learning capabilities, machine learning models are currently widely used for traffic

predictions and studies reveal that better results have been produced compared to the

classical parametric models (Salott et al., 2018). Support Vector Regression (SVR)

(Drucker et al., 1997), Bayesian network models, K-Nearest Neighbour (KNN) (Zhang,

2016), Artificial Neural Networks (ANN) (Zupan, 1994), Recurrent Neural Networks

(RNN) (Sherstinsky, 2020), and Convolutional Neural Networks (CNN) (Indolia et al.,

2018) are renown nonparametric models applied in traffic prediction.

2.1.6 Traffic Congestion

Traffic congestion is the condition in transport that is characterized by slower

speeds, increased vehicular queueing and longer trip times. When vehicles are stopped

for longer periods of time traffic congestion occurs (Treiber et al., 2012). According to

13
Systematics (2005), congestion occurs when the regular traffic flow is interrupted by a

high density of vehicles that result in excess travel time. Caves (2004) opined that since

1950s traffic congestion has increased substantially on urban road networks. When

traffic demand is high to the extent that the interaction between vehicles slows down

the speed of the traffic stream, this results in congestion.

2.1.7 Data Sources for Traffic Flow

Different data sources can be used to obtain congestion-related and traffic flow

information such as GPS, sensors, simulation models, social media, probe data etc.

These are described as follows:

i. GPS: Global positioning system is used to provide location and travel times

information from anywhere on the Earth surface. It can be used with or without

telephonic or internet system so as to improve its performance (Howell, 2013).

14
Figure 2.1: GPS Satellite Network

Source: (Howell, 2013)

15
ii. Sensors: These devices are used to analyze and measure travel times in traffic so as

to identify time critical routes, congestion patterns, and other crucial traffic information

to optimize traffic flow. The sensors called BlipTrack was first used in Zurich,

Switzerland, to enhance traffic with less fuel consumption in relation to vehicle

emissions, economic values through reduced travel times. Since then the BlipTrack

solution has gained acceptance in the UK, US and New Zealand (BlipSystem, 2016).

16
Figure 2.2: Smart traffic sensors for monitoring traffic congestion

Source: (BlipSystem, 2016)

17
iii. Simulation: It involves developing a model that imitates the process of a real-world

system over time (Banks et al., 2001). It helps to reduce cost and understand the real

world complexity before development and actual implementation of a solution.

Simulation has been extensively used in traffic flow and traffic travel time prediction.

The models can be developed using software tools like: MATSIM, Repast, ArcGIS,

AnyLogic, SUMO, etc.

iv. Social media: This is a good source for streaming real-time big data from online

sources including Facebook and Twitter (Hortonworks, 2017). Figure 2.3 illustrates the

stages involved in streaming of tweets from the input source to the destination using a

bolt pipeline architecture (EndoCode, 2015). It helps to accomplish the tweets

preprocessing, feature extraction, social network generation, sentiment analysis, etc.

18
Figure 2.3: Streaming processing pipeline architecture

Souece: (Hortonworks, 2017; EndoCode, 2015)

19
v. Probe vehicle: Vehicle probe is an emerging technology used for monitoring traffic

without the need for maintaining and deploying equipment in the right-of-way (Young,

2007). Vehicle probes directly measure travel time using data from a portion of the

vehicle stream in contrast to speed sensors. According to Young (2007), commercial

vehicle probe data services primarily include the automated vehicle location (AVL) and

use of cell phone data.

2.2 Machine Learning

Machine learning (ML) is a branch of artificial intelligence (AI) that reveals the

experiential “learning” that is related to human intelligence, also having the ability to

learn and through the use of computational algorithms enhances its analyses (Bini,

2018; Naylor, 2018). ML is the study of data and algorithms that a computer uses to

improve its understanding of a given task (Aronsson and Bengtsson, 2019). Manning

(2020) defined ML as the subset of AI studying how computer can enhance their

thinking, knowledge, perception, or actions based on experience or data. ML could also

be described as the gathering of the use of diverse algorithms to teach computer systems

to discover patterns in data to be used for future prediction (Belyadi and Haghighat,

2021). ML focuses on creating computer programs that use and access data to learn by

themselves. ML process starts with data or observations, such as direct experience or

instruction. ML has demonstrated valuable due to the fact that it can solve problems at

a pace and scale that cannot be duplicated by the human thoughts alone. There are four

major types of machine learning. These include supervised learning, unsupervised

learning, semi-supervised learning and reinforcement learning.

20
2.2.1 Supervised Learning

Supervised learning is one of the major types of machine learning. Machine

learning algorithm is trained on labeled data in this type (Russell, 2018). Supervised

learning is extremely powerful when used in the right circumstances, although the data

needs to be labeled accurately for this technique to work. ML algorithm is given a small

training dataset to work with in supervised learning. This training dataset is a smaller

part of the larger dataset and provides the algorithm a simple concept of the problem,

solution, and data points to be dealt with. The training dataset is similar also to the final

dataset in its characteristics and offers the labelled parameters required for the problem

to the algorithm (Russell, 2018). The algorithm then reveals relationships between the

parameters given, effect relationship between the variables and essentially establishing

a cause in the dataset. At the end of the training, the algorithm established the

relationship between the input and the output and idea of how the data works. This

solution is then deployed to be used with the final dataset, which it learns from in the

same manner as the training dataset (Mohammed et al., 2017). This implies that

supervised machine learning algorithms will continue to discovering new patterns,

relationships as it trains itself on new data, and enhance even after being deployed.

2.2.2 Unsupervised Learning

Unsupervised learning has advantage of being able to work with unlabelled data

(Russell, 2018). This implies that human effort is not needed for the dataset to be

machine-readable but permitting much bigger datasets to be worked on by the program.

In supervised learning, the labels permit algorithm to discover the precise nature of the

relationship between any two data points (Mohammed et al., 2017). However,

unsupervised learning does not have labels to learn from, this results in the creation of

hidden structures. Relationships between data points require no input from human

21
beings but are perceived by the algorithm in an abstract manner. What makes

unsupervised learning algorithms versatile is the creation of these hidden structures

(Russell, 2018). Unsupervised learning algorithms can adapt to the data by dynamically

changing hidden structures instead of a defined and set problem statement. This gives

extra post-deployment improvement than supervised learning algorithms.

2.2.3 Semi-Supervised Learning

The classified and unclassified data are a mixture of the given data in this type

of learning (Mohammed et al., 2017). The appropriate model for the classification of

data can be generated through the combination of labelled and unlabelled data.

Unlabelled data is in abundance and labelled data is scarce in most of the situations.

The essence of semi-supervised learning is to create a model that will predict future test

data better than that of the model generated using the labelled data alone (Russell,

2018).

2.2.4 Reinforcement Learning

This type of learning is based on reward or penalty, and its utmost purpose is to

use insights acquired from environmental activities to take action to increase the reward

or minimize the risk (Mohammed et al., 2017). Sutton and Barto (2017) asserted that

reinforcement learning is a learning process that evolves with trial and error where a

teacher or a supervisor is not available. This learning takes inspiration directly on how

human beings learn from data in their lives. It features an algorithm that learns from

new situations using a trial-and-error method and improves upon itself. Non-favourable

outputs are discouraged or punished while favourable outputs are encouraged or

reinforced.

22
2.3 Evolution of Machine Learning

In 1763, Thomas Bayes propounded mathematical theorem for probability that

is known as Bayes Theorem which remain an important concept approach to

machine learning.

Alan Turing researches in 1940s fastened with the idea of machine intelligence.

Arthur Samuel created an early learning machine in 1952 which turned into

capable of discover ways to play checkers, using annotated guides by human

specialists and games. It played against itself to learn how to differentiate good

moves from bad.

In 1956, John McCarthy alongside with Marvin Minsky, Nathaniel Rochester,

and Claude Shannon birthed the term ‘artificial intelligence’ at a workshop that

brought together leading researchers towards the development of Computer

Science (The Royal Society, 2017).

In 1967, Nearest Neighbour Algorithm was proposed which could be used for

pattern recognition (Jafar Alzubi et al., 2018).

In 1979, Stanford University students created “Stanford Cart”, an advanced

robot that could move round a room and keep away from barriers in its path.

In 1986, David Rumelhart together with James McClelland and the PDP

Research Group published Parallel Distributed Processing, a two-volume set of

work that accelerated the use of neural network models for machine learning.

In 1992, Gerald Tesauro developed an artificial neural network-based program,

that was able to play backgammon and could match the abilities of top human

players.

In 1997, IBM invented Deep Blue computer became the first computer chess-

playing system to beat world chess champion.

23
In 2011, IBM’s Watson defeats two of its champions at Jeopardy game in US.

In 2012, Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton published a

paper that described a model that had been used to win an annual image

recognition competition.

In 2014, Microsoft developed “Distributed Machine Learning Toolkit” for

effective distribution of machine learning problems to multiple computers to

work parallel to discover a solution (Li et al., 2014).

In 2016, AlphaGo was created by researchers at Google DeepMind to play the

ancient Chinese game of Go. It won four out of five matches against

professional human player (Chen, 2016).

In 2017, researchers at Carnegie Mellon University built Libratus. A system that

defeated four top players at no-limit Texas Hold.

2.4 Machine Learning Process

i. Data Acquisition: This is the method of amassing data from relevant sources

before it can be stored, cleaned, preprocessed, and used for further mechanisms.

ii. Data Exploration and Preprocessing: This involves cleaning and

preprocessing the data into an organized format.

iii. Feature Selection: The data obtained from the above step may consist of many

features, all of which might not be applicable to the learning process. These

features need to be eliminated and the most crucial featured subset needs to be

obtained.

iv. Model Building: Training the dataset and building the model by choosing the

proper machine learning algorithms to discover the patterns.

24
v. Execution and Model Validation: This involves implementation of the model

and validating the model. These include validating and fine-tuning the

parameters.

2.5 Applications of Machine Learning

i. Computer Vision: Machine learning can support enhanced image recognition

systems and computer vision. Such vision will make computers to detect and

analyze visual images and to associate numerical or symbolic information with

those images (Belyadi and Haghighat, 2021). In social media applications,

image recognition could be used to tag people with photos that have been

uploaded to a website. Similar image recognition systems could also be used to

recognize scanned handwritten material.

ii. Filtering Emails: Spam detection systems can use machine learning to filter

emails. In this application, the system is trained using a sample of documents,

which are classified as spam and non-spam, to distinguish between emails and

direct them to the correct folders (Papadopoulos, 2019). In this training process,

the system can learn how the presence of specific words, or the names of

different senders, and other characteristics, relate to whether or not the email is

spam (Sun et al., 2019). When deployed in the live system, it uses this learning

to classify new emails, refining its training when users identify incorrect

classifications.

iii. Recommender Systems: Systems that recommend products or services on the

basis of previous choices. Recommender systems use patterns of consumption,

and expressed preferences, to forecast which products or services are likely to

be desirable to the user. It is machine learning that processes data from previous

25
purchases, and the purchases of others, and uses this to discover patterns and

make predictions (The Royal Society, 2017).

iv. Pattern Recognition: Pattern recognition could be described as the automated

recognition of patterns and regularities in data, e.g., image analysis (Anzai,

2012). A common application of its pattern recognition abilities is in the fraud

detection systems associated with credit card use or other payment systems.

Using the normal transaction data from a large number of users, algorithms are

trained to recognize typical patterns of spending (Maulud and Abdulazeez,

2020). Using this data for each user, it can also learn what makes a transaction

more or less likely to be fraudulent, such as the location, magnitude or timing

of spending activity.

v. Voice Recognition: Until recently, voice recognition systems suffered from

low levels of accuracy, which made them difficult to use in many cases (López

and Guerrero, 2017). Recent advances mean that these systems can now

recognize speech much more accurately, translating the data patterns encoded

within sound waves to text, and carrying out the commands contained therein.

As a result, many smartphones and other devices now come equipped with

virtual personal assistants; applications such as Alexa, Cortana, Google

Assistant, or Siri, which respond to voice commands or answer questions

(López and Guerrero, 2017).

vi. Machine Translation: Using machine translation, computer systems are able

to automatically convert text or speech from one language into another. Efforts

in this field date back to at least the early 1950s (Weaver, 1955). Recent

advances in the field that have made these techniques more broadly useful.

There now exists a range of approaches to this task, including statistical, rule-

26
based, and neural network-based techniques (Le and Schuster, 2016). Today,

machine translation is used in specific translation apps for mobile phones, social

and traditional media, and in international organizations that need to reproduce

documents in a large number of languages.

vii. Traffic Prediction: Transportation systems are an important economic

development segment of every country. Nevertheless, various cities around the

world are witnessing an excessive increase in traffic volume, that leads to

serious issues such as delays, traffic congestion, higher fuel consuming,

accidents, emergencies, and a degrade quality of life in modern society

(Guerrero et al., 2018). Hence, an intelligent transportation system through

forecasting future traffic is essential, which is an indispensable component of a

smart city. Accurate traffic prediction based on machine learning can assist to

minimize the issues (Boukerche and Wang, 2020). For instance, machine

learning can help transportation companies to predict possible issues that may

happen on particular routes and advising their customers to take a different path

based on the travel history and trend of traveling through diverse routes.

viii. Cybersecurity and Threat Intelligence: Machine learning has become an

important cyber-security technology that consistently learns by analyzing data

to discover patterns, better identify malware in encrypted traffic, locate insider

threats, forecast where bad neighborhoods are online, keep people secure while

surfing, or safe data in the cloud by revealing suspicious activity (Zhang et al.,

2020). Clustering techniques could be used to detect cyber-anomalies and

policy violations.

27
In addition to these application areas, machine learning based models could be also

applied to several other domains such as economics, robotics, banking, bioinformatics,

computer networks, and many more.

2.6 Machine Learning Algorithms

Machine learning (ML) algorithms are the techniques by which artificial

intelligence system predicts output values from given input data and conducts its task.

ML algorithms create a model based on a training data known as sample (Maulud and

Abdulazeez, 2020). ML algorithms are applied where the creations of traditional

algorithms are difficult or impractical to implement required functions (Carleo, 2019).

The two algorithms used for this study under machine learning are Decision Tree and

Random Forest.

2.6.1 Decision Tree (DT)

DT is a tree-based method in which any path starting from the root is defined

through a data separating sequence until an outcome on the leaf node is achieved (Yang,

2019). Each tree comprises of the nodes and branches (Swain and Hauska, 1997). Each

subset defines a value that can be taken by the node and each node represents features

in a category to be classified (Dey, 2016). Decision tree is a top-down, recursive

division that makes use of a top-down, divide-and-conquer technique (Tao et al., 2016).

It is a tree-structured classifier, where branches represent the decision rules, internal

nodes represent the features of a dataset and each leaf node represents the outcome

(Yang, 2019). Decision tree algorithm could be utilized to solve classification and

regression problems. Decision tree also could be employed to develop a training

model that can predict the value or class of the target variable by learning simple

decision rules inferred from training data (Tao et al., 2016). There are two nodes in a

Decision tree which are the decision node and leaf node. Decision nodes are used to

28
make any decision and have feature more than one branches while leaf nodes are the

output of these decisions and do not comprise of any further branches (Dey, 2016). The

test or decisions are executed on the premise of features of the given dataset. Zhang et

al. (2020) opined that decision tree evaluates and compares within the decision tree the

attribute values of nodes and based on the different attribute values determine the

branch down from the node. Decision tree learners make attempt to discover a decision

rule that produces the greatest decrease in impurity at a node (Albon, 2018).

29
Decision Node

Decision Node Decision Node


Sub-Tree

Leaf Node Decision Node

ooooooNN
Leaf Node Leaf Node
NNNNode
ooooooNN ooooooNN
Node
NNNNode NNNNode

Node Node

Leaf Leaf

Figure 2.4: Decision Tree Diagram Node Node

Source: (Janikow, 1998) ooooooN ooooooN

NNNNN NNNNN

ode ode

Node Node

30
Advantages of Decision Tree

According to Jijo and Abdulazeez (2021), below are the Decision Tree advantages:

1. It is very easy to understand.

2. It is a non-parametric algorithm i.e. it requires no significant assumptions to be

fulfilled.

3. It can classify both numerical and categorical outcomes but the generated attribute

must be categorical.

4. It can be quickly translated to a set of principle for production.

5. It can create complex decision boundaries, allowing them to easily solve non-linear

problems.

2.6.2 Random Forest (RF)

RF is a classifier that consists of a collection of tree-structured classifiers

(Breiman, 2001). It is a machine learning approach that could be used to solve

classification and regression problems. It makes use of ensemble learning, that is a

method that merges numerous classifiers to offer solutions to complicated problems

(Yang, 2019). It includes many decision trees from a bootstrap aggregated sample in

the original training set with the same distribution for the individual trees such that each

tree depends on the values of random vector grown (Liaw and Wiener, 2002). To create

an uncorrelated forest of trees whose prediction by committee is more accurate than

that of any individual tree, it uses bagging and feature randomness when building each

individual tree (Dey, 2016).

Advantages of Random Forest

He et al. (2018) opined the following Random Forest advantages:

1. It can perform both classification and regression tasks.

2. It reduces overfitting in decision trees and facilitates to enhance the accuracy.

31
3. It produces good predictions that can be easily understood.

4. It works well with both categorical and continuous values.

5. It automates missing values present in the data.

2.7 Overfitting and Underfitting

The model is said to overfit the training data when a machine learning model

cannot generalize well to new data (the test set) and learns unique features to the

training set (Géron, 2017). Different ML models make use of various regularization

methods to avoid overfitting. Conversely, a model is underfitting when it cannot learn

from the training set at all (Géron, 2017). In this situation, the performance of the model

will be poor on both the training set as well as the test set. The quality of the training

data must be considered in order to avoid underfitting (Kamble and Kounte, 2020). For

instance, relevant features for the learning objective must be part of the data and outliers

and different noise must be removed. Removing noise also help against overfitting. The

reason being that the model learns the noise of the training data that does not exist in

the test set (Géron, 2017). Additionally, during the learning phase adding random noise

in each iteration can also help against overfitting. This is feasible as it prevents the

model from learning some existing noise in the training set.

2.7.1 Feature Engineering

Provision of relevant features for a given task is very essential for a successful

ML model. For instance, prediction of the traffic congestion is likely not going to be

very successful based on the current price of gold. Intuitively, the model will not

achieve anything interesting because these two variables are completely unrelated.

Featuring engineering is the process of uncovering the most relevant and useful features

(Géron, 2017).

32
2.7.2 Data Preparation

The first and foremost points to guarantee the successful building of forecasting

models are data quality and its representation. Preparing the data appropriately for a

given model is the next step. The quality of the data is the first part to consider.

Secondly, the data must be organized in a particular way for a time series forecasting

context.

2.7.3 Parameters

Machine learning models frequently rely upon many parameters. Some

parameters used remain constant during the learning phase and do not directly belong

to the model itself. In avoiding a poorly performing model, tuning the parameters is an

important step.

2.8 Deep Learning (DL)

DL is a subfield of machine learning that is considered to be a nested

hierarchical model that incorporates traditional neural networks (Narmadha and Kumar,

2017). It permits computational models to learn features progressively from data at

multiple levels (Amitha et al., 2020). It has been increasingly recognized as a crucial

tool for artificial intelligence research with applications in numerous areas such as

motion modeling, automatic speech recognition, object detection, natural language

processing, classification tasks, dimensionality reduction (Bengio et al., 2013). It

makes use of algorithms called artificial neural networks (ANNs) that are capable of

self-learning and inspired by the structure and function of the brain. Rather than being

explicitly told how to solve a problem, ANNs are trained to learn models and patterns.

Deep learning has gained a popularity to the extent that as the amount of data available

increased, it promotes the development of hardware that gives effective computers.

33
2.9 Deep Learning algorithms

Deep learning algorithms are set of decision-making networks that are pre-

trained to serve a task and they are dynamically made to run through

numerous layers of neural networks (Inzunza, et al., 2020). They mostly work with any

kind of data and require huge amounts of information and computing power to solve

complex issues. Deep-learning algorithms can be categorized into different types.

These include Deep Neural Network (DNN) Long Short Term Memory Recurrent

Neural Network (LSTM-RNN), Convolution Neural Network (CNN), Deep Belief

Network (DBN), Generative Adversarial Networks (GAN), etc.

2.9.1 Deep Neural Network (DNN)

DNN is an algorithm that stimulates the activity of human brain, the

transmission of information between the different layers of neural connections and the

recognition of patterns (Chollet, 2021). It has an input layer and at least one layer in

between an output layer. The higher the number of layers, the deeper the network. Each

of these layers performs different types of specific categorization and classification in

a process called hierarchy of features.

Advantages of Deep Neural Network (DNN)

According to Chollet (2021), below are DNN advantages:

1. It handles large and complex data.

2. It improves performance.

3. It does automatic feature learning.

4.It handles structured and unstructured data.

5. It unravels non-linear relationships within data that may be elusive to detect using

conventional methods.

34
2.9.2 Long Short Term Memory Recurrent Neural Network (LSTM-RNN)

LSTM-RNN is capable of learning long-term dependencies, especially in

sequence prediction problems (Zhang et al., 2019). It automatically predicts possible

outcomes through those sequences. LSTM-RNN allows prior inputs to learn and evolve

with more exposure. It is used for sequential modeling and language modeling. Without

mentioning them in the code, LSTM-RNN can learn patterns and predict outcomes.

Advantages of LSTM-RNN

Inzunza et al. (2020) stated the following LSTM-RNN advantages:

1. It uses higher memory for processing series of inputs.

2. It can process inputs of any length.

3. It is used for time series prediction.

4. It is very effective at modeling complex sequential data.

5. It is much less susceptible to the vanishing gradient problem.

2.9.3 Convolution Neural Network (CNN)

CNN is a neural network that excels at image recognition, segmentation, and

object detection (Babu, 2019). CNN is also known as ConvNet. It makes use of more

than one layer to extract features from the available data. It consists of four layers.

These include Convolution layer, Rectified Linear Unit (ReLU), Pooling Layer, Fully

Connected Layer. These four layers offer an operating mechanism for the network. The

first layer in CNN is convolution layer, which from the data filters out complicated

features. The ReLU then maps data to train the network. Thereafter, the pooling layer

receives the process sends by the map, which converts the data from 2D to a linear

array, and reduces sampling. Finally, the fully connected layer used as input to detect

images or other data types forms a flattened linear matrix.

35
2.9.4 Deep Belief Network (DBN)

DBN is another popular deep learning with artificial intelligence features that

permits the network to learn patterns in data. It is used for image feature detection and

face recognition software tasks. The DBN is an artificial neural network that helps in

learning and recognizing patterns which involves different layers of Restricted

Boltzmann Machines (RBM) (Ramchandra and Rajabhushanam, 2021). The RBM

layers provide a robust structure that can classify data based on different categories,

and the layers of DBN follow the top-down technique, permitting communication

throughout the system.

2.9.5 Generative Adversarial Network (GAN)

GAN is a deep learning algorithm that helps generative artificial intelligence

(AI). It can generate results on their own by training through specific datasets to create

new data instances and capable of unsupervised learning (Huang et al., 2020). The

GAN model has two major key elements. These include a discriminator and a generator.

The discriminator is trained to check the output for any fake data or errors and rectify

the model based on it. In contrast, the generator is trained to create fake data based on

its learning. GAN is used for generating videos, simulating gravitational lenses, and

enhancing astronomical images. It is also used for image generation, such as enhancing

the graphics quality in video games. In the AI community, GAN remains a popular

research topic because its potential application is vast and varied.

2.10 Related Works

Taiwo et al. (2023) proposed a model to predict traffic congestion. They applied

classification tree, support vector machine and RUSboosted algorithms to build traffic

congestion models. The experimental results indicated that support vector machine

outperforms the other two algorithms. However, the study was limited to the use of

36
online dataset and the dataset used is not applicable to Nigeria situation. Ramchandra

and Rajabhushanam (2021) worked on traffic prediction system using machine learning

algorithm. They utilized Deep Autoencoder (DAN), Deep Belief Network (DBN),

Random Forest (RF) and Long Short Term memory (LSTM) to predict the traffic flow

of a particular zone. The experimental results indicated that the LSTM performs better

than the other three algorithms with 94.3%. However, the authors did not subject

preprocessed dataset to SMOTE algorithm in order to overcome overfitting problem

posed by random oversampling. Ravi et al. (2021) conducted a study on a system that

can be used to analyze the traffic and predict the congestion on specific path and

notifying well in advance the vehicles intending to travel on the congested path. They

applied You Only Look Once (YOLO) algorithm to implement the model. The model

provides accurate and early prediction of the traffic congestion. However, the dataset

used is not applicable to Nigeria situation. In addition, Uber movement data collected

did not contain all the necessary information that could have made their predictive

model to be more realistic. Geetha et al. (2021) proposed a system to increase traffic

efficiency. They employed genetic algorithm to build predictive model. The system

performs better than the existing ones. However, the study was limited to the use of

online dataset and the dataset used lacks real-time testing of the proposed scheme.

Duhayyim et al. (2021) proposed a model to predict traffic flow with weather

conditions in smart cities. They employed artificial intelligence based traffic flow

prediction with weather conditions (AITFP-WC) technique. The results indicated the

efficiency of the AITFP-WC approach is higher than the recent state of art techniques.

However, the dataset used is not applicable to Nigeria situation.

Odesanya and Odesanya (2021) worked on the performance analysis of traffic

congestion using designated neural network training algorithms, aiming to develop a

37
model to analyze traffic flow. They applied Bayesian Regularization (BR), Scaled

Conjugate Gradient (SCG) and Levenberg-Marquardt (LM) algorithms to build models.

Experimental results showed that BR outperformed SCG and LM. Ramesh in terms of

accuracy. However, the dataset used was not subjected to SMOTE algorithm so as to

overcome overfitting problem posed by random oversampling. Lakshna et al. (2021)

proposed a model to minimize the traffic congestion by diverting or redirecting the

upcoming vehicles into the shortest path or alternate path based on prediction methods.

They utilized Random Forest (RF), AdaBoost (AB) and Logistic Regression (LR) to

build models. The results indicated that LR performed better than RF and AB in terms

of prediction accuracy. However, the study was limited to the use of online dataset

which is not applicable to Nigeria situation. Majumdar et al. (2021) introduced long

short-term memory networks for the prediction of congestion propagation across a road

network. They employed univariate and multivariate algorithms to build predictive

models. Both univariate and multivariate predictive models’ analysis showed an

accuracy of 84–95%. However, trajectory information extracted from traffic simulator

were not subjected to SMOTE algorithm in order to overcome overfitting problem

posed by random oversampling. Liu and Shetty (2021) developed a model for traffic

congestion and road accidents. They applied four various machine learning algorithms

to build models. The results indicated that random forest outperformed the other three

algorithms. However, the model lacks in performance due to uncertain run-time traffic

conditions. Rajeev et al. (2021) conducted a study on a system for traffic assessment.

They utilized regression based algorithm for image detection to analyze the bulk data

of the transport system and machine learning for prediction. The system achieved 83%

accuracy in terms of traffic prediction. However, dataset used is not applicable to

Nigeria situation.

38
Hassan et al. (2021) developed a system that will control traffic congestion in smart

societies. They utilized IoT based intelligent traffic congestion handling system

empowered by machine learning (IoT-ITCHS-ML). In training and validation, the

system accomplished 81% accuracy. However, time delays are main limitations which

may occur due to poor collection of sensors or slow connectivity of network. Rajendran

and Ayyasamy (2020) conducted a study on a model for short term traffic flow

prediction. They utilized structure pattern and regression to build models. The proposed

system performs better than the conventional systems in terms of accuracy and turns

out to facilitate in conserving energy. However, the dataset used is not applicable to

Nigeria situation. Andrew and Parvathi (2020) proposed a solution to predict vehicular

traffic using machine learning methods. They build a model that is capable of predicting

traffic volume based on features that brings out hidden insights in vehicular movements.

The research resulted in identifying an optimal model to the publicly available dataset.

However, time-consuming features extraction makes the model inefficient for real time

forecast. In addition, the dataset used was not subjected to SMOTE algorithm in order

to overcome overfitting problem posed by random oversampling. Kamble and Kounte

(2020) researched on machine learning technique to identify traffic congestion based

on multiple parameters. They utilized Gaussian process in machine learning for the

prediction of traffic speed. The technique performs accurate results in traffic speed

prediction. However, Gaussian process lacks real-time testing of the proposed scheme.

Kyaw et al. (2020) predicted traffic congestion of urban road network. Decision Trees,

Random Forest Classifiers and ExtraTree Classifiers algorithms were used to build

predictive models. The experimental results showed that Decision Trees produced a

better result than the other two algorithms. However, the study was limited to the use

of online dataset which is not applicable to Nigeria situation.

39
Tamir et al. (2020) conducted a study on a model to predict traffic congestion. They

employed Decision Tree, Logistic Regression and Neural Networks algorithms to build

traffic congestion models. The results showed that Decision Tree outperforms other two

algorithms with accuracy of 97%. However, the study failed to subject the preprocessed

dataset to SMOTE algorithm in order to overcome overfitting problem posed by

random oversampling. Rahman (2020) predicted short term traffic flow using machine

learning approaches such as k-nearest neighbor (KNN), support vector machine (SVM)

and artificial neural network (ANN). Related parameters were incorporated with the

algorithms of machine learning for better traffic flow prediction in this study. The

results revealed that KNN produces more accurate results than SVM and ANN.

However, the study failed to adopt multiple simulations to justify the performance of

the selected algorithms. Ata et al. (2020) proposed a TCC-SVM model for an

intelligent traffic congestion control. They employed Support Vector Machine to

predict congestion with a preprocessing layer to enhance the incoming data by dealing

with missing values. The performance of the proposed TCC-SVM model is much better

when compared to the previous techniques based on the evaluation of the results

produced from the simulation. However, the study was limited to the use of online

dataset which is not applicable to Nigeria situation. Meena et al. (2020) developed a

model to predict accurate and timely traffic flow information. They applied machine

learning algorithms such as Decision Tree, Support Vector Machine (SVM) and

Random Forest to build models. The results indicated that Random Forest produced a

better result than the other two algorithms. However, the study failed to adopt the use

of feature selection techniques for feature selection. Zafar and Ul Haq (2020)

researched on traffic prediction that is based on traffic data collected through Google

Map API. Their application is a desktop-based application that predicts traffic

40
congestion state using Estimated Time of Arrival (ETA). They used three machine

learning techniques to build models. Results indicated that random forest classification

algorithm has the highest prediction accuracy of 92% followed by XGBoost and KNN

respectively. However, the dataset used is not applicable to Nigeria situation.

Almehmadi et al. (2020) proposed a model to detect anomalies in road traffic

data to identify traffic congestions. They utilized Hierarchical Temporal Memory

(HTM) cortical learning algorithm. The algorithm is evaluated and compared against

some of the state-of-the-art anomaly detection techniques. The results showed that the

algorithm performed better than KNN-GAS, the ICA-LoOP, and the SVD-IO.

However, the study failed to subject the preprocessed dataset to SMOTE algorithm in

order to overcome overfitting problem posed by random oversampling. Janković et al.

(2020) investigated the possibility of employing different machine learning algorithms

to predict daily and hourly traffic volume. They carried out the research through two

case studies. In first case study, they applied Linear Regression, Multilayer Perceptron,

Lazy IBk (k-Nearest Neighbors), M5P, Random Forest, Random Tree, and REPTree

algorithms to predict daily traffic volume of traffic flow and M5P outperformed the

others. In second case study, they utilized Lazy IBk (k-Nearest Neighbors), Random

Forest, Random Tree, and Random committee were trained with the aim to predict the

hourly volume. The Lazy IBk algorithm was slightly better than the others. However,

the dataset used is not applicable to Nigeria situation. Mei et al. (2020) conducted a

study to forecast traffic congestion. They utilized fuzzy comprehensive evaluation

technique to divide traffic status level (TSL) as well as five various machine learning

algorithms to build predictive models. However, the study lacks in time-efficiency for

dense traffic condition with rapid fluctuations. The results showed that BP neural

network is more accurate than other algorithms. Jiber et al. (2020) proposed a hybrid

41
model that combines Extreme Learning Machine (ELM) and Ensemble Based System

in Decision Making (EBDM) to predict the future hourly traffic of a road section in

Tangier Morocco. They applied single hidden Layer Feed-forward Neural Network

(SLFN) to build model. The experimental results indicated that the model outperformed

in terms of prediction accuracy when compared to other well-known algorithms.

However, the study was limited to the use of online dataset which is not applicable to

Nigeria situation. Inzunza et al. (2020) developed a system to predict the traffic flow in

a city. They employed machine learning, computer vision, deep learning, and neuronal

networks to implement the model. The proposed system works relatively fast and

produced promising results. However, the study failed to The study failed to adopt

multiple simulations to justify the performance of the selected algorithms.

Huang et al. (2020) proposed road-condition-based congestion prediction

system (RCPS) that makes use of traffic volume and vehicle speed to predict traffic

congestion. To extract traffic volume and vehicle speed on the road, the proposed model

collects real-time road images taken from camera drones. They used extracted traffic

indicators to predict the congestion level in the future. RCPS produces high accuracy

in congestion level prediction. However, the dataset used is not applicable to Nigeria

situation. Verma and Badade (2019) worked on a system to control traffic in a smart

city. They utilized Long Range Wide Area Network (LoRa) and Intelligent Traffic

Management System (ITMS) to predict traffic. Experimental results indicated that the

system will produce high performance in traffic prediction. However, the study failed

to incorporate the spatial traffic flow features. In addition, the authors did not subject

preprocessed dataset to SMOTE algorithm in order to overcome overfitting problem

posed by random oversampling. Deb et al. (2019) proposed an approach to forecast

level of traffic congestion on the basis of a time series analysis. They employed various

42
machine learning algorithms to build predictive models. The results of the various

algorithms used showed that logistic regression outperforms with an accuracy of 85%.

However, the study was limited to the use of online dataset which is not applicable to

Nigeria situation. Sridevi et al. (2019) conducted a study on a model for traffic analysis

considering social media platforms. They used random forest algorithm for the

estimation of traffic based on the traffic congestion level. The model accomplished 86%

accuracy. However, the study lacks in time-efficiency for dense traffic condition with

rapid fluctuations. Bandaragoda et al. (2019) worked on trajectory clustering of road

traffic in urban environments. They employed incremental machine learning in

conjunction with hyperdimensional computing. The method gives a novel unsupervised

incremental learning for road traffic congestion detection. However, the study failed to

adopt multiple simulations to justify the performance of the selected algorithms. In

addition, the preprocessed dataset was not subjected to SMOTE algorithm in order to

overcome overfitting problem posed by random oversampling.

Zhang et al. (2019) proposed a model to forecast traffic congestion. They used

attention-based long short-term memory (LSTM) recurrent neural network to build

predictive model. The results showed that the model performs better than the baselines

of congestion prediction. However, delay in data received by the signal sensors affected

solution performance of the model. Mystakidis and Tjortjis (2019) researched on a

model to predict traffic congestion. They used Decision Trees and Logistic Regression

to build models. Experimental results showed that Decision Trees were more accurate

than Logistic Regression. However, large amount of data make algorithm slower and

changes are not distinguishable. Alshamrani et al. (2019) worked on a machine learning

based model for the prediction of traffic flow in smart cities. The proposed system

comprises of four subsystems working together to manage traffic in terms of

43
congestion, delays, and emergency issues such as accidents. However, the study was

limited to the use of online dataset which is not applicable to Nigeria situation. Kong et

al. (2019) proposed a prediction network-based on machine learning. They utilized long

short-term memory (LSTM) on big data-driven traffic flow. Based on machine learning

network, they also constructed the LSTM parameter optimization algorithm. Couple

with the increase of training steps, the model has superior performance. However, the

dataset used is not applicable to Nigeria situation. Ata et al. (2019) proposed a model

for smart road traffic congestion. They applied Artificial Back Propagation Neural

Networks (MSR2C-ABPNN) to build model. Experiment showed that the model gives

attractive results. However, time delays are main limitations which may occur due to

poor collection of sensors or slow connectivity of network. Babu (2019) conducted a

study on a model for the traffic congestion for Internet of things (Iot) based smart city.

The convolution neural networks (CNN) and different machine learning techniques

were utilized to predict traffic congestion. The results revealed that CNN outperformed

other various machine learning algorithms. However, the dataset used is not applicable

to Nigeria situation. In addition, the preprocessed dataset was not subjected to SMOTE

algorithm in order to overcome overfitting problem posed by random oversampling.

44
Table 2.1: Review of closely related works for traffic congestion

Author(s) Title Aim Method Strengths Limitations


& Year

Taiwo et al. Traffic The authors The authors Support The study was
(2023) congestion proposed a utilized vector limited to the
prediction model to classification machine use of online
using predict tree, support outperforms dataset. In
supervised traffic vector the other two addition,
machine congestion. machine and algorithms. dataset used is
learning RUSboosted not applicable
algorithms algorithms to to Nigeria
build traffic situation.
congestion
models.
Hassan et Iot enabled The They The system Time delays
al. (2021) intelligent researchers employed accomplishe are main
traffic proposed a support vector d high limitation
congestion system that machine accuracy in which may
handling sense and (SVM) to training and occur due to
system notify the build traffic validation. poor
empowered congested congestion collection of
by machine areas. model. sensors or
learning slow
connectivity
of network.
Ramchandr Traffic The authors They utilized The The time
a, & Prediction proposed a Deep experimental dependence of
Rajabhusha System using model toAutoencoder results the traffic data
nam, Machine predict (DAN), Deep indicated that should be
(2021) Learning traffic flow Belief the LSTM investigated
Algorithms of aNetwork performs prior to
particular (DBN), better than inputting the
zone. Random the other data into the
Forest (RF) three model.
Long Short algorithms
Term Memory with 94.3%
(LSTM) accuracy,
algorithms to
build models.
Geetha et A traffic The authors They applied The system Dataset
al. (2021) prediction for proposed a genetic performs collected
intelligent system to algorithm to better than lacks real-
transportatio increase build model. the existing time testing of
n system traffic ones. the proposed
using efficiency. scheme.
machine
learning

45
Ravi et al. Traffic The They applied The model Uber
(2021) managementresearchers You Only provides movement
system using
proposed a Look Once accurate and data collected
machine model to (YOLO) early did not
learning predict algorithm to prediction of contain all the
algorithm traffic implement the the traffic necessary
congestion model. congestion. information
and that could
notifying have made
well in their
advance the predictive
vehicles model to be
intending to more realistic.
travel on the
congested
path.
Odesanya, Performance The They applied Experimental The time
I. & Analysis of researchers Bayesian results dependence of
Odesanya, Traffic developed a Regularizatio showed that the traffic data
(2021). Congestion model to n (BR), Scaled BR should be
Using analyse Conjugate outperformed investigated
Designated traffic flow. Gradient SCG and prior to
Neural (SCG) and LM. inputting the
Network Levenberg- data into the
Training Marquardt model.
Algorithms (LM)
algorithms to
build models.

Ramesh et Smart Traffic The authors Random The results Noise in the
al. (2021) Prediction proposed a Forest (RF), indicated that raw data
and model toAdaBoost LR causes low
Congestion minimize (AB) and performed accuracy of
Reduction in the traffic Logistic better than the model.
Smart Cities congestion Regression RF and AB in
in urban(LR) were terms of
areas. applied to prediction
build models. accuracy.
Majumdar Congestion The They Both Trajectory
et al. prediction researchers employed univariate information
(2021) for smart developed a univariate and and extracted from
sustainable model to multivariate multivariate traffic
cities using predict the algorithms to predictive simulator did
IoT and propagation build models. models’ not contain the
machine of analysis most needed
learning congestion showed an information.
approaches across a road accuracy of
network. 84–95%.

46
Liu & Analytical The authors They utilized The results The model
Shetty Models for developed a four various indicated that lacks in
(2021) Traffic model to machine random performance
Congestion predict learning forest with uncertain
and Accident traffic algorithms to outperformed run-time
Analysis
congestion build models. the other traffic
and road three conditions.
accidents. algorithms
with 87.5%.
Rajeev et Traffic flow The They used The system The time
al. (2021) prediction researchers random forest has greater dependence of
using random developed a and bellman accuracy in the traffic data
forest and system for ford terms of should be
bellman ford traffic algorithms to traffic investigated
for best route assessment. build model. prediction. prior to
detection inputting the
data into the
model.
Duhayyim Modeling of The They The results Unknown
et al. artificial researchers employed indicated the optimization
(2021) intelligence proposed a artificial efficiency of performance
based traffic model to intelligence the AITFP- when the
flow predict based traffic WC approach method is
prediction traffic flow flow higher than used in
with weather with prediction the recent combination
conditions weather with weather state of art with other
conditions conditions techniques. techniques.
in smart (AITFP-WC)
cities. technique
Rajendran, Short-term The They The model One major
& traffic researchers employed performs deficiency of
Ayyasamy, prediction proposed a locally better than locally
(2020) model model to weighted the weighted
for urban predict short learning to conventional learning is its
transportatio term traffic build model. systems in inability to
n using flow. terms of scale well.
structure accuracy and
pattern turns out to
and regressio facilitate in
n: An Indian conserving
context energy.

47
Tamir et al. Traffic The They The results Dataset used
(2020) congestion researchers employed showed that is not
prediction developed a Decision Tree, Decision applicable to
using model to Logistic Tree Nigeria
decision tree, predict Regression outperforms situation.
logistic traffic and Neural other two
regression congestion. Networks algorithms
and neural algorithms to with 97%
networks build nodels. accuracy.
Andrew, Vehicular The authors The build a The research Time-
M. & Traffic proposed a model that is resulted in consuming
Parvathi, R. analysis and model to capable of identifying features
(2020) prediction predict predicting an optimal extraction
using traffic flow. traffic volume model to the makes the
Machine based on publicly model
learning features that available inefficient for
algorithms brings out dataset. real time
hidden forecast.
insights in
vehicular
movements.
Mei et al. Research on The authors Fuzzy The results The study
(2020) short-term proposed a comprehensiv showed that lacks in time-
urban traffic model to e evaluation BP neural efficiency for
congestion forecast technique and network is dense traffic
based on traffic five various more condition with
fuzzy congestion. machine accurate than rapid
comprehensi learning other fluctuations.
ve evaluation algorithms algorithms.
and machine were utilized
learning to build
models.
Kamble, & Machine The They applied The Gaussian
Kounte learning researchers gaussian technique process lacks
(2020) approach on presented process in performs real-time
traffic machine machine accurate testing of the
congestion learning learning for result in proposed
monitoring approach to prediction of traffic speed scheme.
system in identify traffic speed. prediction.
internet of traffic
vehicles congestion
based on
multiple
parameters.

Kyaw et al. Predicting The authors Decision The Noise in the


(2020) on-road predicted Trees, experimental data causes
traffic traffic Random results low accuracy
congestion congestion Forest showed that of the
from public of urban Classifiers Decision

48
transport road and ExtraTree
Trees predictive
GPS data network. Classifiers
produced a model.
algorithmsbetter result
were used to
than the other
build models.
two
algorithms.
Rahman, F. Short term The He employed KNN The study
I. (2020) traffic flow researcher k-nearest produces failed to adopt
prediction predicted neighbor more multiple
using short term (KNN), simulations to
accurate
machine traffic flow support vector justify the
learning - using machine result than performance
KNN, SVM machine (SVM) and SVM and of the selected
and ANN learning artificial ANN with algorithms.
with weather techniques. neural 94.8%
information network accuracy.
(ANN) to
build traffic
congestion
models.

Meena et Traffic The authors They used The results The study
al. (2020) prediction for developed a decision tree, indicated that failed to adopt
intelligent model to support vector Random the use of
transportatio predict machine Forest feature
n accurate and (SVM) and produced a selection
system using timely random forest better result techniques for
machine traffic flow to build than the other feature
learning information. models. two selection.
algorithms
with 88.88%.
Jiber et al. Road traffic The authors They applied The The study has
(2020) prediction proposed a single hidden experimental high delay in
model using hybrid Layer Feed- results computational
extreme model to forward indicated that steps.
learning predict Neural the model
machine future Network outperformed
hourly (SLFN) to in terms of
traffic of a build model. prediction
road section. accuracy
when
compared to
other well-
known
algorithms.
Ata et al. Adaptive IoT The They applied The Has high data
(2020) empowered researchers Support performance processing
smart road proposed a Vector of the model delay.
traffic model for an Machine to is much
congestion intelligent build models. better when

49
control traffic compared to
system using congestion the previous
supervised control. techniques
machine based on the
learning evaluation of
algorithm the results
produced
from the
simulation.
Huang et Traffic The Traffic The system The time
al. (2020) Congestion researchers volume and produces dependence of
Level proposed a vehicle speed high the traffic
Prediction system to were used to accuracy in volume and
Based on predict predict traffic congestion vehicle speed
Recurrent traffic congestion. level data should be
Neural congestion. prediction. investigated
Networks prior to
inputting the
data into the
model.
Zafar & Ul Traffic The They used Results Data collected
Haq, congestion researchers random forest, indicated that through
(2020) prediction developed XGBoost and random Google Map
based on model to KNN to build forest API lacks the
Estimated predict models. algorithm has most needed
Time of traffic highest information.
Arrival congestion prediction
state using accuracy
Estimated more than
Time of XGBoost and
Arrival KNN.
(ETA).
Alshamrani Machine The They applied The system The proposed
et al. learning researchers machine manages system needed
(2019) based model developed a learning traffic in further
for system to algorithm to terms of investigation
traffic predict build model. congestion, to ascertain its
prediction in accurate and delays, and performance
smart cities timely emergency
traffic flow issues such as
information. accidents.
Kong et al. Big data- The authors They utilized The model Unknown
(2019) driven proposed a long short- has superior optimization
machine prediction term memory performance. performance
learning- on big data- (LSTM) when the
enabled driven parameter method was
traffic flow traffic flow. optimization used in
prediction. algorithm to combination
build model. with other
techniques.

50
Verma & Traffic The authors They utilized Experimental The study
Badade Prediction proposed a Long Range results failed to
(2019) Using system to Wide Area showed that incorporate
Machine control Network the system the spatial
Learning traffic in a (LoRa) and will produce traffic flow
smart city. Intelligent high features.
Traffic performance
Management in traffic
System prediction.
(ITMS) to
predict traffic.
Babu. Methodologi The author Convolution The results Delay in data
(2019) es for Traffic proposed a neural revealed that received by
congestion model for networks CNN the signal
prediction for the traffic (CNN) and outperformed sensors
a Iot based congestion different other various affected
smart city for Internet machine machine solution
using of things learning learning performance
machine (Iot) based techniques algorithms. of the model.
learning and smart city. were utilized
CNN to build
models.
Sridevi et Traffic The They used The model The study
al. (2019) analysis by researchers random forest accomplishe lacks in time-
using developed a algorithm to d 86% efficiency for
random model for build model. accuracy. dense traffic
forest traffic condition with
algorithm analysis. rapid
considering fluctuations.
social media
platforms

Mystakidis, Big data The authors Decision Experimental Large amount


& Tjortjis mining for proposed a Trees and results of data make
(2019) smart cities: model to Logistic showed that algorithm
predicting predict Regression Decision slower and
traffic traffic were utilized Trees were changes are
congestion congestion. to build more not
using models. accurate than distinguishabl
classification Logistic e.
Regression
with 71.1%
accuracy.

51
Based on the review of related works, it is evident that while substantial research has

been conducted to predict traffic congestion. No studies have considered factors

causing traffic congestion in the Nigeria context. To address this gap, the proposed

research aims to develop predictive model for road traffic congestion in Lagos using

two machine learning algorithms: (Decision Tree and random Forest) and two deep

learning algorithms: (Deep Neural Network and Long Short Term Memory Recurrent

Neural Network). It will also integrate SMOTE algorithm with Deep Neural Network

and Long Short Term Memory Recurrent Neural Network to enhance the performance

of the model.

52
CHAPTER THREE

RESEARCH METHODOLOGY

This chapters presents a detail methodological framework applied in the

development of a predictive model to predict road traffic congestion in Nigeria. The

methodology has been carefully structured to address the study's previously outlined

objectives through a systematic and rigorous approach. The methodological process

begins with a comprehensive exposition of the data acquisition protocols. This

encompasses the systematic identification and collection of relevant datasets, ensuring

the appropriate road traffic congestion data for model development. The careful

consideration given to data selection and collection forms the foundation for subsequent

analytical processes.

3.1 Dataset Collection

The dataset was collected using mixed research method. Qualitative aspect was

done using dataset from the Federal Road Safety Corps (FRSC) office while

quantitative aspect was done by developing google form (sentiment approach) for those

that reside in those areas and road users that are plying those roads who daily fill the

form and submit it. Six months of traffic dataset were used to predict traffic congestion.

The dataset consists of 4600 instances and 14 attributes namely: Date_time, Holiday,

Narrow_road_network, Weather, Accident, Potholes, Rain, Bad_access_roads,

Presence_of_too_many_vehicles_on_the_road, Poor_drainage, Weather_description,

Presence_of_traffic_control_officer, Fault_vehicle, and Traffic_volume. The dataset

was later uploaded into Google Drive to facilitate easy access into the simulation

environment where different analyses were done for this study. Figure 3.1 shows a

diagrammatic representation of the implementation process of the work.

53
Traffic Dataset

Data collection (Lagos)

Data Preprocessing

Pre processing

Sampled Dataset
Unsampled Dataset (Using Unsampling)

(using Upsampling)
Training Dataset Splitting Testing
(80%) (20%)

Model Building & Training


DT, RF,
DNN,
LSTM-RNN

Prediction

Validation
Accuracy, Precision,
Recall, Specificity, F1
Score

Figure 3.1 The Architecture of the Traffic Congestion Predictive Model

Source: Field Work (2024)

54
Figure 3.2: Sample of dataset instances with their features

Source: Field Work (2024)

55
Table 3.1: Input and target attributes

Input attributes Target attributes

Holiday

Narrow_road_network
Bad_access_roads

Presence_of_too_many_vehicles_on_the_road
Accident

Weather Congestion Level


Weather_description

Rain

Presence_of_traffic_control_officer

Potholes

Poor_drainage

Faulty_vehicle

Traffic_volume

Source: Field Work (2024)

56
3.1.1 Data Preprocessing

The data preprocessing in this study was performed using an online cloud-based

Python notebook called Google CoLaboratory that was provided by Google to its users.

This provided a convenient way of preprocessing the different steps in the working

procedure. Several python libraries would be applied in different ways, and are

summarized below.

NumPy: It was used for easy handling of huge multi-dimensional lists and matrices. It

also consists of several mathematical functions for convenient manipulation of these

data structures.

Pandas: It was used for data wrangling, analysis and statistics. It was built with the

intention of implementing and improving on existing data manipulation. Loading,

preparing, manipulating, modelling and analyzing in data preprocessing were

accomplished with the help of Pandas.

Scikit-learn: This library was used for manipulation of datasets and implementation of

machine and deep learning algorithms.

Matplotlib: A 2D plotting library was used to create graphs that visualize data in

different ways.

Data preprocessing started with categorizing the data acquired to different types of data

structures including Categorical data (Direction, Type of road, Congestion Level) and

Numerical data (Date, Time, Length of the road, Travel Time, road Volume, Speed of

the car, Occupancy of the road). Both of the data types were preprocessed and made

ready for constructing the predictive model. The following three tasks were associated

with the data preprocessing.

57
A. Assigning data to the attributes /variables deceleration

The attributes used in the traffic congestion predictive model was assigned data types

as shown in figure 3.3.

58
Figure 3.3: Assigning data to the attributes /variables

Source: Field Work (2024)

59
B. Filling the missing values: There are different methods to handling the missing data

in the data preprocessing; (1) Ignore the tuple, (2) fill in the missing value manually,

(3) Fill in it automatically with Mean, Mode, and Median, and (4) select the most

probable value. In this study the missing values are treated by ignoring the tuple as

shown in Figure 3.4.

60
Figure 3.4: Filling of missing values

Source: Field Work (2024)

61
C. Assign numerical values for categorical data

The categorical attributes in the datasets were converted to numerical values and the

numerical values were assigned individually.

3.2 Model Formulation

Predictive model for traffic congestion were formulated using sampling the

dataset with SMOTE algorithms, Decision Tree, Random Forest, DNN and LSTM.

After the completion of data preprocessing, the dataset is left with eleven input

attributes and one target attribute. Consequently, training and testing datasets need to

be identified prior to prediction model design. The training datasets were subjected to

two section: first data with SMOTE algorithm while the second was without SMOTE

for the construction of the predictive model. The size of training dataset is an influential

factor to assure better results.

3.2.1 Synthetic Minority Oversampling Technique (SMOTE)

This algorithm helps to overcome the overfitting problem posed by random

oversampling. The preprocessed dataset was subjected to SMOTE algorithm. The

mathematical formulation of SMOTE algorithm can be expressed as follows:

Let X_combined = {X + x_synthetic} represent the combination of original dataset and

synthetic dataset; where X is the original dataset; x_sythentic is the synthetic dataset

generated by SMOTE; X_combined

Then, synthetic dataset generated by SMOTE is calculated as:

x_synthetic = x + (K - x)*rand(0,1) (3.1)

Where x is minority class samples; K is number of nearest neighbours; rand(0,1) is a

random number between 0 and 1

Then, oversampling rate (T) is calculated as:

𝑁∗𝐾
𝑇= (3.2)
𝑁−1

62
Where N is number of minority class samples

3.2.2 Decision Tree

Decision Tree is used to create model for predicting the value of a target variable

based on input features. Gini impurity metric was used to evaluate the quality of a split

in the traffic congestion predictive model developed. It was used to measure the

likelihood of a randomly chosen element being misclassified in the traffic congestion

dataset acquired. The mathematical model for Gini impurity used for the traffic

congestion prediction is shown in equation 3.3.

The Gini impurity G (D) is defined as:


𝑛
2
𝐺 (𝐷 ) = 1 − ∑ 𝑝 (3.3)
𝑖
𝑖=1

Where:

pi is the proportion of class i (parameters used in the prediction of traffic congestion)

in the Dataset D.

D is the dataset of the traffic congestion.

3.2.3 Random Forest

Random forest is an ensemble method used to improve the accuracy of decision

tree prediction. On a different random subset of the training data, each tree in the forest

is trained to evaluate the quality of a split in the traffic congestion predictive model

developed. This subset is created by random sampling with replacement. Mathematical

model for random forest is calculated as follows:

Let D = {(X1, Y1), (X2, Y2),…, (Xn, Yn)}

Prediction is made through majority voting as follows:

Y = mode{hk(X)}k =1 (3.4)

Where:

63
D is the dataset of the traffic congestion

Xi is a relevant feature (parameters used in the prediction of traffic congestion)

Yi is the target variable (output)

K-th is denoted as hk(X)

3.2.4 Deep Neural Network (DNN)

Deep neural network is an approach that combines different layers of neural

network models. Input features were fed into input layer for process analysis. Two

hidden layers were used to transform input features into next levels through weighted

connections and activation functions. Activation function is calculated as follows:

𝑎(𝑙) = 𝑓(𝑧 (𝑙) ) (3.5)

ReLU is calculated as follows:

Z = max(0, z) (3.6)

The process continues through all layers until the output layer l:

𝑧 (𝑙) = 𝑊 (𝑙) . 𝑎(𝑙−1) + 𝑏 (𝑙) (3.7)

Where:

w is the weight in layer l-1

a is the activation function in layer l-1

b is the bias for l

z is the weighted to layer l

3.2.5 Long Short Term Memory Recurrent Neural Network (LSTM-RNN)

LSTM-RNN is a recurrent neural network that retains long-term dependencies

in the data and it is used in time series prediction. It consists of forget gate, input gate

and output gate. Forget gate was used to remove unwanted information from the cell

state. Input gate was used to store new information in the cell state while output gate

was used to determine what part of cell state to output in the next time step as the hidden

64
state. ft decides how much of the previous cell state (Ct-1 ) should be passed to the next

step. Forget gate is calculated as follows:

ft = σ(Wf . [ht-1, Xt] + bf) (3.8)

Where σ is the sigmoid activation function, W f and bf are the weight and bias

parameters. Thereafter, input gate is generated as:

it = σ(Wi . [ht-1, Xt] + bi) (3.9)

Input features were fed into the cell state through input gate to predict traffic congestion

and it generated update cell state as follows:

ῦt = tanh(Wv . [ht-1, Xt] + bv) (3.10)

Output gate is determined based on the updated cell state that passed through tanh as

follows:

Ot = σ(Wo . [ht-1, X t] + bo) (3.11)

The hidden state ht is then obtained as follows:

ht = O t . tanh(Ct) (3.12)

3.3 Model Simulation

Model simulation on the collected dataset for the development of predictive

model for road traffic congestion was done by splitting the dataset into two subsets.

The larger part which is 80% consisting of the training dataset were used to build the

predictive model while the smaller part consisting of 20% dataset were used to validate

the performance of the predictive model. The Simulation was done on Python

environment using web-based Google Colaboratory.

3.4 Model Validation

The model used 20% test dataset to validate the performance of the predictive

model. The simulation done in this study were evaluated, and the results of the model

65
validation were reported on a confusion matrix. The performance evaluation metrics

were used for evaluating the performance of the predictive model include accuracy,

precision, recall, F1 Score, specificity, execution time for each of the algorithms.

3.4.1 Accuracy Score


Model accuracy is a machine learning classification model performance metric

that is defined as the ratio of true positives and true negatives to all positive and negative

observations. The closer the value is to 100% the better the model. In other words,

accuracy tells us how often we can expect our machine learning model to correctly

predict an outcome out of the total number of times it made predictions as shown in

equation 3.14.

(𝑇𝑃+𝑇𝑁)
𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 𝑆𝑐𝑜𝑟𝑒 = (𝑇𝑃+𝐹𝑁+𝑇𝑁+𝐹𝑃) ˟ 100% (3.13)

Where:

TP (True Positive): The amount of time the model predicted 1 when the actual value

was 1.

TN (True Negative): The amount of time the model predicted 0 when the actual

value was 0.

FN (False Negative): The amount of time the model predicted 0 when the actual

value was 1.

FP (False Positive): The amount of time the model predicted 1 when the actual value

was 0.

66
3.4.2 Precision

Precision is the number of correct cases returned by the model. The closer the

value is to 1, the better the model

𝑇𝑃
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 = (3.14)
𝑇𝑃+𝐹𝑃

3.4.3 Recall or Sensitivity

Recall is the number of positives returned by the model. The closer the value is

to 1, the better the model.


𝑇𝑃
𝑅𝑒𝑐𝑎𝑙𝑙 = (3.15)
𝑇𝑃+𝐹𝑁

3.4.4. Specificity

Specificity is the number of negatives returned by the model. The closer the

value is to 1, the better the model.


𝑇𝑁
𝑆𝑝𝑒𝑐𝑖𝑓𝑖𝑐𝑖𝑡𝑦 = (3.16)
𝑇𝑁+𝐹𝑃

3.4.5 F1 Score

F1score is an evaluation metric that measures a model's accuracy. It combines

the precision and recall scores of a model into a single metric to gain a better

understanding of model performance.


𝑇𝑁
𝐹1 = 1 (3.17)
𝑇𝑃+2(𝐹𝑃+𝐹𝑁)

3.4.6 Confusion Matrix

Confusion matrix is a table that displays the number of correct and incorrect

predictions made by a classification model. It helps in evaluating the performance of

the model by comparing its predictions against the actual values. The explanation of

the terms associated with confusion matrix are as follows:

True Positives (TP): It is the case when both actual class & predicted class of data

point is 1.

67
True Negatives (TN): It is the case when both actual class & predicted class of

data point is 0.

False Positives (FP): It is the case when actual class of data point is 0 & predicted

class of data point is 1.

False Negatives (FN): It is the case when actual class of data point is 1 & predicted

class of data point is 0.

The confusion matrix is used to summarize the performance of the classification

algorithm. Table 3.2 shows a Three-level classification confusion matrix including

light-congestion, medium-congestion, and high congestion for the road network.

Table 3.2: Confusion matrix

Predicted Value

Congestion Light Medium High

Light LL LM LH
Actual value

Medium ML MM MH

High HL HM HH

Source: Field Work (2024)

Where:

LL: Light-congestion is predicted truly

LM: Light-congestion is predicted as Medium-congestion

LH: Light-congestion is predicted as High-congestion

ML: Medium-congestion is predicted as Light-congestion

MM: Medium-congestion is predicted truly

MH: Medium-congestion is predicted as High-congestion

HL: High-congestion is predicted as Light-congestion

HM: High-congestion is predicted as Medium-congestion

HH: High-congestion is predicted truly

68
3.5 Integration of the LSTM-RNN Model for Road Traffic Congestion into a

Web and Mobile Applications

3.5.1 Web Application

This section expounds the methodology for integrating the LSTM-RNN model

for road traffic congestion into a web application. The aim is to provide an accessible

and interactive interface for users to predict traffic congestion. This integration

promotes the deployment of the model by allowing users to input traffic parameters and

receive real-time prediction from the user's end and at the backend for the traffic

wardens and transportation companies.

a. Framework Selection

i. Flask: A lightweight WSGI web application framework in Python called Flask

was used for its flexibility and simplicity. It permits rapid development of web

applications with minimal overhead.

ii. HTML and CSS: HTML (HyperText Markup Language) structures the web

pages, while CSS (Cascading Style Sheets) was employed for styling, ensuring

a user-friendly and visually appealing interface.

iii. JavaScript: JavaScript improves the interactivity of the web application,

handling client-side operations and improving user experience.

b. Building the Flask Application

i. Setup: Begins by setting up a Flask project. Install Flask and other necessary

libraries using pip.

pip install Flask transformers keras

ii. Application Structure: The application was structured into several

components: the main application script, templates (HTML files), and static

files (CSS and JavaScript).

69
iii. Main Application Script (app.py): The script initialized the Flask application

and defined routes for handling user inputs and displaying results.

c. Creating the User Interface (HTML Templates): Created HTML templates

to structure the web pages. The primary templates include index.html for the

input form and result.html for displaying the prediction results.

d. Enhancing Interactivity with JavaScript: JavaScript was employed to

enhance the user experience by validating input and providing instant feedback.

e. Styling the Web Application CSS (styles.css): Used CSS to style the web

application, ensuring a professional and user-friendly interface.

3.5.2 Mobile Application

Integrating the LSTM-RNN model into a mobile application necessitates a

seamless blend of deep learning approaches with mobile software development. The

objective is to deploy a robust predictive system for road traffic congestion that operates

efficiently on mobile devices. The integration process includes model serialization,

interface design, and backend development, all implemented within the mobile

ecosystem using Java and associated toolkits.

a. Model Serialization and Preparation: The initial step in this integration is the

serialization of the trained LSTM-RNN model. This involves converting the

Python-based deep learning model into a format for the Android application.

i. Model Exportation: After training the model in Python using the Google Colab

environment, the model is serialized using the pickle module. This serialization

captures the model's architecture, weights, and necessary metadata. The

serialized model is then saved in a format (e.g., .pkl) that can be transferred to

the mobile development environment.

70
ii. TensorFlow Lite Conversion: To optimize the model for mobile deployment,

the serialized model is converted to TensorFlow Lite (TFLite) format. This step

reduces the model's size and enhances its inference speed on mobile devices.

The conversion is accomplished using TensorFlow’s TFLiteConverter,

ensuring that the model retains its predictive accuracy while becoming more

resource-efficient.

b. Integration with Mobile Application

i. Android Studio Setup: The development of the Android application was

conducted within the Android Studio Integrated Development Environment

(IDE), which offers robust support for Java programming and Android

development. Android Studio is configured to include necessary libraries, such

as TensorFlow Lite, via Gradle dependencies, which will facilitate the

integration of the machine learning model.

ii. User Interface (UI) Design: The UI was designed using XML layouts in

Android Studio, ensuring that it is intuitive and user-friendly.

iii. Model Inference using TensorFlow Lite: The TensorFlow Lite model was

loaded into the Android application using the TensorFlow Lite Interpreter API,

which allows the application to perform inference. The user input was

preprocessed to match the format expected by the model. This preprocessing is

implemented in Java to ensure compatibility with Android’s runtime

environment.

c. Backend Development and Data Handling

i. Data Storage and Retrieval: The application utilized local storage or a remote

database (e.g., Firebase) to store and retrieve user predictions. This storage

ensures that users can track their past results. The data handling is managed

71
using Android’s Room Persistence Library for local databases or Firebase

Realtime Database for cloud-based storage.

ii. Integration with Flask Backend (Optional): If server-side processing was

required (e.g., for more complex tasks), the Android application communicates

with a Flask backend. The backend can be hosted on a cloud platform, enabling

real-time model updates and data management. The communication between

the Android application and the Flask backend is facilitated using RESTful

APIs over HTTP. JSON is used for data serialization and deserialization during

these exchanges.

3.5.3 LSTM-RNN INTEGRATION

Integrating the LSTM-RNN model for road traffic congestion prediction into a

web using Flask, jinja2, and Pickle, while mobile application using Java programming,

and android toolkits offers a practical solution for deploying road traffic congestion

prediction into Web and Android views. This technique ensures usability, accessibility

and provides a platform for users to interact with the model endlessly.

72
CHAPTER FOUR
RESULTS AND DISCUSSION OF FINDINGS

4.1. Result of Road Traffic Congestion Dataset

The statistical summary of the traffic congestion dataset provided an insightful

overview of key variables that were used for data analysis. The detailed analysis was

presented in Table 4.1, summarizing the type of attribute, categorical value and

numerical value for each variable.

73
Table 4.1: Numerical values for categorical data

Type of attribute Categorical value Numerical value


'Holiday' No holiday, holiday 1,2 respectively
'Narrow_road_network Narrow road network, No Narrow road 0,1 respectively
network
'Bad_access_road Bad access road, No Bad access road 0,1 respectively
Presence_of_too_many_vehicle No presence of many vehicles, 1,2 respectively
s_on_the_road' Presence of many vehicles
'Accident' No 'Accident', 0,1 respectively
'Accident'
'Weather' Bad 'Weather', 1,2 respectively
Good Weather
'Rain' No rain, Light rain, Moderate rain, 1,2,3,4
4Heavy rain respectively
Presence_of_traffic_control_off Presence_of_traffic_control_officer, 1,2 respectively
icer No
Presence_of_traffic_control_officer
'Potholes' No 'Potholes', Light 'Potholes', 1,2,3,4
Moderate 'Potholes', High 'Potholes' respectively
Poor_drainage Poor_drainage, No Poor_drainage 1,2 respectively
Fault_vehicle No Fault_vehicle, Fault_vehicle 1,2 respectively

Source: Field Work (2024)

74
4.2 Model Formulation

4.2.1 Result of Decision Tree Model

The result of Decision Tree Model as shown in figure 4.1 and Table 4.2.

Figure 4.1: Result of Decision Tree Model

Source: Field Work (2024)

75
Table 4.2: Result of Decision Tree Model

S/No Validation Metric Result

1 Accuracy 79%

2 Precision 0.7922780624081572

3 Recall 0.7883008356545961

4 F1-Score 0.7892611317349966

5 Specificity 0.7910447761194029

Source: Field Work (2024)

76
4.2.1.1 Discussion on Decision Tree Confusion Matrix

Decision Tree prediction model was built by taking the road network datasets.

Consequently, the model generated confusion matrix as shown in Figure 4.2 and Table

4.3 which could be used to compute performance evaluation metrics. The confusion

matrix showed that out of 134 data classified as predicted value in row 1, 106 was

actually classified as light-congestion, 27 was classified as medium-congestion while 1

was classified as high-congestion. It also showed that out of 122 data classified as

predicted value in column 1, 106 was actually classified as light-congestion, 15 was

classified as medium-congestion while 1 was classified as high-congestion. The

confusion matrix showed that out of 161 data classified as predicted value in row 2, 15

was actually classified as light-congestion, 129 was classified as medium-congestion

while 17 was classified as high-congestion. It also showed that out of 173 data classified

as predicted value in column 2, 27 was actually classified as light-congestion, 129 was

classified as medium-congestion while 15 was classified as high-congestion. The

confusion matrix showed that out of 64 data classified as predicted value in row 3, 1

was actually classified as light-congestion, 15 was classified as medium-congestion,

while 48 was classified as high-congestion. It also showed that out of 66 data classified

as predicted value in column 3, 1 was actually classified as light-congestion, 15 was

classified as medium-congestion, while 48 was classified as high-congestion.

77
Figure 4.2: Python-based Decision tree confusion matrix

Source: Field Work (2024)

78
Table 4.3: Python-based Decision tree confusion matrix

Predicted Value

Congestion Light Medium High

Light 106 27 1
Actual value

Medium 15 129 17

High 1 15 48

Source: Field Work (2024)

79
4.2.1.2 Discussion on Decision Tree Prediction Model

The results showed that the Decision Tree had accuracy of 79% which indicated

a good performance of the model. It also had precision of 0.79; recall of 0.79; F1 Score

of 0.79; and specificity of 0.79. The closer the value is to 1, the better the model.

Feeding testing datasets to the Decision Tree prediction model generated the

prediction probabilities of the three congestion levels. Moreover, the bar chat-based

graphical representation for each of probabilities including ‘Light-congestion’,

Medium-congestion’, and ‘High-congestion’ were shown in Figure 4.3, Figure 4.4, and

Figure 4.5 respectively.

80
Light
120

106

100

80
Actual Value

60

40

27

20

1
0
Light Medium High
Predicted Value

Figure 4.3: Light congestion

Source: Field Work (2024)

81
Medium
140

129

120

100

80
Actual Value

60

40

20 17
15

0
Light Medium High
Predicted Value

Figure 4.4: Medium congestion

Source: Field Work (2024)

82
High
60

50
48

40
Actual Value

30

20

15

10

1
0
Light Medium High
Predicted Value

Figure 4.5: High congestion

Source: Field Work (2024)

83
The probability distribution graph represented the three level congestion predictions in

decreasing order: Medium-congestion, Light-congestion, and High-congestion. There

was a relatively high probability of Medium-congestion and less probability of High-

congestion for the particular testing dataset.

84
4.2.2 Result of Random Forest Model

The result of Random forest model as shown in Figure 4.6 and Table 4.4.

Figure 4.6: Result of Random Forest Model

Source: Field Work (2024)

85
Table 4.4: Result of Random Forest Model

S/No Validation Metric Result


1 Accuracy 82%
2 Precision 0.8250191047460276
3 Recall 0.8217270194986073
4 F1-Score 0.8213715686483147
5 Specificity 0.8432835820895522

Source: Field Work (2024)

86
4.2.2.1 Discussion on Random Forest Confusion Matrix

Random Forest prediction model was built by taking the road network datasets.

Consequently, the model generated confusion matrix as shown in figure 4.7 and Table

4.5 which could be used to compute performance evaluation metrics. The confusion

matrix showed that out of 134 data classified as predicted value in row 1, 113 was

actually classified as light-congestion, 21 was classified as medium-congestion while 0

was classified as high-congestion. It also showed that out of 134 data classified as

predicted value in column 1, 113 was actually classified as light-congestion, 19 was

classified as medium-congestion while 2 was classified as high-congestion. The

confusion matrix showed that out of 161 data classified as predicted value in row 2, 19

was actually classified as light-congestion, 136 was classified as medium-congestion

while 6 was classified as high-congestion. It also showed that out of 173 data classified

as predicted value in column 2, 21 was actually classified as light-congestion, 136 was

classified as medium-congestion while 16 was classified as high-congestion. The

confusion matrix showed that out of 64 data classified as predicted value in row 3, 2

was actually classified as light-congestion, 16 was classified as medium-congestion,

while 46 was classified as high-congestion. It also showed that out of 52 data classified

as predicted value in column 3, 0 was actually classified as light-congestion, 6 was

classified as medium-congestion, while 46 was classified as high-congestion.

87
Figure 4.7: Python-based Random forest confusion matrix

Source: Field Work (2024)

88
Table 4.5: Python-based Random forest confusion matrix

Predicted Value

Congestion Light Medium High

Light 113 21 0
Actual value

Medium 19 136 6

High 2 16 46

Source: Field Work (2024)

89
4.2.2.2 Discussion on Random Forest Prediction Model

The results showed that the Random Forest had accuracy of 82% which

indicated a good performance of the model. It also had precision of 0.83; recall of 0.82;

F1 Score of 0.82; and specificity of 0.84. The closer the value is to 1, the better the

model.

Feeding testing datasets to the Random forest prediction model generated the

prediction probabilities of the three congestion levels. Moreover, the bar chat-based

graphical representation for each of probabilities including ‘Light-congestion’,

Medium-congestion’, and ‘High-congestion’ were shown in, Figure 4.8, Figure 4.9, and

Figure 4.10 respectively.

90
Light
120
113

100

80
Actual Value

60

40

21
20

0
0
Light Medium High
Predicted Value

Figure 4.8: Light-congestion

Source: Field Work (2024)

91
Medium
160

140 136

120

100
Actual Value

80

60

40

19
20

0
Light Medium High
Predicted Value

Figure 4.9: Medium congestion

Source: Field Work (2024)

92
High
50

46

45

40

35

30
Actual Value

25

20

16

15

10

0
Light Medium High
Predicted Value

Figure 4.10: High- congestion

Source: Field Work (2024)

93
The probability distribution graph represented the three level congestion predictions in

decreasing order: Medium-congestion, Light-congestion, and High-congestion. There

was a relatively high probability of Medium-congestion and less probability of High-

congestion for the particular testing dataset.

94
4.2.3 Result of Deep Neural Network Model

The result of Decision Tree Model as shown in figure 4.11 and Table 4.2.

Figure 4.11: Result of DNN Model

Source: Field Work (2024)

95
Table 4.6: Result of DNN Model without SMOTE

S/No Validation Metric Result


1 Accuracy 98%
2 Precision 0.98
3 Recall 0.98
4 F1-Score 0.98
5 Specificity 0.97

Source: Field Work (2024)

96
4.2.3.1 Discussion on DNN Confusion Matrix

DNN prediction model was built by taking the road network datasets.

Consequently, the model generated confusion matrix as shown in Figure 4.12 and Table

4.7 which was used to compute performance evaluation metrics. The confusion matrix

shows that out of 728 data classified as predicted value in row 1, 725 was actually

classified as light-congestion, 3 was classified as medium-congestion while 0 was

classified as high-congestion. It also shows that out of 736 data classified as predicted

value in column 1, 725 was actually classified as light-congestion, 11 was classified as

medium-congestion while 0 was classified as high-congestion. The confusion matrix

shows that out of 126 data classified as predicted value in row 2, 11 was actually

classified as light-congestion, 109 was classified as medium-congestion while 6 was

classified as high-congestion. It also shows that out of 112 data classified as predicted

value in column 2, 3 was actually classified as light-congestion, 109 was classified as

medium-congestion while 0 was classified as high-congestion. The confusion matrix

shows that out of 72 data classified as predicted value in row 3, 0 was actually classified

as light-congestion, 0 was classified as medium-congestion, while 72 was classified as

high-congestion. It also shows that out of 78 data classified as predicted value in column

3, 0 was actually classified as light-congestion, 6 was classified as medium-congestion,

while 72 was classified as high-congestion.

97
Figure 4.12: Python-based DNN confusion matrix

Source: Field Work (2024)

98
Table 4.7: Python-based DNN without SMOTE confusion matrix
Predicted Value

Congestion Light Medium High

Light 725 3 0
Actual value

Medium 11 109 6

High 0 0 72

Source: Field Work (2024)

99
4.2.3.2 Discussion on DNN Prediction Model

The results showed that the DNN had accuracy of 98% which indicated a very

high performance of the model. It also had precision of 0.98; recall of 0.98; F1 Score

of 0.98; and specificity of 0.97. The closer the value is to 1, the better the model.

Feeding testing datasets to the Deep Neural Network prediction model

generated the prediction probabilities of the three congestion levels. Moreover, the bar

chat-based graphical representation for each of probabilities including ‘Light-

congestion’, ‘Medium-congestion’, and ‘High-congestion’ are shown in, Figure 4.13,

Figure 4.14, and Figure 4.15 respectively.

100
Light
800

725

700

600

500
Actual Value

400

300

200

100

3 0
0
Light Medium High
Predicted Value

Figure 4.13: Light-congestion

Source: Field Work (2024)

101
Medium
120

109

100

80
Actual Value

60

40

20

11

0
Light Medium High
Predicted Value

Figure 4.14: Medium-congestion

Source: Field Work (2024)

102
High
80

72

70

60

50
Actual Value

40

30

20

10

0 0
0
Light Medium High
Predicted Value

Figure 4.15: High-congestion

Source: Field Work (2024)

103
The probability distribution graph represented the three level congestion predictions in

decreasing order: Medium-congestion, Light-congestion, and High-congestion. There

was a relatively high probability of Light -congestion and less probability of High-

congestion for the particular testing dataset.

104
4.2.3.3 DNN Accuracy and Loss graphs

The DNN graph for the accuracy and loss at epoch 1000 without SMOTE for

the Train and validation accuracy as shown in Figure 4.16 and figure 4.17. The Figure

shows that the model was able to predict the congestion accurately.

105
Figure 4.16: DNN Accuracy graph

Source: Field Work (2024)

106
Figure 4.17: DNN Loss graph

Source: Field Work (2024)

107
4.2.4 DNN Model with SMOTE Result

The result of DNN model with SMOTE as shown in table 4.8.

Table 4.8: Result of DNN Model with SMOTE

S/No Validation Metric Result


1 Accuracy 98%
2 Precision 0.98
3 Recall 0.98
4 F1-Score 0.98
5 Specificity 0.98

Source: Field Work (2024)

108
4.2.4.1 DNN Accuracy and Loss graphs with SMOTE

The DNN graph for the accuracy and loss at epoch 1000 for the Model with

SMOTE algorithm as shown in Figure 4.18 and Figure 4.19. The figure shows that the

model was able to predict the congestion accurately. The accuracy increases as the

epoch interval increases as depicted in Figure 4.18, 4.19.

109
Figure 4.18: DNN Accuracy graph with SMOTE

Source: Field Work (2024)

110
Figure 4.19: DNN Loss graph with SMOTE

Source: Field Work (2024)

111
4.2.5 LSTM-RNN Model Result
The Result of LSTM-DNN model as shown in figure 4.20 and table 4.9.

Figure 4.20 Result of LSTM-RNN Model

Source: Field Work (2024)

112
Table 4.9: Result of LSTM-RNN Model without SMOTE

S/No Validation Metric Result


1 Accuracy 99%
2 Precision 0.99
3 Recall 0.99
4 F1-Score 0.99
5 Specificity 0.97

Source: Field Work (2024)

113
4.2.5.1 Discussion on LSTM-RNN Confusion Matrix

LSTM-RNN prediction algorithm was designed by taking the road network

datasets. Consequently, the model generated confusion matrix as shown in Figure 4.21

and Table 4.10 which could be used to compute performance evaluation metrics. The

confusion matrix shows that out of 728 data classified as predicted value in row 1, 727

was actually classified as light-congestion, 1 was classified as medium-congestion

while 0 was classified as high-congestion. It also shows that out of 738 data classified

as predicted value in column 1, 727 was actually classified as light-congestion, 11 was

classified as medium-congestion while 0 was classified as high-congestion. The

confusion matrix shows that out of 120 data classified as predicted value in row 2, 11

was actually classified as light-congestion, 109 was classified as medium-congestion

while 0 was classified as high-congestion. It also shows that out of 111 data classified

as predicted value in column 2, 1 was actually classified as light-congestion, 109 was

classified as medium-congestion while 1 was classified as high-congestion. The

confusion matrix shows that out of 3 data classified as predicted value in row 3, 0 was

actually classified as light-congestion, 1 was classified as medium-congestion, while 2

was classified as high-congestion. It also shows that out of 2 data classified as predicted

value in column 3, 0 was actually classified as light-congestion, 0 was classified as

medium-congestion, while 2 was classified as high-congestion.

114
Figure 4.21: Python-based LSTM-RNN confusion matrix

Source: Field Work (2024)

115
Table 4.10: Python-based LSTM -RNN without SMOTE confusion matrix

Predicted Value

Congestion Light Medium High

Light 727 1 0
Actual value

Medium 11 109 0

High 0 1 2

Source: Field Work (2024)

116
4.2.5.2 Discussion on LSTM-RNN Prediction Model

The results showed that the LSTM-RNN had accuracy of 99% which indicated

a very high performance of the model. It also had precision of 0.99; recall of 0.99; F1

Score of 0.99; and specificity of 0.97. The closer the value is to 1, the better the model.

Feeding testing datasets to the LSTM -RNN prediction model generated the

prediction probabilities of the three congestion levels. Moreover, the bar chat-based

graphical representation for each of probabilities including ‘Light-congestion’,

Medium-congestion’, and ‘High-congestion’ were shown in, Figure 4.22, Figure 4.23,

and Figure 4.24 respectively.

117
Light
800

727

700

600

500
Actual Value

400

300

200

100

1 0
0
Light Medium High
Predicted Value

Figure 4.22: Light-congestion

Source: Field Work (2024)

118
Medium
120

109

100

80
Actual Value

60

40

20

11

0
0
Light Medium High
Predicted Value

Figure 4.23: Medium-congestion

Source: Field Work (2024)

119
High
80

72

70

60

50
Actual Value

40

30

20

10
6

0
0
Predicted Value

Figure 4.24: High-congestion

Source: Field Work (2024)

120
The probability distribution graph represented the three level congestion predictions in

decreasing order: Medium-congestion, Light-congestion, and High-congestion. There

was a relatively high probability of Light -congestion and less probability of High-

congestion for the particular testing dataset.

121
4.2.5.3 LSTM-RNN Accuracy and Loss graphs

The LSTM-RNN graph for the accuracy and loss at epoch 1000 without

SMOTE as shown in Figure 4.25 and Figure 4.26. The figure showed that the model

was able to predict the congestion accurately.

122
Figure 4.25: LSTM-RNN Accuracy graph

Source: Field Work (2024)

123
Figure 4.26: LSTM-RNN Loss graph

Source: Field Work (2024)

124
4.2.6 Result of LSTM-RNN Model with SMOTE

The result of LSTM-RNN model with SMOTE as shown in table 4.11.

Table 4.11: Result of LSTM-RNN Model with SMOTE

S/No Validation Metric Result


1 Accuracy 98%
2 Precision 0.98
3 Recall 0.98
4 F1-Score 0.98
5 Specificity 0.98

125
4.2.6.1 LSTM-RNN Accuracy and Loss graphs with SMOTE

The LSTM-RNN graph for the accuracy and loss at epoch 1000 for the Model with

SMOTE algorithm is as shown in Figure 4.27 and Figure 4.28.

126
Figure 4.27: LSTM-RNN Accuracy graph with SMOTE

Source: Field Work (2024)

127
Figure 4.28: LSTM-RNN Loss graph with SMOTE

Source: Field Work (2024)

128
4.3 Model Simulation

Model simulation was done using Python programming language to split the

dataset into two subsets. The larger part which is 80% consisting of the training dataset

were used to build the predictive model while the smaller part consisting of 20% dataset

were used to validate the performance of the predictive model. The Simulation was

done on Python environment using web-based Google Colaboratory.

4.4 Model Validation

The model used 20% test dataset to validate the performance of the predictive

model. The performance evaluation metrics used to evaluate the performance of the

predictive model were accuracy, precision, recall, f1 score, specificity, execution time

(secs) for each of the algorithms.

4.5 Comparison of traffic congestion models based on Evaluation Metrics

4.5.1 Accuracy

The results showed accuracy (%) of 79, 82, 98, 99 for Decision Tree, Random

Forest, Deep Neural Network and Long Short Term Memory Recurrent Neural

Network algorithms respectively as shown in Figure 4.29. The accuracy of the LSTM-

RNN algorithm is higher compared to Decision Tree, Random Forest and Deep Neural

Network algorithms for the traffic dataset divided into 80% 20% as shown in Table

4.12.

129
Table 4.12: Accuracy of the Algorithms used

S/N Algorithm Accuracy (%)


1 Decision Tree 79%
2 Random Forest 82%
3 Deep Neural Network 98%
4 LSTM-RNN 99%

Source: Field Work (2024)

130
Figure 4.29: Comparison of traffic congestion models based on accuracy

Source: Field Work (2024)

131
4.5.2 Precision

The results showed precision of 0.79, 0.83, 0.98, 0.99 for Decision Tree,

Random Forest, Deep Neural Network and Long Short Term Memory Recurrent Neural

Network algorithms respectively as shown in Figure 4.30. The precision of the Long

Short Term Memory Recurrent Neural Network algorithm is higher compared to and

Decision Tree, Random Forest, Deep Neural Network algorithms for the traffic dataset

divided into 80% 20% as shown in Table 4.13. Based on the values of the precision for

the four algorithms which is close to 1 showed that the model prediction was right.

132
Table 4.13: Precision of the Algorithms used

S/N Algorithm Precision


1 Decision Tree 0.79
2 Random Forest 0.83
3 Deep Neural Network 0.98
4 LSTM-RNN 0.99

Source: Field Work (2024)

133
Figure 4.30: Comparison of traffic congestion models based on precision

Source: Field Work (2024)

134
4.5.3 Recall

The results showed recall of 0.79, 0.82, 0.98, 0.99 for Decision Tree, Random

Forest, Deep Neural Network and Long Short Term Memory Recurrent Neural

Network algorithms respectively as shown in Figure 4.31. The recall of the Long Short

Term Memory Recurrent Neural Network algorithm is higher compared to Decision

Tree, Random Forest and Deep Neural Network algorithms for the traffic dataset

divided into 80% 20% as shown in Table 4.14. Based on the values of the recall for the

four algorithms which is close to 1 depicted that the model prediction was right.

135
Table 4.14: Recall of the Algorithms used

S/N Algorithm Recall


1 Decision Tree 0.79
2 Random Forest 0.82
3 Deep Neural Network 0.98
4 LSTM-RNN 0.99

Source: Field Work (2024)

136
Figure 4.31: Comparison of traffic congestion models based on recall

Source: Field Work (2024)

137
4.5.4 F1 Score

The results showed F1 Score of 0.79, 0.82, 0.98, 0.99 for Decision Tree, Random

Forest, Deep Neural Network and Long Short Term Memory Recurrent Neural

Network algorithms respectively as shown in Figure 4.32. The F1 Score of the Deep

Neural Network algorithm is higher compared to Decision Tree, Random Forest and

Long Short Term Memory Recurrent Neural Network algorithms for the traffic dataset

divided into 80% 20% as shown in Table 4.15. Based on the values of the F1 Score for

the four algorithms which is close to 1 depicted that the model prediction was right.

138
Table 4.15: F1 Score of the Algorithms used

S/N Algorithm F1 Score


1 Decision Tree 0.79
2 Random Forest 0.82
3 Deep Neural Network 0.98
4 LSTM-RNN 0.99

Source: Field Work (2024)

139
Figure 4.32: Comparison of traffic congestion models based on F1 Score

Source: Field Work (2024)

140
4.5.5 Specificity

The results showed specificity of 0.79, 0.84, 0.98, 0.97 for Decision Tree, Random

Forest, Deep Neural Network and Long Short Term Memory Recurrent Neural

Network algorithms respectively as shown in Figure 4.33. The specificity of the Deep

Neural Network algorithm is higher compared to Decision Tree, Random Forest and

Long Short Term Memory Recurrent Neural Network algorithms for the traffic dataset

divided into 80% 20% as shown in Table 4.16. Based on the values of the specificity

for the four algorithms which is close to 1 showed that the model prediction was right.

141
Table 4.16: Specificity of the Algorithms used

S/N Algorithm Specificity


1 Decision Tree 0.79
2 Random Forest 0.84
3 Deep Neural Network 0.98
4 LSTM-RNN 0.97

Source: Field Work (2024)

142
Figure 4.33: Comparison of traffic congestion models based on specificity
Source: Field Work (2024)

143
4.5.6 Execution Times

The results showed execution times (secs) of 0.01, 0.45, 415.62, 566.12 for Decision

Tree, Random Forest, Deep Neural Network and Long Short Term Memory Recurrent

Neural Network algorithms respectively as shown in Figure 4.34. With respect to the

execution times, Random Forest algorithm has fastest speed compare to Decision Tree,

Deep Neural Network and Long Short Term Memory Recurrent Neural Network

algorithms as shown in Table 4.17.

144
Table 4.17: Execution Times of the Algorithms used

S/N Algorithm Execution Time (secs)


1 Decision Tree 0.45
2 Random Forest 0.01
3 Deep Neural Network 415.62
4 LSTM-RNN 566.12

Source: Field Work (2024)

145
Figure 4.34: Comparison of traffic congestion models based on execution times

Source: Field Work (2024)

146
Figure 4.35: Execution time of the algorithms used

Source: Field Work (2024)

147
Having compared the four models, it can be deduced that LSTM-RNN model with

(99%) is more effective and accurate in predicting traffic congestion than Deep Neural

Network (98%), Random Forest (82%) and Decision Tree (79%). The accuracy of

LSTM-RNN and DNN developed in this thesis showed higher predictive rate compared

to the accuracy found in the literature Ramchandra & Rajabhushanam (2021), and

Tamir et al (2020) which is 94.3% and 97% accuracy respectively.

4.6 Results of the Web and Mobile Prototype for Traffic Congestion Predictive

Model

4.6.1 Web-based Prototype Result for Traffic Congestion Prediction

a. Home Page Web-based Prototype for Traffic Congestion Prediction

The prototype interface for traffic congestion predictive model, as depicted

below in figure 4.36, provided a straightforward and user-friendly platform for

predicting traffic congestion. The interface features a text input box where users

can select 1 or 2 and press 'Submit' button to predict traffic congestion based on

traffic parameters’ input.

b. User Interaction

The primary interaction element in this prototype is the number input boxes that

users can use to select 1 or 2 on each traffic parameter. The clear and concise

instructions ensure that users understand how to use the tool effectively. Once

the number is entered, users can click the 'Submit' button to predict traffic

prediction.

c. Functional Flow

i. Number Input: Users select a number in the provided number boxes.

ii. Prediction Process: Clicking the 'Submit' button initiates traffic congestion

iii. prediction process.

148
iv. Backend Processing: The entered number is sent to the backend, where the

LSTM-RNN model processes the input to predict traffic congestion.

v. Result Presentation: Traffic congestion prediction (Traffic is Medium) is

displayed alongside the input text, providing clear feedback to the user.

d. Significance and Application

This prototype demonstrates the practical application of LSTM-RNN model for

traffic congestion prediction. The user-friendly interface was designed for ease

of use, making it accessible to traffic managers/warders, researchers, and

drivers. The immediate traffic prediction results offer valuable insights into

drivers’ satisfaction.

149
Figure 4.36: Web-based Prototype Results for Traffic Congestion Prediction

Source: Field Work (2024)

150
4.6.2 Mobile Prototype Result for Traffic Congestion Prediction

a. Home Page Web-based Prototype for Traffic Congestion Prediction

The prototype interface for traffic congestion prediction model, as depicted

below in figure 4.37 and 4.38, provides a straightforward and user-friendly

platform for predicting traffic congestion. The interface features a text input box

where users can select 1 or 2 and press 'Submit' button to predict traffic

congestion based on traffic parameters’ input.

b. User Interaction

The primary interaction element in this prototype is the number input boxes that

users can use to select 1 or 2 on each traffic parameter. The clear and concise

instructions ensure that users understand how to use the tool effectively. Once

the number is entered, users can click the 'Submit' button to predict traffic

prediction.

c. Functional Flow

i. Number Input: Users select a number in the provided number boxes.

ii. Prediction Process: Clicking the 'Submit' button initiates traffic congestion

prediction process.

iii. Backend Processing: The entered number is sent to the backend, where the

LSTM-RNN model processes the input to predict traffic congestion.

iv. Result Presentation: Traffic congestion prediction (Traffic is Medium) is

displayed alongside the input text, providing clear feedback to the user.

d. Significance and Application

This prototype demonstrates the practical application of LSTM-RNN model for

traffic congestion prediction. The user-friendly interface was designed for ease

of use, making it accessible to traffic managers/warders, researchers, and

151
drivers. The immediate traffic prediction results offer valuable insights into

drivers’ satisfaction.

152
Figure 4.37: Mobile Prototype Results for Traffic Congestion Prediction

Source: Field Work (2024)

153
Figure 4.38: Mobile Prototype Results for Traffic Congestion Prediction

Source: Field Work (2024)

154
CHAPTER FIVE

SUMMARY, CONCLUSION AND RECOMMENDATIONS

5.1 Summary

This study analyzed the effectiveness of two machine learning algorithms and

two deep learning algorithms on traffic dataset collected through mixed research

method. The dataset contains 14 attributes and 4600 instances which were further

divided into 80% for training and 20% for testing. The dataset was used to formulate

predictive models for traffic congestion. The results showed that LSTM-RNN model

demonstrated superior overall performance, achieving an accuracy of 99% compared

to Deep Neural Network (98%), Random Forest (82%) and Decision Tree (79%).

Regarding the precision, the LSTM-RNN model had highest performance of 0.99

compared to Deep Neural Network (0.98), Random Forest (0.83) and Decision Tree

(0.79). With respect to the recall, the LSTM-RNN model had highest performance of

0.99 compared to Deep Neural Network (0.98), Random Forest (0.82) and Decision

Tree (0.79). In terms of F1-Score, the Deep Neural Network model had highest

performance of 0.98 compared to LSTM-RNN (0.97), Random Forest (0.82) and

Decision Tree (0.79). With regards to Specificity, both Deep Neural Network and Long

Short Term Memory Recurrent Neural Network models had highest performance of

0.97 compared to Random Forest (0.84) and Decision Tree (0.79). The Decision Tree

model had fastest execution time of 0.01 secs compared to Random Forest (0.45 secs),

Deep Neural Network (415.62 secs) and Long Short Term Memory Recurrent Neural

Network (566.12 secs). Notably, both DNN with SMOTE and LSTM-RNN with

SMOTE outperformed other models in terms of specificity scores.

155
5.2 Conclusion

In this study, two machine learning algorithms (Decision Tree and Random

Forest) and two deep learning algorithms (DNN and LSTM-RNN) were used to build

a predictive model that can be used to predict road traffic congestion in Lagos. The

formulation and simulation of the predictive models were carried out using Python

Google Colab environment. The results showed that the LSTM-RNN model achieved

highest prediction accuracy followed by Deep Neural Network, Random Forest and

Decision Tree respectively.

5.3 Recommendations

Based on the findings of this research, the following recommendations are

proposed:

a. The model should be integrated into existing traffic policies which capture

monitoring and tracking of information that are associated with factors causing

congestion.

b. Traffic managers should utilize the model to predict traffic congestion.

c. The model should be continuously updated and fine-tuned with new data to

maintain its accuracy and relevance.

5.4 Contribution to Knowledge

a. It developed user-friendly prototype for real-time transportation data to predict

traffic congestion.

b. This integration promoted model accuracy and relevance by focusing on the

most relevant features for road traffic congestion prediction.

c. It provided a framework for selecting appropriate machine learning and deep

learning models based on specific needs.

156
d. The study addressed gaps found in the literature reviewed to forecast the traffic

congestion.

157
REFERENCES

Adekanmbi, O. (2018). Artificial Intelligence Simplified: 99 Use Cases and Expert

Thought. Published by Data Science Nigeria. (2018). ISBN: 978-0-9984014-1-6.

Adetiloye, T. O. (2018). Predicting Short Term Traffic Congestion on Urban Motorway

Networks. (Unpublished Doctoral Thesis, Concordia University Montréal,

Québec, Canada). https://spectrum.library.concordia.ca/id/eprint/985249/

Akçelik, R., Besley, M. & Thompson, D. (2000). Microsimulation and analytical

methods for modelling urban traffic. Traffic, no. 4/2000.

Albon, C. (2018). Machine Learning with Python Cookbook. Practical Solutions from

Preprocessing to Deep Learning. Published by O’Reilly Media, Inc., 1005

Gravenstein Highway North, Sebastopol, CA 95472.

Almehmadi, A., Bosakowski, T., Sedky, M. & Bastaki, B. B. (2020). HTM based

anomaly detecting model for traffic congestion. In 2020 4th International

Conference on Cloud and Big Data Computing (ICCBDC), August 26–28,

2020, Virtual, United Kingdom, (pp. 97-101). ACM ISBN 978-1-4503-7538-2.

https://doi.org/10.1145/3416921.3416941

Alshamrani, F. H., Syed, H. F. & Elhussein, M. A. (2019). Machine learning based

model for traffic prediction in smart cities. 2nd Smart Cities Symposium, March

24-26, 2019, University of Bahrain.

Alqudah, N., & Yaseen, Q. (2020). Machine Learning for Traffic Analysis: A Review.

International Workshop on Data-Driven Security (DDS 2020) April 6-9, 2020,

Warsaw, Poland. Procedia Computer Science 170(2020), 911–916.

Amitha, M., Amudha, P. & Sivakumari, S. (2020). Deep learning techniques: An

Overview. Advanced Machine Learning Technologies and Applications. pp

559-608.

158
Anzai, Y. (2012). Pattern recognition and machine learning. Published by

Elsevier (2012).

Andrew, M. & Parvathi, R. (2020). Vehicular Traffic analysis and prediction using

Machine learning algorithms. 2020 International Conference on Emerging

Trends in Information Technology and Engineering (ic-ETITE).

https://doi./10.1109@ic-ETITE47903.2020.279

Aronsson, L. & Bengtsson, A. (2019). Machine learning applied to traffic forecasting.

A degree project report submitted to Department of Computer Science and

Engineering, Chalmers University of Technology and University of

Gothenburg, Sweden.

Ata, A., Khan, M. A., Abbas, S., Khan, M. S. & Ahmad, G. (2020). Adaptive IoT

empowered smart road traffic congestion control system using supervised

machine learning algorithm. The Computer Journal, 2(1), 1-8

https://doi/10.1093/comjnl/bxz129

Ata, A., Khan, M. A., Abbas, S., Ahmad, G. & Fatima, A. (2019). Modelling smart

road traffic congestion control system using machine learning techniques.

Neural Network World, pp. 99-110. https://doi/10.14311/NNW.2019.29.008

Athanasopoulos, G. & Hyndman, R. J. (2018). Forecasting: principles and practice, 2 nd

edition. https://otexts.com/fpp2/

Babu, P. T. (2019). Methodologies for Traffic congestion prediction for a Iot based

smart city using machine learning and CNN. Institute of Scholars. Available in

SSRN eLibrary. Retrieved from SSRN-id3510057.pdf

Bandaragoda, T., De Silva, D., Kleyko, D., Osipov, E., Wiklund, U. & Alahakoon, D.

(2019). Trajectory clustering of road traffic in urban environments using

incremental machine learning in combination with hyperdimensional

159
computing. In 2019 IEEE Intelligent Transportation Systems Conference

(ITSC) Auckland, NZ, October 27-30, 2019.

Banks, J., Carson J., Nelson, B. & Nicol, D. (2001). Discrete-Event System Simulation.

Prentice Hall, pp. 3.

Belyadi, H. & Haghighat, A. (2021). Machine learning guide for oil and gas using

python. Available on www.sciencedirect.com

Bengio, Y., Courville, A. & Vincent, P. (2013). Representation learning: A review and

new perspectives. IEEE Transactions on Pattern Analysis and Machine

Intelligence. 35(8) 1798–1828.

Bini, S. A. (2018). Artificial intelligence, machine learning, deep learning, and

cognitive computing: what do these terms mean and how will they impact health

care? J Arthroplast. 33(8), 2358-61.

https://doi.org/10.1016/j.arth.2018.02.067

Blip systems (2016). Smart traffic sensors help alleviate traffic congestion in

Switzerland. http://blipsystems.com/smart-sensor-switzerland/

Breiman, L. (2001) Random forests. Machine learning, 45(1), 5-32.

Boukerche, A. & Wang, J. (2020). Machine learning-based traffic prediction models

for intelligent transportation systems. Comput Netw. 2020;181.

Carleo, G. (2019). Machine learning and the physical sciences. Reviews of Modern

Physics, 91(4), 045002.

Carl Goves, Robin North, Ryan Johnston & Graham Fletcher (2015). Short term traffic

prediction on the UK motorway network using neural networks. Transportation

Research Procedia 13 (2016) 184 – 195.

Caves, R. W. (2004). Encylopedia of the City. Routledge. p. 141.

Chen, J. X. (2016). The evolution of computing: AlphaGo. Computing in Science &

160
Engineering. 18(4), 4-7.

Chollet, F. (2021). Deep Learning with Python. Second Edition. Published by Manning

Publications Co. ISBN: 9781617296864.

Deb, B., Khan, S. R., Hasan, K. T., Khan, A. H., and Alam, M. D. A. (2019). Travel

time prediction using machine learning and weather impact on traffic

conditions. 5th International Conference for Convergence in Technology (I2CT)

Pune, India. Mar 29-31, 2019. ISBN: 978-1-5386-8075-9 IEEE

Dey, A. (2016). Machine learning algorithms: A review. International Journal of

Computer Science and Information Technologies, 7(3), 1174–1179.

Drucker, H., Surges, C. J. C., Kaufman, L., Smola, A. & Vapnik V. (1997). Support

vector regression machines. Adv. Neural Inf. Process. Syst., 1, 155-161.

Duhayyim, M. A., Albraikan, A. A., Al-Wesabi, F. N., Burbur, H. M., Alamgeer, M.,

Hilal, A. M., Hamza, M. A. & Rizwanullah, M. (2021). Modeling of artificial

intelligence based traffic flow prediction with weather conditions. Computers,

Materials & Continua (CMC), 71(2), pp. 3953-3968.

https://DOI:10.32604/cmc.2022.022692

EndoCode (2015, April 8). Building a stream processing pipeline with Kafka, Storm

and Cassandra – Part 1: Introducing the components [Blog post].

https://endocode.com/blog/2015/04/08/building-a-stream-processing-

pipeline-with-kafka-storm and-cassandra-part-1-introducing-the-

components/.

FHWA (2001). Traffic Flow Theory Revised. A State-of-the-Art Report (2001 revision).

TRB Spec. Rep. 165 Monogr. Traffic Flow Theory, pp. 1-1,12-6.

Fouladgar, M., Parchami, M., Elmasri, R. & Ghaderi, A. (2017). Scalable deep traffic

161
flow neural networks for urban traffic congestion prediction. Proc. Int. Jt. Conf.

Neural Networks, 2017(5), 2251-2258.

Geetha, V., Gomathy, C. K., Harshitha, T. & Varma, P. V. N. (2021). A traffic

prediction for intelligent transportation system using machine learning.

International Journal of Engineering and Advanced Technology (IJEAT),

10(4)166-168. https://DOI:10.35940/ijeat.D2426.0410421

Géron, A. (2017). Hands-on machine learning with Scikit-Learn and TensorFlow:

concepts, tools, and techniques to build intelligent systems. O’Reilly Media,

Inc.

Gerlough, D. L. & Huber, M. J. (1975). Traffic Flow Theory: A Monograph.

Gravvanis, G. A., Salamanis, A. I, & Papadopoulos, C. K. F. (2019). Advanced

Parametric methods for short-term traffic forecasting in the era of big data. vol.

149. Springer International Publishing.

Guerrero-Ibáñez, J., Zeadally S. & Contreras-Castillo, J. (2018). Sensor technologies

for intelligent transportation systems. Sensors, 18(4), 1212.

Hassan, F., Ijaz, A., Ali, M., Afzal, Z. & Arslan, F. (2021). Iot enabled intelligent traffic

congestion handling system empowered by machine learning. International

Journal of Scientific & Technology Research (IJSTR), 10(6), 22-26.

He, L., Levine, R. A., Fan, J., Beemer, J. & Stronach, J. (2018). Random forest as a

predictive analytics alternative to regression in institutional research. Journal of

Practical Assessment, Research & Evaluation, 23(1), 1-15. ISSN 1531-7714.

Hortonworks (2017, June 18). Realtime event processing in Hadoop with Nifi, Kafka

and Storm [Blog post]. http://hortonworks.com/hadoop-tutorial/realtime-

event-processing-nifi-kafka-storm/.

Howell, E. (2013). Navstar: GPS Satellite Network.

162
http://www.space.com/19794-navstar.html.

Huang, F., Wang, C. & Chao, C. (2020). Traffic Congestion Level Prediction Based on

Recurrent Neural Networks. In 2020 International Conference on Artificial

Intelligence in Information and Communication (ICAIIC, 2020), pp. 248-252.

ISBN: 978-1-7281-4985-1 IEEE

Indolia, S., Goswami, A. K., Mishra, S. P. & Asopa, P. (2018). “Conceptual

Understanding of Convolutional Neural Network- A Deep Learning Approach.

Procedia Comput. Sci., 132, 679-688.

Inzunza, M. C., Robles, L. H., Mancilla, M. A. & Neri, E. L. (2020). Traffic prediction

architecture based on machine learning approach for smart cities. Research in

Computing Science 149(11), 23-33.

Jafar Alzubi, Anand Nayyar & Akshi Kumar (2018). Machine Learning from Theory

to Algorithms: An Overview. Second National Conference on Computational

Intelligence (NCCI 2018). IOP Conf. Series: Journal of Physics: Conf.

Series1142 (2019) 012012.

Janković, S., Uzelac, A., Zdravković, S., Mladenović, D., Mladenović, S. & Andrijanić,

I. (2020). Traffic volumes prediction using big data analytics methods.

International Journal for Traffic and Transport Engineering, 11(2), 184-198.

http://dx.doi.org/10.7708/ijtte2021.11(2).01

Janikow, C. Z. (1998). Fuzzy decision trees: issues and methods. IEEE Transactions

on Systems, Man, and Cybernetics, Part B (Cybernetics), 28(1), 1-14.

Jiber, M., Mbarek, A., Yahyaouy, A., Sabri, M. A. & Boumhidi, J. (2020). Road traffic

prediction model using extreme learning machine: The case study of Tangier,

Morocco. Information 2020, 11, 542-549.

163
Jijo, B. T. & Abdulazeez, A. M. (2021). Classification based on decision tree algorithm

for machine learning. Journal of Applied Science and Technology Trends. 2(1),

20-28. doi: 10.38094/jastt20165

Kamble, S. J. & Kounte, M. R. (2020). Machine learning approach on traffic congestion

monitoring system in internet of vehicles. Third International Conference on

Computing and Network Communications (CoCoNet’19). Procedia Computer

Science 171(2020), 2235-2241.

Kerner, B. S. (2009). Traffic congestion, modelling approaches to, in Encyclopedia of

Complexity and Systems Science, R. A. Meyers, Ed., Springer New York.

Kerner, B. S. (2004). The Physics of Traffic. Pulished by Springer, Berlin, New York

2004. https://www.springer.com/physics/com plexity/book/978-3-540-

20716-0.

Kerner, B. (1999). Congested Traffic Flow: Observations and Theory. Transportation

Research Record: Journal of the Transportation Research Board. 1678, 160-

167. https://doi.org/10.3141%2F1678-20. S2CID 108899410 https://api.

semanticscholar.org/CorpusID:1088 99410.

Kong, F., Li, J., Jiang, B., Zhang, T. & Song, H. (2019). Big data-driven machine

learning-enabled traffic flow prediction. Trans Emerging Tel Tech, 2019(30),

e3482. https://doi.org/10.1002/ett.3482

Kumar, V. P. & Sowmya, I. (2021). A review on pros and cons of machine learning

algorithms. Journal of Engineering Sciences, 12(10), 272-276.

Kyaw, T., Nyein, N. & Zaw, W. (2020). Predicting on-road traffic congestion from

public transport GPS data. International Journal of Advances in Scientific

Research and Engineering (ijasre). 6(3), 2454-8006.

https://doi.org/10.31695/IJASRE.2020.33771

164
Lam, W. H. K., Tang, Y. F., Chan, K. S, & Tam, M. L. (2006). Short-term hourly traffic

forecasts using Hong Kong Annual Traffic Census. Transportation (Amst),

33(3), 291-310.

Le, Q. & Schuster, M. (2016). A neural network for machine translation, at production

stage. Retrieved from https://research.googleblog.com/2016/09/a-neural-

network-for-machine.html

Liaw, A. & Wiener, M. (2002). Classification and Regression by randomForest. R

News, 2(3), 18-22.

Li, L., Lin, H., Wan, J., Ma, Z., & Wang, W. (2020). MF-TCPV: A Machine Learning

and Fuzzy Comprehensive Evaluation-Based Framework for Traffic

Congestion Prediction and Visualization. IEEE Access, 8, 227113-227125.

Li, M., Andersen, D. G., Park, J. W., Smola, A. J., Ahmed, A., Josifovski, V., Long, J.,

Shekita, E. J. & Su, B. Y. (2014). Scaling Distributed Machine Learning with

the Parameter Server. InOSDI. 14, 583-598.

Liu, H. & Shetty, R. R. (2021). Analytical Models for Traffic Congestion and Accident

Analysis. Mineta Transportation Institute Publications. pp. 1-16.

https://doi.org/10.31979/mti.2021.2102

López, G., Quesada, L. & Guerrero, L. A. (2017). Alexa vs. siri vs. cortana vs. google

assistant: a comparison of speech-based natural user interfaces. In: International

Conference on Applied Human Factors and Ergonomics, Springer, 241–250.

Majumdar, S., Subhani, M. M., Roullier, B., Anjum, A. & Zhu, R. (2021). Congestion

prediction for smart sustainable cities using IoT and machine learning

approaches. Sustainable Cities and Society, 64(102500), 1-10.

https://doi.org/10.1016/j.scs.2020.102500

Manning, C. (2020). AI-Definitions-HAI. Retrieved from

165
https://hai.stanford.edu/sites/default/files/2020-09/AI-Definitions-HAI.pdf

Maulud, D. & Abdulazeez, A. M. (2020). A review on linear regression comprehensive

in machine learning. Journal of Applied Science and Technology Trends, 1(4),

140-147.

Meena, G., Sharma, D. & Mahrishi, M. (2020). Traffic prediction for intelligent

transportation system using machine learning. 3rd International Conference on

Emerging Technologies in Computer Engineering: Machine Learning and

Internet of Things (ICETCE-2020), 07-08 February 2020, (IEEE Conference

Record 48199)

Mei, Y., Hu, T. & Yang, L. C. (2020). Research on short-term urban traffic congestion

based on fuzzy comprehensive evaluation and machine learning. Proceedings

of the 5th International Conference on Data Mining and Big Data (DMBD), pp.

95–107. Belgrade, Serbia, July 14–20, 2020.

Minev, P., Srinivasan, S. & Vabishchevich, P. N. (2018). Flux formulation of parabolic

equations with highly heterogeneous coefficients. Vol. 340.

Mohammed, M., Khan, M. B., & Bashier, E. B. M. (2017). Machine learning:

Algorithms and applications. CRC Press. ISBN- 13: 978-1-4987-0538-7

Mystakidis, A. & Tjortjis, C. (2019). Big data mining for smart cities: predicting traffic

congestion using classification. https://www.ihu.edu.gr.html

Narmadha, S. & Vijayakumar, V. (2020). Multivariate time serious traffic prediction

using long short term memory network. International Journal of Scientific &

Technology Research 9(4), 1026-1031. ISSN 2277-8616.

Naylor, C. D. (2018). On the prospects for a (deep) learning health care system. JAMA.

320(11), 1099-100. https://doi.org/10.1001/ jama.2018.11103.

Odesanya, I. & Odesanya, F. M. (2021). Performance Analysis of Traffic Congestion

166
using Designated Neural Network Training Algorithms. International Journal

of Engineering and Technologies (IJET), 20, 23-33.

https://doi:10.18052/www.scipress.com/IJET.20.23

Rahman, F. I. (2020). Short term traffic flow prediction using machine learning - KNN,

SVM and ANN with weather information. International Journal for Traffic and

Transport Engineering, 2020, 10(3), 371-389. DOI:

https://dx.doi.org/10.7708/ijtte.2020.10(3).08

Rajeev, G. L., Nancy, R., Megha, S., John, J. M. & John, N. E. (2021). Traffic flow

prediction using random forest and bellman ford for best route detection.

International Journal of Engineering Research & Technology (IJERT).

9(13), 99-101. ISSN: 2278-0181.

Rajendran, S. & Ayyasamy, B. (2020). Short-term traffic prediction model for urban

transportation using structure pattern and regression: An Indian context. A

Springer Nature Journal. SN Applied Sciences 2020(2), 1159-1168. |

https://doi.org/10.1007/s42452-020-2946-2

Ramchandra, N. R., & Rajabhushanam, C. (2021). Traffic Prediction System Using

Machine Learning Algorithms. Retrieved from https://doi./10.4108/eai.7-6-

2021.2308860

Ramesh, K., Lakshna, A., Renjith, P. N. & Sheema, D. (2021). Smart Traffic Prediction

and Congestion Reduction in Smart Cities. Turkish Journal of Computer and

Mathematics Education, 12(12), 1027-1033.

Ravi, A., Nandhini, R., Bhuvaneshwari, K., Divya, J. & Janani, K. (2021). Traffic

management system using machine learning algorithm. International Journal

of Innovative Research in Technology (IJIRT), 7(11), 303-308. ISSN: 2349-

6002.

167
Russell, R. (2018). Machine learning: Step-by-step guide to implement machine

learning algorithms with Python. Springer Publishing.

Rzeszótko, J. & Nguyen, S. H. (2012). Machine learning for traffic prediction. Fundam.

Informaticae, 119(3-4), 407-420.

Salott, J., Fenet, S., Billot, R., El Faouzi, N. E. & Solnon,, C. (2018). Comparison of

traffic forecasting methods in urban and suburban context. Proc. - Int. Conf.

Tools with Artif. Intell. ICTAI, 2018(11), 846-853.

Sathiyaraj Rajendran & Bharathi Ayyasamy (2020). Short-term traffic prediction

model for urban transportation using structure pattern and regression:

An Indian context. A Springer Nature Journal. SN Applied Sciences (2020)

2:1159 | https://doi.org/10.1007/s42452-020-2946-2

Seymour, L., Brockwell, P. J. & Davis, R. A. (1997). Introduction to Time Series and

Forecasting. 92(440), 102-115.

Sherstinsky, A. (2020). “Fundamentals of Recurrent Neural Network (RNN)

and Long Short-Term Memory (LSTM) network. Phys. D Nonlinear

Phenom., 404(3), 1-43.

Smith, B. L., Williams, B. M. & Oswald, R. K. (2002). Comparison of parametric and

nonparametric models for traffic flow forecasting. Transp. Res. Part C Emerg.

Technol., 10(4), 303-321.

Sridevi, K., Ganesan, T., Samrat, B. V. S., Srihari, V. (2019). Traffic Analysis by

using Random Forest Algorithm Considering Social Media Platforms.

International Journal of Recent Technology and Engineering (IJRTE),

7(6S), 2277-3878.

Sun, S., Chen, J. & Sun, J. (2019). Traffic congestion prediction based on GPS

trajectory data. Int. J. Distrib. Sens. Networks, 15(5), 48-55.

168
Sutton, R. S. & Barto, A. G. (2017). Reinforcement learning: An introduction (2nd ed.).

Cambridge, MA: Mit Press.

Swain, P. H. & Hauska, H. (1997). The decision tree classifier: Design and potential.

IEEE Transactions on Geoscience Electronics, 15(3), 142-147.

Systematics, C. (2005). Traffic congestion and reliability: Trends and advanced

strategies for congestion mitigation; Cambridge Systematics Inc.: Cambridge,

MA, USA.

Taiwo, E. O., Ogunsanwo, G. O., Alaba, O. B. & Ogunbanwo, A. S. (2023). Traffic

congestion prediction using supervised machine learning algorithms. TASUED

Journal of Pure and Applied Sciences (TJOPAS), 2(1), 110-116.

Tamir, T. S., Xiong, G., Li, Z., Tao, H., Shen, Z., Hu, B. & Menkir, H. M. (2020).

Traffic congestion prediction using decision tree, logistic regression and neural

networks. IFAC PapersOnLine, 53(5) 512–517.

Tang, J., Zeng, J., Wang, Y., Yuan, H., Liu, F. & Huang, H. (2020). Traffic flow

prediction on urban road network based on License Plate Recognition data:

combining attention- LSTM with Genetic Algorithm. Transp. A Transp. Sci.

8(11), 23-29.

Tao, G., Song, H., Liu, J., Zou, J. & Chen, Y. (2016). A traffic accident morphology

diagnostic model based on a rough set decision tree. Transportation Planning

and Technology, 39(8), 751-758.

The Royal Society (2017). Machine learning: the power and promise of computers that

learn by example. ISBN: 978-1-78252-259-1. https//royalsociety.org/machine-

learning

Treiber, Martin, Kresting, Arne (2012). Traffic flow dynamics: Data, Models and

Simulation. Singer Science & Business Media. ISBN: 978-3-642-32459-8.

169
Verma, S. & Badade, S. (2019). Traffic Prediction Using Machine Learning.

Proceedings of National Conference on Machine Learning, 26th March 2019.

(pp. 138-141). ISBN: 978-93-5351-521-8

Vlahogianni, E. I., Karlaftis, M. G. & Golias, J. C. (2014). Short-term traffic

forecasting: Where we are and where we’re going. Transp. Res. Part C Emerg.

Technol. 43, 3-19.

Wafa Shafqat, Sehrish Malik, Yung-cheol Byun & Do-Hyeun Kim (2019). A Short

Term Traffic Flow Prediction Based on Recurrent Neural Networks for Road

Transportation Control in ITS. International Journal of Innovative Technology

and Exploring Engineering (IJITEE), 8(3C), 2278-3075.

Wang, P., Li, Y. & Reddy, C. K. (2019). Machine learning for survival analysis: A

survey. ACM Computing Surveys (CSUR), 51(6), 110.

Weaver, W. (1955). Machine translation of languages. Cambridge, MA: MIT Press.

Xie, P., Li, T., Liu, J., Du, S., Yang, X. & Zhang, J. (2020). Urban flow prediction from

spatiotemporal data using machine learning: A survey. Inf. Fusion, 59, 1-12.

Yang, F. (2019). An extended idea about decision trees. Proceedings of the

International Conference on Computational Science and Computational

Intelligence (CSCI), (pp. 349-354). doi: 10.1109/CSCI49370.2019.00068

Yinan, J., Rui, K., Daqing, L., Shengmin, G., & Havlin, S. (2017). Spatiotemporal

propagation of traffic jams in urban traffic networks. Physics and Society

(Physics.soc-Ph). Retrieved from https://arxiv.org/ pdf/1705.08269.pdf

Young, S. (2007). Real-time traffic operations data using vehicle probe technology.

Zafar, N. & Ul Haq, I. (2020). Traffic congestion prediction based on Estimated Time

of Arrival. PLoS ONE 15(12), e0238200.

https://doi.org/10.1371/journal.pone.0238200

170
Zhang, T., Liu, Y., Cui, J., Leng, W., Xie, W., & Zhang, L. (2019). Short-term traffic

congestion forecasting using attention-based long short-term memory recurrent

neural network. ICCS (3), volume 11538 of Lecture Notes in Computer Science,

page 304-314. Springer.

Zhang, Z., Zhao, Z. & Yeom, D. S. (2020). Decision tree algorithm-based model and

computer simulation for evaluating the effectiveness of physical education in

Universities. Complexity, pp. 1-11. https://doi.org/10.1155/2020/8868793

Zhang, Z. (2016). Introduction to machine learning: K-nearest neighbors. Ann. Transl.

Med., 4(11), 33-41.

Zhang, Y. & Liu, Y. (2009). Comparison of parametric and nonparametric techniques

for non peak traffic forecasting. World Acad. Sci. Eng. Technol., 39(3), 242-

248.

Zheng, Y. (2015). Trajectory data mining: An overview. ACM Trans. Intell. Syst.

Technol., 16(20), 1-41.

Zhu, G., Song, K., Zhang, P., & Wang, L. (2016). A traffic flow state transition model

for urban road network based on hidden Markov model. Neurocomputing, 214,

567–574. doi: 10.1016/j.neucom.2016.06.044

Zupan, J. (1994). Introduction to artificial neural network (ANN) methods: what they

are and how to use them. Acta Chim. Slov., 41(9), 327.

171

You might also like