BotMed/Eficlat50-BotMed-v1

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.

Model Details

Model Description

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.

  • Developed by: Bindupautra Jyotibrat (BJyotibrat), Avinash Kushwaha (AvinashK47), Rana Talukdar (Rana-15)
  • Shared by: BJyotibrat
  • Model type: Convolutional neural network (EfficientNetB0 transfer learning), image classification
  • Language(s) (NLP): Not applicable (Computer Vision Model)
  • License: GPL-3.0
  • Finetuned from model: EfficientNetB0 (ImageNet-pretrained)

Model Sources

Uses

Direct Use

Intended for classifying brain MRI images into one of four categories: glioma, meningioma, no tumor, or pituitary tumor, for research, educational, and experimental purposes.

Downstream Use

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.

Out-of-Scope Use

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.

Bias, Risks, and Limitations

  • Class-specific error patterns: Per the confusion matrix, glioma and meningioma are the most frequently confused classes with each other and with pituitary (e.g. 34 glioma images misclassified as meningioma, 44 meningioma images misclassified as pituitary), while "no tumor" and "pituitary" are classified with very high accuracy. Users should be aware the model is comparatively weaker at distinguishing glioma and meningioma cases.
  • No clinical validation: Evaluation metrics (accuracy, precision, recall, F1, confusion matrix) measure performance against the dataset's own labels, not independent clinical ground truth. The model has not been evaluated by radiologists or validated against clinical diagnostic standards.
  • Dataset-driven bias: The training data is a compilation of three source datasets (Figshare, SARTAJ, and Br35H), which may carry inconsistencies in imaging equipment, patient demographics, acquisition protocols, and label quality across sources.
  • Limited class scope: The model can only classify into the four trained categories. Other tumor types, comorbidities, or abnormalities outside these categories will be forced into one of the four labels rather than flagged as "unknown."
  • Image quality sensitivity: As with most CNN-based image classifiers, performance may degrade on images with unusual orientations, low resolution, artifacts, or scanner types not well represented in training.

Recommendations

Users (both direct and downstream) should be made aware of the risks, biases, and limitations of the model. In particular:

  • Always pair model predictions with review by a qualified radiologist or medical professional before any clinical or patient-facing use.
  • Treat outputs as a research/assistive aid, not a diagnostic result.
  • Be aware of the model's comparatively higher error rate on glioma and meningioma classification.
  • Do not use this model on imaging modalities or patient populations not represented in its training data.

How to Get Started with the Model

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)")

Training Details

Training Data

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.

Training Procedure

Trained on Google Colab GPUs using a two-phase transfer learning approach on top of EfficientNetB0 (ImageNet-pretrained).

Preprocessing

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)

Training Hyperparameters

  • Training regime: Standard float32 training (no mixed precision)
  • Batch size: 32
  • Image size: 224 x 224
  • Phase 1 (feature extraction): base model frozen, Adam optimizer (learning rate 0.001), up to 10 epochs
  • Phase 2 (fine-tuning): top ~30% of EfficientNetB0 layers unfrozen, Adam optimizer (learning rate 1e-4), up to 20 epochs
  • Loss: categorical crossentropy
  • Callbacks: 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)
  • Validation split: 20% of the Training directory held out for validation
  • Experiment tracking: Weights & Biases (wandb)

Speeds, Sizes, Times

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.

Evaluation

Testing Data, Factors & Metrics

Testing Data

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.

Factors

Evaluation was disaggregated by the four tumor classes (glioma, meningioma, no tumor, pituitary); no other subpopulation breakdown was performed.

Metrics

  • Accuracy — overall proportion of correctly classified images.
  • Precision, Recall, F1-Score — per-class and aggregate (macro/weighted average) classification quality.
  • Confusion Matrix — full breakdown of predicted vs. actual class for detailed error analysis.
  • ROC-AUC — multi-class, one-vs-rest area under the ROC curve.
  • Log Loss — probabilistic confidence-weighted error measure.

Results

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):

confusion_matrix

Full per-image predictions (100 samples) are available in Eficlat50 - BotMed_v1_100_Predictions.xlsx.

Summary

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 Outputs

Example inference output on a sample MRI image is available here: inferencing.png.

Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

  • Hardware Type: Google Colab GPU
  • Cloud Provider: Google Colab
  • Hours used: 2 hours

Technical Specifications

Model Architecture and Objective

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.

Compute Infrastructure

Google Colab

Hardware

Google Colab GPU instance(s).

Software

TensorFlow, Keras 3, scikit-learn, Weights & Biases, Google Colab.

Authors

Contact

Email: bjyotibrat@gmail.com

Downloads last month
46
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for BJyotibrat/Eficlat50-BotMed-v1

Quantized
(9)
this model

Collection including BJyotibrat/Eficlat50-BotMed-v1

Paper for BJyotibrat/Eficlat50-BotMed-v1