Ensuring the integrity of aviation plug components is crucial for maintaining the safety and functionality of the aerospace industry. Traditional methods for detecting surface defects often show low detection probabilities, highlighting the need for more advanced automated detection systems. This paper enhances the YOLOv5 model by integrating the Generalized Efficient Layer Aggregation Network (GELAN), which optimizes feature aggregation and boosts model robustness, replacing the conventional Convolutional Block Attention Module (CBAM). The upgraded YOLOv5 architecture, incorporating GELAN, effectively aggregates multi-scale and multi-layer features, thus preserving essential information across the network’s depth. This capability is vital for maintaining high-fidelity feature representations, critical for detecting minute and complex defects. Additionally, the Focal EIOU loss function effectively tackles class imbalance and concentrates the model’s attention on difficult detection areas, thus significantly improving its sensitivity and overall accuracy in identifying defects. Replacing the traditional coupled head with a lightweight decoupled head improves the separation of localization and classification tasks, enhancing both accuracy and convergence speed. The lightweight decoupled head also reduces computational load without compromising detection efficiency. Experimental results demonstrate that the enhanced YOLOv5 architecture significantly improves detection probability, achieving a detection rate of 78.5%. This improvement occurs with only a minor increase in inference time per image, underscoring the efficiency of the proposed model. The optimized YOLOv5 model with GELAN proves highly effective, offering significant benefits for the precision and reliability required in aviation component inspections.