timm/eurosat-rgb
Viewer β’ Updated β’ 27k β’ 1.42k β’ 1
Fine-tuned ResNet18 on the EuroSAT dataset for satellite image land use classification. The model classifies Sentinel-2 satellite imagery (10m resolution) into 10 land use/cover categories.
| Metric | Score |
|---|---|
| Test Accuracy | 98.21% |
| Architecture | ResNet18 (ImageNet pretrained) |
| Training Epochs | 20 |
| Dataset Size | 27,000 images |
| Class | Description |
|---|---|
| πΎ AnnualCrop | Annual cropland |
| π² Forest | Dense forest areas |
| πΏ HerbaceousVegetation | Natural vegetation |
| π£οΈ Highway | Road infrastructure |
| π Industrial | Industrial zones |
| π Pasture | Grazing land |
| π³ PermanentCrop | Orchards, vineyards |
| ποΈ Residential | Urban residential areas |
| ποΈ River | Rivers and waterways |
| π SeaLake | Seas and lakes |
import torch
from torchvision import models, transforms
from PIL import Image
import torch.nn as nn
checkpoint = torch.load('eurosat_resnet18_finetuned.pth', map_location='cpu')
model = models.resnet18(weights=None)
model.fc = nn.Sequential(
nn.Dropout(0.4), nn.Linear(512, 256), nn.BatchNorm1d(256),
nn.ReLU(), nn.Dropout(0.2), nn.Linear(256, 10)
)
model.load_state_dict(checkpoint['model_state_dict'])
model.eval()
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
img = Image.open('satellite_image.jpg').convert('RGB')
with torch.no_grad():
pred = model(transform(img).unsqueeze(0))
class_id = pred.argmax(1).item()
print(f"Predicted: {checkpoint['class_names'][class_id]}")
EuroSAT RGB - 27,000 labeled Sentinel-2 satellite images.