SEN2NEON / README.md
simon-donike's picture
Update README.md
72d6e2d verified
|
Raw
History Blame Contribute Delete
7.01 kB
---
pretty_name: SEN2NEON (Validation)
license: cc-by-4.0
tags:
- remote-sensing
- geospatial
- sentinel-2
- super-resolution
- multispectral
- earth-observation
task_categories:
- image-to-image
task_ids:
- super-resolution
annotations_creators:
- no-annotation
language_creators:
- other
language: []
multilinguality:
- other
size_categories:
- 1K<n<10K
dataset_info:
features:
- name: id
dtype: string
- name: lr
dtype: image
- name: hr
dtype: image
- name: split
dtype: string
- name: name
dtype: string
- name: lon
dtype: float64
- name: lat
dtype: float64
- name: LC_detail_id
dtype: int64
- name: LC_detail_text
dtype: string
- name: LC_superclass_id
dtype: int64
- name: LC_superclass_text
dtype: string
---
# SEN2NEON (Validation Subset)
LR/HR Multispectral Super‑Resolution Dataset for benchmarking and research.
![Example](https://raw.githubusercontent.com/simon-donike/file_hosting/refs/heads/main/sen2neon_example.png)
---
## Dataset Summary
SEN2NEON provides paired **low‑resolution (LR, 10 m)** and **high‑resolution (HR, 2.5 m)** GeoTIFF tiles for validating super‑resolution (SR) models in remote sensing. Each pair shares the same spatial footprint; HR is an integer 4× upsample of LR and is pixel‑aligned. A companion `metadata.jsonl`/CSV file supplies per‑tile metadata and land‑cover labels to enable **stratified evaluation** (e.g., Forest vs Built‑up).
The code, examples and validation workflowws can be found at [ESAOpenSR/SEN2NEON](https://github.com/ESAOpenSR/SEN2NEON).
- **Modality:** Multispectral GeoTIFFs (band count may vary by source preprocessing)
- **Tasks:** Super‑resolution (image‑to‑image), benchmarking & analysis
- **Scale:** ~30 GB total (varies by release)
- **Alignment:** HR is 4× LR; integer, isotropic scale; pixel‑aligned
- **Geo:** UTM/ETRS zones per tile (see `crs` in CSV); `lon/lat` provided for centroids
---
## Repository Layout
```
.
├── metadata.jsonl # line‑delimited JSON index (recommended entry point)
├── sen2neon_metadata.csv # CSV index (same content as JSONL, tabular form)
├── neon_10m_linearized/ # LR tiles (GeoTIFF)
└── neon_2.5m_linearized/ # HR tiles (GeoTIFF)
```
Relative paths in the JSON/CSV (e.g., `neon_10m_linearized/…`) match the on‑hub layout.
---
## Record Schema (metadata.jsonl)
Each line is one sample:
```json
{
"id": "<stem>",
"lr": "neon_10m_linearized/<file>.tif",
"hr": "neon_2.5m_linearized/<file>.tif",
"split": "val",
"name": "<filename.tif>",
"lon": <float or null>,
"lat": <float or null>,
"LC_detail_id": <int or null>,
"LC_detail_text": "<str or null>",
"LC_superclass_id": <int or null>,
"LC_superclass_text": "<str or null>"
}
```
Notes:
- `split` is set to `"val"` for this release.
- `lon/lat` are WGS84 centroids; may be null for tiles outside coverage.
- LC fields come from the categorical land‑cover raster used in preprocessing (see below).
---
## Quick Download
Using the Hub snapshot cache (resumable, selective patterns):
```bash
pip install -U huggingface_hub
python - <<'PY'
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="simon-donike/SEN2NEON",
repo_type="dataset",
local_dir="./data/sen2neon",
allow_patterns=[
"metadata.jsonl",
"sen2neon_metadata.csv",
"neon_10m_linearized/**",
"neon_2.5m_linearized/**"
],
)
PY
```
(For high‑throughput, you can `pip install hf_transfer` and set `HF_HUB_ENABLE_HF_TRANSFER=1`.)
---
## Load with 🤗 Datasets (Streaming, no full download)
```python
from datasets import load_dataset, Image
# Stream JSONL, keep paths relative to the Hub
ds = load_dataset(
"json",
data_files="hf://datasets/simon-donike/SEN2NEON/metadata.jsonl",
split="train", # streaming uses a single split; filter by 'split' field if needed
streaming=True
)
# Cast path fields to Image feature to lazily fetch TIFFs
ds = ds.cast_column("lr", Image())
ds = ds.cast_column("hr", Image())
row = next(iter(ds))
lr_img = row["lr"] # dict with 'path' and PIL image accessor
hr_img = row["hr"]
print(row["id"], row.get("LC_superclass_text"))
```
---
## Load with PyTorch (Local Files)
After downloading (e.g., into `./data/sen2neon/`), you can use the provided CSV‑driven loader:
```python
from data.sen2neon_ds import SEN2NEON
from torch.utils.data import DataLoader
root = "./data/sen2neon"
csv = f"{root}/sen2neon_metadata.csv"
ds = SEN2NEON(csv_path=csv, root_dir=root, crop_size_lr=None)
loader = DataLoader(ds, batch_size=2, shuffle=True, num_workers=4, pin_memory=True)
batch = next(iter(loader))
lr, hr, meta = batch["lr"], batch["hr"], batch["meta"]
print(lr.shape, hr.shape, meta["LC_superclass_text"][:2])
```
---
## Land‑cover Integration
Each sample is joined with **land‑cover** information derived from an external categorical land‑cover raster covering the study area. The LR tile footprint is reprojected to the LC CRS; the **mode** value within that window is taken as the label.
- `LC_detail_id` / `LC_detail_text`: fine‑grained class (e.g., 41 → “Deciduous”).
- `LC_superclass_id` / `LC_superclass_text`: coarser **super‑group** (e.g., 40 → “Forest”, 50 → “Built‑up”).
- These fields enable **stratified metrics** (e.g., PSNR/SSIM/SAM) by environment type.
- Missing values may occur (outside coverage / NoData).
---
## Geospatial & Data Notes
- **CRS:** Tiles are stored in per‑scene/projected UTM/ETRS zones; see `crs` in the CSV (when available). Centroids are additionally provided as WGS84 (`lon/lat`).
- **Alignment:** HR is an exact 4× integer scaling of LR with pixel‑grid alignment.
- **Nodata:** TIFF `nodata` values are respected; downstream loaders may map them to NaN.
- **Bands:** Band count may vary across scenes; code examples select RGB if available (else fallbacks).
---
## Intended Uses
- Benchmarking SR models (classical, CNN, diffusion, GANs).
- Stratified evaluation by land‑cover class (robust performance reporting).
- Qualitative visualization and error analysis.
## Limitations
- Land‑cover labels are window‑mode summaries, not per‑pixel annotations.
- Some tiles may lack LC labels or have ambiguous boundaries near class transitions.
- Sensor mix / preprocessing differences can affect cross‑domain generalization.
---
## License
Please refer to the dataset repository license on the Hub page. If you fork/modify, include the original attribution. (Contact the maintainers for commercial/redistribution questions.)
---
## Citation
If you use SEN2NEON in your research, please cite the dataset and the accompanying tools. A publication is in the works.
---
## Contact
- Maintainer: Image Processing Laboratory, University of Valencia, Spain
- Issues & questions: open a discussion on the linked GitHub repository.