--- 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 Enhanced Acquisition Timeline

### 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).