kendrickfff commited on
Commit
8b5ee3a
ยท
verified ยท
1 Parent(s): 5714211

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +83 -0
README.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - image-classification
5
+ - pytorch
6
+ - resnet18
7
+ - satellite-imagery
8
+ - remote-sensing
9
+ - eurosat
10
+ datasets:
11
+ - timm/eurosat-rgb
12
+ metrics:
13
+ - accuracy
14
+ pipeline_tag: image-classification
15
+ ---
16
+
17
+ # ๐Ÿ›ฐ๏ธ EuroSAT Satellite Image Classifier
18
+
19
+ ## Model Description
20
+ Fine-tuned **ResNet18** on the **EuroSAT** dataset for satellite image land use classification.
21
+ The model classifies Sentinel-2 satellite imagery (10m resolution) into 10 land use/cover categories.
22
+
23
+ ## Performance
24
+ | Metric | Score |
25
+ |--------|-------|
26
+ | **Test Accuracy** | **98.21%** |
27
+ | Architecture | ResNet18 (ImageNet pretrained) |
28
+ | Training Epochs | 20 |
29
+ | Dataset Size | 27,000 images |
30
+
31
+ ## Classes
32
+ | Class | Description |
33
+ |-------|-------------|
34
+ | ๐ŸŒพ AnnualCrop | Annual cropland |
35
+ | ๐ŸŒฒ Forest | Dense forest areas |
36
+ | ๐ŸŒฟ HerbaceousVegetation | Natural vegetation |
37
+ | ๐Ÿ›ฃ๏ธ Highway | Road infrastructure |
38
+ | ๐Ÿญ Industrial | Industrial zones |
39
+ | ๐Ÿ„ Pasture | Grazing land |
40
+ | ๐ŸŒณ PermanentCrop | Orchards, vineyards |
41
+ | ๐Ÿ˜๏ธ Residential | Urban residential areas |
42
+ | ๐Ÿž๏ธ River | Rivers and waterways |
43
+ | ๐ŸŒŠ SeaLake | Seas and lakes |
44
+
45
+ ## Usage
46
+ ```python
47
+ import torch
48
+ from torchvision import models, transforms
49
+ from PIL import Image
50
+ import torch.nn as nn
51
+
52
+ checkpoint = torch.load('eurosat_resnet18_finetuned.pth', map_location='cpu')
53
+ model = models.resnet18(weights=None)
54
+ model.fc = nn.Sequential(
55
+ nn.Dropout(0.4), nn.Linear(512, 256), nn.BatchNorm1d(256),
56
+ nn.ReLU(), nn.Dropout(0.2), nn.Linear(256, 10)
57
+ )
58
+ model.load_state_dict(checkpoint['model_state_dict'])
59
+ model.eval()
60
+
61
+ transform = transforms.Compose([
62
+ transforms.Resize((224, 224)),
63
+ transforms.ToTensor(),
64
+ transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
65
+ ])
66
+
67
+ img = Image.open('satellite_image.jpg').convert('RGB')
68
+ with torch.no_grad():
69
+ pred = model(transform(img).unsqueeze(0))
70
+ class_id = pred.argmax(1).item()
71
+ print(f"Predicted: {checkpoint['class_names'][class_id]}")
72
+ ```
73
+
74
+ ## Dataset
75
+ [EuroSAT RGB](https://huggingface.co/datasets/timm/eurosat-rgb) - 27,000 labeled Sentinel-2 satellite images.
76
+
77
+ ## Training Details
78
+ - **Base model**: ResNet18 (ImageNet pretrained)
79
+ - **Fine-tuned layers**: layer3 + layer4 + fc head
80
+ - **Optimizer**: AdamW (lr=1e-3, weight_decay=0.01)
81
+ - **Scheduler**: OneCycleLR (max_lr=3e-3)
82
+ - **Augmentation**: RandomFlip, Rotation, ColorJitter, Affine
83
+ - **Label smoothing**: 0.1