File size: 1,907 Bytes
d72098a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
license: mit
language:
- en
tags:
- swin-transformer
- satellite-imagery
- image-classification
- pytorch
- computer-vision
pipeline_tag: image-classification
---

# Swin Transformer — Satellite Image Classification

PyTorch implementation of Swin Transformer (Liu et al. 2021) trained on NWPU-RESISC45 satellite imagery dataset.

## Model Details

| Property | Value |
|---|---|
| Architecture | Swin Transformer (4 stages) |
| Dataset | NWPU-RESISC45 |
| Classes | 45 land use categories |
| Test Accuracy | 82% |
| Input Size | 224×224 |
| Embed Dim | 96 |
| Training Hardware | RTX 4050 6GB |
| Framework | PyTorch (from scratch) |

## Classes
airplane, airport, baseball_diamond, basketball_court, beach, bridge,
chaparral, church, circular_farmland, cloud, commercial_area, dense_residential,
desert, forest, freeway, golf_course, ground_track_field, harbor, industrial_area,
intersection, island, lake, meadow, medium_residential, mobile_home_park,
mountain, overpass, palace, parking_lot, railway, railway_station,
rectangular_farmland, river, roundabout, runway, sea_ice, ship, snowberg,
sparse_residential, stadium, storage_tank, tennis_court, terrace, thermal_power_station, wetland

## Usage

```python
from huggingface_hub import hf_hub_download
import torch
from torchvision import transforms
from PIL import Image

checkpoint = torch.load(
    hf_hub_download("Sathya77/swin-transformer-satellite", "swin_resisc45.pth"),
    map_location='cpu'
)

model = SwinTransformer(embed_dim=96, num_classes=45)
model.load_state_dict(checkpoint['model_state_dict'])
model.eval()
```

## Live Demo
Try it here: [Sathya77/swin-transformer-satellite](https://huggingface.co/spaces/Sathya77/swin-transformer-satellite)

## References
- [Swin Transformer Paper](https://arxiv.org/abs/2103.14030) — Liu et al. 2021
- [NWPU-RESISC45 Dataset](http://www.escience.cn/people/JunweiHan/NWPU-RESISC45.html)