Open-access OPTIMIZING ROAD SAFETY THROUGH A MULTI-TASK ENSEMBLE MODEL UTILIZING GENETIC ALGORITHM AND FEATURE SELECTION

ABSTRACT

This paper introduces MTES-GA-DFS, a multi-task ensemble framework for road safety prediction. The proposed approach jointly predicts three key outcomes-accident severity, time of day, and accident hotspot-providing a unified view of road safety dynamics. Multiple heterogeneous base models are trained in parallel and combined through a stacking strategy using a multi-task meta-model. The stacking process is optimized via a genetic algorithm to select effective model combinations. In addition, a dynamic feature selection method is proposed to identify task- and model-specific relevant features, reducing dimensionality while preserving predictive performance. The proposed framework facilitates proactive interventions, supports efficient resource allocation, and enables informed decision-making for accident prevention. The framework is evaluated on the US Accidents dataset (2016-2023). Experimental results show an F1-score improvement of 22.56% and a reduction in false alarms of 47.24% compared to baseline approaches, demonstrating the effectiveness of the proposed method for accurate and robust road safety prediction.

Keywords:
road safety; prediction; multi-task ensemble model; dynamic feature selection; genetic algorithm; stacking; traffic accidents

1 INTRODUCTION

Road safety is a paramount societal issue, necessitating the development of advanced methodologies to enhance predictive capabilities and facilitate proactive measures 18); (15); (28. Despite the wealth of research and models dedicated to this issue, a majority of them yield unimodal outputs 37); (11); (26. However, there is an emerging need for multi-output models in road safety. Such models are indispensable in practice for mitigating accidents and enhancing safety measures. To address this gap, this paper proposes an innovative approach that amplifies road safety predictions using a multi-task ensemble model, referred to as MTES-GA-DFS. This model simultaneously considers three pivotal factors: ’severity’, ’time of day’, and ’accident hotspot’. These elements provide a more comprehensive framework for understanding accident dynamics. The practicality of our approach is rooted in the application of multi-task ensemble learning 32. This approach enables the training of several base models simultaneously, each focusing on a different aspect of road safety.

In the next step, we exploit the predictions from these diverse base models using stacking, a well-established method primarily aimed at reducing the generalization error of the final output 36. Stacking involves training a new model, known as a meta-model, on the predictions of the base models. This meta-model can capture patterns and relationships that the base models might miss, thereby further improving the accuracy of our predictions. Predicting these three factors simulta-neously rather than separately allows for a more holistic understanding of road safety dynamics. It enables the capture of complex interdependencies between these factors, thereby providing a more accurate and comprehensive prediction. This approach not only enhances the effectiveness of accident prevention measures but also makes the final model more practical and adaptable to real-world scenarios, thereby contributing to overall public safety 33); (5. In addition to ensemble learning and optimization, we propose a dynamic feature selection method, D-GSFE. This method is customized for each prediction task and each base model, adding flexibility to our approach. This adaptive feature selection ensures that the ensemble focuses on the most relevant variables, thereby enhancing the practical utility of our methodology for real-world scenarios.

Our approach is both comprehensive and practical, providing decision-makers with the essential tools they need for proactive measures, optimal resource distribution, and informed decision-making. This significantly enhances the effectiveness of accident prevention 29. We plan to carry out thorough experiments using the extensive US Accidents dataset, which covers the period from 2016 to 2023 19); (20. This will serve as a solid validation of the practical effectiveness and dependability of our method. The goal of our research is to establish a data-driven model for road safety, pushing forward strategies for practical accident prevention and mitigation. The remainder of this paper is organized as follows: Section 2 reviews related approaches with a focus on machine learning (ML) methods, particularly those relevant to road safety. In Section 3, we detail our proposed multi-task ensemble model, emphasizing its optimization through stacking, genetic algorithm, and dynamic feature selection. Section 4 summarizes the experimental study and compares results with state-of-the-art methods. Finally, Section 5 concludes the paper and outlines potential future perspectives.

2 LITERATURE REVIEW

Recent advancements in ML have significantly improved predictive modeling in the domain of road safety. Most studies in this area focus on predicting single-output variables, such as accident severity, using ensemble or deep learning techniques 9); (35. While these models have shown promising results, they often fail to capture the multifaceted nature of road accidents, where multiple factors interact simultaneously.

Table 1 summarizes a set of key recent contributions to the field. These studies commonly apply ML algorithms for accident severity prediction and offer various insights, ranging from feature importance to algorithmic performance.

Table 1
Summary of Recent Studies on Road Accident Prediction.

From the literature, it is evident that most approaches focus on predicting a single dimension of traffic incidents-such as occurrence or severity-often using ensemble learning models. While these methods achieve high accuracy, they tend to overlook the multi-dimensional nature of road safety, which is influenced by temporal patterns and spatial clustering. Only a limited number of studies explore multi-task learning to jointly predict severity, timing, and location-related risks. Moreover, the high computational cost and limited interpretability of ensemble techniques remain challenges, particularly in settings with constrained resources or limited data availability. There is a clear gap in research on interpretable, lightweight, and multi-output predictive models that can simultaneously support prevention strategies, resource allocation, and emergency planning.

The proposed method addresses these limitations by implementing a multi-task ensemble learning framework optimized with a genetic algorithm. It enables the simultaneous prediction of accident severity, time of occurrence, and accident hotspots. Through dynamic feature selection and model optimization, the approach improves predictive performance, enhances practical applicability, and contributes to a reduction in false alarms.

3 OPTIMIZED MULTI-TASK ENSEMBLE MODEL FOR ENHANCED ROAD SAFETY

In this section, we present our optimized multi-task ensemble model, which is specifically designed to enhance road safety. We start with a brief overview of its structure, highlighting the key components. Following that, we delve into the algorithms associated with the model. Lastly, we explain how our approach effectively addresses the limitations of existing methods in accident prevention and reduction.

The steps to build our Optimized Multi-task Ensemble Model are illustrated in Figure 1.

Figure 1
Step-by-Step Illustration of the Development of Our Optimized Multi-Task Ensemble Model for Road Safety Improvements.

3.1 Data Preparation

3.1.1 Data Source

The data for this study comes from the US Accidents dataset (2016 - 2023). This comprehensive dataset contains 7.7 million accident records across 49 US states 19); (20. It includes 46 variables that provide detailed information about each accident, such as location, time, and weather conditions. These variables form the foundation of our analysis, allowing us to identify patterns, high-risk areas, and assess accident severity.

3.1.2 Target Variable Separation

In our study, we concentrate on three target variables: ’severity,’ ’time of day,’ and ’accident hotspot.’ These variables are particularly interesting as they offer critical insights into the accident data.

  • - Severity: This variable measures the impact of an accident. It is used directly in the model as it provides a direct measure of the accident’s disruption level.

  • - Time of day: This variable records the time when an accident occurred. It is processed into eight categories: Early Morning, Morning, Late Morning, Early Afternoon, Afternoon, Evening, Night, and Late Night. This categorization helps us identify patterns and peak accident times more effectively.

  • - Accident hotspot: This variable identifies locations with a high frequency of accidents. It is derived by calculating the mean number of accidents for each location. Locations with a number of accidents above this mean are considered as hotspots. This information can aid in preventive measures by identifying areas that require more attention in terms of road safety.

The remaining variables in the dataset serve as explanatory variables that provide additional context and details about each accident. By separating our target variables, we can tailor our analysis and modeling efforts to predict and understand these specific aspects of traffic accidents.

3.1.3 Data Separation

The data is divided into a training set (75%) and a test set (25%). This division allows for the evaluation of the multi-task model once it has been constructed. The training set is further partitioned, with 50% used for training base models and the remaining 50% serving as a validation set during the stacking phase. All model selection and hyperparameter tuning are performed exclusively within the training portion, ensuring that the test set remains completely untouched until the final evaluation. While we did not perform full k-fold cross-validation due to the high computational cost of multi-task GA optimization, the use of an entirely independent validation set for stacking and a final held-out test set mitigates the risk of overfitting to any specific split structure.

3.1.4 Preprocessing Steps for the Training Dataset

In the context of ML development, data preprocessing stands as a crucial phase in the workflow 13. This phase encompasses a series of steps, each of which is specifically applied to the training dataset. This ensures that the data is appropriately prepared and optimized for the subsequent stages of the ML process.

  • - Cleaning: This initial step is concerned with addressing missing values. We handle missing values in the training set using decision trees, a method known for its effectiveness with categorical data 21.

  • - Data Encoding: The next step involves encoding categorical variables in the training set. We employ target encoding for this purpose, a technique that replaces each unique category with the calculated class distribution of the target variable 8. This method is particularly efficient for high cardinality features and prevents an increase in dimensionality, unlike one-hot encoding.

  • - Normalization: After the encoding process, we normalize the data in the training set using Standardization 30 (also known as Z-score Normalization). This technique adjusts the values to a common scale by removing the mean and scaling to unit variance. It’s a robust choice that works well for most algorithms, ensuring all features are on a common scale and demonstrating less sensitivity to outliers.

These preprocessing steps are crucial to guarantee the quality of the data in the training set and to prepare it for subsequent analysis. The transformations learned from the training set will then be directly applied to the test and validation sets.

3.2 Dynamic Greedy Sequential Feature Elimination Method

This section introduces a novel approach to dynamic feature selection, termed the Dynamic Greedy Sequential Feature Elimination (D-GSFE) 25. The D-GSFE method dynamically selects a subset of features for each prediction task. It operates by iteratively comparing the feature set with a sequentially generated noisy copy, also known as a shadow feature, thereby eliminating features that are deemed insignificant. The risk of introducing new direct correlations with the dependent variable is minimized.

3.2.1 Overview of the D-GSFE Method and Its Core Components

The D-GSFE method is designed to systematically eliminate unimportant features at each iteration for the current prediction task. It assesses the importance of features sequentially by comparing their contributions to a new random variable, a process based on mutual information 40. This allows the method to measure complex relationships, including linear and non-linear correlations, dependencies, and causal relationships with the target variable. The key components of the D-GSFE method are outlined in Table 2.

Table 2
An Overview of the Essential Elements in the D-GSFE Method for Feature Selection.

3.2.2 Fine-Tuning the Coefficients of Feature Importance

The role of feature importance in ML is crucial, as it determines the significance of each feature in making predictions. Global importance measures the overall impact of features on the model’s training, while local importance investigates their distinct contributions to the current prediction task 17. Feature importance can be computed based on local importance values. This method offers an in-depth understanding of the contribution of each feature to the predictive performance of the model. The formula employed for this computation is as follows:

G ( x ) = 1 n j = 1 n | g ( x j ) | (1)

In this equation, G(x) represents the importance of feature x across all predictions (n instances), where g is the local function that calculates the local importance g(x j ), and j is the prediction index.

The importance of features depends on the specific model and training data. The formula G(x) accumulates local contributions for each prediction, regardless of the model’s accuracy. This could introduce bias in assigning feature weights, selecting noisy or less relevant features, and thus distorting the model. Therefore, refining feature importance is essential for enhancing the learning model and its interpretability. In a classification scenario, the indicator function is defined as follows:

χ A ( x j ) = 1 if x j A , 0 otherwise . (2)

Where A represents a set of correct predictions. Consequently, the updated formula for feature importance based on local contributions is given by:

G ^ ( x ) = G ( x ) · χ A ( x j ) (3)

To fine-tune the coefficients of feature importance, these will be utilized to develop our new feature selection method, as detailed in Algorithm 1.

Algorithm 1
Exploring the Dynamic Greedy Sequential Feature Elimination (D-GSFE) Method

The mutual information measure evaluates the dependency between each original feature and its shadow, capturing both linear and non-linear relationships. In the D-GSFE method, Z threshold is determined dynamically at each iteration from the refined importance of the corresponding shadow feature, rather than set to a fixed arbitrary value. This adaptive criterion removes a feature only if it performs consistently worse than a randomized equivalent under identical conditions. The refinement step (Eq. 3), which combines global and local contributions weighted by correct predictions, further reduces the risk of discarding weak but relevant features or retaining irrelevant ones. This design improves statistical robustness and lowers susceptibility to overfitting during feature elimination.

While Eq. 3 conditions the refined importance on correct predictions, potentially favoring already well-utilized features, the iterative shadow-feature comparison ensures that all features are repeatedly re-evaluated under identical conditions. This repeated testing prevents early underutilization from permanently suppressing informative variables, and the adaptive Z threshold mitigates the reinforcement of bias by requiring consistent underperformance before elimination.

3.3 Simultaneous Training of Individual Base Models

To improve prediction accuracy and interpretability for the tasks of severity, time of day, and accident hotspot, we adopt a multi-model strategy guided by the D-GSFE method.

D-GSFE dynamically constructs task-specific feature subsets by analyzing feature relevance over time. Each subset is tailored to its respective prediction target and is used to fine-tune a dedicated base model. This ensures that each model focuses on patterns most relevant to its task, improving precision, reducing noise, and enhancing interpretability. The training process is independent for each base model-meaning model parameters are not shared-but is executed in parallel to improve computational efficiency. All models use the same original dataset as input, but operate on different feature subsets determined by D-GSFE. This approach combines the benefits of task specialization with parallel computation, while maintaining clear separation of learned parameters.

Base model architectures are selected through empirical evaluation across multiple ML algorithms, ensuring each task is paired with the most effective predictive model. The combination of D-GSFE-based feature selection and parallel, task-specific training provides a scalable and effective solution for multi-target accident prediction.

3.4 Predicting Tasks Using Trained Base Models

In the stacking ensemble framework, we first use the trained base models to predict severity, time of day, and accident hotspot on a validation set. This validation set, comprising 50% of the dataset (denoted as P instances), is entirely separate from the data used during training. Using this unseen data prevents data leakage and ensures a realistic evaluation of model performance.

The predictions generated by the base models on the validation set are concatenated into a matrix of size (P instances, 9 task predictions), representing the meta-features for the stacking layer 7. These meta-features are then used to train a higher-level model, known as the meta-model, which learns to optimally combine base model outputs. This setup allows the meta-model to generalize effectively, as it is trained on data independent of the base model training. It also reduces the risk of overfitting and lays a solid foundation for improving ensemble performance.

3.5 Metaset Split: Meta Train Set and Meta Test Set

As we progress with our approach, we divide the meta-features into two main parts: the Meta Train Set, which includes 75% of the predictions (K instances), and the Meta Test Set, which comprises the remaining 25% (P-K instances) 24. This separation is performed after the base-model stage, ensuring that the meta-model is trained and evaluated on data not seen by the base models, thereby reducing the chance of performance inflation. Although a fixed split is used, this layered data separation mimics the benefits of cross-validation by maintaining multiple levels of independence between training and evaluation data.

  • - Meta Train Set: The Meta Train Set forms the dataset set aside for the genetic algorithm optimization process. This set plays a crucial role in training a new ML model using the stacking technique. The genetic algorithm iterates and fine-tunes solutions based on this subset, enhancing the overall predictive capabilities of our approach.

  • - Meta Test Set: The Meta Test Set is used for evaluation and fitness calculation. This set is employed to assess the performance of each individual solution generated by the genetic algorithm. Evaluating against the Meta Test Set offers insights into the robustness and generalization capabilities of the optimized model, guiding the algorithm towards solutions that exhibit superior predictive accuracy across various scenarios.

3.6 Optimizing Stacking Ensemble Models Using Genetic Algorithm

This section delves into the details of optimizing Stacking Ensemble Models using Genetic Algorithm (GA). The GA method boosts ensemble models by iteratively exploring a variety of combinations within the meta-training set 27. It trains multiple ensemble models through stacking and aggregates predictions from base models. The effectiveness of each solution is then evaluated on the meta-test set.

Our primary objective is to increase predictive accuracy by minimizing false alarms. We aim to achieve this by carefully selecting, combining, and fine-tuning components within the ensemble. This systematic optimization process unfolds step by step, intelligently navigating the model landscape, as outlined in Algorithm 2. The result is a finely tuned ensemble model, meticulously chosen to ensure superior performance and efficiency in predictive tasks.

Algorithm 2
Utilizing Genetic Algorithm for the Optimization of Stacking Ensemble Models.

3.6.1 Encoding the Solution

When optimizing the construction of stacking ensemble models using the Genetic Algorithm, we rely on the decision variable y k , as defined in Equation (4).

y k = 1 if the k -th instance belongs to sub-training set A, 0 otherwise. (4)

This variable signifies the usage state of the base model predictions in the meta-training subsets. Here, k denotes the instance index, and A is the training subset assigned for building the meta model for each individual solution.

3.6.2 Initializing the Population

Our strategy for constructing an optimal model ensemble merges random selection with strategic planning 6, based on the previously introduced binary indicator. We kick-start a diverse population of solutions, each with a unique probability of random initialization. This element of randomness injects variability into the population, reducing similarity between solutions and encouraging a thorough exploration of the optimization landscape. This equilibrium between exploration and exploitation influences the diversity of solutions and the pace of discovering the optimal solution.

3.6.3 Selection Operator

To generate a new population with improved characteristics, we utilize the roulette wheel selection method with replacement 16. This method is chosen for its natural and adaptable approach in consistently selecting pairs of individuals for reproduction. The roulette wheel selection method simulates the idea of survival of the fittest in natural selection by giving individuals with superior traits a higher chance of being selected. This contributes to the overall improvement of solutions and facilitates convergence towards the global optimum. The selection process involves creating a roulette wheel, where each individual takes up a space proportional to its fitness. Individuals are then selected randomly, with those occupying larger spaces (i.e., those with higher fitness) having a higher probability of being chosen. This ensures a diverse yet targeted approach to offspring generation.

3.6.4 Crossover Operator

The crossover operator plays a crucial role in traversing different search spaces and fostering the generation of innovative solutions. To make this process more akin to natural processes and adaptable to varying conditions, we adopt a multi-point crossover method 31. This method is favored due to its capacity to emulate biological reproduction more closely and augment the diversity within the population.

In the multi-point crossover approach, we randomly select multiple pivot points, effectively dividing the parent solutions into several segments. These segments are then interchanged between the parents, resulting in the creation of offspring solutions. This method facilitates a more intricate blending of parental features, thereby contributing to the diversification and evolution of the population. As a result of this process, we generate multiple offspring solutions, each embodying a unique blend of traits inherited from their parents. This approach, with its randomness in selecting pivot points, adds an additional layer of adaptability and naturalness to the process.

3.6.5 Mutation Operator

To prevent premature convergence to local optima, we apply a mutation operator. Specifically, the bit-flip mutation acts on the binary decision variables y k defined in Equation (4), switching an instance between inclusion (y k = 1) and exclusion (y k = 0) from the sub-training set A. We mutate a small percentage of instances (1%-3%), a range commonly used in the literature 4, regardless of patterns in the offspring produced by crossover. This range balances exploration of new solutions and exploitation of existing ones, promoting diverse meta-models and enhancing robustness.

3.6.6 Fitness Evaluation

In the context of genetic algorithm optimization, the fitness function plays a pivotal role. It measures the quality of a solution within the problem domain, guiding the genetic algorithm towards the most optimal solutions. In this scenario, each individual solution in the population is used to train a multi-task meta model that is specifically tailored for that individual solution. These models are then put to the test based on the meta test set. The quality of these models is evaluated using the fitness function.

In the accompanying table, T P i,j , FP i,j , TN i,j , and FN i,j represent the True Positives, False Positives, True Negatives, and False Negatives, respectively, for class i in output j.

Table 3
Exploring the Potential Outcomes of Multi-Output Classification.

Our objective function is the false alarm rate (FAR), which measures instances misclassified by the ensemble model built upon the candidate solution. The FAR encapsulates both False Positive Rate (FPR) and False Negative Rate (FNR) within a single metric, serving as a mono-objective function. This approach simplifies the optimization process, aiming to find a solution that minimizes overall misclassification errors across all tasks simultaneously.

FAR = 1 3 C j = 1 3 i = 1 C FPR i , j + FNR i , j , (5)

Here, C is the total number of classes, and FPR and FNR are defined as:

FPR i , j = F P i , j F P i , j + T N i , j ; FNR i , j = F N i , j F N i , j + T P i , j , (6)

for i ∈ {1, 2, . . . ,C} and j ∈ {1, 2, 3}.

The choice of FAR as the objective function is motivated by its ability to simultaneously account for both false positives and false negatives, which is crucial in road safety applications. In this context, a false positive represents a false alarm that may trigger unnecessary emergency responses, while a false negative corresponds to a missed severe accident, which could have serious consequences. By minimizing FAR, the model balances these two types of errors, improving overall reliability and safety. This approach is particularly valuable in multi-task learning, where tasks such as predicting severity, time of day, and accident hotspots are interdependent. FAR provides a unified measure that captures the trade-offs between tasks and ensures the model can leverage shared information to deliver robust and actionable predictions across all targets.

3.6.7 Replacement Operator

The replacement operator in the Genetic Algorithm selects individuals for the next generation. Our strategy combines both elitism 2 and tournament selection 14 methods. Elitism ensures the direct survival of the fittest individuals, or ’elites’, into the next generation. The quantity of elites will be determined during the experiment. To fill the rest of the population, we use tournament selection. This method involves hosting a tournament among a randomly chosen subset of the population. The fittest individual from each tournament is selected until the population is filled. By combining the elites and the tournament-selected individuals, we form the new generation.

3.7 Building the Optimized Multi-Task Ensemble Model

The Genetic Algorithm search culminates with the identification of the optimal ensemble model configuration that minimizes the FAR rate across the three tasks and classes. The ensemble model is subsequently trained, drawing from the output of the base models. A particular model is selected as the meta-learner, chosen for its simplicity and efficiency. This model operates at a higher level, making final predictions based on the outputs of the base models. This strategy enables the ensemble model to harness the diversity of the base models, thereby boosting overall performance. The multi-output capability of the ensemble model is essential for the concurrent prediction of the three tasks.

The optimized multi-task ensemble model is anticipated to surpass the performance of any individual model, owing to the collective strengths of the base models within the ensemble 41. These base models will be delineated during the experiment. The optimization process guarantees that the ensemble model attains optimal performance across all tasks and classes. Algorithm 3 outlines the comprehensive algorithm employed to construct the proposed optimized multi-task ensemble model.

Algorithm 3
Introducing MTES-GA-DFS: Multi-Task Ensemble with Dynamic Feature Selection and Genetic Algorithm Optimization.

3.8 Computational Complexity and Validation Robustness

Let n be the number of samples, m the number of original features, k the D-GSFE iterations, T = 3 the number of tasks, M = 3 the number of base model types per task, F = 9 the number of meta-features (predictions from all base models), P the GA population size, and G the number of generations. The main computational costs are:

  • D-GSFE: O(T · M · k · n · m).

  • Base model training: O(T · M · C b (m′, n)), where m′ ≤ m and C b is the cost of training a given base learner.

  • Prediction generation: O(T · M · n · m′) to produce the F = 9 meta-features.

  • Genetic Algorithm (multi-output meta-model training): O(P · G · n · F) for repeatedly fitting and evaluating a single multi-output logistic regression meta-model on different sample subsets.

Overall, the complexity is:

O ( T M k n m + T M C b ( m ' , n ) + T M n m ' + P G n F ) ,

dominated by feature selection and GA optimization.

To ensure validation robustness while managing computational cost, we employed a layered fixed-split strategy with strictly disjoint subsets at each stage to prevent any reuse of samples between training and evaluation:

  • 1. The dataset is split into training (75%) and test (25%) sets.

  • 2. The training set is further divided into:

  • Base-model training set: used solely to fit the T ×M base models.

  • Base-model validation set: used exclusively to generate the F meta-features from already trained base models.

  • 3. The GA meta-model is trained only on a meta-train set (derived from meta-features) and evaluated on a meta-test set, both disjoint from the data seen by base models.

This strict multi-level data separation ensures no stage “steals” samples from another, fully preventing information leakage. While we did not perform repeated stratified cross-validation due to the high cost of multi-task GA optimization, this design mitigates overfitting risks and approximates the benefits of cross-validation without excessive computational burden.

3.9 Overcoming Limitations of Existing Methods with MTES-GA-DFS

The proposed Multi-Task Ensemble Model (MTES-GA-DFS) effectively addresses the limitations of existing methods in accident prevention and reduction through several innovative strategies:

  • - Comprehensive Predictions: Unlike traditional models that focus on a single aspect of road safety, MTES-GA-DFS predicts three key factors all at once: how severe an accident could be, what time of day it might happen, and where the accident hotspots are. This gives us a full picture of what’s going on.

  • - Enhanced Accuracy through Stacking: While traditional models use a single base model for prediction, MTES-GA-DFS trains multiple base models concurrently. It then uses a stacking method to combine these models into a multi-task meta-model. This technique boosts prediction accuracy by leveraging the strengths of multiple models.

  • - Optimization with Genetic Algorithm: Finding the best combination of models for stacking can be a complex task. MTES-GA-DFS uses a genetic algorithm to optimize this process. This approach effectively navigates the search space of possible model combinations, leading to improved prediction performance.

  • - Dynamic Feature Selection: Many existing methods use a static set of features for prediction, which may not always be optimal. MTES-GA-DFS introduces a new dynamic feature selection method that identifies the most relevant variables for each prediction task and each base model. This ensures that the model always uses the most informative features, enhancing its predictive power.

  • - Proactive Interventions and Informed Decision-Making: By providing more precise and comprehensive insights into road safety, MTES-GA-DFS facilitates proactive interventions, optimal resource allocation, and informed decision-making. These capabilities significantly contribute to accident prevention efforts.

4 EXPERIMENTAL RESULTS AND DISCUSSION

This section presents the experimental evaluation of our proposed multi-task ensemble learning approach for road safety. We first conduct a comprehensive benchmarking of ten machine learning models 22 to identify the top three base models based on predictive performance. Next, we compare our proposed D-GSFE method with seven state-of-the-art feature selection techniques to assess its effectiveness. Finally, we discuss the results in detail, focusing on both the performance and the adaptability of our approach across multiple road safety tasks.

4.1 Model Configurations and Experimental Setup

This section details the configurations of the machine learning models, the D-GSFE method, and the genetic algorithm used for optimization. In the following table, we provide details about the implementation, including the Python version used and the system configuration.

Table 4
Implementation Details.

We first present the configuration of the machine learning models used in our experiments 23. These include a variety of individual and ensemble models with standard hyperparameter settings drawn from established practices in the literature.

Table 5
Configuration of ML Models.

Next, we detail the feature selection techniques evaluated in our study. These methods were applied in the subsequent phase to identify the most relevant attributes for prediction.

Finally, the genetic algorithm is configured with specific parameters to optimize feature selection and ensemble learning, as summarized in Table 7.

Table 6
Feature Selection Techniques.

Table 7
Genetic Algorithm Parameters.

4.2 Evaluation Metrics

There are numerous metrics available to assess the performance of a multi-task ML model dealing with multiple classes. The following subsection presents the commonly used performance measures for evaluation in a more streamlined and comprehensive manner. These measures provide a robust framework for evaluating and comparing the effectiveness of different models and approaches.

  • - Accuracy:

A c c = j = 1 3 i = 1 C T N i , j + T P i , j j = 1 3 i = 1 C T N i , j + T P i , j + F N i , j + F P i , j , (7)

  • - F1-score:

F 1 = 2 · Precision · Recall Precision + Recall , (8)

where Precision and Recall are defined as:

Precision = j = 1 3 i = 1 C T P i , j j = 1 3 i = 1 C T P i , j + F P i , j , (9)

Recall = j = 1 3 i = 1 C T P i , j j = 1 3 i = 1 C T P i , j + F N i , j , (10)

  • - Specificity:

Specificity = j = 1 3 i = 1 C T N i , j j = 1 3 i = 1 C T N i , j + F P i , j , (11)

for i ∈ {1,2, . . . ,C} and j ∈ {1,2,3}.

  • - False Positive Rate (FPR): As defined in Equation 6.

  • - False Alarm Rate (FAR): As defined in Equation 5.

4.3 Evaluation of State-of-the-Art Predictive Models

At the outset of our research, we evaluate a variety of state-of-the-art ML models to assess their capacity for predicting road accident severity. The specific models tested are detailed in Section 4.1, which outlines the full set of baseline learners and their configurations.

We assess a variety of models, acknowledging that each one brings its own strengths and weaknesses to the table. The effectiveness of these models varies depending on the unique characteristics of the data at hand. Our aim in testing multiple models is to identify the one that provides the best results for our specific task. In line with this, we employ a range of metrics to measure model performance. These metrics include Accuracy, F1-score, Specificity, False Positive Rate (FPR), and False Alarm Rate (FAR). Each metric provides a different perspective on performance, allowing us to gain a comprehensive understanding of each model’s pros and cons. The results of our evaluation are summarized in the following table:

Table 8
Evaluating State-of-the-Art Predictive Models for Severity Prediction.

The results demonstrate that the Random Forest model outperforms all other models in terms of accuracy, achieving 94.50%. It also attains the highest specificity at 96.33%, indicating its strong ability to correctly identify negative instances. In contrast, models such as K-Nearest Neighbors and Logistic Regression perform lower across all metrics compared to the other models.

In the subsequent phase of our research, we are assessing the same set of ML models for their capability to predict the time of day when road safety incidents occur. The evaluation criteria remain consistent with Task 1. The findings from this phase will be outlined in the table below:

Table 9
Evaluating State-of-the-Art Predictive Models for Time of Day Prediction.

The results reveal that the Random Forest model excels with the highest accuracy of 87.51% and the highest F1-score of 50.03%, demonstrating a superior balance between precision and recall. This indicates that the Random Forest model is the most suitable for this specific task. The XGBoost Classifier model also shows commendable performance with an accuracy of 87.23% and an F1-score of 48.90%.

In contrast, the K-Nearest Neighbors model exhibits the lowest performance across all metrics, with an F1-score of 30.61% and an accuracy of 82.65%. This suggests that the K-Nearest Neighbors model may not be as effective for this specific task compared to the other models.

In the third phase of our research, we are assessing the same set of ML models for their capability to predict accident hotspots. The findings from this phase will be outlined in the table below:

The results show that the Random Forest model performs best in predicting accident hotspots, with the highest accuracy of 80.09% and a well-balanced F1-score, indicating a good trade-off between precision and recall. In contrast, models such as SVM and Logistic Regression perform worse across all metrics. Notably, the SVM model has a specificity of 0.00%, which occurs due to the high class imbalance in the dataset: SVM tends to predict the majority class, resulting in almost all negative instances being misclassified. These findings highlight the limitations of certain models for this task and motivate the use of feature selection techniques.

Our evaluation of ML models across three tasks-severity prediction, time of day prediction, and accident hotspot prediction-yields clear findings. For severity prediction, the Bagging Classifier achieves the lowest False Alarm Rate (FAR) of 7.75%, making it the most suitable model. For predicting the time of day, the Bagging Classifier attains the lowest FAR of 34.90%, and for accident hotspot prediction, it achieves the lowest FAR of 24.78%, indicating its consistent performance across tasks.

Table 10
Evaluating State-of-the-Art Predictive Models for Accident Hotspot Prediction.

In the next phase of our study, we are testing the same set of ML models for a multi-task output, where the models are tasked to predict severity, time of day, and accident hotspots simultaneously. The models are being evaluated using the same metrics as in the previous tasks. The results will be presented in the table below:

Table 11
Evaluating the Performance of Multi-Output State-of-the-Art Predictive Models.

Both the Random Forest and XGBoost Classifier models perform well. The Random Forest model achieves the highest accuracy at 89.09%, followed by the XGBoost Classifier at 88.68%. Considering the need to minimize the False Alarm Rate, the Random Forest and XGBoost models have the lowest FARs of 16.28% and 16.88%, respectively.

Conversely, the K-Nearest Neighbors model shows the lowest performance across all metrics with an F1-score of 59.91% and an accuracy of 83.07%. This suggests that the K-Nearest Neighbors model may not be as effective for this particular task compared to the other models. Comparing these results with the evaluations from individual tasks, it’s clear that multi-task learning presents its own set of challenges and may require different strategies for model selection. While some models perform well on individual tasks, their performance can vary when handling multiple outputs simultaneously. These insights underscore the complexity of multi-task learning and emphasize the importance of comprehensive model evaluation. As we progress in our study, these findings will guide us in refining our models and methodologies for multi-task learning in road safety prediction.

4.4 Evaluating the D-GSFE Method: A Comparative Study

In this study, we evaluate the proposed feature selection method, D-GSFE, across three target variables: severity, time of day, and accident hotspot, both individually and jointly. The performance of D-GSFE is compared with the feature selection techniques described in Section 4.1. All methods are evaluated using the metrics defined in Section 4.2, along with the Number of Features Selected (NFS). For consistency, Random Forest is used as the estimator for all methods, except for Lasso and Elastic Net, which employ regularized linear regression. The choice of Random Forest is motivated by its strong performance in previous experiments, making it a reliable baseline for this case study.

Table 12 reports the results for the first target variable, ’severity’. The proposed D-GSFE method shows the best performance, achieving an accuracy of 94.80%, an F1-score of 89.59%, and a specificity of 96.53%, while also recording the lowest FPR and FAR, indicating strong robustness in accident severity classification. In contrast, the Elastic Net method, which relies on only two features, performs worst across all metrics, with the highest FPR and FAR, making it less suitable for this task.

Table 12
Analysis of Feature Selection Techniques in Comparison with D-GSFE for Severity Prediction.

Before the application of D-GSFE, the Random Forest model recorded an accuracy of 94.50%, an F1-score of 88.99%, and a FAR of 7.34%. However, after the application of D-GSFE, all these metrics improved: the accuracy increased to 94.80%, the F1-score to 89.59%, and the FAR decreased to 6.94%. This clearly demonstrates the effectiveness of D-GSFE in enhancing model performance while reducing complexity. The table above presents the results for the second target variable, ’time of day.’

Table 13
Analysis of Feature Selection Techniques in Comparison with D-GSFE for Time of Day Prediction.

For the second target variable, ’time of day,’ D-GSFE continues to outshine the other methods. It achieves the highest accuracy of 87.47% and the highest F1-score of 49.89%, all while utilizing only 17 features. This demonstrates that D-GSFE effectively minimizes complexity without sacrificing performance. Interestingly, the Elastic Net method, despite employing a large number of features 26, performs the poorest. This indicates that merely using more features does not assure superior performance. These results further attest to the effectiveness of D-GSFE in feature selection for different targets.

Table 14 presents the results for the third target variable, ’accident hotspot’. The proposed D-GSFE method again achieves the best performance, with an accuracy of 85.84% and an F1-score of 90.27%, while using only 12 features. In contrast, Elastic Net, despite using more features 16, performs the worst, and Lasso, although using fewer features 4, also shows lower performance. This confirms that reducing the number of features alone does not guarantee better results.

Table 14
Analysis of Feature Selection Techniques in Comparison with D-GSFE for Accident Hotspot Prediction.

Before the application of D-GSFE, the Random Forest model had an accuracy of 79.91%, an F1-score of 86.11%, and a FAR of 25.58%. However, after the application of D-GSFE, all these metrics improved. This clearly demonstrates that D-GSFE not only enhances the model’s performance but also reduces complexity by effectively selecting the most relevant features. In the following analysis, we evaluate our proposed method for the three target variables simultaneously. In the multi-task evaluation, D-GSFE shines, achieving an accuracy of 89.02% and an F1-score of 74.10% with just 19 features. This highlights D-GSFE’s ability to effectively reduce complexity and boost performance across multiple tasks. While other methods like GA, SFM, RFE, and SFS show varied performance, none match D-GSFE’s efficiency in feature selection. Notably, the Boruta method does not support multi-task reduction.

Table 15
Multi-Output Evaluation of Three Tasks: Comparative Analysis with D-GSFE.

Applied separately to each target, D-GSFE consistently achieved higher accuracy and F1-score than other methods, using fewer features. This demonstrates its ability to extract the most informative subset and reduce model complexity. When applied jointly to all targets, it still performed best, confirming its effectiveness in multi-task settings, though requiring slightly more features. These findings suggest that per-target application offers a more adaptable and interpretable model, better aligned with the specific characteristics of each task.

4.5 Assessing the Performance of the Optimized Multi-Task Ensemble Model

In this section, we evaluate the performance of the optimized multi-task ensemble model. This assessment is based on the results of previous experiments, including the evaluation of state-of-the-art predictive models.

4.5.1 Base Models Selection

The selection of base models is a pivotal step in crafting an effective ensemble model. It’s crucial to choose models that are diverse and can complement each other’s strengths and weaknesses. For this study, we have selected three distinct types of ML models as our base models: Random Forest, Neural Network, and k-Nearest Neighbors. This selection was guided by the following considerations:

  • - Number of Models: Opting for three base models strikes a balance between complexity and performance. Including too many models could lead to overfitting and increased computational cost, while too few models might not offer sufficient diversity.

  • - Diversity: The chosen models represent different types of ML algorithms. Random Forest is a bagging-based ensemble model, Neural Network is a deep learning model, and k-Nearest Neighbors is an instance-based model. This diversity aids in capturing different patterns in the data and bolsters the robustness of the final ensemble model.

  • - Performance: These models were among the top performers in our initial evaluation of state-of-the-art predictive models. Random Forest, in particular, demonstrated superior performance, making it an obvious choice for inclusion in the ensemble.

In the next phase, these base models will be defined and optimized during the experiment. The goal is to harness their combined strengths to construct an optimized multi-task ensemble model that outperforms any individual model.

4.5.2 Meta-Learner Selection: Logistic Regression

In our ensemble model, we have chosen Logistic Regression as the meta-learner. This decision is driven by several factors:

  • - Efficiency and Simplicity: Logistic Regression is computationally efficient and straight-forward, making it an ideal choice when dealing with large datasets and complex tasks. These characteristics were observed and validated in our preliminary experiments.

  • - Multi-output capability: Logistic Regression can handle multiple outputs simultaneously. This is vital for our multi-task learning scenario where we aim to predict multiple tasks concurrently.

  • - Interpretability: As the meta-learner, Logistic Regression offers interpretability by assigning weights to the predictions of the base models. These weights indicate the influence of each base model’s prediction on the final ensemble prediction, providing insights into the decision-making process of the ensemble model.

Logistic Regression is employed both as a meta-learner and as the evaluation function within the Genetic Algorithm. The GA optimizes the configuration of the multi-task ensemble by minimizing the validation error across the three tasks. The fitness of each candidate solution is determined by the performance of Logistic Regression on the validation set. As a meta-learner, Logistic Regression is trained on the outputs of the base models. Each base model provides three meta-features-one per task-yielding a total of nine features. This enables the meta-learner to effectively combine base predictions for accurate multi-task classification.

4.5.3 Showcasing the Optimized Multi-Task Ensemble Model Results

This part of the study highlights the contribution of the Genetic Algorithm in reducing the False Alarm Rate across the three prediction tasks within the optimized multi-task ensemble model.

The original dataset is split into a training set (75%) and a test set (25%). The training set is further divided equally into training and validation subsets for model development. Base models are trained separately and in parallel for the tasks of severity, time of day, and accident hotspot. Their predictions on the validation set form the meta-features used to train multiple meta-learners, each corresponding to a different configuration evaluated by the Genetic Algorithm. Once the optimal configuration is selected, its performance is finally evaluated on the held-out test set to assess generalization capability.

Figure 2 illustrates the evolution of the FAR during the optimization process. At each iteration, the best-performing solution-i.e., the configuration yielding the lowest FAR-is selected from the population. The plotted curve represents the FAR values of these best solutions over successive iterations, highlighting the progressive improvement of the ensemble model throughout the GA optimization.

Figure 2
Optimization of Base Model Predictions Using Genetic Algorithm: Evolution of False Alarm Rate Minimization.

Initially, the optimization process commences with a relatively high FAR of approximately 16.21%, suggesting that the initial set of models had a high rate of false alarms. However, as the optimization process advances, a significant reduction in FAR is achieved. This demonstrates the effectiveness of the genetic operators in exploring the solution space and identifying improved models. By the end of the process, the FAR decreases to around 8.82%, indicating a nearly 45% reduction. At this point, the FAR values begin to stabilize, suggesting that the optimization process has likely reached a state of equilibrium where further significant improvements are challenging to achieve.

The substantial reduction in the False Alarm Rate throughout the genetic optimization process is primarily due to the method of selecting parent models for each new generation. The roulette wheel selection method is employed, which favors meta models with lower FAR values, thus indicating better performance. Consequently, models that excel in minimizing false alarms have a higher probability of being selected as parents. This selection process propels the optimization process, steering it towards increasingly effective solutions. Offspring are generated by combining features of two parent models, aiding in the exploration of new areas in the solution space. Additionally, minor random changes introduced in the offspring help maintain diversity in the population and prevent the algorithm from stagnating at local optima. This balanced approach of exploration and exploitation drives the continuous improvement observed in the optimization process.

For the selection of the new population for the next generation, a combination of two strategies is employed: tournament selection and elitism. Tournament selection randomly selects a group of individuals and chooses the fittest among them. Elitism ensures that the best individuals are preserved for the next generation. This combination ensures that the population continues to improve over time while preserving the best solutions found so far. The consistent decrease in FAR and the final low FAR value indicate that the optimization process has successfully found a solution that minimizes the false alarm rate. This demonstrates the effectiveness of the genetic algorithm and its operators in solving the optimization problem.

Upon completion of the genetic algorithm, the best performing model based on the output of the optimization process is selected. This model is then used to make predictions on the test dataset. The test dataset, X-test, is used by the base models. At this stage, D-GSFE intervenes to select the tailored features for each base model and each target. The base models then make their predictions. These predictions are used by the Logistic Regression meta-model to make the final prediction.

The performance of this final model is evaluated using the same metrics that were used previously: accuracy, F1 score, specificity, False Positive Rate, and False alarm Rate. These metrics are calculated for each target variable individually, as well as for all targets combined. This comprehensive evaluation allows for an assessment of the model’s performance in predicting each aspect of road safety, as well as its overall performance.

  • - Severity of accidents: The model predicts the severity of accidents with an accuracy of 96.43% and an F1-score of 96.57%. With a low False Positive Rate (FPR) of 1.52% and a False Alarm Rate (FAR) of 3.45%, the model reduces the risk of false alarms, enabling emergency services to prioritize severe accidents effectively.

  • - Time of day: The model also performs well in predicting the time of day when accidents are likely to occur, with an accuracy of 88.02% and an F1-score of 87.21%. The FPR and FAR values of 3.56% and 11.80% respectively, suggest that the model is dependable and doesn’t often raise false alarms. This can assist traffic management authorities in efficiently planning their resources. For instance, they can adjust traffic signals or deploy traffic police based on the model’s predictions, without the concern of wasting resources due to false predictions.

  • - Accident hotspots: The model is proficient in identifying accident-prone areas, with an accuracy of 88.88% and an F1-score of 87.89%. The False Positive Rate and False Alarm Rate values are 14.87% and 10.51% respectively, indicating the model’s reliability. Compared to the previous FPR and FAR values of 40.37% and 25.58%, our proposed model has significantly improved the reliability. This means city planners and traffic authorities can trust the model’s hotspot predictions when planning infrastructure improvements or enforcing traffic rules, without worrying about false identifications.

Figure 3
Performance Evaluations of the Optimized MTES-GA-DFS Model for Each Separate Target.

In the following analysis, we compare the performance of our optimized multi-task model with the results obtained prior to its application. This comparison further illustrates the effectiveness of our model.

The metrics indicate that the multi-task ensemble model that has been developed shows significant improvement in all areas:

  • - Accuracy: The developed multi-task ensemble model has shown significant improvements across all areas. The accuracy has risen from 89.09% to 91.11%, indicating that the model is making correct predictions more frequently.

  • - F1-score: The F1-score, a measure of the model’s precision and recall, has increased from 73.89% to 90.56%. This increase suggests that the model is more accurately identifying true positives.

  • - Specificity: The model’s specificity has slightly improved from 92.89% to 93.35%, meaning the model has become better at identifying true negatives, or in other words, it’s improved in predicting when accidents are not likely to occur.

  • - False Positive Rate (FPR): The FPR has decreased from 7.11% to 6.65%, indicating that the model is less likely to falsely predict an accident.

  • - False Alarm Rate (FAR): The FAR has significantly decreased from 16.28% to 8.59%, meaning the model is less likely to falsely predict an accident when there isn’t one.

Figure 4
Performance Metrics of the Proposed MTES-GA-DFS Model for Multi-Task Output: A Comparative Analysis.

In terms of real-world application, these improvements suggest that the model can provide more accurate and reliable predictions about road safety. This can aid in the implementation of effective interventions and safety measures. For example, traffic authorities can use these predictions to adjust traffic signals during high-risk times, increase patrols in accident-prone areas, and prioritize resources for severe accidents.

Moreover, the simultaneous prediction feature allows for a more dynamic and responsive approach to road safety. If the model predicts a severe accident at a known hotspot during a high-risk time, authorities can take immediate and specific actions such as rerouting traffic, pre-alerting emergency services, and increasing patrols in that area. This integrated approach can lead to a significant reduction in road accidents and enhance overall road safety. It allows for a more efficient use of resources and can potentially save lives by preventing accidents before they happen.

4.5.4 Exploring the Significance of Meta-Features and Contributions of Base Models

This section is dedicated to examining the significance of the nine meta-features that were utilized in training the Logistic Regression meta-learner. Each of these features represents a prediction made by one of the three base models (Random Forest, Neural Network, and k-Nearest Neighbors) for the three target tasks (severity, time of day, and accident hotspots). These features are integral to the decision-making process of the ensemble model.

  • - Investigating the Importance of Meta-Features: The initial analysis is represented by a bar graph consisting of nine bars, grouped in threes, with each group representing a target task. Each bar within a group signifies the importance of the corresponding meta-feature provided by each base model for that specific target task. This graph offers a visual depiction of the contribution of each meta-feature to the ensemble model. The significance of each meta-feature can be quantified using Coefficient Analysis in Logistic Regression, which provides the weights of each feature in the model.

Figure 5
Depicting the Overall Contributions in the Building of the Meta-Model.

The graph provides a clear depiction of the varied contributions of the meta-features, which are essentially the predictions made by the base models. This variation is a key attribute of the multi-task ensemble model, bolstering its resilience and flexibility. The unequal contributions of the meta-features not only strengthen the multi-task ensemble model but also ensure that the most relevant information is employed for each task, resulting in more accurate and reliable predictions. In the subsequent analysis, we will explore further into the Target Task Analysis to comprehend the contributions of the meta-features to the multi-task prediction.

  • - Target Task Analysis: The subsequent analysis comprises three distinct graphs, each pertaining to a specific target task. Each graph displays the contribution of the predictions from the three base models towards the respective target task. This analysis aids in understanding the importance of each base model’s prediction for each target task. The contribution of each base model can be quantified using Partial Dependence Plots, which demonstrate the marginal effect of the meta-features from each base model on the predicted outcome of a target task.

Figure 6
Depicting the Contribution of Meta Features to the Decision-Making of the Meta-Model.

In the task of severity, the Random Forest model exhibits the most significant contribution, suggesting that its predictions are pivotal in determining the severity of an incident. The Neural Network and K-Nearest Neighbors models also contribute, albeit to a lesser degree. When it comes to the time of day task, the contributions are more or less evenly distributed among the three models, indicating that all models offer valuable insights for predicting the likely time of day for incidents. In the task of accident hotspots, the Random Forest model remains the main contributor, but the K-Nearest Neighbors model contributes more than the Neural Network model, suggesting that its predictions are vital in pinpointing areas prone to accidents.

In the forthcoming analysis, our focus will shift to the Contribution Analysis of each Base Model for each of the three tasks. This scrutiny is crucial as it provides insights into the individual performance and significance of each base model in predicting the outcomes for the tasks.

  • - Base Model Contribution Analysis: The concluding analysis scrutinizes the overall contribution of each base model to the ensemble model. This analysis sheds light on the strengths of each base model and their combined performance in the ensemble model. It’s crucial to understand that the effectiveness of the ensemble model is not simply an aggregation of the performances of the base models, but rather a product of their synergistic interaction. The contribution of each base model can be quantified using Stacking Weights Analysis, which provides the weights allocated to each base model’s predictions in the final ensemble prediction.

  • - Random Forest Model (40% contribution): The Random Forest model indeed stands out with the highest contribution across all tasks, making it an indispensable part of the ensemble model. Its proficiency in managing high dimensional spaces and large sets of training examples enables it to effectively discern complex patterns and interactions among features. This proves particularly advantageous in determining the disruption level of an accident (severity) and pinpointing areas with a high frequency of accidents (accident hotspots).

  • - Neural Networks Model (31% contribution): Although the Neural Network model contributes less than the Random Forest model, it still holds a significant role in the ensemble model. The strength of the Neural Network model is rooted in its capability to learn and model non-linear and complex relationships. This is especially beneficial in the time of day task, where the Neural Network model complements the Random Forest model by capturing the non-linear relationships between different times of the day and the likelihood of accidents occurring. This aids in identifying patterns and peak accident times more effectively.

  • - K-Nearest Neighbors Model (29% contribution): The K-Nearest Neighbors model, despite having the smallest total contribution, still plays a vital role in the ensemble model. Its instance-based nature allows it to manage situations where accident hotspots are influenced by local conditions that might be overlooked by other models. This renders the K-Nearest Neighbors model particularly useful in the accident hotspot task, assisting in preventive measures by identifying areas that necessitate more attention in terms of road safety.

Figure 7
Depicting the Contribution of Base Models to the Decision-Making of the Meta-Model.

This distribution of contributions demonstrates that each model excels in handling different aspects of the data. For instance, the Random Forest model contributes the most to predicting accident hotspots, while the Neural Network and K-Nearest Neighbors models also offer valuable insights into the severity and time of day tasks respectively. This diversity in contributions is what makes ensemble learning potent, as it harnesses the strengths of multiple models to achieve superior overall performance.

This thorough analysis enables us to quantify the contribution and importance of each base model and meta-feature to the ensemble model, thereby providing a more profound understanding of our multi-task ensemble model.

4.6 Execution Time Analysis for the Optimized MTES-GA-DFS Model

The complete build of the optimized MTES-GA-DFS model for the US Accidents dataset (2016-2023; 7.7 M samples, 49 features) covers the entire pipeline: data preprocessing, D-GSFE feature selection, base model training, prediction generation, and GA-based meta-model optimization. All stages were executed under the strict multi-level data split described in Section 3.8, ensuring that no sample is reused across training and evaluation phases.

  • D-GSFE: Feature selection is performed separately for each of the T = 3 tasks and M = 3 base model types, using only the base-model training subset (n base 0.5 × 0.75 n ≈ 2.9 M samples). With k = 9 iterations, the theoretical cost is:

T × M × k × n base × m 3 × 3 × 9 × ( 2 . 9 × 10 6 ) × 49 1 . 15 × 10 10

basic operations, though many iterations run in parallel, limiting their impact on wall-clock time. Measured runtime: ≈ 2.5 hours.

  • Base model training: Three heterogeneous learners - Random Forest, Neural Network, and k-Nearest Neighbors - are trained for each task on n base samples, using only their task-specific feature subsets from D-GSFE. This yields T ×M = 9 base models. The average training time per model is τ train seconds, for a total of 9 × τ train seconds. These models are reused during the prediction generation, avoiding repeated retraining. Measured runtime: ≈ 1.5 hours.

  • Prediction generation: The 9 trained base models produce predictions for the base-model validation subset (n base-val samples), yielding a fixed set of F = 9 meta-features. Complexity: O(F · n base-val). Measured runtime: ≈ 0.2 hours.

  • GA optimization: The GA operates on the F = 9 meta-features, with each individual encoding a selection of meta-samples from the meta-training subset used to train the multi-output logistic regression meta-model. For P = 50 and G = 80, the computational cost is:

P × G × n meta-train × F

  • dominated by repeated fitting and evaluation of the meta-model on different sample subsets. Measured runtime: ≈ 2.2 hours.

The total measured runtime for all stages is approximately 6.4 hours, providing a clear cost breakdown for each phase and demonstrating the trade-off between computational expense and model performance, while the fixed multi-level data separation ensures validation robustness and prevents any leakage of information across pipeline stages.

5 CONCLUSIONS

This study introduced MTES-GA-DFS, a multi-task ensemble framework that combines stacking, genetic algorithm optimization, and dynamic feature selection to simultaneously predict three key road safety outcomes: accident severity, time of day, and hotspot locations. The framework integrates heterogeneous base learners-Random Forest, Neural Network, and k-Nearest Neighbors-while optimizing the stacking process through a genetic algorithm. A central contribution is the Dynamic Greedy Sequential Feature Elimination (D-GSFE) method, which performs task- and model-specific feature selection, improving predictive performance while reducing model complexity. Experiments conducted on the US Accidents dataset (2016-2023) demonstrate that MTES-GA-DFS consistently outperforms baseline approaches. Notably, it improves the F1-score by 22.56% (from 73.89% to 90.56%) and reduces false alarms by 47.24% (from 16.28% to 8.59%), highlighting the effectiveness of jointly optimizing ensemble learning and feature selection in a multi-task setting.

From an application perspective, the proposed framework facilitates proactive interventions, supports efficient resource allocation, and enables informed decision-making for accident prevention. Although GA-based optimization introduces additional computational cost, the modular design of the framework allows parallelization and scalability, making it suitable for large-scale datasets. Future work will focus on reducing optimization overhead, incorporating additional contextual data sources, and validating the approach across different regions and multi-output application domains.

Data Availability

We have used publicly available datasets, and we cite them appropriately.

References

  • 1 AHMED S, HOSSAIN MA, BHUIYAN MMI & RAY SK. 2021. A comparative study of machine learning algorithms to predict road accident severity. In: 2021 20th International Conference on Ubiquitous Computing and Communications (IUCC/CIT/DSCI/SmartCNS), IEEE, pp. 390-397.
  • 2 AHN CW & RAMAKRISHNA RS. 2003. Elitism-based compact genetic algorithms. IEEE Transactions on Evolutionary Computation, 7(4): 367-385.
  • 3 AUGUSTINE T & SHUKLA S. 2022. Road accident prediction using machine learning approaches. In: 2022 2nd International Conference on Advance Computing and Innovative Technologies in Engineering (ICACITE), IEEE, pp. 808-811.
  • 4 BÄCK T, FOGEL DB, WHITLEY D & ANGELINE PJ. 2000. Mutation operators. Evolutionary computation, 1: 237-255.
  • 5 BILATO GA, ROCCO CD & AZEVEDO ATD. 2023. Bi-objective approaches to deal with accident risk and logistic costs in vehicle routing problems. Pesquisa Operacional, 43: e270378.
  • 6 BURKE EK, NEWALL JP & WEARE RF. 1998. Initialization strategies and diversity in evolutionary timetabling. Evolutionary computation , 6(1): 81-103.
  • 7 CARNEIRO D, GUIMARÃES M, CARVALHO M & NOVAIS P. 2023. Using meta-learning to predict performance metrics in machine learning problems. Expert Systems, 40(1): e12900.
  • 8 CERDA P & VAROQUAUX G. 2020. Encoding high-cardinality string categorical variables. IEEE Transactions on Knowledge and Data Engineering, 34(3): 1164-1176.
  • 9 DITCHAROEN A, CHHOUR B, TRAIKUNWARANON T, APHIVONGPANYA N, MANEERAT K & AMMARAPALA V. 2018. Road traffic accidents severity factors: A review paper. In: 2018 5th International Conference on Business and Industrial Research (ICBIR), IEEE, pp. 339-343.
  • 10 DONG S, KHATTAK A, ULLAH I, ZHOU J & HUSSAIN A. 2022. Predicting and analyzing road traffic injury severity using boosting-based ensemble learning models with SHAPley Additive exPlanations. International journal of environmental research and public health, 19(5): 2925.
  • 11 FAWCETT L, THORPE N, MATTHEWS J & KREMER K. 2017. A novel Bayesian hierarchical model for road safety hotspot prediction. Accident Analysis & Prevention, 99: 262-271.
  • 12 FISA R, MUSUKUMA M, SAMPA M, MUSONDA P & YOUNG T. 2022. Effects of interventions for preventing road traffic crashes: an overview of systematic reviews. BMC public health, 22(1): 513.
  • 13 GARCÍA S, RAMÍREZ-GALLEGO S, LUENGO J, BENÍTEZ JM & HERRERA F. 2016. Big data preprocessing: methods and prospects. Big data analytics, 1: 1-22.
  • 14 KIM YK, KIM JY & KIM Y. 2004. A tournament-based competitive coevolutionary algorithm. Applied Intelligence, 20(3): 267-281.
  • 15 LANA I, DEL SER J, VELEZ M & VLAHOGIANNI EI. 2018. Road traffic forecasting: Recent advances and new challenges. IEEE Intelligent Transportation Systems Magazine, 10(2): 93-109.
  • 16 LIPOWSKI A & LIPOWSKA D. 2012. Roulette-wheel selection via stochastic acceptance. Physica A: Statistical Mechanics and its Applications, 391(6): 2193-2196.
  • 17 LIU X, WANG L, ZHANG J, YIN J & LIU H. 2013. Global and local structure preservation for feature selection. IEEE transactions on neural networks and learning systems, 25(6): 1083-1095.
  • 18 MONDAL S, PANDEY A, GUPTA A & PANI A. 2023. Identifying the critical risk factors for road crashes based on large-scale safety audits in India. KSCE Journal of Civil Engineering, 27(11): 4906-4918.
  • 19 MOOSAVI S, SAMAVATIAN MH, PARTHASARATHY S & RAMNATH R. 2019. A countrywide traffic accident dataset. arXiv preprint arXiv:1906.05409.
  • 20 MOOSAVI S, SAMAVATIAN MH, PARTHASARATHY S, TEODORESCU R & RAMNATH R. 2019. Accident risk prediction based on heterogeneous sparse data: New dataset and insights. In: Proceedings of the 27th ACM SIGSPATIAL international conference on advances in geographic information systems, pp. 33-42.
  • 21 PATIDAR P & TIWARI A. 2013. Handling missing value in decision tree algorithm. International Journal of Computer Applications, 70(13).
  • 22 PEDREGOSA F, VAROQUAUX G, GRAMFORT A, MICHEL V, THIRION B, GRISEL O, BLONDEL M, PRETTENHOFER P, WEISS R, DUBOURG V ET AL. 2011. Scikit-learn: Machine learning in Python. the Journal of machine Learning research, 12: 2825-2830.
  • 23 RAY S. 2019. A quick review of machine learning algorithms. In: 2019 International conference on machine learning, big data, cloud and parallel computing (COMITCon), IEEE, pp. 35-39.
  • 24 REITERMANOVA Z ET AL. 2010. Data splitting. In: WDS, Matfyzpress Prague, vol. 10, pp. 31-36.
  • 25 SABER A, ABBAS M & FERGANI B. 2023. Greedy Sequential Feature Elimination: A Novel Approach to Feature Selection. In: Sixth International Conference of the Tunisian Operational Research Society TORS’23.
  • 26 SAMEEN MI & PRADHAN B. 2017. Severity prediction of traffic accidents with recurrent neural networks. Applied Sciences, 7(6): 476.
  • 27 SIKORA R ET AL. 2015. A modified stacking ensemble machine learning algorithm using genetic algorithms. In: Handbook of research on organizational transformations through big data analytics, IGi Global, pp. 43-53.
  • 28 SILVA PB, ANDRADE M & FERREIRA S. 2020. Machine learning applied to road safety modeling: A systematic literature review. Journal of traffic and transportation engineering (English edition), 7(6): 775-790.
  • 29 SINGH D, DAS P & GHOSH I. 2024. Bridging conventional and proactive approaches for road safety analytic modeling and future perspectives. Innovative Infrastructure Solutions, 9(5): 1-21.
  • 30 SINGH D & SINGH B. 2020. Investigating the impact of data normalization on classification performance. Applied Soft Computing, 97: 105524.
  • 31 SPEARS WM & DE JONG KA. 1991. An analysis of multi-point crossover. In: Foundations of genetic algorithms, Elsevier, vol. 1, pp. 301-315.
  • 32 THUNG KH & WEE CY. 2018. A brief review on multi-task learning. Multimedia Tools and Applications, 77(22): 29705-29725.
  • 33 TORBAGHAN ME, SASIDHARAN M, REARDON L & MUCHANGA-HVELPLUND LC. 2022. Under-standing the potential of emerging digital technologies for improving road safety. Accident Analysis & Prevention , 166: 106543.
  • 34 VAN ROSSUM G & DRAKE JR FL. 1995. Python reference manual. Centrum voor Wiskunde en Informatica Amsterdam.
  • 35 VANDERSCHUREN M & NEWLANDS A. 2024. A comparison of traditional road safety assessment methods and the newly developed’road safety deserts’ approach. Journal of the South african institution of civil engineering, 66(1): 20-29.
  • 36 WOLPERT DH. 1992. Stacked generalization. Neural networks, 5(2): 241-259.
  • 37 YAN M & SHEN Y. 2022. Traffic accident severity prediction based on random forest. Sustainability, 14(3): 1729.
  • 38 YASSIN SS & POOJA. 2020. Road accident prediction and model interpretation using a hybrid K-means and random forest algorithm approach. SN Applied Sciences , 2: 1-13.
  • 39 YASSIN SS & POOJA. 2023. A Decision-Making Model for Predicting the Severity of Road Traffic Accidents Based on Ensemble Learning. In: Computational Intelligence for Engineering and Management Applications: Select Proceedings of CIEMA 2022, Springer, pp. 771-781.
  • 40 ZHOU H, WANG X & ZHU R. 2022. Feature selection based on mutual information with correlation coefficient. Applied Intelligence , 52(5): 5457-5474.
  • 41 ZHOU J, RAO S & GAO L. 2023. An ensemble knowledge transfer framework for evolutionary multi-task optimization. Swarm and Evolutionary Computation, 83: 101394.
  • Funding
    This research work is not funded.

Edited by

  • Editor responsible for the review
    Editor-in-Chief: Annibal Parracho Sant’Anna.

Publication Dates

  • Publication in this collection
    06 Mar 2026
  • Date of issue
    2026

History

  • Received
    27 Mar 2025
  • Accepted
    09 Jan 2026
location_on
Sociedade Brasileira de Pesquisa Operacional Rua Mayrink Veiga, 32 - sala 601 - Centro, 20090-050 , Tel.: +55 21 2263-0499 - Rio de Janeiro - RJ - Brazil
E-mail: sobrapo@sobrapo.org.br
rss_feed Acompanhe os números deste periódico no seu leitor de RSS
Ir para o topo Reportar erro