the-shoaib2/Brain_Tumor_MRI_Classification
Image Classification
β’
Updated
image
imagewidth (px) 150
1.38k
| label
class label 4
classes |
|---|---|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
|
0glioma
|
A curated dataset of brain MRI scans for tumor classification, organized into 4 categories.
This dataset contains MRI brain scans classified into four categories:
The dataset is split into three subsets:
Total: 12064 images
dataset/
βββ train/
β βββ glioma/
β βββ meningioma/
β βββ notumor/
β βββ pituitary/
βββ val/
β βββ glioma/
β βββ meningioma/
β βββ notumor/
β βββ pituitary/
βββ test/
βββ glioma/
βββ meningioma/
βββ notumor/
βββ pituitary/
from datasets import load_dataset
# Load the dataset
dataset = load_dataset("the-shoaib2/Brain_Tumor_MRI")
# Access splits
train_data = dataset['train']
val_data = dataset['validation']
test_data = dataset['test']
import tensorflow as tf
from tensorflow.keras.preprocessing.image import ImageDataGenerator
# Download and extract dataset
# Then use ImageDataGenerator
datagen = ImageDataGenerator(rescale=1./255)
train_generator = datagen.flow_from_directory(
'dataset/train',
target_size=(299, 299),
batch_size=32,
class_mode='categorical'
)
from torchvision import datasets, transforms
from torch.utils.data import DataLoader
transform = transforms.Compose([
transforms.Resize((299, 299)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])
])
train_dataset = datasets.ImageFolder('dataset/train', transform=transform)
train_loader = DataLoader(train_dataset, batch_size=32, shuffle=True)
A pre-trained model using this dataset is available at: the-shoaib2/Brain_Tumor_MRI_Classification
This dataset can be used for:
If you use this dataset, please cite:
@misc{brain_tumor_mri_dataset,
author = {Shoaib},
title = {Brain Tumor MRI Dataset},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/datasets/the-shoaib2/Brain_Tumor_MRI}}
}
MIT License - See LICENSE file for details
This dataset has been curated and organized for machine learning applications in medical imaging.