## 2 Proposed Intelligent Real-Time Modelling System
### Safety Predictive Toolkit (SPT)  
After a base input file was constructed, the associated dataset noise was first removed before proceeding toward data analysis. Safety Predictive models were constructed in this toolkit by modelling the selected input variables from the literature and mapping them with the desired output variables (Table 1). Such grouping of the output variables is the recommended division by the Department for Transport (DfT). The modelling was performed through the neural network classifier and deep learning. The input base file was randomly divided in the ratio of 6.5:3.0:0.5 for Training: Validation: and Testing. This division is advised for the network to develop accurate prediction characteristics. This division guarantees that the network has enough data to learn correctly, evaluate the trained model, and apply the models developed to untrained scenarios. The Bernoulli distribution assures that the data are randomly distributed. Four types of input variables were used for constructing the predictive model: (a) Infrastructure, (b) Spatial, (c) Personal attributes, and (d) Environmental variables. Twelve infrastructure variables were used for modelling: (a) road type, (b) type of intersection, (c) type of junction control, (d) vehicle manoeuvre--the manoeuvre that the rider was executing or purposefully conducting at the moment of the crash, (e) speed limit, (f) carriageway hazard, (g) vehicle junction location, (h) road location of the vehicle, (i) skidding and overturning, and (j) special site conditions (any infrastructure defects at crash location). At junctions, the rider may be compelled to transfer from one hierarchical level of road classification to another. Hence, two further variables were used for modelling: (k) first road class, and (l) second road class. There were four spatial variables used as input variables. These were (a) hour of the crash, (b) day of the crash, (c) month of the crash, and (d) total number of vehicles involved in the crash. The hour, day, and month of the crash were used as lurking variables to represent the traffic flow conditions. Three personal attributes were used: (a) rider gender, (b) breath test, to check whether the rider was intoxicated during the crash, and (c) purpose of the journey undertaken when the crash occurred. Three environmental variables were used for modelling: (a) prevalent lighting conditions, (b) prevalent meteorological conditions, and (c) meteorological road surface conditions. The proposed learning system tried to mimic the working of the human brain. A multilayer learning system was developed, with two hidden layers between the input and output layers. The backpropagation algorithm-based four-step iterative learning process was used to map the selected input with the output variables. **Step 1:** To begin, random weights were assigned to each layer neuron, and activation functions were employed to transmit signals between different layers. **Step 2:** The second phase was error modelling. The cross-entropy error function simulated the difference between the output of random weights and the desired output. **Step 3:** The first randomly modified synaptic weights were adjusted in the third step: Based on the error computed in step 2, the initially randomly assigned synaptic weights were adjusted. The backpropagation algorithm was used to achieve this modification. **Step 4:** The preceding stages were iterated indefinitely until the maximum number of iterations (epochs), or minimal training error change was reached. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**No.** & **Output Variable** & **No.** & **Output Variable** \\ \hline
1. & 0–16 & 5. & 45–54 \\ \hline
2. & 17–24 & 6. & 55–64 \\ \hline
3. & 25–34 & 7. & Over 65 \\ \hline
4. & 35–44 & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Output variable for constructing the predictive model. The network structure is explicitly described in Table 2, with the set-out parameters used in the deep learning and neural network classifier.