# A Data-Driven Deep Learning Framework for Prediction of Traffic Crashes at Road Intersections
## 4 Model Architecture
### Phase III in RoadInt TCP  
Traffic crash prediction is a typical spatio-temporal prediction topic. Different types of traffic data are embedded in continuous space and change dynamically over time. Therefore, effective extraction of spatio-temporal correlation is a key point to solve traffic crash prediction. Figure 6a,b shows the weekly and hourly traffic crash curves of a specific intersection, respectively. It has been observed from multiple years of records that traffic crashes at this intersection exhibit a time-related behavior. Therefore, it is crucial to capture short-term and long-term time-dependent correlations in the model to improve the accuracy of traffic crash prediction. Figure 6: (**a**) Weekly traffic crash curves of a specific intersection. (**b**) Hourly traffic crash curves of a specific intersection. In addition, we discover that not only the features at nearby intersections in the present moment is useful for traffic crash prediction but also the historical temporal information at nearby intersections has a significant impact. Therefore, we aim to exploit various types of relevant time series in the model. As shown in Figure 7, we give an example of a temporal sequence to Phase III of the RoadInTCP Model. Consider a case where you want to predict whether a traffic crash occurs at an intersection between 8:00 a.m. and 9:00 a.m. on 22 March 2016. The time period previous to the predicted time period (i.e., from 7:00 a.m. to 8:00 a.m. on 22 March 2016), and the same time period in the previous day (i.e., from 8:00 a.m. to 9:00 a.m. on 21 March 2016) and the same time period a week earlier (i.e., from 8:00 a.m. to 9:00 a.m. on 15 March 2016) may provide useful information for the traffic crashes prediction, while the information from 1:00 a.m. to 2:00 a.m. on that day may provide little information. Therefore, in order to obtain sufficient temporal information and reduce the overhead caused by processing irrelevant historical information, Phase III of the RoadInTCP Model is designed to capture multi-pattern features in traffic crash sequences to improve its effectiveness. Motivated by the above arguments, we consider three temporal characteristics in Phase III of RoadInTCP, namely, _immediate feature, short-term feature, and long-term feature_. As shown in Figure 7, we assume that the length of the prediction period \(\Delta t_{q}\) is 1 h, and the immediate feature, short-term feature, and long-term feature are, respectively, taken as integer multiples of \(\Delta t_{q}\). The definitions of these three types of time series are as follows:  
**(1) Immediate feature time series \(\omega_{hour}\)** is a historical time series directly adjacent to the forecast time period. As shown in the blue part of Figure 7, a three-hour time segment directly previous to the prediction period is given. Intuitively, the traffic status of an intersection at this time segment may inevitably affect the traffic in the coming time. Therefore, the immediate feature time series explores the hourly changing patterns in traffic data. \[\omega_{hour}=(X_{\Delta t_{q}-\hat{1}\hat{1}\hat{1}},\ldots,X_{\Delta t_{q}-2 \hat{1}\hat{1}},X_{\Delta t_{q}}) \tag{11}\]  
**(2) Short-term feature time series \(\omega_{day}\)** is the historical time series of the same time period in each of several days before the prediction time period, as shown in the green part in Figure 7, which gives the same time period in each of the two days before the prediction time period. In real life, due to the influence of morning and evening peak hours and people's daily travel patterns, traffic crash data have strong similarities at the same time every day. As shown in Figure 6b, the New York City traffic crash statistics also support this point of view. Therefore, the short-term feature time series explores the daily variation pattern in traffic data.