# InterTwin: Deep Learning Approaches for Computing Measures of Effectiveness for Traffic Intersections

^{*}

## Abstract

**:**

## 1. Introduction

- We develop a novel two-module deep learning approach that captures the intrinsic properties of traffic behavior at an intersection. The first module corresponds to a spatial graph convolution that is used to extract spatial features from the detector waveforms leveraging the relationship between intersection lanes and signal timing phases. This makes our modeling relatively independent of the intersection topology. The second module is an encoder-decoder with temporal attention architecture, to capture the temporal dynamic behavior of the traffic flow for each phase based on the signal timing plan. These two modules are stacked together for obtaining the final prediction.
- We show that the InterTwin-trained models are able to accurately predict MOE distributions generated by traffic simulators. After training, when these models are used in inference mode, these models are four to five orders of magnitude faster compared to microscopic simulations. Additionally, it can model multiple intersection topologies without painstakingly redrawing a new base map for each intersection (that is typically required by a microscopic simulator).
- For training our models, we use data generated using a significant extension of SUMO [3], an open source microscopic traffic simulator to make the data generation more realistic. We use real-world recorded data from high resolution loop detectors for input traffic patterns. Additionally, we have developed a new module that uses ring and barrier implementation along with arrival and departure information at the advanced and/or stop bar loop detectors along with signal timing information using techniques described in [6] and use them in our simulation to generate high fidelity MOEs that are reflective of data collected from real intersections. Additionally, we suitably vary signal timing parameters for these patterns to generate potentially viable counterfactuals. This results in our methods being able to generalize beyond what is typically used in actual practice and ensures that the models trained can predict robustly for a wide range of signal timing parameters. We also simulate a variety of intersection basemaps and behaviors, and estimate different measures of effectiveness, such as queue lengths, travel times, and wait times.

## 2. Related Work

- We propose deep neural networks for estimating the distribution of performance measures instead of doing the microscopic simulations. Our methods are at least four to five orders of magnitude faster;
- Our models can also predict the performance measures for counterfactual signal timing plans, i.e., for a given input traffic and also for different cycle times and green splits (signal timing parameters). This can be useful to study the impact of different signal timing parameters.

## 3. Simulator for Dataset Generation

- Reconstruct the unperturbed inflow waveform using stop bar, advance detector actuations, and signal timing information;
- Extract signal timing details from controller logs;
- Create the intersection base map in SUMO based on Google Maps satellite imagery using SUMO NETEDIT;
- The signal timing plan is perturbed within feasible limits to generate viable counterfactual simulations;
- Run multiple simulations in parallel for different signal timing plans;
- The vehicle traces along with detector output files are parsed to store route wise distribution of travel times, wait times along with waveforms at stopbar, advance detectors, and signal timing information.

## 4. Proposed Framework

- The models are four to five orders of magnitude faster compared to simulations;
- The model can be used for multiple intersection topologies;
- These models can also be used to bootstrap the training of reinforcement learning-based optimization algorithms.

- Spatial Graph Convolution (Spatial GC) is used to extract spatial features from the detector waveforms where the connectivity information of the intersection is incorporated;
- The Encoder Decoder with Temporal Attention (EDTAM) module is used to capture the temporal dynamic behavior of traffic flow. These two modules (GC and EDTAM) are stacked together for obtaining the final prediction. The details of each module is as follows.

#### 4.1. Spatial Graph Convolution

#### 4.2. Encoder Decoder with Temporal Attention

#### 4.3. Overall Network

## 5. Experimental Results

- FCN: Fully Connected Network;
- RNN-FCN: Recurrent Neural Network followed by a fully connected layer;
- T-GCN: Temporal graph convolution network for traffic prediction as proposed in [14];
- STGCN: Spatio Temporal Graph Convolution Network for traffic prediction, as proposed in [21];
- ST-RGAN: Spatio Temporal Residual Graph Attention Network as proposed in [15].

- Only Inflow Traffic Waveforms (INF);
- Only Advanced and Stopbar Waveforms (ADV and STP).

## 6. Case Study

## 7. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Hamilton, A.; Waterson, B.; Cherrett, T.; Robinson, A.; Snell, I. The evolution of urban traffic control: Changing policy and technology. Transp. Plan. Technol.
**2013**, 36, 24–43. [Google Scholar] [CrossRef] [Green Version] - Lownes, N.E.; Machemehl, R.B. VISSIM: A multi-parameter sensitivity analysis. In Proceedings of the 2006 Winter Simulation Conference, Monterey, CA, USA, 3–6 December 2006; pp. 1406–1413. [Google Scholar]
- Lopez, P.A.; Behrisch, M.; Bieker-Walz, L.; Erdmann, J.; Flötteröd, Y.P.; Hilbrich, R.; Lücken, L.; Rummel, J.; Wagner, P.; Wiessner, E. Microscopic Traffic Simulation using SUMO. In Proceedings of the IEEE Intelligent Transportation Systems Conference (ITSC), Maui, HI, USA, 4–7 November 2018. [Google Scholar]
- Barceló, J.; Casas, J. Dynamic network simulation with AIMSUN. In Simulation Approaches in Transportation Analysis; Springer: Berlin/Heidelberg, Germany, 2005; pp. 57–98. [Google Scholar]
- Wang, Y.; Zhang, D.; Liu, Y.; Dai, B.; Lee, L.H. Enhancing transportation systems via deep learning: A survey. Transp. Res. Part C Emerg. Technol.
**2019**, 99, 144–163. [Google Scholar] [CrossRef] - Karnati, Y.; Sengupta, R.; Rangarajan, A.; Ranka, S. Subcycle Waveform Modeling of Traffic Intersections Using Recurrent Attention Networks. IEEE Trans. Intell. Transp. Syst.
**2021**, 1–11. [Google Scholar] [CrossRef] - Sanchez-Gonzalez, A.; Godwin, J.; Pfaff, T.; Ying, R.; Leskovec, J.; Battaglia, P. Learning to simulate complex physics with graph networks. In Proceedings of the International Conference on Machine Learning, Virtual Event, 13–18 July 2020; pp. 8459–8468. [Google Scholar]
- Kasim, M.F.; Watson-Parris, D.; Deaconu, L.; Oliver, S.; Hatfield, P.; Froula, D.H.; Gregori, G.; Jarvis, M.; Khatiwala, S.; Korenaga, J.; et al. Building High Accuracy Emulators for Scientific Simulations with Deep Neural Architecture Search. arXiv
**2020**, arXiv:2001.08055. [Google Scholar] - Wang, Y.; Zhao, L.; Li, S.; Wen, X.; Xiong, Y. Short Term Traffic Flow Prediction of Urban Road Using Time Varying Filtering Based Empirical Mode Decomposition. Appl. Sci.
**2020**, 10, 2038. [Google Scholar] [CrossRef] [Green Version] - Arif, M.; Wang, G.; Chen, S. Deep Learning with Non-parametric Regression Model for Traffic Flow Prediction. In Proceedings of the 2018 IEEE 16th International Conference on Dependable, Autonomic and Secure Computing, 16th International Conference on Pervasive Intelligence and Computing, 4th International Conference on Big Data Intelligence and Computing and Cyber Science and Technology Congress (DASC/PiCom/DataCom/CyberSciTech), Athens, Greece, 12–15 August 2018; pp. 681–688. [Google Scholar]
- Wang, Y.; Xu, S.; Feng, D. A New Method for Short-term Traffic Flow Prediction Based on Multi-segments Features. In Proceedings of the 2020 12th International Conference on Machine Learning and Computing, Shenzhen, China, 19–21 June 2020; pp. 34–38. [Google Scholar]
- Xu, D.; Wei, C.; Peng, P.; Xuan, Q.; Guo, H. GE-GAN: A novel deep learning framework for road traffic state estimation. Transp. Res. Part C Emerg. Technol.
**2020**, 117, 102635. [Google Scholar] [CrossRef] - Zargari, S.A.; Siabil, S.Z.; Alavi, A.H.; Gandomi, A.H. A computational intelligence-based approach for short-term traffic flow prediction. Expert Syst.
**2012**, 29, 124–142. [Google Scholar] [CrossRef] - Zhao, L.; Song, Y.; Zhang, C.; Liu, Y.; Wang, P.; Lin, T.; Deng, M.; Li, H. T-GCN: A Temporal Graph Convolutional Network for Traffic Prediction. IEEE Trans. Intell. Transp. Syst.
**2020**, 21, 3848–3858. [Google Scholar] [CrossRef] [Green Version] - Fang, M.; Tang, L.; Yang, X.; Chen, Y.; Li, C.; Li, Q. FTPG: A Fine-Grained Traffic Prediction Method With Graph Attention Network Using Big Trace Data. IEEE Trans. Intell. Transp. Syst.
**2021**. [Google Scholar] [CrossRef] - Saroj, A.; Roy, S.; Guin, A.; Hunter, M.; Fujimoto, R. Smart city real-time data-driven transportation simulation. In Proceedings of the 2018 Winter Simulation Conference (WSC), Gothenburg, Sweden, 9–12 December 2018; pp. 857–868. [Google Scholar] [CrossRef]
- Brügmann, J.; Schreckenberg, M.; Luther, W. Real-Time Traffic Information System Using Microscopic Traffic Simulation. In Proceedings of the 2013 8th EUROSIM Congress on Modelling and Simulation, Cardiff, UK, 10–13 September 2013; pp. 448–453. [Google Scholar] [CrossRef]
- Klein, L.A.; Mills, M.K.; Gibson, D.R. Traffic Detector Handbook: Volume I; Technical Report; Turner-Fairbank Highway Research Center Georgetown Pike: McLean, VA, USA, 2006.
- Chamberlin, R.; Fayyaz, K. Using ATSPM Data for Traffic Data Analytics; Technical Report; Report No. UT-19.22 Utah Department of Transportation. Available online: https://trid.trb.org/view/1671474 (accessed on 5 December 2021).
- Hamilton, W.L.; Ying, R.; Leskovec, J. Inductive Representation Learning on Large Graphs. In Proceedings of the 31st International Conference on Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017. [Google Scholar]
- Yu, B.; Yin, H.; Zhu, Z. Spatio-Temporal Graph Convolutional Networks: A Deep Learning Framework for Traffic Forecasting. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI-18, International Joint Conferences on Artificial Intelligence Organization, Stockholm, Sweden, 13–19 July 2018; pp. 3634–3640. [Google Scholar] [CrossRef] [Green Version]
- Chami, I.; Abu-El-Haija, S.; Perozzi, B.; Ré, C.; Murphy, K. Machine Learning on Graphs: A Model and Comprehensive Taxonomy. arXiv
**2021**, arXiv:2005.03675. [Google Scholar] - Kipf, T.N.; Welling, M. Semi-Supervised Classification with Graph Convolutional Networks. In Proceedings of the 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, 24–26 April 2017. [Google Scholar]
- Defferrard, M.; Bresson, X.; Vandergheynst, P. Convolutional Neural Networks on Graphs with Fast Localized Spectral Filtering. Adv. Neural Inf. Process. Syst.
**2016**, 29, 3844–3852. [Google Scholar] - Levie, R.; Monti, F.; Bresson, X.; Bronstein, M.M. CayleyNets: Graph Convolutional Neural Networks With Complex Rational Spectral Filters. IEEE Trans. Signal Process.
**2019**, 67, 97–109. [Google Scholar] [CrossRef] [Green Version] - Cho, K.; Merriënboer, B.V.; Gulcehre, C.; Bahdanau, D.; Bougares, F.; Schwenk, H.; Bengio, Y. Learning phrase representations Using RNN encoder-decoder for statistical machine translation. arXiv
**2014**, arXiv:1406.1078. [Google Scholar] - Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; et al. PyTorch: An Imperative Style, High-Performance Deep Learning Library Advances. Adv. Neural Inf. Process. Syst.
**2019**, 32, 8026–8037. [Google Scholar]

**Figure 1.**Ring and barrier controller allows us to separate the 8 lane-movements (i.e., phases 1–8) into two concurrency groups, with one group with the major street movements and one for minor street. Key signal timing parameters include cycle time, barrier time, max green splits, etc. For a given input traffic flow, the signal timing parameters are varied to generate different scenarios.

**Figure 2.**Overall workflow for training the neural network. The data corresponding to different counterfactual signal timing plans is generated using microscopic simulators to train deep neural networks. The trained neural networks can replace the simulators for predicting MOEs such as wait times and are four to five orders of magnitude faster. MOEs: Measures of Effectiveness.

**Figure 3.**Architecture of the proposed InterTwin model. Spatial Graph Convolution (Spatial GC) is used to extract spatial features from the detector waveforms where the connectivity information of the intersection is incorporated. The encoder-decoder block is used to capture temporal dynamic behavior of the traffic flow.

**Figure 4.**A typical intersection with 8 different directions of vehicular movement (phases 1 to 8). Vehicle waveforms are observed at Stop bar and Advance detectors (STP, ADV). STP, ADV, and INF corresponds to the traffic waveform at stopbar detector, advanced and inflow (500 m away from the intersection) aggregated at a 5-s interval. SIG corresponds to signal timing at a 5-s interval. STP, ADV, and SIG are typically available in ATSPM data for every intersection.

**Figure 5.**Summary statistics such as 50th/70th percentile etc. can be computed from the predicted distribution. Actual vs. predicted scatter plot of 50th, 70th percentile of wait time computed from the distribution. The key advantage is that predicting distribution enables us to compute any statistic of interest.

**Figure 6.**Actual vs. predicted distribution of wait time for different green time splits for a given input traffic. These plots show that the model is able to capture the interrelationship between input traffic and signal timing parameters.

**Figure 7.**Scatter plot of 75th percentile of wait times for major vs. minor movements for different barrier-1 times. This can be useful to understand trade-offs in wait time for selecting different barrier-1 times for major vs. minor streets.

**Table 1.**Table showing raw event logs from signal controllers. Most modern controllers generate these data at a frequency of 10 Hz.

Signal ID | Times Tamp | Event Code | Event Param |
---|---|---|---|

1490 | 2018-08-01 00:00:00.000100 | 82 | 3 |

1490 | 2018-08-01 00:00:00.000300 | 82 | 8 |

1490 | 2018-08-01 00:00:00.000300 | 0 | 2 |

1490 | 2018-08-01 00:00:00.000300 | 0 | 6 |

1490 | 2018-08-01 00:00:00.000300 | 46 | 1 |

1490 | 2018-08-01 00:00:00.000300 | 46 | 2 |

1490 | 2018-08-01 00:00:00.000300 | 46 | 3 |

**Table 2.**Table comparing performance of different models. The input to the models are ADV, STP, and SIG. This suggests that our InterTwin model has better accuracy compared to other model architectures. MSE: Mean Square Error, RMSE: Root Mean Square Error, and MAE: Mean Absolute Error.

Model | MSE | RMSE | MAE |
---|---|---|---|

FCN | 1.5 × 10^{−4} | 0.0084 | 0.003 |

RNN-FCN | 2.2 × 10^{−4} | 0.0091 | 0.0032 |

T-GCN [14] | 1.2 × 10^{−4} | 0.008 | 0.0026 |

STGCN [21] | 1.5 × 10^{−4} | 0.0085 | 0.0031 |

ST-RGAN [15] | 5.4 × 10^{−3} | 0.0165 | 0.0095 |

InterTwin (ours) | 0.9 × 10^{−4} | 0.0076 | 0.0023 |

**Table 3.**Comparison of model performance for different input parameters. This suggests that using STP, ADV has better accuracy compared to using INF waveform. The InterTwin model also has better accuracy. It is more practical to use INF along with SIG as INF waveforms are not affected by SIG and multiple signal timing parameters can be evaluated in parallel. Whereas, the other model (STP ADV SIG) can be useful to understand performance measures on recorded historical data.

Model | Inputs | Train Error (MSE) | Test Error (MSE) |
---|---|---|---|

InterTwin | STP ADV SIG | 0.9 × 10^{−4} | 0.9 × 10^{−4} |

InterTwin | INF SIG | 2.0 × 10^{−4} | 2.1 × 10^{−4} |

FCN | STP ADV SIG | 1.3 × 10^{−4} | 1.5 × 10^{−4} |

FCN | INF SIG | 3.0 × 10^{−4} | 3 × 10^{−4} |

**Table 4.**Analysis on Intersection-1205 on 4 February 2019. Changing barrier-1 time from existing value 80 s to 60 s at 8:00 a.m. would improve the wait time on major direction by around 27%. NBT: North Bound Through, SBT: South Bound Through.

Time | Barrier Time —New | Barrier Time —Old | % Improvement of Wait Time on NBT | % Improvement of Wait Time on SBT |
---|---|---|---|---|

8:00 a.m. | 60 | 80 | 26 | 29 |

9:00 a.m. | 70 | 80 | 15 | 12 |

10:00 a.m. | 70 | 80 | 12 | 10 |

11:00 a.m. | 50 | 80 | 34 | 30 |

12:00 p.m. | 60 | 80 | 21 | 21 |

01:00 p.m. | 60 | 80 | 22 | 23 |

02:00 p.m. | 60 | 80 | 22 | 24 |

03:00 p.m. | 50 | 80 | 37 | 34 |

04:00 p.m. | 60 | 80 | 25 | 33 |

05:00 p.m. | 50 | 80 | 34 | 35 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Karnati, Y.; Sengupta, R.; Ranka, S.
InterTwin: Deep Learning Approaches for Computing Measures of Effectiveness for Traffic Intersections. *Appl. Sci.* **2021**, *11*, 11637.
https://doi.org/10.3390/app112411637

**AMA Style**

Karnati Y, Sengupta R, Ranka S.
InterTwin: Deep Learning Approaches for Computing Measures of Effectiveness for Traffic Intersections. *Applied Sciences*. 2021; 11(24):11637.
https://doi.org/10.3390/app112411637

**Chicago/Turabian Style**

Karnati, Yashaswi, Rahul Sengupta, and Sanjay Ranka.
2021. "InterTwin: Deep Learning Approaches for Computing Measures of Effectiveness for Traffic Intersections" *Applied Sciences* 11, no. 24: 11637.
https://doi.org/10.3390/app112411637