Medical image datasets, particularly those comprising Magnetic Resonance (MR) images, are essential for accurate diagnosis and treatment planning. However, these datasets often suffer from class imbalance, where certain classes of abnormalities have unequal representation. Models trained on imbalanced datasets can be biased towards the prominent class, leading to misclassification. Addressing class imbalance problems is crucial to developing robust deep-learning MR image analysis models. This research focuses on the class imbalance problem in MR image datasets and proposes a novel approach to enhance deep learning models. We have introduced a unified approach equipped with a selective attention mechanism, unified loss function, and progressive resizing. The selective attention strategy identifies prominent regions within the underlying image to find the feature maps, retaining only the relevant activations of the minority class. Finetuning of the multiple hyperparameters was achieved using a novel unified loss function that plays a vital role in enhancing the overwhelming error performance for minority classes and accuracy for common classes. To address the class imbalances phenomenon, we incorporate progressive resizing that can dynamically adjust the input image size as the model trains. This dynamic nature helps handle class imbalances and improve overall performance. The research evaluates the proposed approach's effectiveness by embedding it into five state-of-the-art CNN models: UNet, FCN, RCNN, SegNet, and Deeplab-V3. For experimental purposes, we have selected five diverse MR image datasets, BUS2017, MICCAI 2015 head and neck, ATLAS, BRATS 2015, and Digital Database Thyroid Image (DDTI), to evaluate the performance of the proposed approach against state-of-the-art techniques. The assessment of the proposed approach reveals improved performance across all metrics for five different MR imaging datasets. DeepLab-V3 demonstrated the best performance, achieving IoU, DSC, Precision, and Recall scores of 0.893, 0.953, 0.943, and 0.944, respectively, on the BUS dataset. These scores indicate an improvement of 5% in DSC, 6% in IoU, 4% in precision, and approximately 4% in recall compared to the baseline. The most significant increases were observed in the ATLAS and LiTS MICCAI 2017 datasets, with a 5% and 7% increase in IoU and DSC over the baseline (DSC = 0.628, DSC = 0.695) for the ATLAS dataset, and a 5% and 9% increase in IoU and DSC for the LiTS MICCAI 2017 dataset.