🧠 AI Brain Tumor Detection Project {#ai-brain-tumor}

🚀 Inspiration

The inspiration behind this project came from the increasing cases of brain tumors and the need for early detection. MRI analysis is time-consuming and requires expert radiologists. This motivated us to build an AI system that could assist doctors by automating tumor detection from MRI scans using deep learning.

That is so motivating! :brain:

📚 What We Learned

Throughout this project, we gained hands-on experience in:

  • Working with medical imaging datasets
  • Building CNN models using TensorFlow and Keras
  • Image preprocessing and augmentation techniques
  • Performance evaluation using metrics like accuracy and recall

==We deepened both our AI and deployment skills.==

🛠️ How We Built It

Phase Description
Dataset Brain MRI images (Tumor / No Tumor) from Kaggle
Preprocessing Resizing, grayscale conversion, normalization
Modeling CNN built using Keras (Conv2D, MaxPooling, Dropout)
Evaluation Accuracy, loss, precision, confusion matrix
Deployment Streamlit app to upload images and get predictions

⚠️ Challenges We Faced

🚧 Deployment Issues

  • Deploying the trained model on Render required setting up a proper requirements.txt and managing Python environment dependencies.
  • We faced performance issues with large MRI image files that slowed down prediction times.
  • Ensuring cross-platform compatibility and preventing memory overload when handling multiple requests was a tough challenge.
  • Handling file uploads securely and efficiently required careful consideration.

🧠 Data & Modeling

  • Imbalanced Dataset: Certain tumor classes were underrepresented, leading to biased predictions. We addressed this using data augmentation techniques.
  • Overfitting: Our model initially showed high accuracy on training data but underperformed on test data. We resolved this using dropout layers and regularization.
  • Training Time: Without GPU support, model training took longer. We optimized the number of epochs and tweaked the CNN architecture.
  • Medical Sensitivity: Since this is a health-related project, we needed to minimize false positives and negatives to avoid misleading results.

✅ Task List

  • [x] Collect and clean MRI dataset
  • [x] Build CNN model using Keras
  • [x] Apply image preprocessing and augmentation
  • [x] Evaluate model using accuracy, precision, recall, and F1-score
  • [x] Deploy the trained model on Render
  • [ ] Add support for DICOM images
  • [ ] Optimize UI for faster uploads and predictions
  • [ ] Integrate explainable AI (Grad-CAM visualizations)

📎 Footnote

This project was developed using publicly available datasets and is intended strictly for educational and research purposes. [^1]

[^1]: Dataset Source – Brain MRI Images from Kaggle (https://www.kaggle.com/navoneel/brain-mri-images-for-brain-tumor-detection)


🔬 Sample Output

MRI Input Predicted Result
tumor_scan_01.jpg Tumor Detected
healthy_scan_05.jpg No Tumor Detected
tumor_scan_12.jpg Tumor Detected

💡 Final Thoughts

This project helped us understand the real-world impact of artificial intelligence in healthcare. We built a robust CNN-based model that can predict brain tumor presence from MRI scans. Through this, we learned about data preprocessing, model evaluation, and the importance of minimizing false predictions in sensitive domains.

We successfully deployed our model on Render, making it accessible via the web without relying on heavy frameworks.

==We aim to improve this project== further by adding more explainability, mobile responsiveness, and better support for real-world medical image formats.

Thanks for reading! Stay curious and keep building! 🚀

Built With

Share this project:

Updates