TerraCodec (TEC) is a family of pretrained neural compression codecs for multispectral Sentinel-2 satellite imagery. The models compress optical Earth observation data using learned latent representations and entropy coding.
This repository provides Temporal Transformer (TEC-TT) models trained on Sentinel-2 L1C imagery. The main TerraCodec models are released for Sentinel-2 L2A data, the L1C variants were used for declouding experiments in the paper.
Reconstructions
Model Architecture
This repository contains the TEC-TT (Temporal Transformer) variants of TerraCodec for S2L1C data.
assets/TEC_TT_architecture.png
TEC-TT extends the TerraCodec image codecs by modeling temporal dependencies across satellite image sequences. Each frame is first encoded using an ELIC-style CNN encoder–decoder to obtain latent representations. A temporal transformer then predicts the probability distribution of the current frame’s latents conditioned on previously encoded frames.
By exploiting redundancy across seasonal observations, TEC-TT achieves improved compression efficiency for multi-temporal satellite imagery.
See the paper for additional architectural and training details.
Input Format
Codec type
Expected shape
Example
Temporal codecs
[B, T, C, H, W]
[1, 4, 13, 256, 256]
Inputs use 13 Sentinel-2 L1C spectral bands
Recommended spatial size: 256 × 256
Models were trained on four seasonal frames, but can process any number of timesteps during inference (higher T increases compute)
Normalization
Models were trained on Sentinel-2 L1C imagery.
Inputs should be standardized per spectral band using dataset statistics: