TL;DR
The Segment Anything Model (SAM) is a powerhouse for image segmentation, but tiny, imperceptible adversarial perturbations can completely shatter its masks. Robuster SAM fixes this without retraining the entire model or wasting parameters: it uses adversarial attacks as a diagnostic probe to map which layers in SAM's image encoder are most vulnerable, then assigns larger Low-Rank Adaptation (LoRA) capacities to those "weak links" while keeping the original model frozen.
What Problem Does This Paper Address?
Foundation models like SAM excel at zero-shot segmentation—you give it an image and a prompt (like a bounding box), and it segments the object. However, SAM is notoriously fragile against white-box adversarial attacks, where an attacker with access to the model's gradients adds imperceptible noise that corrupts the output masks.
Standard adversarial training (AT)—training the model on worst-case adversarial examples—can defend against this, but applying it to SAM hits two walls:
- Compute cost: Updating hundreds of millions of parameters during iterative adversarial optimization is prohibitively expensive.
- Catastrophic forgetting: Full-model fine-tuning risks overwriting the general visual representations that make SAM work zero-shot across diverse domains.
LoRA (Low-Rank Adaptation) offers a neat workaround by freezing the pre-trained backbone and training only small, low-rank adapter matrices. Yet conventional LoRA assigns the exact same rank to every adapted layer. That implicitly assumes every layer is equally vulnerable to adversarial noise—an assumption that ignores how perturbations actually propagate through deep vision encoders.
Methods
Robuster SAM introduces Vulnerability-Aware LoRA (VA-LoRA) through a three-stage pipeline:
-
Model Vulnerability Profiling: Using a frozen SAM and a small profiling set, the authors generate adversarial examples and measure each encoder block's feature-loss contribution: $$a_l = |h_l(x_{\text{adv}})| \odot |\nabla_{h_l} \mathcal{L}_{\text{adv}}|$$ Intuitively, a feature matters most when it is both strongly activated and has a large gradient with respect to the adversarial segmentation loss. Aggregating this signal yields a scalar vulnerability score $v_l$ for each block.
-
Targeted Adaptation Allocation: Instead of a uniform rank, blocks with higher vulnerability scores ($v_l \ge \tau_B$) receive a higher LoRA rank ($r_{\text{high}}$), while less sensitive blocks receive a lower rank ($r_{\text{low}}$), all within a fixed trainable-parameter budget $B$. This layout is determined before fine-tuning and stays static.
- Adversarial Robustification: With SAM's original weights frozen, only the mixed-rank VA-LoRA adapters are optimized via min-max PGD adversarial training.
Datasets
- Training & Profiling: Disjoint subsets of SA-1B (e.g., 2,000 images for full-training comparisons; 1,000 images for residual allocation) and 64-image COCO cohorts for auxiliary diagnostics.
- Adversarial Evaluation: Validation sets of Pascal VOC2012, COCO2017, and ADE20K, tested against FGSM, PGD-3/5/50, CW, MI-FGSM, AutoAttack, SegPGD-50, and ClipMSE-50 (all $L_\infty$-bounded with $\epsilon = 8/255$).
- Clean Zero-Shot Evaluation (14 datasets): DOORS, LVIS, ZeroWaste-f, NDISPark, EgoHOS, Plittersdorf, BBBC038V1, ADE20K, VOC2012, Cityscapes, COCO2017, HRSOD-TE, CAMO, and BIG.
Key Insights and Ideas
- Vulnerability is heavily front-loaded—and backbone-dependent: Across SAM ViT-B, ViT-L, ViT-H, and SAM2.1 Hiera-B+, roughly 63–64% of the normalized vulnerability mass concentrates in the first half of the image encoder, though exact peak blocks vary by architecture.
- High-scoring blocks are causally critical: When the authors take a uniform-$r=8$ model and independently remove LoRA adapters from different depth groups, removing the top-scoring blocks (0–5) slashes PGD-5 IoU by 40.2 points while leaving clean IoU nearly untouched. Removing middle blocks (4–7) costs only 2.4 points.
- Where you put capacity matters as much as how much you use: At the exact same parameter budget, profile-guided mixed-rank LoRA consistently beats uniform-rank, random, and reverse-profile allocations.
Key Results
- White-box robustness: On COCO2017 under PGD-5, Robuster SAM achieves 67.8% IoU, compared to 20.6% for original SAM, 27.6% for ASAM, and 23.8% for RobustSAM/b. Under AutoAttack, it reaches 67.2% IoU (vs. 20.5% for SAM).
- Parameter efficiency: On COCO2017, VA-LoRA ($r=8\&16$, 2.51M trainable parameters) hits 67.77% PGD-5 IoU—a +12.28 point jump over uniform LoRA $r=16$ (55.49% IoU, 2.78M parameters) while using 9.7% fewer trainable parameters.
- Fixed-budget & adaptive attacks: At 1.98M parameters, profile-guided mixed-rank outperforms Uniform-r12, AdaLoRA, HyperAT, and GaRA-style across 50-step PGD (43.20% vs. 36.10% Uniform-r12), SegPGD-50 (28.70% vs. 22.40%), and ClipMSE-50 (20.40% vs. 13.20%).
- Clean zero-shot & black-box transfer: Robuster SAM maintains competitive clean box-prompt segmentation across all 14 datasets (averaging 79.2% and 78.8% mIoU across the two benchmark groups, vs. 76.7% and 75.8% for original SAM) and shows strong resistance to black-box transfer attacks.
Limitations and Future Work
The current implementation uses a simple two-tier rank allocation ($r_{\text{low}}$ and $r_{\text{high}}$) for clarity and efficiency. Exploring finer-grained rank levels or automatically learning the allocation granularity is left for future work.
Summary updated