# Adaptation of Object Detection Algorithms for Road Indicator Lights in Complex Scenes
## 2 Materials and Methods  
### Overall Framework  
To better demonstrate the constructed road light object detection model applied in complex scenes, the overall architecture of the proposed algorithm model is described in detail and illustrated. Effective improvement and appropriate use of deep learning networks are of great significance in solving many practical problems in reality, and this paper aims to improve the detection performance of the model, especially the ability to recognize small objects in complex scenes, based on the YOLOv8 baseline model, and provide research value for the realization of smarter traffic life. It aims to improve the detection performance of the model, especially the recognition ability of small objects in complex scenes, and to provide research value for the realization of a more intelligent and convenient transportation life.  
When using the YOLOv8 model to complete the task of indicator light object detection in complex scenes, on the one hand, it was found that when the lights are on, the proportion of the object in the video or picture was small and the interference between different lights was severe, and there were slight differences in the type and color of the lights of different vehicles, which makes it difficult to extract features and locate them accurately; on the other hand, it was found that the number of pixels of the camera itself was relatively low, and the camera was affected by the lighting, bad weather, human influence, and so on, leading to the indicator light detection effect being not ideal, and not meeting the standards of practical applications. This paper discusses the deficiencies in detection and proposes solutions.  
In the Backbone part, the adopted backbone network is based on the design of YOLOv8, and structural optimizations such as depth-separable convolution and residual connection are introduced to enhance the feature extraction ability of the model and reduce the computational complexity. The key improvement is to add attention modules at key positions in the Neck layer, such as CBAM [21], ECA [22], SA [23], and GAM [24] attention mechanism modules, which strengthen the model's ability to focus on the object features by re-calibrating the importance of the channel and spatial dimensions of the feature maps, effectively solving the problem that the feature information of the road indicator is less and difficult to extract, and improving the feature acquisition ability in multiple dimensional layers. The acquisition ability of the features is improved in multiple dimensions. After that, the feature information acquired by multiple attention mechanisms is reorganized through the progressive feature pyramid network AFPN [25] feature fusion module, which fuses shallow high-resolution features and deep low-resolution features progressively to form a multiscale feature map rich in semantic information. The key of the AFPN is that it maintains the detailed information of the high-level features and introduces the low-level features through gradual up-sampling and fusion of detailed information while introducing the fine texture of low-level features, which is especially important for improving the accuracy of small object detection. Finally, the original CIOU loss function was replaced with a Focaler-IOU loss function more adapted to difficult sample object detection, aiming to enhance the feature representation ability of the model and improve the sample imbalance problem, especially for those objects that are difficult to locate and recognize (e.g., small or partially occluded objects). By adjusting the focus parameter in the loss function, Focal-IOU [26] can reduce the contribution of easy-to-score samples to the loss and increase the weight of difficult-to-score samples, thus improving the model's detection performance for these samples. Figure 1 shows the overall network structure diagram of our model.