## 2 Related Works
### YOLOv12 Object Detection Network  
YOLOv12 [35] marks the latest advancement in the YOLO series (You Only Look Once). In contrast to previous versions, YOLOv12 introduces architectural enhancements and incorporates state-of-the-art technologies, resulting in notable gains in both detection performance and computational efficiency. The model offers five different variants--n, s, m, l, and x--each with increasing network depth and detection accuracy to meet the varying needs of different applications. After a thorough assessment of factors such as detection precision, model complexity, and hardware compatibility, we chose YOLOv12-n as the base architecture for this research.  
As illustrated in Figure 2, the YOLOv12 architecture includes three principal components: Backbone, Neck, and Head networks. The backbone network employs the Residual Efficient Layer Aggregation Network (R-ELAN), an enhanced variant of Efficient Layer Aggregation Network (ELAN) [30] that incorporates block-level residual connections and adaptive scaling strategies. This optimization enhances feature reuse efficiency while maintaining stable gradient propagation with minimal computational overhead. The integration of 7 x 7 large-kernel separable convolutions expands the receptive field, thus increasing the model's ability to localize small and medium targets. Through meticulous optimization of modern GPU memory hierarchies, this architecture achieves improved computational throughput and reduced inference delay without affecting detection effectiveness.  
The Neck network implements an innovative Area Attention mechanism that effectively integrates multiscale features through advanced spatial information processing. This module combines FlashAttention to address memory access challenges in attention mechanisms, enabling enhanced contextual modeling while maintaining low latency. Furthermore, the optimized multiscale feature fusion strategy improves detection accuracy across different object scales.  
The detection head adopts an improved decoupled architecture from previous YOLO implementations, separating classification and localization prediction branches to mitigate inherent conflicts between these tasks. Structural innovations in the classification head replace traditional dual 3 \(\times\) 3 convolutions with a two-layer depthwise separable convolution (DWConv + 1 \(\times\) 1 convolution), achieving substantial reductions in model parameters while enhancing computational efficiency.  
After a thorough assessment of factors such as detection precision, model complexity, and hardware compatibility, we chose YOLOv12-n as the base architecture for this research. Regarding feature fusion, YOLOv12n presents a compelling architecture. As detailed earlier in this section, its backbone employs the Residual Efficient Layer Aggregation Network (R-ELAN), and its Neck network implements an innovative Area Attention mechanism. This mechanism, which leverages FlashAttention for efficiency, effectively integrates multiscale features through advanced spatial information processing, a critical capability for our task. Dangerous driving behaviors are diverse, ranging from subtle facial cues to larger-scale actions. YOLOv12n's optimized multiscale feature fusion strategy and attention mechanisms provide a robust foundation for capturing these varied features and their contextual information. Although newer versions such as YOLOv10 and YOLOv11 have introduced various advancements, and numerous improvement strategies exist within the field, YOLOv12-n offers a compelling balance of performance and speed, making it an ideal foundation for developing our YOLO-AFR model. Moreover, as a more recent release, YOLOv12 presents valuable opportunities for further refinement and innovation. The proposed modules--A2C2f-FRFN, C3k2_SC-Conv, and Detect_SEAM--are specifically designed to build upon this architecture, enhancing its key capabilities to enable more accurate and robust analysis of dangerous driving behaviors.