AI-powered brain tumor classification analyzes MRI scans to distinguish between benign and malignant tumors with high accuracy
The Brain Tumor Detection AI project is a deep learning-based system designed to classify brain tumors into four categories using MRI scans. It utilizes a DenseNet model trained on a preprocessed and augmented dataset, achieving an impressive 99.65% test accuracy. The project also includes a web application that enables users to upload MRI scans and receive an automated diagnosis report.
Technology Stack
The project is built using Flask for backend processing, TensorFlow for deep learning, and OpenCV for image processing. The frontend is developed with React, styled with TailwindCSS, and optimized with Vite. Backend APIs are managed using Node.js and Express, while Zustand handles state management.
Dataset & Classification
The dataset consists of MRI images classified into four tumor types:
Glioma – Aggressive brain tumor.
Meningioma – Tumor affecting brain membranes.
Pituitary – Tumor in the hormonal gland.
No Tumor – Healthy brain scans.
The dataset was split into 90% training and 10% validation, with a separate test set for final evaluation. Images were resized to 256x256 pixels, and data augmentation (rotation, flipping, contrast adjustments) was applied to improve model generalization.
AI Model & Training
The classification model is based on EfficientNet, optimized with Adam, and trained using CrossEntropyLoss. The dataset was expanded through augmentation, increasing its size sixfold. The model was trained for multiple epochs, selecting the best-performing version based on validation loss.
Web Application Features
The Flask-based web application provides:
MRI scan upload & AI-powered tumor detection 🏥
Automated PDF medical report generation 📄
Interactive dashboard for MRI visualization 📊
Support for various image formats (JPG, PNG, DICOM, NIfTI)
Cloud-based deployment for scalability ☁️
Installation & Deployment
Users can clone the repository, set up a Python virtual environment, install dependencies, and download the pretrained AI model. Running the Flask application enables access to the web interface, allowing users to upload scans and receive instant diagnosis reports.
Security & Compliance
The project ensures HIPAA & GDPR compliance, with AES-256 encryption for secure data storage and authentication via Firebase & OAuth.
Future Enhancements
Potential improvements include 3D MRI analysis, multi-class tumor localization, and real-time AI-assisted diagnostics to further enhance medical imaging and early detection.
This project combines AI-driven medical imaging with an interactive web platform, offering a highly accurate, efficient, and scalable solution for brain tumor detection.