Skip to content

[meta]: Data Quality, Sampling & Augmentation #6

Description

@Dinghye

Motivation

Label band analysis (LABEL_BAND_ANALYSIS.md) revealed several data-level issues that directly impact training quality — nodata contamination, extreme class imbalance, nDSM distribution skew, and non-standard patch shapes. The current baseline addresses none of these and uses no augmentation beyond random cropping. Since ~45% of the competition score depends on height RMSE and ~50% depends on Building, fixing data-level problems is likely the highest-ROI path before any architectural changes.

This meta-issue tracks all data-related improvements, from critical fixes to experimental augmentation.

Prior Analysis

  • LABEL_BAND_ANALYSIS.md — full dataset statistics, class distribution, nodata characterization, nDSM verification
  • BASELINE_REPORT.md — baseline results without any data fixes (AlphaEarth best: composite 0.741)

Work Plan

1. Nodata Masking in Loss (Critical)

Problem: 82.7% of samples contain nodata regions (all 4 bands = 0); 32.7% are more than half nodata. The baseline treats these as valid ground truth (predicting zero), injecting ~39% incorrect gradients.

  • Implement global validity mask: valid = NOT (band0==0 AND band1==0 AND band2==0 AND band3==0) — exclude from all loss terms
  • Implement nDSM-specific mask: additionally exclude pixels where nDSM==0 AND (building>0 OR vegetation>0 OR water>0) — 22.6% of samples have nDSM holes with valid land cover
  • Propagate masks through all loss components (MAE, SSIM, Gradient, Tversky)
  • Benchmark: expect direct RMSE improvement since ~39% of pixels currently contribute wrong signal

2. Non-standard Patch Shapes

Problem: 258 samples (12.7%) are 255×256 or 256×255 instead of 256×256.

  • Verify current reflect-padding handles these correctly
  • Ensure padded pixels are included in the nodata mask (not treated as valid ground truth)

3. nDSM Normalization & Outlier Handling

Problem: nDSM is heavily right-skewed (median 0.095 m vs. mean 3.87 m, max 209.9 m). Current baseline simply divides by 30.

  • Clip extreme outliers — cap at ~45 m (P99.95) before normalization to prevent rare tall structures from distorting training
  • Experiment with log(1+x) transform — may produce a more uniform distribution and improve gradient flow for the majority of near-ground pixels
  • Compare /30 vs. log(1+x)/log(31) vs. clipped /30 on validation RMSE

4. Class Imbalance Mitigation

Problem: Building occupies 3.3% of pixels (82.6% of samples are >95% zero), Water 1.7% (93.3% >95% zero).

  • Weighted sampling — oversample patches containing Building/Water during training (e.g., WeightedRandomSampler with inverse class-frequency weights)
  • Loss reweighting — evaluate increasing loss weight for Building and Water channels beyond current Tversky α=0.3, β=0.7
  • Focal loss variant — for sparse classes, down-weight easy negatives to focus on hard positives
  • Verify train/val split has enough Building/Water samples for stable metric estimation

5. Geometric Augmentation

Problem: No augmentation beyond random crop. With only 2,024 samples, the model sees limited spatial variation.

  • Implement unified spatial augmentation applying identical random transforms to embedding + label:
    • Random horizontal flip (p=0.5)
    • Random vertical flip (p=0.5)
    • Random 90° rotation (k ∈ {0,1,2,3})
  • Must work for both PixelEmbeddingDataset (1:1) and LatentTokenDataset (16× multi-scale)
  • Benchmark geometric aug vs. no-aug on AlphaEarth

6. Advanced Augmentation Experiments

These are experimental and should only be attempted after items 1–5 are resolved:

  • CutMix — paste rectangular region from one sample's embedding+label onto another
  • Copy-paste (class-aware) — extract Building/Water regions and paste onto background-dominated samples
  • Mosaic — stitch 4 patches into 2×2 grid, crop to training size
  • Gaussian noise on embeddings — test σ ∈ {0.01, 0.05, 0.1} relative to per-channel std
  • Test-time augmentation (TTA) — predict on flipped/rotated variants and average; zero training cost

7. Ablation & Final Recipe

  • Controlled ablation: add each improvement incrementally, measure individual contribution
  • Select best recipe by validation composite score
  • Verify recipe generalizes across embedding types (AlphaEarth, TerraMind S2, etc.)
  • Document final data pipeline config and cumulative performance delta

Priority Order

Priority Task Expected Impact Rationale
P0 Nodata masking High 39% of pixels contribute wrong gradients; affects all metrics
P0 Non-standard shapes Low effort Quick fix, prevents edge-case corruption
P1 Class imbalance (sampling + loss) Medium–High Building = 50% of score but 3.3% of pixels
P1 nDSM normalization Medium Skewed distribution hurts height regression (45% of score)
P2 Geometric augmentation Medium Simple, low-risk, expands effective dataset 8×
P3 Advanced augmentation Unknown Experimental; depends on results from P0–P2

Success Criteria

  • Composite validation score ≥ 0.76 (Δ ≥ +0.02 over baseline 0.741)
  • No regression on any individual metric
  • Training time overhead < 20%

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions