Evaluating the Clinical Reliability of Deep Learning Models for Brain Tumor Classification Using MRI
This repository explores whether deep learning models that achieve high accuracy on brain tumor MRI classification actually make clinically meaningful decisions. The project combines CNN models with explainable AI technique to understand where the model looks and whether that focus aligns with real medical features.
Deep learning models achieve impressive accuracy in medical imaging tasks, but most still operate as “black boxes,” making clinicians hesitant to trust them. In domains like brain MRI diagnosis—where decisions must be transparent—explainability is essential.
This project explores how reliably a CNN model classifies brain tumors by combining performance evaluation with interpretability tools such as Grad-CAM. The goal is simple:
to check whether the model is truly learning tumor-related features or relying on irrelevant patterns.
By visualizing the regions that influence the model’s predictions, the project compares:
- What the model focuses on, vs.
- What actually matters clinically.
This helps reveal whether high accuracy reflects real understanding or just statistical shortcuts.
Does high classification accuracy in CNN models for brain tumor MRI represent real clinical understanding, or does the model depend on non-diagnostic image regions?
- Build a baseline CNN model (ResNet18 + EfficientNet) for multi-class brain tumor MRI classification.
- Improve performance and robustness through preprocessing, handling class imbalance, and model architecture improvements.
- Use Grad-CAM to visualize the model’s attention during predictions.
- Compare correct vs. incorrect predictions to understand model failure modes.
- Identify cases where the model focuses on irrelevant regions (skull, edges, other artifacts).
- Highlight why deep learning accuracy can be misleading in medical imaging tasks.
- Data Exploration
- Inspect dataset structure, class balance, MRI quality, and artifacts.
- Preprocessing
- Normalization, resizing, augmentation, class balancing strategies.
- Model Training
- Baseline model: ResNet-18
- Modified model: EfficientNet
- Compare accuracy and general performance.
- Explainability Analysis
- Apply Grad-CAM on test images.
- Inspect model attention and save annotated heatmaps.
- Error Analysis
- Create a CSV (gradcam_analysis.csv) summarizing predictions, errors, focus regions, and clinical insights.
- Manual review to understand whether the model looked at tumor regions or misleading areas.
- Interpretation & Insights
- Analyze cases where the model performs well but for the wrong reasons.
- Highlight why such models are unreliable for clinical deployment.
├── README.md # Project documentation
│
├── notebooks/ #Google Colab notebooks
│ ├── 01_DataExploration.ipynb
│ ├── 02_DataPreprocessing.ipynb
│ ├── 03_Augmentaion_CNN_model.ipynb
│ ├── 04_Model_Iprovement.ipynb
│ └── 05_ExplainableAI.ipynb
│
├── models/ #Saved models weight
│ ├── brain_tumor_resnet18.pth
│ └── efficient_full_model.pth
│
├── results/ #Output generated by the model
├── gradcam/
└── gradcam_analysis.csv
Example explanation of model prediction using Grad-CAM:
- Model correctly detected Glioma; but Grad-CAM focuses on skull edges.
- Model misclassified pituitary as meningioma; focus almost to tumor and it's surrounding tissues.
- Model misclassified Glioma as meningioma; focus drifted to the background.
- Test additional explainability tools (Integrated Gradients, SHAP).
- Investigate training changes (segmentation-guided models, tumor masks).
- Explore clinically grounded evaluation metrics.
- Build a small report or paper summarizing findings.
Safaa Osman
MSc in Biomedical Engineering— Medical Image Processing
Interested in AI for medical imaging and interpretable deep learning.
You are welcome to use and adapt the code with proper attribution.