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