Detect brain tumors from MRI scans using advanced deep learning! ๐
Comprehensive machine learning analysis for brain tumor classification using MobileNetV2
A comprehensive deep learning analysis that classifies brain MRI scans to detect the presence of tumors using transfer learning with MobileNetV2. This project demonstrates the complete medical image analysis workflow from data preprocessing to model deployment! ๐ง
- ๐ Complete exploratory data analysis (EDA)
- ๐ง Transfer learning with MobileNetV2
- ๐ Interactive visualizations & insights
- ๐ค Advanced deep learning models
- ๐ Image preprocessing & augmentation
- ๐ Deep statistical analysis
- ๐ Model performance evaluation
- ๐จ Beautiful visualizations with seaborn & matplotlib
- โก Production-ready code
# 1. Clone it
git clone <your-repo-url>
cd Brain-Tumor-Detection-with-Data-Science
# 2. Install dependencies
pip install tensorflow pandas numpy matplotlib seaborn scikit-image pillow
# 3. Run the analysis!
jupyter notebook Brain_tumor.ipynb
That's it! ๐
jupyter notebook Brain_tumor.ipynb
Perfect for interactive analysis and learning
# Upload Brain_tumor.ipynb to Google Colab
# Upload Brain Tumor.csv and Brain Scans.zip to your Colab session
For cloud-based analysis
# Open the notebook in VS Code with Jupyter extension
For integrated development experience
- Dataset Size: Brain MRI scans with tumor/no-tumor labels
- Image Processing: Resized to 224x224 pixels for MobileNetV2
- Model Architecture: Transfer learning with MobileNetV2 + custom classifier
- Model Performance: 86.6% accuracy on test set
- Training: 5 epochs with Adam optimizer and hinge loss
- Deep Learning Model: 86.6% accuracy on validation set
- Architecture: MobileNetV2 base + Global Average Pooling + Dense layer
- Training: 5 epochs with validation monitoring
- Transfer Learning: Pre-trained on ImageNet, fine-tuned for brain tumor detection
- Data Quality: Comprehensive data validation and preprocessing
- Image Processing: PIL-based resizing and normalization
- Feature Engineering: MobileNetV2 preprocessing pipeline
- Validation: Train-test split with validation monitoring
Brain-Tumor-Detection-with-Data-Science/
โโโ ๐ง Brain_tumor.ipynb # Complete analysis notebook
โโโ ๐ Brain Tumor.csv # Dataset with image paths and labels
โโโ ๐ผ๏ธ Brain Scans.zip # Brain MRI scan images
โโโ ๐ README.md # This file
โโโ ๐ LICENSE # MIT License
- Comprehensive brain MRI data overview and statistics
- Missing value analysis and data quality assessment
- Class distribution analysis (tumor vs no-tumor)
- Image visualization and sample display
- Data preprocessing pipeline
- Brain MRI sample images
- Class distribution plots
- Training history visualization
- Model performance metrics
- Confusion matrix analysis
- MobileNetV2: Transfer learning with pre-trained weights
- Image Preprocessing: Resize to 224x224, normalize pixel values
- Model Evaluation: Accuracy, loss metrics, confusion matrix
- Transfer Learning: Leverage ImageNet pre-trained features
- Training History: Learning curves and validation metrics
- Image resizing to 224x224 pixels
- Pixel value normalization
- MobileNetV2 preprocessing pipeline
- Train-test split with validation
- Data validation and cleaning
๐ง Dataset Overview:
- Brain MRI scans with tumor/no-tumor classification
- Image processing: 224x224 pixel resolution
- Model: MobileNetV2 with transfer learning
- Data quality: Comprehensive preprocessing pipeline
๐ฏ Key Model Performance:
- Overall Accuracy: 86.6%
- Training Loss: 0.6955
- Validation Loss: 0.6872
- Model saved as: model_brain.h5
๐ค Neural Network Architecture:
- Base Model: MobileNetV2 (pre-trained on ImageNet)
- Global Average Pooling: 1280 features
- Output Layer: 1 neuron (binary classification)
- Total Parameters: 2,259,265 (1,281 trainable)
- ๐ง Brain MRI visualization with matplotlib
- ๐ฎ Transfer learning with MobileNetV2
- ๐ฅ Hidden pattern insights in medical images
- ๐จ Beautiful data visualizations
- ๐ฏ Real-world medical AI application
- ๐ช Educational deep learning workflow
Problem: ModuleNotFoundError: No module named 'tensorflow'
Solution: pip install tensorflow pandas numpy matplotlib seaborn scikit-image pillow
Problem: Jupyter notebook not opening
Solution: Install Jupyter: pip install jupyter
Problem: Dataset not found
Solution: Ensure Brain Tumor.csv
and Brain Scans.zip
are in the same directory
Problem: GPU not detected
Solution: Install GPU version: pip install tensorflow-gpu
Problem: Memory issues with large images Solution: Reduce image resolution or batch size
- Brain MRI scans with tumor/no-tumor classification
- Transfer learning with MobileNetV2 architecture
- Image preprocessing pipeline for medical imaging
- Deep learning model training and evaluation
- Comprehensive EDA workflow for medical data
- Statistical significance in medical AI applications
- No missing values in the dataset
- Balanced class distribution analysis
- Image quality validation and preprocessing
- Data types validated and corrected
- Transfer learning optimization
- Data Processing: Handles brain MRI scans efficiently
- Visualization Quality: High-resolution medical image plots
- Model Training: Fast training with transfer learning
- Memory Usage: Efficient tensorflow operations
- Reproducibility: Consistent results with fixed random state
- Fork it ๐ด
- Create a branch ๐ฟ
- Make changes โ๏ธ
- Submit PR ๐
Ideas welcome! ๐ก
- Primary Dataset: Brain MRI scans with tumor classification
- Features: Image pixels (224x224 resolution)
- Target: Binary classification (tumor/no-tumor)
- Application: Medical image analysis and AI diagnostics
For educational and research purposes! This analysis uses brain MRI data to demonstrate deep learning concepts for medical image analysis. The insights help understand medical AI workflows and transfer learning applications! ๐ค
This project is licensed under the MIT License - see the LICENSE file for details.