Downloads · 30 days
0
Fawazzx/alzheimer_classification_using_resnet50_finetuned
alzheimer_classification_using_resnet50_finetuned is a machine learning model from Fawazzx. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains a Jupyter Notebook for fine-tuning a ResNet50 model to classify Alzheimer's disease stages from MRI images. The notebook uses PyTorch and the dataset is loaded from the Hugging Face Datasets l…
Downloads · 30 days
0
Access
Public
Updated Jun 16, 2024
Repo size
94.4 MB
Likes
1
Public
Click a slice to open those files.
.pth94.4 MB · 100%
From the Hugging Face model README
This repository contains a Jupyter Notebook for fine-tuning a ResNet50 model to classify Alzheimer's disease stages from MRI images. The notebook uses PyTorch and the dataset is loaded from the Hugging Face Datasets library.
This notebook fine-tunes a pre-trained ResNet50 model to classify MRI images into one of four stages of Alzheimer's disease:
The dataset used is Falah/Alzheimer_MRI from the Hugging Face Datasets library. It consists of MRI images categorized into the four stages of Alzheimer's disease.
The model architecture is based on ResNet50. The final fully connected layer is modified to output predictions for 4 classes.
To run the notebook locally, follow these steps:
git clone https://github.com/your_username/alzheimer_mri_classification.git
cd alzheimer_mri_classification
pip install -r requirements.txt
jupyter notebook fine-tuning.ipynb
The notebook includes sections for:
The notebook includes a section for evaluating the trained model on the validation set. It calculates and prints the validation loss and accuracy.
Once trained, the model can be saved and used for inference on new MRI images. The trained model weights are saved as alzheimer_model_resnet50.pth.
```python
model = models.resnet50(weights=None)
model.fc = nn.Linear(model.fc.in_features, 4)
model.load_state_dict(torch.load("alzheimer_model_resnet50.pth", map_location=torch.device('cpu')))
model.eval()
```
The model achieved an accuracy of 95.9375% on the validation set.
Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.