Spaces:
Sleeping
Sleeping
| title: Brain MRI Tumor Detection | |
| emoji: π§ | |
| colorFrom: indigo | |
| colorTo: purple | |
| sdk: docker | |
| pinned: false | |
| Pure Flask application for brain MRI classification and tumor segmentation using deep learning. | |
| # Brain MRI Analysis System | |
| A Flask-based web application that analyzes brain MRI images for tumor classification and segmentation. | |
| ## Features | |
| - **MRI Image Upload**: Upload brain MRI images for analysis | |
| - **Tumor Classification**: Identifies the type of tumor (glioma, meningioma, pituitary) or confirms no tumor | |
| - **Tumor Segmentation**: Visualizes the tumor area with an overlay if present | |
| - **Medical Summary**: Provides a brief summary of the findings | |
| - **Analysis History**: Stores all analyses for future reference | |
| ## Technical Stack | |
| - **Backend**: Flask (Python) | |
| - **Frontend**: HTML, Tailwind CSS | |
| - **Database**: SQLite | |
| - **Machine Learning**: TensorFlow/Keras | |
| - **Models**: | |
| - Brain MRI classification model (brain_mri.h5) | |
| - U-Net segmentation model (Unet_model.h5) | |
| ## Setup Instructions | |
| 1. **Clone the repository** | |
| 2. **Install dependencies** | |
| ``` | |
| pip install -r requirements.txt | |
| ``` | |
| 3. **Download the pre-trained models** | |
| - Place the models in the root directory: | |
| - `brain_mri.h5` (classification model) | |
| - `Unet_model.h5` (segmentation model) | |
| 4. **Initialize the database** | |
| - The database will be automatically created when you run the application for the first time | |
| 5. **Run the application** | |
| ``` | |
| python app.py | |
| ``` | |
| 6. **Access the application** | |
| - Open a web browser and go to `http://127.0.0.1:5000/` | |
| ## Project Structure | |
| ``` | |
| βββ app.py # Main Flask application file | |
| βββ brain_mri.db # SQLite database (created automatically) | |
| βββ brain_mri.h5 # Classification model | |
| βββ Unet_model.h5 # Segmentation model | |
| βββ requirements.txt # Dependencies | |
| βββ static/ # Static files | |
| β βββ uploads/ # Uploaded MRI images | |
| β βββ results/ # Generated results | |
| βββ templates/ # HTML templates | |
| βββ base.html # Base template | |
| βββ index.html # Homepage | |
| βββ result.html # Results page | |
| βββ history.html # Analysis history page | |
| ``` | |
| ## Notes | |
| - This application is for educational purposes only and should not be used for actual medical diagnosis. | |
| - The "Gemini summary" feature is simulated in this version. In a production environment, you would integrate with Google's Gemini API. |