Quickly Tuning Foundation Models for Image Segmentation

Breenda Das, Lennart Purucker, Timur Carstensen, Frank Hutter

TL;DR

Fine-tuning the Segment Anything Model (SAM) for domain-specific tasks usually requires tedious manual hyperparameter tuning or prohibitive compute budgets. QTT-SEG applies meta-learning-driven Bayesian optimization to adapt SAM across diverse segmentation benchmarks in under three minutes on a single consumer GPU. It consistently outperforms zero-shot SAM and beats AutoGluon Multimodal across most evaluated tasks.

What Problem Does This Paper Address?

Foundation models like SAM demonstrate remarkable zero-shot image segmentation capabilities across everyday scenes, but their accuracy often drops significantly when deployed in specialized domains such as medical imaging, material science, or aerial mapping.

Adapting SAM to these niche domains requires fine-tuning, which typically demands extensive manual exploration of learning rates, optimizers, and parameter-efficient adapters like LoRA. Traditional AutoML frameworks can automate this process, but they are often too slow, expensive, or lack support for multi-class segmentation. The authors ask: Can we leverage meta-learning to identify high-performing fine-tuning configurations for SAM under strict, multi-minute time constraints?

Methods

The authors introduce QTT-SEG, adapting the Quick-Tune framework to semantic segmentation:

  • Bayesian Optimization Guided by Meta-Predictors: QTT-SEG uses a deep-kernel Gaussian Process performance predictor ($\hat{\ell}_\theta$) and an MLP-based cost predictor ($\hat{c}_w$). Trained on historical fine-tuning trajectories, these models predict how a candidate configuration will perform and how long it will take to run, maximizing Multi-fidelity Expected Improvement.
  • Massive Search Space: Encompasses over 200 million possible pipeline configurations, including:
  • LoRA application to SAM’s image encoder attention and MLP layers (rank: 4, 8, 16; dropout: 0.0, 0.1).
  • AdamW optimization with finely gridded learning rates ($10^{-5}$ to $7 \times 10^{-3}$) and weight decay.
  • Loss functions combining Binary Cross-Entropy and Dice loss to address class imbalance.
  • Six learning rate scheduler families (Cosine, OneCycle, Plateau, Step, Poly, Cosine with Warm Restarts) and data augmentations (flips, rotations).
  • Prompting Setup: SAM is prompted with bounding boxes extracted from ground truth masks, perturbed with random noise to simulate real-world, imperfect user prompts.
  • Meta-Training: The predictors were pre-trained on a meta-dataset of 2,000 configuration–dataset pairs evaluated for 10 epochs. Evaluation is strictly leave-one-dataset-out to evaluate zero-shot transfer to unseen domains.

Datasets

The authors evaluated QTT-SEG on 13 public datasets (curated from Kaggle, Hugging Face, and DatasetNinja), subsampling 100 images and masks across five random seeds:

  • Binary Segmentation (8 datasets):
  • Medical: polyp (CVC-ClinicDB), lesion (ISIC 2016), covid (QaTa-COV19), eyes (microcirculation), cardiac (catheterization), chest (X-ray lung masks).
  • Other: leaf (PlantDoc disease segmentation), fiber (concrete CT scan material science).
  • Multiclass Segmentation (5 datasets):
  • US (abdominal ultrasound organ masks), human_parsing (clothing/body parts from ATR), golf (aerial orthophotos), terrain (synthetic robotics terrain), cholec (laparoscopic surgery tools/organs).

Key Insights and Ideas

  • Extreme Speed-to-Value: QTT-SEG achieves roughly 97.3% of its final performance within just 60 seconds of tuning. Meta-features and historical learning curves allow the optimizer to jump immediately to near-optimal hyperparameter regions without exhaustive trial-and-error.
  • Escaping Early Plateaus: QTT-SEG showed higher relative gains between 120s and 180s (+1.97%) than between 60s and 120s (+0.95%) on binary tasks, indicating that multi-fidelity meta-predictors help the system refine promising configurations rather than getting trapped in early local optima.
  • Low Variance Across Seeds: Fine-tuning runs demonstrated small standard deviations across random seeds, showing that meta-guided optimization yields stable adaptation even on tiny 100-image sample budgets.

Key Results

All experiments ran on a single NVIDIA GeForce RTX 2080 Ti (11 GB VRAM) under 60s, 120s, and 180s budgets:

  • Binary Segmentation:
  • Zero-shot SAM baseline: 0.402 mean IoU.
  • AutoGluon Multimodal: 0.499 (60s), 0.595 (120s), 0.627 (180s).
  • QTT-SEG: 0.660 (60s), 0.661 (120s), 0.674 (180s).
  • QTT-SEG outperformed AutoGluon on 6 of the 8 binary datasets at 180 seconds.
  • Multiclass Segmentation:
  • Zero-shot SAM baseline: 0.299 mean IoU.
  • QTT-SEG: 0.536 (60s), 0.546 (120s), 0.554 (180s) — an 85.28% average relative improvement over zero-shot.
  • Overall: Across all 13 tasks, QTT-SEG delivered an average 76.47% IoU boost over zero-shot SAM at 180 seconds.

Limitations and Future Work

  • Competitor Gaps: AutoGluon still surpassed QTT-SEG on two binary datasets (chest and eyes), suggesting certain modalities benefit from alternative training strategies or architectures.
  • Prompt Dependency: Evaluation relied exclusively on perturbed bounding box prompts; point-based prompts or text-prompted segmentation were not explored.
  • Future Directions: The authors plan to incorporate richer domain knowledge into meta-features and expand the search space to cover additional parameter-efficient fine-tuning architectures and loss formulations.

Summary updated

BibTeX
@inproceedings{das2025quickly,
  author = {Breenda Das and Lennart Purucker and Timur Carstensen and Frank Hutter},
  title = {{Quickly Tuning Foundation Models for Image Segmentation}},
  booktitle = {AutoML Non-Archival Content Track},
  year = {2025},
  url = {https://openreview.net/forum?id=zPz2fkPuRe},
}

Loading related content...

Figure