File size: 8,189 Bytes
b212a94
 
167fc2e
 
 
 
 
 
 
 
 
 
 
 
 
b212a94
2012c63
 
 
167fc2e
2012c63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5e0f559
2012c63
 
 
 
 
 
 
5e0f559
2012c63
 
 
 
167fc2e
2012c63
 
 
 
 
 
b1ef176
 
 
 
 
 
 
 
 
 
 
6b2a67c
 
 
 
 
 
285513d
 
 
 
 
911de20
 
5e0f559
 
6b2a67c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2012c63
 
5e0f559
 
 
2012c63
 
 
 
 
 
 
 
167fc2e
2012c63
 
 
 
5e0f559
 
2012c63
 
 
 
 
 
 
 
167fc2e
2012c63
 
 
 
 
5e0f559
 
 
2012c63
 
 
 
 
 
 
 
167fc2e
2012c63
 
fee8f12
 
5e0f559
 
 
fee8f12
 
 
 
 
 
 
 
 
 
 
 
 
5e0f559
 
 
fee8f12
 
5e0f559
fee8f12
 
 
 
 
 
 
 
2012c63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5e0f559
 
 
 
 
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
---
license: mit
task_categories:
- image-to-image
language:
- en
tags:
- earth
- remote sensing
- super-resolution
- Sentinel-2
- sentinel-2
pretty_name: opensr_test
size_categories:
- 10K<n<100K
---


<p align="center">
  <a href="https://github.com/ESAOpenSR/opensr-test"><img src="images/logo.png" alt="header" width="50%"></a>
</p>

<p align="center">
    <em>
    A comprehensive benchmark for real-world Sentinel-2 imagery super-resolution
    </em>
</p>

---

**GitHub**: [https://github.com/ESAOpenSR/opensr-test](https://github.com/ESAOpenSR/opensr-test)

**Documentation**: [https://esaopensr.github.io/opensr-test](https://esaopensr.github.io/opensr-test)

**PyPI**: [https://pypi.org/project/opensr-test/](https://pypi.org/project/opensr-test/)

**Paper**: [https://ieeexplore.ieee.org/abstract/document/10530998](https://ieeexplore.ieee.org/abstract/document/10530998)

---

#

## **Overview**

Super-resolution (SR) aims to improve satellite imagery ground sampling distance. However, two problems are common in the literature. First, most models are **tested on synthetic data**, raising doubts about their real-world applicability and performance. Second, traditional evaluation metrics such as PSNR, LPIPS, and SSIM are not designed to assess SR performance. These metrics fall short, especially in conditions involving changes in luminance or spatial misalignments - scenarios frequently encountered in real world.

To address these challenges, 'opensr-test' provides a fair approach for SR benchmark. We provide three datasets carefully crafted to minimize spatial and spectral misalignment. Besides, 'opensr-test' precisely assesses SR algorithm performance across three independent metrics groups that measure consistency, synthesis, and correctness.

<p align="center">
  <img src="images/diagram.png" alt="header">
</p>



## **Datasets**

The `opensr-test` package provides five datasets for benchmarking SR models. These datasets are carefully crafted to minimize spatial and spectral misalignment. 

| Dataset | Scale factor | Number of images | HR patch size |
|---------|--------------|-------------------|--------------|
| NAIP    | x4           | 62               | 484x484       |
| SPOT    | x4           | 9               | 512x512       |
| Venµs   | x2           | 59               | 256x256       |
| SPAIN CROPS | x4       | 28               | 512x512       |
| SPAIN URBAN | x4       | 20               | 512x512       |

Each dataset consists of a dictionary with the following keys:

- **`L2A`**: Sentinel-2 L2A bands (12 bands).
- **`L1C`**: Sentinel-2 L1C bands (12 bands).
- **`HR`**: High-resolution image (RGBNIR) without harmonization.
- **`HRharm`**: Harmonized high-resolution image (RGBNIR). The HRharm image is **harmonized with respect to the Sentinel-2 L2A bands**.
- **`metadata`**: A pandas DataFrame with the images' metadata.
    - **`lr_file:`** The low-resolution image file path.
    - **`hr_file:`** The high-resolution image file path.
    - **`roi:`** The spatial unique identifier.
    - **`lr_gee_id:`** The low-resolution image Google Earth Engine id.
    - **`reflectance:`** How SR affects the mean of reflectance values. It uses the L1 norm. The lower the value, the better the reflectance consistency.
    - **`spectral:`** This shows how the harmonization affects the spectral signature compared to the LR image. It uses the spectral angle distance. The lower the value, the better the spectral consistency. The values are in degrees.
    - **`spatial:`** The spatial misalignment in terms of LR pixels (10m). The lower the value, the better the spatial consistency.
    - **`crs:`** The coordinate reference system of the images.
    - **`affine:`** The affine transformation of the images. It is a 2x3 matrix that maps pixel coordinates to the spatial coordinates.

| Band | Description | Resolution (m) | L2A Index | L1C index |
|------|-------------|----------------|-------| -------|
| B01  | Coastal aerosol | 60 | 0 | 0 |
| B02  | Blue | 10 | 1 | 1 |
| B03  | Green | 10 | 2 | 2 |
| B04  | Red | 10 | 3 | 3 |
| B05  | Vegetation red edge | 20 | 4 | 4 |
| B06  | Vegetation red edge | 20 | 5 | 5 |
| B07  | Vegetation red edge | 20 | 6 | 6 |
| B08  | NIR | 10 | 7 | 7 |
| B8A  | Narrow NIR | 20 | 8 | 8 |
| B09  | Water vapor | 60 | 9 | 9 |
| B10  | Cirrus | 60 | - | 10 |
| B11  | SWIR-I | 20 | 10 | 11 |
| B12  | SWIR-II | 20 | 11 | 12 |

### **NAIP (X4 scale factor)**

The National Agriculture Imagery Program (NAIP) dataset is a high-resolution aerial imagery dataset covering the continental United States. **It consists of 
62 NAIP images at 2.5m** were captured in the visible and near-infrared spectrum (RGBNIR) and all Sentinel-2 L1C and L2A bands. The dataset focuses on crop fields, 
forests, and bare soil areas.

```python
import opensr_test

naip = opensr_test.load("naip")
```

<p align="center">
  <a href="https://github.com/ESAOpenSR/opensr-test"><img src="images/NAIP.gif" alt="header" width="80%"></a>
</p>

### **SPOT (X4 scale factor)**

The SPOT imagery was obtained from the Worldstat dataset. The dataset consists of **9 SPOT images at 2.5m** captured in the visible and near-infrared 
spectrum (RGBNIR) and all Sentinel-2 L1C and L2A bands. It focuses on urban areas, crop fields, and bare soil areas.

```python
import opensr_test

spot = opensr_test.load("spot")
```

<p align="center">
  <a href="https://github.com/ESAOpenSR/opensr-test"><img src="images/SPOT.gif" alt="header" width="80%"></a>
</p>


### **Venµs (X2 scale factor)**

The Venµs images were obtained from the [**Sen2Venµs dataset**](https://zenodo.org/records/6514159). The dataset consists of 
**59 Venµs images at 5m** captured in the visible and near-infrared spectrum (RGBNIR) and all Sentinel-2 L1C and L2A bands. The 
dataset focuses on **crop fields, forests, urban areas, and bare soil areas**.

```python
import opensr_test

venus = opensr_test.load("venus")
```

<p align="center">
  <a href="https://github.com/ESAOpenSR/opensr-test"><img src="images/VENUS.gif" alt="header" width="80%"></a>
</p>

### **SPAIN CROPS (x4 scale factor)**

The SPAIN CROPS dataset consists of **28 aerial images at 2.5m** captured in the visible and near-infrared spectrum (RGBNIR) by 
the Spanish National Geographic Institute (IGN). The dataset includes all Sentinel-2 L1C and L2A bands. The dataset focuses 
on **crop fields and forests**.

```python
import opensr_test

spain_crops = opensr_test.load("spain_crops")
```

<p align="center">
  <a href="https://github.com/ESAOpenSR/opensr-test"><img src="images/SPAIN_CROPS.gif" alt="header" width="80%"></a>
</p>

### **SPAIN URBAN (x4 scale factor)**

The SPAIN URBAN dataset consists of **20 aerial imagery at 2.5m** captured in the visible and near-infrared spectrum (RGBNIR) 
by the Spanish National Geographic Institute (IGN). The dataset includes all Sentinel-2 L1C and L2A bands. The dataset focuses
on **urban areas and roads**.

```python
import opensr_test

spain_urban = opensr_test.load("spain_urban")
```

<p align="center">
  <a href="https://github.com/ESAOpenSR/opensr-test"><img src="images/SPAIN_URBAN.gif" alt="header" width="80%"></a>
</p>

## **Citation**

If you use `opensr-test` in your research, please cite our paper:

```
@article{aybar2024comprehensive,
  title={A Comprehensive Benchmark for Optical Remote Sensing Image Super-Resolution},
  author={Aybar, Cesar and Montero, David and Donike, Simon and Kalaitzis, Freddie and G{\'o}mez-Chova, Luis},
  journal={Authorea Preprints},
  year={2024},
  publisher={Authorea}
}
```

## **Acknowledgements**

This work was done with the support of the European Space Agency (ESA) under the project “Explainable AI: application to 
trustworthy super-resolution (OpenSR).” Cesar Aybar acknowledges support by the National Council of Science, Technology, 
and Technological Innovation (CONCYTEC, Peru) through the “PROYECTOS DE INVESTIGACIÓN BÁSICA – 2023-01” program with 
contract number PE501083135-2023-PROCIENCIA. Luis Gómez-Chova acknowledges support from the Spanish Ministry of Science 
and Innovation (project PID2019-109026RB-I00 funded by MCIN/AEI/10.13039/501100011033).