Abstract:Wire-endpoint detection is essential for wiring inspection in electrical experimental teaching, where small target size, complex backgrounds, and frequent occlusions often result in missed or false detections. This paper proposes MHS-YOLO, an improved YOLOv11n-based detection method. The C3k2 module is enhanced using a Multi-Scale Convolutional Block (MSCB) to improve local detail perception and contextual feature extraction. To address spatial awareness limitations in the original HSFPN, a Context Anchor Attention (CAA) mechanism is integrated, introducing anchor-guided spatial attention to reinforce regional weighting and global semantic modeling. Additionally, a Self-Ensemble Attention Mechanism (SEAM) is employed before the detection head to improve endpoint detectability under occlusion and blur by fusing multi-scale local and global features. Experiments on a custom wire-endpoint dataset demonstrate a mean average precision of 98.6%, outperforming the baseline by 1.8%, while reducing parameter count, GFLOPs, and model size by 26.1%, 11.1%, and 23.1%, respectively. These results validate the method"s effectiveness in balancing accuracy and lightweight deployment for experimental wiring inspection.