๐ VL-SAM: Training-Free Open-Ended Object Detection & Segmentation
๐ VL-SAM: Training-Free Open-Ended Object Detection & Segmentation
- Title: Training-Free Open-Ended Object Detection and Segmentation via Attention as Prompts
- Conference: NeurIPS 2024
- Keywords:
Open-Ended Detection
,Segmentation
,SAM
,VLM
,Attention Map
,Training-Free
- Summary: By linking the attention map of a Vision-Language Model (VLM) to the prompt of Segment Anything Model (SAM), VL-SAM enables simultaneous detection and segmentation of unseen objects without additional training!
๐ VL-SAM Key Summary
One-liner: โNo labels, no training โ just use VLM attention as prompts for SAM to detect and segment objects!โ
1) Training-Free Open-Ended Framework
- Combines VLM + SAM without extra training
- Uses attention map as prompts (goes beyond Open-set: unlike open-set methods that require the category word, this does not!)
2) Attention Map Aggregation & Flow
- Aggregates multi-head, multi-layer attention from VLM for high-quality maps
- Mitigates collapse due to causal mask with regularized attention flow
3) Prompt Generation & Iterative Refinement
- Samples positive/negative points from attention
- Feeds into SAM, then iteratively refines with feedback
4) Generalization & Modularity
- Applicable to various VLMs (MiniGPT-4, LLaVA, etc.) and SAM variants (MobileSAM, etc.)
๐ Background
๐ Vision-Language Models (VLMs)
- Beyond GPT-3, LLaMA โ emergence of VLMs:
- BLIP-2: Q-Former module / aligns image-text embeddings with multiple pretraining losses
- LLaMA-Adapter / LLaVA / MiniGPT: adapters or projection layers / aligns vision features into LLM space / combines large LLM with vision
- CogVLM: introduces Visual Expert Modules / converts image features at transformer-head level
- SPHINX: supports multi-vision tasks with various mixing techniques
- CogAgent / LLaVA-Phi: defines VLMs as agents / supports multi-step reasoning / interactive and tool-use tasks
- GPT-4V: strong generalization, handles corner cases and complex real-world scenarios
- BUT: Localization ability is still weaker than models like SAM.
โ Hence, combining VLM and SAM in a training-free way to show segmentation capability!
- Extra note (Preliminaries):
- Segment Anything Model (SAM): bbox/point prompt-based segmentation model, composed of image encoder, prompt encoder, mask decoder.
- AR-based VLMs: Auto-Regressive, i.e., Transformer decoders with next-token prediction (e.g., GPT-4V, Qwen2.5VL).
Object Detection Paradigms
- Open-Set: With CLIP, but still requires predefined categories (e.g., GLIP, GroundingDINO, SWORD, YOLO-World).
- Open-Ended: Predict both object name + location with no predefined categories. GenerateU pioneered this, followed by DetCLIPv3. But requires large training data.
- โ VL-SAM: First training-free open-ended detection + segmentation.
๐งฑ VL-SAM Architecture
- Connects VLM (object recognition) with SAM (object localization).
- [object recognition] Input image โ VLM detects objects and produces attention map.
- [object localization] Attention map โ converted into point prompts for SAM โ segmentation masks.
1) [object recognition] - Attention Map Generation (VLM)
- Core idea: build SAM prompts directly from VLM attention!
a. Ask VLM to list all objects (Tag2Text-like object list extraction)
b. Save Q/K for all layers & heads during token generation
c. Compute (Q \times K^T), apply causal mask, Softmax โ similarity matrix S
d. Compute head-layer weights (W = \text{Mean}(\max(S, \text{dim}=1), \text{dim}=0))
e. Apply W to S, get corrected (Sโ)
f. Aggregate across layers โ final attention flow
g. Regularize attention flow (to prevent collapse in AR-based VLMs)
Finally: attention map is ready!
2) [object localization] - SAM Prompt Generation
- Extract positive/negative points from attention map
- Positive: top values above threshold
- Negative: low values outside positive regions
- Run SAM once, then refine by re-sampling points from the first result
- Aggregate masks with NMS
3) Ensembles for Accuracy
- Sub-image tiling for small objects
- Multiple prompts: ask VLM multiple times and ensemble results
๐ง Evaluation & Results
- CogVLM-17B + SAM (ViT-H)
- Zero-shot evaluation on LVIS, CODA
- For open-ended eval: embed generated object names with CLIP and match with dataset labels
๐ฏ LVIS
- +3.4 APrare over GenerateU
- Produces segmentation masks simultaneously, though not as strong as Mask R-CNN
๐ฏ CODA (corner-case detection)
- Achieves 40.1 mAR (vs 18.4 mAR for LLaVA-Grounding)
- 74.1% of Oracle SAM upper bound (54.1 mAR)
๐ฏ Ablation Study
- Each component (attention generation, prompt sampling, iterative refinement, multi-scale/question ensemble) contributes
- Without regularized attention flow โ collapse
- Prompt sampling strategy improves segmentation quality
- Multi-scale + question ensemble maximizes corner-case detection
โ Conclusion
- VL-SAM: first training-free open-ended detection + segmentation framework
- Innovative design: connect VLM attention โ SAM prompts
- Enables label-free, training-free recognition, with potential applications in autonomous driving, robotics, safety-critical systems
(Appendix) Easy Example of Computing W โ ๐งฎ N=3 (cat, dog, truck)
Equation (1):
( W = \text{Mean}(\max(S, \text{dim}=1), \text{dim}=0) )
- ( S \in \mathbb{R}^{N \times N \times H \times L} )
- Here, we show a single head h in a single layer l: ( S^{h,l} \in \mathbb{R}^{N \times N} )
1) Single Head h, Single Layer l Example
Tokens: cat(1), dog(2), truck(3) โ N=3
Similarity matrix (S^{h,l}):
(a) Max(S, dim=1)
- cat row: 0.70
- dog row: 0.60
- truck row: 0.60
(b) Mean of those values
\(W_{h,l} = \frac{0.70 + 0.60 + 0.60}{3} = \mathbf{0.6333}\)
2) Same Layer l with Head 2 (H=2)
Example ( S^{h2,l} ):
\[S^{h2,l} = \begin{bmatrix} 0.40 & 0.30 & 0.30 \\ 0.35 & 0.35 & 0.30 \\ 0.34 & 0.33 & 0.33 \end{bmatrix}\]- Max by row โ [0.40, 0.35, 0.34]
- Mean โ ( W_{h2,l} = 0.3633 )
So within layer l:
- Head 1: (W_{h1,l} = 0.6333)
- Head 2: (W_{h2,l} = 0.3633)
โ Head 1 is more โusefulโ and weighted higher.
3) Overall Shape & Broadcasting
Across all heads/layers:
\(W \in \mathbb{R}^{1 \times 1 \times H \times L}\)Next step (Equation 2):
\(S' = \text{Mean}(S \odot W, \text{dim}=2)\)
4) Takeaway
- Row-wise max (over Keys) = how strongly each Query focuses
- Mean over Queries = headโs overall importance (W_{h,l})
- Apply W then average over heads = emphasizes good heads, yielding higher-quality (Sโ)
๐ (ํ๊ตญ์ด) VL-SAM: ํ์ต ์์ด Open-Ended ๊ฐ์ฒด ํ์งยท๋ถํ ๊น์ง!
- ์ ๋ชฉ: Training-Free Open-Ended Object Detection and Segmentation via Attention as Prompts
- ํํ: NeurIPS 2024
- ํต์ฌ ํค์๋:
Open-Ended Detection
,Segmentation
,SAM
,VLM
,Attention Map
,Training-Free
- ์์ฝ: Vision-Language Model(VLM)์ attention map์ Segment Anything Model(SAM)์ prompt๋ก ์ฐ๊ฒฐํด, ์ถ๊ฐ ํ์ต ์์ด unseen ๊ฐ์ฒด ํ์ง์ ๋ถํ ์ ๋์์ ์ํ!
๐ VL-SAM ํต์ฌ ์์ฝ
ํ ์ค ์์ฝ: โ๋ผ๋ฒจ๋, ํ์ต๋ ํ์ ์์ด, VLM์ attention์ผ๋ก SAM์ ๋ถ๋ฌ ๊ฐ์ฒด๋ฅผ ์ฐพ์๋ธ๋ค!โ
1) Training-Free Open-Ended Framework
- ์ถ๊ฐ ํ์ต ์์ด VLM + SAM ์กฐํฉ
- attention map์ prompt๋ก ํ์ฉํด prompt ์์ฑ!! (Open-set๋ณด๋ค ๋ฐ์ - Openset์ ๋จ์ด๋ฅผ ์ ๊ณตํด์ผํ์ง๋ง ์ผ๋ ๊ทธ๊ฒ๋ ํ์์๋ค!)
2) Attention Map Aggregation & Flow
- VLM์ multi-head, multi-layer attention์ ๋ชจ์ ๊ณ ํ์ง ๋งต ์์ฑ
- causal mask๋ก ์ธํ collapse ๋ฌธ์ ๋ฅผ regularized attention flow๋ก ์ํ
3) Prompt Generation & Iterative Refinement
- attention์์ positive/negative point ์ํ๋ง
- SAM์ ์ ๋ ฅ ํ ๊ฒฐ๊ณผ๋ฅผ ๋ค์ feedbackํ์ฌ ์ ์ง์ ์ฑ๋ฅ ํฅ์
4) Generalization & Modularity
- ๋ค์ํ VLM(MiniGPT-4, LLaVA ๋ฑ) ๋ฐ SAM ๋ณํ(MobileSAM ๋ฑ)์ ์ ์ฉ ๊ฐ๋ฅ
๐ ๊ธฐ์กด ์ฐ๊ตฌ์ ํ๋ฆ
๐ VLM - Vision-Language Model
- GPT-3, LLaMA ๋ฑ์ LLM์ ๋์ด Vision Language Model ๋ค์ด ๋์ด!!
- BLIP-2**: Q-Former ๋ชจ๋ ๋์ / ์ด๋ฏธ์งยทํ ์คํธ ์๋ฒ ๋ฉ ์ฐ๊ฒฐ ๋ฐ ์ตํฉ / ์ธ ๊ฐ์ง alignment pretrain loss ์ฌ์ฉ
- LLaMA-Adapter / LLaVA / MiniGPT**: ์ด๋ํฐ(๋๋ projection layer) ํ์ฉ / ์ด๋ฏธ์ง ํผ์ฒ๋ฅผ ํ ์คํธ ์๋ฒ ๋ฉ ๊ณต๊ฐ์ ์ ๋ ฌ / ๋๊ท๋ชจ LLM๊ณผ ๋น์ ๋ชจ๋ฌ ๊ฒฐํฉ
- CogVLM**: Visual Expert Modules ๋์ / ์ด๋ฏธ์ง ํผ์ฒ๋ฅผ transformer head ๋จ์๋ก ๋ณํยท์ ๋ ฌ / head๋ณ ์ธ๋ถํ๋ ๋งคํ ์ ๊ณต
- SPHINX**: ๋ค์ค ์๊ฐ ์์ ์ง์ / ์ฌ๋ฌ mixing ๊ธฐ๋ฒ ํ์ฉ / ๋ค์ํ ํ์คํฌ์ ๋ฒ์ฉ ์ ์ฉ ๊ฐ๋ฅ
- CogAgent / LLaVA-Phi**: VLM์ ์์ด์ ํธ(assistant)๋ก ์ ์ / ๋ฉํฐ์คํ reasoning ์ํ / ๋ํํยท๋๊ตฌ ์ฌ์ฉ ๊ธฐ๋ฐ ์์ ์ฒ๋ฆฌ
- GPT-4V**: ๊ฐ๋ ฅํ ๋ฒ์ฉํ ๋ฅ๋ ฅ / ์๋ก์ดยทํฌ๊ท ์ํฉ(corner case) ์ดํด ๋ฐ ์ถ๋ก ๊ฐ๋ฅ / ์์จ์ฃผํ ๋ฑ ๋ณต์กํ ์ค์ ์๋๋ฆฌ์ค ์ฒ๋ฆฌ ๊ฐ๋ฅ
- ํ์ง๋ง!! Localization ์ญ๋์ SAM ๊ฐ์ ๋ชฉ์ ์ ๋ง๋ ๋ชจ๋ธ์ ๋นํด ์ฑ๋ฅ์ด ๋จ์ด์ง!
๊ทธ๋์!! ๋ ๋ชจ๋ธ Training Free๋ก ์ฐ๊ฒฐํ๋ฉฐ segmentation ๋ฅ๋ ฅ์ ๋ณด์ฌ์ฃผ๊ณ ์ํจ!
- ๋ ์์๋ ์ฌํญ!!(Preliminary)
- Segment Anything Model!!?
- SAM์ด ๋ํ์ ์ด๋ฉฐ SAM์ด ์์ด๋์ด๋ฅผ ์ป์ MaskDINO๋ ์์! ใ
- bbox, point prompt ๊ธฐ๋ฐ์ Segmentation ๋ชจ๋ธ!!
- 3๊ฐ์ ์ฃผ์ ์์๋ก ๊ตฌ์ฑ๋จ : ์ด๋ฏธ์ง ์ธ์ฝ๋, ํ๋กฌํฌํธ ์ธ์ฝ๋, ๋ง์คํฌ ๋์ฝ๋
- ์ด๋ฏธ์ง ์ธ์ฝ๋ฉ & ํ๋กฌํฌํธ ํ ํฐ & ์ด๊ธฐํ ๋ง์คํฌ ํ ํฐ์ ๋ง์คํฌ ๋์ฝ๋์ ๋ฃ์ด์!! ์ต์ ์ mask token์ ๋ง๋ค๊ณ , ์ด mask token์ผ๋ก ์ฌ๋ฌ mask๋ฅผ ๋ง๋ฌ
- Auto-Regressive Based Vision-Language Model!!
- VLM์ AR-based์ non-AR๋ก ๋๋จ!
- AR-based (Auto-Regressive base)๋ ๋ฌด์์ธ๊ฐ!? = Transformer decoder๊ฐ next-token prediction์ผ๋ก ๋์ํ๋ ๊ตฌ์กฐ๋ฅผ ์๋ฏธ!
- ๋ค์ token์ predict ํ๋, decoding์ ์ค์ ์ผ๋ก ์์ฐ์ด ํ ์คํธ ์์ฑ์ ํจ! GPT-4V, Qwen2.5VL๋ฑ ์ฐ๋ฆฌ๊ฐ ์๊ณ ์๋ VLM์ด ์ฌ๊ธฐํด๋น!
- image encoder, text tokenizer, projection layers, language decoder๋ก ๊ตฌ์ฑ๋จ!
- ์ด๋ฏธ์ง์ ํ ์คํธ๋ฅผ ๋ฐ์ผ๋ฉด, ๊ฐ๊ฐ์ ์ธ์ฝ๋๋ฅผ ํตํด ํ ํฐ์ ๋ฐ๊ณ , projection layers ๋ก ์ด๋ฏธ์ง์ ํ ์คํธ๋ฅผ ์ ๋ ฌํ๊ณ ๋์ฝ๋๋ก ๊ฐ์ output์ ์์ฑํ๋ค!!
- ๋ฐ๋ฉด non-AR์ โํ
์คํธ ์์ฑโ๋ณด๋ค๋ ๋ถ๋ฅ/์ ๋ ฌ/๋งค์นญ ์ค์ฌ, autoregressive LM ๋์ฝ๋๊ฐ ํต์ฌ์ด ์๋๋ค!
- ํ ์คํธ ์์ฑ์ธ์ ๋ถ๋ฅ(CLIP), Mask ์์ฑ(SAM) ๋ฑ์ ๊ฐ์ ์ ๊ฐ์ง!
๊ฐ์ฑ ํ์ง (Object Detection)
- Open-Set ๋ฐฉ๋ฒ: CLIP ๋ชจ๋ธ ๋๋ถ์ Open-set์ผ๋ก ๋ฐ์ ํ์ง๋ง, ์ด ์ญ์๋ ์ฌ์ ์ ํ์งํ ๊ฐ์ฑ์ ๋ํ ์ ์ ํ์ โ ํ๊ณ
- ์ฌ๊ธฐ์ ์ธ๊ธํ Open-Set ๋ฐฉ๋ฒ์? GLIP, GroundingDINO, SWORD, YOLO-World
- Open-Ended ๋ฐฉ๋ฒ: ์ฌ์ ์นดํ
๊ณ ๋ฆฌ ์์ด ๊ฐ์ฒด ์ด๋ฆ+์์น ๋์ ์์ธก
- GenerateU๊ฐ ์ฒซ Open-ended problem. ๋ํ DetCLIPv3v ๋ฑ!!
- ํ์ง๋ง ๊ธฐ์กด open-ended ๋ชจ๋ธ์ ๋๊ท๋ชจ ํ์ต ๋ฐ์ดํฐ/ํ์ธํ๋ ํ์
- โ VL-SAM์ ํ์ต ์๋(training-free) open-ended ํ์ง+๋ถํ ์ต์ด ์ ์!
๐งฑ VL-SAM ๊ตฌ์กฐ (Architecture)
- VLM์ SAM์ ๊ฐ๊ฐ object recognition, object localization ๋ชจ๋ธ๋ก์ ์๋ก ์ฐ๊ฒฐํ๋ค!
- [object recognition]์ด๋ฏธ์ง ์ธํ์ด ๋ค์ด์ค๋ฉด, VLM์ด ์ด๋ฏธ์ง ๋ด์ ๊ฐ์ฑ๋ฅผ ํ์งํ๊ณ !, attention generation module๋ก attention map์ ๋ง๋ ๋ค.
- [object localization] attention map์ ๋ฐํ์ผ๋ก point ptompt๋ฅผ ๋ง๋ค๊ณ , SAM์ผ๋ก ๋ณด๋ด์ segmentation ํ๋ค!!
1) [object recognition] - Attention Map Generation (VLM)
- ์ฌ๊ธฐ๊ฐ VL-SAM์ ํต์ฌ ์์ด๋์ด๋ก!! SAM์ ๋ฃ์ Object prompt๋ฅผ ๋ง๋๋ ๋ถ๋ถ!!
a. ์ฐ์ image๋ฅผ ๊ธฐ๋ฐ์ผ๋ก VLM์๊ฒ ๋ชจ๋ ๊ฐ์ฑ๋ฅผ ๋์ดํ๋ผ๊ณ ํจ!, ๋์ด๋๊ฒ์์ Tag2Text ๊ธฐ๋ฒ์ผ๋ก object list ํ๋ณด
b. ํ ํฐ ์์ฑ์์, ๋ชจ๋ ๋ ์ด์ด์, ๋ชจ๋ head์ query(Q), key(K) ์ ๋ํ์ฌ ์ ์ฅํด๋ . ์ถ์ถ๋ ๊ฐ์ฑ๋ค์ Q, K๋ฅผ ๋ถ๋ฌ์์, c. ์ ์ฅ๋ Q, K๋ฅผ(๋ง์. Layer ์ X Head ์) Q ร Kแต ์ฐ์ฐ ํ ๋ค์ causal mask๋ฅผ ์ ์ฉ, SoftMax ๋ก ํ์คํํด์ similarity matrix(S) ๋ฅผ ๊ตฌํจ
d. ๋ชจ๋ ๋ ์ด์ด์, ๋ชจ๋ head์ ๊ฐ์ค์น๊ฐ ๋ค๋ฅด๊ธฐ์ ๊ฐ๊ฐ์ ๊ฐ์ค์น W๋ฅผ ๊ตฌํจ- ๊ตฌํ๋ ๋ฐฉ๋ฒ์ W = Mean(Max(S, dim = 1), dim = 0).
- ์ฌ์ด ์์! (๋งจ ๋ค์!)
e. ๊ตฌํด์ง ๊ฐ์ค์น W๋ S๋ก ๋ณด์ ๋ Sโฒ ์ฐ์ถ!
f. Layer๋ง๋ค ์ฐ์ถ๋ Sโฒ๋ฅผ ๋ฐํ์ผ๋ก ์ต์ข attention flow์ฐ์ถ!
g. ๊ทธ๋ Sโฒ์ ๊ทธ๋ฅ ๋ค ๊ณฑํ๋ฉด AR-VLM์ ํน์ฑ (Auto-Regressive ๋ชจ๋ธ์ causal mask ์ ์ฉ๋จ) ์ collapse(์ผ์ชฝ ์๋จ์ ๋ชจ์ด๋ ๋ฌธ์ )๊ฐ ๋ฐ์ํ๊ฒ๋๊ณ ! ๊ทธ๋์ ์ด๋ฅผ ๋ง๊ณ ์ Regularized attention flow column๋ฅผ ์ฌ์ฉ!!(์ผ์ชฝ ์์ ์๋ attention ๊ฐ๋ค์ ์ธ์์ ์ผ๋ก ์ค์ฌ์ค์ค)
Finally. ์ต์ข ์ ์ผ๋ก attention map์ด ๋ง๋ค์ด์ง!!!
2) [object localization] - SAM Prompt Generation
- ์ ๋จ๊ณ์์ ๋ง๋ค์ด์ง attention map์์ positive&negative point๋ฅผ ์ถ์ถํด์ SAM ํ ๊ฒ์
- ๊ทธ๋ฐ๋ฐ, attention map์ด ์๋ฒฝํ์ง๋ง์ ์๊ธฐ์, ํํฐ๋ง์ด ํ์!
- positive area : ์๊ณ๊ฐ์ ๋๊ณ ๊ทธ๊ฒ๋ณด๋ค ํฐ ์์ญ, ๊ทธ์ค์์๋ ์ ์ผ ํฐ ๊ฐ์ positive point
- negative area : positive area ์ธ์ ์์ต, ๊ทธ์ค ์ ์ผ ์์ ๊ฐ์ negative point
- ๋ํ SAM ๊ฒฐ๊ณผ๊ฐ ์ก์์ด ๋ง์ ์ ์์ด 2๋ฒ ๋ฐ๋ณตํด์ ์งํํจ!
- ์ฒซ๋ฒ์งธ๋ก๋ PerSAM ์ฒ๋ผ, point ์์ผ๋ก segmentation mask ์ฌ๋ฌ๋ฒ ์์ฑ
- ๋๋ฒ์จฐ๋ก๋ ์ฒซ๋ฒ์จฐ์ ๊ฒฐ๊ณผ๋ฅผ attention map์ผ๋ก ๋ค์ํ๋ฒ ๋ง์คํฌํ๊ณ positive/negative point ์์ ์๋ก ์ถ์ถ, ์ฌ๋ฌ๋ฒ SAM์ ํด์ ๊ฐ์ ํ๊ณ
- ๋ง์ง๋ง์ผ๋ก ์ด ๊ฒฐ๊ณผ๋ค์ NMS ๋ฐฉ๋ฒ์ผ๋ก ์ง๊ณ
3) Ensembles - ์ ํํ ๋ต์ ์ํด!!
- ํด์๋ ๋ฎ์ ์ด๋ฏธ์ง์ ์์ ๋ถ๋ถ์ ๋ชป ์ก์์ ์์ด!
- ๊ทธ๋์ sub image๋ก ์ชผ๊ฐ์ ๊ฐ๊ฐ VL-SAM ์์ ํด!!
- ํ๋กฌํฌํธ์ ์๋ฏผํ๋ฐ?
- ๊ทธ๋์ VLM์ ๋ฌผ์ด๋ด์ 10๊ฐ ํ๋กฌํฌํธ ๋ฐ๊ณ , 10๊ฐ ํ๋กฌํฌํธ ๊ฒฐ๊ณผ๋ฅผ ๋ชจ๋ ํฉ์ณ~
๐ง ์ค์ ์ํ๋ฐฉ๋ฒ(Training Recipe) ๋ฐ ๊ฒฐ๊ณผ!
- CogVLM-17B + SAM(ViT-Huge) ์กฐํฉ์ ๋ชจ๋ธ์ ํ์ฉ!
- CogVLM-17B ์ EVA2-CLIP-E (๋น์ ) + Vicuna (์ธ์ด)์ ๊ตฌ์กฐ
- Zero-shot ๋ฐฉ์์ผ๋ก LVIS, CODA ๋ฑ ๋ฐ์ดํฐ์ ํ๊ฐ
- open-ended์ด๊ธฐ์ ๋ชจ๋ธ์ด ์์ฑํ ์์ ๋ก์ด ๊ฐ์ฒด๋ช (open-vocab)์ CLIP ํ ์คํธ ์ธ์ฝ๋๋ก ์๋ฒ ๋ฉํ ๋ค, ๋ฐ์ดํฐ์ ์ ์ ํด์ง ๋ผ๋ฒจ๋ค๊ณผ ๋งค์นญํด์ ํ๊ฐ
๐ฏ LVIS (long-tail segmentation)
- ๊ธฐ์กด open-ended ๋ฐฉ๋ฒ GenerateU ๋๋น +3.4 APrare ํฅ์
- segmentation mask๊น์ง ๋์์ ์ ๊ณต, ๋ค๋ง Mask R-CNN๋งํผ์ ์ฑ๋ฅ์ ์๋์ด์ด
๐ฏ CODA (corner-case detection, ์์จ์ฃผํ)
- 40.1 mAR ๋ฌ์ฑ (๊ธฐ์กด LLaVA-Grounding: 18.4 mAR)
- Oracle SAM upper bound(54.1 mAR)์ 74.1% ์์ค ์ฑ๋ฅ
๐ฏ Ablation Study
- Attention generation, prompt sampling, iterative refinement, multi-scale & question ensemble ๊ฐ๊ฐ ์ฑ๋ฅ ๊ฐ์ ๊ธฐ์ฌ
- Regularized attention flow ์์ ์ attention collapse ๋ฐ์
- Prompt sampling ์ ๋ต์ด segmentation ํ์ง ๊ฐ์
- Multi-scale + Question ensemble ์กฐํฉ ์ corner case ํ์ง ์ฑ๋ฅ ๊ทน๋ํ
โ ๊ฒฐ๋ก
- VL-SAM์ open-ended ๊ฐ์ฒด ํ์งยท๋ถํ ์ training-free๋ก ์ต์ด ๋ฌ์ฑ
- VLM์ attention์ SAM prompt๋ก ์ฐ๊ฒฐํ๋ ํ์ ์ ๊ตฌ์กฐ
- ๋ผ๋ฒจยทํ์ต ์๋ ๋ฒ์ฉ ์ธ์์ด ๊ฐ๋ฅํด, ์์จ์ฃผํ/๋ก๋ณดํฑ์ค/์์ -critical ์์คํ ๋ฑ ์์ฉ ๊ฐ๋ฅ์ฑ ํผ
(์ถ๊ฐ) W ๊ตฌํ๋ ์ฌ์ด ์์ - ๐งฎ N=3 (cat, dog, truck) ์์๋ก ๋ณด๋ Head๋ณ ์ค์๋ Weight W ๊ณ์ฐ
๋ฌธํ ์ (1):
W = Mean(Max(S, dim = 1), dim = 0)
- S โ โ^{N ร N ร H ร L} (N=ํ ํฐ ์, H=ํค๋ ์, L=๋ ์ด์ด ์)
- ์ฌ๊ธฐ์๋ ํ ๋ ์ด์ด(l ๊ณ ์ )์์ ํ ํค๋(h)๋ฅผ ๋จผ์ ์๋ก ๋ญ๋๋ค: S^{h,l} โ โ^{NรN}
1) ํ ๊ฐ Head(h), ํ ๊ฐ Layer(l)์์์ ์์
ํ ํฐ: cat(1), dog(2), truck(3) โ N=3
ํด๋น head์ similarity ํ๋ ฌ(= QรKแต ํ softmax ๊ฒฐ๊ณผ๋ผ๊ณ ์๊ฐ):
(a) Max(S, dim = 1) โ ์ด ๋ฐฉํฅ(Key j) ์ต๋๊ฐ
- Query(cat) ํ์ ์ต๋๊ฐ: max(0.70, 0.20, 0.10) = 0.70
- Query(dog) ํ์ ์ต๋๊ฐ: max(0.10, 0.60, 0.30) = 0.60
- Query(truck) ํ์ ์ต๋๊ฐ: max(0.15, 0.25, 0.60) = 0.60
(b) Mean(โฆ, dim = 0) โ ํ ๋ฐฉํฅ(Query i) ํ๊ท
\(W_{h,l} = \frac{0.70 + 0.60 + 0.60}{3} = \mathbf{0.6333}\)
- ์ด ๊ฐ W_{h,l} ๊ฐ โLayer l ์ Head h ์ค์๋(์ง์ค๋)โ์ ๋๋ค.
- ์ง๊ด: ๊ฐ Query๊ฐ ํ Key์ ์ผ๋ง๋ ๊ฐํ๊ฒ ์ง์คํ๋์ง๋ฅผ ํ๋ณ ์ต๋๊ฐ์ผ๋ก ๋ณด๊ณ , ๊ทธ๊ฑธ ๋ชจ๋ Query์ ๋ํด ํ๊ท ๋ด ํด๋น Head์ ๋ํ ์ง์ค๋๋ก ์ผ์.
2) ๊ฐ์ Layer(l)์ Head๊ฐ 2๊ฐ(H=2) ์๋ค๊ณ ๊ฐ์
๋ ๋ฒ์งธ head์ S^{h2,l} ์:
\[S^{h2,l} = \begin{bmatrix} 0.40 & 0.30 & 0.30 \\ 0.35 & 0.35 & 0.30 \\ 0.34 & 0.33 & 0.33 \end{bmatrix}\]- Max by row โ [0.40, 0.35, 0.34]
- Mean of those โ ( W_{h2,l} = (0.40 + 0.35 + 0.34)/3 = \mathbf{0.3633} )
๊ฒฐ๊ณผ์ ์ผ๋ก, ๊ฐ์ ๋ ์ด์ด l ์์์
- Head 1 ์ค์๋ (W_{h1,l} = 0.6333)
- Head 2 ์ค์๋ (W_{h2,l} = 0.3633)
โ Head 1์ด ๋ โ์ ์ฉํโ head๋ก ํ๋จ๋์ด ๊ฐ์ค์น๊ฐ ๋ ํผ.
3) ์ ์ฒด ๋ชจ์๊ณผ ๋ธ๋ก๋์บ์คํ
๋ชจ๋ head/๋ ์ด์ด์ ๋ํด ์ ๊ณ์ฐ์ ํ๋ฉด
\(W \in \mathbb{R}^{1 \times 1 \times H \times L}\)๋ค์ ๋จ๊ณ ์ (2): \(S' = \text{Mean}(S \odot W, \text{dim}=2)\)
- (S \odot W): head ์ฐจ์(H)์ ๋ํด ํฌ์ธํธ์์ด์ฆ ๊ณฑ (๋ธ๋ก๋์บ์คํ )
- ๊ทธ ํ head ์ถ ํ๊ท (dim=2) โ head-๊ฐ์ค ํตํฉ๋ (Sโ \in \mathbb{R}^{N \times N \times L})
4) ํ ์ค ์์ฝ
- ํ๋ณ ์ต๋๊ฐ(Max over Keys) = ๊ฐ Query๊ฐ ์ผ๋ง๋ ๊ฐํ๊ฒ ์ง์คํ๋
- ๊ทธ ์ต๋๊ฐ๋ค์ ํ๊ท (Mean over Queries) = ํด๋น Head์ ๋ํ ์ง์ค๋(W_{h,l})
- W๋ก ๊ฐ์ค ํ Head ํ๊ท โ ํ์ง ์ข์ Head์ ์ ๋ณด๋ฅผ ๋ ์ด๋ฆฐ Sโ ์์ฑ