Satellite remote sensing systems capture Earth observation data across highly heterogeneous sensors (Synthetic Aperture Radar (SAR), Panchromatic (PAN), and Multispectral (MS) bands). Each sensor modality registers distinct physical and structural properties of the Earth's surface.
SABER is a scientifically rigorous cross-modal satellite image retrieval framework that maps disparate sensor modalities into a single, unified embedding space. By leveraging wavelength-conditioned foundation models, parameter-efficient adapters, and generative flow-matching latent bridges, SABER aligns multi-sensor imagery (Sentinel-1/2, Gaofen-1 PAN/MS) to enable sub-30 millisecond end-to-end semantic retrieval across modalities without joint-sensor retraining.
SABER is built upon four foundational mathematical and deep learning components:
graph TD
%% Define Styles
classDef query fill:#1f77b4,stroke:#333,stroke-width:2px,color:#fff;
classDef gallery fill:#2ca02c,stroke:#333,stroke-width:2px,color:#fff;
classDef process fill:#f7f7f7,stroke:#666,stroke-dasharray: 5 5,color:#000;
classDef loss fill:#d62728,stroke:#333,stroke-width:2px,color:#fff;
classDef index fill:#9467bd,stroke:#333,stroke-width:2px,color:#fff;
%% Nodes
subgraph Input ["Multi-Sensor Input Data"]
Q_Img["Query Image (e.g., S1 SAR or PAN)"]:::query
G_Img["Gallery Scene (e.g., S2 MS or MS)"]:::gallery
Q_Wav["Query Wavelengths (λ_q)"]
G_Wav["Gallery Wavelengths (λ_g)"]
end
subgraph Encoder ["Foundation Encoder Architecture (DOFA + LoRA)"]
Hyper_Q["Wavelength Hypernetwork"]:::process
Hyper_G["Wavelength Hypernetwork"]:::process
Proj_Q["Patch Projection Layer"]
Proj_G["Patch Projection Layer"]
ViT_Q["Frozen DOFA ViT blocks"]
ViT_G["Frozen DOFA ViT blocks"]
LoRA_Q["Trainable LoRA Adapters (r=16, α=32)"]:::process
LoRA_G["Trainable LoRA Adapters (r=16, α=32)"]:::process
ProjHead_Q["3-Layer Projection Head (MLP)"]
ProjHead_G["3-Layer Projection Head (MLP)"]
end
subgraph LatentSpace ["Latent Space Mapping"]
Z1["Source Latent Space (z1)"]:::query
Z2["Target Latent Space (z2)"]:::gallery
end
subgraph Alignment ["Stochastic Latent Bridge (Flow Matching)"]
CFM["Conditional Flow Matching (CFM) Bridge"]
Euler["10-Step Euler ODE Solver"]:::process
Z1_to_Z2["Mapped Embeddings (z1 -> z2)"]:::query
end
subgraph Retrieval ["FAISS Vector Search Backend"]
DB["Gallery Index Database (10,000+ scenes)"]:::index
FAISS["FAISS IndexFlatIP (Cosine Search)"]:::index
Results["Top-5 & Top-10 Ranked Results"]:::query
end
subgraph LossFunctions ["Training Phase Loss Library"]
L_Inv["Invariance Loss (L2 Distance)"]:::loss
L_Var["Variance Regularization (stdev >= 1)"]:::loss
L_Cov["Covariance Regularization (decorrelation)"]:::loss
L_Jac["Soft Jaccard Regression Loss"]:::loss
L_Rank["Listwise Neighborhood Ranking Loss"]:::loss
end
%% Query Path Flow
Q_Img --> Proj_Q
Q_Wav --> Hyper_Q
Hyper_Q --> Proj_Q
Proj_Q --> ViT_Q
LoRA_Q -.-> ViT_Q
ViT_Q --> ProjHead_Q
ProjHead_Q --> Z1
Z1 --> Euler
Euler --> CFM
CFM --> Z1_to_Z2
Z1_to_Z2 --> FAISS
%% Gallery Path Flow
G_Img --> Proj_G
G_Wav --> Hyper_G
Hyper_G --> Proj_G
Proj_G --> ViT_G
LoRA_G -.-> ViT_G
ViT_G --> ProjHead_G
ProjHead_G --> Z2
Z2 --> DB
DB --> FAISS
FAISS --> Results
%% Training Optimization Loss Flow
Z1 <--> |Contrastive Alignment| Z2
Z1 -.-> L_Inv
Z2 -.-> L_Inv
Z1 -.-> L_Jac
Z2 -.-> L_Jac
Rather than using static RGB backbones, SABER uses a domain-oriented foundation ViT-Base (DOFA) backbone. A wavelength hypernetwork dynamically generates patch projection weights based on the central wavelengths (
-
Sentinel-1 SAR:
$\lambda = [5.405,\mu\text{m}, 5.405,\mu\text{m}]$ (C-band) -
Sentinel-2 Multispectral:
$\lambda = [0.443,\mu\text{m}$ to$2.190,\mu\text{m}]$ (12 bands) -
Gaofen-1 PAN:
$\lambda = [0.675,\mu\text{m}]$ (Panchromatic) -
Gaofen-1 MS:
$\lambda = [0.485,\mu\text{m}$ to$0.830,\mu\text{m}]$ (4 bands)
This dynamic conditioning allows the model to inherently adapt to the spectral characteristics of the sensor.
To adapt the pre-trained foundation encoder to Earth observation tasks without overfitting or representation collapse, Low-Rank Adaptation (LoRA) adapters are applied to the attention (qkv) and MLP (fc1, fc2) layers of the Transformer blocks:
-
Rank (
$r$ ): 16, Alpha ($\alpha$ ): 32 -
Parameter Profile: ~98.18% of the ViT backbone parameters remain completely frozen (
111.3Mfrozen,2.06Mtrainable adapters). This ensures training stability, high representation capability, and a low memory footprint (VRAM$< 1,\text{GB}$ ).
To map the representations of a source modality
At inference, we integrate the vector field using a 10-step Euler ODE solver on the GPU to generate highly aligned target-like query descriptors.
The aligned space is optimized using a joint loss constraint:
- VICReg Regularization: Enforces Variance, Invariance, and Covariance constraints to prevent representation collapse.
- Soft Jaccard Regression: Regresses cosine similarity values directly against multi-label class Jaccard overlap targets.
- Listwise Neighborhood Ranking: Penalizes deviations in relative rankings of query-gallery pairs based on neighborhood similarity.
To ensure scientific accuracy and reproducibility, the mathematical definitions of the core objectives are defined below:
The probability path
where
To guarantee that the projection head embeddings do not suffer from informational collapse:
- Invariance Loss (L_inv): Enforces alignment between matched pairs.
-
Variance Regularization (L_var): Forces embedding dimensions to have a standard deviation above a threshold
$\gamma = 1$ .
-
Covariance Regularization (L_cov): Penalizes off-diagonal elements in the covariance matrix
$C(Z)$ to decorrelate embedding dimensions.
Designed specifically for multi-labeled datasets (BEN-14K), this regression objective aligns embedding cosine similarities with label-based Jaccard overlap indices:
Penalizes ranking inconsistencies within local neighborhoods by minimizing the Kullback-Leibler (KL) divergence between label-based distribution
Evaluated on BEN-14K using a strict 20% Query / 80% Gallery partition (100% non-synthetic data).
| Model / Paradigm | Publication / Baseline Type | S1 |
S2 |
S1 |
S2 |
Cross-Modal mAP@5 | Trainable Params |
|---|---|---|---|---|---|---|---|
| MAE | Standard Self-Supervised | ~46.2% | ~47.1% | ~63.8% | ~71.2% | ~58.3% | 100% |
| SatMAE | Satellite Masked Autoencoder | ~51.4% | ~52.3% | ~68.1% | ~75.4% | ~63.8% | 100% |
| MAE-RVSA | Rotated Variational Attention | ~54.8% | ~55.2% | ~70.2% | ~77.8% | ~66.1% | 100% |
| RemoteCLIP | IEEE TGRS 2024 (Contrastive) | 49.80% | 50.10% | — | — | 67.40% | 100% |
| X-JEPA | CVPR 2024 (Cross-Modal JEPA) | 61.23% | 63.73% | 72.98% | 82.65% | 71.95% | 100% |
| CR-JEPA | arXiv:2606.00706 | 75.82% | 75.40% | 75.11% | 82.87% | ~78.50% | 100% (Full ViT) |
| SABER (Ours) | Our Architecture | 72.42% – 73.51% | 73.10% | 75.40% | 75.97% – 76.38% | 91.37% – 91.49% | ~1.82% (LoRA) |
Measurements conducted on an NVIDIA GeForce RTX 2050 laptop GPU (budget baseline setup):
- Average Retrieval Latency (End-to-End per Query):
- BEN-14K (Sentinel-1/2): 28.48 ms (27.51 ms model forward + 0.97 ms FAISS search)
- DSRSID (Gaofen-1): 28.66 ms (27.73 ms model forward + 0.93 ms FAISS search)
- Query Throughput: 36.35 queries / second on a single budget GPU (escalates to >320 QPS on A100/H100 GPUs)
- FAISS Index Build Time: 1.20 seconds (10,000 gallery database items)
- Peak VRAM Usage: 918.70 MB (fully compatible with low-memory edge devices)
SABER contains significant optimizations to standard satellite data loaders:
-
730x Loading Speedup: Replaced inefficient channel-wise PIL loops with a high-throughput C++ OpenCV (
cv2.resize) pipeline in dsrsid.py. Average batch ingestion load times dropped from 292s/it to 0.98s/it. - Stratified Sampling: Implemented a randomized stratified index sampler to load balanced class batches across all 8 classes in DSRSID, preventing database sequential indexing bias.
-
Bidirectional Querying: Evaluators can run searches in both directions (e.g. MS
$\rightarrow$ SAR / MS$\rightarrow$ PAN) using the--direction s2_to_s1flag, exploiting the symmetric embedding geometry.
SABER/
├── Saber/ # Unified SABER Core Engine
│ ├── configs/ # Configuration files (config.yaml)
│ ├── datasets/ # BEN-14K and DSRSID loaders & augmentation pipelines
│ ├── models/ # DOFA ViT backbone, LoRA adapters, predictor & CFM bridge
│ ├── trainer/ # Training loops, loss functions & retrieval metrics
│ ├── retrieval/ # FAISS IndexFlatIP vector search index builders
│ ├── train.py # Base encoder training script (DOFA + LoRA)
│ ├── train_cfm_standalone.py # Standalone CFM bridge training pipeline
│ ├── export_embeddings.py # Pre-computed DB payload exporter (.pth)
│ ├── evaluate.py # Multi-split retrieval evaluation script
│ ├── evaluate_all_directions.py # All-direction (S1->S2, S2->S1, S1->S1, S2->S2) evaluator
│ ├── build_dsrsid_1000_db.py # DSRSID database index builder
│ ├── extract_and_search_real_dsrsid.py # DSRSID real feature extractor & searcher
│ ├── search_dsrsid_image.py # Image query search pipeline for DSRSID
│ ├── demo.py # Single-query visual retrieval demonstrator
│ ├── render_retrieval_grid.py # High-res retrieval result grid renderer
│ ├── server.py # Production FastAPI REST backend (<0.5ms search)
│ └── benchmark.py # Hardware latency & throughput profiler
├── newFrontend/ # Next.js 16 + React Bits + Shadcn UI Web App
├── scripts/ # Optimization & latency testing scripts
│ └── test_latency_optimizations.py # GPU FP16 / FP32 vs CPU NumPy matrix mult profiler
├── docs/ # Technical architecture reports & benchmarking guides
├── checkpoints/ # Model weight checkpoints (.pth)
└── visualizations/ # Retrieval grids, t-SNE & UMAP embeddings plots
Clone the repository and install all Python & Node.js dependencies:
git clone https://github.com/SK8-infi/SABER
cd SABER
python -m venv .venv
# On Windows PowerShell:
.venv\Scripts\activate
# On Linux/macOS:
# source .venv/bin/activate
pip install -r Saber/requirements.txtcd newFrontend
npm install
cd ..Train the wavelength-conditioned DOFA ViT encoder with LoRA adapters (
- Sentinel-1 / Sentinel-2 (BEN-14K):
python Saber/train.py --dataset_name ben14k --modality both --data_dir Datasets/benv1_14k --epochs 5 --synthetic false - Gaofen-1 PAN / MS (DSRSID):
python Saber/train.py --dataset_name dsrsid --data_dir Datasets/DSRSID/DSRSID-001.mat --epochs 5 --synthetic false
Train the generative CFM bridge ODE vector field:
- Standalone CFM Bridge Training:
python Saber/train_cfm_standalone.py --epochs 80 --lr 0.001
- Pipeline Feature Extraction + Bridge Training:
python Saber/extract_features.py --checkpoint checkpoints/latest_ben14k.pth --output_dir checkpoints/extracted python Saber/train_bridge.py --features_dir checkpoints/extracted --epochs 80
Export pre-computed 768-D normalized embeddings and serialized FAISS indices into lightweight, zero-GPU database payloads:
python Saber/export_embeddings.py \
--checkpoint checkpoints/latest_ben14k.pth \
--bridge checkpoints/bridge_best_ben14k.pth \
--output saber_search_db.pthEvaluate retrieval performance across specific split partitions (Seed 42 70/10/20 split):
# Evaluate on held-out test split (2,967 query vs 11,865 gallery)
python Saber/evaluate.py --db saber_search_db.pth --split test
# Evaluate on full dataset (All-vs-All 14,832 samples)
python Saber/evaluate.py --db saber_search_db.pth --split allRun full 4-direction evaluation matching CR-JEPA & X-JEPA benchmarks:
python Saber/evaluate_all_directions.py --db saber_search_db.pthpython Saber/evaluate.py --architecture saber --checkpoint checkpoints/latest_ben14k.pth --dataset_name ben14k --modality both --synthetic false --data_dir Datasets/benv1_14kpython Saber/build_dsrsid_1000_db.pypython Saber/extract_and_search_real_dsrsid.pypython Saber/search_dsrsid_image.py --query_idx 10python Saber/demo.py --dataset_name ben14k --checkpoint checkpoints/latest_ben14k.pth --query_index 4 --synthetic false --data_dir Datasets/benv1_14kpython Saber/render_retrieval_grid.pypython Saber/benchmark.pypython scripts/test_latency_optimizations.pyStart the production zero-GPU search API (<0.5ms query time):
python -m uvicorn Saber.server:app --host 0.0.0.0 --port 8000In a second terminal window:
cd newFrontend
npm run devOpen your browser and navigate to:
http://localhost:3000
- Query Inspector:
http://localhost:3000/dashboard/format/query - DSRSID Search:
http://localhost:3000/dashboard/format/dsrsid-search - Cloud-Free Optical Synthesis:
http://localhost:3000/dashboard/format/cloud-free - Latent Space Explorer:
http://localhost:3000/dashboard/format/embeddings