# Spatiotemporal Road Traffic Anomaly Detection: A Tensor-Based Approach
## 2 Related Work  
### Traffic Data Modeling  
Most traffic data like speed, density, or traffic flow profiles were represented by vectors, which consist of time series data [3]. Each value in the vector represents the observed traffic parameter, which is averaged within a defined time interval. The limitations of such an approach are reflected in the impossibility of representing spatial components like spatial correlations between consecutive road segments. On the other hand, matrix-based models are used to model more complex traffic data and are often represented as traffic images [4; 5]. Authors in [6] generated traffic images as an input to proposed spatiotemporal generative adversarial network with a goal to represent urban mobility dynamics. In [7], authors modeled traffic data using matrix that represent counts of origin and destination trips of a car-hailing service. Indexes of the matrix cells are often labeled as \(m\times n\) where \(m\) represents the road traffic segments and \(n\) time intervals. These models are used for spatiotemporal dependencies extraction between the observed traffic parameters, but only if the matrix is constructed to represent both spatial and temporal components. Such cases can be observed when using common mobility data representation, Origin-Destination (O-D) matrices. To extract temporal components of the O-D matrices, one more dimension must be introduced. One of the most used matrix decomposition methods, Principal Component Analysis (PCA), is used here. The PCA method is suitable for data interpretation with a smaller number of components and detects anomalies. On the other hand, the authors in [8] report that the PCA was not a suitable method when analyzing the traffic data because of large deviations in data due to many outliers in sensor readings. As the PCA relaxesthree-dimensional data to the bi-dimensional form, authors in [9] claim that it cannot be used for spatiotemporal patterns extraction.  
Commonly, researchers extract speed profiles from different large traffic datasets. Values in speed profiles are extracted mainly by aggregating a large amount of Global Navigation Satellite System (GNSS) data recorded in defined time intervals into a single value. This process could result in significant deviations. Similarly, if O-D matrices represent data, there could be a large number of missing values in some data intervals. In most cases, large traffic data includes many delivery vehicles that significantly influence O-D matrices due to predefined delivery routes. The proposed STM traffic data representation model can avoid this behavior.  
As a traffic data modeling technique, tensor-based models emerged only recently. The main advantage is that those models do not suffer from mentioned limitations regarding spatiotemporal data representation because of their property to model multi-dimensional data. The proposed method in this paper incorporates a tensor-based approach that is constructed using STMs. The model does not suffer large deviations as data is not aggregated from narrow time intervals. Secondly, the method can be used regardless of delivery vehicles because speed is the main observed traffic parameter.