Development of a Hybrid Artificial Neural Network-Particle Swarm Optimization Model for the Modelling of Traffic Flow of Vehicles at Signalized Road Intersections

The tremendous increase in vehicular navigation often witnessed daily has elicited constant and continuous traffic congestion at signalized road intersections. This study focuses on applying an artificial neural network trained by particle swarm optimization (ANN-PSO) to unravel the problem of traffic congestion. Traffic flow variables, such as the speed of vehicles on the road, number of different categories of vehicles, traffic density, time, and traffic volumes, were considered input and output variables for modelling traffic flow of non-autonomous vehicles at a signalized road intersection. Four hundred and thirty-four (434) traffic datasets, divided into thirteen (13) inputs and one (1) output, were obtained from seven roadsites connecting to the N1 Allandale interchange identified as the busiest road in Southern Africa. The results obtained from this research have shown a training and testing performance of 0.98356 and 0.98220. These results are indications of a significant positive correlation between the inputs and output variables. Optimal performance of the ANN-PSO model was achieved by tuning the number of neurons, accelerating factors, and swarm population sizes concurrently. The evidence from this research study suggests that the ANN-PSO model is an appropriate predictive model for the swift optimization of vehicular traffic flow at signalized road intersections. This research extends our knowledge of traffic flow modelling at a signalized road intersection using metaheuristics algorithms. The ANN-PSO model developed in this research will assist traffic engineers in designing traffic lights and creation of traffic rules at signalized road intersections.


Introduction
With the increase in urbanization, traffic congestion is becoming a serious issue, which is equally considered catastrophic to road users [1][2][3][4][5]. Traffic congestions are an essential part of daily human activities, such as driving to the workplace, shopping malls, etc. There is a consistent and systemic trend of experiencing a delay in traffic flow on highways, freeways, and road intersections. At pedestrians, there is a likelihood of a stop process before crossing the road at any given time, until a point where traffic must have cleared from all directions. Other busy areas are places like international airports. Passengers struggle at the point of entry. In recent times, the observable queues at most airports are alarming.
There is an urgent need to develop an intelligent approach to address traffic congestion at signalized road intersections. Researchers in the field of transport systems and traffic control [6][7][8] have suggested that autonomous vehicles are the future of transportation. As much as that statement has been suggested to be accurate, some developing and developed countries are still far from achieving a fully autonomous vehicle. Traffic congestion has become a widely acknowledged issue challenging to solve. This societal problem has spread majorly in the urban area of the world. The primary objectives of transportation researchers and Government administrators nowadays are to eliminate traffic congestion and assist urban planners with solutions to traffic congestion problems. Although efforts have been made and incentives and strategies have been implemented to reduce traffic congestion in megacities, new traffic congestion problems kept re-occurring and with a high level of unpredictability, especially in developing countries even though pre-existing traffic problems have been ameliorated. Sometimes, it is difficult to comprehend if the traffic congestion measures that have been put in place by urban planners and transportation engineers will either work or not. Intelligent transportation systems provide efficient transportation in terms of vehicles' reduced traffic flow time on the road. It also improves transportation safety and increases global connectivity in the road transportation network. As a result of the energy crisis the world is currently experiencing because of severe carbon monoxide from vehicles' exhaust pipes, the need for artificial intelligence techniques cannot be underemphasized. The revolution of the transportation sector and the fast-rising interest in intelligent transportation systems are due to the persistent traffic congestion on highways and freeways and the synergy of new information technology needed for real-time traffic simulation. Reinvigorating road transportation systems is crucial for implementing the fourth industrial revolution in road transportation networks.
This research study used the South African Road transportation network as a case study. A holistic approach is needed to tackle traffic flow congestion at a signalized road intersections in Gauteng province, South Africa. Gauteng is vital to the South African economy; therefore, there is a need for an advanced and well-managed transportation system [9]. The population of urban cities in South Africa has increased rapidly over the last ten years [10]. According to documented reports on vehicular navigation, the total traffic flow between Johannesburg and Pretoria during on-peak days on the N1 freeway is over 160,000 vehicles per day [11]. This research study focuses on the South African Road transportation system, especially the busiest N1 Allandale interchange road, which has the highest traffic volume in Southern Africa. The novelty of this study is in the application of a hybrid artificial neural network trained by a particle swarm optimization model for modelling traffic flow at signalized road intersections. Also, transportation researchers to date have focused majorly on road intersections rather than on signalized road intersections. This study aimed to address the following research questions: • Can a hybrid artificial intelligence algorithm such as an artificial neural network trained by particle swarm optimization (ANN-PSO) be used as a predictive approach in modeling traffic flow at a signalized road intersection? • Can traffic flow parameters such as speed of vehicles, traffic density, time, number of different classes of vehicles on the road, and traffic volume be used to model vehicular traffic flow at a road intersection?
This paper is divided into five parts. The first section introduces the research study and outlines the primary aim and significance of this research study. The second section discusses prior research related to the engineering application of Artificial neural networkparticle swarm optimization (ANN-PSO) and the theoretical framework of the model. The third section concerns the methodology used for this research study, including location, collection of the traffic datasets, and how the model was developed. The fourth section presents the findings of this research study. The final section comprises the conclusion and implications of this study on the road transportation system.

Literature Review Related Studies
In recent years, there has been a growing body of literature review on particle swarm optimization (PSO) and its application in the field of engineering. Prior studies have stated that the application of particle swarm optimization in engineering applications is broad. However, its application to the best of authors' knowledge in the area of road intersections is limited. The importance of particle swarm optimization cannot be underemphasized due to its hybrid properties and its superior artificial intelligence. Wu et al. propose various applications of particle swarm optimization for the scheduling of railway operations and planning of the railway network layout [12]. They used PSO to find the best optimal railway schedules. AlRashidi et al. [12] Implemented PSO in the effective electric power system. Jain et al. [13] used different forms of objectives to solve a multi-objective load problem by applying PSO. Furthermore, additional related studies on particle swarm optimization are its application in determining the optimal performance of power flow [14,15], load flow [16,17], and the design of a proportional integral derivative (PID) controller in a system that uses an automatic voltage regulator (AVR) [18] and finally in the decreasing of power loss [19]. In civil engineering, especially in construction, [20] came up with a PSO algorithm to design a rectangular flow in the form of a beam slab. Mac et al. [21] suggested an efficient hierarchical global path planning technique for non-stagnant robots in a chaotic engineering environment by applying particle swarm optimization. Islam et al. [22] proposed a function called time-varying transfer, which can be found in binary particle swarm optimization (BPSO). This BPSO is called time-varying transfer functionbased binary PSO (TVT-BPSO). The aim was to use this BPSO to evaluate its exploration and exploitation abilities critically. Suresh et al. [23] used PSO in the medical field to predict the duration of stay of sick patients in the hospital, and the key finding of this research was that PSO was efficient compared to other predictive models. Some other applications of PSO over the years have expanded to other engineering applications such as source seeking problem [24], elevator door conceptual framework [25], the problem of quad assignment [26], determining the quantity of equipment in possession [27], and the problem of job shop scheduling [28]. Table 1 below shows previous research been done by researchers on different types of particle swarm optimization (PSO). Table 1. Types of particle swarm optimization (PSO).

Author(s)
Types of PSO Aims Key Findings [29] Particle swarm optimization and firefly algorithm (FFA) This paper aimed to compare the performance of PSO and the firefly algorithm by using almost ten non-linear functions. The time and mean values of the non-linear functions were used as the input and output variables.
The result showed that the non-linear functions and time value is smaller compared with the firefly algorithm. [30] Particle swarm optimization PSO The aim was to apply PSO on four test functions to achieve an adequate selection of particles.
The study implied that not all test functions were improved in terms of performance. [31] Particle swarm optimization-recombination and dynamic linkage discovery (PSO-RDL) The aim was to use this hybrid PSO-RDL to solve economic dispatch in the power system. They discovered that the performance of PSO-RDL was similar to a modified particle swarm optimization (MPSO) There are also different types of PSO that various researchers have used; they are: • Multi-objective optimization by implementing PSO.
Researchers have used this approach in solving various optimization problems by using a combination of PSO and discrete multi-objective PSO [32]. In addition to multiobjective methods such as competitive cooperative and co-evolutionary approaches [33] and a PSO evaluation by a vector [34].
There have been many modifications to PSO to improve its optimization performance and applicability. Notable among these modified PSOs are memory enhanced PSO [35], predator-prey PSO [36]. However, there are newer modified PSOs such as comprehensive learning particle swarm optimizer (CLPSO) [37], self-learning particle swarm optimization (SLPSO) [38], and orthogonal learning particle swarm optimization (OLPSO) [39]. The unique thing about this newer variant of PSO is that they do not need tuning of parameters, and their structure is quite different from an older generation of PSOs. Another significant feature about them is that they only use information that is current and not past information. A considerable number of researchers have used different types of PSO in solving real-life problems. Researchers such as [40] used different kinds of PSO variants on dixian-szego testing. Liu et al. [41] came up with an evolutionary game particle swarm optimization (EGPSO) to model particle behaviours and patterns by applying replicator dynamics and multi-start methods. Hossen et al. [42] used an adaptive PSO that is dependent on spider behaviour. Benmessahel et al. [43] explained the implications of removing obsolete particles from a current PSO iteration. Ji et al. [44] used the combination of gradient and PSO to eliminate immature convergence.
For the validation and predictions of different types of data, there are various preexisting models such as artificial neural networks (ANNs) [45,46], finite element method (FEM), and finite strip method (FSM) [47,48]. The finite element method is a common technique created by ABAQUS and ANSYS. They have been applied to different types of experimental investigations to either validate or predict the structural properties of certain specimens [49]. Even though the finite element has been widely applied over the years for prediction, it still has disadvantages such as significant time executions, a different variation of outputs, and a high number of data requisitions [50]. In recent years, artificial intelligence (AI) methods have performed significant functions advancing various engineering aims and objectives [51]. Artificial neural networks are a sub-branch of Artificial intelligence techniques. They can solve three distinct types of issues such as (1) approximation of functions, (2) classification, and (3) prediction of time series [52]. However, considering these issues, an ANN model is commonly trained and developed by using optimization approaches. Conventional algorithms such as but not limited to backpropagation algorithms have been used so many times in training artificial neural networks [52]. However, the major setback of using conventional algorithms is that they are usually stuck in local extremums and exhibiting difficulties in crossing plateaus of the error function associated with the landscape. The error landscape is the deficiencies of the conventional algorithms. To address these deficiencies, metaheuristic optimization algorithms such as genetic algorithm (GA), particle swarm optimization (PSO) [53], and imperialist competitive algorithm [54] can be applied to trained artificial neural networks to address these deficiencies. The global search, a significant characteristic of these algorithms, can improve the ANN model performance in some situations.
ANN-PSO was used in this study because many researchers have used particle swarm optimization modelling to develop a predictive approach in different areas of studies, notably among them is [55], who used the ANN-PSO model to predict thermal properties [56] used different types of particle swarm optimization algorithms such as basic particle swarm optimization (PSO), the second generation of particle swarm optimization (SGPSO) and a new model of PSO (NMPSO) to find solutions to three primary aspects (synaptic weights, architecture, and transfer functions neurons) of an ANN network. During this research study, it was discovered that a hybrid ANN-PSO model has never been used before to predict the traffic flow performance of vehicles at road intersections. Celtek et al. [57] used another form of hybrid particle swarm optimization called social learning particle swarm optimization (SL-PSO) to solve real-time traffic signal control. The primary reason why a hybrid ANN-PSO was used in this study was that [57] stated that PSO is an algorithm that performs a fast convergence to optimal solutions. This characteristic is desirable when evaluating different traffic conditions (traffic flow, traffic density, and vehicular speed). Besides, a PSO algorithm is easy to use and requires very few adjustment parameters. The results of this research have proven that the ANN-PSO model is far more accurate, easy to use, and efficient than other predictive models when it comes to traffic flow prediction of vehicles at a signalized road intersection.

Research Design
This research study is designed to demonstrate how an artificial neural network trained by particle swarm optimization can model vehicles' traffic flow at signalized road intersections using selected traffic flow inputs and output. Seven selected signalized road intersections were selected due to their large traffic volume of vehicles on the selected metropolitan section of Gauteng province in South Africa. Figure 1 shows the flowchart of the research methodology applied in this research.

Population of the Study
One of the top-rated companies known for traffic monitoring solutions, specializing in collecting traffic data electronically, constitutes the study population. The company is called Mikros Traffic Monitoring (MTM) Company, a Syntell group subsidiary. This company works in conjunction with the South Africa Ministry of Transportation. Traffic data obtained from MTM for this research study is concentrated on vehicles navigating Gauteng province, South Africa.

Traffic Data
The size of the dataset considered in this study is four hundred and thirty-four, and fourteen traffic flow parameters were considered as both inputs and output within the investigation period.

Data Collection
The method adopted for the collection of data includes the Primary and secondary methods. The primary method used in this research involves collecting traffic data from seven South African signalized road intersections through inductive loop detectors and video cameras. The secondary data was obtained through visitations to the South African Ministry of Transportation and South Africa National Roads Agency Limited (SANRAL) and interaction with Traffic engineers and urban planners' staff of Mikros traffic Monitoring systems Ltd. (MTM) to obtain relevant information on transportation systems within South Africa.

Sample and Sampling Techniques
Sampling has to do with choosing a subcategory of individuals from a statistical population to assess the entire population quickly. In the case of this research, the traffic dataset obtained from Mikros Traffic Monitoring Limited was unlimited. A fraction of four hundred and thirty-four and fourteen traffic data was chosen to easily assess the entire population of the South Africa Transportation Network, and we focused on seven roadsites connected to the N1 Allandale freeway in Gauteng Province due to their higher traffic density and traffic volume. The inputs and outputs variables used in this research are the speed of the vehicles, number of different classifications of vehicles, traffic volume, traffic density, the distance covered by the vehicles, and the time it takes the vehicles to travel the road's length.

Population of the Study
One of the top-rated companies known for traffic monitoring solutions, specializing in collecting traffic data electronically, constitutes the study population. The company is called Mikros Traffic Monitoring (MTM) Company, a Syntell group subsidiary. This company works in conjunction with the South Africa Ministry of Transportation. Traffic data obtained from MTM for this research study is concentrated on vehicles navigating Gauteng province, South Africa.

Location of the Research Study
The Allandale interchange (N1 Ben Schoeman) is one of the busiest and best-rated interchanges in South Africa regarding infrastructure and connectivity. It also connects Johannesburg and Pretoria with an average travel distance of 14.7 km. The aerial drone image of this interchange is shown in Figure 2. This interchange accommodates more than 80,000 vehicles traveling southbound and over 71,000 vehicles moving Northbound every 24-h. Figure 3 shows the N1 Allandale interchange's description, a South Africa Government (National) road network that connects Johannesburg through Pretoria, Bloemfontein, Polokwane, Capetown, and Beit Bridge (which is located on the border of South Africa and Zimbabwe).
The traffic dataset was obtained from the N1 Ben Schoemann, also known as the Allandale interchange, using inductive loop detectors and roadside video cameras. This interchange is connected to seven different road networks with different lanes and directions. The characteristics of these roadsites are shown in the Appendix A (Table A1) Note: Off-ramp: When a vehicle drives off the freeway to connect with another road, usually a minor road. On-ramp: This is when vehicles connect from the minor road to the freeway The characteristics of these seven roadsites have been described in detail in Table A1 in Appendix A. The table comprises of the longitude and latitude of each of the roadsites, the number of lanes on each road, number of vehicles on each road, lengths of the road, speed limit, and the direction of the vehicular traffic flow on each roadsites.

FOR PEER REVIEW 7 of 29
24-h. Figure 3 shows the N1 Allandale interchange's description, a South Africa Government (National) road network that connects Johannesburg through Pretoria, Bloemfontein, Polokwane, Capetown, and Beit Bridge (which is located on the border of South Africa and Zimbabwe).

Size and Extraction of the Traffic Datasets
Four hundred and thirty-four traffic datasets were collected under different heterogeneous conditions. From seven road sites on the South Africa Road network, all these road sites are connected to the N1 route, the busiest on the South Africa Road network. The traffic datasets were collected from these seven sites with the aid of various traffic collection equipment. Fourteen different traffic flow parameters were identified from these traffic datasets. These traffic parameters are crucial in understanding the traffic flow patterns of the South Africa Road network. Five traffic flow periods were identified based on the period from the traffic datasets. The five traffic flow periods are identified based on the traffic volume experienced on these roads depending on the day's specific time. These periods are either off-peak or on-peak, depending on the time during the day. The periods are classified as 1, 2, 3, 4, 5 in this research; this is explained further in Section 3.9. Fourteen of these parameters were used as inputs and output during the artificial neural network-particle swarm optimization modelling. The traffic flow parameters identified in these seven road sites are shown in Table 2:

•
Traffic density: This is the number of vehicles per unit length. It is calculated as: Traffic volume = Number of vehicles time (2) • The number of short/medium/long trucks: This is the overall total number of different types of trucks on a specific road depending on the time of the day and traffic volume.

•
The number of light vehicles: This is the overall total number of different types of light vehicles on a specific road network considering the period of the day and traffic volume. • Time of day of light vehicles or short/medium/long trucks: This parameter is dependent on the speed of the vehicles or truck and the distance of the specific road site. For example, the road sites used as a case study in this research study have their distance. Its mathematical expression is; • The average speed of light vehicles or short/medium/long trucks: This is the speed of the vehicles on the road at a specific period. Each road has its speed limit. The road sites used for this study all have a speed limit of 120 km/h.
The South African Ministry of transportation classified different vehicles into Class 1, Class 2, Class 3, or Class 4. Light vehicles are usually classified as Class 1. In contrast, trucks are classified between Class 2 to Class 4 depending on each truck's number of axles. In this research, the following are grouped under a light vehicle or short/medium/long truck: 2 axles, 6 tyre unit + light trailer (max 4 axle); three-axle single units (+1 axle trailer); four or fewer axle large trailer(s); five-axle single trailer; fight motor vehicle; light motor vehicle towing; motorcycle; seven axle vehicles; six-axle multi-trailer; six-axle single trailers; two-axle buses; two axles six tyre single unit. The definition of different classifications of vehicles has been provided in the Appendix A section. Table 3 shows the traffic flow parameters collected by each traffic flow equipment's. The equipment used for the data collection by Mikros Traffic Monitoring (MTM), a subsidiary of Syntell Group Limited, are: Electronic equipment is used in road transportation networks to record data or information garnered for some time by vehicles' movement on highways and road intersections. An example of a data logger is shown in Figure 4. This information gathered can be analyzed or documented for future purposes. They make use of sensors to record information from vehicles. analyzed or documented for future purposes. They make use of sensors to record information from vehicles.

Loop Detectors
They are also called inductive loop detectors (shown in Figure 5). These detectors are installed along with highway bumps or where there is a zebra crossing. Besides, they are always relatively closed to traffic lights. They detect the number of vehicles passing, the speed and distance covered by the vehicles, and the time it took the vehicle to arrive at that position on the road.

Video Cameras
These are installed on traffic light poles and usually found around road intersections, road tunnels, highways, freeways, and sometimes roundabouts. A typical illustration of this is shown in Figure 6. They are commonly used to catch traffic offenders or monitor the traffic flow of vehicles. The major limitation is that they are always affected by weather

Loop Detectors
They are also called inductive loop detectors (shown in Figure 5). These detectors are installed along with highway bumps or where there is a zebra crossing. Besides, they are always relatively closed to traffic lights. They detect the number of vehicles passing, the speed and distance covered by the vehicles, and the time it took the vehicle to arrive at that position on the road. analyzed or documented for future purposes. They make use of sensors to mation from vehicles.

. Loop Detectors
They are also called inductive loop detectors (shown in Figure 5). These installed along with highway bumps or where there is a zebra crossing. Besi always relatively closed to traffic lights. They detect the number of vehicles speed and distance covered by the vehicles, and the time it took the vehicle that position on the road.

Video Cameras
These are installed on traffic light poles and usually found around road i road tunnels, highways, freeways, and sometimes roundabouts. A typical il this is shown in Figure 6. They are commonly used to catch traffic offender the traffic flow of vehicles. The major limitation is that they are always affected conditions, especially during the rainy or harmattan period; during this perio

Video Cameras
These are installed on traffic light poles and usually found around road intersections, road tunnels, highways, freeways, and sometimes roundabouts. A typical illustration of this is shown in Figure 6. They are commonly used to catch traffic offenders or monitor the traffic flow of vehicles. The major limitation is that they are always affected by weather conditions, especially during the rainy or harmattan period; during this period, it is difficult for the video cameras to monitor vehicles' traffic flow on the road. Figure 6. Video cameras attached to a traffic signal light.

South Africa Vehicular Traffic Flow
Note that for this research study, the period of the day is divided as: For clarity and understanding of the vehicular traffic volume of each roa dates and days the traffic datasets were collected are from 15th July 2019 (Mond July 2019 (Thursday). Figure A1 (these figures can be found in the Appendix they are numbered A-G) shows the traffic volume of vehicles at each roadsites co the period of the day. The traffic volume tables for each roadsites can be fou Appendix A section. They are named Tables A1-A7. The traffic flow system d the traffic volume at a certain period of the day. For example, in each of the roa period between (00:00:00-04:59:59) is when the traffic flow is gradually buildin is a period between midnight and the early morning when people are just starti place of work. Between 05:00:00-09:59:59 and 10:00:00-14:59:59 is the on-peak p when the traffic volume attains the maximum number of vehicles on the roa usually when traffic congestion occurs due to high road traffic density (large v

South Africa Vehicular Traffic Flow
Note that for this research study, the period of the day is divided as:  Figure A1 (these figures can be found in the Appendix A section, they are numbered A-G) shows the traffic volume of vehicles at each roadsites considering the period of the day. The traffic volume tables for each roadsites can be found in the Appendix A section. They are named Tables 2, A1 and A3-A7. The traffic flow system depends on the traffic volume at a certain period of the day. For example, in each of the roadsites, the period between (00:00:00-04:59:59) is when the traffic flow is gradually building up. This is a period between midnight and the early morning when people are just starting to their place of work. Between 05:00:00-09:59:59 and 10:00:00-14:59:59 is the on-peak period, this when the traffic volume attains the maximum number of vehicles on the road. This is usually when traffic congestion occurs due to high road traffic density (large vehicle occupancy on the road). The traffic congestion can be either recurrent (this occurs when the route is heavily used because of its network connectivity) and non-recurrent (this might be due to road accidents or unforeseeable circumstances on the road). The exception among these vehicular traffic flows is that during the non-working days, which are Saturday and Sunday, from critical observation, between the period of 00:00:00-04:59:59 and 05:00:00-09:59:59, there is a low traffic volume due to people not going to place of work at this period of the day. During these days (Saturday and Sunday), the traffic flow only started to build up in the afternoon, around 15:00:00 and 19:59:59. When the traffic flow is high, the traffic density will increase, which means that the traffic volume will be high, i.e., high traffic volume means there are many vehicles on the road. The traffic flow periods have shed light on one thing, to understand traffic flow, it is crucial that we first have clarity on the traffic volume, traffic density, and the period of the day (off-peak and on-peak). Particle swarm optimization is a strong and effective metaheuristic algorithm that resolves complicated and non-linear optimization problems [58]. This swarm optimization technique can efficiently solve global optimization issues compared with other classical optimization techniques. Particle swarm optimization is a modern optimization technique dependent on social methods such as fish schooling and bird flocking [59]. Depending on the mathematical conceptual framework of particle swarm optimization, these three significant parameters play important roles in PSO optimizations: position, velocity, and fitness. The primary steps of PSO to solve any complex optimization issues is as follows: • Initializing a population of individuals (particles) with random velocities and positions in the domain of the problem.

•
Computing the fitness value for all particles.

•
Investigating fitness of particles.

•
Updating the velocity and position of particles using Equations (4) and (5).
r 1 and r 2 are called random numbers. c 1 and c 2 are the acceleration constants. w, χ, P t and G t are all called the weight of inertia, pbest, and gbest.
When an artificial neural network is adequately trained in the MATLAB environment, it will function as a black-box model, explaining the relationship between a complex dataset, which comprises an input and output (irrespective of the number of variables). An artificial neural network consists of mathematical processing units called neurons. These neurons can be found in the black box during a neural network operation on MATLAB. These neurons can form a relationship with each other via weights and biases. An artificial neural network consists of three primary layers: the input, hidden, and output layers. The neurons are placed in the hidden and output layers, while the input layers do not contain any neurons. After the neural network toolbox has been opened in MATLAB, training will be conducted with the input data and the corresponding output datasets.
The inputs in Table 2 were divided into 13 columns; the output datasets are in a single column on another excel sheet. These are all carried out to determine the appropriate weights and biases of the neurons. Neural network training of data (input and outputs) means determining the optimum variables of different weights and biases of the neural network. Generally, different methods are applied to determine the appropriate parameters of weights and biases of the Artificial Neural Network. In this research, the suitable optimum training of the network has been done by applying an artificial intelligence technique called Artificial Neural Network-Particle Swarm Optimization, which can be found in the MATLAB software environment.
Once the ANN-PSO training has been done adequately on the datasets, the network validation is performed using the testing data-independent variables. An artificial neural network is perfect if the fitness function values are lower or closer to one for the training and validation of the traffic datasets. Particle swarm optimization is created through different species' social and cooperative behaviour to fill the loopholes in a multidimensional search space. The PSO algorithm is based on the personal experience (Pbest), the overall personal experience of the species (Gbest), and the decision m particles' decision-making to determine the subsequent positions in the search space. Furthermore, the personal experience of different types of species are accelerated by two (2) main factors called C 1 and C 2 and a pair of (no specific variables random) r 1 and r 2 which are created between a variable ranging from 0 to 1, while the movement is multiplied by 'w', which is a crucial inertia factor 'w'.
In Equation (6), Pbest k p,q denotes the personal best of the qth component of the pth individual, while the Gbest k q referred to qth component of the best individual species of the population of iteration 'k'. Figure 7 shows the search mode of operation of a particle swarm optimization. The initial Pbest of each particle is the position, and the initial Pbest is the most appropriate particle position between a randomly initialized population. The Pbest and Gbest of each particle are: The flowchart below shows the steps been applied to train the artificial neural network using particle swarm optimization. In the early stages, 'N' sets of weights and biases of the size of particles 'D', directly proportional to 'n*(m + 2) + 1' applied randomly. Each traffic dataset is a particle in particle swarm optimization, which is depicted as the particle position. Presently, the initial velocity of each particle in the traffic dataset is applied as 10% of the current position of the correlated particle (which is referred to as 'V'). The fitness 'f' of each particle in the traffic dataset undergoes evaluation. The corresponding particles to the optimum performance of the fitness named as Gbest while Pbest of each particle are accepted as their corresponding bearings. Equations (6) and (9) In Equation (6), , denotes the personal best of the th component of the th individual, while the referred to th component of the best individual species of the population of iteration 'k'. Figure 7 shows the search mode of operation of a particle swarm optimization. The initial of each particle is the position, and the initial is the most appropriate particle position between a randomly initialized population. The and of each particle are: The flowchart below shows the steps been applied to train the artificial neural network using particle swarm optimization. In the early stages, 'N' sets of weights and biases   A programming language has been inbuilt in the MATLAB environment, assuming that there is a three-layer artificial neural network architecture. The number of input and output variables considered for developing the artificial neural network-particle swarm optimization model is shown in Table 2. In this study, the number of neurons used varies between five (5) and ten (10), respectively. The ANN-PSO model has variables, which are dependent on particle swarm optimization or the artificial neural network. The PSO variables include the overall number of particles in the swarm population size (swarm size, N), acceleration factor associated with the particle velocity ( and ), the inertial weight of the particles (w). The artificial neural network features are the network architecture (i.e., the total number of neurons in the hidden layer 'n'). The inertia weight of the particles is commonly known as random numbers, which are primarily within the A programming language has been inbuilt in the MATLAB environment, assuming that there is a three-layer artificial neural network architecture. The number of input and output variables considered for developing the artificial neural network-particle swarm optimization model is shown in Table 2. In this study, the number of neurons used varies between five (5) and ten (10), respectively. The ANN-PSO model has variables, which are dependent on particle swarm optimization or the artificial neural network. The PSO variables include the overall number of particles in the swarm population size (swarm size, N), acceleration factor associated with the particle velocity (C 1 and C 2 ), the inertial weight of the particles (w). The artificial neural network features are the network architecture (i.e., the total number of neurons in the hidden layer 'n'). The inertia weight of the particles is commonly known as random numbers, which are primarily within the range of 0-1.
A comprehensive iteration was carried out on the ANN-PSO model for obtaining an appropriate combination of variables related to the traffic data. Six different numbers of neurons were considered; the variables are 5, 6, 7, 8, 9, and 10. Six (6) distinct swarm population sizes were also considered. According to past research work [60], it was discovered that the best possible optimum value of the acceleration factor of the particle C 1 and C 2 is situated in-between 1-2.5 and 2-3. Five (5) various variables of accelerating factors C 1 and C 2 were considered. Table 4 shows the overall number of neurons in the hidden layer used to train the datasets. The table also presents the particle size and the acceleration factor considered when training the traffic datasets. The variables of the PSO-ANN hybrid model developed for the traffic data were established by performing frequent training of the traffic data. An overall 1000 training runs were done on the MATLAB environment to acquire the near-perfect integration of the ANN-PSO framework. Training of the traffic data during the ANN-PSO training of the traffic data. The training will only be stopped or terminated when the objective function iteration has been fulfilled. The following benchmark was adhered to. The benchmark is: The training run will be terminated if the objective function is not up to a specific fixed parameter. The ANN-PSO training was carried out in the MATLAB environment by following these steps:

•
Step One: Traffic data collection.

•
Step Two: Creation of the hybrid network.

•
Step Three: Configuration of the ANN-PSO network.

•
Step Four: Initialization of the weight and biases.

•
Step Five: Training the Neural network by applying particle swarm optimization.

•
Step Six: Validation and testing of the ANN-PSO network.

•
Step Seven: Using the Neural Network.
The inputs and outputs variables used for the development of the ANN-PSO network are shown in Table 2. These input and output variables were categorized based on the method used by [61,62]. Preparation of the dataset is followed by structuring the architecture of the algorithms. MATLAB user interface tools and command-line functionality are used to oversee the ANN-PSO model's development, training, and testing. The traffic datasets used in this traffic prediction study were obtained from seven major road intersections connecting to the N1 Allandale Road, the busiest interchange in southern Africa. The breakdown of how the traffic datasets were divided and used for the ANN-PSO training and testing is shown in Table 5 below. We used 434 traffic datasets, 364 for training, and 70 for testing the ANN-PSO model performance. The division of the traffic datasets for training and testing is shown in Table 5 below. The MATLAB codes used to develop the ANN-PSO model have been deposited in a GitHub repository. This is the link to the MATLAB codes https://github.com/Olayode1989/ANN-PSO-codes.git (accessed on 20 August 2021).  (10) and (11) show the regression value's statistical formulae and the mean square error.
where y k ,ŷ k , y k n represents the experimental data sample, the values predicted by the algorithm, the mean value of the experimental data samples, and the number of data samples, respectively. The primary code file used for training the traffic datasets using ANN-PSO was generated. These codes were saved as 'm_pso_m' before the ANN-PSO was used to prepare the traffic data. The input and output datasets were created and saved in a Microsoft Excel worksheet. In the Microsoft worksheet, two sheets were created, namely sheet 1 and sheet 2. In sheet 1, it consists of the input datasets and sheet two, which comprises the output (traffic volume) and the target data required to be placed in the first column of the first row of sheet 2 in the excel file. This Microsoft excel of the input and output data (target data) must be saved with the name 'datafile.xlsx' and kept in the same directory as the ANN-PSO codes. These traffic data can be uploaded into the MATLAB environment by inputting the following command codes in the MATLAB command window: [x,t] = traffic_dataset; Inputs =X ; Outputs = t ; All three files were saved in the MATLAB directory 'myfunc.m', 'nn_pso.m', and datafile. xslx to train the artificial neural network using Particle swarm optimization effectively. The 'nn_pso.m' file is run consistently depending on the number of hidden neurons, swarm population size, and accelerating factor. For example, if the number of hidden neurons is five (5) and the swarm population size is 10, the best performing accelerating factor is C 1 = 2.25 and C 2 = 2. These parameters will be changed in the 'nn_pso.m' codes inside the MATLAB environment.

Results and Discussions The ANN-PSO Model Results and Discussions
The 434 traffic datasets obtained from the seven roadsites were divided into 367 and 70 for training and testing. To achieve the best optimum output, the trial-and-error approach was used to discover the best value for the number of hidden nodes, iterations, and acceleration factors. Sigmoid and linear functions were used for the ANN-PSO model for the hidden and output node activation functions. The best optimal parameters for both training and testing performance of the ANN-PSO model of traffic flow at each roadsites, as shown in Table 6, are: (a) Number of hidden neurons = 5 (b) Swarm population size = 400 (c) Number of traffic datasets = 434 (d) C 1 and C 2 = 1.5 and 2 (e) Training (R 2 ) = 0.98356 (f) Testing (R 2 ) = 0.98220  The study set out to determine if an artificial network trained by particle swarm optimization can be used to model traffic flow at a signalized road intersection. The current study has been able to answer that question, considering Table 6, which shows evidently that the ANN-PSO model is capable of modelling traffic flow at a signalized road intersection. The most interesting finding from the ANN-PSO results shows that the best optimum training and testing performed for the roadsites was obtained with a different number of neurons, swarm population sizes, and acceleration factors C 1 and C 2 . From the results, it can be concluded that the ANN-PSO's parameters affect the performance prediction of the traffic flow datasets. Another significant finding from the ANN-PSO result is that the accelerating factors and mean square error plays an essential role in determining the optimum performance of each ANN-PSO model on each roadsites; for example, the lower the MSE, the more likely there is going to be an optimum training or testing performance of the ANN-PSO model. The most striking result to emerge from the research study is that when an ANN-PSO model comprises the maximum correlation coefficient (R 2 ) and the minimum MSE, it can be said that the ANN-PSO model is superior. The training and testing performance regression value for the roadsites indicates that the inputs and target are well correlated. Another significant finding is that when R-value is closer to 1, this means that there is an accurate linear relevance between the traffic inputs and target. The study set out to determine if an artificial network trained by particle swarm optimization can be used to model traffic flow at a signalized road intersection. The current study has been able to answer that question, considering Table 6, which shows evidently that the ANN-PSO model is capable of modelling traffic flow at a signalized road intersection. The most interesting finding from the ANN-PSO results shows that the best optimum training and testing performed for the roadsites was obtained with a different number of neurons, swarm population sizes, and acceleration factors and . From the re-

Conclusions and Future Work
To achieve the aim of this research study, an in-depth and exhaustive research study has been conducted to develop an ANN-PSO capable of modelling and analysing vehicular traffic flow at a signalized road intersection. For the accurate modelling of traffic flow, it was important to understand and identify some traffic flow parameters and have clarity on how traffic flow affects the movement of vehicles at a signalized road intersection. In this research study, the successful development of the ANN-PSO model for the traffic flow of vehicles at a signalized road intersection has been achieved. The vehicular speed, the time of the day, the traffic volume, and the traffic density of each class of vehicles (light vehicles, long trucks, medium trucks, and short trucks) have been considered as the traffic flow inputs and outputs variables. The following conclusions can be drawn from this present study: The ANN-PSO model developed in this study will assist transportation engineers and urban planners in developing possible ways to use their respective country's traffic information to understudy traffic flow patterns and variables for effective predictive models. Also, designing a traffic control system for traffic lights at road intersections can be made possible and timely.

•
The results of this study will serve as a base for future studies for engineers and transportation researchers in understanding the complexity of traffic flow patterns at a signalized road intersection. Also, it will assist drivers in the decision-making process, such as which period of the day traffic congestion is likely to occur on a particular road.
Based on the results obtained from this research study, this research study has thrown up many questions in need of further investigation in the field of transportation:

•
Further work needs to be done to establish whether other metaheuristic algorithms, such as the second generation of particle swarm optimization (SGPSO), bee colony, an artificial neural network trained by genetic algorithm (ANN-GA), adaptive neurofuzzy inference system trained by particle swarm optimization (ANFIS-PSO) and simulated annealing can be used in developing predictive models using traffic flow parameters obtained from a signalized road intersection. • A natural progression of this research study would be to focus on unsignalized road intersections, traffic light timing response optimization, and the usability of traffic volume in determining traffic congestions at road intersections. Besides, demonstrating other metaheuristic techniques' strength and predictive power will be very useful as a comparative measure for minimizing traffic issues in road transportation.  Seven or more axle multi-trailer trucks: This is also either a tractor or a truck power unit. It is usually used to carry heavy construction materials or used for transporting fuels.