Model Card for BrainTumorClassifier: InceptionV3-Based Brain Tumor Detection

BrainTumorClassifier is a deep learning model built on InceptionV3 and trained to classify MRI brain scans into two categories: Brain Tumor and Healthy.
The model leverages transfer learning from ImageNet weights to accelerate training and improve generalization, supporting early detection of brain tumors.

⚠️ Disclaimer: This model is intended for research and educational purposes only.
It is not a substitute for professional medical diagnosis or treatment.
Always consult a licensed healthcare provider for medical decisions.


Model Details

Key Features:

  • Binary classification of MRI brain images (Brain Tumor vs Healthy)
  • Transfer learning using InceptionV3 pretrained on ImageNet
  • Input size: 299Γ—299 RGB images, normalized
  • Custom dense head with batch normalization, dropout, and L1/L2 regularization
  • Evaluated on separate validation and test sets with high accuracy

Skills & Technologies Used:

  • TensorFlow / Keras for model design & training
  • ImageDataGenerator for preprocessing and augmentation
  • InceptionV3 for feature extraction and fine-tuning
  • Matplotlib & Seaborn for visualization
  • Hugging Face Hub for model hosting
  • Kaggle for dataset and training environment

  • Developed by: Rawan Alwadeya
  • Model type: Convolutional Neural Network (CNN) with Transfer Learning
  • Language(s): N/A (Image model)
  • License: MIT

Uses

This model can be used for:

  • Research in brain tumor detection and AI-assisted diagnosis
  • Educational demonstrations of transfer learning on medical imaging data
  • Portfolio projects showcasing preprocessing, model training, and deployment

Dataset

  • Source: Brain Tumor MRI Dataset (Kaggle)
  • Classes: Brain Tumor, Healthy
  • Preprocessing:
    • Duplicate images removed
    • Images resized to 299Γ—299 RGB and normalized
    • Balanced train, validation, and test splits

Performance

The final model demonstrated strong performance on the held-out test set:

  • Accuracy: 98.04%
  • Precision: 97.62%
  • Recall: 98.09%
  • F1 Score: 97.85%

πŸ‘©β€πŸ’» Author

Rawan Alwadeya
AI Engineer | Generative AI Engineer | Data Scientist


Example Usage

import numpy as np
from keras.models import load_model
from PIL import Image
import requests
from io import BytesIO
from huggingface_hub import hf_hub_download

# Download the model from Hugging Face Hub
model_path = hf_hub_download(repo_id="RawanAlwadeya/BrainTumorClassifier", filename="BrainTumorClassifier.h5")
model = load_model(model_path)

# Preprocess an MRI image
def preprocess_image(image):
    IMG_SIZE = (299, 299)
    image = image.convert("RGB")
    image = image.resize(IMG_SIZE)
    img_array = np.array(image) / 255.0
    img_array = np.expand_dims(img_array, axis=0)  # add batch dimension
    return img_array

# Example: load an image from URL
url = "https://example.com/sample_mri.jpg"
response = requests.get(url)
image = Image.open(BytesIO(response.content))

img_array = preprocess_image(image)
prediction = model.predict(img_array)[0][0]

if prediction >= 0.5:
    print("⚠️ Brain Tumor likely detected")
else:
    print("βœ… Likely Healthy")
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support