Journal of Artificial Intelligence Systems Engineering
1*Department of Mathematics, Sona College of Arts and Science, Salem 636005, Tamilnadu, India
2FLABS SRM IST Kattankulathur, Tamilnadu, India
* Corresponding author: uma_m2485@yahoo.com
Received: 22 Jun 2026 Revised: 4 July 2026 Accepted: 13 July 2026 Published: 05 August 2026
The problem of aligning chest radiographs to their semantically equivalent radiology reports is a first step towards zero-shot classification, cross-modal retrieval, and automatic report writing. General purpose vision–language models like CLIP do not perform well in the clinic since the pretraining distribution is often insufficient to include rare radiological lexicon, negation-dense language and nuanced pathology signals. To address the semantic alignment gap between chest X-ray images and radiology reports on MIMIC-CXR, we propose a transformer-based cross-modal contrastive framework, called DAP-CLIP (Domain-Adaptive Prompted CLIP). The three crucial components of our approach are introduced here: (i) a Vision Transformer (ViT-B/16) image encoder and a clinical BERT text encoder are trained together under a symmetric InfoNCE contrastive objective; (ii) a Domain-Adaptive Prompt Pool — a set of learnable, pathology-conditioned prompt tokens injected into both encoders to direct representations to domain-relevant sub-manifolds; and (iii) a lightweight cross-attention fusion module to further fine-tune the image–text correspondence at the token level. The performance of DAP-CLIP is compared on the MIMIC-CXR v2.0.0 benchmark (377,110 studies) where it outperforms BioViL by +3.6 points for mean zero-shot AUROC on eight CheXpert pathologies, and MedCLIP by +5.2 points for image-to-report retrieval at R@10. The domain-adaptive prompt pool is the single largest factor driving semantic alignment quality as demonstrated by ablation studies and t-SNE visualization of the cross-modal clusters yield significantly tighter alignments. In conclusion, DAP-CLIP shows the feasibility and parameter efficiency of designing a prompt-based approach to domain adaptation towards clinical quality multimodal alignment.
Keywords: Vision Transformer, Contrastive Learning, Domain-Adaptive Prompting, Radiology Report Retrieval, MIMIC-CXR, Zero-Shot Classification, Medical Vision–Language.
Chest x-rays are the most commonly ordered imaging study in the world, and every image is accompanied by a free-text radiology report, including findings, impression, and comparisons with previous studies. The ability to learn a shared cross-modal semantic space between the image and the report allows for a myriad of downstream capabilities: zero-shot disease classification, search image–report, error checking, and even the automatic generation of reports. CLIP has been a key player in the popularization of contrastive vision–language pretraining as a dominant paradigm for alignment.
The direct transfer of CLIP-style models to the chest X-ray domain is a difficult task due to three reasons. First, there is an imbalance of natural-image–caption pretraining data: phrases like “opacity in the right lower lobe with air bronchograms” don't occur that often in web corpora. Second, the text used in radiology is rife with negations and uncertainties (“no evidence of pneumothorax”, “possible early consolidation”) that are difficult to deal with using standard contrastive objectives. Third, chest X-ray findings have granular, spatially localised findings, which global CLIP-style pooling tends to smear.
The second problem is tackled by recent domain-specific work which has pretrained on medical corpora, such as MedCLIP, BioViL, and CheXzero, but usually the former is frozen and the latter contains hand-crafted templates such as “a photo of {finding}”. We believe that learnable, domain-adaptive prompts offer a better and parameter-efficient way to connect the transformer encoder to the clinical distribution.
We give the following contributions:
In this paper, we present DAP-CLIP, a transformer-based contrastive framework specifically designed for chest X-ray – report alignment on MIMIC-CXR. We propose a learnable set of prompt tokens conditioned on latent pathology descriptors, injected into both the ViT and text encoder streams, which we call a Domain-Adaptive Prompt Pool (DAPP). We introduce a lightweight Cross-Attention Fusion module to generate token-wise alignment scores to boost fine-grained retrieval without introducing a large number of parameters. We achieve leading zero-shot performance on 8 CheXpert pathologies (mean AUROC = 0.891), and show that our retrieval, report generation, and probing benchmarks all benefit.
The related work is reviewed in Section 2, the alignment problem is formalized in Section 3, DAP-CLIP is described in Section 4, experiments are reported in Section 5, findings and limitations are discussed in Section 6, and finally, the paper is concluded in Section 7.
CLIP gave rise to large-scale contrastive image–text alignment and follow-up models (ALIGN, BLIP-2, SigLIP) improved the objectives and scaling laws. All use web-scale general domain data.
Contrastive pretraining for chest X-rays was adapted by ConVIRT, MedCLIP, GLoRIA, BioViL, BioViL-T, and CheXzero. These works provide good baselines, but are less robust across pathology vocabularies because they are textually based and make use of manual prompts.
CoOp, CoCoOp, MaPLe and VPT proposed learnable prompt tokens for vision–language models. This direction has been explored only a little in the medical field, with existing approaches (KAD, XPL) either freezing the vision backbone or using prompts only on one modality. Our DAPP performs prompt learning and conditioning over both modalities using pathology-aware descriptors.
Late-fusion contrastive models (CLIP) rely solely on global pooled representations, whereas token-level fusion (ALBEF, BLIP) offers greater alignment at the token level, but requires more compute. The overhead of our lightweight cross-attention module is minimal (~2.1M extra params) and the tokens are learned.
Caption: DAP-CLIP architecture. A Vision Transformer processes chest radiographs while a clinical BERT encodes the report. A shared Domain-Adaptive Prompt Pool conditions both streams. Projection heads and a symmetric InfoNCE loss align embeddings in a common semantic space.
We are trained on a set of paired chest X-rays xii and radiology reports xit, and receive the encoders fi (ViT-B/16), ft (Clinical-BERT) and projection heads gi, gt, which map to a d = 512-dimensional unit-norm space. The goal is to maximise the similarity between paired samples and minimise the similarity between unpaired samples.
A measure of both centroid distance and pairwise variance is defined as:
The lower the SAG, the tighter the alignment.
DAP-CLIP is composed of four components: a ViT-B/16 image encoder, a Clinical-BERT text encoder, a learnable token-based Domain-Adaptive Prompt Pool (DAPP) module for introducing learnable tokens to both encoders, and a Cross-Attention Fusion (CAF) module for token-level alignment.
ViT-B/16 is a pretrained ImageNet-21k model that was additionally initialized from CLIP, and yields 197 patch tokens and a [CLS] token. It uses Clinical-BERT (Alsentzer et al.) to encode the text into 128 wordpiece tokens. A small learning rate (1e-5) is used for both encoders to prevent catastrophic forgetting.
We create P = 32 learnable prompt vectors p1, …, pP ∈ ℝd. We compute an attention-based routing for each of the input samples:
It is composed of a query token q, obtained from a light-weight pathology classifier head on top of the raw image, and a set of learned prompt keys Kj. This adaptive prompt p̂ is then added to the sequence of tokens in both the ViT stream and the BERT stream. The prompts are automatically customized for each type of pathology (Cardiomegaly, Effusion, Pneumothorax, etc.) without the need for any hard-coding.
We encode and then run two layers of cross-attention to map text tokens to image patches (and image patches to text tokens), generating enhanced joint embeddings. These are then collected and fed into the projection heads gi, gt. Only 2.1M parameters and 4% inference overhead are added by CAF.
The idea of server aggregation is that we calculate the global manifold estimate M_g and penalize the deviations of each server:
where the approximation of P is obtained using Gaussian Mixture Models of outputs obtained by projections. The most important component that prevents intra-institutional drift in the context of SGR is the key.
The loss is the sum of the text-matching loss based on the binary image–text pairs L_align and a repulsion term for the different P prompt vectors L_prompt_div, combined with weights λ1 and λ2. We set λ1 = 0.5 and λ2 = 0.1.
| Component | Setting |
|---|---|
| Image encoder | ViT-B/16, CLIP-init, fine-tuned |
| Text encoder | Clinical-BERT (110M params) |
| Embedding dim (d) | 512 |
| Prompt pool size P | 32 |
| Cross-Attn layers | 2 |
| Batch size | 256 |
| Optimizer | AdamW, lr = 1e-5, wd = 0.05 |
| Warmup | 2000 steps, cosine decay |
| Temperature τ | 0.07 |
| λ1 (ITM), λ2 (Prompt Div) | 0.5, 0.1 |
| Training epochs | 40 |
| Hardware | 4 × NVIDIA A100 (80GB) |
MIMIC-CXR consists of 377,110 chest radiographs from 65,379 patients with 227,835 free-text reports from Beth Israel Deaconess Medical Center. The official training/validation/test splits are followed and CheXpert labels are used for zero-shot validation on 8 pathologies. Images are resized to 224 × 224, and the reports are tokenized up to 128 wordpieces (Impression + Findings sections).
| Split | Studies | Images | Reports | Positive Cases (any pathology) |
|---|---|---|---|---|
| Train | 222,758 | 368,960 | 222,758 | 143,522 |
| Validation | 1,808 | 2,991 | 1,808 | 1,132 |
| Test | 3,269 | 5,159 | 3,269 | 2,081 |
| Total | 227,835 | 377,110 | 227,835 | 146,735 |
DAP-CLIP has been put into practice in PyTorch 2.3, HuggingFace Transformers, and timm. Training takes ~52 GPU-hours on 4 × A100. The entire code is written using mixed precision (bf16). Full code, pretrained weights, and hyperparameters will be published.
Compared to CLIP (original), MedCLIP, BioViL, BioViL-T and CheXzero. Evaluation consists of three tasks: (1) zero-shot classification AUROC across 8 CheXpert pathologies; (2) cross-modal retrieval (image→report and report→image, R@1, R@5, R@10); and (3) report generation with a light-weight decoder (BLEU-4, ROUGE-L, CIDEr).
Caption: (a) Baseline ViT-BERT without prompting shows a wide gap between modalities. (b) DAP-CLIP (ours) shows tightly aligned clusters with pathology-labeled sub-groupings, indicating both cross-modal alignment and pathology-aware structure.
Caption: DAP-CLIP (dark navy) outperforms all baselines on every category, with the largest gains on subtle findings such as Consolidation and Fracture.
| Model | Mean AUROC ↑ | SAG ↓ | R@10 (I→T) ↑ | R@10 (T→I) ↑ | BLEU-4 ↑ | ROUGE-L ↑ |
|---|---|---|---|---|---|---|
| CLIP (original) | 0.712 | 0.784 | 42.1 | 40.7 | 0.081 | 0.161 |
| MedCLIP | 0.839 | 0.492 | 72.8 | 70.4 | 0.152 | 0.238 |
| BioViL | 0.855 | 0.457 | 76.3 | 74.1 | 0.164 | 0.246 |
| BioViL-T | 0.867 | 0.436 | 78.9 | 76.5 | 0.171 | 0.253 |
| CheXzero | 0.861 | 0.448 | 77.4 | 75.2 | 0.166 | 0.249 |
| DAP-CLIP (ours) | 0.891 | 0.362 | 84.1 | 82.6 | 0.201 | 0.281 |
The SAG is reduced by 17.0% compared to BioViL-T, and the image-to-report R@10 is increased by +5.2 points, suggesting the advantage of both modality alignment and fine-grained retrieval.
Caption: Ablation heatmap showing the contribution of each DAP-CLIP component to AUROC, F1, BLEU-4, and Retrieval R@10. Removing the Domain-Adaptive Prompt Pool produces the largest degradation, confirming it is the primary source of the alignment gains.
Key findings: (i) eliminating the prompt pool results in the largest single drop in mean AUROC, from 0.891 to 0.822; (ii) removing cross-attention fusion has the largest impact on retrieval (R@10 drops 8 pts) and only a minor impact on classification; (iii) fixed hand-crafted prompts (including MedCLIP prompts) recover ~40% of the AUROC gain from DAPP.
We sweep P ∈ {4, 8, 16, 32, 64, 128}. As the number of prompts increases, performance increases monotonically up to P = 32 and then remains stable, indicating that 32 prompts with pathology knowledge are sufficient to cover the entire CheXpert label space. We use P = 32 as the default.
To illustrate this, we provide four qualitative examples in the supplementary material showing that DAP-CLIP is able to retrieve the ground-truth report whereas the baselines get semantically similar but incorrect matches (e.g., when DAP-CLIP gets “pleural effusion” and the baselines get “pulmonary edema”).
The X-ray findings of chest X-rays are grouped around a few clinically relevant sub-domains. A learnable prompt pool can be used to efficiently provide an inductive bias that allows the model to focus its capacity on each sub-domain without fine-tuning the backbone of the model to every sub-domain. However, with fixed textual prompts, all sub-domains will have the same textual context, which will lower alignment.
Limitations. (i) This is a single institution in the U.S. and generalization to other populations, equipment, and languages is not tested. (ii) The medical images are of a non-trivial nature, and also have negation and uncertainty represented – something our current text encoder is only implicitly able to represent. (iii) We focus on frontal views and leave lateral views and prior-comparison reasoning for future work.
Ethical Considerations. All experiments use de-identified MIMIC-CXR data under PhysioNet credentialed access. No outputs are released that include information about patients. It is important for users using DAP-CLIP in clinical workflows to ensure that human oversight, calibration, and bias audit are in place.
We propose a transformer-based contrastive learning framework for cross-modal semantic alignment (DAP-CLIP) using chest X-ray and radiology report data. In addition to state-of-the-art zero-shot classification results on MIMIC-CXR (mean AUROC = 0.891), DAP-CLIP also achieves parameter efficiency while establishing state-of-the-art retrieval results (R@10 = 84.1%). Gains were confirmed by ablation, which indicates that the majority of gains observed are due to adaptive prompting. Our results show that domain-adaptive prompting is a viable and useful way of bridging the semantic gap in medical vision–language systems, and point to a number of future directions: multi-view radiographs, longitudinal comparison, and multilingual clinical corpora.