Patent Publication Number: US-2023140289-A1

Title: Traffic accident prediction systems and methods

Description:
CROSS-REFERENCES TO RELATED APPLICATIONS 
     The present disclosure claims priority to U.S. Provisional Patent Application 63/275,206 titled “Traffic Accident Prediction Systems and Methods” having a filing date of Nov. 3, 2021, the entirety of which is incorporated herein. 
    
    
     BACKGROUND 
     Traffic police patrol are typically dispatched uniformly to urban zones, with the aim of covering as much area as possible in order to respond to traffic accidents as quickly as possible. The problem with this approach, however, is that traffic accident distribution is not uniform, e.g., some busy zones during rush hour traffic tend to have more accidents than other areas. Consequently, patrol vehicles sent to zones with many accidents are often busy, while other patrol vehicles may unnecessarily roam about in zones with no accidents, thereby leading to suboptimal response time to accidents. Manually adjusting a dispatching plan for patrol vehicles is tedious and error-prone, since the number of accidents in each zone varies depending on a time of the day, day of the week, weather, special events or holidays, road changes, ongoing construction work, existing accidents, etc. 
     One solution to manually adjusting a dispatching plan is to train an intelligent dispatching system that uses a machine learning model to proactively predict a number of traffic accidents in each zone in the next police patrol shift. More patrol vehicles may then be dispatched to zones with an anticipated high traffic accident rate in the next relevant time period (e.g., next few hours). This approach models the number of accidents in each zone as an independent time series without attributes. Such an approach fails to take into account other important factors that can affect a predicted accident rate in a zone, such as the number of accidents in neighboring zones and external factors such as weather conditions. 
     Accordingly, a need exists for an intelligent system that predicts traffic accidents in a predetermined area over a predetermined period of time, in order to assist with the efficient distribution of public safety resources to respond to these traffic accidents. 
     SUMMARY 
     The present disclosure generally relates to traffic accident prediction systems and methods. 
     In light of the present disclosure, and without limiting the scope of the disclosure in any way, in an aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, a system for a traffic accident prediction is provided. 
     In an aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, the traffic accident prediction system includes a processor in communication with a memory, where the processor is configured to receive information related to traffic accidents and determine using an accident prediction model to determine a predicted amount of traffic accidents in a predetermined geographic region over a predetermined period of time. 
     In an aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, a processor is further configured to preprocess the received information for use in the accident prediction model, by extracting a feature matrix of features of interest from the received information 
     In an aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, accident prediction model combines multiple graphical representations of the received information related to traffic accidents using a graph convolutional network. 
     In an aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, accident prediction model combines multiple graphical representations of the received information related to traffic accidents using a graph convolutional network. 
     In an aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, the accident prediction model performs a mapping function to predict an accident number count for a predetermined area over a predetermined period of time. 
     In another aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, the accident prediction model may be implemented in the form of a spatiotemporal attention-based, multi-graph convolutional neural network. 
     In another aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, the accident prediction model is comprised of a plurality of machine learning models. 
     In another aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, the accident prediction model outputs the predicted amount of traffic accidents in a predetermined geographic region over a predetermined period of time in the form of a traffic accident prediction map. 
     In another aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, a method for traffic accident prediction consists of receiving information related to traffic accidents in a predetermined geographic region, constructing multiple graphical representations of the received information, and training a machine learning model to predict the number of traffic accidents using the graphical representations of the received information. 
     In another aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, the method for traffic accident prediction further comprises, extracting a feature matrix from the received information related to traffic accidents which is used to construct multiple graphical representations of the received information. 
     In another aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, a method for traffic accident prediction includes receiving a feature matrix of features of interest for a predetermined area and over a predetermined time. 
     In another aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, wherein constructing multiple graphical representations of the received information as a part of a method of traffic accident prediction, includes an adaptive adjacency matrix, which self-learns hidden dependencies between entries in a feature matrix included in the received information. 
     In another aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, the method for traffic accident prediction further comprises, visually projecting a predicted number of traffic accidents on a traffic accident prediction map. 
     In another aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, training a machine learning model, as a part of a method of traffic accident prediction comprises, includes an extracting features of interest from the received information, performing a multi-graph, multi-layer convolution, applying a spatial attention mechanism, implementing a recurrent network to update future calculations based on past calculations, supplying the machine learning model with known future information, applying a temporal attention mechanism, and outputting a predicted number of traffic accidents for a predetermined area over a predetermined period of time. 
     In another aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, training a machine learning model, as a part of a method of traffic accident prediction, includes implementing a recurrent network wherein implementing a recurrent network includes a long term short memory neural network. 
     In another aspect of the present disclosure, which may be combined with any other aspect listed herein unless specified otherwise, wherein outputting a predicted number of traffic accidents for a predetermined area over a predetermined period of time, as a part of a method of traffic accident prediction, includes visually projecting the predicted number of traffic accidents on a traffic accident prediction map. 
     The reader will appreciate the foregoing details, as well as others, upon considering the following detailed description of certain non-limiting embodiments including a traffic accident prediction system and method according to the present disclosure. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       The accompanying figures depict various elements of the one or more embodiments of the present disclosure, and are not considered limiting of the scope of the present disclosure. 
       In the Figures, some elements may be shown not to scale with other elements so as to more clearly show the details. Additionally, like reference numbers are used, where possible, to indicate like elements throughout the several Figures. 
         FIG.  1    illustrates an example system for predicting traffic accidents, according to an aspect of the present disclosure. 
         FIG.  2    illustrates an example accident prediction model to be implemented into a traffic accident prediction system, according to an aspect of the present disclosure. 
         FIG.  3    illustrates an example accident prediction model with a preprocessing module to be implemented into a traffic accident prediction system, according to an aspect of the present disclosure. 
         FIG.  4    is a flowchart of the functions of the accident prediction system, according to embodiments of the present disclosure. 
         FIG.  5    is a flowchart of an example method of predicting traffic accidents, according to embodiments of the present disclosure. 
         FIG.  6    is a flowchart of an example method of predicting traffic accidents, according to embodiments of the present disclosure. 
     
    
    
     DETAILED DESCRIPTION 
     The present disclosure generally relates to traffic accident prediction systems and methods. 
       FIG.  1    illustrates an example system  100  for predicting traffic accidents in predetermined geographic zones. The system  100  may include a traffic accident prediction system  102 . In various aspects, the traffic accident prediction system  102  may include a processor in communication with a memory  106 . The processor may be a CPU  104 , an ASIC, or any other similar device. The traffic accident prediction system  102  may include an accident prediction model  108  trained to predict traffic accidents in a predetermined geographic region during a predetermined time period based on various factors. The accident prediction model  108  may be implemented by one or more suitable machine learning models, including one or more supervised learning models, unsupervised learning models, or other types of machine learning models. For example, the accident prediction model  108  may be implemented as a deep, attention-based graph neural network (GNN). In other examples, the components of the traffic accident prediction system  102  may be combined, rearranged, removed, or provided on a separate device or server. 
     The traffic accident prediction system  102  may be in communication with an external system  120  over a network  110 . The network  110  can include, for example, the Internet or some other data network, including, but not limited to, any suitable wide area network or local area network. The external system  120  may collect various data that it transmits to the traffic accident prediction system  102  for accident prediction. For example, the external system  120  may transmit traffic data, weather data, etc. In some aspects, the traffic accident prediction system  102  may collect this data itself and not need to collect any data from the external system  120 . 
     The traffic accident information may include factors such as specific time, location, road type, road conditions, and weather conditions for the predetermined geographic area of interest. 
       FIG.  2    illustrates an accident prediction model  108  for use in a traffic accident prediction system  102 . According to an embodiment of the present disclosure, the accident prediction model  108  may be implemented as a spatiotemporal attention-based multi-graph convolution neural network. Such a network may be comprised of an encoder  130 , a decoder  140 , and a traffic accident prediction  150 . 
     In embodiments of the present disclosure, methods and systems for the prediction of traffic accidents in a predetermined area over a predetermined period of time are provided. The predetermined area of interest is defined as an undirected graph, G, consisting of all sets of nodes, V, and edges, E. An adjacency matrix, A, represents the interconnections of nodes. Therefore the predetermined area of interest (area network) can be defined by G=(V, E, A). Each node in the area network samples D records at the same frequency. 
     In embodiments of the present disclosure, the accident prediction model  108  determines a spatiotemporal-based traffic accident prediction, which can be perceived as a mapping function ƒ(·) on the premise of area network, G, with a feature matrix set, X, that contains known traffic information and external observations extracted, where the feature matrix of each sample is defined as x∈R n×S×D  and the features of the i-th node in each sample as x i ∈R S×D , where n is the number of nodes and S is the length of the historical time series. 
     The output of this mapping function is a traffic accident count C, where the count is expressed as C∈R m×n×T , where m is the number of samples from the original data and T is the length of the predetermined time period. 
     In embodiments of the present disclosure, the accident prediction model  108  performs an accident prediction that can be expressed by Formula 1 below, where X (t−S):t ∈R m×n×S×D  and C (t+1):(t+T) ∈R m×n×T . 
     
       
         
           
             
               
                 
                   
                     ( 
                     
                       
                         X 
                         
                           
                             ( 
                             
                               t 
                               - 
                               S 
                             
                             ) 
                           
                           : 
                           t 
                         
                       
                       , 
                       G 
                     
                     ) 
                   
                   
                     → 
                     
                       f 
                       ⁡ 
                       ( 
                       · 
                       ) 
                     
                   
                   
                     C 
                     
                       
                         ( 
                         
                           t 
                           + 
                           1 
                         
                         ) 
                       
                       : 
                       
                         ( 
                         
                           t 
                           + 
                           T 
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   Formula 
                   ⁢ 
                       
                   1 
                 
               
             
           
         
       
     
     The accident prediction model  108 , given a spatiotemporal field G, a matrix set X, the number of traffic accidents C in each area up to time T, a training dataset defined by Formula 2, and a testing dataset defined by Formula 3 below, finds the mapping function ƒ(·) that can predict C (t+1):(t+T)  while minimizing prediction error. 
         D   train ={( X   train   (t−S):t   , G ),  C   train   (t+1):(t+T)    Formula 2
 
         D   test ={( X   test   (t−S):t   , G ),  C   test   (t+1):(t+T)    Formula 3
 
     In an embodiment of the present disclosure, the encoder  130  may contain a graph construction module  131 , a multi-graph convolution module  132 , a spatial attention module  133 , and a recurrent module  134 . 
     The graph construction module  131  is used to extract local spatial dependencies hidden in the input data. It does so by constructing multiple different graphs of the input data. In one embodiment, the graph construction module  131  generates a distance graph. The distance graph allows for the analysis of physical space distribution in order to extract spatial features by taking into account the correlations and influence neighboring areas have on each other. The distance graph takes in the geographic coordinates of the area where an accident occurred and graphs an edge between said area and any other node representing a different geographical area according to Formula 4 below, where ε is the distance threshold, and d i,j  is the distance between node i and node j. 
     
       
         
           
             
               
                 
                   
                     
                       A 
                       ~ 
                     
                     dis 
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             1 
                             , 
                             
                               
                                 d 
                                 
                                   i 
                                   , 
                                   j 
                                 
                                 
                                   - 
                                   1 
                                 
                               
                               &gt; 
                               ε 
                             
                           
                         
                       
                       
                         
                           
                             0 
                             , 
                             
                               
                                 d 
                                 
                                   i 
                                   , 
                                   j 
                                 
                                 
                                   - 
                                   1 
                                 
                               
                               ≤ 
                               ε 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   Formula 
                   ⁢ 
                       
                   4 
                 
               
             
           
         
       
     
     The graph construction module  131  also generates an adaptive adjacency matrix that can directly learn hidden dependencies of nodes from a large amount of data without any prior knowledge. The graph construction module  131  generates the adaptive adjacency matrix according to Formula 5 below, where E 1  is regarded as source embedding and E 2  is regarded as target node embedding and both E 1  and E 2  contain learnable parameters. 
         Ã   adp =softmax(ReLU( E   1   E   2   T ))   Formula 5
 
     The product of E 1  and E 2  is the weight of the spatial dependence of the two nodes. The softmax function is utilized to standardize the adaptive adjacency matrix, while the rectified linear unit (ReLU) activation function is utilized to eliminate weak connections. 
     The encoder  130  may also contain a multi-graph convolution module  132 . The multi-graph convolution module  132  performs a multi-layer graph convolution with a layer-wise propagation rule as shown in Formula 3 below. Through this operation the module  132  parameterizes the convolution kernel and defines the node weight matrix from a spatial perspective to reduce time and space complexity. In Formula 6, Ã=A+I N , Ã∈R n×n  denotes the adjacency matrix of the undirected graph G with self-loops to take into account the information of the node and its neighboring nodes. 
     
       
         
           
             
               A 
               ~ 
             
             = 
             
               
                 
                   D 
                   ~ 
                 
                 
                   - 
                   
                     1 
                     2 
                   
                 
               
               ⁢ 
               
                 A 
                 ~ 
               
               ⁢ 
               
                 
                   D 
                   ~ 
                 
                 
                   - 
                   
                     1 
                     2 
                   
                 
               
             
           
         
       
     
     denotes the normalized adjacency matrix, where   equals Σ j    H (l)  represents the feature matrix of all nodes in layer l. W (l)  represents the corresponding trainable matrix that will be updated during training. The symbol σ represents a non-linear activation function, such as the ReLU function. 
     
       
         
           
             
               
                 
                   
                     H 
                     
                       ( 
                       
                         l 
                         + 
                         1 
                       
                       ) 
                     
                   
                   = 
                   
                     σ 
                     ⁡ 
                     ( 
                     
                       
                         
                           D 
                           ~ 
                         
                         
                           - 
                           
                             1 
                             2 
                           
                         
                       
                       ⁢ 
                       
                         A 
                         ~ 
                       
                       ⁢ 
                       
                         
                           D 
                           ~ 
                         
                         
                           - 
                           
                             1 
                             2 
                           
                         
                       
                       ⁢ 
                       
                         H 
                         
                           ( 
                           l 
                           ) 
                         
                       
                       ⁢ 
                       
                         W 
                         
                           ( 
                           l 
                           ) 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   Formula 
                   ⁢ 
                       
                   6 
                 
               
             
           
         
       
     
     The multi-graph convolution module  132  combines distance spatial information and self-learned hidden graph dependencies from the previously constructed graphs in order to learn features of the fused graphs, where the features of the distance graph and the self-adaptive adjacency matrix are combined according to Formula 7 below, which results in a propagation rule defined by Formula 8 below. 
         Z =[ A   dis   ∥A   adp ]  Formula 7
 
         H   (l+1) =σ( ZH   (l)   W   (l) )   Formula 8
 
     By combining features from multiple graphs, the multi-graph convolution module  132  aggregates the transformed feature information from the different neighborhoods of each node. Accordingly, the multi-graph convolution module  132  further updates the feature matrix. In some embodiments of the present disclosure, the multi-graph convolution module takes the form of a graph convolutional network (GCN). 
     The encoder  130  may also contain a spatial attention module  133 . The spatial attention module  133  captures how the traffic conditions of different areas influence each other and how these correlations change over time. The spatial attention module  133  applies an attention mechanism defined below in Formula 9-11. The weight from v i  to its neighboring node v j  is defined by Formula 10, where a is a vector of learnable parameters. 
     
       
         
           
             
               
                 
                   
                     e 
                     ij 
                   
                   = 
                   
                     Leaky 
                     ⁢ 
                     
                          
                         
                     
                     ⁢ 
                     
                       ReLU 
                       ⁡ 
                       ( 
                       
                         
                           a 
                           T 
                         
                         [ 
                         
                           
                             W 
                             
                               ( 
                               l 
                               ) 
                             
                           
                           ⁢ 
                           
                             H 
                             i 
                             
                               ( 
                               l 
                               ) 
                             
                           
                           ⁢ 
                           
                             W 
                             
                               ( 
                               l 
                               ) 
                             
                           
                           ⁢ 
                           
                             H 
                             j 
                             
                               ( 
                               l 
                               ) 
                             
                           
                         
                         ] 
                       
                       ) 
                     
                   
                 
               
               
                 
                   Formula 
                   ⁢ 
                       
                   9 
                 
               
             
           
         
       
       
         
           
             
               
                 
                   
                     α 
                     ij 
                   
                   = 
                   
                     
                       softmax 
                       ⁢ 
                          
                       
                         ( 
                         
                           e 
                           ij 
                         
                         ) 
                       
                     
                     = 
                     
                       
                         exp 
                         ⁢ 
                            
                         
                           ( 
                           
                             e 
                             ij 
                           
                           ) 
                         
                       
                       
                         
                           ∑ 
                           
                             
                               v 
                               k 
                             
                             ∈ 
                             
                               N 
                               ⁡ 
                               ( 
                               
                                 v 
                                 i 
                               
                               ) 
                             
                           
                         
                           
                         
                           exp 
                           ⁢ 
                              
                           
                             ( 
                             
                               e 
                               ik 
                             
                             ) 
                           
                         
                       
                     
                   
                 
               
               
                 
                   Formula 
                   ⁢ 
                       
                   10 
                 
               
             
           
         
       
       
         
           
             
               
                 
                   
                     H 
                     
                       ( 
                       
                         l 
                         + 
                         1 
                       
                       ) 
                     
                   
                   = 
                   
                     σ 
                     ⁡ 
                     ( 
                     
                       
                         ∑ 
                         
                           
                             v 
                             j 
                           
                           ∈ 
                           
                             N 
                             ⁡ 
                             ( 
                             
                               v 
                               i 
                             
                             ) 
                           
                         
                       
                       
                         
                           a 
                           ij 
                         
                         ⁢ 
                         
                           W 
                           
                             ( 
                             l 
                             ) 
                           
                         
                         ⁢ 
                         
                           H 
                           j 
                           
                             ( 
                             l 
                             ) 
                           
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   Formula 
                   ⁢ 
                       
                   11 
                 
               
             
           
         
       
     
     The output of the spatial attention module  133  is a matrix set of spatial features,  , extracted by the multi-graph convolution module  132  and the spatial attention module  133  according to formula 12 below. 
         = AMG conv( X   t   , Z )   Formula 12
 
     The encoder  130  may contain a recurrent module  134 . The recurrent module  134  may be implemented as a recurrent neural network, such as a long term short memory (LTSM). In an embodiment of the present disclosure, the LTSM is structured according to Formulas 13-17 listed below. 
         t   t   (l) =σ( W   i1   (l)   H   t−1   (l)   +W   i2   (l)   {tilde over (X)}   t   (l)   +b   i   (l) )   Formula 13
 
         o   t   (l) =σ( W   o1   (l)   H   t−1   (l)   +W   o2   (l)   {tilde over (X)}   t   (l)   +b   o   (l) )   Formula 14
 
       ƒ t   (l) =σ( W   ƒ1   (l)   H   t−1   (l)   +W   ƒ2   (l)   {tilde over (X)}   t   (l)   +b   ƒ   (l) )   Formula 15
 
         c   t   (l) =ƒ t   (l)    ⊙c   t−1   (l)   +i   t   (l)  ⊙tan h ( W   c1   (l)   H   t−1   (l)   +W   c2   (l)   {tilde over (X)}   t   (l)   +b   c   (l) )    Formula 16
 
         H   t   (l)   =o   t   (l)  ⊙ tan h ( c   t   (l) )   Formula 17
 
     The feature matrix for the current time stamp is calculated using the previous hidden status H t−s−1  and   at time step t−s, s∈{0, 1, . . . , S}. 
     The recurrent module 134  calculates these recurrent units and stores all of the spatiotemporal information collected in the encoder  130  in a context vector, C. This context vector serves as the connection between the encoder  130  and decoder  140 . 
     The accident prediction model  108  contains a decoder  140 . The decoder may contain a decoder recurrent module  141 , a future information module  142 , and a temporal attention module  143 . 
     The decoder  140  may contain a decoder recurrent module  141  and a future information module  142 . The decoder recurrent module  141  may be implemented as a recurrent neural network, such as a LTSM. The decoder recurrent module uses the context vector C as its initial hidden state to decode output sequences. 
     The future information module provides the decoder recurrent module  141  with known future inputs, E t+k   i , which contain date and historical statistic information, in order to avoid increasing the complexity and calculation burden of the accident prediction model  108  and to increase the prediction accuracy. The output of the decoder recurrent module  141  is defined by Formula 18 below. 
     
       
         
           
             
               
                 
                   
                     H 
                     
                       t 
                       + 
                       k 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             
                               decoder 
                               ⁢ 
                                  
                               
                                 cell 
                                 ⁢ 
                                 
                                     
                                      
                                 
                                 ( 
                                 
                                   C 
                                   , 
                                   
                                     E 
                                     
                                       t 
                                       + 
                                       k 
                                     
                                     i 
                                   
                                 
                                 ) 
                               
                             
                             , 
                             
                               k 
                               = 
                               1 
                             
                           
                         
                       
                       
                         
                           
                             
                               decoder 
                               ⁢ 
                                  
                               cell 
                               ⁢ 
                                   
                               
                                 ( 
                                 
                                   
                                     H 
                                     
                                       t 
                                       + 
                                       k 
                                       - 
                                       1 
                                     
                                   
                                   , 
                                   
                                     E 
                                     
                                       t 
                                       + 
                                       k 
                                     
                                     i 
                                   
                                 
                                 ) 
                               
                             
                             , 
                             
                               k 
                               ∈ 
                               
                                 { 
                                 
                                   2 
                                   , 
                                   3 
                                   , 
                                   … 
                                      
                                   , 
                                   T 
                                 
                                 } 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   Formula 
                   ⁢ 
                       
                   18 
                 
               
             
           
         
       
     
     The decoder  140  may also contain a temporal attention module  143 . The temporal attention module  143  applies a temporal attention mechanism that adds an attention weight for each time step to adaptively assign different importance to different time periods. The temporal mechanism captures the relevance of source-side information so that the network can directly focus on important time steps in the past to help predict future accidents more accurately. The temporal attention module  143  applies the temporal attention mechanism as defined in Formulas 19-21, where H t−s   (l)  represents intermediate features extracted by the lower level of the network and where the attention vector for t−s is β(t, s)∈[0,1], s∈{0, 1, . . . , S}. β(t, s) also represents the normalization of η t   t−s  that can be used to measure the similarity between H t   (l)  and H t−s   (l) , and β(t, s) is further utilized as the weight coefficient to calculate H t   ′(l)    
     
       
         
           
             
               
                 
                   
                     η 
                     t 
                     
                       t 
                       - 
                       s 
                     
                   
                   = 
                   
                     
                       W 
                       η 
                     
                     ⁢ 
                        
                     tanh 
                     ⁢ 
                        
                     
                       ( 
                       
                         
                           H 
                           t 
                           
                             ( 
                             l 
                             ) 
                           
                         
                         ⁢ 
                         
                           W 
                           f 
                         
                         ⁢ 
                         
                           H 
                           
                             t 
                             - 
                             s 
                           
                           
                             ( 
                             l 
                             ) 
                           
                         
                       
                       ) 
                     
                   
                 
               
               
                 
                   Formula 
                   ⁢ 
                       
                   19 
                 
               
             
           
         
       
       
         
           
             
               
                 
                   
                     β 
                     ⁡ 
                     ( 
                     
                       t 
                       , 
                       s 
                     
                     ) 
                   
                   = 
                   
                     softmax 
                     ⁢ 
                        
                     
                       ( 
                       
                         η 
                         t 
                         
                           t 
                           - 
                           s 
                         
                       
                       ) 
                     
                   
                 
               
               
                 
                   Formula 
                   ⁢ 
                       
                   20 
                 
               
             
           
         
       
       
         
           
             
               
                 
                   
                     H 
                     t 
                     
                       ′ 
                       ⁡ 
                       ( 
                       l 
                       ) 
                     
                   
                   = 
                   
                     
                       ∑ 
                       
                         s 
                         = 
                         0 
                       
                       S 
                     
                       
                     
                       
                         β 
                         ⁡ 
                         ( 
                         
                           t 
                           , 
                           s 
                         
                         ) 
                       
                       ⁢ 
                       
                         H 
                         
                           t 
                           - 
                           s 
                         
                         
                           ( 
                           l 
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   Formula 
                   ⁢ 
                       
                   21 
                 
               
             
           
         
       
     
     By iteratively training the accident prediction model  108 , the feature matrices for each time step for a predetermined period time, which is the output of the decoder  140 , are used to construct traffic accident prediction  150 , which in some embodiments may be visualized through traffic accident prediction map, to better predict where traffic accidents may occur in the future and where public resources should be stationed in order to best respond to these accidents. 
       FIG.  3    illustrates an accident prediction model  108  according to another embodiment of the present disclosure, wherein an accident prediction model  108  contains a data preprocessing module  109  that preprocesses received traffic accident information to extract a feature matrix to be input into the encoder  130  of the accident prediction model  108 . The multidimensional feature matrix may contain spatiotemporal information i.e. the specific location and time related to traffic accidents received in the traffic accident information, and it may also contain other external attributes, such as weather condition, road type, construction status (whether construction is taking place in a specific location at a specific time), or event status (whether an event is taking place in a specific location at a specific time that results in some modification to the road or traffic pattern). 
       FIG.  4    shows a flowchart of hierarchy of functions performed in an example implementation  400  of an accident prediction model  108 , according to various embodiments of the present disclosure. At block  401 , the accident prediction model receives information related to traffic accidents. In some embodiments of the present disclosure, the implementation of the accident prediction model  108  is such that it is configured to receive traffic accident data in the form of an extracted feature matrix, which may contain spatiotemporal and external attributes. In other embodiments, the accident prediction model  108  is implemented in such a way to extract a feature matrix of features of interest from the received traffic information. 
     At block  402 , the accident prediction model  108  constructs multiple graphical representations from the feature matrix, such as a distance graph and a self-adaptive adjacency matrix. 
     At block  403 , the accident prediction model  108  performs a multi-layer multi-graph convolution with a layer-wise propagation rule defined according to Formula 5. 
     At block  404 , the accident prediction model  108  applies a spatial attention mechanism as defined by Formulas 6-8 in order to adaptively capture dynamic correlations of spatial dimensions between nodes in the area network of interest. 
     At block  405 , the accident prediction model  108  passes the feature matrix, which contains the spatial features extracted through the multi-layer multi-graph convolution and application of the spatial attention mechanism, through a recurrent neural network. In some embodiments, the recurrent neural network is an LTSM defined by Formulas 10-14, that calculates current time features using previous hidden statuses. 
     At block  406 , the accident prediction model  108  uses the calculations of the recurrent units through the recurrent neural network to develop to context vector, C, which stores all of the spatiotemporal information of the encoder  130  of an accident prediction model  108 . 
     At block  407 , the context vector, C, is passed to a decoder which uses C as the initial hidden state to decode output sequences using Formula 15. At block  408 , known future inputs such as historical and statistical data related to traffic accidents in a predetermined area are also fed into the decoder at this stage. 
     At block  409 , the accident prediction model applies a temporal attention mechanism to adaptively assign different weights of importance to different time periods according to formula 16-18. 
     At block  410 , the result of the temporal attention mechanism being applied is a feature matrix defined by Formula 8. 
     At block  411 , the accident prediction model  108  uses the previously calculated feature matrix to determine a predicted number of traffic accidents in a given area over a predetermined amount of time. In some embodiments of the present disclosure, the predicted number of traffic accidents in a given area over a predetermined amount of time is visualized in the form of a traffic accident prediction map that updates at each time step of time sequence data that is the input to the accident prediction model  108 . 
       FIG.  5    shows an example method  500  for predicting traffic accidents in a predetermined area over a predetermined amount of time, according to embodiments of the present disclosure. In an embodiment of the present disclosure, a method for predicting traffic accidents  500  consists of receiving traffic accident data from a predetermined area  501 . The method  500  continues by constructing multiple graphical representations based on the features of interest present in the received data  502 , training an accident prediction model  503  to determine a predicted amount of traffic accidents  504  over a predetermined amount of time. In various embodiments, the steps of receiving traffic accident data  501  and constructing multiple graphical representations based of features of interest  502  are carried out within an accident prediction model. 
       FIG.  6    shows an example method  600  for predicting traffic accidents in a predetermined area over a predetermined amount of time. In an embodiment of the present disclosure, a method for predicting traffic accidents  600  consists of receiving traffic accident data from a predetermined area  601 . The method  600  continues by extracting a multidimensional feature matrix of features of interest, such as spatiotemporal or external attributes, from the received data  602 , constructing multiple graphical representations based on the features of interest present in the received data  603 , training an accident prediction model  604  to determine a predicted amount of traffic accidents  605  over a predetermined amount of time. In various embodiments, the steps of receiving traffic accident data  601 , extracting a multidimensional feature matrix of features of interest  602 , and constructing multiple graphical representations based of features of interest  603  are carried out within an accident prediction model. 
     All of the disclosed methods and procedures described in this disclosure can be implemented using one or more computer programs or components. These components may be provided as a series of computer instructions on any conventional computer readable medium or machine readable medium, including volatile and non-volatile memory, such as RAM, ROM, flash memory, magnetic or optical disks, optical memory, or other storage media. The instructions may be provided as software or firmware, and may be implemented in whole or in part in hardware components such as ASICs, FPGAs, DSPs, or any other similar devices. The instructions may be configured to be executed by one or more processors, which when executing the series of computer instructions, performs or facilitates the performance of all or part of the disclosed methods and procedures. 
     Without further elaboration, it is believed that one skilled in the art can use the preceding description to utilize the claimed inventions to their fullest extent. The examples and aspects disclosed herein are to be construed as merely illustrative and not a limitation of the scope of the present disclosure in any way. It will be apparent to those having skill in the art that changes may be made to the details of the above-described examples without departing from the underlying principles discussed. In other words, various modifications and improvements of the examples specifically disclosed in the description above are within the scope of the appended claims. For instance, any suitable combination of features of the various examples described is contemplated.