DOI : https://doi.org/10.5281/zenodo.19731732
- Open Access

- Authors : Kartavya Sharma, Hardik Mahajan
- Paper ID : IJERTV15IS041886
- Volume & Issue : Volume 15, Issue 04 , April – 2026
- Published (First Online): 24-04-2026
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
Automated Brain Tumor Detection using MRI Images and ResNet18-based Deep Learning Approach
Kartavya Sharma
Chandigarh University Punjab, India
Hardik Mahajan
Chandigarh University Punjab, India
Abstract: – Detecting brain tumors at an early stage is important for timely treatment and improving patient outcomes [1], [2]. In this work, a deep learning-based system is developed to automatically classify brain MRI images into tumor and non- tumor categories[3], [4]. The approach makes use of transfer learning by adapting a pre-trained ResNet18 model, allowing effective feature extraction even with a limited dataset [5], [6].
The system combines preprocessing, feature extraction, and classification into a single pipeline. MRI images are resized, normalized, and passed through the modified ResNet18 network, where only the final layers are trained for the specific classification task [7]. The trained model achieves an accuracy of nearly 93% on the test dataset, while also maintaining strong recall in detecting tumor cases.
To make the system usable beyond experimentation, a Flask-based web interface is implemented, enabling users to upload MRI images and obtain predictions along with confidence scores. This adds a practical aspect to the work and demonstrates how such models can be integrated into real-world applications. The results suggest that transfer learning-based models can effectively support medical image analysis, although further improvements using larger datasets and advanced architectures can enhance performance [8], [9].
Keywords: Brain Tumor Detection, Magnetic Resonance Imaging (MRI), Deep Learning, Convolutional Neural Networks (CNN), Transfer Learning, ResNet18 Architecture, Medical Image Analysis, Image Classification, Computer-Aided Diagnosis (CAD), Feature Extraction, Biomedical Imaging, Neural Network Optimization
-
INTRODUCTION
Brain tumors are among the critical neurological conditions that can significantly impact human life if not detected at an early stage [1], [10]. They arise due to abnormal cell growth within the brain, which may either remain localized (benign) or spread aggressively (malignant) [11]. The severity of the condition depends on factors such as tumor type, size, and location, often
affecting essential brain functions like memory, coordination, and vision [12].
Accurate and timely diagnosis is essential for effective treatment planning. In clinical practice, Magnetic Resonance Imaging (MRI) is commonly used to examine brain abnormalities due to its ability to capture detailed soft tissue structures [13], [14]. However, analyzing MRI scans manually requires expertise and can be time-intensive, especially when dealing with a large number of images [15]. This creates a need for automated systems that can assist in identifying patterns that may not be easily visible [16].
Recent developments in deep learning have opened new possibilities in medical image analysis. Models based on Convolutional Neural Networks (CNNs) can learn complex visual features directly from raw images, reducing the dependency on manual feature extraction [3], [17]. Among these, transfer learning using pre-trained models such as ResNet18 has shown promising results, particularly when working with smaller datasets [5], [18].
In this study, we propose a brain tumor detection system based on the ResNet18 architecture using transfer learning. The model is trained on MRI brain images to classify them into tumor and non-tumor categories. Additionally, a Flask-based web application is developed to enable real-time image upload and prediction, making the system more practical and user- friendly.
I(i) UNDERSTANDING BRAIN TUMOR
A brain tumor is an abnormal and uncontrolled growth of cells within the brain that can interfere with normal neurological functions[11], [12]. These tumors may be classified as benign (non-cancerous) or malignant (cancerous), depending on their growth rate and ability to spread [19]. Malignant tumors are more aggressive and can significantly affect brain functionality
by damaging surrounding tissues. The symptoms of brain tumors vary depending on their size, type, and location in the brain. Common symptoms include persistent headaches, seizures, blurred vision, difficulty in speech, memory loss, and loss of coordination [20]. One of the major challenges in brain tumor diagnosis is that these symptoms often overlap with other neurological disorders, making early detection difficult without imaging techniques [21].
Magnetic Resonance Imaging (MRI) is widely used for brain tumor detection because it provides high-resolution images of soft brain tissues [13], [22]. MRI scans help in clearly distinguishing abnormal tissue structures, making them suitable for automated analysis using computer vision and deep learning techniques. However, manual interpretation of MRI scans requires expertise and is time-consuming, which increases the demand for automated diagnostic systems [15].
I(ii) DATASET DISCUSSION
The dataset used in this study consists of MRI brain images categorized into two classes:
-
Tumor
-
No Tumor
The dataset is organized in a directory structure compatible with PyTorchs ImageFolder utility, where each class is stored in a separate folder. The dataset is divided into training and testing sets:
dataset/train/ & dataset/test/
Each image is automatically labeled based on its folder name.
TABLE 1: Dataset Description
Parameter
Description
Data Type
MRI Brain Images
Classes
Tumor, No Tumor
Directory Structure
train/, test/
Image Size
224 x 224 pixels
Color Channels
3 (RGB)
Dataset Split
Training and Testing
Labelling Method
Folder-based (ImageFolder)
Preprocessing Steps:
Before feeding images into the model, several preprocessing steps are applied:
-
Image Resizing:
All images are resized to 224 × 224 pixels, which is the
required input size for ResNet18.
-
Data Augmentation:
Random horizontal flipping is applied to training images to improve generalization and reduce overfitting.
-
Normalization:
-
Images are normalized using ImageNet statistics: Mean = [0.485, 0.456, 0.406]
Standard Deviation = [0.229, 0.224, 0.225]
This ensures compatibility with the pre-trained ResNet18 model.
Data Loading:
The dataset is loaded using PyTorch DataLoader with: Batch size = 32
Shuffle enabled for training set only
This improves computational efficiency and ensures proper
randomization during training.
TABLE 2: Image Preprocessing Techniques
Technique
Purpose
Resizing
Standardize input size (224 x 224)
Normalization
Match ImageNet distribution
Horizontal Flip
Data augmentation, reduce overfitting
Tensor Conversion
Convert images to PyTorch tensors
This helps handle dataset imbalance.
Optimizer:
Adam optimize Learning rate = 0.001
Only parameters of the final fully connected layer are updated
Training Configuration: Number of epochs: 5 Batch size: 32
Input image size: 224 × 224 Device: Apple Metal Performance Shaders (MPS) if available
Training mode: Mini-batch gradient descent
-
-
PROPOSED METHODOLOGY
System Workflow:
The proposed system is based on a transfer learning approach using ResNet18, a deep convolutional neural network pre- trained on the ImageNet dataset [5], [18]. The system is designed to classify MRI brain images into tumor and no tumor categories.
Model Architecture:
The architecture used in this project is based on ResNet18 with a modified classification head.
Base Model: ResNet18 Pretrained on ImageNet dataset
All convolutional layers are frozen (weights not updated during training)
Loss Function and Optimization: CrossEntropyLoss
Class weights applied:
Tumor class = 2.0
No Tumor class = 1.0
Training Procedure:
The training process follows:
-
Forward pass of input
images through ResNet18
-
Loss calculation using CrossEntropyLoss
-
Backpropagation of gradients
-
Weight updates using Adam optimizer
-
Loss tracking for each epoch
The average loss per epoch is recorded to observe convergence behavior.
System Model Description:
The system can be represented as a layered pipeline: Input Layer: MRI brain scan images
Preprocessing Layer: resizing, normalization, augmentation Feature Extraction Layer: ResNet18 convolutional backbone (frozen weights)
Classification Layer: custom fully connected neural network
Output Layer: binary prediction (Tumor / No Tumor)
TABLE 3: Model Architecture Description
Component
Description
Base Model
ResNET18 (Pretrained)
Feature Extractor
Frozen Convolutional Layers
Input Size
224 x 224 x 3
FC Layer 1
512 128
Activation
ReLU
Dropout
0.5
Output Layer
128 2
Classification Type
Binary Classification
-
-
EXISTING LITERATURE
The application of deep learning techniques for brain tumor detection has gained significant attention in recent years due to their ability to automatically learn hierarchical features from medical imaging data [3], [4], [9]. Numerous studies have explored different convolutional neural network (CNN) architectures, transfer learning strategies, and hybrid models to improve classification accuracy and reduce diagnostic time [8], [16].
Khan et al. [20] proposed a CNN-based framework for brain tumor classification using MRI images. Their model demonstrated strong performance in extracting spatial features directly from imaging data without manual feature engineering. However, the study highlighted challenges related to dataset size and generalization across different imaging sources.
Talo et al. [21] investigated the use of pre-trained deep learning models, including ResNet and VGG variants, for medical image classification tasks. Their findings indicated that transfer learning significantly improves performance, especially when working with limited datasets. ResNet-based models, in particular, showed better convergence due to residual learning, which helps mitigate the vanishing gradient problem in deeper networks.
Deepak and Ameer [22] proposed a transfer learning approach using pre-trained CNN models for brain tumor classification. Their study compared multiple architectures and concluded that deeper networks provide better feature representation but require careful fine-tuning to avoid overfitting. They also
emphasized the importance of proper preprocessing and normalization for achieving stable training performance [6], [7].
Cheng et al. [23] introduced a radiomics-based approach for brain tumor classification using MRI scans. Their method relied on handcrafted feature extraction techniques such as texture, shape, and intensity-based descriptors [10]. While the approach achieved reasonable accuracy, it was limited by dependency on manual feature design and lack of scalability compared to deep learning-based methods.
Ismael and Abdel-Qader [24] explored a hybrid CNN approach for brain tumor detection and demonstrated that combining multiple convolutional layers improves feature extraction capability. Their work highlighted that deeper architectures tend to outperform traditional machine learning methods such as SVM and Random Forest [25] when applied to complex medical imaging datasets.
In addition, several studies have focused on lightweight and optimized CNN architectures for real-time deployment. These works aim to reduce computational complexity while maintaining high accuracy, making them suitable for clinical applications and edge devices [16]. However, trade-offs between model efficiency and performance remain a key challenge.
Overall, the existing literature clearly indicates that deep learning-based approaches outperform traditional machine learning methods in brain tumor detection tasks [3], [9]. Among them, transfer learning using pre-trained models such as ResNet18 has emerged as a highly effective strategy due to its ability to leverage learned representations from large-scale datasets [18]. However, issues such as dataset imbalance, limited generalization, and lack of real-world clinical validation still persist, motivating further research in this domain.
-
RESULTS AND DISCUSSION
The proposed brain tumor detection model was evaluated using a separate test dataset consisting of MRI images categorized into Tumor and No Tumor classes. The model, based on a transfer learning approach using ResNet18[5], [18], was trained for 5 epochs and tested on unseen data to assess its generalization capability.
Parameter
Value
Epochs
5
TABLE 4: Training Parameters
Batch Size
32
Optimizer
Adam
Learning Rate
0.001
Loss Function
CrossEntropyLoss
Class Weights
[2.0, 1.0] Device
MPS / CPU
-
F1-Score: The F1-score reflects a good balance between precision and recall, indicating stable performance across both classes.
These metrics confirm that the model performs reliably across different evaluation measures and is not biased toward a single class [25].
Overall Performance:
The experimental results show that the model achieves an accuracy of approximately 93% on the test dataset. This indicates that the model is capable of effectively distinguishing between tumor and non-tumor MRI images. The use of a pre- trained ResNet18 architecture enabled efficient feature extraction [5], allowing the model to converge quickly even with a limited number of training epochs. The relatively high accuracy demonstrates that transfer learning is well-suited for medical image classification tasks where large-scale labeled datasets are not always available [16].
Confusion Matrix Analysis:
To further evaluate the classification performance, a confusion matrix was generated based on the model predictions. The confusion matrix provides insight into the distribution of correct and incorrect classifcations across both classes.
The model correctly identified a large proportion of tumor and non-tumor cases, indicating strong classification capability. The number of True Positives (Tumor correctly detected) and True Negatives (No Tumor correctly detected) was significantly higher compared to misclassifications.
A key observation is that the number of False Negatives (tumor cases predicted as non-tumor) remains low. This is particularly important in medical applications, as missing a tumor case can lead to serious consequences [15]. Similarly, the number of False Positives is also limited, which reduces unnecessary concern or further medical testing.
Overall, the confusion matrix reflects a well-balanced model with good sensitivity and specificity.
Classification Metrics:
The classification report further validates the effectiveness of
the model:
-
Precision: High precision indicates that when the model predicts a tumor, it is usually correct.
-
Recall: Strong recall for the tumor class shows the models ability to detect most actual tumor cases.
Training Performance:
The training loss observed over 5 epochs shows a consistent decreasing trend, indicating stable learning behavior. The use of the Adam optimizer with a learning rate of 0.001 contributed to smooth convergence.
The inclusion of a dropout layer (p = 0.5) in the classifier helped in reducing overfitting [17], while the use of class weights in the loss function improved the models sensitivity toward the tumor class.
TABLE 5: Model Performance
Metric
Value
Accuracy
~93%
Precision (Tumor)
High
Recall (Tumor)
High
F-1 Score
Balanced
Discussion:
The results obtained from the proposed system demonstrate that deep learning models, particularly those based on transfer learning, can achieve high accuracy in brain tumor detection tasks [3], [16]. The ResNet18 architecture effectively captures important features from MRI images, enabling accurate classification with minimal training effort.
However, certain limitations remain. Misclassifications may occur due to variations in image quality, noise, or similarities between tumor and non-tumor regions[13], [14]. Additionally, the model performance is dependent on the quality and diversity of the dataset used for training. Despite these limitations, the achieved accuracy of 93%, along with balanced classification metrics, indicates that the system can serve as a supportive tool for assisting medical professionals in early detection and diagnosis of brain tumors.
-
-
-
CHALLENGES AND FUTURE DIRECTIONS
Despite the promising performance of the proposed brain tumor detection system, several challenges and limitations need to be addressed for real-world applicability.
One of the primary challenges is the limited size and diversity of the dataset [13]. The model is trained on a relatively small and structured dataset, which may not fully represent the variability present in real clinical environments. Differences in MRI machines, imaging protocols, and patient conditions can affect model performance and generalization.
Another important challenge is class imbalance, where tumor and non-tumor samples may not be equally distributed. Although class weights were applied during training to mitigate this issue, imbalance can still influence model bias and prediction reliability.
The model also relies on transfer learning with frozen layers [18], which limits its ability to learn domain-specific low-level features from medical images. While this approach reduces training time and computational cost, it may restrict the models adaptability to more complex or unseen patterns in MRI scans. In addition, interpretability of deep learning models remains a concern [15]. The decision-making process of convolutional neural networks is not easily explainable, which can reduce trust in clinical settings. Medical professionals often require clear reasoning behind predictions, especially in critical diagnosis tasks.
Another limitation is the absence of multi-class classification, as the current system only distinguishes between tumor and non- tumor cases. In practical scenarios, identifying tumor types (such as glioma, meningioma, etc.) is equally important for treatment planning.
Future Directions:
To overcome the above challenges, several improvements can be considered:
-
Incorporating larger and more diverse datasets from multiple sources to improve model generalization
-
Fine-tuning deeper layers of ResNet18 instead of freezing all parameters to enhance feature learning
-
Exploring advanced architectures such as ResNet50,
EfficientNet, or Vision Transformers
-
Implementing multi-class classification for identifying different tumor types
-
Integrating explainable AI techniques (such as Grad-CAM) to improve interpretability
-
Developing real-time clinical deployment systems with integration into hospital workflows
-
Extending the system into a mobile or cloud-based application
for wider accessibility
Addressing these challenges can significantly enhance the robustness, accuracy, and usability of brain tumor detection systems in real-world healthcare environments.
-
-
CONCLUSION
In this paper, a deep learning-based approach for brain tumor detection using MRI images has been presented. The proposed system utilizes a transfer learning technique with the ResNet18 [5], [18] architecture to classify brain images into tumor and non-tumor categories.
The model demonstrates strong performance, achieving an accuracy of approximately 93%, along with balanced precision and recall values. The integration of preprocessing techniques, a customized classifier layer, and weighted loss function contributes to effective learning and classification.
Furthermore, the development of a Flask-based web application enhances the practical applicability of the system by enabling real-time predictions with confidence scores. This makes the model more accessible and usable as a supportive tool for medical professionals.
The results indicate that deep learning techniques have significant potential in improving the accuracy and efficiency of brain tumor detection [3], [9]. With further improvements in dataset quality, model design, and deployment strategies, such systems can play an important role in assisting early diagnosis and reducing the workload on healthcare experts.
The study highlights that automated brain tumor detection using deep learning is a promising direction for future research and can contribute to better clinical outcomes when integrated with existing medical practices.
REFERENCES
-
D. N. Louis et al., The 2016 World Health Organization classification of tumors of the central nervous system: a summary, Acta Neuropathologica, vol. 131, no. 6, pp. 803820, 2016.
-
A. Ostrom et al., CBTRUS statistical report: Primary brain and other central nervous system tumors diagnosed in the United States, Neuro- Oncology, vol. 22, no. Suppl 2, pp. iv1iv96, 2020.
-
Y. LeCun, Y. Bengio, and G. Hinton, Deep learning, Nature, vol. 521, no. 7553, pp. 436444, 2015.
-
G. Litjens et al., A survey on deep learning in medical image analysis,
Medical Image Analysis, vol. 42, pp. 6088, 2017.
-
K. He, X. Zhng, S. Ren, and J. Sun, Deep residual learning for image
recognition, in Proc. IEEE CVPR, 2016, pp. 770778.
-
O. Russakovsky et al., ImageNet large scale visual recognition challenge, International Journal of Computer Vision, vol. 115, no. 3, pp. 211252, 2015.
-
I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning. MIT Press, 2016.
-
H. Greenspan, B. van Ginneken, and R. M. Summers, Guest editorial deep learning in medical imaging, IEEE Trans. Med. Imaging, vol. 35, no. 5, pp. 11531159, 2016.
-
S. K. Zhou et al., A review of deep learning in medical imaging,
Proceedings of the IEEE, vol. 109, no. 5, pp. 820838, 2021.
-
P. Kickingereder et al., Radiomic profiling of glioblastoma, Radiology, vol. 284, no. 3, pp. 880889, 2017.
-
J. G. Cairncross and J. R. Ueki, Biology of brain tumors, New England Journal of Medicine, vol. 371, pp. 10281037, 2014.
-
M. Weller et al., Glioma, Nature Reviews Disease Primers, vol. 1, pp. 15017, 2015.
-
S. Bauer et al., A survey of MRI-based medical image analysis for brain tumor studies, Physics in Medicine & Biology, vol. 58, no. 13, pp. R97 R129, 2013.
-
E. R. Gerstner and A. H. Batchelor, Imaging of brain tumors, The New England Journal of Medicine, vol. 377, no. 12, pp. 11401151, 2017.
-
N. H. Shah et al., Artificial intelligence and machine learning in clinical development, The New England Journal of Medicine, vol. 378, pp. 2457 2459, 2018.
-
A. Esteva et al., A guide to deep learning in healthcare, Nature Medicine, vol. 25, pp. 2429, 2019.
-
N. Srivastava et al., Dropout: A simple way to prevent neural networks from overfitting, Journal of Machine Learning Research, vol. 15, pp. 19291958, 2014.
-
S. J. Pan and Q. Yang, A survey on transfer learning, IEEE Trans. Knowledge and Data Engineering, vol. 22, no. 10, pp. 13451359, 2010.
-
A. T. Villanueva-Meyer et al., Imaging of brain tumors: MR imaging and
beyond, Neuroimaging Clinics, vol. 26, no. 4, pp. 563580, 2016.
-
H. Mohsen et al., Classification using deep learning neural networks for brain tumors, Future Computing and Informatics Journal, vol. 3, no. 1,
pp. 6871, 2018.
-
E. Talo et al., Convolutional neural networks for multi-class brain disease
detection, Computerized Medical Imaging and Graphics, vol. 78, 2019.
-
S. Deepak and P. M. Ameer, Brain tumor classification using deep CNN,
Journal of Ambient Intelligence and Humanized Computing, 2020.
-
J. Cheng et al., Enhanced performance of brain tumor classification via tumor region augmentation, IEEE Trans. Med. Imaging, vol. 34, no. 12,
pp. 23232333, 2015.
-
S. A. Ismael and A. Abdel-Qader, Brain tumor classification using deep
learning, IEEE Access, vol. 8, pp. 105906105915, 2020.
-
C. M. Bishop, Pattern Recognition and Machine Learning. Springer, 2006.
