Hey there! Welcome to my project on Brain Tumor Detection using Convolutional Neural Networks (CNNs). In this notebook, I worked on classifying brain MRI images into four distinct categories:
- Glioma Tumor
- Meningioma Tumor
- Pituitary Tumor
- No Tumor
π You can explore my full implementation here: Brain Tumor Detection using CNN - Kaggle Notebook
- Source: Kaggle Brain Tumor MRI Dataset
- Structure:
- Training: 5712 images
- Testing: 1311 images
- Classes: glioma, meningioma, pituitary, notumor
βββ data/
β βββ Training/
β β βββ glioma/
β β βββ meningioma/
β β βββ pituitary/
β β βββ notumor/
β βββ Testing/
β βββ glioma/
β βββ meningioma/
β βββ pituitary/
β βββ notumor/
βββ brain_tumor_detection_cnn.ipynb
βββ Model1.h5
βββ README.md
- Python
- TensorFlow / Keras
- Pandas, NumPy
- Matplotlib, Seaborn
- PIL (Python Imaging Library)
- Conv2D (64 filters) + MaxPooling2D
- Conv2D (512 filters) + MaxPooling2D
- Conv2D (256 filters) + MaxPooling2D
- Conv2D (128 filters) + MaxPooling2D
- Flatten
- Dense (256 units) + Dropout (0.3)
- Dense (128 units) + Dropout (0.5)
- Dense (4 units, softmax activation)
Optimizer: Adamax (learning rate = 0.001)
Loss Function: Categorical Crossentropy
Callbacks: EarlyStopping (patience=7)
- Training Accuracy: 98.8%
- Validation Accuracy: 94.5%
- Test Accuracy: 96%
- Weighted F1-Score: 0.96
- Clone the repository or open the Kaggle notebook.
- Load the dataset into the correct directory structure.
- Run the notebook to train the model.
- Evaluate using test data or predict on your own images.
- Trained model is saved as
Model1.h5.
This project is open for educational and research purposes only.
Utkarsh Midha
π LinkedIn: Utkarsh Midha
π Kaggle: @midhautkarsh
- Kaggle Dataset
- TensorFlow/Keras Documentation