Rami/Diabetic_Retinopathy_Preprocessed_Dataset_256x256
Viewer • Updated • 2.75k • 628 • 1
How to use MahimaTayal123/DR-Classifier with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-classification", model="MahimaTayal123/DR-Classifier")
pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png") # Load model directly
from transformers import AutoImageProcessor, AutoModelForImageClassification
processor = AutoImageProcessor.from_pretrained("MahimaTayal123/DR-Classifier")
model = AutoModelForImageClassification.from_pretrained("MahimaTayal123/DR-Classifier")# Load model directly
from transformers import AutoImageProcessor, AutoModelForImageClassification
processor = AutoImageProcessor.from_pretrained("MahimaTayal123/DR-Classifier")
model = AutoModelForImageClassification.from_pretrained("MahimaTayal123/DR-Classifier")This model is a fine-tuned version of google/vit-base-patch16-224-in21k on an unknown dataset. It achieves the following results on the evaluation set:
This model leverages the Vision Transformer (ViT) architecture to classify retinal images for early detection of Diabetic Retinopathy (DR). The fine-tuned model improves accuracy and generalization on medical imaging datasets.
The model was trained on a curated dataset containing labeled retinal images. The dataset includes various severity levels of Diabetic Retinopathy, ensuring robustness in classification.
The following hyperparameters were used during training:
| Epoch | Train Loss | Validation Loss | Train Accuracy |
|---|---|---|---|
| 1 | 0.4513 | 0.5234 | 0.8270 |
| 2 | 0.3124 | 0.4102 | 0.8930 |
| 3 | 0.2751 | 0.3856 | 0.9150 |
| 4 | 0.2376 | 0.3012 | 0.9320 |
| 5 | 0.2187 | 0.2654 | 0.9420 |
Base model
google/vit-base-patch16-224-in21k
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="MahimaTayal123/DR-Classifier") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")