ESA-YOLOv5m: a lightweight spatial and improved attention-driven detection for brain tumor MRI analysis
Maram Fahaad Almufareh1, Noshina Tariq2, Mamoona Humayun3
1Department of Information Systems, College of Computer and Information Sciences, Jouf University, Sakaka, Saudi Arabia.
Introduction:
The early and accurate detection of brain tumors is vital for improving patient outcomes, enabling timely clinical interventions, and reducing diagnostic uncertainty. Despite advances in deep learning, conventional Convolutional Neural Network (CNN)-based models often struggle with small or low-contrast tumors. They also remain computationally demanding for real-time clinical deployment.
Methods:
This study presents an Enhanced Spatial Attention (ESA)-integrated You Only Look Once v5 medium (YOLOv5m) architecture, a lightweight and efficient framework for brain tumor detection in MRI scans. The ESA module, positioned after the Spatial Pyramid Pooling-Fast (SPPF) layer, enhances feature discrimination by emphasizing diagnostically relevant regions while suppressing background noise, thereby improving localization accuracy without increasing computational complexity. Experiments were conducted on the Figshare brain tumor MRI dataset containing three tumor classes: glioma, meningioma, and pituitary.
Results:
ESA-YOLOv5m achieved a Precision of 90%, Recall of 90%, and mean Average Precision (mAP)@0.5 of 91%, surpassing the baseline YOLOv5m by approximately 11%-12%. An ablation study further confirmed that placing the ESA module after the SPPF layer yields the highest performance (mAP@0.5 = 0.91), while earlier integration produced marginally lower results. Classwise analyses demonstrated consistent gains (mAP range 0.87-0.98), and fivefold cross-validation showed stable performance (mAP@0.5 = 0.910 ± 0.006). Efficiency tests revealed negligible overhead, with less than a 4.3% increase in parameters and an average latency below 10 ms per image.
Discussion:
Overall, the results validate that integrating a lightweight spatial attention mechanism significantly enhances tumor localization and model generalization while preserving real-time inference. The proposed ESA-YOLOv5m framework provides a reliable and scalable solution for automated brain tumor detection, suitable for clinical decision-support systems and edge healthcare applications.
Related Concept Videos
Positron Emission Tomography
One of the main requirements of a PET scan is a positron-emitting radioisotope, which is produced in a cyclotron and then attached to a substance used by the part of the body...
Magnetic Resonance Imaging
Imaging Studies IV: Magnetic Resonance Imaging
Brain Imaging
These technologies include computerized axial tomography (CAT or CT scans), positron-emission tomography (PET scans), magnetic resonance imaging (MRI), functional magnetic resonance imaging (fMRI), and Transcranial Magnetic...


