Application of Quantum Genetic Optimization of LVQ Neural Network in Smart City Traffic Network Prediction

Accurate prediction of traffic flow in urban networks is of great significance for smart city management. A short-term traffic flow prediction algorithm of Quantum Genetic Algorithm - Learning Vector Quantization (QGA-LVQ) neural network is proposed to forecast the changes of traffic flow. Different from BP neural network, Learning Vector Quantization (LVQ) neural network is of simple structure, easy implementation and better clustering effect. Utilizing the global optimization ability of Quantum Genetic Algorithm (QGA), it is combined with LVQ neural network to overcome some shortcomings of LVQ neural network, including sensitive to initial weights and prone to local minima. In order to test the convergence ability and the timeliness of QGA-LVQ neural network in short-term traffic flow, some contrast experiments are performed. Experimental simulation results show that, QGA-LVQ neural network obtains excellent prediction results in prediction accuracy and convergence speed. Besides, compared with GA-BP neural network and wavelet neural network, QGA-LVQ neural network performs better in short-term traffic flow prediction.


I. INTRODUCTION
Along with the rapid development of the economy, people's travel patterns undergo tremendous changes. The number of private car ownership increases greatly and continuously, which leads to many traffic problems. Some experts have already conducted a series of studies on traffic problems [1]- [3]. Among them, the traffic congestion is a very serious traffic problem, which has caught the attention of the public and government departments. Through investigation and analysis, traffic congestion is closely related to traffic flow. Fortunately, the development of artificial intelligence technology provides a new way for smart cities to predict traffic flow, so that regulators can take early action to prevent or ease the congestion.
Artificial neural networks show good performance in the analysis and prediction of complex nonlinear systems [4], [25]- [28], [33]. Many scholars at home or abroad have put forward many kinds of traffic flow prediction methods based on artificial neural networks. Fu et al. proposed a short-term traffic flow prediction based on BP neural network, showing a certain nonlinear fitting ability [5]. Zheng et al. used Convolutional neural networks (CNN) to capture spatial correlations [41]. Xu et al. proposed a traffic flow prediction model based on adaptive particle swarm neural network, which effectively improved the convergence speed within the acceptable prediction error range and enhanced the real-time performance to a certain extent [6]. Jin et al. proposed short-term traffic flow prediction based on wavelet neural network [7], and Lu et al. proposed short-term traffic flow prediction based on improved GA-optimized BP neural network [8], both of which have advantages over the traditional BP neural network in predicting accuracy because they both overcome the sensitivity to the initial value.
Traffic flow prediction is a hot topic. Researchers have achieved many results in this field. Jiang et al. utilize Hidden Markov models (HMMs) to present the statistical relationship between individual vehicle speeds and the traffic speed [42]. Zheng et al. proposed an end-to-end multitask learning time convolutional neural network (MTL-TCNN) to predict short-term passenger demand at the multi-regional level. The algorithm combined with the spatio-temporal dynamic time warping (ST-DTW) feature selector. It can solve the multi-task prediction problem well considering the spatio-temporal correlation [39]. This method tends to recommend schemes for travel modes and is helpful for the selection of travel routes. He et al. proposed a method based on low-frequency probe vehicle data (PVD) to identify intersection traffic congestion in urban road networks [40]. Zheng et al. proposed a traffic prediction model based on Long Short-Term Memory (LSTM) network. Unlike traditional prediction models, the LSTM network considers the spatiotemporal correlation of the transportation system through a 2D network composed of multiple memory units [35]. Bhatia et al. constructed a long short-term memory neural network (LSTM-NN) architecture which overcomes the issue of back-propagated error decay through memory blocks for spatiotemporal traffic prediction with high temporal dependency. They used Mean Squared Error (MSE) to explore the potential to predict real-time traffic trends accurately [43]. Liang et al. proposed a method based on feature selection for linear prediction to identify reasonable spatiotemporal traffic patterns related to the target link [37]. However, linear prediction has limited convergence, and the performance of vector regression is not outstanding. Liu et al. proposed a preprocessing method for the prediction process. This method can determine which features should be included in the input vector [38]. However, this method does not improve the prediction algorithm much. Zheng et al. proposed a tensorbased k-nearest neighbor (K-NN) method that can maintain the general trend of long-term traffic. This method has a good effect on traffic prediction in the case of data loss [36]. It has a certain effect on the prediction of the overall trend, but it has defects in the accuracy at a specific time. Zhang et al. proposed a multi-task learning (MTL) model based on deep learning. The model detects the spatiotemporal causality between links, and selects the most informative features for the MTL model [34]. This leads to loss of information, and the prediction results will be biased by other secondary information without being noticed.
To some extent, artificial neural networks help to regulate the traffic flow of the road network and improve the utilization of the road network. But traffic flow data has some special characteristics such as periodicity, nonlinearity and uncertainty, which makes it difficult to predict accurately and timely. Tanwar et al. used the industrial, scientific and medical (ISM) radio band. to realize the real-time transmission of data signals, which ensured the timeliness of data [44]. Fan et al. proposed to use building sensors and predict real-time traffic based on the relationship between traffic and buildings., which ensure the accurateness of the data [45]. Hence, in some cases, the existing network traffic prediction methods cannot meet the actual demands. There is an urgent need to explore a better method to predict traffic flow. Learning Vector Quantization (LVQ) neural network is an extension of Self-organizing Maps (SOM), with the advantages of simple structure, good clustering effect and simple calculation. Besides, the nonlinear fitting ability of LVQ neural network is also very strong. LVQ is a network that combines supervised learning and competitive learning, and has its own uniqueness compared with the above methods. It services the weakness of the lack of classification information brought about by the self-organizing network using unsupervised learning algorithms. In view of the advantages of LVQ neural network, we attempt to use LVQ neural network to predict short-term traffic flow. At the same time, it also has defects, such as the weight vector may not converge during the training process, and the information of each dimension attribute of the input sample is not fully utilized. In other words, it assumes that the ''contribution'' of each dimension attribute to the classification is the same. In addition, Quantum Genetic Algorithm (QGA) is introduced to overcome the disadvantages of LVQ neural network, including sensitive to initial weights and easily falling into local minima and so on. QGA is a kind of black box algorithm. As an optimized LVQ pre-processing network, it has its unique advantages. Bayesian optimization also is a kind of black box optimization. Its important role is to find the fitting curve of the function, which requires a lot of prior knowledge. The traditional GA network passes the excellent chromosomes and genes to the offspring and regroups them. Its advantage is that it can jump out of the local optimal solution and reach the global optimal solution. QGA represents chromosomes with qubits, quantum revolving gates update chromosomes, and quantum non-gate variant chromosomes. This method converges the probability amplitude to 1 or 0. When the value of LVQ is 0 or 1, the chance of obtaining an equal probability will increase a lot, resulting in an increase in the success rate of clustering. Then, an urban traffic flow prediction method based on Quantum Genetic Algorithm -Learning Vector Quantization (QGA-LVQ) neural network is proposed.
The proposed QGA-LVQ neural network integrates the advantages of QGA and LVQ neural network. It not only has many excellent characteristics similar to LVQ neural network, such as simple structure, few training steps and high classification accuracy, but also uses QGA to have a better global solution, which effectively overcomes the shortcoming of LVQ neural network that is sensitive to initial weights and prone to local minima. LVQ neural network has strong ability of prediction and discrimination for complex nonlinear systems, which is very important for short-term traffic flow prediction.
The rest of this paper is organized as follows: In section 2, the relevant theories (including QGA and LVQ neural network) are analyzed. In section 3, an algorithm of Quantum Genetic Algorithm -Learning Vector Quantization (QGA-LVQ) neural network is proposed, and the application of QGA-LVQ neural network in short-term traffic flow prediction is analyzed. In section 4, in order to test the convergence and optimization ability of the proposed QGA-LVQ neural network, the contrast experiments of the QGA-LVQ neural network, GA-BP neural network [8] and wavelet neural network [7] are performed on five short-term traffic flow data sets. The experimental results show that the algorithm of QGA-LVQ neural network has advantages over the other two algorithms. In section 5, a brief conclusion is given.

II. RELATED WORK A. QGA
In 1996, Ajit and Mark [9] first proposed Quantum Genetic Algorithm (QGA) by integrating quantum computing theory into Genetic Algorithm (GA). QGA represents chromosomes in appropriate quantum states, and their update evolution operations are accomplished by quantum gate rotation. QGA gives full play to the characteristics of quantum computing and inherits the advantages of GA [10]. The calculation process of QGA is given below.

1) QUANTUM BIT CODING
Two different states of a qubit are defined as |0 and |1 in the two-dimensional complex vector space. And the state of a qubit can also be the superposition of the two states [11].
As the smallest unit of information, the state of a qubit can be expressed as equation (1).
where α and β are complex numbers, respectively representing the relevant probability amplitudes, and satisfy the condition |α| 2 + |β| 2 = 1. In QGA, chromosomes are encoded using qubits and quantum superposition states. The encoding of each quantum chromosome is shown in equation (2) [12].
where t is the population algebra, then the quantum population of the t-th generation is represented as . . , q t n }, m is the quantum number, and n is the population size. In addition, the normalization condition (as shown in equation (3)) needs to be satisfied [13].

2) QUANTUM REVOLVING GATES
Update evolution is the key step of QGA. The qubits utilize quantum gates to perform matrix transformation to complete the state migration, to realize the population evolution. Operations of qubits generally use quantum revolving gate, whose definition is shown in equation (4) [14].
The process of the population evolution is shown in equation (5).
where θ i is the rotation angle. The angle and the direction of θ i are determined according to the adjustment rules. The coordinate Schematic diagram of the quantum revolving gate is shown in Fig. 1.

3) QUANTUM CROSSOVER AND MUTATION
Quantum crossover is a full interference crossover operation based on the coherent properties of the quantum. Each quantum chromosome in the population needs to perform a crossover operation. The Table 1 gives an example of a crossover operational approach to diagonal permutation and combination When the number of populations is 6 and the length of chromosomes is 7. VOLUME 8, 2020  In the process of quantum mutation, the quantum mutation operators U(ω( θ i)) are used to achieve updating and optimization [15].
where f (α i , β i ) is the direction of rotation, θ i is the size of the rotation, and is the adjustment factor. The value of is usually small. Differential evolution algorithms (DEA) [16], [17] is another population-based optimization algorithm. Nevertheless, there are still some weaknesses in DEA, e.g. (1) improper control parameter adaptation schemes; and (2) defect in each mutation strategy., existing in some state-ofthe-art DE variants, which may result in slow convergence and worse optimization performance. Therefore, QGA is adapted in the proposed algorithm.

B. LVQ NEURAL NETWORK
The LVQ neural network proposed by Kohonen in 1990 integrates the competitive learning idea with the characteristics of supervised learning algorithm [18]. LVQ neural network has many excellent characteristics, including simple structure, few training steps and high classification accuracy. LVQ neural network shows strong prediction and discrimination ability for complex nonlinear uncertain systems, such as protein sequence prediction [11] and high-voltage circuit breaker diagnosis [19].
The structure of LVQ neural network is divided into three layers, namely the input layer, the competition layer and the output layer, as shown in Fig. 2. The competition layer is mainly responsible for the classification of input layer neurons relative to input vectors.
The concept of the competition layer is derived from the SOM. The neurons in the competition layer compete with each other by calculating distances between the input vector and the neurons themselves. The neuron whose pattern closest to the input vector ''wins'', with the corresponding weight changing to 1; and the other neurons fail, with the weights changing to 0. The connections between input vector and the neurons in the competition layer are full connections, while the connections between the neurons in the competition layer and the neurons in the output layer are partial connections. The neurons in the competition layer are only connected linearly with one neuron in the output layer, and the weights is the same as the weights from the input layer to the competition layer. If the connection exists, the corresponding weight is 1; otherwise, the weight is 0.
LVQ neural network is developed into two types: LVQ1 neural network and LVQ2 neural network. The biggest difference between them is the number of winning neurons in the competition layer. There is only one winning neuron in LVQ1 neural network, while there are two winning neurons in LVQ2 neural network. LVQ2 neural network introduces secondary winning neurons based on LVQ1 neural network to enhance the performance of network training and improve the classification accuracy of the algorithm.
The calculation steps of LVQ1 neural network are shown as follows [20]: Step1: The weight W ij between the input layer and the competition layer is initialized, and the learning rate η (η > 0) is set up.
Step2: The input vector X = (x 1 , x 2 , . . . , x R ) ⊥ (R is the number of input elements) is imported into the input layer, and the distance d between the competition layer neurons and the input vector is calculated: where, S l is the number of competitive neurons [21].
Step3: The competition layer neurons with the shortest distance from the input vector are selected. If d j is the smallest, the category label of the output layer neurons that connected is marked as C j .
Step4: The category label corresponding to the input vector is set to C x . If C j = C x , the weight is adjusted as equation (9).
Otherwise, the weight is adjusted as equation (10).
Step5: The program is jumped to Step2 and repeated until the error precision ε reaches a satisfactory requirement or the number of iterations reaches the maximum.
In LVQ1 neural network, only one neuron in the competition layer is activated. The weight of the winning neuron is modified, while the weight of the other neurons remains unchanged. In LVQ2 neural network, two neurons in the competition layer are activated in network training process. These two neurons are the closest to the input vector, and they are denoted as winning neuron a and sub-winning neuron b, respectively. During a training process, the weights of the winning neuron a and the second winning neuron b are both modified.
LVQ2 can take advantage of updating the weight vector to speed up the optimal solution. At the same time, this method can ensure the timeliness of traffic flow prediction, and correspond to the actual traffic space accurate clustering to achieve the correspondence of the space-time relationship.

III. QUANTUM GENETIC OPTIMIZATION LVQ NEURAL NETWORK FOR SHORT-TERM TRAFFIC FLOW PREDICTION
A. QGA-LVQ NEURAL NETWORK LVQ neural network, like BP neural network, is sensitive to initial weights and prone to local minima [8]. Lu et al. applied the improved GA to BP neural network and obtained better prediction results of the short-time traffic flow. In view of the similar characteristics of LVQ neural network and BP neural network, we intend to apply GA to LVQ neural network. Lin et al. proposed a quantum heuristic genetic algorithm to solve the problem of dynamic continuous network design [22]. Compared with GA, the QGA has the following advantages: 1) richer population diversity; 2) fewer populations; 3) better search capabilities; 4) faster convergence speed; 5) higher convergence accuracy. QGA shows better performance in dealing with nonlinear systems. Since QGA has a better global solution, it is used to effectively overcome the shortcoming of LVQ neural network that easily falls into local minima. At the same time, the introduction of QGA reduces the sensitivity of LVQ neural network to initial weights and improves the convergence speed. Combining QGA and LVQ neural network, an algorithm of Quantum Genetic Algorithm -Learning Vector Quantization (QGA-LVQ) neural network for short -time traffic flow prediction is proposed.
The main idea of QGA-LVQ neural network is to firstly select the initial value for LVQ neural network through QGA method, and then make the population gradually converge to the optimal solution to further improve the classification accuracy. The accuracy of classification is the premise of traffic prediction. Only if the classification is accurate and the convergence of each clustering operation can be achieved, the traffic flow value in a specific time and space can be predicted.
The prediction steps of QGA-LVQ neural network are as follows: Step1: The genetic algebra t is set to zero, that is t = 0, and the population Q(t 0 ) is initialized. Each individual of the initial population is observed once to obtain a state p(t).
Step2: The fitness function of QGA-LVQ neural network is determined according to the distance. The average distance between random individuals in the population and sample points in the input layer is used, which is calculated as equation (11).
where F t is the set of elements belonging to Class k, N k is the number of elements of Class k, and x j is an input vector of the training samples of LVQ neural network. Then, the fitness of the individual is calculated as equation (12).
Step3: The termination condition of the iterative calculation is shown in equation (13). (13) where N is the number of input vectors for the samples. If |D| < ε, the iterative calculation is over.
Step4: t = t + 1, and each individual in population Q(t) is observed once. The fitness for each state is calculated. After that, the population is updated with quantum revolving doors to record the best individuals and their fitness. Then, go back to Step 2.

B. APPLICATION OF QGA-LVQ NEURAL NETWORK IN SHORT-TERM TRAFFIC FLOW PREDICTION
Short-term traffic flow has the characteristics of time variation, non-linear and periodic stability, which is susceptible to many factors in the actual environment. The proposed QGA-LVQ neural network provides a good idea for shortterm traffic flow prediction. First, the short-time traffic flow data set is constructed, and then the QGA-LVQ neural network is generated through training the sample data, so as to achieve efficient prediction.
The short-time traffic flow prediction process based on QGA-LVQ neural network is described in Fig. 3, which includes the schematic diagram. The short-term traffic flow signal is input to the learning network, and the data is classified and converged to 0 or 1 through the QGA network preprocessing mode. These classification data are then subjected to cluster processing of the LVQ network to solve the global optimal solution, so as to achieve the goal of predicting short-term traffic flow values.
Step1: The traffic flow data collected by ground monitors are denoised by wavelet analysis in order to remove the interference signals. In the process of data monitoring, some encryption technologies [23], [24], [29]- [32] are considered to use for the sake of security of the monitor network Step2: The data that denoised are divided into training data and test data.
Step3: Both training samples and test samples are normalized.
Step4: LVQ neural network parameters and QGA parameters are initialized.
Step5: The weights are optimized by QGA method.
Step6: Test samples are used to test the short-term prediction performance of QGA-LVQ neural network.   traffic flow data are normalized. The environment configuration of the simulation experiment is shown in Table 2, and the experimental parameter configuration is shown in Table 3.  Square Error (RMSE) are used to test the convergence and optimization ability of the algorithm, and Running Time (RT) is used to test the convergence rate. Running Time (RT) is based on counting seconds. The other evaluation indicators are calculated as follows.

Five evaluation indicators
The Mean Absolute Percentage Error (MAPE) is shown in equation (14).
The Equal Coefficient (EC) is shown in equation (15).
The Mean Absolute Error (MAE) is shown in equation (16).
The Root Mean Square Error (RMSE) is shown in equation (17).
where N is the number of test samples, Y p (t) is the predicted output value of the QGA-LVQ neural network at Time t and Y r (t) is the actual traffic flow value at Time t. Fig. 4 shows the short-term traffic flow prediction results based on the QGA-LVQ neural network on the Dataset 1. Table 4 shows the evaluation results of short-term traffic flow prediction based on the QGA-LVQ neural network that runs 10 times. It can be seen from Fig. 4 and Table 4 that the predicted results of the proposed QGA-LVQ neural network is almost consistent with the actual traffic flow, which verifies its feasibility.   In addition, the experiments are conducted to compare the proposed QGA-LVQ neural network with GA-BP neural network [8] and wavelet neural network [7] on the dataset1, and the comparison results are shown in Table 5. As can be seen from Table 5, compared with the other two neural network prediction algorithms, the proposed QGA-LVQ shows better prediction performance. In particular, the MAPE of QGA-LVQ is approximately 25% lower than that of GA-BP. Though the running time of QGA-LVQ neural network is longer than that of wavelet neural network. This is because the basis and the whole structure of wavelet neural network are determined based on wavelet analysis theory, which leads to faster convergence speed. However, the running time of QGA-LVQ neural network is still about 7 seconds shorter than that of GA-BP, with stronger real-time performance. By comparing with the LVQ network, the input data processed by the QGA network makes the LVQ network have better convergence and reduces the error. It is worth mentioning that the prediction effect is better. Table 6 shows the prediction results of the QGA-LVQ neural network on five data sets, each of which was run 10 times to average. It can be seen from Table 6,  QGA-LVQ neural network obtains good prediction results on all the five data sets in terms of convergence speed and prediction accuracy. Therefore, it can be concluded that the proposed QGA-LVQ neural network has stability and reliability to some extent, and QGA-LVQ neural network performs well in convergence speed and prediction accuracy.
The experimental process tested the prediction of traffic congestion on a certain road during one day and compared it with the real-time traffic situation. As shown in Figure 5, blue is real-time traffic data, and red is model prediction data. The two data can basically match with each other. The model can predict traffic congestion one hour in advance, which provides early warning for preventing traffic congestion. As shown in Figure 6, the running speed of the vehicle in the real-time road condition information is counted, and a comparison test is performed on the predicted value. The predicted value can better reflect the traffic congestion is lower than the average commute, which is basically consistent with the actual situation.

V. CONCLUSION
A method for predicting urban traffic network traffic based on QGA-LVQ neural network is proposed. By using the QGA with better global solution, the problems that LVQ neural network is sensitive to initial weights and easy to fall into local minimum are solved, and the convergence speed is improved. On five general short-term traffic flow data sets, the contrast experiments of QGA-LVQ neural network, GA-BP neural network and wavelet neural network are conducted. The experimental results show that, compared with GA-BP neural network and wavelet neural network, short-term traffic flow prediction based on QGA-LVQ neural network has better accuracy and real-time performance. In particular, the Mean Absolute Percentage Error (MAPE) of QGA-LVQ is approximately 25% lower than that of GA-BP. Besides, the experimental results on multiple data sets also verify the stability and reliability of QGA-LVQ. By comparing with real-time data, the model prediction results can realize real-time prediction of traffic congestion, and there is a small deviation between the prediction results and the actual situation.