Skip to content

About

NV-Reason PathWSI

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

NV-Reason-PathWSI

HuggingFace GitHub arXiv License

NV-Reason-PathWSI is a generative vision-language model for whole-slide pathology image (WSI) interpretation. It supports abnormality and lesion classification, structured report generation, visual question answering, and interactive reasoning from digitized histopathology images.

This repository provides inference examples for the NV-Reason-PathWSI model. The complete model package — weights, configuration, tokenizer, and model card — is maintained on Hugging Face and is intentionally not duplicated here.

NV-Reason-PathWSI is for research and development only. It is not a medical device and must not be used as a substitute for professional clinical judgment, diagnosis, or treatment decisions. Model outputs can be incorrect and should be reviewed by qualified medical professionals.

Contents

  • inference.py: single-image command-line inference (transformers backend)
  • inference_vllm.py: batched JSONL-to-JSONL inference (vLLM backend; reproduces the benchmark decoding configuration)
  • examples/: example histopathology images stored with Git LFS
  • THIRD-PARTY-NOTICES: PyPI dependencies and the third-party package licenses

Model source

All examples load nvidia/NV-Reason-PathWSI with AutoModelForImageTextToText and AutoProcessor. The checkpoint is a standard native multimodal architecture that works with stock Transformers and vLLM — trust_remote_code is not required. On first use, Transformers downloads the model package from Hugging Face and stores it in the local Hugging Face cache.

The command-line inference example accepts --model when a local model copy or a different Hugging Face repository is needed.

Model overview

  • Language backbone: Qwen3.5-4B (native multimodal)
  • Input: RGB histopathology patches and whole-slide image tiles (PNG/JPEG)
  • Thinking mode: enable_thinking chat-template flag; direct answers by default
  • GPU requirement: one ≥24 GB GPU for inference
  • Number of model parameters: 4.54B (bf16)

Installation

Python 3.11 and a CUDA-capable PyTorch installation are recommended. A fresh environment can be created with uv:

uv venv --seed --python 3.11 nvreasonpathwsi
source nvreasonpathwsi/bin/activate

uv pip install -r requirements.txt

Quick start: inference

Download the example images

The images in examples/ are stored with Git LFS. Install Git LFS, then run these commands from the repository root:

git lfs install
git lfs pull --include="examples/*"

Command-line examples

# Open-ended description
python inference.py \
  --image examples/sample_1.png \
  --prompt "Describe the histopathological features visible in this image."

# Diagnostic reasoning (thinking mode)
python inference.py \
  --image examples/sample_1.png \
  --prompt "Reason step by step about the likely diagnosis." \
  --think

# Finding-specific question with a concise answer
python inference.py \
  --image examples/sample_1.png \
  --prompt "Are tumor cells present in this image? Answer only Yes or No."

Thinking is disabled by default; add --think to enable it.

Batched inference

inference_vllm.py processes a JSONL file of {"image": "<path>", "prompt": "<text>"} records and writes the same records back with a response field:

python inference_vllm.py \
  --input examples/queries.jsonl \
  --output responses.jsonl

Defaults (greedy decoding, 16384 context, 8192 max tokens, thinking off) match the benchmark evaluation configuration.

Acknowledgements

NV-Reason-PathWSI builds on Qwen3.5, Transformers, and vLLM.

License

This repository and the model package are released under the OpenMDW-1.1 license. Third-party package licenses are listed in THIRD-PARTY-NOTICES.

Citation

@article{wang2026pathologycot,
  title   = {Pathology-CoT: Learning Visual Chain-of-Thought Agent from Expert
             Whole Slide Image Diagnosis Behavior},
  author  = {Wang, Sheng and Wu, Ruiming and Herndon, Charles and Liu, Yihang
             and Koga, Shunsuke and Shen, Jeanne and Huang, Zhi},
  year    = {2026},
  journal = {arXiv preprint arXiv:2510.04587}
}

About

NV-Reason PathWSI

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages