{"id":22202452,"url":"https://github.com/recker-dev/alzheimer-cnn-tinyvgg16","last_synced_at":"2026-04-29T16:39:34.245Z","repository":{"id":264751814,"uuid":"894289157","full_name":"Recker-Dev/alzheimer-cnn-tinyVGG16","owner":"Recker-Dev","description":"This project uses a TinyVGG16-based CNN to classify MRI scans for Alzheimer's Disease stages: Mild Impairment, Moderate Impairment, No Impairment, and Very Mild Impairment. It includes Jupyter notebooks for training and prediction, and a Streamlit app for easy inference. The model achieves high metrics in predicting Alzheimer's stages.","archived":false,"fork":false,"pushed_at":"2024-11-26T05:30:45.000Z","size":8558,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T07:13:51.295Z","etag":null,"topics":["ai","ai-in-healthcare","alzeheimers","cnn-classification","deep-learning","image-classification","kaggle-dataset","medical-imaging","mri-images","neuroimaging","pytorch","pytorch-cnn-classification","streamlit","streamlit-webapp","tinyvgg"],"latest_commit_sha":null,"homepage":"https://alzheimer-cnn-tinyvgg16.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/Recker-Dev.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-26T05:05:36.000Z","updated_at":"2025-02-06T17:06:05.000Z","dependencies_parsed_at":"2024-11-26T06:37:05.241Z","dependency_job_id":null,"html_url":"https://github.com/Recker-Dev/alzheimer-cnn-tinyVGG16","commit_stats":null,"previous_names":["recker-dev/alzheimer-cnn-tinyvgg16"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Recker-Dev%2Falzheimer-cnn-tinyVGG16","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Recker-Dev%2Falzheimer-cnn-tinyVGG16/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Recker-Dev%2Falzheimer-cnn-tinyVGG16/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Recker-Dev%2Falzheimer-cnn-tinyVGG16/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Recker-Dev","download_url":"https://codeload.github.com/Recker-Dev/alzheimer-cnn-tinyVGG16/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245798358,"owners_count":20673902,"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","ai-in-healthcare","alzeheimers","cnn-classification","deep-learning","image-classification","kaggle-dataset","medical-imaging","mri-images","neuroimaging","pytorch","pytorch-cnn-classification","streamlit","streamlit-webapp","tinyvgg"],"created_at":"2024-12-02T16:23:42.885Z","updated_at":"2026-04-29T16:39:34.183Z","avatar_url":"https://github.com/Recker-Dev.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CNN Model for Alzheimer's MRI Dataset\n\nThis project implements a Convolutional Neural Network (CNN) for classifying MRI scans into various stages of Alzheimer's Disease using the [Best Alzheimer's MRI Dataset](https://www.kaggle.com/datasets/lukechugh/best-alzheimer-mri-dataset-99-accuracy/data).\n\n## Dataset\n\nThe dataset comprises high-quality MRI scans labeled for Alzheimer's Disease progression. It can be downloaded from [Kaggle](https://www.kaggle.com/datasets/lukechugh/best-alzheimer-mri-dataset-99-accuracy/data).\n\n### Problem Statement\n\nThe task is a **classification** problem to predict the stage of Alzheimer's Disease.\n\n### Classes\n\nThe dataset includes the following classes:\n\n- **Mild Impairment**\n- **Moderate Impairment**\n- **No Impairment**\n- **Very Mild Impairment**\n\n## Model Architecture\n\nThe CNN model comprises two convolutional blocks followed by a fully connected classifier; influenced by TinyVGG16 architecture.\n\n## Performance Metrics\n\nThe model was evaluated on both training and test datasets. Below are the key metrics:\n\n### Training Metrics\n\n- **Loss:** 0.0039\n- **Accuracy:** 99.90%\n- **Precision:** 0.9990\n- **Recall:** 0.9990\n- **F1-Score:** 0.9990\n\n### Testing Metrics\n\n- **Loss:** 0.1574\n- **Accuracy:** 95.47%\n- **Precision:** 0.9563\n- **Recall:** 0.9547\n- **F1-Score:** 0.9548\n\n### Train-Test Loss Over Epochs:\n\n![Train Test Loss as observed over 20 epochs](outputs/train-test-loss-over-epochs.png \"Train Test Loss\")\n\n### Train Data Confusion Matrix:\n\n![Train Data Confusion Matrix](outputs/train_data_cnf_mat.png \"Train Data Confusion Matrix\")\n\n### Test Data Confusion Matrix:\n\n![Test Data Confusion Matrix](outputs/test_data_cnf_mat.png \"Test Data Confusion Matrix\")\n\n## How to get the code\n\n```bash\ngit clone https://github.com/Recker-Dev/alzheimer-cnn-tinyVGG16.git\ncd alzheimer-cnn\n```\n\n## How to Setup Environment\n\nFollow these steps to set up and run the project:\n\n1. **Create a Conda environment**  \n   Run the following command to create a new environment named `alz_torch_cnn` with Python 3.10:\n\n   ```bash\n   conda create --name alz_torch_cnn python=3.10 -y\n   ```\n\n2. **Activate the environment**\n\n   ```bash\n   conda activate alz_torch_cnn\n   ```\n\n3. **Install dependencies**\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Deactivate the environment**\n   ```bash\n   conda deactivate\n   ```\n\n## How to Use the Model\n\nYou can interact with the model in two ways:\n\n1. **Using Jupyter Notebooks**  \n   There are notebooks provided under the `notebooks` section. These notebooks allow you to experiment with the model, visualize predictions, and understand its workings in a step-by-step manner.\n\n2. **Using the Streamlit Application**  \n   For users without much coding background, an application (`app.py`) is provided for easy inference. Follow these steps to use the app:\n\n   - Activate the environment:\n     ```bash\n     conda activate alz_torch_cnn\n     ```\n   - Run the Streamlit app:\n     ```bash\n     streamlit run app.py\n     ```\n\n3. **Testing Images**  \n   Testing images are provided in the `Sample Testing Alzheimer Dataset` folder. Use these images to test the model's performance through the Streamlit app or the provided notebooks.\n\n## Folder Structure:\n\n```\nroot\n├── app.py        # Main Streamlit application for user interaction\n├── models\n│   └── alz_CNN.pt  # Trained PyTorch model for Alzheimer's classification\n├── model_arch.py  # Defines the architecture of the Alzheimer's classification model\n├── notebooks      # Jupyter notebooks for development and analysis\n│   ├── Alzehmier_CNN.ipynb  # Notebook for training the Alzheimer's classification model\n│   └── predict_using_alzehmierCNN.ipynb  # Notebook for demonstrating model prediction\n└── Sample Testing Alzehimer Dataset  # Folder containing sample images for testing\n    └── test            # Subfolder containing images for inference/testing\n        ├── Mild Impairment\n        ├── Moderate Impairment\n        ├── No Impairment\n        └── Very Mild Impairment\n└── requirements.txt  # File listing required Python libraries\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecker-dev%2Falzheimer-cnn-tinyvgg16","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frecker-dev%2Falzheimer-cnn-tinyvgg16","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecker-dev%2Falzheimer-cnn-tinyvgg16/lists"}