Multi-Class Classification of retina images using deep learning
Take a look to my Medium Post about this project here!
Use the Python version 3.7.6 and install the libraries in the requirements.txt file of this repo
-
Download the dataset from this link. Then, unzip the compressed file.
-
Download the trained model from: link
Your project structure should be like this:
.
├── data.ipynb
├── retinopathy-model-adam-ce.pt
├── archive
│ ├── 0
│ │ └── *.jpeg
│ ...
│ └── 4
│ └── *.jpeg
├── utils
│ ├── dataprocessing.py
│ ├── engine.py
│ ├── visualizations.py
└── ...The aim of this project is to classify retina images into different types of Diabetic Retinopathy using deep learning, specifically a ResNet50 convolutional neural network. Diabetic Retinopathy is a common complication of diabetes and can lead to blindness if left untreated. Early detection of the condition is crucial to prevent blindness. Hence, it is important to train models able to diagnose these pathologies.
This repo is organized this way:
- The archive folder where the dataset is stored.
- The utils folder that contains the dataprocessing, engine and visualization scripts that hold functions that are used in the jupyter notebook.
- Tha jupyter notebook, data.ipynb where data exploration, visualizations, training, and evaluation is made.
| | **precision** | **recall** | **f1-score** |
|-------------------:|--------------:|-----------:|-------------:|
| 0 | 0.7676 | 0.9504 | 0.8493 |
| 1 | 0.0000 | 0.0000 | 0.0000 |
| 2 | 0.3211 | 0.1076 | 0.1612 |
| 3 | 0.1036 | 0.1657 | 0.1275 |
| 4 | 0.0000 | 0.0000 | 0.0000 |
| **accuracy** | 0.7185 | 0.7185 | 0.7185 |
| **macro avg** | 0.2385 | 0.2448 | 0.2276 |
| **weighted avg** | 0.6149 | 0.7185 | 0.6514 |- After downloading the dataset and the model weigths as in the Installation Section, run the jupyter notebook cells.
Credits to Kaggle for the data. The code of this project was based on this notebook