csaybar commited on
Commit
dc938c7
1 Parent(s): 44feb0c

Upload 14 files

Browse files
.gitattributes CHANGED
@@ -56,3 +56,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
56
  # Video files - compressed
57
  *.mp4 filter=lfs diff=lfs merge=lfs -text
58
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
56
  # Video files - compressed
57
  *.mp4 filter=lfs diff=lfs merge=lfs -text
58
  *.webm filter=lfs diff=lfs merge=lfs -text
59
+ demo/dem_SA_SA5120_E1223N0237.tif filter=lfs diff=lfs merge=lfs -text
60
+ demo/demo_p509.tif filter=lfs diff=lfs merge=lfs -text
61
+ test/test_2000_high.mlstac filter=lfs diff=lfs merge=lfs -text
62
+ test/test_509_high.mlstac filter=lfs diff=lfs merge=lfs -text
63
+ test/test_509_scribble.mlstac filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,78 @@
1
- ---
2
- license: cc0-1.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ license: cc0-1.0
2
+ task_categories:
3
+ - image-segmentation
4
+ language:
5
+ - en
6
+ tags:
7
+ - earth-observation
8
+ - remote-sensing
9
+ - sentinel-2
10
+ - multi-spectral
11
+ - satellite
12
+ - geospatial
13
+ pretty_name: cloudsen12
14
+ size_categories:
15
+ - 100K<n<1M
16
+ ---
17
+
18
+
19
+ <img src="cloudsen12.gif" alt="drawing" width="20%"/>
20
+
21
+
22
+ **CloudSEN12+** is a significant extension of the [CloudSEN12](https://cloudsen12.github.io/) dataset, which doubles the number of expert-reviewed labels, making it, by
23
+ a large margin, the largest cloud detection dataset to date for Sentinel-2. All labels from the previous version have been curated and refined, enhancing the
24
+ dataset's trustworthiness. This new release is licensed **under CC0**, which puts it in the public domain and allows anyone to use, modify, and distribute
25
+ it without permission or attribution.
26
+
27
+ ## Data Folder order
28
+
29
+
30
+ The CloudSEN12+ dataset is organized into `train`, `val`, and `test` splits. The images have
31
+ been padded from 509x509 to 512x512 and 2000x2000 to 2048x2048 to ensure that the patches are divisible by 32. The padding is filled with zeros in the left and bottom sides of the image. For
32
+ those who prefer traditional storage formats, GeoTIFF files are available in our [ScienceDataBank](https://www.scidb.cn/en/detail?dataSetId=2036f4657b094edfbb099053d6024b08&version=V1) repository.
33
+
34
+ <center>
35
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/6402474cfa1acad600659e92/9UA4U3WObVeq7BAcf37-C.png" alt="drawing" width="50%"/>
36
+ </center>
37
+
38
+ *CloudSEN12+ spatial coverage. The terms p509 and p2000 denote the patch size 509 × 509 and 2000 × 2000, respectively. ‘high’, ‘scribble’, and ‘nolabel’ refer to the types of expert-labeled annotations*
39
+
40
+ ## Data Structure
41
+
42
+ We use `.mlstac` format to store the data in HugginFace and GeoTIFF for ScienceDataBank.
43
+
44
+
45
+ Index | Name | Scale | Wavelength | Description |
46
+ |------|------|--------|---------------------------------|--------------------------|
47
+ | 0 | B1 | 0.0001 | 443.9 nm (S2A)/442.3 nm (S2B) | Aerosols. |
48
+ | 1 | B2 | 0.0001 | 496.6 nm (S2A)/492.1 nm (S2B) | Blue. |
49
+ | 2 | B3 | 0.0001 | 560 nm (S2A)/559 nm (S2B) | Green. |
50
+ | 3 | B4 | 0.0001 | 664.5 nm (S2A)/665 nm (S2B) | Red. |
51
+ | 4 | B5 | 0.0001 | 703.9 nm (S2A)/703.8 nm (S2B) | Red Edge 1. |
52
+ | 5 | B6 | 0.0001 | 740.2 nm (S2A)/739.1 nm (S2B) | Red Edge 2. |
53
+ | 6 | B7 | 0.0001 | 782.5 nm (S2A)/779.7 nm (S2B) | Red Edge 3. |
54
+ | 7 | B8 | 0.0001 | 835.1 nm (S2A)/833 nm (S2B) | NIR. |
55
+ | 8 | B8A | 0.0001 | 864.8 nm (S2A)/864 nm (S2B) | Red Edge 4. |
56
+ | 9 | B9 | 0.0001 | 945 nm (S2A)/943.2 nm (S2B) | Water vapor. |
57
+ | 10 | B10 | 0.0001 | 1373.5 nm (S2A)/1376.9 nm (S2B) | Cirrus. |
58
+ | 11 | B11 | 0.0001 | 1613.7 nm (S2A)/1610.4 nm (S2B) | SWIR 1. |
59
+ | 12 | B12 | 0.0001 | 2202.4 nm (S2A)/2185.7 nm (S2B) | SWIR 2. |
60
+ | 13 | CM1 | 1 | - | Expert-labeled image. |
61
+ | 14 | CM2 | 1 | - | UnetMobV2-labeled image. |
62
+
63
+
64
+ ## Folder Structure
65
+
66
+
67
+ The **fixed/** folder contains high and scribble labels, which have been improved in this new version. These changes have already been integrated.
68
+
69
+ The **demo/** folder contains examples illustrating how to utilize the models trained with CLoudSEN12 to estimate the hardness and trustworthiness indices.
70
+
71
+ The **images/** folder contains the CloudSEN12+ imagery
72
+
73
+ ## Download
74
+
75
+
76
+ ## Citation
77
+
78
+ Cooming soon!
cloudsen12.gif ADDED

Git LFS Details

  • SHA256: 1d6099e58818882cb489359cc1b61c76322515eeca8e65eaa9072c4af9cfe856
  • Pointer size: 132 Bytes
  • Size of remote file: 1.62 MB
demo/dem_SA_SA5120_E1223N0237.tif ADDED

Git LFS Details

  • SHA256: f4cad0abedd78bade954c35df891c9e63d2a32ce3125f5a8328c384de24bb159
  • Pointer size: 133 Bytes
  • Size of remote file: 92.5 MB
demo/demo.py ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import segmentation_models_pytorch as smp
2
+ import sklearn.metrics
3
+ import torch
4
+ import timm
5
+
6
+ # -- Replace with your data --
7
+ x = torch.randn(1, 13, 512, 512) # S2 L1C image
8
+ y = torch.randint(0, 4, (1, 512, 512)).numpy() # Target
9
+
10
+
11
+ # -- Load the segmentation model - UNetMobV2 --
12
+ segmodel = smp.Unet(
13
+ encoder_name="mobilenet_v2",
14
+ encoder_weights=None,
15
+ in_channels=13,
16
+ classes=4
17
+ )
18
+ segmodel.load_state_dict(torch.load("models/UNetMobV2.pt"))
19
+ segmodel.eval()
20
+
21
+
22
+ # -- Predict the cloud mask --
23
+ with torch.no_grad():
24
+ yhat = segmodel(x)
25
+ cloudmask = torch.argmax(yhat, dim=1).cpu().numpy().squeeze()
26
+
27
+
28
+ # -- Predict the trustworthiness index (TI) --
29
+ ti_index = sklearn.metrics.fbeta_score(
30
+ y_true=y.flatten(),
31
+ y_pred=cloudmask.flatten(),
32
+ beta=2.0,
33
+ average="macro"
34
+ )
35
+
36
+
37
+ # -- Load the hardness index (HI) model --
38
+ hi_model = timm.create_model(
39
+ model_name="resnet10t",
40
+ pretrained=True,
41
+ num_classes=1,
42
+ in_chans=13
43
+ )
44
+ hi_model.load_state_dict(torch.load("models/resnet10.pt"))
45
+ hi_model.eval()
46
+
47
+
48
+ # -- Estimate the hardness index (HI) --
49
+ with torch.no_grad():
50
+ y = hi_model(x)
51
+ hi_index = torch.sigmoid(y).cpu().numpy().squeeze().item()
52
+
53
+
54
+ # -- Decision making --
55
+ if (ti_index < 0.3) & (hi_index > 0.5):
56
+ perror = 1
57
+ else:
58
+ perror = 0
demo/demo_p509.tif ADDED

Git LFS Details

  • SHA256: 23bad3a815dbd6e5090436be9b2d07d1deeea86b40a83d160d853c463bbe0d6c
  • Pointer size: 132 Bytes
  • Size of remote file: 5.55 MB
demo/models/L2A_EfficientNetUnet.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3bd7e691020d6231309bc17665fedfebffcf08cb1fb4906c3ac905f080be2aee
3
+ size 36019691
demo/models/UNetMobV2.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bcb6db6a592143b43363ba655f46924487a9d5488b49913126424beffeed8d1a
3
+ size 26794501
demo/models/resnet10.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84110a2d4bd8bdf176d7d59d7c6047b516186fcfb7a9b25decd482bdfe181d9c
3
+ size 19750419
fixed/high.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cbf40be4354bcccf6add3408b673a1411120c35b700fe04b582ebd1d881adb26
3
+ size 1842276479
fixed/scribble.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fe8edbff6e875a9300dcb73140f78d6bc9cd798f3ead2c552c3bbae4f92680a8
3
+ size 587426915
test/metadata.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93bdba643d2fcff2716afeb59913f9552e22a87a2311fceeb91fd21ba21dc61d
3
+ size 136427
test/test_2000_high.mlstac ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:996747add5bb7a8d50b014274ed6f4a555dfd5b5aa3a5e2461d8cfd26cff10f9
3
+ size 2622789473
test/test_509_high.mlstac ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8ccdeb5c8c0e6d3e1e40b6ab86683239b457bc2868d2c66354909263ca2a126
3
+ size 1908740388
test/test_509_scribble.mlstac ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cac661a2648e059cfbdca9a2d06ace2e2982c0405ca40b3d2b4bd5eaac57e3a6
3
+ size 1288538676