This project establishes a comprehensive training pipeline designed to evaluate and compare state-of-the-art image classification models using PyTorch. The primary objective is to automate the training, validation, and evaluation processes for multiple deep learning architectures on a custom dataset. Specifically, this project focuses on classifying eye diseases by utilizing various deep learning architectures, including ResNet, Vision Transformer (ViT), VGG, and DenseNet. The models were trained and evaluated on a dataset obtained from Kaggle.
The dataset used in this project can be found on Kaggle. It includes labeled images of different eye conditions suitable for image classification tasks.
Below is a preview of some example images from the dataset used in training:
- Python
- PyTorch
- torchvision
- OpenCV
- pandas, numpy
- matplotlib, seaborn
- tqdm
- scikit-learn
The training script provided in this project allows training and evaluation of multiple pre-trained models from the torchvision model zoo including:
- ResNet: resnet18, resnet34, resnet50
- VGG: vgg11, vgg13, vgg16, vgg19
- DenseNet: densenet121, densenet169
- Vision Transformers (ViT): vit_b_16, vit_b_32, vit_l_16, vit_l_32
These models are fine-tuned on the user-provided dataset with training and validation splits.
modelPerformance/
├── resnet18/
│ ├── best_model_XXacc_25epochs.h5
│ ├── confusion_matrix.png
│ └── metrics.txt
├── vgg16/
...
- Prepare your dataset in the structure:
data/
├── train/
│ ├── class_1/
│ └── class_2/
└── val/
├── class_1/
└── class_2/
- Load data using torchvision
ImageFolderandDataLoader - Call
Classification_Models(data_loaders)
- You can selectively enable models based on your GPU memory.
- Pretrained weights ensure better convergence on small datasets.
- The script is modular and easy to extend for additional models or evaluation criteria.
Epochs 10
Batch Size 4
| Models Name | Time | Best ACC |
|---|---|---|
| Resnet 18 | 3m 48s | 0.9385 |
| Vit_b_16 | 35m 10s | 0.9243 |
| VGG_11 | 13m 4s | 0.9349 |
| Densenet 121 | 8m 52s | 0.9290 |
Epochs 50
Batch Size 4
| Models Name | Time | Best ACC |
|---|---|---|
| Resnet 18 | 20m 19s | 0.9254 |
| Densenet 121 | 49m 13s | 0.9349 |
I’m always excited to hear your thoughts and ideas! 💡✨ Please don’t hesitate to reach out with any feedback or suggestions that could help make this project even better. Your input means a lot to me! 😊






