MECSA: a multi-scale enhanced channel and spatial attention module for robust pedestrian detection
摘要
Pedestrian detection remains a challenging task in computer vision due to frequent issues such as occlusion, scale variation, and low illumination, which are commonly encountered in surveillance, autonomous navigation, and real-world environments. While recent advances in deep learning-based object detectors, such as YOLO, have shown promise, their performance can still degrade in complex scenarios. To address this, we propose YOLOv7-MECSA, an enhanced variant of YOLOv7 that integrates a novel attention mechanism, called MECSA (Multi-scale Enhanced Channel and Spatial Attention), into its backbone architecture. The MECSA module introduces a dual attention mechanism that strengthens both channel and spatial representations in a context-aware and scale-adaptive manner. It employs a multiscale pooling strategy to capture varying receptive fields, followed by adaptive 1D convolution-based channel attention, and lightweight spatial attention using 2D convolution over pooled feature maps. Experimental results on four benchmark pedestrian datasets–WiderPerson, COCO-Person, Enriched CamPed, and INRIA–demonstrate consistent improvements over state-of-the-art baselines. Specifically, YOLOv7-MECSA achieves mAP@50 gains of 6.9%, 4.9%, 5.4%, and 5.4%, respectively, compared to the baseline YOLOv7, while maintaining real-time inference (7.2 FPS) and negligible parameter overhead (36.48M vs. 36.91M). On the COCO-Person dataset, the proposed model attains mAP@50 = 0.85 and mAP@50–95 = 0.61, outperforming SE, ECA, and CBAM-based variants. Qualitative evaluations on PennFudan, LLVIP, UCSD, and CrowdHuman further confirm improved detection robustness under occlusion and low-light conditions. These findings validate the effectiveness and generalizability of the MECSA module in enhancing multi-scale feature learning for real-time pedestrian detection tasks.