Lightweight highway accident scene recognition based on improved Yolov8n
Abstract
In recent years, traffic accidents on highways have occurred frequently. An accident threatens lives and property. It also disrupts traffic. Current accident scene recognition faces challenges. Accuracy is often suboptimal. Deploying detection models in real-world scenarios is difficult due to high computational complexity and insufficient inference speed, rather than parameter size alone. These scenarios have limited computational resources. High computational complexity and low inference efficiency cause the difficulty, while model parameter size is not the only bottleneck. To address these issues, a lightweight highway accident scene recognition algorithm based on an improved YOLOv8n is proposed. This algorithm is designed with potential deployment in fixed monitoring devices installed at accident-prone highway sections in mind. It enables automatic accident detection through real-time video analysis and could promptly send alerts to traffic management centers, potentially facilitating rapid dispatch of rescue resources and traffic control, thereby offering a pathway to enhance highway safety management and emergency response efficiency. However, we note that field deployment experiments and hardware-level latency tests are not included in this study, and thus practical applicability claims remain to be validated in future work. First, MobileViT, a lightweight CNN, enhances feature extraction for highway accident targets, showing improved robustness under simulated adverse weather conditions (e.g. blurring and contrast reduction that mimic fog and rain). However, we explicitly note that these are image-space simulations; the model’s generalization to authentic foggy or rainy environments has not been tested in this study and remains a critical direction for future investigation. Second, Ghostnet and VanillaNet are added to the model’s neck network, reducing computational complexity and improving inference speed while maintaining detection accuracy and keeping parameter growth minimal in extreme weather. Finally, SlideLoss replaces the original Loss function to address sample imbalance and improve detection of complex targets. Ablation and comparative experiments were conducted using the DADA and Car Crash Dataset datasets. The proposed algorithm achieves higher average precision than traditional methods. The improved model’s average precision increased by 2.3%, from 92.8% to 95.1%, while also adhering to lightweight design principles, with computational complexity reduced from 8.2 to 7.2 and the number of parameters decreased from 3.0 M to 2.9 M. These findings confirm the algorithm’s superiority and the effectiveness of its improvements.