Adilbai commited on
Commit
beb1210
·
verified ·
1 Parent(s): 38d06ba

Upload EuroSAT classifier

Browse files
.gitattributes CHANGED
@@ -33,3 +33,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ confusion_matrix_detailed.png filter=lfs diff=lfs merge=lfs -text
37
+ confusion_matrix_epoch_1.png filter=lfs diff=lfs merge=lfs -text
38
+ confusion_matrix_epoch_6.png filter=lfs diff=lfs merge=lfs -text
39
+ per_class_performance.png filter=lfs diff=lfs merge=lfs -text
40
+ probability_distribution.png filter=lfs diff=lfs merge=lfs -text
41
+ training_history.png filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: microsoft/swin-base-patch4-window7-224
4
+ tags:
5
+ - image-classification
6
+ - satellite-imagery
7
+ - eurosat
8
+ - remote-sensing
9
+ - transformer
10
+ datasets:
11
+ - nielsr/eurosat-demo
12
+ metrics:
13
+ - accuracy
14
+ - f1
15
+ library_name: transformers
16
+ pipeline_tag: image-classification
17
+ ---
18
+
19
+ # EuroSAT Satellite Image Classifier
20
+
21
+ This model is a fine-tuned version of `microsoft/swin-base-patch4-window7-224` for satellite image classification on the EuroSAT-SAR dataset.
22
+
23
+ ## Model Details
24
+
25
+ - **Base Model**: microsoft/swin-base-patch4-window7-224
26
+ - **Dataset**: EuroSAT-SAR (Synthetic Aperture Radar satellite images)
27
+ - **Task**: Multi-class image classification
28
+ - **Number of Classes**: 10
29
+ - **Image Size**: 224x224
30
+
31
+ ## Classes
32
+
33
+ The model can classify satellite images into the following 10 categories:
34
+
35
+ - 0: AnnualCrop
36
+ - 1: Forest
37
+ - 2: HerbaceousVegetation
38
+ - 3: Highway
39
+ - 4: Industrial
40
+ - 5: Pasture
41
+ - 6: PermanentCrop
42
+ - 7: Residential
43
+ - 8: River
44
+ - 9: SeaLake
45
+
46
+ ## Training Details
47
+
48
+ - **Learning Rate**: 5e-05
49
+ - **Batch Size**: 32
50
+ - **Number of Epochs**: 10
51
+ - **Optimizer**: AdamW
52
+ - **Weight Decay**: 0.01
53
+ - **Warmup Steps**: 500
54
+
55
+ ## Usage
56
+
57
+ ```python
58
+ from transformers import AutoImageProcessor, AutoModel
59
+ from PIL import Image
60
+ import torch
61
+
62
+ # Load the model and processor
63
+ processor = AutoImageProcessor.from_pretrained("Adilbai/eurosat-swin-transformer")
64
+ model = AutoModel.from_pretrained("Adilbai/eurosat-swin-transformer")
65
+
66
+ # Load and preprocess an image
67
+ image = Image.open("path_to_your_satellite_image.jpg")
68
+ inputs = processor(images=image, return_tensors="pt")
69
+
70
+ # Make prediction
71
+ with torch.no_grad():
72
+ outputs = model(**inputs)
73
+ predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
74
+ predicted_class = predictions.argmax().item()
75
+
76
+ print(f"Predicted class: {predicted_class}")
77
+ Dataset
78
+ This model was trained on the EuroSAT-SAR dataset, which contains Synthetic Aperture Radar (SAR) satellite images from the Sentinel-1 satellite. The dataset includes land use and land cover classification of European landscapes.
79
+
80
+ Performance
81
+ The model achieves competitive performance on the EuroSAT-SAR test set. Detailed evaluation metrics can be found in the training logs.
82
+
83
+ Training Infrastructure
84
+ Framework: PyTorch with Transformers
85
+ Hardware: CUDA-compatible GPU
86
+ Mixed Precision: Enabled for efficient training
87
+ Monitoring: TensorBoard for training visualization
88
+ Citation
89
+ If you use this model, please cite:
90
+
91
+ BibTeX
92
+ @article{eurosat,
93
+ title={EuroSAT: A Novel Dataset and Deep Learning Benchmark for Land Use and Land Cover Classification},
94
+ author={Helber, Patrick and Bischke, Benjamin and Dengel, Andreas and Borth, Damian},
95
+ journal={IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing},
96
+ year={2019}
97
+ }
98
+ License
99
+ This model is released under the Apache 2.0 License.
config.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "EuroSATTransformerClassifier"
4
+ ],
5
+ "model_type": "eurosat-transformer",
6
+ "num_labels": 10,
7
+ "id2label": {
8
+ "0": "AnnualCrop",
9
+ "1": "Forest",
10
+ "2": "HerbaceousVegetation",
11
+ "3": "Highway",
12
+ "4": "Industrial",
13
+ "5": "Pasture",
14
+ "6": "PermanentCrop",
15
+ "7": "Residential",
16
+ "8": "River",
17
+ "9": "SeaLake"
18
+ },
19
+ "label2id": {
20
+ "AnnualCrop": 0,
21
+ "Forest": 1,
22
+ "HerbaceousVegetation": 2,
23
+ "Highway": 3,
24
+ "Industrial": 4,
25
+ "Pasture": 5,
26
+ "PermanentCrop": 6,
27
+ "Residential": 7,
28
+ "River": 8,
29
+ "SeaLake": 9
30
+ },
31
+ "base_model": "microsoft/swin-base-patch4-window7-224",
32
+ "image_size": 224,
33
+ "dropout_rate": 0.1,
34
+ "problem_type": "single_label_classification"
35
+ }
confusion_matrix_detailed.png ADDED

Git LFS Details

  • SHA256: 1d3943bc613ba70ad0a7a58732fc209394207bfd130a75f9f9a8930663022e3b
  • Pointer size: 131 Bytes
  • Size of remote file: 409 kB
confusion_matrix_epoch_1.png ADDED

Git LFS Details

  • SHA256: 6151f36dc78d33cf642df2e99e221f44616f62996c9efceb6f8b2eb0688546e3
  • Pointer size: 131 Bytes
  • Size of remote file: 288 kB
confusion_matrix_epoch_6.png ADDED

Git LFS Details

  • SHA256: f495d1d94200d4f4e18781a6a904f8c20110bb03e09dd4d9b0bb399c4e28218a
  • Pointer size: 131 Bytes
  • Size of remote file: 289 kB
evaluation_results.json ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metrics": {
3
+ "accuracy": 0.9881481481481481,
4
+ "precision_weighted": 0.9882860757948263,
5
+ "recall_weighted": 0.9881481481481481,
6
+ "f1_weighted": 0.9881731188401808,
7
+ "precision_per_class": [
8
+ 0.9800664451827242,
9
+ 1.0,
10
+ 0.9830508474576272,
11
+ 0.9920318725099602,
12
+ 1.0,
13
+ 0.9898477157360406,
14
+ 0.9498069498069498,
15
+ 0.9966666666666667,
16
+ 0.9920318725099602,
17
+ 0.9966666666666667
18
+ ],
19
+ "recall_per_class": [
20
+ 0.9833333333333333,
21
+ 0.99,
22
+ 0.9666666666666667,
23
+ 0.996,
24
+ 0.996,
25
+ 0.975,
26
+ 0.984,
27
+ 0.9966666666666667,
28
+ 0.996,
29
+ 0.9966666666666667
30
+ ],
31
+ "f1_per_class": [
32
+ 0.9816971713810315,
33
+ 0.9949748743718593,
34
+ 0.9747899159663865,
35
+ 0.9940119760479043,
36
+ 0.9979959919839679,
37
+ 0.982367758186398,
38
+ 0.9666011787819253,
39
+ 0.9966666666666667,
40
+ 0.9940119760479043,
41
+ 0.9966666666666667
42
+ ],
43
+ "support_per_class": [
44
+ 300,
45
+ 300,
46
+ 300,
47
+ 250,
48
+ 250,
49
+ 200,
50
+ 250,
51
+ 300,
52
+ 250,
53
+ 300
54
+ ],
55
+ "classification_report": {
56
+ "AnnualCrop": {
57
+ "precision": 0.9800664451827242,
58
+ "recall": 0.9833333333333333,
59
+ "f1-score": 0.9816971713810315,
60
+ "support": 300
61
+ },
62
+ "Forest": {
63
+ "precision": 1.0,
64
+ "recall": 0.99,
65
+ "f1-score": 0.9949748743718593,
66
+ "support": 300
67
+ },
68
+ "HerbaceousVegetation": {
69
+ "precision": 0.9830508474576272,
70
+ "recall": 0.9666666666666667,
71
+ "f1-score": 0.9747899159663865,
72
+ "support": 300
73
+ },
74
+ "Highway": {
75
+ "precision": 0.9920318725099602,
76
+ "recall": 0.996,
77
+ "f1-score": 0.9940119760479043,
78
+ "support": 250
79
+ },
80
+ "Industrial": {
81
+ "precision": 1.0,
82
+ "recall": 0.996,
83
+ "f1-score": 0.9979959919839679,
84
+ "support": 250
85
+ },
86
+ "Pasture": {
87
+ "precision": 0.9898477157360406,
88
+ "recall": 0.975,
89
+ "f1-score": 0.982367758186398,
90
+ "support": 200
91
+ },
92
+ "PermanentCrop": {
93
+ "precision": 0.9498069498069498,
94
+ "recall": 0.984,
95
+ "f1-score": 0.9666011787819253,
96
+ "support": 250
97
+ },
98
+ "Residential": {
99
+ "precision": 0.9966666666666667,
100
+ "recall": 0.9966666666666667,
101
+ "f1-score": 0.9966666666666667,
102
+ "support": 300
103
+ },
104
+ "River": {
105
+ "precision": 0.9920318725099602,
106
+ "recall": 0.996,
107
+ "f1-score": 0.9940119760479043,
108
+ "support": 250
109
+ },
110
+ "SeaLake": {
111
+ "precision": 0.9966666666666667,
112
+ "recall": 0.9966666666666667,
113
+ "f1-score": 0.9966666666666667,
114
+ "support": 300
115
+ },
116
+ "accuracy": 0.9881481481481481,
117
+ "macro avg": {
118
+ "precision": 0.9880169036536595,
119
+ "recall": 0.9880333333333333,
120
+ "f1-score": 0.987978417610071,
121
+ "support": 2700
122
+ },
123
+ "weighted avg": {
124
+ "precision": 0.9882860757948263,
125
+ "recall": 0.9881481481481481,
126
+ "f1-score": 0.9881731188401808,
127
+ "support": 2700
128
+ }
129
+ }
130
+ },
131
+ "config": {
132
+ "model_name": "microsoft/swin-base-patch4-window7-224",
133
+ "num_labels": 10,
134
+ "batch_size": 32,
135
+ "learning_rate": 5e-05,
136
+ "num_epochs": 10
137
+ },
138
+ "label_names": [
139
+ "AnnualCrop",
140
+ "Forest",
141
+ "HerbaceousVegetation",
142
+ "Highway",
143
+ "Industrial",
144
+ "Pasture",
145
+ "PermanentCrop",
146
+ "Residential",
147
+ "River",
148
+ "SeaLake"
149
+ ]
150
+ }
per_class_performance.png ADDED

Git LFS Details

  • SHA256: a3620c7a6488cd45f2eb94d9966c9a2fa8c03670e0c6f03291fc10c39cb0e0b4
  • Pointer size: 131 Bytes
  • Size of remote file: 265 kB
probability_distribution.png ADDED

Git LFS Details

  • SHA256: 58bdb395a1a0e4b11b7d1f504cc590fc87cc90f06fcaf9ef3ec64885cf65e1d7
  • Pointer size: 131 Bytes
  • Size of remote file: 109 kB
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33db89561cc5e5a58faf3254d4d0194627a9e280c2bcb37030f11b7936569559
3
+ size 350281670
training_args.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "learning_rate": 5e-05,
3
+ "num_epochs": 10,
4
+ "batch_size": 32,
5
+ "warmup_steps": 500,
6
+ "weight_decay": 0.01,
7
+ "model_name": "microsoft/swin-base-patch4-window7-224"
8
+ }
training_history.png ADDED

Git LFS Details

  • SHA256: a99209087c2f1c7c335d911a329b7cd5ac50d322dbf85f03d84a198785d545b3
  • Pointer size: 131 Bytes
  • Size of remote file: 304 kB