Earth-OneVision Reproduction & SatQuery AI
A from-scratch, paper-faithful reproduction of Earth-OneVision (Cai et al., "Earth-OneVision: Extending Remote Sensing Multimodal Large Language Models to More Sensor Modalities and Tasks," arXiv:2606.10819), plus SatQuery AI - an agentic remote-sensing vision-language assistant (GUI + backend) built on top of it for the Smart India Hackathon problem statement.
Not the official Earth-OneVision checkpoint. No official weights exist publicly (
docs/assumptions.md#A11). This repo trains the paper's architecture from publicQwen3/SigLIP-2foundation weights. SeeMODEL_CARD.md.
What's here
- Full architecture: SigLIP-2 → FGVLA (ACSA + DeepStack) → MLP projector → Qwen3, with a
tokenizer extended by 1000 dedicated coordinate tokens + a configurable R-RLE segmentation
vocabulary (SLIS).
backend/model/ - Training pipeline: PCMA two-stage curriculum, response-only-masked autoregressive loss,
CUDA+DeepSpeed ZeRO-2 Trainer (2x NVIDIA A40), checkpointing.
backend/training/ - Dataset framework: a common MMRS-OneVision-compatible record schema, per-dataset
download/verify/convert/validate converters, leakage prevention, pluggable GPT-assisted
synthesis.
backend/data/ - Inference + evaluation: structured output decoding (text/boxes/oriented-boxes/points/
R-RLE masks), per-task metrics, paper-vs-reproduction comparison.
backend/inference/,backend/evaluation/ - SatQuery AI: an interactive web app (FastAPI + vanilla-JS frontend) with an agentic
controller that classifies the query, checks input compatibility, routes to a specialist tool,
and returns an evidence-grounded, auditable response.
backend/app/ - 144 automated tests (unit + a real end-to-end integration suite against actual downloaded
weights) and a 12-step smoke test on synthetic data.
backend/tests/,backend/scripts/smoke_test.py
Read docs/paper_spec.md first - it's the authoritative extraction of what the paper actually
says, tagged PAPER_EXPLICIT vs. UNSPECIFIED_BY_PAPER, with every inference this repo made
recorded in docs/assumptions.md.
Environment setup
Two ways to get a working environment, either works standalone:
- Nix (recommended if you have it - gives GDAL/PROJ/GEOS/poppler as real compiled binaries,
no Homebrew/apt required):
nix developdrops you into a shell with those pluspython3.11anduvalready onPATH(seeflake.nix). - Without Nix:
bash scripts/setup.shalone works too as long as your system already has a GDAL installrasteriocan link against (Homebrew'sgdal, or your distro's package).
Either way, Python dependencies themselves always go through uv/requirements.txt, not Nix:
nix develop # optional, see above
bash scripts/setup.sh # uv venv + pinned deps (torch, transformers, fastapi, ...)
bash scripts/verify_environment.sh # versions + device detection + fast unit tests (no downloads)
bash scripts/download_models.sh # fetch Qwen3-0.6B + SigLIP-2-base (~1.6GB; NOT any dataset)
bash scripts/smoke_test.sh # full pipeline, synthetic data, real weights, 12 steps
This does not download any training dataset - see docs/datasets.md for why, and
backend/data/dataset_registry.yaml for how to obtain each one yourself if you want to actually train.
Run SatQuery AI (the interactive app)
source ../.venv/bin/activate
uvicorn app.backend.main:app --host 0.0.0.0 --port 8000
# open http://localhost:8000
Upload one image (single-image VQA/captioning/grounding), two same-modality images (bi-temporal change analysis), or two different-modality images (optical+SAR cross-modal reasoning), type a query, and click Analyze. The response includes the answer, any spatial evidence (boxes/points drawn on a canvas), a confidence bar, a full execution trace (classified task, selected tool, input configuration, latency), and a downloadable JSON report.
Without SATQUERY_CHECKPOINT set, the app builds the architecture from foundation weights
directly (untrained beyond whatever the base LLM/vision-encoder already know) - the pipeline is
fully functional and demonstrable end-to-end; answer quality reflects whether you've actually
run PCMA training (see below). Set SATQUERY_CHECKPOINT=/path/to/checkpoint to load a trained one.
Without that override, the API selects checkpoints/final/,
checkpoints/stage2/final/, checkpoints/stage1/final/, or
checkpoints/baseline-small/final/ in that order, then falls back to the
small foundation model.
Train
python tools/download_dataset.py --dataset cdvqa # prints manual-download instructions
python tools/convert_dataset.py --dataset cdvqa --split train
python tools/validate_dataset.py --manifest data/manifests/cdvqa/train.jsonl
bash scripts/train_stage1.sh # PCMA Stage 1 (viewpoint gap)
bash scripts/train_stage2.sh # PCMA Stage 2 (imaging-physics gap + optical replay)
See docs/training.md. For CUDA multi-GPU, use the DeepSpeed launcher commands there.
Inference (CLI)
python inference/generate.py --model checkpoints/final \
--image example.tif --prompt "Describe the land cover." --task caption
Evaluate
bash scripts/evaluate.sh vqa preds_rsvqa_hr.jsonl
python evaluation/paper_results.py --reproduced results/reproduced.json
backend/evaluation/paper_results.py never fabricates a number - any benchmark you haven't actually
measured prints as NOT_MEASURED.
Repository map
backend/model/ EarthOneVision architecture (SigLIP-2, ACSA, DeepStack, projector, SLIS, Qwen3)
backend/data/ schema, processors, converters, synthesis, leakage prevention, registry
backend/training/ loss, optimizer/scheduler, device strategy, trainer, checkpointing
backend/inference/ generation pipeline + structured output decoder
backend/evaluation/ per-task metrics + paper-result comparison
backend/app/ SatQuery AI: FastAPI backend (agentic controller + tool registry) + frontend
backend/tools/ parameter counting, architecture inspection, dataset CLI
backend/scripts/ setup, smoke test, training, evaluation entry points
backend/configs/ base/stage1/stage2/inference YAML, DeepSpeed ZeRO-2 JSON
flake.nix Nix dev shell: GDAL/PROJ/GEOS/poppler + python3.11 + uv
backend/tests/ 144 tests: SLIS, FGVLA, projector, modalities, dataset schema, loss masking,
leakage, converters, synthesis, controller, full model, full app
docs/ paper_spec, assumptions, paper_to_code, architecture, training, datasets,
reproducibility
Documentation index
docs/paper_spec.md- paper extraction, explicit vs. inferred, per TASK.md's required table.docs/assumptions.md- every unspecified-detail decision, classified and justified.docs/paper_to_code.md- paper section/equation → repo file → class/function traceability.docs/architecture.md,docs/training.md,docs/datasets.md,docs/reproducibility.mdMODEL_CARD.md,MMRS_ONEVISION_DATASET_CARD.mdREPRODUCTION_REPORT.md- what was actually measured, on this actual machine.tasks/TASK_TRAINING.md,tasks/TASK_TESTING.md,tasks/TASK_DEPLOYMENT.md,tasks/TASK_LLMOPS.md,tasks/TASK_FRONTEND_DEPLOYMENT.md- executable task docs: objective, steps, done criteria, debug table.tasks/TASK_MODEL_BOOTSTRAP.md- checkpoint priority, small-model fallback, API status, and parallel frontend work.