Downloads · 30 days
31
25% of all-time downloads
BJyotibrat/Eficlat50-BotMed-v1
Eficlat50-BotMed-v1 is a image classification model from BJyotibrat. Use it when you need a label for an image. It is set up for keras. The card lists the license as gpl-3.0.
Eficlat50-BotMed-v1 is an EfficientNetB0-based image classification model fine-tuned to classify brain MRI scans into four categories: glioma, meningioma, no tumor, and pituitary tumor.
Downloads · 30 days
31
25% of all-time downloads
All-time downloads
124
Public
Repo size
83 MB
Likes
1
Public
Click a slice to open those files.
.keras46.1 MB · 56%
From the Hugging Face model README
Eficlat50-BotMed-v1 is an EfficientNetB0-based image classification model fine-tuned to classify brain MRI scans into four categories: glioma, meningioma, no tumor, and pituitary tumor.
Eficlat50-BotMed-v1 is a transfer-learning model built on top of EfficientNetB0 (pretrained on ImageNet), fine-tuned for multi-class brain tumor classification from MRI images. It was trained on the Brain Tumor MRI Dataset using Google Colab GPUs, with a two-phase training strategy: an initial feature-extraction phase with the base model frozen, followed by a fine-tuning phase where the top ~30% of EfficientNetB0's layers were unfrozen and trained at a lower learning rate.
The model head consists of global average pooling, batch normalization, dropout, and two dense layers (256 and 128 units) before a final 4-way softmax classification layer. Data augmentation (rotation, translation, zoom, horizontal flip, contrast, and brightness jitter) was applied during training to improve generalization.
On a held-out test set of 1,600 images (400 per class), the model achieved 91% overall accuracy, with particularly strong performance on the "no tumor" and "pituitary" classes.
Intended for classifying brain MRI images into one of four categories: glioma, meningioma, no tumor, or pituitary tumor, for research, educational, and experimental purposes.
Potential downstream applications include:
(1) research and educational tools for demonstrating transfer-learning-based medical image classification,
(2) a triage-assistance component in a larger clinical decision-support pipeline, always paired with review by a qualified radiologist or medical professional,
(3) a baseline model for benchmarking further fine-tuning, architecture changes, or dataset expansions, and
(4) integration into broader multi-modal medical AI systems (e.g. alongside BotMed's text-based medical chatbot models) as an image-understanding component.
This model is not a certified diagnostic tool and must not be used as a substitute for professional radiological or medical evaluation. It is unsafe and inappropriate for any use where its output directly informs a real patient's diagnosis or treatment without review and confirmation by a licensed medical professional. It has not been validated for MRI scans outside the four trained classes, non-brain imaging, non-MRI modalities (e.g. CT, X-ray), or pediatric populations if not represented in the training data.
Users (both direct and downstream) should be made aware of the risks, biases, and limitations of the model. In particular:
Use the code below to get started with the model.
import numpy as np
import keras
from keras.utils import load_img, img_to_array
model_path = "Eficlat50_BotMed_v1.keras"
class_names = ["glioma", "meningioma", "notumor", "pituitary"]
model = keras.models.load_model(model_path)
img_path = "your_mri_image.jpg"
IMG_HEIGHT, IMG_WIDTH = 224, 224
img = load_img(img_path, target_size=(IMG_HEIGHT, IMG_WIDTH))
img_array = np.expand_dims(img_to_array(img), axis=0) # raw 0-255, no manual rescaling
prediction = model.predict(img_array, verbose=0)
class_idx = np.argmax(prediction)
confidence = np.max(prediction)
print(f"Predicted class: {class_names[class_idx]} ({confidence * 100:.2f}% confidence)")
Trained on the Brain Tumor MRI Dataset (Kaggle, by Masoud Nickparvar), a combination of the Figshare, SARTAJ, and Br35H datasets. The dataset is organized into four classes — glioma, meningioma, no tumor, and pituitary — split into pre-defined Training and Testing directories.
Trained on Google Colab GPUs using a two-phase transfer learning approach on top of EfficientNetB0 (ImageNet-pretrained).
Images were resized to 224x224 and used at their raw pixel scale (0-255) without manual rescaling, since EfficientNetB0 handles input preprocessing internally.
Data Augmentation (training set only):
data_augmentation = keras.Sequential([
layers.RandomRotation(factor=0.05),
layers.RandomTranslation(height_factor=0.1, width_factor=0.1),
layers.RandomZoom(0.1),
layers.RandomFlip("horizontal"),
layers.RandomContrast(factor=0.1),
layers.RandomBrightness(factor=0.1),
])
Model Head:
base_model = EfficientNetB0(weights='imagenet', include_top=False, input_shape=(224, 224, 3))
base_model.trainable = False
x = base_model.output
x = GlobalAveragePooling2D()(x)
x = BatchNormalization()(x)
x = Dropout(0.4)(x)
x = Dense(256, activation='relu')(x)
x = BatchNormalization()(x)
x = Dropout(0.3)(x)
x = Dense(128, activation='relu')(x)
x = Dropout(0.2)(x)
predictions = Dense(num_classes, activation='softmax')(x)
ModelCheckpoint (best val_loss), EarlyStopping (patience 5 in phase 1, 7 in phase 2, restores best weights), ReduceLROnPlateau (factor 0.5, patience 3, min LR 1e-7)Final logged training run metrics reached approximately 98.3% training accuracy and 100% validation accuracy by the end of fine-tuning (phase 2), before evaluation was run on the separate held-out test set (see Results below for true test performance).
Full run history is available as a CSV export: wandb_run_history - Eficlat50 BotMed v1.csv.
The Testing split of the Brain Tumor MRI Dataset, evaluated on a balanced held-out set of 1,600 images (400 per class). Full evaluation artifacts are available in the evaluation folder.
Evaluation was disaggregated by the four tumor classes (glioma, meningioma, no tumor, pituitary); no other subpopulation breakdown was performed.
Classification Report (Test Set):
| Class | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| glioma | 0.93 | 0.82 | 0.87 | 400 |
| meningioma | 0.90 | 0.82 | 0.86 | 400 |
| notumor | 0.92 | 0.99 | 0.96 | 400 |
| pituitary | 0.88 | 1.00 | 0.94 | 400 |
| Accuracy | 0.91 | 1600 | ||
| Macro avg | 0.91 | 0.91 | 0.91 | 1600 |
| Weighted avg | 0.91 | 0.91 | 0.91 | 1600 |
Confusion Matrix (Test Set):

Full per-image predictions (100 samples) are available in Eficlat50 - BotMed_v1_100_Predictions.xlsx.
The model achieves 91% overall accuracy on the held-out test set. "No tumor" and "pituitary" classes are classified with the highest recall (0.99 and 1.00 respectively), while glioma and meningioma show comparatively lower recall (0.82 each), with most of the confusion occurring between glioma, meningioma, and pituitary classes. Precision is consistently high (0.88-0.93) across all classes, indicating relatively few false positives per predicted class.
Example inference output on a sample MRI image is available here: inferencing.png.
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
EfficientNetB0 backbone (ImageNet-pretrained) with a custom classification head (GlobalAveragePooling2D, BatchNormalization, Dropout, Dense(256), BatchNormalization, Dropout, Dense(128), Dropout, Dense(4, softmax)), fine-tuned in two phases for 4-class brain tumor classification from MRI images.
Google Colab
Google Colab GPU instance(s).
TensorFlow, Keras 3, scikit-learn, Weights & Biases, Google Colab.
Email: [email protected]