{"id":27133189,"url":"https://github.com/chiggi24/cs4442_final_project","last_synced_at":"2026-04-08T21:31:53.688Z","repository":{"id":286354652,"uuid":"943626177","full_name":"chiggi24/cs4442_final_project","owner":"chiggi24","description":"A Flask-based web app for brain tumour classification from MRI scans using pre-trained deep learning models. Supports Glioma, Meningioma, Pituitary, and No Tumor detection with model selection and confidence scoring.","archived":false,"fork":false,"pushed_at":"2025-04-05T22:28:36.000Z","size":93297,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T23:26:34.993Z","etag":null,"topics":["brain-tumour","cnn","deep-learning","flask","healthcare-ai","image-classification","keras","medical-imaging","mri-classification","neuroimaging","tensorflow","transfer-learning"],"latest_commit_sha":null,"homepage":"https://neuroscanai-427956346530.us-central1.run.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/chiggi24.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":"2025-03-06T02:31:49.000Z","updated_at":"2025-05-05T13:08:36.000Z","dependencies_parsed_at":"2025-04-05T23:31:23.906Z","dependency_job_id":null,"html_url":"https://github.com/chiggi24/cs4442_final_project","commit_stats":null,"previous_names":["chiggi24/cs4442_final_project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chiggi24/cs4442_final_project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiggi24%2Fcs4442_final_project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiggi24%2Fcs4442_final_project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiggi24%2Fcs4442_final_project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiggi24%2Fcs4442_final_project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chiggi24","download_url":"https://codeload.github.com/chiggi24/cs4442_final_project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiggi24%2Fcs4442_final_project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31575467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["brain-tumour","cnn","deep-learning","flask","healthcare-ai","image-classification","keras","medical-imaging","mri-classification","neuroimaging","tensorflow","transfer-learning"],"created_at":"2025-04-07T23:19:51.014Z","updated_at":"2026-04-08T21:31:53.671Z","avatar_url":"https://github.com/chiggi24.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 NeuroScanAI\n\nNeuroScanAI is a deep learning-based tool for classifying brain MRI scans into one of four categories: **Glioma**, **Meningioma**, **Pituitary**, or **None** (no tumour). It offers both a model training pipeline and an interactive web interface for live predictions.\n\nWe evaluate and compare the performance of four popular convolutional neural networks:\n**ResNet50**, **VGG16**, **EfficientNetB0**, and **InceptionV3** — each trained and validated using Stratified K-Fold cross-validation.\n\n---\n\n## Live Demo (Google Cloud Run)\n\u003e Try the deployed version here: [**NeuroScanAI Demo**](https://neuroscanai-427956346530.us-central1.run.app/)\n\nThis deployment is hosted using **Google Cloud Run**, a fully managed, serverless platform that runs containerized applications with automatic scaling. We containerized our Flask app using the `Dockerfile` in the `deployment/` directory, then uploaded it to Cloud Run. Our four trained `.keras` models are stored in **Google Cloud Storage** and loaded dynamically at runtime.\n\n---\n\n## Dataset Info\n\n- **Source**: [Brain Tumor Classification (MRI) Dataset - Kaggle](https://www.kaggle.com/datasets/sartajbhuvaji/brain-tumor-classification-mri)\n- **License**: MIT License\n- **Provided Format**:\n  - Grayscale `.jpg` MRI scans with black backgrounds\n  - Pre-split into `Training/` and `Testing/` directories, each containing four subfolders (one per class)\n- **Preprocessing**:\n  - Images were converted to **RGB** and resized to **224x224** for model input compatibility\n  - We **merged all images into a single `data/` folder**, organized by four class folders:\n    - `Glioma/`\n    - `Meningioma/`\n    - `Pituitary/`\n    - `None/`\n- **Classification Task**: Supervised multi-class classification (4 categories)\n\n---\n\n## Project Structure\n\nThe repository is organized into two main components: `deployment/` for the web app, and `training/` for the model development pipeline.\n\n```bash\ncs4442_final_project/\n│\n├── deployment/               # Flask-based frontend + backend for prediction\n│   ├── static/               # Static assets (JS, CSS, and tooltip examples)\n│   │   ├── images/           # Sample MRI images for each tumour class\n│   │   ├── script.js         # Handles image upload, preview, results, tooltips\n│   │   └── style.css         # Light/dark theme and component styling\n│   │\n│   ├── templates/            # HTML templates\n│   │   └── index.html        # Main web interface layout\n│   │\n│   ├── app.py                # Main Flask server application\n│   ├── Dockerfile            # Docker config for Cloud Run deployment\n│   └── requirements.txt      # Dependencies for deployment environment\n│\n├── training/                 # All training scripts, data, and notebooks\n│   ├── data/                 # Merged dataset with subfolders per class\n│   │   ├── Glioma/\n│   │   ├── Meningioma/\n│   │   ├── None/\n│   │   └── Pituitary/\n│   │\n│   ├── models/               # Saved Keras model files from training\n│   │\n│   ├── brain_tumor_classification.ipynb   # End-to-end training \u0026 analysis notebook\n│   ├── config.py                         # Hyperparameters and constants\n│   ├── data_augmentation.py              # Functions for augmenting MRI data\n│   ├── data_preprocessing.py             # Image preprocessing routines\n│   ├── feature_extraction.py             # Model feature extraction functions\n│   ├── model_evaluation.py               # Evaluation, visualization, and metrics\n│   ├── model_training.py                 # K-fold training logic with saving/loading\n│   ├── requirements.txt                  # Dependencies for training pipeline\n│   └── utils.py                          # Reusable helper functions for training\n│\n├── .gitignore                # Standard Git ignore rules\n└── README.md                 # Project overview and usage guide\n\n```\n\n---\n\n## Getting Started\n\nEnsure you have **Python 3.11** installed before proceeding.\n\nClone the repository:\n\n```bash\ngit clone https://github.com/chiggi24/cs4442_final_project.git\ncd cs4442_final_project\n```\n\n---\n\n## Running the Training Notebook\n\n\u003e Located in `training/brain_tumor_classification.ipynb`\n\n- Make sure you're inside the cloned `cs4442_final_project` directory.\n- Navigate to the `training/` folder:\n\n```bash\ncd training\n```\n- Create and activate a virtual environment using Python 3.11:\n\n```bash\npython3.11 -m venv venv\nsource venv/bin/activate  # or venv\\Scripts\\activate on Windows\n```\n- Install the required dependencies:\n```bash\npip install -r requirements.txt\n```\n- Register the environment as a new Jupyter kernel:\n```bash\npython -m ipykernel install --user --name=neuroscanai --display-name \"NeuroScanAI\"\n```\n\n- Launch Jupyter Notebook and in the top-right dropdown, select the `NeuroScanAI` kernel\n- All training code, plots, and evaluation logic are included\n- Trained `.keras` models will be saved into the `training/models/` directory\n\n\u003e **Note 1**: To speed up training during testing, you can reduce the number of epochs and K-folds in `training/config.py`:\n\n```python\n# Number of training epochs\nEPOCHS = 2  \n\n# Number of folds for K-Fold Cross-Validation \nK_FOLDS = 2\n```\n\n\u003e **Note 2**: If you prefer to skip training and use pre-existing trained models instead, you can download them from the following [Pre-trained Models (Google Drive)](https://drive.google.com/drive/folders/1qr_dh3GFHygpjIOCY8k6aU1itj16Ydxl). After downloading, place the `.keras` model files into the `training/models/` directory.\n\n---\n\n## Local Deployment (Flask Web App)\n\n\u003e Ensure you're using **Python 3.11** for TensorFlow compatibility.\n\n- From the project root (`cs4442_final_project/`), navigate to the `deployment/` folder:\n\n```bash\ncd deployment\n```\n- Create and activate a virtual environment:\n```bash\npython3.11 -m venv venv\nsource venv/bin/activate  # or venv\\Scripts\\activate on Windows\n```\n- Install dependencies:\n```bash\npip install -r requirements.txt\n```\nRun the Flask app:\n```bash\npython app.py \n```\n- Open your browser and go to: [http://localhost:8080](http://localhost:8080)\n\n---\n\n## Dependencies\n\nThe project maintains **separate environments** for training and deployment, each with its own set of dependencies defined in `requirements.txt`.\n\n### Key libraries:\n- **TensorFlow** – Core deep learning framework for model development and inference\n- **OpenCV** – Image preprocessing and format handling\n- **Matplotlib** \u0026 **Seaborn** – Visualization of metrics and results\n- **Scikit-learn** – Metrics, preprocessing, and validation utilities\n- **Flask** – Lightweight web framework used for deployment\n- **Google Cloud Storage** – Access to hosted `.keras` models in production\n- **Pillow** – Support for image file operations\n\n---\n\n## Contributors  \n- **Christopher Higgins**  \n- **Bryson Crook**  \n- **Mohamed El Dogdog**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchiggi24%2Fcs4442_final_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchiggi24%2Fcs4442_final_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchiggi24%2Fcs4442_final_project/lists"}