TL;DR
Earth observation (EO) satellites generate vast amounts of multispectral time-series data, yet open-source, large-scale neural codecs tailored to this domain are virtually nonexistent. TerraCodec (TEC) introduces a family of learned codecs pretrained on Sentinel-2 data, featuring a Temporal Transformer (TEC-TT) that exploits seasonal time redundancy and a novel "Latent Repacking" technique (FlexTEC) for single-checkpoint, variable-rate compression. The models achieve $3\times$ to $10\times$ stronger compression than classical codecs at matched quality and double as state-of-the-art zero-shot cloud inpainters.
What Problem Does This Paper Address?
Satellites like Sentinel-2 collect enormous streams of 12-band, 16-bit imagery across repetitive orbits. Current operational pipelines still default to classical standards like JPEG2000 or CCSDS, which compress bands independently as grayscale images and ignore temporal correlations entirely.
While learned neural compression has made major strides in computer vision, its application to EO remains fragmented:
- Prior EO compression work mostly investigates small-scale RGB or single-frame settings.
- Pretrained neural codecs native to 12-band, 16-bit satellite imagery are not publicly available.
- Neural codecs typically require training a separate network checkpoint for every single rate–distortion trade-off point (fixed-rate bottleneck).
Methods
TerraCodec tackles these challenges through domain-specific architecture choices:
- Multispectral Intra-Frame Codecs:
- TEC-FP: A fast baseline using a Factorized Prior entropy model.
- TEC-ELIC: A high-performance image codec utilizing spatial-channel context (SCCTX) adapted from ELIC to model dependencies across spectral bands.
- Temporal Transformer (TEC-TT): Adapts the Video Compression Transformer (VCT) paradigm. Instead of hand-crafted motion estimation/compensation (which fails on satellite imagery dominated by seasonal variations rather than optical flow), TEC-TT processes latents in spatial blocks and employs an autoregressive transformer conditioned on context from the preceding two frames.
- Latent Repacking & FlexTEC (Variable-Rate Compression): Standard token dropping in transformers removes entire spatial patches, creating severe visual holes. Latent Repacking reorganizes latent tokens across the channel dimension: each token spans the entire spatial scene but holds only a narrow channel slice ($k = d_\text{lat}/T$). By pairing this with dynamic rate scaling and token masking during training, the network orders information from coarse structure (early tokens) to fine details (later tokens). At inference, users simply transmit $K \in \{1, \dots, 16\}$ tokens using a single model checkpoint, filling dropped tokens with transformer-predicted priors.
Datasets
- SSL4EO-S12 v1.1: A large-scale global corpus of Sentinel-2 L2A (and L1C) data containing 244,000 locations across 4 seasonal timestamps. Used for pretraining and rate–distortion evaluation.
- AllClear: A benchmark dataset consisting of multi-temporal cloudy Sentinel-2 observations and cloud-free targets, used to evaluate zero-shot cloud removal/inpainting.
- Sen1Floods11 & reBEN-7k: Downstream geospatial benchmarks for flood water segmentation (binary mask) and land cover classification (19 semantic classes), respectively.
(No completely new benchmark datasets were introduced, but the paper adapts existing datasets into standardized compression and downstream-utility benchmarks).
Key Insights and Ideas
- Temporal Priors Outperform Motion Vectors in EO: Satellite time series change through seasonal vegetation cycles, sun angle shifts, and clouds rather than translational movement. Latent-space temporal attention naturally models these cycles without explicit motion compensation.
- Learned Priors Enable Zero-Shot Downstream Tasks: In neural compression, the entropy model predicts the mean $\mu$ and scale $\sigma$ of the current latents based on past frames. Because the model learns to filter out transient noise, decoding the predicted prior mean $\mu$ acts as a clean, clear-sky temporal forecast—effectively solving cloud removal without any fine-tuning.
- Channel Slicing Beats Spatial Dropping: Slicing latents across feature channels rather than spatial tiles creates tokens that represent global scene context. This allows graceful rate degradation when truncating bitstreams.
Key Results
- Rate–Distortion Performance: TerraCodec achieves $3\times$ to $10\times$ bitrate reductions over classical codecs (JPEG, JPEG2000, WebP, HEVC/x265) at equivalent PSNR and SSIM. On P-frames with 2-frame context, TEC-TT yields a 22.6% rate reduction over its context-free variant at equal PSNR.
- Variable-Rate FlexTEC: A single FlexTEC checkpoint operating across 16 discrete token budgets matches or exceeds the fixed-rate TEC-FP baseline while avoiding the need to store 16 separate models.
- Downstream Task Resilience: Training geospatial foundation models (Prithvi 2.0 and TerraMind) on data compressed by up to $380\times$ resulted in less than a 1.0 percentage point drop in accuracy, F1 score, and mIoU.
- State-of-the-Art Zero-Shot Cloud Removal: On the AllClear benchmark, TEC-TT achieved a test PSNR of 32.86 dB and SSIM of 0.917, outperforming specialized zero-shot baselines like UnCRtainTS (29.01 dB / 0.898) and heuristic mosaicing (29.82 dB / 0.755). On the hardest 10% subset (average 99% cloud cover), TEC-TT maintained a competitive 25.97 dB.
Limitations and Future Work
- Sensor-Specific: Models are currently trained exclusively on Sentinel-2 imagery; application to other sensors (e.g., Landsat, commercial high-resolution, or SAR) requires retraining or fine-tuning.
- Short Context Windows: Evaluated on sequences of 4 frames with a 2-frame context due to compute constraints. Longer sequences would yield higher temporal amortization but require higher compute.
- Inference Optimizations: Techniques like Key-Value (KV) caching for the temporal transformer are not yet integrated into the reference implementation.
- High-Compression Gap in FlexTEC: While FlexTEC performs competitively across most bitrates, fixed-rate models still hold an advantage at extreme compression ratios. Combining Latent Repacking with other variable-rate methods remains an open direction.
Summary updated