Next Article in Journal
Climate Change, Hurricanes, and Property Loss: A Machine Learning Approach to Studying Infrastructure Sustainability
Next Article in Special Issue
A Prediction Framework for Autonomous Driving Stress to Support Sustainable Shared Autonomous Vehicle Operations
Previous Article in Journal
Open Innovation and Public–Private Collaboration in Manufacturing: A Case Study from Piedmont, Northern Italy
Previous Article in Special Issue
Enhancing Sustainable Traffic Safety Through Machine Learning: A Risk Assessment and Feature Selection Framework Using NGSIM Data
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Recognizing Risk Driving Behaviors with an Improved Crested Porcupine Optimizer and XGBoost

1
School of Economics and Management, Qingdao Institute of Technology, Jiaozhou 266300, China
2
School of Art and Design, Xi’an University of Technology, Xi’an 710048, China
3
School of Traffic and Transportation, Lanzhou Jiaotong University, Lanzhou 730070, China
*
Authors to whom correspondence should be addressed.
Sustainability 2026, 18(6), 2804; https://doi.org/10.3390/su18062804
Submission received: 29 December 2025 / Revised: 22 February 2026 / Accepted: 10 March 2026 / Published: 12 March 2026

Abstract

The effective recognition of risky driving behaviors holds technical potential for supporting accident prevention and sustainable transportation. However, existing intelligent algorithms for optimizing deep learning models in this field often suffer from slow convergence and high errors. This study proposes a novel hybrid model (ICPO-XGBoost) for risky driving behavior classification. The improved crested porcupine optimizer (ICPO) was developed using logistic-tent composite mapping for population initialization, a hybrid mechanism combining refraction opposition-based learning and Cauchy mutation to avoid local optima, and an adaptive variable spiral search with inertia weight to balance global and local search. The ICPO was then employed to optimize the hyperparameters of the XGBoost classifier. The ICPO demonstrated superior optimization accuracy and convergence speed compared to benchmark algorithms. The ICPO-XGBoost model achieved accuracy, precision, recall, and F1 scores of 96.2%, 95.4%, 95.8%, and 95.6%, respectively, for classifying and identifying risky driving behaviors. Compared to various benchmark models, these results represent increases of 12.7–24.8%, 14.8–31.8%, 14.9–31.0%, and 15.0–32.4%, respectively. For specific driving behavior categories (normal driving, slow driving, short-distance tailgating, sudden acceleration/deceleration, frequent lane changing, and forced lane changing), the precision, recall, and F1 scores of the ICPO-XGBoost model fell within the ranges of 84.8–99.2%, 87.5–100.0%, and 86.2–99.2%, respectively. Compared to benchmark models, these metrics show increases of 1.5–75.8%, 5.8–68.1%, and 3.3–72.6%, respectively. Notably, the model significantly improved accuracy in identifying sudden acceleration/deceleration behaviors. The results of this model facilitate the classification and early warning of risky driving behaviors, thereby reducing the frequency of such behaviors, lowering the risk of traffic accidents, and enhancing road traffic safety.

1. Introduction

The widespread issue of traffic-related injuries and fatalities has become a major global concern, resulting in more than 1.2 million deaths annually and imposing significant socioeconomic costs worldwide [1]. With the increasing vehicle ownership and usage in developing countries, if effective measures are not implemented at the levels of human factors, vehicles, roads, and the environment, the number of deaths due to road traffic accidents is projected to rise to 2.4 million by 2030, making it the seventh leading cause of death worldwide. In China, the growing demand for motorized travel, the increase in mixed traffic volumes, and the weak safety awareness among road users have particularly exacerbated traffic safety issues [2]. According to statistics, in 2024, China’s total car ownership reached 352.68 million vehicles, and the number of licensed motor vehicle drivers reached 523.2 million, representing increases of 7.2% and 4.3%, respectively, compared to 2023. In the same year, a total of 150,054 road traffic accidents involving motor vehicles occurred in China, resulting in direct economic losses of 10.4345 billion yuan, which marked a 10.7% increase compared to the previous year [3]. As operators of vehicles, participants in road traffic, and perceivers of environmental conditions, drivers play a dominant role in the road traffic system [4]. Drivers’ risk perception of the road traffic environment or improper operations are prone to cause abnormal vehicle trajectories, leading to road traffic accidents [5]. How to calibrate, fit, and determine the parameters of regression and classification recognition models based on the characteristics of vehicle driving trajectories, in order to build an accurate classification and recognition model for risky driving behaviors, is the key to identifying and warning against such behaviors. The outcomes of this research can lower the occurrence rate of risky driving behaviors and improve the level of road traffic safety.
Research on driving behavior classification and recognition has primarily relied on analyzing vehicle trajectory characteristics, including lateral and longitudinal velocity [6], acceleration/deceleration patterns, and lateral offset [7]. The methodological framework in this domain encompasses three main categories: mathematical statistics models, machine learning approaches, and deep learning architectures. Within mathematical statistics, representative models include the multi-objective recognition (MOR)-based driving risk identification model [8], the risk index-based behavior classification model [9], and the Gaussian mixture hidden Markov model (GMM-HMM) [10]. Machine learning models such as k-means clustering [11], back propagation neural network [12], support vector machine [13], and random forest [14] offer higher recognition accuracy compared to the aforementioned models. However, they struggle to overcome difficulties in determining kernel function parameters under large data sample conditions, and their optimization accuracy, convergence rate, and generalization capabilities need improvement [15].
By exploring driving behavior data features, such as driver personal attributes, driving habits, road section accident rates, and lane-changing duration under large data sample conditions [16], driving behavior recognition models based on long short-term memory (LSTM) [17], multi-channel convolutional neural network and long short-term memory (MCT-CNN-LSTM) [18], XGBoost [19], and transformer [20] have been constructed. Compared with traditional machine learning models, these approaches demonstrate superior capability in capturing nonlinear relationships and complex correlations within driving behavior data, ultimately enhancing model accuracy and robustness [21]. Driving behavior recognition models, such as particle swarm optimized-least squares support vector machine (PSO-LSSVM) [22], genetic algorithm-convolutional neural network (GA-CNN) [23], and salp swarm algorithm-back propagation (SSA-BP) [24], address a major drawback of deep learning—excessive reliance on manual parameter tuning. By mitigating this issue, they improve the generalization ability of predictive models.
The crested porcupine optimizer (CPO) is characterized by its simple structural principle and limited number of model parameters. Compared with other existing intelligent algorithms, the CPO algorithm offers advantages in higher solution accuracy and faster convergence speed [25], leading to its widespread application in engineering problems such as path planning [26], traffic accident severity identification [27], and mechanical fault classification and detection [28]. However, existing research suggests that the circular selection strategy employed during the initialization phase of the CPO algorithm tends to reduce the diversity and quality of the population. Furthermore, limitations in the individual position update mechanisms during the perception and physiological defense phases diminish the algorithm’s ability to balance the relationship between global search and local exploitation. These defects in the optimization mechanism of the CPO algorithm increase its risk of falling into local optima, thereby compromising its solution accuracy and convergence rate. Existing research on the improvement of the crested porcupine optimizer (CPO) primarily includes two aspects: first, employing strategies such as sine chaotic mapping [29], circle chaotic mapping [30], and the good point set strategy [31] to enhance the circular selection generation mechanism of the CPO. This increases the uniformity and diversity of the solution space distribution during the population initialization phase, thereby improving the quality of the solution set during the optimization process. Second, utilizing strategies including elite opposition-based learning [32], the Lévy flight strategy [33], the velocity vector mechanism of the particle swarm optimization algorithm [34], the Cauchy mutation operator [35], adaptive t-distribution-based perturbation [27], and adaptive neighborhood search [36] to optimize the position update methods of individual crested porcupines during the perception and physiological defense phases. This expands the search space for optimal feasible solutions of the CPO algorithm and enhances its ability to balance local exploitation and global search.
Existing research has primarily focused on exploring the correlation characteristics between different influencing factors and driving behaviors in publicly available foreign datasets, constructing driving behavior classification and recognition models mainly based on machine learning and intelligent algorithms, and optimizing deep learning parameters. However, it has overlooked influencing factors such as the domestic mixed traffic conditions and driving behavior habits. This paper first employs logistic-tent composite mapping to initialize the porcupine population, thereby enhancing its diversity and quality. To overcome the algorithm’s tendency to become trapped in local optima and converge prematurely, a hybrid mechanism combining refraction opposition-based learning and Cauchy mutation is introduced. Subsequently, the integration of adaptive variable spiral search and inertia weights refines the individual position update process, effectively balancing global exploration with local exploitation and improving convergence accuracy. Finally, a classification and recognition model is developed using the ICPO-XGBoost algorithm, which is applied to clustered trajectory data of risky driving behaviors. The ICPO-XGBoost model, by accounting for the mixed traffic operating conditions and driver behavioral habits, enhances both the classification accuracy and practical applicability of risk driving behavior recognition.
The remainder of the paper is organized as follows:
In Section 2, the strategies and roles of the improved porcupine optimization algorithm are detailed. The numerical simulation results of the hybrid strategy improved porcupine optimization algorithm for optimizing 12 benchmark test functions are comparatively analyzed, and the ICPO-XGBoost-based risky driving behavior classification and recognition model is constructed.
In Section 3, the K-means algorithm, nearest neighbor imputation method, and Savitzky–Golay filter are used to cluster and smooth/denoise the risky driving behavior data. The results of the ICPO-XGBoost-based risky driving behavior classification and recognition model are discussed, and the classification accuracy and applicability of the proposed model are comparatively analyzed against existing models.

2. Risk Driving Behavior Classification and Recognition Model Based on ICPO-XGBoost

In this study, the terms “recognition,” “classification,” and “identification” are used with distinct meanings. “Recognition” refers to the overall process of detecting risky driving behaviors from trajectory data. “Classification” specifically denotes the assignment of detected behaviors into predefined categories (e.g., sudden acceleration/deceleration, lane changing). “Identification” is used interchangeably with “recognition” to describe the broader task of behavior detection. This distinction is maintained throughout the manuscript to ensure clarity and consistency.
This paper presents an improved crested porcupine optimizer (ICPO) addressing limitations in population initialization and position updating mechanisms of the original CPO. Key enhancements include logistic-tent chaotic mapping for superior population diversity and quality, refraction opposition-based learning with Cauchy mutation for expanded search space and reduced local optima risk, and adaptive variable spiral search with inertia weight strategy for optimized perception-defense phase updates. This synergistic hybrid approach significantly advances the CPO algorithm’s optimization accuracy and convergence performance.

2.1. Design of Hybrid Strategy Improved Crested Porcupine Optimization Algorithm

2.1.1. Population Initialization Optimization Design Based on Logistic-Tent Composite Mapping

The crested porcupine optimizer (CPO) [25] is a nature-inspired metaheuristic that models the defensive behaviors of crested porcupines. The algorithm employs a cyclic selection mechanism for population initialization, which enhances population diversity and quality, thereby reducing susceptibility to local optima and accelerating convergence. The corresponding mathematical representations are given in Equation (1) (population initialization) and Equation (2) (cyclic selection).
X i = L + r × U L | i = 1 , 2 , , N
where X i is the i -th population individual; L and U represent the upper and lower bounds of the population size, respectively; r is a random vector within the range [0, 1]; N denotes the population size.
N = N min + N N min × 1 t % T max T T max T
where T is the number of cyclic selection iterations; T max is the maximum number of cyclic selection iterations; % is the modulo operator; N min is the minimum size of the newly generated population through cyclic selection.
The perception defense strategy mimics the crested porcupine’s predator intimidation through feather ruffling and noise generation. Equations (3) and (4) mathematically formulate these two behaviors, respectively.
X i t + 1 = X i t + τ 1 × 2 × τ 2 × x c p t y i t
where x c p t is the optimal individual at the current iteration; y i t is the individual vector of the population at the current iteration; τ 1 is a random number following a normal distribution; τ 2 is a random number in the range [0, 1].
x i t + 1 = 1 U 1 × x i t + U 1 × y + τ 3 x r 1 t x r 2 t
where r 1 and r 2 are random integers within the range [1, N]; τ 3 is a random value generated in the range [0, 1].
The physiological defense strategy emulates the crested porcupine’s dual defense mechanisms against predators: olfactory secretion and physical confrontation. The corresponding mathematical models are presented in Equation (5) and Equation (6), respectively.
x i t + 1 = 1 U 1 × x i t + U 1 × x r 1 t + S i t × x r 2 t x r 3 t τ 3 × δ × γ t × S i t
where x i t + 1 is the position of the i -th population individual at the t -th cycle selection iteration; δ is a parameter controlling the search direction; γ t is the defense factor; S i t is the scent diffusion factor; r 3 is a random integer within the range [1, N].
x i t + 1 = x c p t + α ( 1 τ 4 ) + τ 4 × δ × x c p t x i t τ 5 × δ × γ t × F i t
where α is the convergence speed factor; τ 4 is a random value generated in the range [0, 1]; F i t is the average force affecting the i -th individual in the population.
The loop-based selective initialization in the CPO may reduce population diversity and quality. This can lead to uneven individual distribution and a limited global search space. To address this, we replace the original strategy with a logistic-tent combined chaotic map. This map is chosen for its strong spatial traversal, fast iteration, and high applicability [37]. In optimizing risk driving behavior data, it enhances the uniformity and ergodicity of population distribution, which improves the algorithm’s convergence speed and solution accuracy. The equation for the logistic-tent combined map is as follows:
z ( t + 1 ) = r z , 1 z ( t ) + 4 r z ( t ) ,                         0 < z ( t ) 0.3 r z , 1 z ( t ) + 4 r 1 z ( t ) ,     0.3 < z ( t ) < 1
where z ( t ) is the value after the t -th iteration; r is a random parameter in the range (0, 4).

2.1.2. Hybrid Optimization Mechanism Based on Refraction Opposition-Based Learning and Cauchy Mutation to Broaden the Search Region

  • Refraction Opposition-Based Learning
By expanding the search space of feasible optimal solutions, the refraction opposition-based learning strategy significantly boosts the CPO algorithm’s optimization capability during its early iterations. As the iterative process continues, this mechanism continues to broaden the search scope, thereby effectively mitigating the risk of the algorithm converging on a local optimum. The underlying principle of this strategy is depicted in Figure 1.
As shown in Figure 1, the known solution lies on the search interval a , b on the x -axis, with the origin o as the midpoint of a , b . The normal is the y -axis, and the angles of incidence and refraction are α and β , respectively. The lengths of the incident and refracted rays are l and l * . Therefore, the equation for the refractive index is:
n = sin α cos α = a + b 2 x x * a + b 2 l * l
Let δ = l * / l , and substitute it into Equation (8). Extending this to a multidimensional space yields the refraction opposition solution as:
x i , j * = a j + b j 2 + a j + b j 2 δ x i , j δ
where x i , j represents the position of the i -th particle in the j -th dimension in the original population; x i , j * denotes the refraction opposition solution corresponding to x i , j ; a j and b j represent the upper and lower bounds of the search space in the j -th dimension, respectively.
2.
Cauchy Mutation
The Cauchy distribution is a continuous probability distribution characterized by an undefined mathematical expectation and a probability density function that decays slowly from its peak, approaching the horizontal axis asymptotically. This study leverages the Cauchy mutation mechanism—derived from this distribution—to perturb feasible solutions throughout CPO’s iterative process, thereby enhancing search efficiency. Integrating this mechanism into the position update strategy strengthens the algorithm’s global exploration capability and improves its ability to escape local optima. The standard Cauchy distribution function is defined as follows:
f x = 1 π 1 + x 2
After applying the Cauchy mutation mechanism to perturb the optimal feasible solution during the iterative execution of the CPO algorithm, the optimal crested porcupine individual position can be expressed as:
x n e w b e s t = x b e s t + x b e s t × C a u c h y 0 , 1
3.
Hybrid Mechanism
The proposed hybrid mechanism dynamically updates individual positions in the CPO population by alternately executing refraction opposition-based learning and Cauchy mutation with equal probability. Within this framework, refraction opposition-based learning expands the search space, enabling exploration of a broader range of potential optimal solutions. Concurrently, Cauchy mutation introduces stochastic perturbations that reduce the risk of premature convergence to local optima and accelerate convergence toward the global optimum. The mathematical representation of this hybrid mechanism is provided below.
x n e w b e s t , 1 = a + b 2 + a + b 2 δ x i δ ,         λ < 0.5 x b e s t + x b e s t × C a u c h y 0 , 1 ,     λ 0.5
where λ is a random number in the range [0, 1].

2.1.3. Adaptive Variable Spiral Search and Inertia Weight

An adaptive variable spiral search strategy [38] is integrated into the position update mechanism of the CPO algorithm to strengthen its global exploration capability. By emulating variable spiral motion trajectories, this approach broadens the algorithm’s search scope and enhances its capacity to escape local optima. The mathematical formulation is provided in Equations (13) and (14).
X ( t + 1 ) = D e b l cos ( 2 π l ) + X * ( t )
D = 2 r X * ( t ) X ( t )
where X ( t + 1 ) represents the position of the t + 1 -th individual; X * is the position of the global optimal individual; b is a constant defining the shape of the spiral position; l is a random number in the range [−1, 1]; r is a random variable in the range [0, 1].
To refine the position updates of individual crested porcupines, this paper incorporates an adaptive variable spiral search strategy alongside an inertia weight. This combination strengthens the guiding influence of the optimal individual throughout the iterative process, thereby accelerating convergence toward the global optimum. The mathematical expression for the inertia weight is provided in Equation (15).
ω = 0.2 cos ( 0.5 π ( 1 t T ) )
The conventional fixed spiral search strategy often entraps the algorithm in local optima. To overcome this drawback, this paper modifies the spiral constant into a parameter that dynamically evolves with the iteration count. This transformation allows the spiral shape to adjust adaptively, thereby broadening the search scope and strengthening the algorithm’s global optimization performance. The expression for this variable spiral parameter is provided in Equation (16).
η * = e 5 cos ( π ( 1 t T ) )
The negative correlation between spiral shape and iteration number, shown in Equation (16), is fundamental to the ICPO algorithm’s design. In the initial iterations, this facilitates a comprehensive global search. In later stages, as the search narrows around promising solutions, the adaptive variable spiral search strategy and inertia weight—used to refine individual position updates—ensure an effective balance between global and local search. This leads to superior optimization accuracy and a faster convergence rate. The updated position update methods for different stages of the ICPO algorithm are presented as follows:
X i t + 1 = ω X i t + η * D e b l cos ( 2 π p ) + τ 1 × 2 × τ 2 × x c p t y i t
x i t + 1 = 1 U 1 × ω x i t + 1 U 1 × η * D e b l cos ( 2 π p ) + U 1 × y + τ 3 x r 1 t x r 2 t
x i t + 1 = 1 U 1 × ω x i t + 1 U 1 × η * D e b l cos ( 2 π p ) + U 1 × x r 1 t + S i t × x r 2 t x r 3 t τ 3 × δ × γ t × S i t
x i t + 1 = ω x c p t + η * D e b l cos ( 2 π p ) + α ( 1 τ 4 ) + τ 4 × δ × x c p t x i t τ 5 × δ × γ t × F i t

2.2. Validation of the Effectiveness of the Hybrid Strategy Improved Crested Porcupine Optimizer (ICPO)

2.2.1. Comparative Analysis of Numerical Simulation Experiment Results

To evaluate the optimization performance of the CPO algorithm enhanced by the hybrid strategy, this paper conducts numerical simulation experiments using 12 benchmark test functions, which include unimodal, multimodal, and composite modalities. The details of these 12 benchmark test functions are presented in Table 1.
To maintain consistency and rigor in the comparative evaluation, all algorithms—including CPO, salp swarm algorithm (SSA), whale optimization algorithm (WOA), and particle swarm optimization (PSO)—were configured with identical parameters: a population size of 50 and a maximum iteration count of 500. Each algorithm was executed 30 times independently, and the resulting mean values and standard deviations were recorded. The statistical outcomes for each benchmark function are summarized in Table 2.
ICPO’s optimization performance on multimodal functions f5f8 outperforms that of CPO, SSA, WOA, and PSO, primarily due to the hybrid mechanism of refraction opposition-based learning and Cauchy mutation. This mechanism enhances the algorithm’s ability to navigate complex search spaces and avoid local optima, thereby increasing the likelihood of convergence to the global optimum. For composite multimodal functions f9f12, the adaptive variable spiral search and inertia weight—applied to improve position updates during the perception and physiological defense stages—ensure a dynamic balance between global and local search. This balance significantly improves both the precision of the solution and the rate of convergence.
To explore the statistical characteristics of the numerical simulation experimental results of the ICPO algorithm, this paper, based on 30 optimization results of benchmark functions solved by each algorithm, constructed the boxplot statistical chart shown in Figure 2. The box plots in Figure 2 illustrate the distribution of optimization outcomes: the central mark indicates the median, the box edges mark the 25th and 75th percentiles, and “+” symbols identify outliers. Examining these plots shows that ICPO’s results are characterized by a tighter interquartile range and minimal outliers. This pattern confirms the algorithm’s enhanced stability and robustness compared to others.
To rigorously assess the robustness and fairness of ICPO’s performance, the Wilcoxon rank-sum test was employed at a 5% significance level. Pairwise comparisons were performed between ICPO and each benchmark algorithm (CPO, SSA, WOA, and PSO), yielding p-values denoted as CP1, CP2, CP3, and CP4, respectively. The complete test results are presented in Table 3. As shown in the table, all p-values for the 12 benchmark functions are below 2.50 × 10−5, well within the 5% significance threshold. These findings provide strong statistical evidence that the superior optimization accuracy and convergence speed achieved by ICPO are not due to random chance.

2.2.2. Comparative Analysis of Algorithm Convergence

The convergence curves in Figure 3 evaluate algorithms’ convergence accuracy, speed, and local optima avoidance. Key observations are as follows:
For f1 and f2, ICPO achieves superior accuracy after ~150 iterations, attributed to logistic-tent mapping enhancing population quality and global search. For f3, f5, f7, and f8, multiple inflection points in ICPO’s curves demonstrate that adaptive variable spiral search and inertia weight strategies effectively balance exploration and exploitation, preventing premature convergence. For f6, f9, and f10, ICPO converges to theoretical optima within 50 iterations, benefiting from logistic-tent mapping’s improved population diversity for rapid early convergence. For f4, f11, and f12, ICPO matches comparison algorithms by iteration 200, then leverages the refraction opposition-based learning and Cauchy mutation hybrid mechanism—combined with inertia weight—to continuously escape local optima and maintain global search.

2.2.3. Comparative Analysis of Algorithm Runtime Performance

To provide an intuitive comparison of algorithmic runtime, this paper examines the performance of ICPO and CPO across 12 benchmark functions classified by dimension. Both algorithms were subjected to 30 independent runs on the same platform, with the average computational time from these experiments summarized in Figure 4. The average runtimes required by the ICPO algorithm for solving unimodal and composite benchmark test functions are 0.891 s and 1.142 s, respectively, representing improvements of 3.86% and 2.31% compared to the CPO algorithm. The overall mean runtime of the ICPO algorithm across all 12 benchmark test functions is 1.049 s, which is 1.62% faster than that of the CPO algorithm.
The synergistic integration of logistic-tent composite mapping, a hybrid mechanism combining refraction opposition-based learning with Cauchy mutation, adaptive variable spiral search, and inertia weighting, significantly accelerates the convergence rate of the original CPO algorithm.
Quantitative assessment of ICPO’s optimization accuracy is conducted through MAE ranking analysis on 12 benchmark functions. The ranking results validate the algorithm’s precision performance. ICPO demonstrates superior optimization accuracy, as evidenced by its MAE performance on 12 benchmark functions (Table 4). Among all algorithms evaluated, ICPO achieves the smallest MAE value, securing the top ranking. This outcome confirms ICPO’s enhanced ability to closely approximate the theoretical optima of benchmark functions.
Ablation experiments were conducted to isolate the impact of each strategy. CPO1–CPO4 represent CPO enhanced with logistic-tent mapping, refraction-Cauchy hybrid, adaptive spiral search, and inertia weight, respectively. Wilcoxon rank-sum tests between ICPO and each variant (Table 5) show p-values below 1.47 × 10−13 for all 12 benchmark functions, confirming statistically significant performance differences (α = 0.05). These results establish that the multi-strategy integration in ICPO yields superior optimization performance compared to any single-strategy enhancement.

2.3. Construction of the ICPO-XGBoost Classification and Recognition Model

2.3.1. Extreme Gradient Boosting Algorithm

XGBoost is an advanced ensemble learning algorithm that iteratively combines multiple low-precision decision trees through weighted accumulation of their leaf node weights, thereby constructing high-accuracy predictive models [39]. The cumulative leaf node weights across all decision trees in the XGBoost model are given by:
y ¯ i ( k ) = k K f k ( x i )
where y ¯ i ( k ) represents the sum of leaf weights in the ensemble model across all decision trees after k iterations; f k ( x i ) denotes the leaf node weight of data sample x i on the k -th decision tree.
The XGBoost objective function comprises a loss term for measuring prediction error and a regularization term for controlling model complexity, ensuring both accuracy and generalizability. Its mathematical formulation is:
O b j = i = 1 m L ( y i , y ¯ i ) + k = 1 k Ω ( f k )
where L is the loss function; Ω denotes the regularization function; m indicates the sample count on the k -th decision tree.

2.3.2. Steps and Process of the ICPO-XGBoost Recognition Model

In this study, the K-means algorithm is employed to cluster and screen data for the classification and recognition of risky driving behaviors, and missing data are handled using the nearest neighbor imputation method. Based on the data smoothed and denoised by the Savitzky–Golay filter, the ICPO algorithm is utilized to optimize the XGBoost parameters. The trained model is then fitted to obtain the classification and recognition results for risky driving behaviors. The steps of the ICPO-XGBoost-based classification and recognition model for risky driving behaviors are as follows, with the workflow illustrated in Figure 5:
1.
Set the ICPO algorithm parameters based on preprocessed risky driving behavior trajectory features: population size = 30, number of iterations = 40.
2.
Initialize the algorithm population parameters using the logistic-tent composite mapping.
3.
Calculate the fitness value of each individual in the current population and determine the position of the optimal individual.
4.
Use Equations (15) and (16) to update the value of parameters ω and η *
5.
Apply the refraction opposition-based learning and Cauchy mutation hybrid mechanism for opposition-based learning evaluation and selection. Update the optimal crested porcupine population individual position using Equation (12).
6.
Refresh population individual positions via adaptive variable spiral search and inertia weight, as expressed in Equations (17)–(20).
7.
Check for maximum iteration attainment. If satisfied, terminate iterations and output the optimal individual position and fitness value. Otherwise, return to step (2).
8.
Extract the ICPO-derived global optimal feasible solution and use it to establish XGBoost model parameters.
9.
Use the ICPO-XGBoost model for the classification and recognition of risky driving behaviors and validate the classification and recognition performance.

3. Case Study

3.1. Preprocessing of Risky Driving Behavior Data

The experimental data in this paper are sourced from the vehicle risk driving behavior trajectory dataset of Shanghai’s North-South Elevated Road [40]. This dataset encompasses six categories of driving behaviors: normal driving, frequent lane changing, forced lane changing, short-distance tailgating, slow driving, and sudden acceleration/deceleration. To reduce computational costs during model validation, key feature indicators for driving behavior classification—namely longitudinal velocity, lateral velocity, and lateral offset position—were selected from the dataset. The K-means clustering algorithm was employed to partition the risk-driving behaviors, resulting in a total of 3000 data samples across different behavior types. The K-means algorithm was configured with a maximum of 300 iterations and 6 clusters. To enhance the quality of the data used for risk driving behavior classification and to mitigate the impact of random fluctuations on the classification results, the nearest neighbor imputation method was applied to fill in missing values within the data samples. Additionally, data smoothing and noise reduction were performed using a Savitzky–Golay filter. The results of the data preprocessing for lateral velocity, longitudinal velocity, and lateral offset position are illustrated in Figure 6, Figure 7 and Figure 8, respectively. Statistical representations of the vehicle trajectory data for each risk driving behavior category are shown in Figure 9.

3.2. Analysis of Risky Driving Behavior Classification and Recognition Results

The experimental design involved dividing the preprocessed risky driving behavior dataset into training (60%), validation (20%), and test (20%) sets. The training set enabled derivation of the regression function, the validation set facilitated parameter adjustment, and the test set confirmed classification performance. Parameter optimization was performed using the ICPO algorithm with population size 30, maximum iterations 40, variable dimension dim = 3, and bounds set to LB = [0.001, 10, 0.0001] and UB = [0.01, 50, 0.1]. The optimization process leveraged the risky driving behavior data from Section 3.1 to determine optimal parameters for the fitted regression classification model. The resulting fitness variation across iterations is presented in Figure 10.
Figure 11 presents the following information: within each green and red square, the upper value denotes the number of samples for a specific type of risky driving behavior, while the lower value represents its corresponding percentage in the total test sample set. For the white squares in the last row, the upper value indicates the percentage of correctly identified samples relative to the total test samples of that particular behavior type. For the white squares in the last column, the upper value indicates the percentage of correctly identified samples relative to the total samples classified as that behavior type. The gray square in the bottom-right corner reports the overall correct and incorrect classification rates for all risky driving behavior test samples.
Taking the fourth column in Figure 11 as an example, out of the 66 test samples for sudden acceleration/deceleration, 56 were correctly identified as sudden acceleration/deceleration, 4 were incorrectly identified as normal driving, 1 was incorrectly identified as slow driving, and 5 were incorrectly identified as close car-following. The value of 9.3% in the fourth row and fourth column represents the proportion of correctly identified sudden acceleration/deceleration test samples (56) relative to the total number of test samples (600).

3.3. Comparative Analysis of Classification and Recognition Errors for Risky Driving Behaviors

Using the risk driving behavior data from Section 3.1 of the paper as input for each model, the ICPO-XGBoost model achieved a classification accuracy of 96.2% for risk driving behavior recognition. This represents an improvement of 12.7% to 24.8% compared to models such as PSO-LSSVM [22], XGBoost [19], and Random Forest [14]. The average runtime of the ICPO-XGBoost model was 365.3 s, which is 53.3 s shorter than that of PSO-LSSVM. For the classification of risk driving behaviors, the ICPO-XGBoost model attained precision, recall, and F1 scores of 95.4%, 95.8%, and 95.6%, respectively. These metrics show increases of 14.8% to 31.8% in precision, 14.9% to 31.0% in recall, and 15.0% to 32.4% in the F1 score when compared to PSO-LSSVM, XGBoost, and Random Forest. A comparison between the actual and predicted classification results for risk driving behaviors by the ICPO-XGBoost, PSO-LSSVM, XGBoost, and Random Forest models is presented in Figure 12.
The overall performance metrics of the recognition results for both ICPO-XGBoost and XGBoost models are shown in Figure 13.
A comparison of the recognition performance metrics for different risk driving behavior features is presented in Table 6. As shown in Table 6, both frequent lane changing and forced lane changing achieved precision, recall, and F1 scores all above 98.1%. In contrast, sudden acceleration/deceleration yielded the lowest scores, with precision, recall, and F1 values of 84.8%, 87.5%, and 86.2%, respectively. The relatively lower recognition accuracy of the ICPO-XGBoost model for sudden acceleration/deceleration behavior can be attributed primarily to its typically short duration. Furthermore, the radar-derived trajectory data for such behaviors may not adequately capture variations in individual driver attributes and habits, which could also contribute to the model’s performance limitation in this category [41]. Normal driving and sudden acceleration/deceleration share highly similar vehicle trajectory characteristics. Additionally, the radar-based analysis used to detect sudden acceleration/deceleration behaviors has inherent limitations, making it prone to misclassification between the two. Future research should focus on extracting more detailed data features through video detection and analysis to improve the recognition accuracy for these behaviors.
All evaluated models (ICPO-XGBoost, PSO-LSSVM, XGBoost, and Random Forest) demonstrated their highest overall recognition accuracy for the short-distance tailgating behavior. For this category, precision, recall, and F1 scores were all above 89.3%. Specifically, the ICPO-XGBoost model achieved performance ranges of 84.8%~99.2% for precision, 87.5%~100.0% for recall, and 86.2%~99.27% for the F1 score across the six driving behavior types (normal driving, slow driving, short-distance tailgating, sudden acceleration/deceleration, frequent lane changing, and forced lane changing). Compared to the baseline XGBoost model, these results represent substantial relative improvements: precision increased by 1.5% to 75.8%, recall by 5.8% to 68.1%, and the F1 score by 3.3% to 72.6%. Notably, for the challenging sudden acceleration/deceleration behavior, the ICPO-XGBoost model attained precision, recall, and F1 scores of 84.8%, 87.5%, and 86.2%, respectively. While these are its lowest scores, they still surpass the performance of all other benchmark models (PSO-LSSVM, XGBoost, and Random Forest) on this specific behavior.

3.4. Sensitivity Analysis of Parameters in the Risky Driving Behavior Classification and Recognition Model

In the ICPO algorithm, the iteration count quantifies the position update steps taken by population individuals as they move toward the identified optimal solution. This process leverages the intrinsic features of the risky driving behavior dataset to progressively converge upon the global optimum. Building upon the parameter settings for the risky driving behavior classification and recognition results model, the iteration count was set to 10, 20, 30, …, 100, respectively. The corresponding average accuracy results for classification are shown in Figure 14a. It can be observed that, with other parameters held constant, after 40 iterations, the accuracy of the risky driving behavior classification results does not exhibit a linear positive correlation with the iteration count. However, the runtime required for the classification results increases significantly. Increasing the iteration count of the ICPO algorithm does not substantially improve the optimization accuracy or convergence rate of the fitted regression parameters for the classification model, and it may lead to redundant and ineffective iterative computations, thereby increasing model runtime.
Population size dictates the ICPO algorithm’s search space; larger spaces typically increase the probability of finding the global optimum. Testing population sizes from 10 to 100 in increments of 10 revealed that beyond 30, accuracy no longer correlates linearly with size, as shown in Figure 14b for risky driving behavior classification. However, the runtime for the classification results increases significantly. Increasing the population size of the ICPO algorithm does not markedly enhance the optimization accuracy or convergence rate of the fitted regression parameters for the classification model. Moreover, unnecessarily enlarging the search space can lead to feature information redundancy and slower model processing [42].

3.5. Sensitivity Analysis of Factors Influencing Risky Driving Behavior Classification and Identification

To quantitatively analyze the sensitivity of factors influencing risky driving behavior identification on the classification results of the ICPO-XGBoost model, this study employs SHAP values to assess the sensitivity effects and contribution levels of these influencing factors. The SHAP values of the influencing factors in the ICPO-XGBoost model are presented in Figure 15. Figure 15a illustrates the scatter plot of SHAP values, depicting the overall relationship between the classification and identification results of risky driving behaviors and the sensitivity effects of the influencing factors. The value of each scatter point in Figure 15a reflects the proportion of the sensitivity effect of the influencing factor. The degree of dispersion of the influencing factors is proportional to their sensitivity effect. As shown in Figure 15a, the lateral offset position exhibits the greatest sensitivity effect on the classification and identification results of risky driving behaviors. Figure 15b presents a ranked visualization of the mean absolute SHAP values of factors influencing risky driving behavior classification and identification. Lateral offset position is the most significant factor affecting the classification and identification results of risky driving behaviors, followed by lateral speed and longitudinal speed, in that order.

4. Conclusions

Based on vehicle trajectory data capturing risky driving behaviors on the Shanghai North-South Passageway, this study constructed a risky driving behavior classification and recognition model using ICPO-XGBoost. Twelve benchmark test functions and risky driving behavior data were selected for numerical simulation experiments and validation of classification performance. The main findings are summarized as follows:
  • This paper enhances the CPO algorithm through four key hybrid strategies: Logistic-tent composite mapping for population initialization, a hybrid mechanism combining refraction opposition-based learning with Cauchy mutation, adaptive variable spiral search, and inertia weight for position updates. The resulting ICPO algorithm achieves superior population diversity and quality, enabling an effective balance between global exploration and local exploitation while reducing susceptibility to local optima. Consequently, both optimization accuracy and convergence speed are improved. Statistical validation using the Wilcoxon rank-sum test across 12 benchmark functions confirms ICPO’s superiority over CPO, SSA, WOA, and PSO in mean values, standard deviations, and convergence behavior. Specifically, results on unimodal and multimodal functions validate the effectiveness of the logistic-tent mapping and the refraction-Cauchy hybrid mechanism, while performance on composite multimodal functions demonstrates the adaptive spiral search and inertia weight strategies’ capacity to balance exploration and exploitation.
  • The ICPO-XGBoost model achieved precision, recall, and F1-score ranges of 84.8–99.2%, 87.5–100.0%, and 86.2–99.27%, respectively, for classifying risky driving behaviors such as normal driving, slow driving, close car-following, sudden acceleration/deceleration, frequent lane changes, and aggressive lane changes. Compared to the XGBoost model, these metrics improved by 1.5–75.8%, 1.8–52.2%, and 1.7–71.9%, respectively. The ICPO-XGBoost model effectively identified sudden acceleration/deceleration behaviors, enhancing the applicability of risky driving behavior classification and recognition results. When the iteration count and population size of the ICPO-XGBoost model were set to 40 and 30, respectively, the model achieved optimal overall recognition performance. Excessively large settings for these two parameters did not significantly improve classification accuracy but substantially increased the runtime of the model.
This study is based on vehicle trajectory data of risky driving behaviors, without considering the mechanisms of influence between factors such as road type, geometric design, traffic operating conditions, driver characteristics, and traffic accidents on risky driving behaviors. Future research directions include the following:
  • Quantitatively analyze the effects of factors such as road type, geometric design, traffic operating conditions, driver characteristics, and traffic accidents on risky driving behaviors. Develop a classification indicator system for risky driving behaviors that incorporates factors such as vehicle acceleration and lane occupancy time, and propose a more refined method for classifying risky driving behaviors.
  • Based on the quantitative analysis results of influencing factors for different types of risky driving behaviors, improve the optimization mechanism and structure of the crested porcupine optimizer. Design a deep learning approach that can adjust hyperparameters and the weights of influencing factors in real time according to different traffic operating environments and risky driving behavior characteristics, thereby enhancing the accuracy and robustness of the classification and identification model for risky driving behaviors.

Author Contributions

Conceptualization, T.S. and X.L.; Data curation, S.L., Y.L. and X.L.; Funding acquisition, Q.H.; Investigation, T.S., X.Y. and Q.H.; Methodology, Q.H. and X.L.; Software, J.S., F.T. and X.L.; Supervision, Q.H., and X.L.; Validation, J.S., F.T. and S.L.; Visualization, F.T., X.Y., Q.H. and Y.L.; Writing—original draft, Q.H. and X.L.; Writing—review and editing, J.S., T.S., X.Y. and S.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Lanzhou 2025 Annual Philosophy and Social Sciences Planning Project (grant number 25-A21), the Young Scholars Science Foundation of Lanzhou Jiaotong University (grant number 2025021), and the National Natural Science Foundation of China (grant number 72571121).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data will be made available on request from the author.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
CPOCrested Porcupine Optimizer
ICPOImproved Crested Porcupine Optimizer
SSASalp Swarm Algorithm
WOAWhale Optimization Algorithm
PSOParticle Swarm Optimization

References

  1. Pérez-Sala, L.; Curado, M.; Tortosa, L.; Vicent, J.F. Deep learning model of convolutional neural networks powered by a genetic algorithm for prevention of traffic accidents severity. Chaos Solit. Fract. 2023, 169, 113245. [Google Scholar] [CrossRef]
  2. Gao, X.; Ci, Y.; Yuen, K.F.; Wu, L.; Li, R. Hybrid traffic flow prediction model for emergency scenarios with scarce historical data. Eng. Appl. Artif. Intell. 2025, 145, 110219. [Google Scholar] [CrossRef]
  3. Ma, X.; Huo, Z.; Lu, J.; Wong, Y.D. Deep forest with SHapley additive explanations on detailed risky driving behavior data for freeway crash risk prediction. Eng. Appl. Artif. Intell. 2025, 141, 109787. [Google Scholar] [CrossRef]
  4. Zhang, J.; Pei, Y.; Sun, J.; Lai, Y.; Wang, S.; Easa, S.M. Achieving bus electrification: Strategy for bus fleet replacement in cold region. Transp. Res. D Transp. Environ. 2025, 145, 104825. [Google Scholar] [CrossRef]
  5. Qi, W.; Ma, S.; Fu, C. An improved car-following model considering the influence of multiple preceding vehicles in the same and two adjacent lanes. Phys. A 2023, 632, 129356. [Google Scholar] [CrossRef]
  6. Chen, Y.; Wang, K.; Lu, J.J. Feature selection for driving style and skill clustering using naturalistic driving data and driving behavior questionnaire. Accid. Anal. Prev. 2023, 185, 107022. [Google Scholar] [CrossRef] [PubMed]
  7. Fei, M.; Zhou, W.; Zhao, H.; Pan, C.; Shi, D.; An, X. Enhancing Driving Safety Evaluation Through Correlation Analysis of Driver Behavior. Sustainability 2025, 17, 4067. [Google Scholar] [CrossRef]
  8. Chen, S.; Xue, Q.; Zhao, X.; Xing, Y.; Lu, J.J. Risky driving behavior recognition based on vehicle trajectory. Int. J. Environ. Res. Public Health 2021, 18, 12373. [Google Scholar] [CrossRef]
  9. Zhu, S.; Li, C.; Fang, K.; Peng, Y.; Jiang, Y.; Zou, Y. An Optimized Algorithm for Dangerous Driving Behavior Identification Based on Unbalanced Data. Electronics 2022, 11, 1557. [Google Scholar] [CrossRef]
  10. Wen, J.; Xu, Y.; Dai, M.; Lyu, N. Mathematical Modeling and Parameter Estimation of Lane-Changing Vehicle Behavior Decisions. Mathematics 2025, 13, 1014. [Google Scholar] [CrossRef]
  11. Ma, L.; Qu, S.; Song, L.; Zhang, J.; Ren, J. Human-like car-following modeling based on online driving style recognition. Electron. Res. Arch. 2023, 31, 3264–3290. [Google Scholar] [CrossRef]
  12. Li, J.; Wang, J.; Long, X.; Zhang, H.; Xie, M. Prediction of following vehicles’ longitudinal game behaviour in lane-changing game scenarios considering driving style. Transp. B Transp. Dyn. 2025, 13, 2553218. [Google Scholar] [CrossRef]
  13. Bagheri, E.; Barshooi, A.H. Nighttime driver behavior prediction using taillight signal recognition via CNN-SVM classifier. Vis. Comput. 2025, 41, 6219–6235. [Google Scholar] [CrossRef]
  14. Jahangiri, A.; Berardi, V.J.; Machiani, S.G. Application of real field connected vehicle data for aggressive driving identification on horizontal curves. IEEE Trans. Intell. Transp. Syst. 2017, 19, 2316–2324. [Google Scholar] [CrossRef]
  15. Xing, Z.; Huang, M.; Peng, D. Overview of machine learning-based traffic flow prediction. Digit. Transp. Saf. 2023, 2, 164–175. [Google Scholar] [CrossRef]
  16. Xiao, D.; Zhang, B.; Chen, Z.; Xu, X.; Du, B. Connecting tradition with modernity: Safety literature review. Digit. Transp. Saf. 2023, 2, 1–11. [Google Scholar] [CrossRef]
  17. Shangguan, Q.; Fu, T.; Wang, J.; Fang, S.; Fu, L. A proactive lane-changing risk prediction framework considering driving intention recognition and different lane-changing patterns. Accid. Anal. Prev. 2022, 164, 106500. [Google Scholar] [CrossRef]
  18. Chen, K.; Diao, Y.; Wang, Y.; Zhang, X.; Zhou, Y.; Gu, M.; Zhang, B.; Hu, B.; Li, M.; Li, W.; et al. MCT-CNN-LSTM: A Driver Behavior Wireless Perception Method Based on an Improved Multi-Scale Domain-Adversarial Neural Network. Sensors 2025, 25, 2268. [Google Scholar] [CrossRef] [PubMed]
  19. Wu, J.; Yue, T.; Zhang, M.; Lv, B.; Tian, Y.; Wang, J. Driving Behavior Characterization in Expressway Merging Areas Based on Roadside LiDAR. IEEE Sens. J. 2025, 25, 18481–18491. [Google Scholar] [CrossRef]
  20. Liu, X.; Huang, H.; Bian, J.; Zhou, R.; Wei, Z.; Zhou, H. Generating intersection pre-crash trajectories for autonomous driving safety testing using Transformer Time-Series Generative Adversarial Networks. Eng. Appl. Artif. Intell. 2025, 160, 111995. [Google Scholar] [CrossRef]
  21. Ma, C.; Liu, T. Survey of short-term traffic flow prediction based on LSTM. Int. J. Mod. Phys. C 2025, 36, 2450177. [Google Scholar] [CrossRef]
  22. Zhao, D.; Zhao, S. Sparse least squares support vector machine based methods for vehicle driving behavior recognition. Proc. Inst. Mech. Eng. D J. Automob. Eng. 2023, 238, 1392–1404. [Google Scholar] [CrossRef]
  23. Aljohani, A.A. Real-time driver distraction recognition: A hybrid genetic deep network based approach. Alex. Eng. J. 2023, 66, 377–389. [Google Scholar] [CrossRef]
  24. Yang, X.; Xiang, K.; Yuan, S.; Huang, J. Vehicle Driving Behavior Recognition and Optimization Strategies Based on Cloud Computing and SSA-BP Algorithm. Stud. Inform. Control. 2024, 33, 17–28. [Google Scholar] [CrossRef]
  25. Abdel-Basset, M.; Mohamed, R.; Abouhawwash, M. Crested Porcupine Optimizer: A new nature-inspired metaheuristic. Knowl.-Based Syst. 2024, 284, 111257. [Google Scholar] [CrossRef]
  26. Li, J.; Bai, J.; Wang, J. High-Precision Trajectory-Tracking Control of Quadrotor UAVs Based on an Improved Crested Porcupine Optimiser Algorithm and Preset Performance Self-Disturbance Control. Drones 2025, 9, 420. [Google Scholar] [CrossRef]
  27. Chen, F.; Liu, X.Q.; Yang, J.J.; Liu, X.K.; Ma, J.H.; Chen, J.; Xiao, H.Y. Traffic accident severity prediction based on an enhanced MSCPO-XGBoost hybrid model. Sci. Rep. 2025, 15, 25729. [Google Scholar] [CrossRef]
  28. Duan, N.; Zeng, Y.; Dao, F.; Xu, S.; Luo, X. Fault Diagnosis of Hydro-Turbine Based on CEEMDAN-MPE Preprocessing Combined with CPO-BILSTM Modelling. Energies 2025, 18, 1342. [Google Scholar] [CrossRef]
  29. Zhang, H.; Guo, C.; Zhai, D.; Wang, Y.; Liu, H.; Chen, F.; Xu, D. Application of Improved Crown Porcupine Optimizer in UAV Path Planning Based on Dynamic Weighted JAYA-CPO Attack Strategy. Prot. Control Mod. Power Syst. 2025, 10, 101–127. [Google Scholar] [CrossRef]
  30. Wang, H.; Zhang, L.; Liu, B. Research and design of a hybrid DV-hop algorithm based on the chaotic crested porcupine optimizer for wireless sensor localization in smart farms. Agriculture 2024, 14, 1226. [Google Scholar] [CrossRef]
  31. Liu, S.; Jin, Z.; Lin, H.; Lu, H. An improve crested porcupine algorithm for UAV delivery path planning in challenging environments. Sci. Rep. 2024, 14, 20445. [Google Scholar] [CrossRef]
  32. Adalja, D.; Patel, P.; Mashru, N.; Jangir, P.; Jangid, R.; Gulothungan, G.; Khishe, M. A new multi objective crested porcupines optimization algorithm for solving optimization problems. Sci. Rep. 2025, 15, 14380. [Google Scholar] [CrossRef] [PubMed]
  33. Gao, Q.; Jin, A.; Wang, C.; Zhang, L.; Zhang, Q.; Xiong, X.; Yang, F. AEGWCPO: A cooperative path planning method for UAV swarm penetration in complex mountainous environments. Meas. Sci. Technol. 2025, 36, 116301. [Google Scholar] [CrossRef]
  34. Chen, S.; Chen, C.; Li, Y.; Meng, L.; Wei, L.; Guan, B. Optimization of Operating Parameters Scheme for Water Injection System Based on a Hybrid Particle Swarm–Crested Porcupine Algorithm. Sustainability 2025, 17, 8057. [Google Scholar] [CrossRef]
  35. Liu, H.; Zhou, R.; Zhong, X.; Yao, Y.; Shan, W.; Yuan, J.; Xiao, J.; Ma, Y.; Zhang, K.; Wang, Z. Multi-strategy enhanced crested porcupine optimizer: CAPCPO. Mathematics 2024, 12, 3080. [Google Scholar] [CrossRef]
  36. Sriprateep, K.; Pitakaso, R.; Khonjun, S.; Srichok, T.; Luesak, P.; Gonwirat, S.; Kaewta, C.; Kosacka-Olejnik, M.; Enkvetchakul, P. Multi-objective optimization of resilient, sustainable, and safe urban bus routes for tourism promotion using a hybrid reinforcement learning algorithm. Mathematics 2024, 12, 2283. [Google Scholar] [CrossRef]
  37. Gao, Z.-M.; Zhao, J.; Zhang, Y.-J. Review of chaotic mapping enabled nature-inspired algorithms. Math. Biosci. Eng. 2022, 19, 8215–8258. [Google Scholar] [CrossRef]
  38. Zhang, J.; He, Q.; Lu, X.; Xiao, S.; Wang, N. A FIG-IWOA-BiGRU Model for Bus Passenger Flow Fluctuation Trend and Spatial Prediction. Mathematics 2025, 13, 3204. [Google Scholar] [CrossRef]
  39. Wang, T.; Han, Y.; Li, W.; Ye, X.; Yuan, Q. A takeover risk assessment approach based on an improved ANP-XGBoost algorithm for human-machine driven vehicles. IEEE Access 2024, 12, 48379–48387. [Google Scholar] [CrossRef]
  40. Wang, J.; Fu, T.; Shangguan, Q. Wide-area vehicle trajectory data based on advanced tracking and trajectory splicing technologies: Potentials in transportation research. Accid. Anal. Prev. 2023, 186, 107044. [Google Scholar] [CrossRef]
  41. Yuan, Q.; Yan, R.; Tan, A.Y.X.; Xu, Q.; Wang, J. Technology roadmap of risk identification and collision avoidance decision-making in autonomous vehicles for domestic animals. Int. J. Crashworthiness 2025, 30, 294–305. [Google Scholar] [CrossRef]
  42. Tatarczak, A.; Gola, A. An integrated fuzzy multi-criteria approach for partner selection in horizontal cooperation. Arch. Transp. 2025, 74, 23–42. [Google Scholar] [CrossRef]
Figure 1. Principle of refraction: opposition-based learning.
Figure 1. Principle of refraction: opposition-based learning.
Sustainability 18 02804 g001
Figure 2. Statistical results of benchmark test function simulations.
Figure 2. Statistical results of benchmark test function simulations.
Sustainability 18 02804 g002
Figure 3. Convergence curves of benchmark functions.
Figure 3. Convergence curves of benchmark functions.
Sustainability 18 02804 g003aSustainability 18 02804 g003b
Figure 4. Comparison of runtime between ICPO and CPO algorithms.
Figure 4. Comparison of runtime between ICPO and CPO algorithms.
Sustainability 18 02804 g004
Figure 5. Framework of the ICPO-XGBoost risk driving behavior classification model.
Figure 5. Framework of the ICPO-XGBoost risk driving behavior classification model.
Sustainability 18 02804 g005
Figure 6. Lateral speed smoothing.
Figure 6. Lateral speed smoothing.
Sustainability 18 02804 g006
Figure 7. Longitudinal speed smoothing.
Figure 7. Longitudinal speed smoothing.
Sustainability 18 02804 g007
Figure 8. Parallel misalignment smoothing.
Figure 8. Parallel misalignment smoothing.
Sustainability 18 02804 g008
Figure 9. Statistics of risk driving behavior recognition data.
Figure 9. Statistics of risk driving behavior recognition data.
Sustainability 18 02804 g009
Figure 10. Fitness values.
Figure 10. Fitness values.
Sustainability 18 02804 g010
Figure 11. Confusion matrix.
Figure 11. Confusion matrix.
Sustainability 18 02804 g011
Figure 12. Classification and recognition results of risky driving behavior: (a) ICPO-XGBoost; (b) PSO-LSSVM; (c) XGBoost; (d) Random Forest.
Figure 12. Classification and recognition results of risky driving behavior: (a) ICPO-XGBoost; (b) PSO-LSSVM; (c) XGBoost; (d) Random Forest.
Sustainability 18 02804 g012aSustainability 18 02804 g012b
Figure 13. The overall performance index of the model.
Figure 13. The overall performance index of the model.
Sustainability 18 02804 g013
Figure 14. Impact of model parameters on recognition results.
Figure 14. Impact of model parameters on recognition results.
Sustainability 18 02804 g014
Figure 15. SHAP values of model influencing factors.
Figure 15. SHAP values of model influencing factors.
Sustainability 18 02804 g015
Table 1. Information on the 12 benchmark test functions.
Table 1. Information on the 12 benchmark test functions.
TypeFunctionDimensionSearch RangeTheoretical Optimum
Unimodal benchmark test functions f 1 ( x ) = i = 1 n x i 2 30 [ 100 , 100 ] 0
f 2 ( x ) = i = 1 n x i + i = 1 n x i 30 [ 10 , 10 ] 0
f 3 ( x ) = i = 1 n 1 100 x i + 1 x i 2 2 + x i 1 2 30 [ 30 , 30 ] 0
f 4 ( x ) = i = 1 n x i + 0.5 2 30 [ 100 , 100 ] 0
Multimodal benchmark test functions F 5 ( x ) = i = 1 n x i sin x i 30 [ 500 , 500 ] 418.98 × D i m n
F 6 ( x ) = i = 1 n x i 2 10 cos 2 π x i + 10 30 [ 5.12 , 5.12 ] 0
F 7 ( x ) = 1 4000 i = 1 n x i 2 i = 1 n cos x i i + 1 30 [ 600 , 600 ] 0
F 8 ( x ) = 0.1 sin 2 3 π x 1 + i = 1 n x i 1 2 1 + sin 2 3 π x i + 1 + ( x n 1 ) 2 1 + sin 2 2 π x n + i = 1 n u x i , 5 , 100 , 4 30 [ 50 , 50 ] 0
Composite modalities benchmark test functions F 9 ( x ) = i = 1 11 a i x 1 ( b i 2 + b 1 x 2 ) b i 2 + b 1 x 3 + x 4 2 4 [ 5 , 5 ] 0.0003
F 10 ( x ) = 1 + ( x 1 + x 2 + 1 ) 2 ( 19 14 x 1 + 3 x 1 2 14 x 2 + 6 x 1 x 2 + 3 x 2 2 ) × 30 + ( 2 x 1 3 x 2 ) 2 × ( 18 32 x 1 + 12 x 1 2 + 48 x 2 36 x 1 x 2 + 27 x 2 2 ) 2 [ 2 , 2 ] 3
F 11 ( x ) = i = 1 7 ( X a i ) ( X a i ) T + c i 1 4 [ 0 , 10 ] −10.4028
F 12 ( x ) = i = 1 10 ( X a i ) ( X a i ) T + c i 1 4 [ 0 , 10 ] −10.5363
Table 2. Simulation results of benchmark test functions.
Table 2. Simulation results of benchmark test functions.
Test FunctionMetricICPOCPOSSAWOAPSO
f1Average5.63 × 10−2395.27 × 10−974.11 × 10−393.58 × 10−753.59 × 102
Standard02.80 × 10−962.24 × 10−381.05 × 10−742.18 × 102
f2Average4.85 × 10−1203.30 × 10−382.10 × 10−211.84 × 10−501.76 × 101
Standard2.64 × 10−1191.81 × 10−371.09 × 10−209.44 × 10−501.01 × 101
f3Average1.56 × 10−042.70 × 1012.58 × 1012.80 × 1011.62 × 104
Standard3.91 × 10−045.78 × 10−13.54 × 10−14.53 × 10−11.31 × 104
f4Average5.55 × 10−72.09 × 10−12.50 × 10−53.82 × 10−13.40 × 102
Standard8.48 × 10−77.18 × 10−21.90 × 10−51.64 × 10−11.97 × 102
f5Average−1.16 × 104−9.98 × 103−9.71 × 103−5.10 × 103−5.10 × 103
Standard1.79 × 1032.65 × 1034.33 × 1024.77 × 1024.77 × 102
f6Average0007.58 × 10−153.76
Standard0002.47 × 10−146.71
f7Average6.23 × 10−89.75 × 10−78.74 × 10−31.86 × 10−25.35
Standard1.06 × 10−71.07 × 10−62.38 × 10−39.01 × 10−32.47
f8Average5.70 × 10−77.50 × 10−41.44 × 10−14.70 × 10−12.32 × 101
Standard7.71 × 10−72.79 × 10−33.57 × 10−22.47 × 10−12.92 × 101
f9Average3.14 × 10−43.07 × 10−43.08 × 10−41.72 × 10−37.99 × 10−3
Standard1.48 × 10−58.29 × 10−92.81 × 10−85.07 × 10−39.10 × 10−3
f10Average3.003.003.003.003.90
Standard6.59 × 10−51.69 × 10−154.11 × 10−43.60 × 10−94.93
f11Average−1.04 × 101−1.02 × 101−7.47−1.01 × 101−9.37
Standard2.47 × 10−69.70 × 10−13.261.392.38
f12Average−1.05 × 101−1.05 × 101−6.66−1.01 × 101−1.02 × 101
Standard3.43 × 10−63.12 × 10−53.591.751.05
Table 3. Wilcoxon Rank-Sum test p-values.
Table 3. Wilcoxon Rank-Sum test p-values.
Test FunctionCP1CP2CP3CP4
f12.78 × 10−221.26 × 10−831.26 × 10−832.46 × 10−82
f21.05 × 10−522.51 × 10−821.26 × 10−834.88 × 10−81
f31.26 × 10−831.26 × 10−831.26 × 10−831.26 × 10−83
f41.26 × 10−831.26 × 10−831.26 × 10−831.26 × 10−83
f51.29 × 10−831.27 × 10−831.27 × 10−831.28 × 10−83
f61.16 × 10−158.44 × 10−412.67 × 10−851.26 × 10−83
f71.26 × 10−831.26 × 10−831.26 × 10−831.26 × 10−83
f81.26 × 10−831.26 × 10−831.26 × 10−831.26 × 10−83
f92.76 × 10−193.16 × 10−491.26 × 10−831.26 × 10−83
f103.34 × 10−211.26 × 10−832.50 × 10−51.26 × 10−83
f111.26 × 10−831.26 × 10−831.26 × 10−831.26 × 10−83
f121.26 × 10−831.26 × 10−831.26 × 10−831.26 × 10−83
Table 4. Algorithm MAE ranking.
Table 4. Algorithm MAE ranking.
AlgorithmMAERank
ICPO8.31 × 1011
CPO2.18 × 1022
SSA2.41 × 1023
WOA6.25 × 1024
PSO2.04 × 1035
Table 5. p-values of the Wilcoxon rank-sum test.
Table 5. p-values of the Wilcoxon rank-sum test.
Test FunctionPC1PC2PC3PC4
f11.78 × 10−223.26 × 10−535.16 × 10−717.46 × 10−82
f21.05 × 10−322.51 × 10−553.26 × 10−734.88 × 10−81
f32.26 × 10−245.26 × 10−374.26 × 10−631.26 × 10−83
f41.64 × 10−532.47 × 10−633.64 × 10−737.67 × 10−89
f58.77 × 10−633.73 × 10−437.23 × 10−531.28 × 10−87
f61.34 × 10−158.42 × 10−412.67 × 10−751.66 × 10−85
f71.47 × 10−136.26 × 10−367.63 × 10−536.46 × 10−92
f87.77 × 10−432.45 × 10−573.68 × 10−731.26 × 10−88
f92.75 × 10−193.98 × 10−414.66 × 10−627.27 × 10−83
Table 6. Comparison of feature recognition performance metrics across models.
Table 6. Comparison of feature recognition performance metrics across models.
CategoryPrecision (%)Recall (%)F1-Score (%)
ICPO-XGBoostPSO-LSSVMXGBoostRandom ForestICPO-XGBoostPSO-LSSVMXGBoostRandom ForestICPO-XGBoostPSO-LSSVMXGBoostRandom Forest
Normal Driving93.089.149.149.592.389.168.468.092.689.157.157.3
Slow Driving99.295.597.186.499.286.355.456.799.290.770.668.5
Close Car-following99.290.097.791.996.089.394.290.497.689.795.991.1
Sudden Acceleration/Deceleration84.849.49.010.587.555.935.319.486.252.414.313.6
Frequent Lane Changing98.172.782.959.2100.076.969.067.499.074.875.363.0
Aggressive Lane Changing98.487.182.584.7100.087.888.887.099.287.485.585.8
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

Su, J.; Shen, T.; Tang, F.; You, X.; He, Q.; Lu, X.; Li, Y.; Luo, S. Recognizing Risk Driving Behaviors with an Improved Crested Porcupine Optimizer and XGBoost. Sustainability 2026, 18, 2804. https://doi.org/10.3390/su18062804

AMA Style

Su J, Shen T, Tang F, You X, He Q, Lu X, Li Y, Luo S. Recognizing Risk Driving Behaviors with an Improved Crested Porcupine Optimizer and XGBoost. Sustainability. 2026; 18(6):2804. https://doi.org/10.3390/su18062804

Chicago/Turabian Style

Su, Juan, Tong Shen, Fuli Tang, Xue You, Qingling He, Xiaojuan Lu, Yikang Li, and Shenglin Luo. 2026. "Recognizing Risk Driving Behaviors with an Improved Crested Porcupine Optimizer and XGBoost" Sustainability 18, no. 6: 2804. https://doi.org/10.3390/su18062804

APA Style

Su, J., Shen, T., Tang, F., You, X., He, Q., Lu, X., Li, Y., & Luo, S. (2026). Recognizing Risk Driving Behaviors with an Improved Crested Porcupine Optimizer and XGBoost. Sustainability, 18(6), 2804. https://doi.org/10.3390/su18062804

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

Article Metrics

Back to TopTop