ResNet18 Intel Image Classifier
Three fine-tuned ResNet18 models trained on the Intel Image Classification dataset (buildings, forest, glacier, mountain, sea, street), comparing different transfer learning strategies.
Files
resnet18_feature_extract.pthโ only the final layer trained (frozen backbone)resnet18_partial.pthโ layer3, layer4, and final layer trainedresnet18_full.pthโ entire network fine-tuned
Test accuracy
| Strategy | Test Accuracy |
|---|---|
| feature_extract | 87.97% |
| partial | 94.07% |
| full | 93.60% |
Usage
import torch
from torchvision import models
import torch.nn as nn
model = models.resnet18(weights=None)
model.fc = nn.Linear(model.fc.in_features, 6)
model.load_state_dict(torch.load("resnet18_partial.pth", map_location="cpu"))
model.eval()
Classes: buildings, forest, glacier, mountain, sea, street