LoFi: Location-Aware Fine-Grained Representation Learning for Chest X-ray

Myeongkyun Kang, Yanting Yang, Xiaoxiao LiarXiv 2026

TL;DR

The paper introduces LoFi (Location-aware Fine-grained representation learning), a novel framework that improves chest X-ray interpretation by jointly optimizing contrastive, captioning, and location-aware losses using a lightweight large language model (LLM). By learning highly localized, region-level image features, LoFi significantly enhances both image-text retrieval and phrase grounding performance, especially when paired with retrieval-based in-context learning.

What Problem Does This Paper Address?

In medical imaging—particularly chest X-rays—clinically relevant findings are often spatially confined to tiny regions rather than being globally distinct across the entire image. For example, identifying a small pleural effusion or localized atelectasis requires a model to have a highly nuanced, "fine-grained" understanding of the image.

Current medical vision-language models face two major roadblocks here:

  1. Lack of region-level supervision: Standard contrastive models (like CLIP variants) look at the image and text globally, missing fine-grained, localized details because region-level annotations (bounding boxes) are incredibly scarce and expensive to produce.
  2. Poor generalization: Large Vision-Language Models (LVLMs) often struggle to generalize their fine-grained understanding when evaluated on external datasets (external validation) without extensive, task-specific fine-tuning.

To bridge this gap, the authors set out to build a model that can learn localized, region-text alignments from long-form radiology reports and limited bounding boxes, and then leverage these representations to guide larger models at inference time.

Methods

LoFi introduces a multi-objective learning framework that connects a vision-text encoder with a lightweight LLM to enforce location awareness.

Fig. 1: Illustration of (a) location-aware fine-grained representation learning frameworks and (b) a retrieval-based in-context learning pipeline.

1. Multi-Objective Training

LoFi jointly optimizes three distinct types of losses:

  • Sigmoid Loss ($L_s$): A contrastive objective (adapted from SigLIP) that ensures matched image-text pairs have higher similarity scores than unmatched pairs, optimizing global retrieval.
  • Autoregressive Captioning Loss ($L_c$): Trains the model to generate full radiology reports from images, helping it learn from long-form clinical text.
  • Location-Aware Captioning Loss ($L_g, L_d$): This is the core novelty. It consists of a grounding loss (predicting bounding box coordinates given a clinical phrase) and a dense captioning loss (predicting the clinical phrase given a bounding box).

The architecture utilizes a pretrained SigLIP2-400M as the image/text encoder and a lightweight Gemma-3-270M as the autoregressive language model, fine-tuned efficiently using LoRA.

2. Retrieval-Based In-Context Learning (ICL)

At inference time, instead of fine-tuning a massive model on a new dataset, the authors use LoFi's fine-grained image encoder to perform a k-nearest-neighbor search. It retrieves the top-$k$ most relevant image-text-box examples (demonstrations) from a candidate pool and feeds them as context to a larger, instruction-tuned medical model (MedGemma-1.5-4B). This allows the model to adapt to new datasets on the fly without changing its weights.

Datasets

The model was trained and evaluated on two primary chest X-ray benchmarks:

  • MIMIC-CXR / MIMIC-Ext: A massive dataset of 377,110 chest X-rays and 227,835 radiology reports. For region-level training, the authors utilized 394,835 machine-generated "silver-standard" text-box pairs from MIMIC-Ext, applying a weighted box fusion strategy to clean up overlapping annotations.
  • PadChest-GR: A dataset containing 4,555 chest X-rays with human-annotated bounding boxes for abnormal findings. This was used as a rigorous benchmark for both internal validation (where the model sees some training data) and external validation (zero-shot adaptation via ICL).

Key Insights and Ideas

  • The Synergy of Grounding and Dense Captioning: Forcing the model to translate back and forth between coordinates and text strings acts as a powerful regularizer. It prevents the vision encoder from collapsing into purely global representations.
  • Better Retrieval Directly Powers Better Few-Shot Learning: In-context learning is highly sensitive to prompt quality. Because LoFi's encoder is exceptionally good at finding clinically similar examples, the downstream LVLM receives much more accurate and helpful context, leading to superior phrase grounding.
  • Parameter Efficiency Wins: During internal validation, fine-tuning the LoFi-infused parameters outperformed massive models like MAIRA-2 while using a fraction of the parameters (270M vs. 7B).

Key Results

Medical Image-Text Retrieval

Evaluated on the MIMIC-CXR test set, LoFi significantly outperformed existing state-of-the-art medical contrastive models in both image-to-text and text-to-image retrieval tasks.

Table 1: Retrieval performance on the MIMIC-CXR dataset. R@K denotes Recall at K, where K is the cutoff rank.

As shown in Table 1, LoFi achieved an Image-to-Text R@1 of 13.90 and a Text-to-Image R@1 of 11.91, comfortably beating specialized models like CARZero and RadIR.

External Phrase Grounding

When evaluated on the external PadChest-GR dataset using retrieval-based ICL ($k=40$ demonstrations), LoFi achieved the highest localization scores across the board.

Table 2: Phrase grounding performance on the PadChest-GR dataset for external validation using retrieval-based ICL with MedGemma and k demonstrations.

LoFi reached an F1 score of 25.34 at an Intersection over Union (IoU) threshold of 0.5, outperforming MedSigLIP (24.51) and standard SigLIP2 (21.47).

Limitations and Future Work

The primary bottleneck identified by the authors is the computational overhead of In-Context Learning (ICL) at inference time. Retrieving and processing up to 40 multi-modal demonstrations significantly increases prompt token length and latency. The authors highlight the need for future research to focus on optimizing this retrieval pipeline to enable more efficient, real-time clinical deployment.

Summary updated

BibTeX
@misc{kang2026lofi,
  author = {Myeongkyun Kang and Yanting Yang and Xiaoxiao Li},
  title = {{LoFi: Location-Aware Fine-Grained Representation Learning for Chest X-ray}},
  year = {2026},
  eprint = {2603.19451},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.19451},
}
Figure