Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

EndoComparer

EndoComparer: Comparative Surgical Video Question Answering with
Pseudo-Siamese Visual Adaptation and Perceive-then-Compare Reasoning

Shi Li1,2, Lalith Sharan1,2, Joël L. Lavanchy3,4, Kun Yuan1,2, Lorenzo Arboit1,2, Nabani Banik1,2, Elif Yazici1,2, Maria Vannucci2,5, Vinkle Srivastav1,2, Pietro Mascagni1,2,6, Nicolas Padoy1,2

1ICube, University of Strasbourg, CNRS, INSERM, France 2IHU Strasbourg, France 3Clarunis, Basel, Switzerland 4University of Basel, Switzerland 5University of Turin, Italy 6Fondazione Policlinico Universitario Agostino Gemelli IRCCS, Rome, Italy

EndoComparer is a vision-language model focused on cross-case surgical video comparison: given two surgical videos from different cases, it answers questions about whether and how they differ in anatomy, tools, actions and skill. It gives each video its own visual encoding and reasoning path, which makes the model more robust and accurate against video-binding confusion, where the content of one video is attributed to the other.

EndoComparer architecture: two video slots pass through a shared frozen vision encoder with slot-specific LoRA adapters (PSVL); the language model reads the interleaved sequence and answers with a Perceive-then-Compare response that states what each video shows before the answer letter.

🔥 News

  • [2026.11.04] ⭐️ Code and model release.

🕹️ Quick start

1. Install

pip install -r requirements.txt            

2. Get the base model and the EndoComparer checkpoint

hf download Qwen/Qwen3.5-9B --local-dir models/Qwen3.5-9B
hf download ethanshili/EndoComparer --local-dir models/EndoComparer

The checkpoint holds the language-model LoRA (adapter_model.safetensors) and the Pseudo-Siamese Visual LoRA (dual_vision_lora.pt, psvl_config.json); both are loaded onto the frozen base at inference.

3. Run inference on the demo item

demo/ ships one EndoDiffVQA test item: two cholecystectomy clips and the question "Is the gallbladder coagulated in both videos?" with its four options.

bash scripts/evaluate.sh --jsonl demo/items.jsonl \
    --model models/Qwen3.5-9B --weights models/EndoComparer \
    --out results/demo/results.json

The model first states what each video shows, then gives the letter:

Video 1: coagulated. Video 2: not coagulated. (b)

results/demo/results.json holds the record (id, prediction, raw_prediction);

🚀 Training

bash scripts/train.sh --from-dataset --dataset-root data/EndoDiffVQA --out runs/endocomparer

🔮 Evaluation

bash scripts/evaluate.sh --dataset-root data/EndoDiffVQA --split test --out results/test/results.json

Runs EndoComparer on the test split with the shared frame protocol and writes Detect / Specify / Strict next to the results. Add --controls full,swap for the swap control, or --jsonl items.jsonl for your own items.

Citation

To be added.

License

This repository is released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license. See the LICENSE file for details.

Acknowledgements

EndoDiffVQA is built on CholecT50, MultiBypass140 and CholeScore. EndoComparer builds on Qwen3.5-9B.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages