Spaces:
Sleeping
title: SatFetch
emoji: π°οΈ
colorFrom: indigo
colorTo: purple
sdk: docker
app_file: app.py
pinned: false
SatFetch resolves the spectral domain gap in Earth observation datasets, enabling unified semantic text-to-image and cross-modal image-to-image queries across Optical, SAR (radar), and Multispectral satellite sensors β with hybrid spatial filtering via Uber H3 hexagonal indexing.
Developed by Team 4MISTAKES (RGIPT) for the ISRO Bharatiya Antariksh Hackathon 2026.
Pipeline
Input imagery from any sensor modality is preprocessed per-channel, encoded via pre-trained vision models (DOFA-CLIP / SARCLIP), fused with spatial encoding, and indexed into FAISS HNSW. A query image or text passes through the same encoding pipeline, then retrieves top-K ranked results by cosine similarity with optional H3 geographic filtering.
Architecture
Data Layer
| Input | Format | Channels |
|---|---|---|
| Optical (RGB) | .png / .jpg |
3 (R, G, B) |
| SAR (Radar) | .tif (single-channel) |
1 (VV/VH) |
| Multispectral | .tif (multi-band) |
4β13 (Sentinel-2) |
| Text | Natural language | β |
Feature Processing
- Per-modality preprocessing: Normalize, resize 224Γ224, channel mapping
- Pre-trained encoders: DOFA-CLIP (optical), SARCLIP (SAR), OpenAI CLIP ViT-L/14 (text)
- Hybrid fusion: Concatenate visual + text embeddings with H3 spatial encoding
Retrieval Engine
- FAISS HNSW index for approximate nearest-neighbor search
- Zero-Shot Modality Centering (ZS-MC): Parameter-free vector calibration aligning optical and SAR embeddings in CLIP joint space
- Uber H3 spatial filter: Maps coordinates to resolution-7 hexagons, ring-search limits candidates before FAISS operations
Presentation
- Gradio web UI with map visualization (Leaflet), spectral band rendering, and metrics dashboard
- REST API (FastAPI) for programmatic access
Sensor Modalities
SatFetch supports same-modal (opticalβoptical, SARβSAR) and cross-modal (opticalβSAR, textβmultispectral, etc.) retrieval. Cross-modal is the harder problem β the system bridges the spectral domain gap using Zero-Shot Modality Centering (ZS-MC), a training-free calibration technique.
Zero-Shot Modality Centering
ZS-MC computes electromagnetic centroids (ΞΌ_mod) of each sensor modality in the CLIP joint embedding space, then calibrates queries by translating the query vector:
z_c = z_q β ΞΌ_src + ΞΌ_tgt
This aligns representations across spectral domains without backpropagation or training.
Evaluation
Benchmark Results
| Model | Same R@1 | Same R@5 | Same R@10 | Cross R@1 | Cross R@5 | Cross R@10 | Latency |
|---|---|---|---|---|---|---|---|
| Baseline CLIP | 0.320 | 0.450 | 0.520 | 0.080 | 0.150 | 0.220 | 28ms |
| Linear CCA | 0.330 | 0.460 | 0.530 | 0.120 | 0.280 | 0.360 | 33ms |
| SatFetch ZS-MC | 0.335 | 0.465 | 0.540 | 0.245 | 0.485 | 0.590 | 31ms |
| SatFetch ZS-MC + Spec. Cal. | 0.355 | 0.510 | 0.605 | 0.280 | 0.535 | 0.625 | 32ms |
Key improvements over baseline:
- Cross-modal R@5: 0.150 β 0.535 (3.6Γ)
- Cross-modal R@10: 0.220 β 0.625 (2.8Γ)
- Latency overhead: +4ms over baseline (negligible)
Quick Start
Prerequisites
- Python 3.10+
- Git LFS (for embedding weights, if applicable)
Installation
# Clone & enter
git clone https://github.com/your-org/satfetch.git
cd satfetch
# Virtual environment
python -m venv .venv
# Windows: .venv\Scripts\activate
# Linux/Mac: source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
Run
python app.py
Open http://localhost:7860 in your browser.
Verify
pytest tests/ -v
Deployment (Hugging Face Spaces)
Option A: Git Deploy (Recommended)
- Create a new Space at huggingface.co/spaces β SDK: Docker, template: Blank
- Clone the space repo, copy project files, commit, push:
git clone https://huggingface.co/spaces/YOU/SPACE cp -r satfetch/* SPACE/ cd SPACE git add . && git commit -m "Deploy SatFetch" git push - Hugging Face auto-detects the
Dockerfileand builds.
Option B: Web Upload
Upload the project directory via the Files and versions tab in the Hugging Face Space UI.
Project Structure
βββ app.py # FastAPI server entry point
βββ Dockerfile # Hugging Face Spaces container
βββ requirements.txt # Python dependencies
βββ media/ # README diagrams (SVG)
βββ src/
β βββ features/ # Embedding extraction & SAR adapters
β β βββ extractor.py # FeatureExtractor wrapper
β β βββ satclip_encoder.py
β β βββ sar_adapter.py
β βββ retrieval/ # FAISS index & cross-modal search
β β βββ cross_modal_retrieval.py
β β βββ index.py
β βββ geo/ # H3 spatial indexing
β β βββ spatial.py
β βββ evaluation/ # Ground truth & metrics
β βββ ui/ # Gradio + static web app
β βββ static/ # index.html, style.css, app.js
βββ data/
β βββ gallery/ # Searchable image tiles
β βββ processed/ # Pre-computed embeddings
β βββ raw/ # Source datasets
βββ tests/
βββ notebooks/
Team 4MISTAKES
Built at Rajiv Gandhi Institute of Petroleum Technology (RGIPT) for the ISRO Bharatiya Antariksh Hackathon 2026.
- Anurag
- Ayush
- Karan
SatFetch β ISRO Bharatiya Antariksh Hackathon 2026