Next Article in Journal
Deep Learning-Based Short-Term Stream-Stage and Urban Inundation Prediction in a Highly Urbanized Basin: A Case Study of Bisan-dong, Anyang, South Korea
Previous Article in Journal
Evaluation of Miniscrew Stability in Posterior Teeth Intrusion—A Three-Dimensional Finite Element Analysis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Traffic Accident Prediction via Patch-Aware and Basis Representation in Time Series Modeling

1
School of Civil Engineering, Chongqing University, Chongqing 400045, China
2
State Key Laboratory of Safety and Resilience of Civil Engineering in Mountain Area, Chongqing University, Chongqing 400045, China
3
Key Laboratory of New Technology for Construction of Cities in Mountain Area, Ministry of Education, Chongqing University, Chongqing 400045, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2026, 16(4), 1793; https://doi.org/10.3390/app16041793
Submission received: 27 December 2025 / Revised: 29 January 2026 / Accepted: 4 February 2026 / Published: 11 February 2026

Abstract

Traffic accident prediction is of great importance for intelligent transportation systems and public safety management. Unlike conventional traffic flow forecasting tasks, accident data are characterized by low occurrence frequency and highly imbalanced distributions, with near-zero values during most time periods and occasional concentrated bursts. Accident occurrences are also strongly influenced by daily and weekly periodic patterns, resulting in mixed characteristics of low baseline levels, abrupt peaks, and long-term trends. These properties make traditional time series forecasting methods based on stationarity assumptions or single-period modeling less effective. To address this issue, this study proposes a time series forecasting framework that integrates patch-aware local perception with global basis representation. Specifically, this study aims to improve traffic accident time-series forecasting accuracy under sparse and bursty conditions by integrating patch-aware local perception with global basis representation. The patch-level structure captures fine-grained fluctuations in accident sequences by modeling short-term local variations, while basis decomposition provides robust modeling of overall trends through a set of global latent components, leading to complementary effects at both local and global levels. Experimental results on the I-405 highway accident dataset demonstrate that the proposed model significantly outperforms baseline methods, reducing mean squared error (MSE) and mean absolute error (MAE) by approximately 9.7% and 12.6% compared with PatchTST, and by 22.3% and 28.2% compared with Basisformer. Furthermore, experiments on public benchmark datasets ETTh1 and Electricity show that the proposed method achieves comparable or superior performance to mainstream models, indicating its effectiveness and generalization ability across different types of time series scenarios.

1. Introduction

Traffic accident prediction aims to estimate the likelihood of accident occurrence in specific regions and time periods based on historical spatiotemporal data, and it plays a crucial role in proactive safety management and emergency response within intelligent transportation systems [1]. With the continuous improvement of urban traffic infrastructure, traffic management agencies have gradually established large-scale monitoring and incident recording systems, providing essential data foundations for data-driven accident prediction models [2]. Existing studies mainly focus on exploring the relationships between traffic flow variables—such as volume, speed, and occupancy—and accident occurrence, and employ statistical learning or machine learning methods for modeling [3]. However, traffic accidents are inherently characterized by strong randomness, uneven spatiotemporal distributions, and severe data sparsity, which pose significant challenges for accurate and robust prediction [4].
Traditional accident prediction approaches often rely on statistical analysis or shallow models such as logistic regression. Although these methods offer interpretability, their modeling capacity is limited, making it difficult to capture the nonlinear patterns and complex temporal dependencies present in traffic systems [5]. In recent years, the rapid development of deep learning techniques for time series modeling has provided new opportunities for traffic accident prediction. Recurrent neural networks (RNNs) [6] and their variants, particularly long short-term memory networks (LSTMs) [7], have been widely applied to traffic flow and accident prediction tasks due to their ability to model temporal dependencies [8]. Nevertheless, LSTM-based models suffer from gradient degradation and limited receptive fields when handling long time series, which restricts their capability to capture global temporal characteristics. To address these limitations, Transformer-based architectures have been introduced into the field of time series forecasting.
Transformer models leverage self-attention mechanisms to model dependencies between arbitrary time steps and demonstrate strong capabilities in capturing long-range temporal relationships. Despite these advantages, standard Transformer architectures are associated with high computational complexity, insufficient sensitivity to localized anomalies, and limited interpretability [9]. To enhance Transformer performance in long-term time series forecasting, several variants have been proposed. Informer employs sparse attention and distillation mechanisms to significantly improve computational efficiency, making it suitable for long-sequence prediction tasks [10]. Autoformer introduces trend–seasonality decomposition and an autocorrelation-based mechanism, effectively addressing long-term dependency modeling [11]. FEDformer further enhances global temporal representation by incorporating frequency-domain modeling based on Fourier transformations [12]. Peng et al. applied Informer to urban traffic flow anomaly prediction and demonstrated improved detection performance during peak periods [13], while Wei et al. employed Autoformer for mid- and long-term road safety risk forecasting, validating the effectiveness of periodic trend decomposition in transportation applications [14]. These models have achieved promising performance across public benchmark datasets in energy, meteorology, and transportation domains, confirming the effectiveness of decomposition- and frequency-based modeling strategies for improving Transformer-based time series forecasting.
In parallel, inspired by the success of Vision Transformer models in computer vision [15], recent studies have explored the integration of local modeling concepts into time series analysis. PatchTST adopts a patch-based embedding strategy that segments long time series into fixed-length temporal windows and treats each patch as a Transformer input, thereby preserving local temporal structures and enhancing sensitivity to short-term fluctuations [16]. In addition, its channel-independent modeling strategy reduces inter-variable interference and improves training efficiency. From a complementary perspective, BasisFormer focuses on constructing interpretable time series representations by learning a set of reusable basis components. During prediction, input sequences are projected onto these learned bases to extract latent similarities and reconstruct future representations, which is particularly advantageous for datasets exhibiting periodic or repetitive patterns [17]. In traffic accident data, such periodic behaviors—such as weekday–weekend differences and peak-hour effects—are highly prevalent, making basis representation a promising approach for accident prediction.
Despite their respective advantages, PatchTST primarily emphasizes local pattern perception but may introduce redundant information in the absence of effective semantic compression, whereas BasisFormer focuses on global structure alignment through basis composition and may respond insufficiently to abrupt local variations. Although these two approaches exhibit complementary strengths, an effective integration of patch-level local perception and global basis representation has not yet been fully explored. Moreover, most existing studies concentrate on general time series forecasting or traffic flow prediction tasks, with limited attention paid to the unique challenges of highly uncertain and sparse traffic accident prediction.
Motivated by these observations, this study proposes a traffic accident prediction framework that integrates patch-aware local perception with global basis representation. Built upon the global modeling paradigm of BasisFormer, the proposed model incorporates patch segmentation and convolution-based fusion mechanisms to enhance sensitivity to localized temporal fluctuations while maintaining efficient global representation alignment. By jointly modeling local variations and global temporal structures, the proposed approach aims to improve prediction accuracy, robustness, and interpretability for traffic accident forecasting.

2. Methodology

2.1. Overall Framework of the Proposed Model

To effectively capture the complex temporal characteristics of traffic accident data, which exhibit both sudden bursts and periodic patterns, this study proposes a traffic accident prediction model that integrates patch-aware local perception with basis representation learning. The overall architecture of the proposed model is illustrated in Figure 1, which mainly consists of three key stages: local feature perception, basis representation modeling, and global trend integration.
As shown in Figure 1, the model takes a traffic accident time series of length L as input and divides it into P equal-length segments (patches) using a sliding window strategy, denoted as patch1, patch2, …, patchp. Each patch preserves the local temporal dynamics within a short time interval, enabling the model to focus on fine-grained fluctuation patterns.
Subsequently, all patches are fed into a shared-parameter Patch Encoder module to extract local semantic features and generate unified embedding representations. This process enhances the model’s sensitivity to short-term accident surges and abrupt variations.
After local encoding, the feature representation of each patch is independently processed by the Basis Module. By leveraging a set of learnable basis vectors, the Basis Module reconstructs patch-level features through linear combinations, thereby capturing latent periodic structures and global temporal patterns. The reconstructed representations of all patches are then concatenated to form a composite sequence of local reconstruction trajectories, which reflects more comprehensive temporal evolution characteristics.
Finally, the fused representation is input into a Transformer-based module to model cross-patch contextual dependencies, further improving prediction accuracy. The model outputs the future traffic accident risk sequence as the final forecasting result.
Specifically, the model output corresponds to the predicted number of traffic accidents occurring within the next forecasting horizon (e.g., one hour), rather than a binary accident occurrence indicator.

2.2. Patch Segmentation and Local Perception Module

In traffic accident prediction tasks, accident occurrences often exhibit characteristics such as abrupt changes and high volatility. Although the overall time series may be sparse, local time intervals frequently contain dense bursts of accident events. To better model such non-stationary temporal patterns, a patch-aware local perception module is designed, as illustrated in Figure 2, to segment and encode the original time series.
The input data are represented as a three-dimensional tensor with shape [B,L,C], where B denotes the batch size, L is the sequence length, and C represents the number of channels (i.e., accident counts in this study). A sliding window mechanism, implemented by the Patch Extractor, is first applied along the temporal dimension to divide the input sequence into multiple sub-sequences (patches) of length patch_len.
Each resulting patch has a shape of [patch_len,C], which preserves the local temporal evolution patterns of traffic accidents. All patches are then fed into a shared Patch Encoder to extract discriminative temporal features.
The internal structure of the Patch Encoder consists of two one-dimensional convolutional layers (Conv1D), followed by ReLU activation functions, global average pooling, and a linear projection layer. This architecture is capable of automatically identifying patch-level characteristics such as sudden accident surges and local volatility.
After encoding, the representations of all patches are concatenated to form a patch token sequence with shape [B,P,dmodel], where P denotes the number of patches and dmodel is the feature dimension. To model inter-patch dependencies and contextual semantics, a Global Aggregation module is introduced, which is essentially a lightweight Transformer encoder. This module performs cross-patch modeling and outputs the aggregated feature representation.
The patch segmentation process can be formally expressed as follows:
x p ( i ) = x ( i 1 ) s : ( i 1 ) s + l p ,
where s denotes the sliding stride that controls the overlap between adjacent patches.
Each patch is subsequently encoded into a fixed-length vector through a local encoder (e.g., convolutional layers, Transformer encoder, or MLP):
z p ( i ) = f e n c ( x p ( i ) ) .
The encoded patch representations are then aggregated with positional information and fed into the backbone network for sequence modeling.
From the perspective of traffic accident prediction, the patch mechanism offers two major advantages. On the one hand, traffic accident data often exhibit periodic patterns such as daily or weekly cycles, holidays, and peak hours, which are well-suited for patch-based periodic modeling. On the other hand, accident occurrences typically present a “short-term burst and long-tail decay” behavior, and local patch modeling enables the model to promptly capture early signals of sudden accident escalation.
In this study, a sliding-window strategy similar to PatchTST is adopted. The input sequence of length L is divided into P patches, resulting in an intermediate representation with shape [B,P,patch_len,C]. After patch encoding and global attention-based aggregation (Global Query Aggregator), the final patch-level representation is obtained for subsequent modeling.

2.3. Basis Representation Module

As shown in Figure 3, the Basis Module represents the structural characteristics of the time series using a shared set of basis representations. By multiplying the patch-specific coefficient matrix with the basis vectors, the module reconstructs and predicts the temporal patterns of each patch. Compared with conventional Transformers that directly model point-wise temporal dependencies, this approach is more suitable for complex time series with periodicity and abrupt changes, such as traffic accident data.
The Basis Module consists of three main components:
(1)
Coefficient Module
The encoded patch features are first fed into a stack of Basis Cross Attention Blocks (BCABs). Through multi-head attention mechanisms, this module models the matching relationships between patch features and shared basis representations, thereby learning the weighting coefficients of each patch with respect to different basis vectors.
The output of this module is a three-dimensional tensor with shape [B,C,N], which represents the response intensity of each channel under N basis representations.
(2)
Basis Representation Module
Meanwhile, a set of N basis vectors with dimension dmodel, denoted as [N,dmodel], is generated through a trainable multilayer perceptron (MLP) based on the global historical sequence. These basis vectors are shared across all patches and serve as reusable structural templates for sequence reconstruction.
The patch reconstruction process can be expressed as:
X ^ =   W × B ,
where
X denotes the reconstructed patch representation with shape [B,P,dmodel];
W is the coefficient matrix with shape [B,C,N];
B represents the shared basis vector set with shape [N,dmodel].
To transform the reconstructed patch representations into final prediction outputs, a Bottleneck MLP is introduced. This module first compresses the feature dimension and then performs split and concatenation operations along the temporal dimension to reorganize the time series structure. Finally, an MLP layer outputs the predicted traffic accident sequence with shape [B,L,C], where L denotes the forecasting horizon.

3. Experimental Results and Analysis

3.1. Dataset Description and Preprocessing

The traffic accident data used in this study were obtained from the Traffic Incident Management System (TIMS) released by the Federal Highway Administration (FHWA) [18]. The study focuses on a representative urban freeway segment, Interstate 405 (I-405), located in the Los Angeles metropolitan area of California, United States. The I-405 corridor was selected as a representative urban freeway due to its high traffic demand, complex interchange structure, diverse accident patterns, and long-term availability of high-quality accident records, which together provide a challenging and realistic testbed for accident time-series prediction.
Although the experiments in this study are conducted on a single freeway corridor, the proposed modeling framework is not tied to any specific roadway and is designed to capture general temporal characteristics of sparse and bursty accident time series, making it applicable to other urban freeway scenarios with similar data availability.
From a methodological perspective, the proposed approach focuses on learning general temporal patterns of sparse and bursty accident sequences, rather than corridor-specific spatial characteristics. To further examine the generalization capability of the model beyond a single freeway, extensive experiments were additionally conducted on two public benchmark time-series datasets (ETTh1 and Electricity), which exhibit diverse temporal dynamics and statistical properties. The consistent performance gains observed across these datasets indicate that the proposed framework is not limited to a specific corridor and can generalize to other traffic-related time series scenarios.
In this study, the prediction target is defined as the hourly accident count aggregated over the selected freeway corridor, resulting in a univariate time-series forecasting task.
The geographical location of the selected freeway segment is illustrated in Figure 4.
The original dataset contains detailed information for each traffic accident event, including occurrence time, geographic coordinates, roadway name, accident severity level, and casualty statistics. After data screening and preprocessing, accident records from January 2018 to December 2024 were retained, resulting in approximately 10,253 valid accident events. Each record corresponds to a single traffic accident occurrence.
After aggregating individual accident events into an hourly time series, the final dataset contains approximately 61,000 time steps spanning from January 2018 to December 2024. The resulting accident count series exhibits a highly imbalanced distribution.
Specifically, the majority of hourly intervals contain zero recorded accidents, while a smaller proportion of time steps correspond to one or two accidents. Only a limited number of periods exhibit multiple accidents within the same hour, representing high-risk traffic conditions. This pronounced sparsity and long-tailed distribution further highlight the challenges of traffic accident forecasting and motivate the use of risk-oriented evaluation metrics beyond conventional error-based measures. The distribution of hourly accident counts after aggregation is summarized in Table 1.
This distribution further confirms the strong sparsity and long-tailed nature of the accident time series.
During preprocessing, records with missing or invalid key attributes (e.g., accident time or location) were removed. The remaining accident events were aggregated into an hourly time series with a continuous temporal index. Hours without recorded accidents were explicitly retained as zero-valued entries, ensuring temporal continuity without artificial interpolation.
Table 2 provides representative accident records sampled from different years (2018, 2021, and 2024) to illustrate the structure and temporal coverage of the raw data.
A sample of the original accident records is presented in Table 2, which includes the collision date and time, primary and secondary road names, accident severity, number of injuries and fatalities, as well as latitude and longitude information.
To meet the input requirements of time series forecasting models, individual accident events on the I-405 freeway were aggregated into a univariate time series representing the number of accidents per hour. The resulting sequence exhibits pronounced temporal characteristics, including clear periodic patterns (e.g., weekday–weekend differences and peak–off-peak variations) as well as strong burstiness caused by holidays, extreme weather conditions, or abnormal traffic disturbances. In addition to the accident count series, multiple exogenous variables were constructed to enrich the model input and enhance interpretability.
Traffic accident distributions vary significantly across different time periods. Accident occurrences are frequent during peak hours, while late-night and early-morning periods on weekends tend to be sparse, leading to substantial differences in both mean and variance across time segments. Direct normalization of the entire sequence may suppress informative signals during sparse periods while allowing peak-hour patterns to dominate the learning process. To alleviate this issue, a segmented normalization strategy (denoted as seg4) was adopted.
Specifically, the time series was divided into four temporal categories: weekday peak hours (WD-peak), weekday off-peak hours (WD-off), weekend peak hours (WE-peak), and weekend off-peak hours (WE-off). Z-score normalization was applied independently within each segment, followed by value clipping to suppress extreme outliers [19]. This preprocessing strategy preserves overall temporal trends while improving the representation of sparse accident occurrences, thereby enhancing model robustness under complex temporal conditions.
Based on the segmented normalization strategy (seg4), several accident-related features were constructed. Specifically, the variable accident_seg4 represents the raw hourly accident count assigned to its corresponding temporal segment (WD-peak, WD-off, WE-peak, or WE-off). The feature accident_z_by_seg4 is obtained by applying Z-score normalization to the accident counts within each segment independently, using the segment-specific mean and standard deviation. This operation ensures that accident intensities are normalized relative to comparable temporal contexts rather than the entire time series.
In addition, accident_z_by_peak is derived by normalizing accident counts with respect to peak-hour statistics only, which emphasizes relative accident severity during high-demand traffic periods. All normalization parameters are computed exclusively from the training data to avoid information leakage.
Without this segmented normalization, the strong dominance of peak-hour accident patterns would bias the learning process, making it difficult for the model to effectively capture low-frequency accident signals during off-peak periods. Figure 5 illustrates the overall preprocessing pipeline used to transform raw traffic accident records into model-ready time series features.
The final feature set used for model training and evaluation is summarized in Table 3, which includes temporal cyclic encodings, environmental conditions, road surface information, calendar indicators, and multiple accident-related derived features.

3.2. Experimental Setup and Evaluation Metrics

To evaluate the effectiveness of the proposed model for traffic accident prediction, a series of systematic experiments were conducted, including model training configuration, evaluation metrics, hyperparameter sensitivity analysis, and performance comparisons with multiple baseline methods. All experiments were implemented in a unified experimental environment to ensure fairness and reproducibility.

3.2.1. Experimental Configuration

All experiments were carried out on a local workstation running the Windows 11 operating system. The proposed model and baseline methods were implemented using Python 3.9 and the PyTorch 1.12 deep learning framework. The hardware platform consisted of an AMD Ryzen 7 9700X CPU and an NVIDIA GeForce RTX 5070 Ti GPU. Automatic Mixed Precision (AMP) was enabled during training to accelerate computation and reduce memory consumption.
The detailed experimental environment and configuration are summarized in Table 4.
For all models, the same input window length, forecasting horizon, and dataset partitioning strategy were adopted to ensure a fair comparison. Model training was performed using the training set, hyperparameters were selected based on validation performance, and final results were reported on the test set.

3.2.2. Evaluation Metrics and Baseline Models

To comprehensively assess the prediction accuracy of the proposed model, two widely used regression metrics were adopted: Mean Squared Error (MSE) and Mean Absolute Error (MAE) [20]. MSE emphasizes large prediction errors by squaring deviations, while MAE measures the average absolute difference between predicted and ground-truth values, providing stable and interpretable error estimation.
The evaluation metrics are defined as follows:
M S E = 1 n i = 1 n ( y ^ i y i ) 2 ,
M A E = 1 n i = 1 n | y ^ i y i | ,
where n denotes the total number of samples, y i represents the ground-truth accident count at time step i, and y ^ i is the corresponding predicted value.
Given the highly imbalanced nature of traffic accident data, where most time intervals contain zero or low accident counts and only a small number of periods exhibit accident surges, error-based metrics alone may not fully reflect a model’s practical effectiveness in safety-critical scenarios.
Therefore, in addition to MSE and MAE, we introduce Top-K Precision as a complementary evaluation metric to assess the model’s ability to correctly identify high-risk accident periods.
Specifically, let T K p r e d denote the set of K time intervals with the highest predicted accident counts, and T K t r u e denote the set of K intervals with the highest observed accident counts. Top-K Precision is defined as:
Top - K Precision = T K pred T K true K ,
where T K p r e d denotes the set of K time intervals ranked with the highest predicted accident counts, and T K t r u e denotes the set of K time intervals with the highest observed accident counts.
To validate the effectiveness of the proposed method, several representative time series forecasting models were selected as baseline methods. These baselines cover classical statistical approaches, recurrent neural networks, and state-of-the-art Transformer-based architectures. The selected baseline models are summarized as follows:
ARIMA [21]: A classical autoregressive integrated moving average model serving as a linear statistical baseline.
LSTM: A long short-term memory network designed to capture long-range temporal dependencies in sequential data.
Transformer: A self-attention-based sequence modeling architecture that captures global dependencies between arbitrary time steps, alleviating the gradient degradation problem of recurrent models.
Informer: A Transformer variant that introduces sparse attention mechanisms to improve efficiency for long-sequence forecasting tasks.
Autoformer: A decomposition-based Transformer model that incorporates trend–seasonality decomposition and autocorrelation mechanisms.
PatchTST: A state-of-the-art time series Transformer model based on patch segmentation and local representation learning.
BasisFormer (original): The baseline version of the BasisFormer model without patch encoding or structural enhancement.
Ours: The proposed model, which integrates patch-aware local perception and multi-basis representation into the original BasisFormer framework.
All baseline models were trained and evaluated under the same experimental protocol, including identical input sequence lengths, forecasting horizons, and data splits. This ensures that the reported performance differences are attributable to model design rather than experimental bias.

3.3. Hyperparameter Sensitivity Analysis

To evaluate the robustness of the proposed model under different hyperparameter settings and to analyze its performance stability, a comprehensive hyperparameter sensitivity analysis was conducted. Four key hyperparameters were investigated: the learning rate, patch segmentation strategy (i.e., patch length and stride), the number of attention heads, and the number of basis functions. For each hyperparameter, five representative values were tested while keeping all other settings unchanged. Model performance was evaluated on the validation set using Mean Squared Error (MSE) and Mean Absolute Error (MAE). The experimental results are illustrated in Figure 6.
As shown in Figure 6a, the model achieves relatively low error values when the learning rate is set to 1 × 10−4 or 2 × 10−4, indicating stable convergence behavior. When the learning rate increases to 1 × 10−3, both MSE and MAE rise significantly, suggesting that an excessively large learning rate may cause training instability or divergence. Therefore, smaller learning rates are more conducive to stable optimization and generalization performance.
Figure 6b presents the impact of different patch lengths and stride combinations on model performance. The results indicate that a patch configuration of 16/8 yields the lowest MSE, demonstrating that moderately increasing patch size can help capture local temporal structures more effectively. However, when the patch size becomes excessively large, performance degrades, which may be attributed to the over-smoothing of local patterns and the loss of fine-grained temporal information.
The influence of the number of attention heads is shown in Figure 6c. The model performs best when the number of heads is set to 4 or 6. In contrast, increasing the number of heads to 12 leads to a notable increase in prediction error. This phenomenon suggests that an excessive number of attention heads may cause information dispersion, thereby weakening the model’s ability to focus on salient temporal dependencies.
Figure 6d illustrates the effect of the number of basis functions on prediction accuracy. The optimal performance is achieved when the number of basis functions is set to N = 10. When N is either too small (e.g., N = 6) or too large (e.g., N = 14), the prediction error increases. This result indicates that an insufficient number of basis functions limits the model’s capacity to represent global temporal structures, whereas an overly large basis set may introduce redundancy and impair generalization.
Based on the sensitivity analysis, the primary hyperparameters of the proposed model were selected as summarized in Table 5.

3.4. Ablation Study

To further investigate the contribution of each key component in the proposed model, a systematic ablation study was conducted. Several core modules were progressively removed or simplified, and the resulting model variants were evaluated on multiple benchmark datasets. The ablation results are reported in Table 6.
As shown in Table 6, removing the patch-based encoding mechanism (denoted as w/o Patch) leads to the most significant performance degradation among all ablation settings. On the ETTh1 dataset, the Mean Squared Error (MSE) increases sharply from 0.3989 to 0.5875, while the Mean Absolute Error (MAE) rises from 0.4184 to 0.5203. This result indicates that for low-frequency time series with strong periodicity, such as electricity load data, the patch mechanism plays a crucial role in capturing local fluctuation patterns and enhancing short-term sensitivity.
In contrast, the Basis module exhibits a more pronounced impact on the Traffic dataset. When the number of basis functions is reduced to one (w/o Basis), the MSE and MAE increase to 0.6227 and 0.4062, respectively, which represents a substantially larger degradation compared with the ETTh1 dataset (0.3989→0.4208 in MSE). This observation suggests that for high-dimensional and multi-sensor traffic data with strong periodic structures, the Basis module serves as a core component for abstracting global trends and modeling cross-channel dependencies.
Further analysis of the auxiliary loss functions shows that removing the Smooth Loss or the InfoNCE Loss results in only minor performance degradation. These findings imply that the two auxiliary objectives mainly contribute to training stability and feature distribution regularization, while their direct impact on final prediction accuracy is relatively limited.
Overall, the ablation results demonstrate a complementary relationship between the Patch and Basis mechanisms. The Patch module is particularly effective in modeling low-frequency time series with pronounced local variations, whereas the Basis module provides stronger global modeling capability for high-frequency, high-dimensional datasets. By integrating both components, the proposed model achieves robust performance across diverse time series forecasting scenarios and maintains strong generalization ability.

3.5. Baseline Comparison Under Multiple Evaluation Metrics

3.5.1. Evaluation Under Standard Error Metrics

To further evaluate the effectiveness and generalization capability of the proposed model across different time series forecasting scenarios, visualized prediction results and quantitative comparisons were conducted on the I-405 traffic accident dataset as well as two public benchmark datasets, namely ETTh1 and Electricity. The prediction results are illustrated in Figure 7a–c.
As shown in Figure 7a, the traffic accident time series on the I-405 freeway exhibits high sparsity and significant amplitude variations. Despite these challenges, the proposed model accurately captures sparse peak patterns corresponding to accident surges. By employing patch-wise independent basis representations, the model effectively expresses multi-scale temporal patterns within segmented time windows while preserving global temporal dependencies. As a result, the model achieves a balanced representation of local abrupt changes and long-term trends, which is particularly suitable for accident prediction tasks characterized by burstiness and sparsity.
In the ETTh1 electricity load forecasting task (Figure 7b), the data exhibit strong periodicity and relatively stable temporal dynamics. The proposed model successfully captures the dominant periodic trends; however, slight phase shifts can be observed in some high-frequency fluctuation regions. This phenomenon suggests that under strongly periodic signals, the global basis representation plays a dominant role, while local patch information still has potential for further refinement in modeling fine-scale variations.
As illustrated in Figure 7c, the Electricity demand dataset demonstrates concurrent fluctuations across multiple users and regions. The proposed model is able to stably track short-term demand variations, with predicted curves closely aligning with ground-truth values in most time intervals. This result indicates that the combined patch-aware and basis-based architecture exhibits strong generalization capability in scenarios involving multi-variable and multi-region temporal interactions.
The quantitative performance comparison of all baseline models is summarized in Table 7.
As reported in Table 7, the proposed model (Ours) achieves the best performance on the I-405 traffic accident dataset, with an MSE/MAE of 0.4630/0.2733. Compared with PatchTST, the proposed method achieves improvements of approximately 9.7% in MSE and 12.6% in MAE, and significantly outperforms BasisFormer as well as other state-of-the-art Transformer-based models such as Informer and Autoformer. These results demonstrate that the proposed model effectively captures the coexistence of abrupt events and periodic patterns in traffic accident data. The patch mechanism enhances responsiveness during accident peaks, while the basis representation improves stability during low-activity periods, leading to superior overall performance.
In contrast, classical statistical methods (e.g., ARIMA) and recurrent neural networks (e.g., LSTM) consistently underperform across all datasets. In particular, on the I-405 dataset, the MSE of ARIMA exceeds that of the proposed model by more than 60%, highlighting the limitations of shallow statistical models and simple sequential memory mechanisms when applied to highly non-stationary and sparse accident data.
On strongly periodic public datasets, differentiated performance characteristics are observed. For the ETTh1 dataset, which is dominated by energy consumption time series with weak burstiness, PatchTST achieves the best results (MSE/MAE = 0.3134/0.3585). Although the proposed model does not surpass PatchTST in this scenario, it outperforms Autoformer and Informer, indicating that the introduction of basis representations remains beneficial for capturing periodic trends. On the Electricity dataset, the proposed model achieves an MSE/MAE of 0.1655/0.2654, outperforming BasisFormer and approaching the performance of PatchTST. This suggests that the integration of patch-aware modeling and basis representations provides a balanced solution for datasets with concurrent local disturbances and global temporal patterns.

3.5.2. Evaluation Under Risk-Oriented Metrics

While standard error metrics such as MSE and MAE provide an overall assessment of average prediction accuracy, traffic accident forecasting is inherently risk-oriented, where the accurate identification of extreme accident periods is of greater practical importance. To further evaluate the proposed model under high-risk scenarios, two additional metrics are introduced: the 95th Percentile Mean Absolute Error (P95-MAE) and the Top-K Recall.
The P95-MAE measures the tail behavior of the error distribution and specifically reflects prediction stability during extreme periods characterized by high accident intensity and large fluctuations. In contrast, Top-K Recall evaluates the model’s ability to correctly identify high-risk time windows by comparing the overlap between the top-K time steps ranked by predicted accident intensity and those ranked by ground-truth values. These two metrics jointly assess the model’s performance from the perspectives of extreme error control and risk period identification, which are more aligned with the requirements of traffic safety analysis and early warning applications.
The P95-MAE is defined as:
P 95 - MAE = P e r c e n t i l e 95 ( y t y ^ t ) ,
where y t and y ^ t denote the ground-truth and predicted accident values at time step t, respectively.
The Top-K Recall is defined as:
Top - K   Recall = Ω K Ω ^ K Ω K ,
where ΩK represents the set of time steps corresponding to the top-K highest accident intensities in the ground truth, and Ω ^ k denotes the set of time steps ranked within the top-K according to model predictions.
The comparative results of all baseline models on the I-405 traffic accident dataset under these risk-oriented metrics are summarized in Table 8.
As shown in Table 8, traditional statistical models such as ARIMA and recurrent neural networks such as LSTM perform poorly in extreme accident scenarios, exhibiting both higher P95-MAE values and lower Top-K Recall scores. This indicates that shallow statistical assumptions and simple sequential memory mechanisms are insufficient for modeling highly sparse and bursty accident patterns.
Transformer-based models, including Informer and Autoformer, achieve moderate improvements in both metrics, with P95-MAE reduced to 1.07 and 1.02 and Top-K Recall increased to 0.53 and 0.57, respectively. However, their performance remains unstable in peak accident periods, suggesting limited sensitivity to abrupt risk escalation.
PatchTST demonstrates a stronger ability to capture short-term accident surges, achieving a Top-K Recall of 0.63 due to its patch-wise local modeling strategy. BasisFormer, on the other hand, benefits from interpretable global basis representations and achieves a Top-K Recall of 0.55, highlighting its strength in modeling structured temporal patterns.
The proposed model consistently outperforms all baselines across both metrics, achieving the lowest P95-MAE of 0.82 and the highest Top-K Recall of 0.71. Compared with PatchTST, the P95-MAE is reduced by approximately 12.8%, while the Top-K Recall is improved by approximately 29.1% compared with BasisFormer. These results demonstrate that the integration of patch-aware local perception and global basis representations significantly enhances the model’s sensitivity to high-risk accident periods without sacrificing long-term trend modeling capability.
Overall, the risk-oriented evaluation confirms that the proposed model not only achieves superior average prediction accuracy but also exhibits strong robustness and reliability in extreme accident scenarios. This dual advantage is particularly critical for traffic accident forecasting applications, where timely identification of high-risk periods is essential for proactive traffic safety management and early warning systems.
In addition to Top-K Recall, we further report Top-K Precision to evaluate the accuracy of high-risk period identification from a complementary perspective.
As shown in Table 9, the proposed model consistently achieves the highest Top-K Precision across different K values, indicating its superior capability in accurately identifying high-risk accident periods compared with baseline methods.

3.6. Interpretability Analysis

To further understand the decision-making mechanism of the proposed model in traffic accident forecasting, an interpretability analysis was conducted by visualizing the learned attention weights within the basis-aware attention module. The visualization aims to reveal how different input feature channels contribute to the learned basis representations under a multi-head attention mechanism.
Figure 8 presents the attention heatmaps learned by the proposed model on the I-405 traffic accident dataset. The horizontal axis represents the basis index (N = 10), while the vertical axis corresponds to different input feature channels, including temporal encodings, environmental factors, and historical accident-related variables. Color intensity indicates the magnitude of attention weights, reflecting the relative importance of each feature channel to a specific basis representation. Each subfigure corresponds to one attention head (Head 0–Head 5), illustrating the diversity of feature–basis associations learned across multiple subspaces.
As shown in Figure 8, temporal features such as hour_sin, dow_cos, and is_weekend consistently receive high attention weights across multiple heads, indicating that the model strongly relies on daily and weekly periodic patterns as well as weekend effects when modeling accident occurrence. This observation aligns well with the inherent temporal regularities of traffic accidents, which are closely associated with peak-hour traffic demand and weekday–weekend travel behavior.
Historical accident-related features, including accident_raw and accident_z_by_peak, also exhibit prominent attention weights in several heads. This suggests that recent accident intensity and peak-period normalized signals play a critical role in shaping the basis representations used for future prediction. The result further validates the effectiveness of the segmented normalization strategy adopted in data preprocessing, as these features become salient components in the learned basis combinations.
In contrast, external environmental variables such as weather conditions (WEATHER_1_B, WEATHER_1_F), lighting conditions (LIGHTING_B, LIGHTING_E), and road surface states (ROAD_SURFACE) demonstrate more heterogeneous attention patterns across different heads. This indicates that the multi-head attention mechanism captures complementary contextual information in different subspaces, allowing the model to selectively emphasize environmental factors under varying temporal and traffic conditions rather than assigning them uniform importance.
Notably, distinct attention heads exhibit markedly different basis allocation patterns even for the same feature channel. For example, Head 0 and Head 2 attend to different basis indices for hour_sin, implying that the model learns multiple latent temporal abstractions for the same input signal. This diversity confirms that the multi-head attention mechanism is not redundant but instead enables the model to disentangle complex feature–basis relationships and capture heterogeneous accident patterns at multiple temporal scales.
Overall, the interpretability analysis demonstrates that the proposed model effectively integrates temporal regularities, historical accident dynamics, and contextual environmental factors through basis-aware attention. By learning structured and interpretable feature–basis associations, the model provides not only accurate predictions but also meaningful insights into the underlying mechanisms driving traffic accident risks, thereby enhancing its applicability in practical traffic safety analysis and decision support systems.

4. Conclusions

In this study, a traffic accident forecasting model integrating patch-aware local perception and global basis representations was proposed to address the challenges of sparsity, burstiness, and strong periodicity commonly observed in accident time series. By combining localized patch segmentation with interpretable basis modeling, the proposed framework aims to balance short-term abrupt pattern capture and long-term structural trend alignment within a unified architecture.
Experimental results on the I-405 traffic accident dataset demonstrate that the proposed model consistently outperforms classical statistical methods and state-of-the-art deep learning baselines under standard error metrics. Compared with representative Transformer-based models, the proposed approach achieves lower MSE and MAE values, indicating superior overall prediction accuracy for highly non-stationary and sparse accident data. Additional evaluations on public benchmark datasets further verify the model’s generalization capability across different types of time series forecasting tasks.
Beyond average accuracy, the proposed model exhibits clear advantages in high-risk scenario identification. Under risk-oriented evaluation metrics, including P95-MAE and Top-K Recall, the model achieves more stable predictions during extreme accident periods and more accurately identifies high-risk time windows. These results highlight the effectiveness of integrating patch-level sensitivity with global basis alignment for traffic safety–oriented forecasting tasks, where reliable extreme-event prediction is of critical importance.
Furthermore, interpretability analysis based on attention weight visualization reveals that the model learns meaningful feature–basis associations across multiple attention heads. Temporal periodic features, historical accident signals, and contextual environmental factors are selectively emphasized under different latent subspaces, providing insights into the mechanisms driving accident risk formation. This interpretability enhances the transparency and practical applicability of the proposed framework in real-world traffic safety analysis and decision-making support.
Despite the encouraging results, this study still has limitations. The current model is evaluated on a single freeway corridor for accident prediction, and future work will consider extending the framework to larger-scale road networks and multi-source spatiotemporal data. In addition, incorporating real-time traffic flow information and exploring adaptive basis learning strategies may further improve predictive robustness under rapidly changing traffic conditions.
Overall, the proposed patch-aware and basis-integrated forecasting framework provides an effective and interpretable solution for traffic accident prediction. The results suggest that combining local perception mechanisms with structured global representations is a promising direction for improving both prediction accuracy and risk-awareness in intelligent transportation safety systems.

Author Contributions

Conceptualization, P.Z. and Q.X.; methodology, P.Z.; software, P.Z.; validation, P.Z. and Q.X.; formal analysis, P.Z.; investigation, P.Z.; resources, Q.X.; data curation, P.Z.; writing—original draft preparation, P.Z.; writing—review and editing, Q.X.; visualization, P.Z.; supervision, Q.X.; project administration, Q.X. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data used in this study are publicly available from the Transportation Injury Mapping System (TIMS) provided by the University of California, Berkeley Safe Transportation Research and Education Center (SafeTREC), available at https://tims.berkeley.edu (accessed on 15 March 2025).

Acknowledgments

The authors would like to thank the Transportation Injury Mapping System (TIMS) for providing the publicly accessible accident data used in this study.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Marcillo, P.; Valdivieso Caraguay, Á.L.; Hernández-Álvarez, M. A Systematic Literature Review of Learning-Based Traffic Accident Prediction Models Based on Heterogeneous Sources. Appl. Sci. 2022, 12, 4529. [Google Scholar] [CrossRef] [Scilit]
  2. Dimitrijevic, B.; Khales, S.D.; Asadi, R.; Lee, J. Short-Term Segment-Level Crash Risk Prediction Using Advanced Data Modeling with Proactive and Reactive Crash Data. Appl. Sci. 2022, 12, 856. [Google Scholar] [CrossRef] [Scilit]
  3. Cai, B.; Di, Q. Different Forecasting Model Comparison for Near Future Crash Prediction. Appl. Sci. 2023, 13, 759. [Google Scholar] [CrossRef] [Scilit]
  4. Yannis, G.; Dragomanovits, A.; Laiou, A.; La Torre, F.; Domenichini, L.; Richter, T.; Ruhl, S.; Graham, D.; Karathodorou, N. Road Traffic Accident Prediction Modelling: A Literature Review. Proc. Inst. Civ. Eng. Transp. 2017, 170, 245–254. [Google Scholar] [CrossRef] [Scilit]
  5. Wang, S.; Yan, C.; Shao, Y. A Review of Road Traffic Accident Prediction Methods. Am. J. Manag. Sci. Eng. 2023, 8, 73–77. [Google Scholar] [CrossRef] [Scilit]
  6. Elman, J.L. Finding Structure in Time. Cogn. Sci. 1990, 14, 179–211. [Google Scholar] [CrossRef]
  7. Hochreiter, S.; Schmidhuber, J. Long Short-Term Memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  8. Sameen, M.I.; Pradhan, B. Severity Prediction of Traffic Accidents with Recurrent Neural Networks. Appl. Sci. 2017, 7, 476. [Google Scholar] [CrossRef] [Scilit]
  9. Wen, Q.; Zhou, T.; Zhang, C.; Chen, W.; Ma, Z.; Yan, J.; Sun, L. Transformers in Time Series: A Survey. In Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI); IJCAI: Macau, China, 2023; pp. 759–767. [Google Scholar]
  10. Zhou, H.; Zhang, S.; Peng, J.; Zhang, S.; Li, J.; Xiong, H.; Zhang, W. Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting. Proc. AAAI Conf. Artif. Intell. 2021, 35, 11106–11115. [Google Scholar] [CrossRef] [Scilit]
  11. Wu, Q.; Li, X.; Wang, J.; Long, M. Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting. In Proceedings of the 35th International Conference on Neural Information Processing Systems, Online, 6–14 December 2021. [Google Scholar]
  12. Zhou, T.; Ma, Z.; Wen, Q.; Wang, X.; Sun, L.; Jin, R. FEDformer: Frequency Enhanced Decomposed Transformer for Long-term Series Forecasting. In Proceedings of the International Conference on Machine Learning, Baltimore, MD, USA, 17–23 July 2022. [Google Scholar]
  13. Peng, X.; Lin, Y.; Cao, Q.; Cen, Y.; Zhuang, H.; Lin, Z. Traffic Anomaly Detection in Intelligent Transport Applications with Time Series Data Using Informer. In Proceedings of the 2022 IEEE 25th International Conference on Intelligent Transportation Systems (ITSC), Macau, China, 8–12 October 2022. [Google Scholar] [CrossRef] [Scilit]
  14. Wei, H.; Song, Q.; Dan, C.; He, Z.; Li, H.; Pu, M. Performance Evaluation of ARIMA, Autoformer, and Symmetric LSTNFCL Models for Traffic Accident Emergency Prediction. Symmetry 2025, 17, 639. [Google Scholar] [CrossRef] [Scilit]
  15. Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An Image Is Worth 16 × 16 Words: Transformers for Image Recognition at Scale. In Proceedings of the 9th International Conference on Learning Representations (ICLR), Virtual Event, 3–7 May 2021. [Google Scholar]
  16. Nie, Y.; Nguyen, N.H.; Sinthong, P.; Kalagnanam, J. A Time Series Is Worth 64 Words: Long-Term Forecasting with Transformers. In Proceedings of the 11th International Conference on Learning Representations (ICLR), Kigali, Rwanda, 1–5 May 2023. [Google Scholar]
  17. Ni, Z.; Yu, H.; Liu, S.; Li, J.; Lin, W. BasisFormer: Attention-Based Time Series Forecasting with Learnable and Interpretable Basis. In Advances in Neural Information Processing Systems 36 (NeurIPS 2023); Curran Associates: Red Hook, NY, USA, 2023. [Google Scholar]
  18. UC Berkeley Safe Transportation Research and Education Center (SafeTREC). Transportation Injury Mapping System (TIMS): California Crash Data Tool. Available online: https://tims.berkeley.edu (accessed on 1 December 2025).
  19. de Zarzà, I.; de Curtò, J.; Roig, G.; Calafate, C.T. LLM Multimodal Traffic Accident Forecasting. Sensors 2023, 23, 9225. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  20. Li, H.; Chen, L. Traffic Accident Risk Prediction Based on Deep Learning and Spatiotemporal Features of Vehicle Trajectories. PLoS ONE 2025, 20, e0320656. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  21. Box, G.E.P.; Jenkins, G.M.; Reinsel, G.C.; Ljung, G.M. Time Series Analysis: Forecasting and Control, 5th ed.; John Wiley & Sons: Hoboken, NJ, USA, 2015. [Google Scholar]
Figure 1. Overall architecture of the proposed traffic accident prediction model.
Figure 1. Overall architecture of the proposed traffic accident prediction model.
Applsci 16 01793 g001
Figure 2. Illustration of the patch segmentation and local perception process.
Figure 2. Illustration of the patch segmentation and local perception process.
Applsci 16 01793 g002
Figure 3. Structure of the Basis Module.
Figure 3. Structure of the Basis Module.
Applsci 16 01793 g003
Figure 4. Location of the I-405 freeway in the Los Angeles area.
Figure 4. Location of the I-405 freeway in the Los Angeles area.
Applsci 16 01793 g004
Figure 5. Preprocessing pipeline for traffic accident time series forecasting.
Figure 5. Preprocessing pipeline for traffic accident time series forecasting.
Applsci 16 01793 g005
Figure 6. Sensitivity analysis of key hyperparameters.
Figure 6. Sensitivity analysis of key hyperparameters.
Applsci 16 01793 g006
Figure 7. Prediction results on different datasets.
Figure 7. Prediction results on different datasets.
Applsci 16 01793 g007
Figure 8. Attention heatmaps of the basis-aware attention module under different attention heads.
Figure 8. Attention heatmaps of the basis-aware attention module under different attention heads.
Applsci 16 01793 g008aApplsci 16 01793 g008b
Table 1. Distribution of hourly accident counts after aggregation.
Table 1. Distribution of hourly accident counts after aggregation.
Accident Count per HourPercentage (%)
081.0
113.2
23.8
≥32.0
Table 2. Sample records of raw traffic accident data.
Table 2. Sample records of raw traffic accident data.
COLLISION_DATECOLLISION_TIMEPRIMARY_RDSECONDARY_RDCOLLISION_SEVERITYNUMBER_KILLEDNUMBER_INJUREDLATITUDELONGITUDE
1 January 20181832I-405 N/BWILSHIRE BLVD20234.0522−118.4453
5 January 20180720I-405 S/BVENTURA FWY30134.1679−118.4966
14 June 20210815I-405 N/BSUNSET BLVD20134.0983−118.3637
22 October 20241748I-405 S/BCULVER BLVD30334.0211−118.3965
Table 3. Feature structure after data preprocessing.
Table 3. Feature structure after data preprocessing.
CategoryFeature Name(s)Type (Encoding)Description
Temporal cyclehour_sin, hour_cosContinuous [−1,1]Cyclic encoding of hour-of-day
Weekly cycledow_sin, dow_cosContinuous [−1,1]Cyclic encoding of day-of-week
Weather conditionsWEATHER_1, WEATHER_1_A, WEATHER_1_B, …One-hotMajor weather categories (A/B/C/E/F/G)
Lighting conditionsLIGHTING_-, LIGHTING_A, …One-hotLighting conditions (daylight, nighttime, street lighting, etc.)
Road surfaceROAD_SURFACE, ROAD_SURFACE_A, ROAD_SURFACE_B, …One-hotRoad surface conditions (dry, wet, snow-covered, etc.)
Calendar indicatorsis_weekend, is_peak, is_holiday0/1Weekend, peak-hour, and holiday indicators
Target and derived featuresaccident_raw, accident, seg4, accident_z_by_seg4, accident_z_by_seg4_clip3, accident_z_by_peak, …Continuous/CategoricalAccident counts and segment-wise normalized features
Table 4. Experimental environment and configuration.
Table 4. Experimental environment and configuration.
CategorySpecification
Operating systemWindows 11 (64-bit)
CPUAMD Ryzen 7 9700X (8 cores, 16 threads)
GPUNVIDIA GeForce RTX 5070 Ti
Memory8 GB GPU memory, 32 GB system memory
Programming languagePython 3.9
Deep learning frameworkPyTorch 1.12
Numerical precisionAutomatic Mixed Precision (AMP)
Dataset splitTraining:Validation:Testing = 6:2:2
NormalizationZ-score normalization
Table 5. Main hyperparameter settings of the proposed model.
Table 5. Main hyperparameter settings of the proposed model.
ParameterValue
patch_len8
Patch stride4
batch_size32
d_model128
heads6
N10
learning_rate0.0005
train_epochs100
Table 6. Ablation study results on different datasets.
Table 6. Ablation study results on different datasets.
Model VariantMSE (ETTh1)MAE (ETTh1)MSE (Traffic)MAE (Traffic)
Full Model0.39890.41840.50280.3355
w/o Patch (full-sequence input)0.58750.52030.66530.4218
w/o Basis (number of bases = 1)0.42080.4290.62270.4062
w/o Smooth Loss0.41720.42760.52050.343
w/o InfoNCE Loss0.41060.42350.5150.3402
Table 7. Performance comparison of different models on multiple datasets.
Table 7. Performance comparison of different models on multiple datasets.
ModelMSE (I-405)MAE (I-405)MSE (ETTh1)MAE (ETTh1)MSE (Electricity)MAE (Electricity)
ARIMA0.78120.52010.65890.59740.32760.3621
LSTM0.61520.39290.51670.52890.24240.3031
Informer 0.54800.35730.43360.44500.19550.2735
Transformer0.57500.36850.46810.47120.21340.2864
Autoformer0.53660.34170.41750.43360.18870.2682
PatchTST0.51270.31260.31340.35850.15730.2374
Basisformer0.59560.38080.58750.52030.16920.2669
Ours0.46300.27330.39890.41840.16550.2654
Table 8. Performance comparison under risk-oriented evaluation metrics on the I-405 dataset.
Table 8. Performance comparison under risk-oriented evaluation metrics on the I-405 dataset.
ModelP95-MAE (I-405)Top-K Recall (I-405, K = 10)
ARIMA1.450.32
LSTM1.180.46
Informer1.070.53
Transformer1.120.50
Autoformer1.020.57
PatchTST0.940.63
Basisformer1.090.55
Ours0.820.71
Table 9. Top-K Precision comparison on the I-405 accident dataset.
Table 9. Top-K Precision comparison on the I-405 accident dataset.
ModelTop-5Top-10Top-20
ARIMA0.40.330.25
LSTM0.480.40.32
Informer0.550.460.38
Transformer0.520.440.36
Autoformer0.570.480.39
PatchTST0.620.540.45
BasisFormer0.580.50.41
Ours0.70.620.53
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhang, P.; Xie, Q. Traffic Accident Prediction via Patch-Aware and Basis Representation in Time Series Modeling. Appl. Sci. 2026, 16, 1793. https://doi.org/10.3390/app16041793

AMA Style

Zhang P, Xie Q. Traffic Accident Prediction via Patch-Aware and Basis Representation in Time Series Modeling. Applied Sciences. 2026; 16(4):1793. https://doi.org/10.3390/app16041793

Chicago/Turabian Style

Zhang, Peizhe, and Qiang Xie. 2026. "Traffic Accident Prediction via Patch-Aware and Basis Representation in Time Series Modeling" Applied Sciences 16, no. 4: 1793. https://doi.org/10.3390/app16041793

APA Style

Zhang, P., & Xie, Q. (2026). Traffic Accident Prediction via Patch-Aware and Basis Representation in Time Series Modeling. Applied Sciences, 16(4), 1793. https://doi.org/10.3390/app16041793

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop