Application of an improved YOLOv5s-based deep learning model for automated detection of pulmonary adenocarcinoma in situ and minimally invasive adenocarcinoma
Zhipeng Sun, Jinghui Chen, Lianxin Xie, Tao Yang, Lanlan Yang, Chengbin Ye, Hongjia Zhao
Objective To investigate the performance and clinical application potential of an improved YOLOv5-based deep learning model for automated detection and classification of pulmonary adenocarcinoma in situ (AIS) and minimally invasive adenocarcinoma (MIA), with particular emphasis on attention mechanisms and multiscale feature fusion for small pulmonary nodule detection. Methods CT images of 225 pathologically confirmed AIS or MIA lesions treated at the Affiliated People's Hospital of Fujian University of Traditional Chinese Medicine between December 2019 and June 2025 were retrospectively collected. In the deep learning workflow, the 225 lesions were first divided at the lesion level: 27 lesions (11 MIA and 16 AIS) were set aside, and the 218 original PNG images derived from these lesions were reserved as an independent test set that was excluded from all data augmentation and model training. The remaining lesions were converted into PNG format and further augmented using horizontal flipping, yielding a final dataset of 3,000 images for training and validation. Subsequently, the dataset was partitioned into training and validation sets at an 8:2 ratio. During this process, the origins of the augmented lesion images were manually verified to ensure that an original image and its corresponding augmented variants were not assigned to different subsets simultaneously. YOLOv5s was used as the baseline model. Local contrast-spatial attention modules (LCSA and LCSAv2), BiFPN, and ASFF were incorporated for attention enhancement and multiscale feature fusion. Five-fold cross-validation was performed. Mean average precision (mAP), precision, and recall were evaluated across IoU thresholds from 0.6 to 0.9, and ablation experiments were conducted to quantify the contribution of each module. Results In the baseline model selection stage, comparison under identical conditions showed that YOLOv5s achieved detection performance comparable to YOLOv11s while reducing GFLOPs by approximately 25%; therefore, YOLOv5s was selected as the improvement baseline. In five-fold cross-validation at IoU = 0.6, baseline YOLOv5s achieved an mAP@50 (AP at the matching IoU of 0.6) of 0.947, precision of 0.849, and recall of 0.932. After LCSA x ASFF was introduced, recall increased to 0.941 and mAP@50 was maintained at 0.946. Under the stringent localization criterion of IoU = 0.9, LCSA × ASFF achieved an mAP@50 of 0.878, a 3.8-percentage-point higher value than the baseline (0.846); precision (0.879) and recall (0.773) were also the highest among all models, with the smallest performance attenuation in the high-IoU range. Ablation experiments showed that the combined use of LCSA and ASFF produced stronger synergistic effects in the high-IoU range than either module alone, whereas LCSAv2 combined with ASFF did not show the expected synergistic gain. On the independent test set, baseline YOLOv5s achieved precision, recall, and mAP@50 values of 0.747, 0.715, and 0.753, respectively; the improved LCSA × ASFF model achieved corresponding values of 0.693, 0.753, and 0.788. Recall and mAP@50 increased simultaneously, indicating better overall detection performance than the baseline. The improved YOLOv5s-based deep learning model performed better in automated detection, and the LCSA × ASFF combination improved localization accuracy while maintaining recall through the synergy between local contrast enhancement and adaptive scale fusion. Conclusion The improved YOLOv5s model achieved automated detection and classification of small pulmonary nodules through end-to-end training, showing clear advantages in clinical workflow automation without manual intervention. The synergistic effect of local contrast enhancement and adaptive scale fusion effectively improved AIS/MIA localization precision and classification accuracy, supporting its potential as an assistive tool for early lung adenocarcinoma screening, pending external multi-centre validation.