Skip to content

HexCrystal69/ClarityNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 ClarityNet | Brain Tumor Detection with CNN

This project is a deep learning-based web application for brain tumor detection from MRI scans. It uses a ResNet50 model and provides an interactive Streamlit interface for users to upload MRI images, get predictions, visualize model attention (Grad-CAM), and find nearby hospitals using OpenStreetMap and OpenRouteService.

✨ Features

  • 📤 Upload MRI scans and get instant predictions (tumor/no tumor)
  • 📊 Probability distribution for model confidence
  • 🔥 Grad-CAM visualization to highlight regions influencing the model's decision
  • 📁 Batch analysis: Upload multiple scans and view trends
  • 💡 Recommendations based on results
  • 📄 Downloadable PDF/Text reports
  • 🏥 Find nearby hospitals (using OSM/Overpass/ORS)
  • 🗺️ Route map to the nearest hospital (in-app and Google Maps link)
  • 📚 Resource links for further reading/support

📂 Project Structure

Brain Tumor Detection with CNN/
├── app/
│   ├── streamlit_app.py      # Main Streamlit app
│   ├── ui.py                # UI components
│   ├── gradcam.py           # Grad-CAM utility
│   ├── main.py              # Model loading and prediction
├── data/
│   ├── yes/                 # MRI images with tumor
│   └── no/                  # MRI images without tumor
├── model/
│   ├── brain_tumor_model_resnet50_final.h5  # Trained model
│   └── training_history.png # Training history plot
├── utils/
│   ├── preprocess.py        # Image preprocessing utilities
├── requirements.txt         # Python dependencies
├── README.md                # Project documentation

🚀 Setup & Usage

  1. Install dependencies:
    pip install -r requirements.txt
  2. Run the app:
    streamlit run app/streamlit_app.py
  3. Upload MRI images and explore the results in your browser.

📝 Notes

  • 🌍 The app uses OpenStreetMap (OSM) and OpenRouteService (ORS) for hospital search and routing. No API key is needed for OSM; a free key is used for ORS.
  • 🧹 Temporary files and compiled Python files are cleaned up for production.
  • 🗑️ The test.py and tempCodeRunnerFile.py files have been removed as they are not needed.

Screenshots

Screenshot 2025-06-18 030119

Screenshot 2025-06-18 030400

Screenshot 2025-06-18 030420

Screenshot 2025-06-18 030454

Screenshot 2025-06-18 030505

Screenshot 2025-06-18 030522

📄 License

See LICENSE for details.

About

An AI-powered system using CNN and Grad-CAM to detect and visualize brain tumors from MRI scans, offering accurate predictions and interpretable medical imaging insights.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages