microsoft-biomedvlp-cxr-bert-general
microsoft-biomedvlp-cxr-bert-general
Version: 11
Hugging Face•Last updated July 2025

CXR-BERT-general

CXR-BERT is a chest X-ray (CXR) domain-specific language model that makes use of an improved vocabulary, novel pretraining procedure, weight regularization, and text augmentations. The resulting model demonstrates improved performance on radiology natural language inference, radiology masked language model token prediction, and downstream vision-language processing tasks such as zero-shot phrase grounding and image classification. First, we pretrain CXR-BERT-general from a randomly initialized BERT model via Masked Language Modeling (MLM) on abstracts PubMed and clinical notes from the publicly-available MIMIC-III and MIMIC-CXR . In that regard, the general model is expected be applicable for research in clinical domains other than the chest radiology through domain specific fine-tuning. CXR-BERT-specialized is continually pretrained from CXR-BERT-general to further specialize in the chest X-ray domain. At the final stage, CXR-BERT is trained in a multi-modal contrastive learning framework, similar to the CLIP framework. The latent representation of [CLS] token is utilized to align text/image embeddings.

Model variations

ModelModel identifier on HuggingFaceVocabularyNote
CXR-BERT-generalmicrosoft/BiomedVLP-CXR-BERT-general PubMed & MIMICPretrained for biomedical literature and clinical domains
CXR-BERT-specialized (after multi-modal training)microsoft/BiomedVLP-CXR-BERT-specialized PubMed & MIMICPretrained for chest X-ray domain

Citation

The corresponding manuscript is accepted to be presented at the European Conference on Computer Vision (ECCV) 2022
@misc{https://doi.org/10.48550/arxiv.2204.09817,
  doi = {10.48550/ARXIV.2204.09817},
  url = {https://arxiv.org/abs/2204.09817},
  author = {Boecking, Benedikt and Usuyama, Naoto and Bannur, Shruthi and Castro, Daniel C. and Schwaighofer, Anton and Hyland, Stephanie and Wetscherek, Maria and Naumann, Tristan and Nori, Aditya and Alvarez-Valle, Javier and Poon, Hoifung and Oktay, Ozan},
  title = {Making the Most of Text Semantics to Improve Biomedical Vision-Language Processing},
  publisher = {arXiv},
  year = {2022},
}

Model Use

Intended Use

This model is intended to be used solely for (I) future research on visual-language processing and (II) reproducibility of the experimental results reported in the reference paper.

Primary Intended Use

The primary intended use is to support AI researchers building on top of this work. CXR-BERT and its associated models should be helpful for exploring various clinical NLP & VLP research questions, especially in the radiology domain.

Out-of-Scope Use

Any deployed use case of the model --- commercial or otherwise --- is currently out of scope. Although we evaluated the models using a broad set of publicly-available research benchmarks, the models and evaluations are not intended for deployed use cases. Please refer to the associated paper for more details.

Data

This model builds upon existing publicly-available datasets: These datasets reflect a broad variety of sources ranging from biomedical abstracts to intensive care unit notes to chest X-ray radiology notes. The radiology notes are accompanied with their associated chest x-ray DICOM images in MIMIC-CXR dataset.

Performance

We demonstrate that this language model achieves state-of-the-art results in radiology natural language inference through its improved vocabulary and novel language pretraining objective leveraging semantics and discourse characteristics in radiology reports. A highlight of comparison to other common models, including ClinicalBERT and PubMedBERT :
RadNLI accuracy (MedNLI transfer)Mask prediction accuracyAvg. # tokens after tokenizationVocabulary size
RadNLI baseline53.30---
ClinicalBERT47.6739.8478.98 (+38.15%)28,996
PubMedBERT57.7135.2463.55 (+11.16%)28,895
CXR-BERT (after Phase-III)60.4677.7258.07 (+1.59%)30,522
CXR-BERT (after Phase-III + Joint Training)65.2181.5858.07 (+1.59%)30,522
CXR-BERT also contributes to better vision-language representation learning through its improved text encoding capability. Below is the zero-shot phrase grounding performance on the MS-CXR dataset, which evaluates the quality of image-text latent representations.
Vision–Language Pretraining MethodText EncoderMS-CXR Phrase Grounding (Avg. CNR Score)
BaselineClinicalBERT0.769
BaselinePubMedBERT0.773
ConVIRTClinicalBERT0.818
GLoRIAClinicalBERT0.930
BioViLCXR-BERT1.027
BioViL-LCXR-BERT1.142
Additional details about performance can be found in the corresponding paper, Making the Most of Text Semantics to Improve Biomedical Vision-Language Processing .

Limitations

This model was developed using English corpora, and thus can be considered English-only.

Further information

Please refer to the corresponding paper, "Making the Most of Text Semantics to Improve Biomedical Vision-Language Processing", ECCV'22 for additional details on the model training and evaluation. For additional inference pipelines with CXR-BERT, please refer to the HI-ML GitHub repository. The associated source files will soon be accessible through this link.
microsoft/BiomedVLP-CXR-BERT-general powered by Hugging Face Inference Toolkit

Send Request

You can use cURL or any REST Client to send a request to the AzureML endpoint with your AzureML token.
curl <AZUREML_ENDPOINT_URL> \
    -X POST \
    -H "Authorization: Bearer <AZUREML_TOKEN>" \
    -H "Content-Type: application/json" \
    -d '{"inputs":"The answer to the universe is undefined."}'

Supported Parameters

  • inputs (string): The text with masked tokens
  • parameters (object):
    • top_k (integer): When passed, overrides the number of predictions to return.
    • targets (string[]): When passed, the model will limit the scores to the passed targets instead of looking up in the whole vocabulary. If the provided targets are not in the model vocab, they will be tokenized and the first resulting token will be used (with a warning, and that might be slower).
Check the full API Specification at the Hugging Face Inference documentation .
Model Specifications
LicenseMit
Last UpdatedJuly 2025
ProviderHugging Face