Instructions to use Raghava-Ram/brain-tumor-efficientnet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Raghava-Ram/brain-tumor-efficientnet with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://Raghava-Ram/brain-tumor-efficientnet") - Notebooks
- Google Colab
- Kaggle
library_name: tensorflow tags: - medical-imaging - brain-tumor - mri - image-classification - deep-learning - efficientnet
Brain Tumor MRI Classification (EfficientNetB4)
Model Description
This model performs automatic classification of brain MRI scans into four categories using deep transfer learning.
It is built using the EfficientNetB4 architecture pretrained on ImageNet and fine-tuned for brain tumor classification.
The model predicts one of the following classes:
- Glioma Tumor
- Meningioma Tumor
- Pituitary Tumor
- No Tumor
The objective of this project is to assist in automated analysis of brain MRI images and demonstrate how deep learning can be applied to medical imaging tasks.
Model Details
Architecture: EfficientNetB4 + custom classification head
Framework: TensorFlow / Keras
Input size: 380 Γ 380 RGB images
Output: Softmax probabilities for 4 classes
Custom classification head:
EfficientNetB4 (ImageNet pretrained)
BatchNormalization
Dense(256) + ReLU
BatchNormalization
Dropout(0.4)
Dense(128) + ReLU
BatchNormalization
Dropout(0.3)
Dense(4) + Softmax
Dataset
The model was trained on a brain MRI dataset containing images categorized into four classes.
Training Set
- Total images: 5,600
- Classes: 4
- Images per class: 1,400
Testing Set
- Total images: 1,600
- Images per class: 400
Classes:
- Glioma
- Meningioma
- Pituitary
- No Tumor
All images were resized to:
380 Γ 380 pixels
Training Procedure
Training was performed in two phases.
Phase 1 β Transfer Learning
- EfficientNetB4 backbone frozen
- Only classification layers trained
- Optimizer: Adam
- Learning rate: 1e-3
Phase 2 β Fine Tuning
- EfficientNetB4 backbone unfrozen
- Entire network trained
- Learning rate reduced to 1e-4
Callbacks used:
- EarlyStopping
- ReduceLROnPlateau
Maximum training epochs:
40 + 40 epochs
Evaluation
The model was evaluated on a separate test dataset.
Test Accuracy: ~95%
Evaluation metrics included:
- Accuracy
- Confusion Matrix
- Classification Report
Usage
Download Model
Model repository:
https://huggingface.co/Raghava-Ram/brain-tumor-efficientnet
Direct model file:
https://huggingface.co/Raghava-Ram/brain-tumor-efficientnet/resolve/main/pretrained_model.keras
Load the Model
from huggingface_hub import hf_hub_download
import tensorflow as tf
model_path = hf_hub_download(
repo_id="Raghava-Ram/brain-tumor-efficientnet",
filename="pretrained_model.keras"
)
model = tf.keras.models.load_model(model_path)
Intended Use
This model is intended for:
- Educational purposes
- Research demonstrations
- Medical imaging deep learning experiments
- AI model deployment projects
Limitations
- The dataset size is limited.
- Performance may vary across different MRI machines or imaging conditions.
- The model has not been clinically validated.
Ethical Considerations
β οΈ This model is for educational and research purposes only.
It should not be used for real medical diagnosis or treatment decisions.
Always consult qualified medical professionals for clinical interpretation.
Author
Raghava Ram
Project: Brain Tumor Detection using Deep Transfer Learning
- Downloads last month
- -