Model card for resnet50.dcxfm

ResNet-50 image encoder of DCXFM (Dense Chest X-ray Foundation Model), ported to timm from the official stage-1 checkpoint "stage1-epoch=11-step=5040.ckpt" (submodule "img_encoder_student") of HKU-MedAI/DCXFM. DCXFM is a chest X-ray vision-language foundation model trained with mixed supervisions (text, labels, segmentation masks) for dense prediction (phrase grounding, zero-shot semantic segmentation, zero-shot classification).

Model Details

  • Model Type: Feature backbone (image encoder, encoder-only port; classifier head removed, num_classes=0)
  • Developed by: HKU MedAI (Fuying Wang, Lequan Yu)
  • Model Stats:
    • Params: 25.6M (ResNet-50 encoder trunk, fc head dropped)
    • Image size: 512 x 512 x 3
    • Architecture: ResNet-50 (Bottleneck [3,4,6,3]), stem conv1 7x7 stride 2 + bn1 + ReLU + maxpool, overall stride 32
  • Pre-training:
    • Stage-1 SDMP (self-distilled multimodal pretraining) on MIMIC-CXR chest X-rays with a CXR-BERT text encoder; soft cross-modal contrastive alignment + local-to-global self-distillation. Input 512x512, mean 0 / std 1 (grayscale replicated to RGB)
    • Framework: PyTorch Lightning (checkpoint "stage1-epoch=11-step=5040.ckpt", Google Drive file id 11s4IznU3aYF3INSEhEIpy5GdnDREvq6j)
  • Preprocessing (upstream eval): resize longest edge to 512 (cv2.INTER_AREA), zero-pad shorter edge to 512x512, scale to [0,1] (Normalize(mean=0, std=1)); timm equivalent: crop_mode="border", crop_pct=1.0, mean=[0,0,0], std=[1,1,1], input_size=[3,512,512]
  • Papers:
  • Original: https://github.com/HKU-MedAI/DCXFM
  • License: MIT

Model Usage

Image Embeddings

from urllib.request import urlopen
from PIL import Image
import timm

# get example chest X-ray image
img = Image.open(
  urlopen(
    "https://raw.githubusercontent.com/ieee8023/covid-chestxray-dataset/master/images/000001-1.png"
  )
).convert("RGB")

# load model from the hub
model = timm.create_model(
  model_name="hf-hub:1aurent/resnet50.dcxfm",
  pretrained=True,
).eval()

# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)

data = transforms(img).unsqueeze(0) # input is a (batch_size, num_channels, img_size, img_size) shaped tensor
output = model(data)  # output is a (batch_size, num_features) shaped tensor

Citation

@article{Wang2025DCXFM,
  author  = {Wang, Fuying and Yu, Lequan},
  title   = {Scaling Chest X-Ray Foundation Models From Mixed Supervisions for Dense Prediction},
  journal = {IEEE Transactions on Medical Imaging},
  year    = {2025},
  volume  = {44},
  number  = {12},
  pages   = {5306--5318},
  doi     = {10.1109/TMI.2025.3589928}
}
Downloads last month
2
Safetensors
Model size
23.6M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including 1aurent/resnet50.dcxfm