Submitted:
11 May 2026
Posted:
12 May 2026
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Literature Review
2.1. Conventional HRGC Safety Modeling
2.2. Spatial Dependence in Transportation Safety
2.3. Machine Learning in HRGC Safety Analysis
2.4. Behavioral, Environmental, and Operational Risk Factors
2.5. Distributional and System-Level Safety Analysis
2.6. Identified Research Gap
3. Methodology
3.1. Data Cleaning and Filtering
3.2. Spatial Autocorrelation
3.2.1. Neighborhood Network Structure
3.2.2. Global Spatial Autocorrelation
3.2.3. Local Spatial Autocorrelation
- HH: high AIPX surrounded by high AIPX neighbors
- LL: low AIPX surrounded by low AIPX neighbors
- HL: high AIPX surrounded by low AIPX neighbors
- LH: low AIPX surrounded by high AIPX neighbors
- NS: not statistically significant
3.2.4. Significance Testing
3.3. Distributional Modeling of High Intensity Clusters
3.3.1. Candidate Distributions
3.3.2. Kolmogorov–Smirnov Test
3.3.3. Anderson–Darling and Cramér–Von Mises Statistics
3.3.4. Q–Q and P–P Diagnostics
3.4. Feature Engineering
3.4.1. Recursive Feature Reduction
- A stratified k-fold cross-validation (CV) (with k = 5) was performed to estimate model performance on the current feature subset.
- A preprocessing algorithm applied median imputation and min–max scaling to numeric predictors, and most-frequent imputation with scaling to ordinal-coded categorical predictors.
- The trained model was evaluated using AUC, and the mean and standard deviation across folds were recorded.
- Permutation importance was computed on the full dataset using R = 20 repetitions, where each feature was randomly permuted and the resulting decrease in AUC was measured. Sensitivity analysis confirmed that higher or lower values of R did not change the importance ranking.
- The feature with the smallest mean AUC reduction (i.e., weakest contribution) was removed.
- The algorithm repeated until a single feature remained.
3.4.2. Cardinality Trimming
3.5. Machine Learning and Feature Ranking
- Model diversity captures linear and nonlinear relationships.
- Nested cross validation (CV) ensures unbiased model comparison.
- Threshold independent metric prioritizes ranking performance under data imbalance.
- Threshold optimization aligns classification with balanced objectives.
- Refitting on the full data maximizes information use in feature ranking.
- Dual explainability provides both global dependence and directional interpretation.
3.5.1. Model Formulation
3.5.2. Performance Metrics
3.5.3. Hyperparameter Tuning
- Outer CV (5-fold): estimates generalization performance.
- Inner CV (3-fold): selects hyperparameters via grid search.
3.5.4. Explainability Methods
3.6. Feature Discrimination Tests
3.6.1. Categorical Variables
3.6.2. Numeric Variables
4. Results
4.1. Spatial Autocorrelation
4.2. Target Feature Distribution
4.3. Recursive Feature Elimination
4.4. Categorical Noise Reduction
4.5. Machine Learning
4.5.1. Model Training and Selection
4.5.2. Feature Explanations
4.6. Feature Discrimination
4.6.1. Dominant Warning Types
4.6.2. Train Direction
4.6.3. Temperature
5. Discussion
6. Conclusions
Funding
Data Availability Statement
Conflicts of Interest
References
- Zahedian, S.; Maharjan, A.; Gorman, M.; Franz, M. L. Exploring the Equity Impact: Analyzing the Relationship between Railroad Safety and Sociodemographic Factors. Transp. Res. Rec. 2025, vol. 2679(no. 8), 105–121. [Google Scholar] [CrossRef]
- Lee, S.; Chen, T.; Sze, N. N.; Mao, T.; Ou, Y.; Mihaita, A.-S.; Chen, F. Analysing driver behaviour and crash frequency at railway level crossings using connected vehicle and GIS data. Travel Behav. Soc. vol. 39, 100957, 2025. [CrossRef]
- Alves, M. N.; Zschitschick, J. B.; Alves, V. T.; Ruiz-Padillo, A. Risks associated with road-rail grade crossings: A systematic literature review. J. Rail Transp. Plan. Manag. 2026, vol. 38, 100583. [Google Scholar] [CrossRef]
- Banerjee, A.; Haleem, K. Modeling crash frequencies at highway-railroad grade crossings in Kentucky in the United States. Accid. Anal. Prev. 2026, vol. 230, 108452. [Google Scholar] [CrossRef]
- Wang, Y.; Jiao, Y.; Fu, L.; Shangguan, Q. Exploring Causal Factor in Highway–Railroad-Grade Crossing Crashes: A Comparative Analysis. Infrastructures vol. 10(no. 8), 216, 2025. [CrossRef]
- Dzinyela, R.; Shirazi, M.; Das, S.; Lord, D. The negative Binomial-Lindley model with Time-Dependent Parameters: Accounting for temporal variations and excess zero observations in crash data. Accid. Anal. Prev. 2024, vol. 207, 107711. [Google Scholar] [CrossRef]
- Al-Mahamid, H.; Al-Nabulsi, D.; Torok, A. Developing safety performance functions incorporating pavement roughness using Poisson regression and Machine learning models on Jordan’s Desert Highway. Transp. Res. Interdiscip. Perspect. vol. 34, 101659, 2025. [CrossRef]
- Bayode, O.; Aiyelokun, O.; Osanyinlokun, O.; Adanikin, A. Enhancing road crash prediction: A comparative study of Machine Learning algorithms and Safety Performance Functions on the Lagos-Ibadan Expressway. Niger. J. Technol. 2025, vol. 44(no. 2), 215–221. [Google Scholar] [CrossRef]
- Hamed, M. M.; AlShaer, A. Analysis of duration between crashes using a hazard-based duration approach with heterogeneity in means and variances: Some new evidence. Anal. Methods Accid. Res. 2023, vol. 39, 100283. [Google Scholar] [CrossRef]
- Zayandehroodi, M.; Mojaradi, B.; Bagheri, M. Improving reliability of safety countermeasure evaluation at highway-rail grade crossings through aleatoric uncertainty modeling with machine learning techniques. Reliab. Eng. Syst. Saf. 2025, vol. 261, 111082. [Google Scholar] [CrossRef]
- Mahato, R. K.; Htike, K. M.; Kafle, A.; Gewali, V.; Kafle, A.; Sharma, V. Spatial distribution and cluster analysis of road traffic accidents in Nepal. PLoS ONE 2025, vol. 20(no. 8), e0331333. [Google Scholar] [CrossRef] [PubMed]
- Miao, C.; Chen, X.; Zhang, C. Assessing network-based traffic crash risk using prospective space-time scan statistic method. J. Transp. Geogr. 2024, vol. 119, 103958. [Google Scholar] [CrossRef]
- Khosravi, Y.; Hosseinali, F.; Adresi, M. Identifying accident prone areas and factors influencing the severity of crashes using machine learning and spatial analyses. Sci. Rep. 2024, vol. 14(no. 1), 29836. [Google Scholar] [CrossRef] [PubMed]
- Rana, P.; Sattari, F.; Lefsrud, L.; Hendry, M. T. Machine Learning Approach to Enhance Highway Railroad Grade Crossing Safety by Analyzing Crash Data and Identifying Hotspot Crash Locations. Transp. Res. Rec. J. Transp. Res. Board 2023, vol. 2678(no. 7), 1055–1071. [Google Scholar] [CrossRef]
- Lee, M.; Khattak, A. J. Motor Vehicle Traffic Diversion to Alternate Routes for Improving Safety at Highway-Rail Grade Crossings. Transp. Res. Rec. J. Transp. Res. Board 2025, vol. 2680(no. 4), 115–124. [Google Scholar] [CrossRef]
- Zhao, L.; Farooq, M. U.; Khattak, A. J. Data Accuracy Matters: Improving Highway-Rail Grade Crossings Crash Predictions through Inventory Verification. Transp. Res. Rec. J. Transp. Res. Board vol. 2679(no. 2), 1616–1627, 2025. [CrossRef]
- Wu, X.; Chen, Y.; Qian, Y. Integrating Railroad Crossing Blockage Information in First Responder Dispatching Route Planning. J. Transp. Eng. Part A Syst. 2024, vol. 150(no. 4). [Google Scholar]
- Senkondo, E.; Chimba, D.; Madalo, M.; Yeboah, A.; Blue, S. Comparative Analysis of Machine Learning and Statistical Models for Railroad–Highway Grade Crossing Safety. Vehicles 2025, vol. 7(no. 4), 163. [Google Scholar]
- Yin, X.; Jin, J.; Zhang, Z. Interpretable accident prediction at highway-rail grade crossings: a deep learning approach. Comput. Ind. Eng. 2025, vol. 207, 111337. [Google Scholar] [CrossRef]
- Chhotu, A. K.; Suman, S. K. Predicting the Severity of Accidents at Highway Railway Level Crossings of the Eastern Zone of Indian Railways using Logistic Regression and Artificial Neural Network Models. Eng. Technol. Appl. Sci. Res. 2024, vol. 14(no. 3), 14028–14032. [Google Scholar] [CrossRef]
- Yang, Z.; Zhang, C.; Li, G.; Hong-yi, X. Analysis of the Impact of Different Road Conditions on Accident Severity at Highway-Rail Grade Crossings Based on Explainable Machine Learning. Symmetry vol. 17(no. 1), 147, 2025. [CrossRef]
- Xiao, Y.; Duan, Z. An explainable multi-task deep learning framework for crash severity prediction using multi-source data. Sci. Rep. 2025, vol. 15(no. 1), 21978. [Google Scholar] [CrossRef] [PubMed]
- Samerei, S. A.; Aghabayk, K. Interpretable machine learning for evaluating risk factors of freeway crash severity. Int. J. Inj. Control Saf. Promot. 2024, vol. 31(no. 3), 534–550. [Google Scholar] [CrossRef] [PubMed]
- Ko, Y. G.; Jo, K. C.; Lee, J. S.; Yu, J. S. Vehicle Collision Frequency Prediction Using Traffic Accident and Traffic Volume Data with a Deep Neural Network. Appl. Sci. vol. 15(no. 18), 9884, 2025. [CrossRef]
- Elsayed, A.; Abdel-Rahim, A.; Prescott, L. From Prediction to Explanation: Explainable Machine Learning for Motor Vehicle–Involved Pedestrian and Cyclist Crash Risk. Infrastructures 2026, vol. 11(no. 3), 77. [Google Scholar] [CrossRef]
- Rifat, M. A. K.; Kabir, A.; Huq, A. S. An Explainable Machine Learning Approach to Traffic Accident Fatality Prediction. Procedia Comput. Sci. 2024, vol. 246, 1905–1914. [Google Scholar] [CrossRef]
- Kotsyubynska, Y.; Kozan, N. M.; Chadiuk, V.; Kostyshyn, A.; Kotsyubynsky, A.; Fentsyk, V. Machine Learning and Deep Learning for Predicting Traffic Crash Injury Severity: A Systematic Review and Meta-Analysis (2014-2025). J. Road. Saf. vol. 1(no. 37), 2026. [CrossRef]
- Khattak, A. J.; Farooq, M. U.; Farhan, A. Motor Vehicle Drivers’ Knowledge of Safely Traversing Highway-Rail Grade Crossings. Transp. Res. Rec. J. Transp. Res. Board 2023, vol. 2678(no. 7), 604–621. [Google Scholar] [CrossRef]
- Badshah, I.; Ali, A.; Lu, P. Risky User Behavior at Highway–Rail Grade Crossings: A Systematic Literature Review with Empirical Insights. Appl. Sci. vol. 15(no. 22), 12021, 2025.
- Nguyen, N. A. T.; Truong, L. T.; Skarbez, R. Improving nighttime visibility and safety at passive railway level crossings: New designs incorporating photoluminescent markings and signs. Traffic Inj. Prev. 2026, vol. 27(no. 1), 100–107. [Google Scholar] [CrossRef]
- Vivek, A. K.; Mohapatra, S. S. An observational study on pedestrian and bicyclist violations at railroad grade crossings: Exploring the impact of geometrical and operational attributes. J. Saf. Res. 2023, vol. 87, 395–406. [Google Scholar] [CrossRef]
- Dolama, M. G.; Wodi, B. H.; Ternowetsky, N.; Regehr, J. D.; Leung, C. K. Quantifying emergency response system risk caused by grade crossing blockages. In Transportation Planning and Technology; 2025; pp. 1–22. [Google Scholar]
- Özkan, M.; Yerlikaya, M. A.; Yildiz, K. A machine learning optimisation integration for enhanced railway crossing safety. In Proceedings of the Institution of Civil Engineers - Transport, 2026; pp. 1–20. [Google Scholar]
- Ibtihal, S. A.; Rifaat, S. M. Crash occurrence and severity at railway level crossings in Bangladesh. Transp. Res. Interdiscip. Perspect. 2026, vol. 36, 101840. [Google Scholar] [CrossRef]
- Alshriem, M.; Yang, Y. Prediction of Large-Scale Traffic Accident Severity in Qatar: A Binary Reformulation Approach for Extreme Class Imbalance with Interpretable AI. Future Transp. 2026, vol. 6(no. 2), 88. [Google Scholar] [CrossRef]
- Alanazi, F.; Umar, I. K.; Yosri, A. M.; Okail, M. A. Comparative evaluation of deep learning and traditional models for predicting traffic accident severity in Saudi Arabia. Sci. Rep. 2025, vol. 15(no. 1), 32568. [Google Scholar] [CrossRef]
- Hussain, F.; Li, Y.; Haque, S. M. M. Machine learning-based real-time crash risk forecasting for pedestrians. Commun. Transp. Res. 2025, vol. 5, 100224. [Google Scholar] [CrossRef]
- Rungskunroch, P.; Maneerat, P. A data-driven framework for railway risk assessment and safety management: evidence from Thailand’s national network. Urban Plan. Transp. Res. 2025, vol. 13(no. 1), 2590872. [Google Scholar] [CrossRef]
- Bridgelall, R. Hierarchical Reconciliation of Fifty-One Years of Highway–Rail Grade Crossing Data with Verified Multistage Inference. Algorithms 2026, vol. 19(no. 4), 282. [Google Scholar] [CrossRef]
- FRA. Highway-Rail Grade Crossing Incident Data (Form 57)," Federal Railroad Administration (FRA), 2026. Available online: https://data.transportation.gov/Railroads/Highway-Rail-Grade-Crossing-Incident-Data-Form-57-/7wn6-i5b9/about_data (accessed on 21 March 2026).
- FRA. Crossing Inventory Data (Form 71) - Current," Federal Railroad Administration (FRA), 2026. Available online: https://data.transportation.gov/Railroads/Crossing-Inventory-Data-Form-71-Current/m2f8-22s6/about_data (accessed on 21 March 2026).
- Anselin, L. Local indicators of spatial association—LISA. Geogr. Anal. 1995, vol. 27(no. 2), 93–115. [Google Scholar] [CrossRef]
- Forbes, C.; Evans, M.; Hastings, N.; Peacock, B. Statistical Distributions, 4th ed.; John Wiley & Sons: Hoboken, New Jersey, 2011. [Google Scholar]
- Model Selection and Multimodel Inference: A Practical Information-Theoretic Approach; Burnham, K. P., Anderson, D. R., Eds.; Springer: New York, NY, New York, 2002. [Google Scholar]
- Casella, G.; Berger, R. Statistical Inference, 2nd ed.; Chapman and Hall/CRC: Boca Raton, Florida, 2024; p. 565. [Google Scholar]
- Aggarwal, C. C. Data Mining; Springer International Publishing: New York, New York, 2015; p. 734. [Google Scholar]










| Filter | Features | Rows | Description |
|---|---|---|---|
| FRA Incidents | 154 | 250,290 | 51 years of raw incident data (1975 – 2025) |
| Undefined Features | 96 | 250,290 | Drop features with >5% missing values, add “Row ID” key |
| Public/Private Code = “Y” | 96 | 226,170 | Retain public at-grade crossings only |
| Reconciled Counties | 101 | 225,765 | CONUS retained, HMI reconciled, audit features added |
| Model | k | AIC | K–S D | K–S p | AD | CvM | RQQ | r | RPP | α | μ | σ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Johson SU | 4 | 509.61 | 0.05 | 0.31 | 1.08 | 0.17 | 0.13 | 0.99 | 0.02 | -7.22 | 0.54 | 0.02 |
| Lognormal | 2 | 518.50 | 0.06 | 0.17 | 1.49 | 0.24 | 0.06 | 1.00 | 0.03 | 0.37 | 0.00 | 1.51 |
| Gamma | 2 | 534.12 | 0.08 | 0.05 | 2.32 | 0.37 | 0.10 | 0.99 | 0.04 | 7.18 | 0.00 | 0.23 |
| Weibull | 2 | 581.40 | 0.10 | 0.00 | 4.79 | 0.66 | 0.15 | 0.97 | 0.05 | 2.62 | 0.00 | 1.83 |
| Filter Stage | Total | Kept | Dropped % | Dominant Categories |
|---|---|---|---|---|
| HH & LL Clusters | 74,373 | 74,373 | 0 | Homogeneous spatial clusters |
| Railroad Type = [1, 1L, 1S] | 74,373 | 62,062 | 16.55 | Class 1 Railroads |
| Track Type Code = [1] | 62,062 | 54,503 | 10.16 | Mainline tracks |
| Track Class = [1,2,3,4] | 54,503 | 52,051 | 3.3 | Track speed limit classes |
| Equipment Type Code = [1] | 52,051 | 41,171 | 14.63 | Freight trains |
| Equipment Involved Code = [1] | 41,171 | 39,257 | 2.57 | Train units pulling |
| Highway User Code = [A, B, C, D] | 39,257 | 36,488 | 3.72 | Cars and trucks |
| Missing Values | 36,488 | 34,614 | 2.52 | Dropped empty |
| Filter | Features | Rows | Description |
|---|---|---|---|
| Reconciled Counties | 101 | 225,765 | CONUS retained, HMI reconciled, add fixed state/county to audit |
| Significant Clusters | 39 | 74,373 | Retain HH/LL labeled incidents, drop meta variables |
| Redundant Features | 33 | 74,373 | Drop redundant variables (total vs. breakdown of killed/injured) |
| Unimportant Features | 24 | 74,373 | Recursive AUC feature elimination to maximize mean AUC |
| Category Trimming | 24 | 36,488 | Retain dominant categories (Class, Freight, Mainline, etc.) |
| Undefined Predictors | 24 | 34,614 | Drop incidents with missing predictors before model fitting |
| Model | AUC | F1 | RTR | Hyperparameters Grid and Selections in Bold Font |
|---|---|---|---|---|
| XGB | 0.849 | 0.950 | 1.9 | n = [100,200,300]; d = [4,6,8]; η = [0.03, 0.05, 0.1]; s = [0.8, 1.0]; c = [0.8, 1.0] |
| LGB | 0.848 | 0.950 | 17.4 |
n = [100,200,300]; d = [-1, 10, 20]; l = [31,63]; η = [0.03, 0.05, 0.1]; s = [0.8, 1.0]; c = [0.8, 1.0] |
| CB | 0.846 | 0.951 | 7.0 | n = [100,200,300]; d = [4,6,8]; l = [3,5,7]; η = [0.03, 0.05, 0.1] |
| RF | 0.838 | 0.949 | 9.1 | n = [100,200,300]; d = [none, 10, 20]; m = [2,5]; l = [1,2] |
| LR | 0.822 | 0.949 | 1.0 | C = [0.01, 0.1, 1.0, 10.0]; R = [L1, L2] |
| ET | 0.815 | 0.947 | 9.0 | n = [100,200,300]; d = [none, 10, 20]; m = [2,5]; l = [1,2] |
| Warning Type | LL Count | LL (%) | HH Count | HH (%) | Δ (HH% − LL%) | Z-statistic | p-value |
|---|---|---|---|---|---|---|---|
| Crossbucks | 2,364 | 66.48 | 11,017 | 35.47 | −31.01 | −35.97 | <0.001 |
| Gates | 343 | 9.65 | 8,440 | 27.17 | 17.53 | 22.75 | <0.001 |
| FLS | 655 | 18.42 | 9,397 | 30.26 | 11.84 | 14.73 | <0.001 |
| Other | 194 | 5.46 | 2,204 | 7.1 | 1.64 | 3.65 | <0.001 |
| Total (N) | 3,556 | 100 | 31,058 | 100 | — | — | — |
| Statistic | Value |
|---|---|
| Chi-square (χ²) | 1346.25 |
| Degrees of freedom | 3 |
| p-value | <0.001 |
| Cramér’s V | 0.197 |
| Direction | LL Count | LL (%) | HH Count | HH (%) | Δ (HH% − LL%) | Z-statistic | p-value |
|---|---|---|---|---|---|---|---|
| North | 367 | 10.32 | 7,783 | 25.06 | 14.74 | 19.62 | <0.001 |
| South | 315 | 8.86 | 7,986 | 25.71 | 16.85 | 22.3 | <0.001 |
| East | 1,417 | 39.85 | 7,503 | 24.16 | −15.69 | −20.26 | <0.001 |
| West | 1,457 | 40.97 | 7,786 | 25.07 | −15.90 | −20.31 | <0.001 |
| Total (N) | 3,556 | 100 | 31,058 | 100 | — | — | — |
| Statistic | Value |
|---|---|
| Chi-square (χ²) | 1279.38 |
| dof | 3 |
| p-value | <0.001 |
| Cramér’s V | 0.192 |
| Class | N | Mean | Median | Std | Min | Q1 | Q3 | Max | IQR | Skew | Kurtosis |
|---|---|---|---|---|---|---|---|---|---|---|---|
| LL | 3,556 | 46.44 | 45 | 24.89 | −25.0 | 28 | 67 | 107 | 39 | −0.07 | −0.75 |
| HH | 31,057 | 59.73 | 61 | 21.33 | −40.0 | 45 | 75 | 110 | 30 | −0.41 | −0.41 |
| Test | Statistic | Units | p-value | Effect Size | Interpretation |
|---|---|---|---|---|---|
| Welch’s | 30.58 | t | <0.001 | — | Mean difference (HH > LL) |
| M–W | 7.23×107 | U | <0.001 | r_rb = 0.31 | Rank/location difference |
| K–S | 0.23 | D | <0.001 | — | Distributional difference |
| Cohen’s d | 0.61 | d | — | 0.61 | Moderate standardized mean difference |
| Class | N | μ | σ | Log-Lik | AIC | KS D | KS p | CvM W2 | CvM p |
|---|---|---|---|---|---|---|---|---|---|
| LL | 3,556 | 46.44 | 24.89 | −16,475.99 | 32,955.99 | 0.067 | <0.001 | 2.74 | <0.001 |
| HH | 31,057 | 59.73 | 21.33 | −139,103.57 | 278,211.15 | 0.082 | <0.001 | 31.87 | <0.001 |
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. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).