## 4 Proposed Framework  
Our focus is to train deep neural networks to be able to estimate performance measures such as wait times, travel times, etc., for a given input traffic and also for different cycle times and green splits (signal timing parameters). These trained models should be able to approximate the dynamics of physical simulators, when used in inference mode has the following advantages:  
* 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.  
Effectively, the model captures the interrelations between the various traffic, signal timing, and topology parameters and their impact on MOEs and allows for understanding the impact of a variety of signal timing parameters on MOEs for a given set of input traffic  
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.  
patterns for a given intersection topology. Additionally, our model generates a distribution rather than summary statistics. The overall workflow for training the neural network is shown in Figure 2. The data corresponding to different counterfactual signal timing plans is generated using microscopic simulators to train deep neural networks. For the rest of this section, for ease of description, we use distribution of wait times as an example of our performance measure. However, our framework is general enough to be used for other measures (or multiple measures) as well. The deep learning model takes input traffic as input and outputs distribution of wait times for different signal timing plans.  
The input traffic waveforms are represented as 1-D vectors, each with T components. Here T refers to the length of time a particular detector's data (arrival volumes) is being considered, with each component being aggregated at a 5-s level. In our work, \(T=72\), i.e., each data vector corresponds to 360 s of data. The output is the distribution of wait times for the 360-s window. The maximum wait time in our dataset is 2000 s, the wait times are binned into bins of size 10 s. So, the output is represented as a vector of size 200. Our proposed model, InterTwin, shown in Figure 3, has two main modules:  
1. Spatial Graph Convolution (Spatial GC) is used to extract spatial features from the detector waveforms where the connectivity information of the intersection is incorporated;
2. 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.  
We now describe each of these modules in detail.  
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 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.