Fawazzx/Alzheimer_Classification
2
1---2title: Alzheimer Classification3emoji: ๐4colorFrom: indigo5colorTo: indigo6sdk: gradio7sdk_version: 4.36.18app_file: app.py9pinned: false10license: apache-2.011---12# Alzheimer MRI Classification13 14This repository contains a Gradio application for classifying Alzheimer's disease stages from MRI images using a fine-tuned ResNet50 model. The application is deployed on Hugging Face Spaces.15 16## Table of Contents17- [Introduction](#introduction)18- [Model Details](#model-details)19- [Setup](#setup)20- [Usage](#usage)21- [Contributing](#contributing)22 23## Introduction24This application uses a convolutional neural network (ResNet50) to classify MRI images into one of four stages of Alzheimer's disease:25- Mild Demented26- Moderate Demented27- Non-Demented28- Very Mild Demented29 30The model is fine-tuned on a custom dataset and can be accessed through a user-friendly web interface powered by Gradio.31 32## Model Details33The model architecture is based on ResNet50, with the final fully connected layer adjusted to output predictions for 4 classes. The model is trained using PyTorch and fine-tuned on a dataset of MRI images.34 35## Setup36To run the application locally, follow these steps:37 381. Clone the repository:39 ```bash40 git clone https://github.com/your_username/alzheimer_mri_classification.git41 cd alzheimer_mri_classification42 ```43 442. Install the required dependencies:45 ```bash46 pip install -r requirements.txt47 ```48 493. Ensure you have the model file (`alzheimer_model_resnet50.pth`) in the root directory of the project. You can download it from [Hugging Face Hub](https://huggingface.co/your_username/alzheimer_model_resnet50).50 514. Run the application:52 ```bash53 python app.py54 ```55 565. The Gradio interface will launch and can be accessed in your web browser at `http://127.0.0.1:7860`.57 58## Usage59Once the application is running, you can upload an MRI image through the web interface and get the predicted classification.60 61### Example Usage621. Open the application in your browser.632. Click on "Upload an MRI Image" to upload an image.643. The application will display the predicted classification for the uploaded image.65 66 67## Contributing68Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.69 70 71Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference72 