{"id":18836721,"url":"https://github.com/stonewerner/brain-tumor-ml","last_synced_at":"2026-05-08T13:08:15.474Z","repository":{"id":261508956,"uuid":"884506810","full_name":"stonewerner/brain-tumor-ML","owner":"stonewerner","description":"ML model to identify types of brain tumors in MRI scans.","archived":false,"fork":false,"pushed_at":"2024-11-08T14:28:14.000Z","size":5190,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-20T03:42:37.090Z","etag":null,"topics":["ai","gemini","ml","python","streamlit"],"latest_commit_sha":null,"homepage":"https://brain-tumor-ml-stone.streamlit.app/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stonewerner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-06T21:56:48.000Z","updated_at":"2024-11-08T14:28:18.000Z","dependencies_parsed_at":"2024-11-06T23:35:36.635Z","dependency_job_id":"446bf84c-380d-467f-85e4-3f3ac8214c73","html_url":"https://github.com/stonewerner/brain-tumor-ML","commit_stats":null,"previous_names":["stonewerner/brain-tumor-ml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stonewerner%2Fbrain-tumor-ML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stonewerner%2Fbrain-tumor-ML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stonewerner%2Fbrain-tumor-ML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stonewerner%2Fbrain-tumor-ML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stonewerner","download_url":"https://codeload.github.com/stonewerner/brain-tumor-ML/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239774326,"owners_count":19694700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","gemini","ml","python","streamlit"],"created_at":"2024-11-08T02:31:34.435Z","updated_at":"2026-01-27T21:30:15.582Z","avatar_url":"https://github.com/stonewerner.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 Brain Tumor MRI Classification\n\n[![Python](https://img.shields.io/badge/Python-3.7%2B-blue.svg)](https://www.python.org/)\n[![TensorFlow](https://img.shields.io/badge/TensorFlow-2.0%2B-orange.svg)](https://www.tensorflow.org/)\n[![Streamlit](https://img.shields.io/badge/Streamlit-1.0%2B-red.svg)](https://streamlit.io/)\n\nA deep learning project that uses transfer learning and custom CNN architectures to classify brain tumors from MRI scans into four categories: Glioma, Meningioma, Pituitary, and No Tumor.\n\n## 🎯 Project Overview\n\nThis project implements two different deep learning approaches:\n1. **Transfer Learning with Xception**: Leveraging a pre-trained model for enhanced accuracy\n2. **Custom CNN**: A dedicated convolutional neural network built from scratch\n\nBoth models are deployed through a user-friendly Streamlit web interface that provides:\n- Real-time tumor classification\n- Confidence scores\n- Saliency maps for model interpretability\n- AI-generated explanations of the model's focus areas\n\n## 📊 Model Architecture \u0026 Performance\n\n### Transfer Learning Model (Xception)\n- Pre-trained on ImageNet dataset\n- 36 convolutional layers\n- 21 million parameters\n- Features:\n  - Max pooling\n  - Dropout layers for regularization\n  - Softmax activation for classification\n- Performance metrics:\n  - High accuracy on test set\n  - Robust against overfitting\n\n### Custom CNN Model\n- 4 convolutional layers\n- 4.7 million parameters\n- Architecture:\n  - Multiple Conv2D layers with ReLU activation\n  - MaxPooling2D layers\n  - Dropout for regularization\n  - Dense layers with L2 regularization\n  - Softmax output layer\n\n## 🛠️ Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/stonewerner/brain-tumor-ML.git\ncd brain-tumor-ML\n\n# Install required packages\npip install -r requirements.txt\n```\n\n## 📦 Dependencies\n\n- tensorflow \u003e= 2.0\n- streamlit\n- numpy\n- pandas\n- pillow\n- plotly\n- opencv-python\n- google-generativeai\n- python-dotenv\n\n## 🚀 Usage\n\n\n### Running the Web App\n\n```bash\nstreamlit run app.py\n```\n\n## 🖥️ Web Interface Features\n\n1. **Image Upload**: Support for jpg, jpeg, and png formats\n2. **Model Selection**: Choose between Transfer Learning and Custom CNN\n3. **Visualization**:\n   - Original MRI scan\n   - Saliency map highlighting model focus areas\n4. **Results Display**:\n   - Predicted tumor type\n   - Confidence scores\n   - Interactive probability chart\n   - AI-generated explanation of the classification\n\n## 📈 Data Processing\n\nThe project includes robust data handling:\n- Image preprocessing and augmentation\n- Brightness adjustment for training data\n- Proper train/validation/test splits\n- Standardized image sizing\n\n## 🔍 Model Interpretability\n\n- **Saliency Maps**: Visual explanation of model decisions\n- **Region Focus**: Highlights critical areas in MRI scans\n- **AI Explanations**: Generated using Google's Gemini model\n- **Confidence Metrics**: Probability distribution across classes\n\n## 👥 Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\n## 📧 Contact\n\nStone Werner - stonewerner.com\n\nProject Link: [https://github.com/stonewerner/brain-tumor-ML](https://github.com/stonewerner/brain-tumor-ML)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstonewerner%2Fbrain-tumor-ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstonewerner%2Fbrain-tumor-ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstonewerner%2Fbrain-tumor-ml/lists"}