MedNet: a lightweight attention-augmented CNN for medical image classification.
Authors
Affiliations (3)
Affiliations (3)
- Department of Computer Science and Engineering, Gopalganj Science and Technology University, Gopalganj, 8105, Bangladesh. [email protected].
- Department of Computer Science and Information Systems, Bradley University, Illinois, 61625, USA.
- Department of Computer Science and Engineering, Gopalganj Science and Technology University, Gopalganj, 8105, Bangladesh.
Abstract
Disease detection using medical images enables early and precise diagnosis. Despite the growing success of deep learning models, accurate classification remains a significant challenge. Medical images often exhibit characteristics such as limited spatial resolution, subtle visual differences between disease categories (low inter-class variance), and substantial variation within the same class (high intra-class variability). These factors collectively hinder the ability of standard vision models to generalize effectively, frequently resulting in misclassification. These challenges highlight the need for efficient architectures that can focus on critical spatial and contextual features for reliable performance. To mitigate these challenges we propose MedNet, a lightweight CNN architecture that combines depthwise separable convolutions with the CBAM attention mechanism to efficiently extract and refine spatially and contextually relevant features. The core ResidualDSCBAMBlock captures local patterns while CBAM enhances important spatial and channel-wise information, followed by adaptive pooling, dropout, and fully connected layers for robust classification. The model is trained and validated on the DermaMNIST, BloodMNIST, OCTMNIST which from MedMNIST, and Fitzpatrick17k datasets. MedNet matches or exceeds CNN baselines across these medical image datasets achieving higher accuracy with significantly fewer parameters and lower computational cost, demonstrating its effectiveness and efficiency in medical image classification tasks. Code is available at https://github.com/Md-Ferdous/MedNet .