Downloads · 30 days
0
Shad0wKillar/efficientnet-b5
efficientnet-b5 is a image classification model from Shad0wKillar. Use it when you need a label for an image. The card lists the license as mit.
I fine-tuned a pre-trained EfficientNet-B5 model to classify images into three categories: pizza, steak, and sushi.
Downloads · 30 days
0
Access
Public
Updated Apr 30, 2026
Repo size
115 MB
Likes
1
Public
Click a slice to open those files.
.pth114 MB · 99%
From the Hugging Face model README
I fine-tuned a pre-trained EfficientNet-B5 model to classify images into three categories: pizza, steak, and sushi.
torchvision.models.efficientnet_b5EfficientNet_B5_Weights.DEFAULTI trained the model for 10 epochs using the Adam optimizer.
cuda (if available) with a set manual seed of 37 for reproducibility.I used a 20% subset of a pizza, steak, and sushi dataset. The data was split into train and test directories.
Over the 10 epochs, the training and testing loss steadily decreased, with the testing loss ending impressively below 0.20. The testing accuracy consistently outperformed the training accuracy and finished highly stable at roughly 97.5%.

The model performs exceptionally well across all three classes on the test set, showing strong improvements over previous iterations:

I plotted the instances where the model was confident but incorrect. The model struggled specifically with predicting complex textures as sushi, though its highest confidence on these incorrect predictions hovered around only 0.51, indicating it was less confident in its errors compared to earlier models.

import torch
import torchvision
# I loaded the model architecture
weights = torchvision.models.EfficientNet_B5_Weights.DEFAULT
model = torchvision.models.efficientnet_b5(weights=weights)
# I modified the classifier
model.classifier = torch.nn.Sequential(
torch.nn.Dropout(p=0.2, inplace=True),
torch.nn.Linear(in_features=2048, out_features=3, bias=True),
)
# I loaded the saved weights
model.load_state_dict(torch.load("EfficientNet_B5_20percent.pth", map_location="cpu"))
model.eval()