--- title: MRI Brain Tumor Detection emoji: 🧠 colorFrom: blue colorTo: purple sdk: docker app_port: 7860 pinned: false --- # 🧠 MRI Brain Tumor Detection System Deep Learning application for automated brain tumor classification from MRI scans using a custom ResidualInceptionBlock CNN architecture. ## 🎯 Features - **4-Class Classification**: Glioma, Meningioma, Pituitary, No Tumor - **Real-time Inference**: Fast predictions with confidence scores - **Modern UI**: Clean, responsive React interface - **RESTful API**: FastAPI backend with automatic documentation ## 🏗️ Architecture - **Frontend**: React 18 + Vite - **Backend**: FastAPI + PyTorch - **Model**: Custom ResidualInceptionBlock CNN (50+ layers) - **Deployment**: Docker + Hugging Face Spaces ## 🚀 Quick Start ### Using the Deployed App Simply visit the app URL and upload an MRI scan image to get instant predictions. ### Local Development 1. **Clone the repository** ```bash git clone cd mri-diagnosis-app ``` 2. **Start with Docker Compose** ```bash docker-compose up --build ``` 3. **Access the application** - Frontend: http://localhost:3000 - API Docs: http://localhost:8000/docs ### Manual Setup **Backend:** ```bash cd backend pip install -r requirements.txt uvicorn app.main:app --reload ``` **Frontend:** ```bash cd frontend npm install npm run dev ``` ## 📋 API Endpoints - `POST /api/predict` - Upload MRI image for prediction - `GET /health` - Health check endpoint - `GET /docs` - Interactive API documentation ## 🎨 Usage 1. Upload an MRI brain scan (PNG, JPG, JPEG) 2. Click "Run Diagnosis" 3. View prediction with confidence score ## 📊 Model Information - **Classes**: 4 (Glioma, Meningioma, Pituitary, No Tumor) - **Input Size**: 224x224 RGB images - **Architecture**: Custom ResidualInceptionBlock with 50+ layers ## 🛠️ Technology Stack - **PyTorch** 2.1.0 - **FastAPI** 0.104.1 - **React** 18.2.0 - **Vite** 5.0.0 - **Docker** & Docker Compose ## 📝 License MIT License ## 👨‍💻 Author [Your Name] ## 🙏 Acknowledgments - Dataset: [Mention your dataset source] - Based on ResidualInceptionBlock architecture