## 3 Methodology
### The Goal, Data Inputs, and Data Processing Involved in the Development of the ANN-PSO Model
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\)'. \[V_{p,q}^{K+1}=w\times V_{p,q}^{K}+c_{1}r_{1}\Big{(}\mathit{Pbest}_{p,q}^{k}-X_{ p,q}^{K}\Big{)}+c_{2}r_{2}\Big{(}\mathit{Gbest}_{q}^{k}-X_{p,q}^{K}\Big{)} \tag{6}\]  
\[X_{p,q}^{K+1}=X_{p,q}^{K}+V_{p,q}^{K+1} \tag{7}\]  
In Equation (6), \(\mathit{Pbest}_{p,q}^{k}\) denotes the personal best of the \(q\)th component of the \(p\)th individual, while the \(\mathit{Gbest}_{q}^{k}\) referred to \(q\)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 \(\mathit{Pbest}\) of each particle is the position, and the initial \(\mathit{Pbest}\) is the most appropriate particle position between a randomly initialized population. The \(\mathit{Pbest}\) and \(\mathit{Gbest}\) of each particle are:  
\[If\,f\Big{(}X_{P}^{K+1}\Big{)}<f\Big{(}\mathit{Pbest}_{P}^{K}\Big{)}\,\,\, then\,\,\mathit{Pbest}_{P}^{K+1} =X_{P}^{K+1}\,\,\,\mathit{else\,\,\mathit{Pbest}_{P}^{K+1}}=\mathit{Pbest} _{P}^{K} \tag{8}\]  
\[If\,f\Big{(}X_{P}^{K+1}\Big{)}<f\Big{(}\mathit{Gbest}^{K}\Big{)}\,\,\,\text{ then }\,\mathit{Gbest}^{K+1} =X_{P}^{K+1}\,\,\,\mathit{else\,\,\mathit{Gbest}^{K+1}}=\mathit{Gbest} ^{K} \tag{9}\]  
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 \(\mathit{Gbest}\) while \(\mathit{Pbest}\) of each particle are accepted as their corresponding bearings. Equations (6) and (9) are used to upgrade the positions of each particle in the PSO, resulting in conclusive optimized weights and biases of the ANN traffic model. A typical flowchart shows an ANN-PSO-based model in Figure 8.  
Figure 7: The Particle Swarm Optimization search technique for \(p\)th particle at a \(k\)th objective function in the search field. 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  
Figure 8: A framework of the ANN-PSO Model developed for the traffic flow prediction performance. 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.