Next Article in Journal
Numerical Investigation of the Influence of the Stress Multiaxiality on the Propagation Behavior of Rayleigh Waves
Previous Article in Journal
Special Issue on Challenges for Power Electronics Converters, 2nd Edition
Previous Article in Special Issue
Analysis of Automotive Suspension System Failures and Reliability Evaluation: A Study Based on V-SIM Simulation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Using Neural Networks to Predict the Frequency of Traffic Accidents by Province in Poland

1
Department of Transport, Stanislaw Staszic State University of Applied Sciences in Pila, Podchorazych Str. 10, 64-920 Pila, Poland
2
Laboratory of Vision Science and Optometry, Faculty of Physics and Astronomy, Adam Mickiewicz University of Poznan, Uniwersytetu Poznanskiego Str. 2, 61-614 Poznan, Poland
3
Department of Automobile Engineering, Faculty of Transport Engineering, Vilnius Gediminas Technical University, Plytinės Str. 25, 10105 Vilnius, Lithuania
*
Author to whom correspondence should be addressed.
Appl. Sci. 2025, 15(16), 9108; https://doi.org/10.3390/app15169108
Submission received: 7 July 2025 / Revised: 8 August 2025 / Accepted: 17 August 2025 / Published: 19 August 2025
(This article belongs to the Special Issue Simulations and Experiments in Design of Transport Vehicles)

Abstract

Road traffic fatalities remain a significant global issue, despite a gradual decline in recent years. Although the number of accidents has decreased—partly due to reduced mobility during the pandemic—the figures remain alarmingly high. To further reduce these numbers, it is crucial to identify regions with the highest accident rates and predict future trends. This study aims to forecast traffic accident occurrences across Poland’s provinces. Using official police data on annual accident statistics, we analyzed historical trends and applied predictive modeling in Statistica to estimate accident rates from 2022 to 2040. Several neural network models were employed to generate these projections. The findings indicate that a significant reduction in road accidents is unlikely in the near future, with rates expected to stabilize rather than decline. The accuracy of predictions was influenced by the random sampling distribution used in model training. Specifically, a 70-15-15 split (70% training, 15% testing, and 15% validation) yielded an average error of 1.75%, and an 80-10-10 split reduced the error to 0.63%, demonstrating the impact of sample allocation on predictive performance. These results highlight the importance of dataset partitioning in accident forecasting models.

1. Introduction

Annual fatalities caused by road accidents remain alarmingly high. According to data from the World Health Organization (WHO), approximately 1.3 million lives are lost globally each year due to traffic collisions. Road crashes are the leading cause of mortality among individuals aged 5 to 29. In response, the United Nations has set an ambitious goal to reduce traffic-related fatalities and serious injuries by 50% before 2030 [1].
The losses caused by traffic accidents, as well as the costs of activities related to the investigation of their circumstances, constitute a sufficiently significant amount in each country. Therefore, not only research related to the analysis of the causes and consequences of traffic accidents, their reconstruction, and investigation of the circumstances [2,3] but also the assessment of the risk of traffic accidents [4,5] and their prediction [6] are becoming important and increasingly relevant. This would allow for better management of future risks and planning of activities related to the problem of traffic accidents.

2. Literature Review

Various approaches have been developed to predict accident rates. Among these, time series analysis is one of the most widely applied methods [7]. However, this technique has certain drawbacks, including difficulties in evaluating prediction accuracy based on historical data and frequent autocorrelation in residual components [8]. Researchers have explored alternative models; for instance, Procházka et al. [9] employed a multi-seasonal forecasting model, while Sunny et al. [10] applied Holt–Winters exponential smoothing. A key limitation of the latter is its inability to account for external variables in predictions [11,12].
Forecasting the number of traffic accidents is a topic that has attracted attention both for its social dimension and its practical significance for transport policy. To date, a variety of methods have been used. The most commonly used are time series models, such as ARIMA or Holt–Winters, but they have limitations in integrating exogenous variables and are sensitive to the autocorrelation of residual components [13]. We also use regression models for forecasting. They use linear relationships but require stationarity of the data. Their effectiveness decreases when the phenomena are nonlinear [14]. ANOVA models and classical statistical methods are another type of forecasting method. They are most often used in regional forecasting, such as in Poland [15], but are burdened with assumptions that, if broken, lead to erroneous conclusions.
A growing number of studies indicate that neural networks are more effective in forecasting nonlinear and seasonal phenomena [16]. The use of MLP (multilayer perceptron) models allows the analysis of complex data, such as the number of accidents, taking into account seasonality and local trends. However, it is important to note that, considering the COVID-19 pandemic, numerous studies have confirmed a significant reduction in road accidents during lockdowns, up to 30% [17]. However, the trend returned to previous values after restrictions were lifted.

3. Materials and Methods

In recent years, the number of traffic accidents in Poland has been decreasing, which is partly attributed to the COVID-19 pandemic and legislative action. According to the Police Headquarters, 30,288 fatal accidents were reported in 2019, with 2909 fatalities. There was a decrease in 2020, with 2491 deaths (−14% against 2019). This trend continued in the following years as well: In 2021, there were 22,816 accidents (2245 killed), while in 2022, 21,322 accidents occurred (1896 killed). A further decline in 2023 (20,936 accidents, 1893 killed) illustrates that the number of incidents remained at a reduced level after the pandemic restrictions were lifted. There was a slight rebound in 2024, with 21,519 accidents and 1896 fatalities reported.
The trend is also evident in the charts. The CSO analysis shows that there was a general decline in both accidents, fatalities, and injuries from 2013 to 2022. Data comparison: in 2021, 22.6 thousand accidents and 2212 fatalities were observed, while in 2024, 21.5 thousand accidents and 1896 deaths were reported. This means that the pandemic has led to an approximate 10–15% reduction in the number of casualties (from 2909 killed in 2019 to 1896 in 2024).
Poland is home to about 38 million people (Table 1). Its entire size is 312,705 square kilometers, divided into 16 provinces (Table 2, Figure 1). In every province that was studied between 2001 and 2021, the average decrease from 2001 is higher than 56%. The provinces of Podlaskie (69%) and Kujawsko–Pomorskie (70%) have the highest level of awareness, while Lubuskie (32%) has the lowest level of awareness. The number of traffic accidents in a province is based on its population. Poland’s accident rate is exceptionally high when compared to other EU countries. Consequently, every attempt should be made to reduce this number and identify the provinces with the highest number of traffic accidents (Figure 2 and Figure 3).
Table 1. Population of Poland from 2001 to 2020 [18].
Table 1. Population of Poland from 2001 to 2020 [18].
Lower SilesiaKuyavia–PomeraniaLublin ProvinceLubusz ProvinceLodz ProvinceLesser PolandMasoviaOpole Province
20012,909,6222,069,7472,201,7201,008,9832,617,3183,236,2685,121,6811,066,438
20022,904,6942,069,1662,196,9921,008,1962,607,3803,237,2175,128,6231,061,009
20032,898,3132,068,1422,191,1721,008,7862,597,0943,252,9495,135,7321,055,667
20042,893,0552,068,2582,185,1561,009,1682,587,7023,260,2015,145,9971,051,531
20052,888,2322,068,2532,179,6111,009,1982,577,4653,266,1875,157,7291,047,407
20062,882,3172,066,3712,172,7661,008,5202,566,1983,271,2065,171,7021,041,941
20072,878,4102,066,1362,166,2131,008,4812,555,8983,279,0365,188,4881,037,088
20082,877,0592,067,9182,161,8321,008,9622,548,8613,287,1365,204,4951,033,040
20092,876,6272,069,0832,157,2021,010,0472,541,8323,298,2705,222,1671,031,097
20102,917,2422,098,7112,178,6111,023,2152,542,4363,336,6995,267,0721,017,241
20112,916,5772,098,3702,171,8571,023,1582,533,6813,346,7965,285,6041,013,950
20122,914,3622,096,4042,165,6511,023,3172,524,6513,354,0775,301,7601,010,203
20132,909,9972,092,5642,156,1501,021,4702,513,0933,360,5815,316,8401,004,416
20142,908,4572,089,9922,147,7461,020,3072,504,1363,368,3365,334,5111,000,858
20152,904,2072,086,2102,139,7261,018,0752,493,6033,372,6185,349,114996,011
20162,903,7102,083,9272,133,3401,017,3762,485,3233,382,2605,365,898993,036
20172,902,5472,082,9442,126,3171,016,8322,476,3153,391,3805,384,617990,069
20182,901,2252,077,7752,117,6191,014,5482,466,3223,400,5775,403,412986,506
20192,900,1632,072,3732,108,2701,011,5922,454,7793,410,9015,423,168982,626
20202,891,3212,061,9422,095,2581,007,1452,437,9703,410,4415,425,028976,774
SubcarpathiaPodlaskie ProvincePomeraniaSilesiaHoly CrossWarmia-MasuriaGreater PolandWest Pomerania
20012,104,1381,209,4392,178,3374,741,8161,299,3821,428,4693,350,4371,698,402
20022,105,0501,207,7042,183,6364,731,5331,295,8851,428,4493,355,2791,697,718
20032,097,2481,205,1172,188,9184,714,9821,291,5981,428,8853,359,9321,696,073
20042,097,9751,202,4252,194,0414,700,7711,288,6931,428,7143,365,2831,694,865
20052,098,2631,199,6892,199,0434,685,7751,285,0071,428,6013,372,4171,694,178
20062,097,5641,196,1012,203,5954,669,1371,279,8381,426,8833,378,5021,692,838
20072,097,3381,192,6602,210,9204,654,1151,275,5501,426,1553,386,8821,692,271
20082,099,4951,191,4702,219,5124,645,6651,272,7841,427,0733,397,6171,692,957
20092,101,7321,189,7312,230,0994,640,7251,270,1201,427,1183,408,2811,693,198
20102,127,9481,203,4482,275,4944,634,9351,282,5461,453,7823,446,7451,723,741
20112,128,6871,200,9822,283,5004,626,3571,278,1161,452,5963,455,4771,722,739
20122,129,9511,198,6902,290,0704,615,8701,273,9951,450,6973,462,1961,721,405
20132,129,2941,194,9652,295,8114,599,4471,268,2391,446,9153,467,0161,718,861
20142,129,1871,191,9182,302,0774,585,9241,263,1761,443,9673,472,5791,715,431
20152,127,6571,188,8002,307,7104,570,8491,257,1791,439,6753,475,3231,710,482
20162,127,6561,186,6252,315,6114,559,1641,252,9001,436,3673,481,6251,708,174
20172,129,1381,184,5482,324,2514,548,1801,247,7321,433,9453,489,2101,705,533
20182,129,0151,181,5332,333,5234,533,5651,241,5461,428,9833,493,9691,701,030
20192,127,1641,178,3532,343,9284,517,6351,233,9611,422,7373,498,7331,696,193
20202,121,2291,173,2862,346,6714,492,3301,224,6261,416,4953,496,4501,688,047
Table 2. Area and population by province in Poland in 2020 [18].
Table 2. Area and population by province in Poland in 2020 [18].
ProvinceAreaPopulation
in hain km2Totalper 1 km2
Poland31,270,525312,70538,265,013122
Lower Silesia 1,994,67019,9472,891,321145
Kuyavia–Pomerania 1,797,13417,9712,061,942115
Lublin Province2,512,24625,1232,095,25883
Lubusz Province1,398,79313,9881,007,14572
Łodz Province1,821,89518,2192,437,970134
Lesser Poland 1,518,27915,1833,410,441225
Masovia 3,555,84735,5595,425,028153
Opole Province941,1879412976,774104
Subcarpathia 1,784,57617,8462,121,229119
Podlaskie Province2,018,70220,1871,173,28658
Pomerania 1,832,36818,3232,346,671128
Silesia 1,233,30912,3334,492,330364
Holy Cross 1,171,05011,7101,224,626105
Warmia-Masuria 2,417,34724,1731,416,49559
Greater Poland 2,982,65029,8263,496,450117
West Pomerania 2,290,47222,9051,688,04774
Figure 1. Location of provinces in Poland [19].
Figure 1. Location of provinces in Poland [19].
Applsci 15 09108 g001
Figure 2. Number of road accidents in Poland by province from 2009 to 2021 [20].
Figure 2. Number of road accidents in Poland by province from 2009 to 2021 [20].
Applsci 15 09108 g002
Figure 3. Number of road accidents in Poland by province in 2021 [20].
Figure 3. Number of road accidents in Poland by province in 2021 [20].
Applsci 15 09108 g003
To predict traffic accident rates across Polish provinces, multiple neural network models were employed. A key strength of this approach lies in its ability to simulate human cognitive processes. These networks are structured with interconnected nodes, each processing inputs through adjustable weights, variances, and outputs. For this study, Statistica’s artificial neural network (ANN) module was used to iteratively optimize these weights during training.
The predictive framework relied on multilayer perceptron (MLP) networks, each featuring a single hidden layer. The input layer comprised 10 neurons, corresponding to the historical traffic accident data (time series) for each province. The hidden layer’s architecture was tested with two to eight neurons, while the output layer consisted of a single neuron generating the predicted accident values. Model performance was contingent upon two factors: The selected network topology (e.g., neuron count in the hidden layer) and the parameter configuration (e.g., weight optimization during training).
A neural network is a computational model inspired by the human nervous system, designed to process information through interconnected layers. These models are structured in such a way that data—whether in the form of images, audio, text, or numerical values—are introduced at the input layer and subsequently processed through intermediate layers before generating a final output. During training, the system learns patterns in the input data, enabling it to analyze complex information and make decisions based on learned relationships.
At the heart of such systems are artificial neurons, which serve as simplified representations of their biological counterparts. Just like biological neurons, artificial ones receive multiple inputs, process them, and produce a single output signal. These components mimic the function of dendrites in the brain, allowing for the transformation of input data into a meaningful response. Neural networks are a foundational element of artificial intelligence, supporting the development of intelligent systems capable of organizing knowledge hierarchically and making autonomous decisions [21].
Their versatility enables neural networks to be applied in numerous domains. For example, streaming platforms utilize them to recommend shows and movies based on user behavior, while services like Google Translate rely on them for language translation. In e-commerce, they assist in customizing product recommendations during auctions, and in the transport sector, they are used to forecast traffic accident occurrences [22,23,24,25].
In this context, a neural network model was applied to estimate the number of traffic accidents across selected counties. One of the major advantages of such systems lies in their ability to simulate cognitive functions of the human brain. These models operate through networks composed of input nodes, adjustable weights, bias values, and output nodes.
Neural networks emulate the processes of the nervous system through mathematical formulations. Their architecture typically involves several layers, starting with an input layer that assimilates data of various types. The system then propagates this information through one or more hidden layers—often referred to as transition layers—before producing a result at the output layer (Figure 4). Each stage plays a critical role in extracting relevant features from the data and generating accurate predictions.
For the modeling process, the Statistica software 13.3, which includes dedicated tools for neural network analysis, was used to optimize weight values during testing. A multilayer perceptron (MLP) architecture was implemented, incorporating hidden layers composed of a variable number of neurons, ranging from two to eight, depending on the case. The output layer consisted of a single neuron that produced the forecasted values of traffic accident occurrences in the studied regions.
The neural network model developed in this study is based primarily on historical time series data of road accident frequency for each province in Poland, covering the years 2001 to 2021. These data served as the sole input to the multilayer perceptron (MLP) networks used for prediction. The input layer consisted of 10 neurons, each representing accident counts from the ten most recent years in the training set. The model architecture also included a hidden layer (with two to eight neurons) and an output neuron producing the projected number of accidents.
Although the model does not explicitly incorporate exogenous variables such as traffic volume, meteorological conditions, or infrastructure characteristics, these factors are indirectly reflected in the data used, for instance, the following features:
  • Demographic and infrastructural differences between provinces influence the historical accident rates and are thus implicitly embedded in the model.
  • Legislative changes, such as increased penalties for violations introduced in 2022, and external shocks like the COVID-19 pandemic, are represented through fluctuations in the time series.
  • Temporal patterns, including long-term trends and seasonal variations, are captured during model training.
In essence, while the model does not isolate specific causal factors, their cumulative effects are learned by the network through historical data. Future work may include enriching the model with additional explanatory variables to improve its predictive capabilities and interpretability.
This methodology underscores the flexibility of ANNs in modeling complex, nonlinear relationships within traffic safety data. Measures of forecast excellence were derived from the following forecast errors, which were found using Equations (1)–(5):
  • ME—mean error
    M E = 1 n i = 1 n Y i Y p ,
  • MAE—mean absolute error
    M A E = 1 n i = 1 n Y i Y p ,
  • MPE—mean percentage error
    M P E = 1 n i = 1 n Y i Y p Y i ,
  • MAPE—mean absolute percentage error
    M A P E = 1 n i = 1 n Y i Y p Y i ,
  • SSE—mean square error
    S S E = 1 n i = 1 n Y i Y p 2  
where
n—length of the forecast horizon;
Y—observed value of traffic accidents;
Yp—the forecast value of traffic accidents.
Neural network models with the lowest mean percentage error and mean absolute percentage error were used to forecast the frequency of traffic accidents.

4. Results

The change in the number of traffic accidents in each province was examined using the Kruskal–Wallis nonparametric test, and the findings indicated that the provinces under consideration had different medians. The test statistic has a value of 260.4 and a test probability of p = 0.000. The obtained value leads to the conclusion that the monthly accident rates in Poland deviate statistically significantly from the examined data in each province.
Moreover, as Figure 2 and Figure 3 show, there is a noticeable difference in accidents according to the province. Figure 5 clearly shows that the provinces with the highest population density, Masovia and Silesia, also have the highest frequency of traffic accidents, while Lubusz Province and Podlaskie Province have the lowest frequency.

Road Accident Forecasting

The number of road accidents in the provinces under consideration was projected using annual data from the Polish Police from 2001 to 2021 [20]. The following random sample sizes were used for statistical tests in Statistica:
-
Teaching 70%, testing 15%, and validation 15%;
-
Teaching 80%, testing 10%, and validation 10%.
The majority of studies were conducted using random sample sizes of 15% for testing, 70% for instruction, and 15% for validation. In order to answer the topic of whether and how the random sample size affects the success of the analysis utilized, new random sample sizes of teaching 80%, testing 10%, and validation 10% were adopted because no study in this area could be found. The investigation was conducted in each of the previously indicated random sample sizes and with the assumed number of learning networks: 20, 40, 60, 80, 100, and 200. This was done to avoid a false halt of learning when a local minimum occurs. Increasing this value leads to an abundance of learning networks.
This study used different numbers of random paths to show how their choice affected the results. Meanwhile, it was believed that the neurons in the hidden and output layers were activated by logistic, linear, exponential, and hyperbolic tangent functions. The activation function of a neural network is the process by which its neurons determine the value of their output. They are also used to calculate the value of a neuron’s output signal while taking the values of this collective excitation into consideration.
Each layer that has been covered has a specific purpose. In particular, data entry into the network is the responsibility of the input layer; here, the data include the total number of traffic accidents that transpired during the research period. The hidden layer, or the next layer in question, uses input neurons to process the values of the incoming data. The output layer, the last layer to be considered, is used to ascertain the data’s output values once it has been analyzed.
It was anticipated that the learning error functions would lower the output of the neural network’s sum of squares of errors. The iterative BFGS (Broyden–Fletcher–Goldfarb–Shanno) learning algorithm was used. The algorithm used in this study is quite stable and shows no sensitivity to directional minimization errors. Moreover, there is no usage of the Hesse matrix. Furthermore, one of the advantages of the aforementioned algorithm is a wide region of convergence, which permits one to approach the optimization task to a solution without considering a predetermined starting point [27].
The Statistica automatic search module for optimal networks was utilized in the computations. Five networks were identified for each number of learning networks and an expected number of random groups in order to serve this goal. Then, out of the sixty neural network combinations that were tested, the combinations with the lowest assumed MAPE error values were selected.
The best-trained neural networks used to forecast the number of traffic accidents in Poland by province are displayed in Table 3 and Table 4. In the tables under examination, the word “MLP” refers to a specific type of neural network consisting of n input layers, n hidden layers, and n output layers. The quality of neural network learning and validation was then evaluated. Values closer to 1 indicate better performance. The subsequent columns contain the neuron activation function that was previously defined and for which the error was lowest. The number at BFGS indicates the number of epochs required for the network to learn its architecture and find the best solution with the least amount of learning error.
To better understand how the choice of training–validation–testing split affects forecasted accident levels, the results from the 70-15-15 and 80-10-10 configurations were compared for the year 2040 across all provinces. Although both approaches produced similar trends, the predicted values in some regions (e.g., Lesser Poland, Silesia) differed by more than 5%. To visualize this, a comparative difference map may be created in future work, using GIS tools to display forecast divergence. Such maps can help identify provinces where model sensitivity is higher and forecast confidence is lower, thereby supporting more informed decisions in traffic safety planning.

5. Discussion

Based on current police reports, the previous statistical analysis was expanded to include data from 2022 to 2024. In summary, in 2022, 21,322 accidents (1896 killed, 24,743 injured) were reported; in 2023, 20,936 accidents (1893 killed, 24,125 injured) occurred; and in 2024, 21,519 accidents (1896 killed, 24,782 injured) were reported. Compared with earlier forecasts, there is general agreement on the numerical range, although the details differ. For example, classical trend models predicted a further decline in accidents, which actually occurred until 2023, but there was a rebound in 2024. In contrast, the neural network forecast by province, assuming stabilization, was confirmed observationally: the number of accidents in 2024 was similar to that of 2022 (it increased only slightly). The new data also enabled a more precise assessment of the error of the models—the results show that the neural nets maintain high accuracy (an error of 1–2%), while the simple trend models yield higher deviations, especially in the short horizon.
Based on the data shown above, it is anticipated that the number of traffic accidents in Poland will decrease every year until reaching a stable level, regardless of the province. The results are impacted by the random sample size selection. With the 70-15-15 proportions, the average percentage error was 1.75% for the learning group (70%), 15% for the testing group, and 15% for the validation group. However, for the second sample (80-10-10), the error was 0.63%.
It is important to note that the outbreak affected the results. During the pandemic, there was an average 30% decrease in the number of road accidents [28]. However, after the outbreak, the number of road accidents went back to what it was before the epidemic.
The COVID-19 pandemic was a key factor disrupting accident data. The period of traffic restrictions (2020–2021) saw a decrease in the number of incidents, with the historical minimum level of fatalities (2245 people) falling in 2021. As the authors note, “the pandemic significantly reduced the frequency of accidents on the road,” which is also confirmed by trend analysis. After the restrictions were lifted, traffic gradually increased, contributing to a rebound in the number of accidents in 2024.
Moreover, the Tanh function for the hidden layer and the linear function for the baseline are the most beneficial activation functions for the first investigation (70-15-15). For the second investigation, it is advantageous to use the Tanh and exponential functions (80-10-10).
It is feasible to conclude that in the next few years, there will probably be a decrease in traffic accidents, followed by stabilization, based on the data above regarding the expected number of accidents per province. It should be noted that the results were impacted by the epidemic (Figure 6 and Figure 7).
Moreover, Figure 6 and Figure 7 present the projected number of traffic accidents in Poland’s provinces from 2022 to 2040, based on two different training–validation–testing splits. Figure 6 corresponds to the model trained with a 70-15-15 split (70% training, 15% testing, and 15% validation), while Figure 7 presents the results using the 80-10-10 split.
The figures visualize the expected stabilization in the number of traffic accidents across provinces after an initial decline. In both cases, the neural network models forecast relatively flat trends after 2025, with minor variations between provinces. However, the model trained on the 80-10-10 split generally produces smoother curves and smaller fluctuations, which aligns with its lower mean absolute percentage error (MAPE = 0.63%) compared to the 70-15-15 model (MAPE = 1.75%).
Notably, provinces with higher historical accident rates—such as Masovia and Silesia—maintain higher predicted values, while regions like Lubusz and Podlaskie exhibit lower and more stable forecasted accident levels. These differences reflect the patterns observed in the historical data and were learned by the neural network during training.
The visual comparison between the two figures also demonstrates the effect of data partitioning on model stability and forecast variance, underlining the importance of selecting optimal training configurations in neural network forecasting.

6. Conclusions

The neural network method projected the number of accidents that would happen in each province of Poland using Statistica software. The software minimized both the average absolute percentage error and the average absolute error while assuming the weights.
Based on the study, it was found that forecasts of the number of traffic accidents based on data from 2000 to 2021 indicated a further decrease in the number of accidents (trend models) or their stabilization (neural networks). The data for 2022–2024 confirm that, after a period of decline, there was a rebound, with the number of accidents at a slightly higher level in 2024. However, according to the UNRSC assumptions, there is a long-term favorable trend (fewer deaths than 5 years ago). In addition, the use of neural networks (MLPs) allows for high forecast accuracy, which can support police planning and prevention efforts. The results suggest maintaining effective enforcement (e.g., higher fines from 2022) and investing in infrastructure (expansion of the highway network, sidewalks, etc.) to continue the trend of reducing casualties. At the same time, it is worth including additional factors (traffic volume, meteorological conditions, and pedestrian participation) in predictive models, as proposed in the literature.
Classical trending methods are intuitive, but they do not take into account the impact of new variables and can fail with non-stationary changes (e.g., pandemic, novation). Neural networks offer flexibility and usually lower predictive error, but their effectiveness depends on correct parameter selection and training set balance. Further research should test different architectures (e.g., deep networks or LSTMs) and compare them with other ML algorithms (e.g., random forests, Bayesian networks). It is also important to validate predictions on new data—the introduction of 2022–2024 data into the analysis shows that models must adapt to unexpected perturbations in the data.
It is possible to conclude that the pandemic has decreased the number of traffic accidents based on the gathered data. Before stabilization, there should be an even greater drop in traffic accidents in the next few years. Moreover, the pandemic may further change the findings’ importance. The calculated forecast errors show how accurate the models are.
Keeping in mind the obtained forecasts, efforts must be made to further reduce the number of traffic incidents. Poland has already implemented these regulations, which would increase the fines for movement offenses on Polish roads, beginning 1 January 2022. The epidemic likely influenced the study’s conclusions because it drastically altered the number of traffic accidents.
In summary, the latest research and data confirm the general trends seen since the early 2000s. However, seasonal effects, crisis events (pandemic), and legislative changes need to be taken into account for the forecasts to be reliable. Integrating statistical methods with machine learning and continuously updating data (CSO, police) will allow for more precise road policy planning and improved road safety.
The authors plan to compute the overall number of traffic accidents by using a range of statistical techniques and taking additional factors impacting accident rates into consideration in a subsequent study. The volume of traffic, the type of weather, and the age of the driver engaged in the crash are a few examples of these.
Although the current study focuses on predicting the number of traffic accidents at the province level, future research should address the spatial dimension of road safety. In particular, identifying “black spots” (i.e., road segments with the highest accident frequency) would enable more targeted and actionable interventions. This would require the inclusion of geo-referenced accident data, which were not available in the present dataset. Future extensions of this work may combine neural network forecasting with geospatial analysis to enhance traffic safety planning.
Compared to previous neural network-based forecasting studies, the present work introduces several improvements. First, it analyzes traffic accident trends over a long time horizon (2001–2021) across all Polish provinces, capturing regional differences and post-pandemic effects. Second, the impact of training–testing–validation splits (70-15-15 vs. 80-10-10) on forecast accuracy is explicitly tested, which is rarely addressed in the literature. Third, the use of multiple MLP architectures with error-driven model selection (based on MAPE, MAE, etc.) ensures that the best-performing model is chosen for each province. Lastly, predictions are validated with the newest available data (2022–2024), providing robust insight into the model’s generalization capabilities. Together, these features enhance both the scientific and practical value of the approach.
One limitation of this study is its geographic scope, as it focuses exclusively on Polish provinces. While this ensures homogeneity of data and legal context, it limits the ability to compare the results internationally. Future research should aim to incorporate international case studies—especially from countries with comparable traffic conditions and publicly available data. Applying the same neural network approach to multiple countries would enable a robust comparison of model performance and accident trends in different road safety environments.
The methodology proposed in this study is transferable and scalable to other countries or larger regions, provided that relevant data are available. This is confirmed by other studies by the authors on this subject. To replicate the forecasting model, the following steps are recommended:
  • Collect historical road accident data by region for a minimum of 10 consecutive years.
  • Preprocess the data to ensure completeness and consistency.
  • Adapt the neural network architecture to match the data scope (e.g., number of input neurons = number of years).
  • Train multiple MLP models with varying hidden layer sizes and activation functions.
  • Validate the model using a holdout dataset or cross-validation and select the best-performing version based on MAPE or MAE.

Author Contributions

Conceptualization, P.G., J.Z. and E.S.; methodology, P.G., J.Z. and E.S.; software, P.G., J.Z. and E.S.; validation, P.G., J.Z. and E.S.; formal analysis, P.G., J.Z. and E.S.; investigation, P.G., J.Z. and E.S.; resources, P.G., J.Z. and E.S.; data curation, P.G., J.Z. and E.S.; writing—original draft preparation, P.G., J.Z. and E.S.; writing—review and editing, P.G., J.Z. and E.S.; visualization, P.G., J.Z. and E.S.; supervision, P.G., J.Z. and E.S.; project administration, P.G., J.Z. and E.S.; funding acquisition, E.S. 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 original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. WHO. The Global Status on Road Safety 2018; WHO: Geneva, Switzerland, 2018; 403p, ISBN 9789241565684. Available online: https://iris.who.int/bitstream/handle/10665/276462/9789241565684-eng.pdf?sequence=1 (accessed on 17 April 2022).
  2. Žuraulis, V.; Sokolovskij, E. Vehicle velocity relation to slipping trajectory change: An option for traffic accident reconstruction. Promet—Traffic Transp. 2018, 30, 395–406. [Google Scholar] [CrossRef]
  3. Stepanović, N.; Tubić, V.; Milenković, M.; Halaj, K. The impact of basic traffic flow characteristics on traffic accident occurrence on 2-lane rural roads in Serbia. Transport 2025, 40, 64–73. [Google Scholar] [CrossRef]
  4. Pečeliūnas, R.; Žuraulis, V.; Droździel, P.; Pukalskas, S. Prediction of road accident risk for vehicle fleet based on statistically processed tire wear model. Promet—Traffic Transp. 2022, 34, 619–630. [Google Scholar] [CrossRef]
  5. Lyashuk, O.; Mironov, D.; Martyniuk, V.; Aulin, V.; Tson, O.; Maruschak, P. Risk analysis of road traffic accidents in Ukraine. Transport 2024, 39, 350–359. [Google Scholar] [CrossRef]
  6. Gorzelańczyk, P.; Sokolovskij, E. Using neural networks to forecast the amount of traffic accidents in Poland and Lithuania. Sustainability 2025, 17, 1846. [Google Scholar] [CrossRef]
  7. Helgason, A. Fractional integration methods and short Time series: Evidence from asimulation study. Polit. Anal. 2016, 24, 59–68. [Google Scholar] [CrossRef]
  8. Forecasting Based on Time Series. 2022. Available online: http://pis.rezolwenta.eu.org/Materialy/PiS-W-5.pdf (accessed on 17 April 2022).
  9. Procházka, J.; Flimmel, S.; Čamaj, M.; Bašta, M. Modelling the Number of Road Accidents. In Applications of Mathematics and Statistics in Economics. International Scientific Conference, Szklarska Poręba, 30 August–3 September 2017; Publishing House of the University of Economics in Wrocław: Wrocław, Poland, 2017. [Google Scholar] [CrossRef]
  10. Sunny, C.M.; Nithya, S.; Sinshi, K.S.; Vinodini, V.M.D.; Lakshmi, A.K.G.; Anjana, S.; Manojkumar, T.K. Forecasting of Road Accident in Kerala: A Case Study. In Proceedings of the 2018 International Conference on Data Science and Engineering (ICDSE), Kochi, India, 7–9 August 2018. [Google Scholar] [CrossRef]
  11. Dudek, G. Forecasting Time Series with Multiple Seasonal Cycles Using Neural Networks with Local Learning. In Artificial Intelligence and Soft Computing ICAISC 2013; Lecture Notes in Computer Science; Rutkowski, L., Korytkowski, M., Scherer, R., Tadeusiewicz, R., Zadeh, L.A., Zurada, J.M., Eds.; Springer: Berlin/Heidelberg, Germany, 2013; p. 7894. [Google Scholar] [CrossRef]
  12. Szmuksta-Zawadzka, M.; Zawadzki, J. Forecasting on the Basis of Holt-Winters Models for Complete and Incomplete Data. Research Papers of the Wrocław University of Economics 2009, No. 38. Available online: http://bazekon.icm.edu.pl/bazekon/element/bwmeta1.element.ekon-element-000164937729 (accessed on 17 April 2022).
  13. Lavrenz, S.; Vlahogianni, E.; Gkritza, K.; Ke, Y. Time series modeling in traffic safety research. Accid. Anal. Prev. 2018, 117, 368–380. [Google Scholar] [CrossRef] [PubMed]
  14. Al-Madani, H. Global road fatality trends’estimations based on country-wise microlevel data. Accid. Anal. Prev. 2018, 111, 297–310. [Google Scholar] [CrossRef] [PubMed]
  15. Chudy-Laskowska, K.; Pisula, T. Prognozowanie liczby wypadków drogowych na Podkarpaciu. Logistics 2015, 4, 2782–2796. [Google Scholar]
  16. Gorzelanczyk, P. Application of neural networks to forecast the number of road accidents in provinces in Poland. Heliyon 2023, 9, e12767. [Google Scholar] [CrossRef] [PubMed]
  17. Jurkovic, M.; Gorzelanczyk, P.; Kalina, T.; Jaros, J.; Mohanty, M. Impact of the COVID-19 pandemic on road traffic accident forecasting in Poland and Slovakia. Open Eng. 2022, 12, 578–589. [Google Scholar] [CrossRef]
  18. Central Statistical Office. Available online: www.gus.pl (accessed on 17 April 2022).
  19. Province Names in English. Available online: https://polandtravel.agency/regions-of-poland/ (accessed on 17 April 2022).
  20. Statistic Road Accident. Available online: https://statystyka.policja.pl/ (accessed on 17 April 2022).
  21. Lake, B.M.; Ullman, T.D.; Tenenbaum, J.B.; Gershman, S.J. Building machines that learn and think like people. Behav. Brain Sci. 2017, 40, e253. [Google Scholar] [CrossRef] [PubMed]
  22. Becoming Human. How Netflix Uses AI, Data Science, and Machine Learning—From a Product Perspective. Available online: www.becominghuman.ai (accessed on 10 August 2019).
  23. Forbes. The Amazing Ways eBay Is Using Artificial Intelligence to Boost Business Success. Available online: www.forbes.com (accessed on 12 September 2020).
  24. Wu, Y.; Schuster, M.; Chen, Z.; Le, Q.V.; Norouzi, M.; Macherey, W.; Krikun, M.; Cao, Y.; Gao, Q.; Macherey, K.; et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv 2020, arXiv:1609.08144. [Google Scholar]
  25. Oronowicz-Jaśkowiak, W. The application of neural networks in the work of forensic experts in child abuse cases. Adv. Psychiatry Neurol. 2019, 28, 273–282. [Google Scholar] [CrossRef]
  26. Wójcik, A. Autoregressive Vector Models as a Response to the Critique of Multi-Equation Structural Econometric Models; Publishing House of the University of Economics in Katowice: Katowice, Poland, 2014; Volume 193. [Google Scholar]
  27. Baron, B.; Pasierbek, A. Comparison of the performance of coupled gradient and quasi-Newtonian BFGS algorithms in the problem of optimizing power distribution in a power system. Electrics 2009, 3, 211. [Google Scholar]
  28. Gorzelańczyk, P. Change in the Mobility of Polish Residents during the COVID-19 Pandemic. Commun.-Sci. Lett. Univ. Zilina 2022, 24, A100–A111. [Google Scholar] [CrossRef]
Figure 4. Neural network models [26].
Figure 4. Neural network models [26].
Applsci 15 09108 g004
Figure 5. Average number of traffic accidents by province from 2001 to 2021.
Figure 5. Average number of traffic accidents by province from 2001 to 2021.
Applsci 15 09108 g005
Figure 6. Projected number of road accidents in 2022–2040 for the 70-15-15 study group.
Figure 6. Projected number of road accidents in 2022–2040 for the 70-15-15 study group.
Applsci 15 09108 g006
Figure 7. Projected number of road accidents in 2022–2040 for the 80-10-10 study group.
Figure 7. Projected number of road accidents in 2022–2040 for the 80-10-10 study group.
Applsci 15 09108 g007
Table 3. Summary of neural network learning for the case of random sample sizes: teaching 70%, testing 15% and validation 15%.
Table 3. Summary of neural network learning for the case of random sample sizes: teaching 70%, testing 15% and validation 15%.
ProvinceNetwork NumberNetwork NameLearning AlgorithmActivation (Hidden)Activation (Output)Errors
MEMAEMPEMAPESSE
Lower Silesia20MLP 10-3-1BFGS 8ExponentialLinear22.06105.580.23%4.48%199.39
Kuyavia–Pomerania200MLP 10-2-1BFGS 4TanhTanh6.3964.200.19%5.83%79.33
Lublin Province20MLP 10-6-1BFGS 4TanhTanh15.7163.210.95%4.81%78.17
Lubusz Province60MLP 10-6-1BFGS 5TanhLogistics1.7029.540.18%4.69%38.85
Łodz Province80MLP 10-2-1BFGS 11LogisticsTanh72.07134.712.92%4.54%190.24
Lesser Poland40MLP 10-7-1BFGS 33LogisticsExponential115.52138.824.51%5.15%276.59
Masovia40MLP 10-3-1BFGS 6ExponentialLinear72.14186.352.43%5.21%248.13
Opole Province40MLP 10-6-1BFGS 10LinearLinear3.5845.731.69%7.28%60.00
Subcarpathia80MLP 10-8-1BFGS 14ExponentialTanh24.55363.962.23%20.76%674.90
Podlaskie Province40MLP 10-6-1BFGS 19LogisticsTanh8.4931.522.81%6.16%47.92
Pomerania20MLP 10-4-1BFGS 21LogisticsTanh40.8470.602.29%3.47%139.26
Silesia60MLP 10-4-1BFGS 7LogisticsLinear29.29122.230.24%3.24%152.45
Holy Cross100MLP 10-8-1BFGS 7LogisticsTanh17.0248.832.18%4.55%61.91
Warmia-Masuria200MLP 10-6-1BFGS 9LogisticsTanh0.5236.850.18%3.10%52.19
Greater Poland60MLP 10-4-1BFGS 1ExponentialExponential9.98392.953.07%14.06%477.32
West Pomerania100MLP 10-2-1BFGS 7LogisticsLinear15.1359.731.87%5.09%70.69
Average28.44118.431.75%6.40%177.96
Table 4. Summary of neural network learning for the case of random sample sizes: teaching 80%, testing 10% and validation 10%.
Table 4. Summary of neural network learning for the case of random sample sizes: teaching 80%, testing 10% and validation 10%.
ProvinceNetwork NumberNetwork NameLearning AlgorithmActivation (Hidden)Activation (Output)Errors
MEMAEMPEMAPESSE
Lower Silesia200MLP 10-2-1BFGS 0LinearExponential29.6597.510.02%4.10%207.57
Kuyavia–Pomerania100MLP 10-6-1BFGS 13LogisticsLinear2.2528.070.06%2.82%34.20
Lublin Province20MLP 10-4-1BFGS 10TanhLogistics2.7271.710.50%5.81%80.54
Lubusz Province60MLP 10-8-1BFGS 24TanhExponential0.4710.550.00%1.65%12.90
Łodz Province40MLP 10-2-1BFGS 5TanhLogistics43.99197.340.06%5.94%272.65
Lesser Poland20MLP 10-2-1BFGS 5LogisticsLogistics94.48467.440.87%15.28%540.21
Masovia80MLP 10-8-1BFGS 3TanhLinear25.07202.751.54%5.56%261.11
Opole Province100MLP 10-6-1BFGS 18TanhLinear6.1924.531.63%4.08%37.95
Subcarpathia80MLP 10-2-1BFGS 4LogisticsLinear5.06114.151.68%7.69%141.80
Podlaskie Province20MLP 10-4-1BFGS 16LinearLinear1.5130.690.86%5.47%42.34
Pomerania60MLP 10-3-1BFGS 7LogisticsTanh5.3887.260.57%3.97%123.00
Silesia200MLP 10-4-1BFGS 46LogisticsExponential17.8541.760.82%1.56%64.00
Holy Cross80MLP 10-4-1BFGS 14TanhExponential4.9526.670.26%2.19%33.00
Warmia-Masuria80MLP 10-4-1BFGS 20TanhExponential0.607.580.10%0.56%10.00
Greater Poland40MLP 10-8-1BFGS 19TanhExponential8.16131.720.17%5.01%181.00
West Pomerania100MLP 10-5-1BFGS 3ExponentialExponential7.2187.720.93%7.55%114.22
Average:15.97101.720.63%4.95%134.81
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

Gorzelańczyk, P.; Zabel, J.; Sokolovskij, E. Using Neural Networks to Predict the Frequency of Traffic Accidents by Province in Poland. Appl. Sci. 2025, 15, 9108. https://doi.org/10.3390/app15169108

AMA Style

Gorzelańczyk P, Zabel J, Sokolovskij E. Using Neural Networks to Predict the Frequency of Traffic Accidents by Province in Poland. Applied Sciences. 2025; 15(16):9108. https://doi.org/10.3390/app15169108

Chicago/Turabian Style

Gorzelańczyk, Piotr, Jacek Zabel, and Edgar Sokolovskij. 2025. "Using Neural Networks to Predict the Frequency of Traffic Accidents by Province in Poland" Applied Sciences 15, no. 16: 9108. https://doi.org/10.3390/app15169108

APA Style

Gorzelańczyk, P., Zabel, J., & Sokolovskij, E. (2025). Using Neural Networks to Predict the Frequency of Traffic Accidents by Province in Poland. Applied Sciences, 15(16), 9108. https://doi.org/10.3390/app15169108

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

Article Metrics

Article metric data becomes available approximately 24 hours after publication online.
Back to TopTop