Improved YOLO-Based Pulmonary Nodule Detection with Spatial-SE Attention and an Aspect Ratio Penalty

Xinhang Song, Haoran Xie, Ting Gao, Nuo Cheng, Jianping GouSensors 2025 · DOI

TL;DR

This paper introduces an improved YOLOv11 model for detecting pulmonary nodules in CT scans. By incorporating a novel Spatial-SE (SSE) attention module and an Explicit Aspect Ratio Penalty IoU (EAPIoU) loss function, the model significantly enhances detection accuracy, especially for small and irregularly shaped nodules, outperforming existing state-of-the-art methods.

What Problem Does This Paper Address?

Accurately detecting pulmonary nodules is crucial for early diagnosis and treatment of lung diseases. However, this task is challenging due to the subtle nature of nodules, their small size, and variations in their shape (aspect ratio). Existing deep learning models often struggle with:

  • Inadequate Feature Representation: Standard attention mechanisms, like Squeeze-and-Excitation (SE), primarily focus on channel-wise dependencies but can overlook crucial spatial details, especially for small objects.
  • Limited Localization Sensitivity: Current Intersection over Union (IoU)-based loss functions, while improved, may not sufficiently penalize aspect ratio discrepancies, leading to less precise bounding box predictions for nodules with unusual shapes.

This paper aims to address these limitations by enhancing both the feature extraction and the bounding box regression components of a YOLOv11 detector.

Methods

The authors propose two main innovations integrated into a YOLOv11 framework:

  1. Spatial-SE (SSE) Module: This novel attention module combines the strengths of channel attention (from the original SE module) with spatial attention.
  2. Channel Attention: Similar to SE, it recalibrates channel-wise feature responses.
  3. Spatial Attention: It introduces a new branch that uses max and average pooling to extract spatial context, creating a spatial attention map. This map is then fused with the channel-attended features to guide the model to focus on critical spatial regions where nodules are likely to be. This dual-attention approach aims to improve the discriminative power of features for small objects.
  4. Explicit Aspect Ratio Penalty IoU (EAPIoU) Loss: This is a new loss function designed to improve bounding box regression.
  5. It builds upon the Complete IoU (CIoU) loss, which considers center distance and aspect ratio.
  6. The key novelty is the introduction of a squared aspect ratio difference penalty. Unlike CIoU's arctangent-based penalty, this direct squared penalty is more sensitive to aspect ratio mismatches, providing stronger gradients for better shape alignment and more accurate bounding box fitting, especially for small or irregularly shaped nodules.

Datasets

The proposed method was evaluated on three publicly available datasets:

  • LUNA16: Derived from the LIDC-IDRI dataset, containing low-dose chest CT scans with radiologist annotations. It's partitioned into ten folds for cross-validation.
  • NODE21: A chest radiograph dataset for nodule detection and synthesis, including frontal-view X-rays with bounding box annotations.
  • LungCT: A curated CT-based dataset designed for pulmonary nodule detection, featuring annotated CT slices.

Key Insights and Ideas

  • Spatial Context is Crucial for Small Objects: The paper strongly suggests that while channel attention is useful, it's insufficient for accurately detecting small objects like pulmonary nodules. Incorporating spatial attention is key to focusing on the relevant local features.
  • Direct Aspect Ratio Penalties are More Effective: The authors argue that a direct, squared penalty for aspect ratio differences in the loss function is more sensitive and effective than indirect methods (like arctangent) for improving bounding box regression accuracy, especially for challenging shapes.
  • Synergistic Improvement: The combination of the SSE attention module and the EAPIoU loss yields superior results compared to using either component alone, highlighting their complementary benefits.
  • Architecture Agnostic Potential: The SSE module and EAPIoU loss demonstrated consistent performance gains when integrated into other popular detection frameworks like Faster R-CNN and RetinaNet, suggesting their broad applicability.

Key Results

The proposed YOLOv11-EAR model achieved state-of-the-art performance across the evaluated datasets:

  • LUNA16: Achieved a precision of 0.781 and mAP@50 of 75.5%, with the highest mAP@50–90 of 33.3%.
  • LungCT: Boosted mAP@50 to 92.4%, outperforming existing IoU variants.
  • NODE21: Reached 89.1% precision and 51.4% mAP@50–90.
  • Efficiency: The model is lightweight, using only 2.5M parameters and 6.3 GFLOPs, making it suitable for real-time applications.
  • Comparison: Outperformed mainstream YOLO variants and established detectors like Faster R-CNN and RetinaNet in precision, recall, and mAP.

Limitations and Future Work

The authors acknowledge the following limitations and suggest future directions:

  • Dataset Bias: The current datasets primarily include nodules ≥ 3 mm. Further validation is needed for extremely small or heterogeneous lesions.
  • Supervised Learning: The training pipeline is fully supervised, limiting its applicability in scenarios with scarce annotations or significant domain shifts.
  • Real-time Deployment: While lightweight, further optimization is needed for deployment on mobile or edge devices.
  • Future Work:
    • Explore semi-supervised learning and domain adaptation techniques for improved transferability.
  • Integrate more efficient attention mechanisms to reduce computational cost.
  • Conduct broader evaluations on diverse datasets and private clinical repositories.

Summary updated

Abstract

The accurate identification of pulmonary nodules is critical for the early diagnosis of lung diseases; however, this task remains challenging due to inadequate feature representation and limited localization sensitivity. Current methodologies often utilize channel attention mechanisms and intersection over union (IoU)-based loss functions. Yet, they frequently overlook spatial context and struggle to capture subtle variations in aspect ratios, which hinders their ability to detect small objects. In this study, we introduce an improved YOLOV11 framework that addresses these limitations through two primary components: a spatial squeeze-and-excitation (SSE) module that concurrently models channel-wise and spatial attention to enhance the discriminative features pertinent to nodules and explicit aspect ratio penalty IoU (EAPIoU) loss that imposes a direct penalty on the squared differences in aspect ratios to refine the bounding box regression process. Comprehensive experiments conducted on the LUNA16, LungCT, and Node21 datasets reveal that our approach achieves superior precision, recall, and mean average precision (mAP) across various IoU thresholds, surpassing previous state-of-the-art methods while maintaining computational efficiency. Specifically, the proposed SSE module achieves a precision of 0.781 on LUNA16, while the EAPIoU loss boosts mAP@50 to 92.4% on LungCT, outperforming mainstream attention mechanisms and IoU-based loss functions. These findings underscore the effectiveness of integrating spatially aware attention mechanisms with aspect ratio-sensitive loss functions for robust nodule detection.
BibTeX
@inproceedings{song2025improved,
  author = {Xinhang Song and Haoran Xie and Ting Gao and Nuo Cheng and Jianping Gou},
  title = {{Improved YOLO-Based Pulmonary Nodule Detection with Spatial-SE Attention and an Aspect Ratio Penalty}},
  booktitle = {Sensors},
  year = {2025},
  doi = {10.3390/s25144245},
}
Figure