NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

MedAdaptAgent: An Automatic Harness for Adapting Medical Imaging Models to New Sites

Hanxue Gu, Zhonghao Liu, Xingrui Gu, Kang Wang, Yang YangarXiv 2026

TL;DR

MedAdaptAgent is an automated "harness" that uses Large Language Models (LLMs) to adapt pre-trained medical imaging models to the specific needs of a new hospital. By intelligently planning experiments and enforcing a strict "Evidence Gate," it significantly boosts performance—achieving a 60% relative gain in segmentation tasks—while preventing the common pitfall of deploying adapted models that actually perform worse than the original.

What Problem Does This Paper Address?

Medical AI models are notoriously "brittle." A model trained to segment livers at Hospital A often fails at Hospital B because of different scanners, imaging protocols, or patient populations—a phenomenon known as domain shift.

While techniques exist to adapt these models (like fine-tuning or test-time adaptation), applying them correctly is hard. It requires a team of ML engineers to diagnose the failure, choose the right method for the specific model architecture, and ensure the adaptation doesn't "break" the model on unseen data. For most clinical researchers, this technical barrier makes model reuse nearly impossible. MedAdaptAgent aims to automate this entire pipeline, turning a free-text request (e.g., "Deploy this liver model to our MRI data") into a verified, runnable deployment package.

Methods

The system architecture, illustrated in Figure 1, consists of four main components:

  1. Onboarding Analyzer: It takes a free-text request and inspects the provided model and target data to create a "deployment contract." It identifies the model's architecture (e.g., does it use BatchNorm?) and the available resources (labels, GPU, time).
  2. Adaptation Planner Agent: This is the "brain" of the system, powered by an LLM (like GPT-5.2 or Qwen3-VL). It operates in a closed loop: diagnosing the model-site gap, selecting a compatible action from a library, running the experiment, and revising its plan based on the results.
  3. Deterministic Control Plane: This acts as a safeguard, ensuring the LLM only suggests actions that are architecturally compatible with the model and fit within the user's compute and label budgets.
  4. Evidence Gate: A critical safety mechanism. Before any adapted model is released, the gate compares it against the original pre-trained model. It requires statistical evidence of improvement to prevent "harmful replacements"—cases where a model might look good on a few training labels but fails on the broader test set.
Figure 1: Automatic new-site model adaptation with the MedAdaptAgent harness. A supplied model and target-hospital request enter the Onboarding Analyzer, which inspects the model-site pair and constructs the feasible action space. The LLM-driven Adaptation Planner iterates planning, tool execution, and evidence updates within deterministic compatibility and budget controls. The Evidence Gate authorizes replacement. The harness then packages the pretrained model or an evidence-supported adapted model, and returns a safe-stop report when no tested option satisfies the deployment objective.

The library of available adjustments is categorized by their resource requirements, as shown in Table 1:

Table 1: Adjustment families exposed to the planner after capability and resource filtering. The GPU requirement is mixed for normalization/TTA because the family contains both forward-only BN reset and gradient-based methods.

Datasets

The authors evaluated the system across 26 different model-site transfers:

  • Segmentation: 13 transfers covering six anatomies (prostate, fundus, cardiac, abdominal, whole-heart, and brain) using datasets like RIGA+, M&Ms, CHAOS, and BraTS.
  • Classification: 13 transfers covering diabetic retinopathy, dermatology, histopathology, chest radiography, and breast histology (e.g., APTOS, HAM10000, NIH-to-CheXpert).
  • Public Models: The harness was also tested on popular pre-trained packages including MONAI bundles (MSD-spleen, SwinUNETR) and TotalSegmentator.

Key Insights and Ideas

  • LLM as a Meta-Researcher: Instead of just using an LLM to write code, MedAdaptAgent uses it to reason about the adaptation process. The planner can decide to start with simple, zero-shot normalization (like BatchNorm reset) and only move to expensive fine-tuning if the initial evidence suggests it's necessary and feasible.
  • The Danger of Small-Label Selection: The paper highlights a major risk: when you only have a few labels (e.g., 5 or 10), the model that scores highest on those labels is often not the best model for the rest of the hospital's data.
  • Safety via Comparison: The "Evidence Gate" is the paper's most practical contribution to AI safety. By explicitly comparing candidates to the source model and using bootstrapping to handle uncertainty, the system avoids the "harmful replacements" that plague manual adaptation.
  • Architecture-Aware Adaptation: The system understands that different models need different tools. For example, it knows that BatchNorm-based adaptation won't work on a SegFormer (which uses LayerNorm) and automatically filters the action space accordingly.

Key Results

The quantitative improvements were substantial across the board:

  • Segmentation Gains: With just 20 local annotations, the mean Dice score across 10 transfers rose from 0.483 to 0.774—a 60.1% relative improvement.
  • Classification Gains: Mean AUROC increased from 0.810 to 0.837 across 13 transfers.
  • Reduced Risk: The Evidence Gate reduced harmful classification replacements by 30.8% compared to simply picking the highest-scoring model on the available labels.
  • Planner Flexibility: The system proved robust across different LLMs. While GPT-5.2 was the primary testbed, open-weight models like Qwen3-VL also successfully recovered performance in complex CT-to-MRI transfers.

As shown in Figure 2, the benefit of the harness (MedAdapt) becomes increasingly clear as the label budget ($K$) increases, consistently outperforming fixed adaptation baselines.

Figure 2: Segmentation adaptation performance across different label budgets.

Limitations and Future Work

  • Image-Level vs. Patient-Level: The current evaluation focuses on image-level transfers. The authors note that true clinical translation will require independent validation at the patient level.
  • Heuristic Thresholds: The Evidence Gate relies on manually specified coefficients and margins. Future work could involve automating the calibration of these safety thresholds.
  • Task Scope: While it handles segmentation and classification well, extending the harness to other tasks like detection or image generation remains a future direction.
  • Compute Costs: While the harness automates the process, the underlying adaptation (especially fine-tuning) still requires significant GPU time, which the authors track but don't yet optimize for cost-efficiency.

Summary updated

BibTeX
@misc{gu2026medadaptagent,
  author = {Hanxue Gu and Zhonghao Liu and Xingrui Gu and Kang Wang and Yang Yang},
  title = {{MedAdaptAgent: An Automatic Harness for Adapting Medical Imaging Models to New Sites}},
  year = {2026},
  eprint = {2610.34884},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.34884},
}

Loading related content...

Figure