## 4 Performance Evaluation
### Simulation Setup  
SUMO includes a set of applications that help prepare and perform the simulation of a traffic scenario. A simulation scenario can contain a large number of vehicles and their routes. Even for small areas, such as the test traffic networks, it is almost impossible to define traffic demand manually. For this reason, we use two of the tools included in SUMO, \"randomTrips.py\" [28] and duarouter [29], to generate the traffic demand of a full day for the synthetic networks M4 and M5. With the intention of simulating the traffic of one day as realistic as possible, we define three traffic flows: LIGHT (5-20% of maximum capacity), MEDIUM (60-70% of maximum capacity), and HEAVY (80-95% of maximum capacity). The distribution of these traffic flows are shown in Table 1.  
Depending on the flow defined for a certain period of the day, a random amount of trips are made and distributed evenly throughout that period. A trip describes the movement of a vehicle from a street of origin to a street destination, time of departure, and route followed. Although the trips are generated randomly, each one of them meets a series of requirements:  
1. They have a minimum distance. In the case of the M4 network, the minimum is 600 m. While for the M5 network, the minimum is 800 m.
2. The start and end streets are selected at random. Nonetheless, the tools allow favors to the streets that are in the periphery of the network. 3. The algorithm used to generate the route is the Dijkstra [30] algorithm. The trips generated are stored in a configuration file that defines the traffic demand that will be used in the simulation. To generate the dataset necessary for deep architecture training, we perform 2400 simulations using the previously generated traffic demand file, but using a different pseudo-random number as seed for each simulation. During these simulations, all the vehicles reported the delay when traveling \begin{table}
\begin{tabular}{c c} \hline \hline
**Hours** & **Traffic Flow** \\ \hline
0–5 & LOW \\
6–7 & MEDIUM \\
8 & HIGH \\
9–14 & MEDIUM \\
15 & HIGH \\
16–19 & MEDIUM \\
20 & HIGH \\
21–22 & MEDIUM \\
23 & LOW \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Traffic flows simulated by time of day on a street the segment (1). With these reports, every 300 s, an adjacency matrix is generated with the average delays of each of the streets of the synthetic network (2). The simulation of a full day generates 288 matrices of this type containing the traffic behavior of the 24 h. The values are normalized using the Min-Max technique (3) and stored in a file for later use. \[Z_{i}=\frac{x_{i}-\min(x)}{\max(x)-\min(x)} \tag{3}\]  
The files obtained are divided at random into two groups: training (80%) and validation (20%). Regardless of the group, each file contains a spatio-temporal sequence of P measurements of a region of size M \(\times\) N. For example, for the M5 network we are talking about 288 measurements of a 5 x 5 region. Initially, a two-layer architecture was implemented and evaluated. The training files are segmented using a 20-measurements-wide sliding windows (5 for input and 15 for prediction). The initial network consisted of two ConvLSTM layers with each layer containing 64 hidden states and \(3\times 3\) kernel. We used a per-GPU batch size of 16 and trained with Adam optimizer, setting learning rate to \(10^{-4}\). This architecture worked correctly, achieving 75% accuracy. To increase the accuracy of the model, a new ConvLSTM intermediate layer was added. This process is repeated four times more, using the same hyperparameters each time. After several test with different configurations, it was determined that the best configuration was a deep five-layer ConvLSTM network (Figure 5), with an accuracy of 88%. This architecture proved to have a more accurate spatiotemporal sequence prediction capability, which makes it suitable to provide predictions in complex dynamic systems such as the problem of traffic flow prediction.