File size: 12,757 Bytes
e24820e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3ea3998
 
 
642e8c0
6314cc4
 
bba65f0
 
 
 
 
3ea3998
 
 
 
bba65f0
3ea3998
55d0087
 
b9bc7cc
 
 
3ea3998
 
 
 
 
 
 
 
 
 
 
d25f111
3ea3998
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
709c6bb
6fe3973
b46df21
 
 
3ea3998
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55d0087
3ea3998
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55d0087
3ea3998
55d0087
3ea3998
 
 
 
 
 
 
55d0087
 
 
 
 
 
 
3ea3998
 
 
55d0087
 
 
 
3ea3998
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
---
license: apache-2.0
task_categories:
- image-classification
- zero-shot-image-classification
- object-detection
language:
- en
- fr
tags:
- SAR
- Cryosphere
- Time series
- Domain Adaptation
size_categories:
- 10K<n<100K
---
# CPAZMAL DATASET

Machine learning-ready cryospheric SAR dataset combining ascending et descending PAZ acquisitions over Mont-Blanc massif glaciers (2020–2023). The dataset contains dual-polarization (HH+HV but not for the all time serie cf Acquisition Timeline) time-series recorded with timestamps and organized by geographic groups to support GroupKFold evaluation. It consists of 8 main classes, with an average of 8 groups per class. An additional class, STUDY, can be used for evaluation and segmentation tasks (ground truth to come) with 2–4 glacier surface subclasses. Each of the 70 groups corresponds to an irregular polygon of variable size. Preprocessing on the original data included radiometric calibration, incidence angle and NEBN noise corrections, geometric transformation via IGN LiDAR HD (1m). A dataloader is provided, allowing selection of temporal windows with options for orbit type, percentage/type of geometric distortions, and extraction of all windows of the requested size from all 70 groups.

**Example**: Request a time-series window of size 16×16 with up to 10% layover in ascending orbit images between January 2020 and December 2020 → produces a dataset of size (3508, 16, 16, 21, 2) with 51 unique groups et 21 timestamps and the following classes repartition:
|             | 0   | 1   | 2   | 3   | 4   | 5   | 6   | 7    |
| ----------- | --- | --- | --- | --- | --- | --- | --- | ---- |
| Samples     | 788 | 394 | 292 | 3   | 711 | 9   | 4   | 1307 |
| Description | ACC | PLA | ROC | HAG | ABL | ICA | LAC | FOR  |


## 1. Structure

```
CPAZMaL/
├── DATASET/
│   ├── CPAZMaL.hdf5          # Optimized HDF5 dataset for ML
│   └── CPAZMaL.txt   # Dataset summary
└── script/
    ├── load_dataset.py              # MLDatasetLoader class
    └── scenarios.py                 # 4 pre-configured ML scenarios
```
## 2. Source Code

The complete data processing pipeline is available on GitHub at the following address: [https://github.com/Matthieu-Gallet/CPAZMaL_dataset](https://github.com/Matthieu-Gallet/CPAZMaL_dataset).

This repository also includes example scenario templates for loading HDF5 data files.

## 3. Dataset Description

### Study Areas

The dataset covers 70 labeled areas across 9 land surface classes in the Mont-Blanc massif. The complete detail of each groups is given in the `table_groups.pdf`file. A summary is provided with the following table:

| Class | N  | Altitude (m)     | Slope (°)        | Aspect (°)       | Lat    | Lon   |
|-------|----|------------------|------------------|------------------|--------|-------|
| ABL   | 7  | 2577 ± 206       | 17.1 ± 5.2       | 268 ± 47         | 45.926 | 6.962 |
| ACC   | 9  | 3077 ± 402       | 26.1 ± 10.2      | 220 ± 71         | 45.916 | 6.968 |
| FOR   | 9  | 1436 ± 194       | 24.4 ± 9.3       | 283 ± 56         | 45.971 | 6.907 |
| HAG   | 7  | 3203 ± 184       | 47.2 ± 8.5       | 232 ± 119        | 45.891 | 6.928 |
| ICA   | 9  | 3353 ± 295       | 43.5 ± 12.0      | 270 ± 90         | 45.920 | 6.966 |
| LAC   | 9  | 1865 ± 616       | 8.5 ± 6.2        | 179 ± 46         | 45.965 | 6.886 |
| PLA   | 9  | 1834 ± 296       | 18.9 ± 7.5       | 223 ± 74         | 45.982 | 6.908 |
| ROC   | 9  | 2333 ± 206       | 26.6 ± 5.5       | 236 ± 74         | 45.947 | 6.908 |
| STUDY | 2  | 2739 ± 54        | 21.3 ± 14.2      | 272 ± 21         | 45.922 | 6.960 |

**Classes:** ABL (Ablation zone), ACC (Accumulation zone), FOR (Forefield), HAG (Hummocky ablation glacier), ICA (Ice/snow avalanche cone), LAC (Lake), PLA (Plateau glacier), ROC (Rockfall), STUDY (Study area)

### Acquisition Timeline

<p align="left">
  <img src="https://cdn-uploads.huggingface.co/production/uploads/68ee4ed89a6f942b016af50f/lHqcrTZ7P3DvjVqQhGeAF.png" 
       alt="Enhanced Acquisition Timeline" 
       width="50%">
</p>

### Data Characteristics

- **Polarization:** Dual-pol (HH + HV)
- **Temporal coverage:** 2008-2020
- **Resolution:** ~3m (ground range)
- **Orbit:** Ascending (ASC) and Descending (DSC)
- **Total acquisitions:** 216 SAR images across 54 groups
- **Format:** HDF5 with optimized chunking for ML

### HDF5 Structure

```
PAZTSX_CRYO_ML.hdf5
├── data/
│   ├── {group_name}/          # e.g., ABL001, ACC002
│   │   ├── ASC/               # Ascending orbit
│   │   │   ├── HH/
│   │   │   │   ├── images     # (H, W, T) - Time series
│   │   │   │   ├── masks      # (H, W, T) - Quality masks
│   │   │   │   ├── timestamps # (T,) - Acquisition dates
│   │   │   │   └── angles_incidence
│   │   │   └── HV/
│   │   └── DSC/               # Descending orbit
│   │       ├── HH/
│   │       └── HV/
├── metadata/
│   ├── classes                # JSON array
│   └── nodata_value
└── index/
    ├── by_class/              # Fast class-based filtering
    └── temporal_ranges/       # Date range index
```

## 4. Usage

### Quick Start

```python
from load_dataset import MLDatasetLoader

# Initialize loader
loader = MLDatasetLoader('DATASET/CPAZMaL.hdf5')

# Load single group data
data = loader.load_data(
    group_name='ABL001',
    orbit='ASC',
    polarisation=['HH', 'HV'],  # Dual-pol
    start_date='20200101',
    end_date='20201231',
    scale_type='amplitude'       # 'intensity', 'amplitude', 'log10'
)

# Extract windows for ML
windows, masks, positions = loader.extract_windows(
    image=data['images'],
    mask=data['masks'],
    window_size=32,
    stride=32,                   # Non-overlapping
    max_mask_value=1,            # Mask quality threshold
    max_mask_percentage=10.0,    # Max % of bad pixels
    min_valid_percentage=50.0,   # Min % of valid pixels
    skip_optim_offset=True       # Deterministic extraction
)
```

### Pre-configured Scenarios

Four ready-to-use ML scenarios are provided in `scenarios.py`:

#### Scenario 1: Temporal Stacking Classification

Multi-date classification with dual-pol temporal stacking. Suitable for random forest, SVM, or CNN-based classifiers.

```python
from scenarios import scenario_1_temporal_stacking_classification

data = scenario_1_temporal_stacking_classification(
    loader=loader,
    window_size=32,              # Patch size
    max_mask_value=1,            # Quality filter
    min_valid_percentage=50.0,   # Data validity threshold
    max_mask_percentage=10.0,
    orbit='ASC',
    start_date='20200101',
    end_date='20201231',
    scale_type='amplitude',      # Transformation: 'intensity', 'amplitude', 'log10'
    skip_optim_offset=True       # Deterministic offset
)

# Returns:
# - X: (N,) array of (window_size, window_size, T, 2) - Variable T between windows
# - y: (N,) class labels (encoded as int)
# - groups: (N,) group identifiers
# - masks, satellites, positions, class_names, group_names
```

**Parameters:**
- `window_size`: Spatial window dimension (default: 32)
- `scale_type`: Data transformation
  - `'intensity'`: Raw backscatter values
  - `'amplitude'`: Square root transformation (√intensity)
  - `'log10'`: Logarithmic scale (dB)
- `min_valid_percentage`: Minimum valid pixel ratio (0-100%)
- `max_mask_value`: Maximum accepted mask value (0-3)
- `skip_optim_offset`: If True, use fixed (0,0) offset for deterministic results

#### Scenario 2: Temporal Prediction (LSTM)

Time series prediction with train/test temporal split. Designed for LSTM, GRU, or Transformer models.

```python
from scenarios import scenario_2_temporal_prediction_lstm

data = scenario_2_temporal_prediction_lstm(
    loader=loader,
    window_size=32,
    orbit='DSC',
    polarization='HH',           # Single-pol
    train_start='20200101',
    train_end='20201031',
    predict_start='20201101',
    predict_end='20201231',
    scale_type='amplitude'
)

# Returns:
# - X_train: (N) array of (window_size, window_size, T_train)
# - X_predict: (N) array of (window_size, window_size, T_predict)
# - timestamps_train, timestamps_predict
```

#### Scenario 3: Cross-Polarization Domain Adaptation

Same-date HH → HV domain adaptation. Tests polarization invariance.

```python
from scenarios import scenario_3_domain_adaptation_pol

data = scenario_3_domain_adaptation_pol(
    loader=loader,
    window_size=32,
    target_date='20200804',      # Single acquisition date
    orbit='DSC'
)

# Returns:
# - X_source: (N, window_size, window_size) - HH polarization
# - X_target: (N, window_size, window_size) - HV polarization
# - y: (N,) labels
```

#### Scenario 4: Cross-Geometry Domain Adaptation

PAZ different acquisition geometries domain adaptation. Tests geometry invariance between different orbits and dates.

```python
from scenarios import scenario_4_domain_adaptation_satellite

data = scenario_4_domain_adaptation_satellite(
    loader=loader,
    window_size=32,
    source_orbit='DSC',           # Source orbit
    target_orbit='ASC',           # Target orbit
    source_date='20210127',       # Source acquisition date
    target_date='20210214',       # Target acquisition date
    source_polarization='HH',     # Source polarization
    target_polarization='HH',     # Target polarization
    scale_type='amplitude'
)

# Returns:
# - X_source: (N_source, window_size, window_size, n_pol) - Source geometry
# - X_target: (N_target, window_size, window_size, n_pol) - Target geometry
# - y_source: (N_source,) labels for source (labeled)
# - y_target: (N_target,) labels for target (for analysis only)
# - groups_source, groups_target
```

### Key Features

**Deterministic Extraction:**
- `skip_optim_offset=True` allows to speed up window extraction by skipping offset optimization.
- `skip_optim_offset=False` performs offset optimization to maximize the number of valid windows, useful for small datasets.


**Scale Transformations:**
- Three options for data representation:
  - `'intensity'`: Raw backscatter
  - `'amplitude'`: Square root (√intensity)
  - `'log10'`: Logarithmic scale (dB)

**Quality Filtering:**
Information of distorted pixels is provided via quality masks (Obtained from ESA processing). 0: No distortion, 1: Layover, 2: Shadow, 3: Both
- `max_mask_value`: Rejects pixels with mask > threshold (0-3 scale)
- `max_mask_percentage`: Maximum bad pixel ratio per window with mask<=`max_mask_value`
- `min_valid_percentage`: Minimum valid data ratio per window (non-nodata and non-NaN). To avoid No Data and NaN use 100%.

### Data Loader Parameters

| Parameter              | Type         | Default    | Description                                    |
|------------------------|--------------|------------|------------------------------------------------|
| `group_name`           | str          | required   | Target area identifier (e.g., 'ABL001')        |
| `orbit`                | str          | 'DSC'      | Orbit direction: 'ASC' or 'DSC'                |
| `polarisation`         | str or list  | 'HH'       | Single ('HH'/'HV') or dual (['HH','HV'])       |
| `start_date`           | str          | None       | Start date 'YYYYMMDD'                          |
| `end_date`             | str          | None       | End date 'YYYYMMDD'                            |
| `scale_type`           | str          | 'intensity'| Transformation: 'intensity', 'amplitude', 'log10'|
| `normalize`            | bool         | False      | Apply pre-computed normalization               |
| `remove_nodata`        | bool         | True       | Replace nodata with NaN                        |
| `window_size`          | int          | 32         | Spatial window size (square)                   |
| `stride`               | int          | None       | Stride for sliding window (None = window_size) |
| `max_mask_value`       | int          | 3          | Maximum mask quality value                     |
| `max_mask_percentage`  | float        | 100.0      | Max % of pixels with mask > max_mask_value     |
| `min_valid_percentage` | float        | 50.0       | Min % of valid (non-NaN) pixels                |
| `skip_optim_offset`    | bool         | False      | Skip offset optimization for determinism       |

## 5. Citation

If you use this dataset, please cite:

```
```

## 6. License

apache 2-0

## 7. Contact

[contact information]

## 8. Acknowledgements

The authors would like to thank the *Spanish Instituto Nacional de Técnica Aeroespacial* (INTA) for providing the PAZ images (Project AO-001-051).