Skip to content
elkhourykPublic

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

LC-TIM: Locally Consistent Transductive Information Maximization for Few-Shot Remote Sensing Scene Classification

Karim El Khoury, Benoît Gérin, Benoît Macq, and Christophe De Vleeschouwer

ICTEAM, UCLouvain, Louvain-la-Neuve, Belgium


Official implementation of LC-TIM, a transductive few-shot adaptation method for remote-sensing (RS) scene classification. LC-TIM augments the Transductive Information Maximization for Few-Shot CLIP (TIM++) objective with a local-consistency regularizer that enforces prediction agreement between each query sample and its κ nearest feature-space neighbors. The regularizer enters as a single multiplicative factor in the closed-form q-update of TIM++, adding negligible computational overhead.

We further propose a multi-source extension, LC-TIM+DINO, that fuses the affinity graph of the RS vision-language model (VLM) with satellite-pretrained DINOv3 patch embeddings, providing an orthogonal structural prior that yields additional gains.

Alongside the method, this repository provides the first comprehensive, open-source benchmark for transductive few-shot RS scene classification, evaluating LP++, TransCLIP, TIM++, LC-TIM and LC-TIM+DINO across ten diverse RS datasets, two RS vision-language backbones and multiple shot settings.

Table of Contents

  1. Installation
  2. Usage: LC-TIM for Few-Shot RS Classification
  3. Multi-Source Extension (LC-TIM+DINO)
  4. Reproducing the Paper Tables
  5. Baselines
  6. Acknowledgment
  7. Citation

Installation

Environment

Create a Python environment with your favorite manager. For example, with conda:

conda create -y --name lctim python=3.10.0
conda activate lctim
pip3 install -r requirements.txt

And install PyTorch according to your configuration:

pip3 install torch==2.0.1 torchaudio==2.0.2 torchvision==0.15.2

open_clip_torch (installed via requirements.txt) is required for the GeoRSCLIP backbone.

Datasets

The ten RS datasets, their fixed 50/25/25 splits, and the folder formatting are provided by the IGARSS 2026 RS few-shot benchmark of El Khoury et al. (https://github.com/elkhouryk/fewshot_RSVLMs). Follow DATASETS.md to install them under a ./DATA root. You will get the following structure:

DATA/
|–– aid/
|–– eurosat/
|–– mlrsnet/
|–– optimal31/
|–– patternnet/
|–– resisc45/
|–– rsc11/
|–– rsicb128/
|–– rsicb256/
|–– whurs/

Usage: LC-TIM for Few-Shot RS Classification

The single entry point is run_rs_all.py. It evaluates all six methods reported in the paper — zero_shot, lp_pp (LP++), transclip (TransCLIP), tim_p2 (TIM++), tim_p2_nnc (LC-TIM) and tim_p2_nnc_consistent (LC-TIM+DINO) — on each RS dataset, and prints per-dataset and average accuracy tables.

Run the full benchmark with GeoRSCLIP ViT-B/32 over all shot settings and seeds:

python run_rs_all.py --root_path ./DATA --backbone georsclip_b32 --shots 1 2 4 8 16 --seeds 1,2,3

Standard CLIP ViT-B/32 backbone:

python run_rs_all.py --root_path ./DATA --backbone vit_b32 --shots 1 2 4 8 16 --seeds 1,2,3

A single dataset / shot setting (features are cached after first extraction):

python run_rs_all.py --root_path ./DATA --backbone georsclip_b32 --datasets eurosat --shots 1

Both backbones use the shared text prompt template "a centered satellite photo of {}". LC-TIM and LC-TIM+DINO use the paper hyperparameters (τ = 120, λ = 0.4, α = 1.0, γ = 0.05, T = 150, κ = 5, λ_LC = 0.3), kept fixed across all datasets and shots.

Per-dataset results are cached at caches/<dataset>/results.json and an aggregate summary is written to caches/results_summary.json.

Multi-Source Extension (LC-TIM+DINO)

tim_p2_nnc_consistent fuses the VLM CLS affinity with a DINOv3 ViT-L/16 (SAT-493M) patch-mean affinity into a single cross-modal "consistent" kNN graph. It requires pre-extracted DINOv3 features. First clone facebookresearch/dinov3 and obtain the gated SAT-493M ViT-L/16 checkpoint, then extract features:

python extract_dinov3_features.py \
    --repo_dir /path/to/dinov3 \
    --weights  /path/to/dinov3_vitl16_pretrain_sat493m-eadcf0ff.pth \
    --root_path ./DATA --datasets aid eurosat mlrsnet optimal31 patternnet \
                                  resisc45 rsc11 rsicb128 rsicb256 whurs

This caches test_cls.pt / test_patchmean.pt under caches/<dataset>/dinov3_vitl16_sat493m/. Once present, run_rs_all.py automatically reports the tim_p2_nnc_consistent (LC-TIM+DINO) column; otherwise that column is skipped.

Reproducing the Paper Tables

The paper reports 10-seed averages for LC-TIM and LC-TIM+DINO. The following scripts produce the exact cached numbers and emit the LaTeX tables:

Tables 1 & 2 — main results (CLIP ViT-B/32 and GeoRSCLIP ViT-B/32):

# LC-TIM numbers (λ_LC=0.3, κ=5, 10 seeds)
python sweep_vanilla_lambda03_vitb32.py --seeds 1,2,3,4,5,6,7,8,9,10   # CLIP ViT-B/32
python sweep_vanilla_lambda03.py        --seeds 1,2,3,4,5,6,7,8,9,10   # GeoRSCLIP ViT-B/32
# Emit LaTeX (base-method numbers read from run_rs_all.py's caches)
python build_table_clip.py --backbone vit_b32       > table_clip.tex
python build_table_clip.py --backbone georsclip_b32 > table_georsclip.tex

Table 3 — LC-TIM vs. LC-TIM+DINO (GeoRSCLIP ViT-B/32 + DINOv3):

python sweep_consistent_lambda03_only.py --seeds 1,2,3,4,5,6,7,8,9,10
python build_table_lctimd.py > table_lctimd.tex

The pre-generated table_clip.tex, table_georsclip.tex and table_lctimd.tex in this repository correspond to the tables in the paper (LCTIM.pdf).

Baselines

All baselines operate on the same frozen VLM embeddings and are dispatched by run_rs_all.py:

  • Zero-shot — the VLM's zero-shot prediction with the RS prompt template.
  • LP++ — inductive linear probe with a learnable CLIP zero-shot weighting (baseline_vl/methods/linear_probe_p2.py).
  • TransCLIP — Gaussian-mixture transductive method with a Laplacian affinity regularizer (baseline_vl/TransCLIP.py).
  • TIM++ — the mutual-information transductive baseline that LC-TIM extends (TIM_p2_solver/, run with lambda_nnc = 0).

Acknowledgment

This repository builds on TIM++, TransCLIP and LP++. It uses the RS few-shot benchmark and dataset splits of El Khoury et al. (IGARSS 2026), and the GeoRSCLIP / DINOv3 RS foundation models. We are grateful for their excellent work.

This work was supported by ARIAC (Walloon region grant No. 2010235) and by the Fonds National de la Recherche Scientifique (FNRS).

Citation

If you find this repository useful, please consider citing our work:

@inproceedings{elkhoury2026lctim,
  title     = {Locally Consistent Transductive Information Maximization for Few-Shot Remote Sensing Scene Classification},
  author    = {El Khoury, Karim and G{\'e}rin, Beno{\^i}t and Macq, Beno{\^i}t and De Vleeschouwer, Christophe},
  booktitle = {Proceedings of the European Conference on Computer Vision (ECCV) Workshops},
  year      = {2026}
}

Contact

For questions, feel free to reach out to karim.elkhoury@uclouvain.be or benoit.gerin@uclouvain.be.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages