atlas

Research map / Architectures and efficiency / Pruning and efficient tuning

BA-SAM: Scalable Bias-Mode Attention Mask for Segment Anything Model

CVPR 2024 · Architectures and efficiency › Pruning and efficient tuning · approach: Low-rank compression and merging · 20 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes BA-SAM, a training-light modification to SAM's attention (a length-dependent scaling factor plus a distance-based additive bias) that reduces performance degradation when inference image resolution differs from the 1024 training resolution.

Problem

SAM's performance degrades when applied to images whose resolution differs from its 1024x1024 pretraining size, and prior fixes (resizing, patch-size changes, retraining) are costly or erase SAM's prior knowledge.

Approach

Reframes resolution variation as length extrapolation: a new scaling factor log_{N_train}(N_test)/sqrt(d_k) keeps attention entropy stable as token count grows, and a bias beta*|i-j| added to query-key scores penalizes distant tokens, both added without changing SAM's architecture.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add the new scaling factor and bias-mode attention maskMobileSAM · ISICMAE: 0.059 -> 0.053Helped
Add the new scaling factor and bias-mode attention maskMobileSAM · DUTSMAE: 0.034 -> 0.031Helped
Add the new scaling factor and bias-mode attention maskMobileSAM · DIS-TE4MAE: 0.057 -> 0.055Helped
Add the new scaling factor and bias-mode attention maskMobileSAM · COD10KMAE: 0.030 -> 0.029Helped
Add the new scaling factor and bias-mode attention maskSAM · COCOAP: 42.5 -> 43.0Helped
Add the new scaling factor and bias-mode attention maskMobileSAM · COCOAP: 40.8 -> 41.2Helped
Add the new scaling factor (ablation)MobileSAM · ISIC, zero-shot, resolution variationperformance degradation (∆diff): 17.8 -> 16.4Helped
Add the bias-mode attention mask (ablation)MobileSAM · ISIC, zero-shot, resolution variationperformance degradation (∆diff): 17.8 -> 16.8Helped
Add the new scaling factor (ablation)MobileSAM · DUTS, zero-shot, resolution variationperformance degradation (∆diff): 6.5 -> 7.5Hurt
Add the bias-mode attention mask (ablation)MobileSAM · DUTS, zero-shot, resolution variationperformance degradation (∆diff): 6.5 -> 7.2Hurt
Add the new scaling factor (ablation)MobileSAM · ISIC, fine-tuned at 1024performance degradation (∆diff): 42.2 -> 40.9Helped
Add the bias-mode attention mask (ablation)MobileSAM · ISIC, fine-tuned at 1024performance degradation (∆diff): 42.2 -> 41.2Helped

Surprising findings

Limitations

Experimental setup

Datasets: DUTS DIS5K ISIC COD10K COCO

Benchmarks: DUTS DIS-TE4 ISIC COD10K COCO

Metrics: MAE AP

Baselines: SAM MobileSAM MSA FlexiViT CASS VST IS-Net SINet

Builds on: Segment Anything Model MobileSAM scaled dot-product attention ALiBi

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy