StanfordAIMI / CheXficient

huggingface.co
Total runs: 47.5K
24-hour runs: 0
7-day runs: 60
30-day runs: 60
Model's Last Updated: March 02 2026
zero-shot-image-classification

Introduction of CheXficient

Model Details of CheXficient

CheXficient

Paper | GitHub

CheXficient is a vision-language foundation model for chest X-ray (CXR) interpretation, designed to improve both data efficiency and computational efficiency during pretraining.

Instead of scaling indiscriminately to ever-larger datasets, CheXficient adopts a principled data curation strategy to selectively prioritize informative training samples. This approach demonstrates that active, structured data selection can serve as a cost-effective alternative to brute-force dataset enlargement.

The model follows a dual-encoder architecture and supports prompt-based zero-shot classification via joint image-text representation learning.


Model Overview
  • Architecture: Vision-language dual encoder
  • Image Backbone: DINOv2 (base)
  • Text Backbone: BioClinicalBERT
  • Input: Chest X-ray image + text prompts
  • Output: Image-text similarity logits and embeddings
  • Framework: PyTorch + Hugging Face Transformers
  • Intended Use: Research in medical AI and multimodal learning

Installation
pip install torch torchvision transformers pillow

Load the Model
import torch
from PIL import Image
from transformers import AutoModel, AutoTokenizer, AutoImageProcessor

repo_id = "StanfordAIMI/CheXficient"
device = "cuda" if torch.cuda.is_available() else "cpu"

model = AutoModel.from_pretrained(
    repo_id,
    trust_remote_code=True
).to(device)

tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
image_processor = AutoImageProcessor.from_pretrained(repo_id, trust_remote_code=True)

model.eval()

Zero-Shot Classification Example
image = Image.open("./CXR/images/5AF3BB6C1BCC83C.png").convert("RGB")
text = ["Pneumonia", "no Pneumonia"]

image_inputs = image_processor(images=image, return_tensors="pt").to(device)
text_inputs = tokenizer(text, padding=True, return_tensors="pt").to(device)

with torch.no_grad():
    outputs = model(
        pixel_values=image_inputs["pixel_values"],
        text_tokens=text_inputs,
    )

print(outputs)

Optional probability conversion:

import torch.nn.functional as F

logits = outputs["logits_per_image"]
probs = F.softmax(logits, dim=-1)
print(probs)

Citation
@article{wang2026data,
  title={A data-and compute-efficient chest X-ray foundation model beyond aggressive scaling},
  author={Wang, Chong and Zhang, Yabin and Gao, Yunhe and Varma, Maya and Mottez, Clemence and Patsatzi, Faidra and Liu, Jiaming and Long, Jin and Delbrouck, Jean-Benoit and Gatidis, Sergios and others},
  journal={arXiv preprint arXiv:2602.22843},
  year={2026}
}

Runs of StanfordAIMI CheXficient on huggingface.co

47.5K
Total runs
0
24-hour runs
18
3-day runs
60
7-day runs
60
30-day runs

More Information About CheXficient huggingface.co Model

More CheXficient license Visit here:

https://choosealicense.com/licenses/mit

CheXficient huggingface.co

CheXficient huggingface.co is an AI model on huggingface.co that provides CheXficient's model effect (), which can be used instantly with this StanfordAIMI CheXficient model. huggingface.co supports a free trial of the CheXficient model, and also provides paid use of the CheXficient. Support call CheXficient model through api, including Node.js, Python, http.

StanfordAIMI CheXficient online free

CheXficient huggingface.co is an online trial and call api platform, which integrates CheXficient's modeling effects, including api services, and provides a free online trial of CheXficient, you can try CheXficient online for free by clicking the link below.

StanfordAIMI CheXficient online free url in huggingface.co:

https://huggingface.co/StanfordAIMI/CheXficient

CheXficient install

CheXficient is an open source model from GitHub that offers a free installation service, and any user can find CheXficient on GitHub to install. At the same time, huggingface.co provides the effect of CheXficient install, users can directly use CheXficient installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

CheXficient install url in huggingface.co:

https://huggingface.co/StanfordAIMI/CheXficient

Url of CheXficient

Provider of CheXficient huggingface.co

StanfordAIMI
ORGANIZATIONS

Other API from StanfordAIMI

huggingface.co

Total runs: 4.2K
Run Growth: 2.2K
Growth Rate: 51.81%
Updated:April 02 2026
huggingface.co

Total runs: 1.6K
Run Growth: 345
Growth Rate: 20.92%
Updated:November 19 2022