EfficientNet-B0 Fine-Tuned on Painting Style Classification π¨
This is a fine-tuned image classification model based on torchvision.models.efficientnet_b0
initialized with pretrained weights from IMAGENET1K_V1. It has been fine-tuned to classify artworks into 9 different painting styles.
π§ Model Details
- Base model: EfficientNet-B0
- Pretrained weights: IMAGENET1K_V1
- Fine-tuned on: keremberke/painting-style-classification
- Number of classes: 9
- Best validation accuracy: 60.15%
- Training epochs: 50
βοΈ Training Details
- Loss function: CrossEntropyLoss with label smoothing (
label_smoothing=0.1
) - Optimizer: AdamW (
lr=1e-4
,weight_decay=0.01
) - Scheduler: ReduceLROnPlateau (mode='max', patience=5, factor=0.5)
- Layer freezing: All layers up to layer 100 were frozen during training
π Usage
from torchvision import transforms
from PIL import Image
transform = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225],
),
])
# Example usage:
img = Image.open("your_image.jpg").convert("RGB")
input_tensor = transform(img).unsqueeze(0)
output = model(input_tensor)
pred = torch.argmax(output, dim=1)