VisionCraft๋ ์ฅ๋ฉด(Scene)์ ์๋ฏธ๋ก ์ ๋งฅ๋ฝ์ ์ดํดํ๊ณ ์ด๋ฅผ ์ด๋ฏธ์ง ๋ถ์ ๋ฐ ๊ฐ์ ๊ณผ์ ์ ๋ฐ์ํ๊ธฐ ์ํ Scene-Aware Computer Vision Framework์ด๋ค. ๊ธฐ์กด์ ์ด๋ฏธ์ง ๋ณด์ ์์คํ ์ ์ฃผ๋ก ๋ฐ๊ธฐ, ๋๋น, ์ ๋ช ๋์ ๊ฐ์ ์ ์์ค(low-level) ํต๊ณ๋์ ์์กดํ์ฌ ๋์ผํ ๋ณด์ ์ ๋ต์ ๋ชจ๋ ์ด๋ฏธ์ง์ ์ ์ฉํ๋ ๊ฒฝ์ฐ๊ฐ ๋ง๋ค. ๊ทธ๋ฌ๋ ์ค์ ํ๊ฒฝ์์๋ ๊ฐ์ ์์ค์ ๋ฐ๊ธฐ๋ ๋๋น๋ฅผ ๊ฐ์ง ์ด๋ฏธ์ง๋ผ๋ ์ฅ๋ฉด์ ์ข ๋ฅ์ ๋ฐ๋ผ ์๊ตฌ๋๋ ๋ณด์ ๋ฐฉ์์ด ๋ฌ๋ผ์ง ์ ์๋ค.
์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด VisionCraft๋ ์ด๋ฏธ์ง ํ์ง ๋ถ์(Image Quality Analysis), ์ฅ๋ฉด ๋ถ๋ฅ(Scene Classification), ๊ฐ์ฒด ๊ฒ์ถ(Object Detection), ์๋ฏธ๋ก ์ ๋ถํ (Semantic Segmentation)์ ํ๋์ ํตํฉ ํ์ดํ๋ผ์ธ์ผ๋ก ๊ฒฐํฉํ์๋ค. ์์คํ ์ ๋จ์ํ ๋ณด์ ๋ ์ด๋ฏธ์ง๋ฅผ ์ถ๋ ฅํ๋ ๋ฐ ๊ทธ์น์ง ์๊ณ , ์ด๋ฏธ์ง์ ํ์ง ์ํ์ ์ฅ๋ฉด ๊ตฌ์กฐ๋ฅผ ๋ถ์ํ์ฌ ์ ํน์ ๋ณด์ ์ด ํ์ํ์ง์ ๋ํ ์๊ฐ์ ยท์ ๋์ ๊ทผ๊ฑฐ๋ฅผ ํจ๊ป ์ ๊ณตํ๋ค.
๋ํ ๋ณธ ํ๋ก์ ํธ๋ ์์ฉ(Application) ๊ด์ ๋ฟ ์๋๋ผ ์ฐ๊ตฌ(Research) ๊ด์ ์ ์คํ๋ ํฌํจํ๋ค. ์ฐ๊ตฌ ํ์ดํ๋ผ์ธ์์๋ CLIP ๊ธฐ๋ฐ Text Embedding์ ResNet50 Scene Classifier์ Latent Space์ ์ฃผ์ ํ๋ Text-Guided Cross-Attention ๊ตฌ์กฐ๋ฅผ ์ ์ํ์์ผ๋ฉฐ, ์ถ๊ฐ์ ์ผ๋ก InfoNCE ๊ธฐ๋ฐ Contrastive Learning์ ์ ์ฉํ์ฌ Visual Representation๊ณผ Text Prototype ๊ฐ์ Alignment๋ฅผ ๊ฐํํ๋ ๋ฐฉ๋ฒ์ ํ๊ตฌํ์๋ค.
์คํ ๊ฒฐ๊ณผ, Text-Guided Cross-Attention ๋ชจ๋ธ์ Visual-Only Baseline ๋๋น Validation Accuracy๋ฅผ 59.79%์์ 60.56%๊น์ง ํฅ์์์ผฐ์ผ๋ฉฐ, ์ต์ข ์ ์ผ๋ก Text Cross-Attention + InfoNCE ๋ชจ๋ธ์ 60.75%์ Validation Accuracy๋ฅผ ๊ธฐ๋กํ์๋ค. ๋ํ UMAP, t-SNE, centroid cosine distance, prototype alignment, attention visualization์ ํตํด ํ ์คํธ ๊ธฐ๋ฐ ์๋ฏธ ์ ๋ณด๊ฐ Latent Representation์ ๋ณด๋ค ๊ตฌ์กฐ์ ์ด๊ณ ์๋ฏธ๋ก ์ ์ธ ๋ฐฉํฅ์ผ๋ก ์ฌ๊ตฌ์ฑํ๋ ํ์์ ํ์ธํ์๋ค.
๊ฒฐ๊ณผ์ ์ผ๋ก VisionCraft๋ Scene-Aware Image Enhancement๋ฅผ ์ํ ์ค์ฉ์ ์์คํ ์ธ ๋์์, Multimodal Representation Learning์ด Scene Classification์ ๋ฏธ์น๋ ์ํฅ์ ๋ถ์ํ๊ธฐ ์ํ ์ฐ๊ตฌ ํ๋ซํผ์ผ๋ก ํ์ฉ๋ ์ ์๋ค.
๊ธฐ์กด์ Image Processing Pipeline์ ๋๋ถ๋ถ Pixel-level Statistics์ ์์กดํด ์๋ค. ๋ฐ๊ธฐ(Brightness), ๋๋น(Contrast), ์ ๋ช ๋(Sharpness)์ ๊ฐ์ Low-level Feature๋ ์ด๋ฏธ์ง ํ์ง์ ํ๋จํ๋ ๋ฐ ์ค์ํ ์ญํ ์ ํ์ง๋ง, ์ค์ ์ฌ๋์ด ์ธ์งํ๋ ์ฅ๋ฉด(Scene)์ ์๋ฏธ์ ๋งฅ๋ฝ์ ์ถฉ๋ถํ ์ค๋ช ํ์ง๋ ๋ชปํ๋ค.
์๋ฅผ ๋ค์ด ์กฐ๋ช ์ด ๋ถ์กฑํ ์ค๋ด ๊ณต๊ฐ๊ณผ ํ๋ฆฐ ๋ ์ ํด๋ณ ํ๊ฒฝ์ ๋ชจ๋ ๋ ธ์ถ(Exposure) ๋ณด์ ์ด ํ์ํ ์ ์๋ค. ๊ทธ๋ฌ๋ ๋์ผํ ๋ณด์ ๊ณต์์ ๋ ์ด๋ฏธ์ง์ ์ผ๊ด์ ์ผ๋ก ์ ์ฉํ๋ ๊ฒ์ ์ถฉ๋ถํ ์ ์ ํ ํด๊ฒฐ์ฑ ์ด ์๋ ์ ์๋ค. ์ค๋ด ์ฌ์ง์์๋ ๊ฐ๊ตฌ ๊ตฌ์กฐ์ ์กฐ๋ช ๋ถํฌ๊ฐ ์ค์ํ๋ฉฐ, ์์ฐ ํ๊ฒฝ์์๋ ํ๋๊ณผ ์งํ์ ์์ฑ ๋๋น ๋ฐ ์ง๊ฐ(Texture)์ด ๋ ์ค์ํ ์์๊ฐ ๋๋ค.
์ฆ, ์ด๋ฏธ์ง๋ฅผ ๋จ์ํ ํฝ์ ์งํฉ์ผ๋ก ๋ฐ๋ผ๋ณด๋ ์ ๊ทผ์๋ ํ๊ณ๊ฐ ์์ผ๋ฉฐ, ๋ณด๋ค ํจ๊ณผ์ ์ธ ์ด๋ฏธ์ง ๋ถ์๊ณผ ๊ฐ์ ์ ์ํด์๋ ์ด๋ฏธ์ง๊ฐ ๋ด๊ณ ์๋ ์๋ฏธ๋ก ์ ๋งฅ๋ฝ(Semantic Context)์ ํจ๊ป ๊ณ ๋ คํด์ผ ํ๋ค.
VisionCraft๋ ์ด๋ฌํ ๋ฌธ์ ์์์์ ์ถ๋ฐํ์๋ค. ๋ณธ ํ๋ก์ ํธ์ ๋ชฉํ๋ ๋จ์ํ ์ด๋ฏธ์ง ๋ณด์ ์ ๋์ด, ์ด๋ฏธ์ง์ ์ฅ๋ฉด ๊ตฌ์กฐ์ ์๋ฏธ๋ฅผ ์ดํดํ๊ณ ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ๋ถ์ ๋ฐ ๊ฐ์ ๊ณผ์ ์ ๋ฐ์ํ๋ Scene-Aware Computer Vision Framework๋ฅผ ๊ตฌ์ถํ๋ ๊ฒ์ด๋ค.
Computer Vision ๋ถ์ผ์ ์ฃผ์ ๋์ ์ค ํ๋๋ ์๊ฐ์ ์ ์ฌ์ฑ(Visual Similarity)๊ณผ ์๋ฏธ์ ์ฐจ์ด(Semantic Difference) ์ฌ์ด์ ๊ฐ๊ทน์ด๋ค.
์๋ฅผ ๋ค์ด ๋ค์๊ณผ ๊ฐ์ ์ฅ๋ฉด๋ค์ ์๋ก ๋ค๋ฅธ ์๋ฏธ๋ฅผ ๊ฐ์ง์ง๋ง ์๊ฐ์ ์ผ๋ก ๋งค์ฐ ์ ์ฌํ ์ ์๋ค.
- restaurant_cafe โ kitchen_dining
- waterfront โ mountain_valley
- public_large_indoor โ corridor_lobby
- bedroom โ office_study
์ด๋ฌํ ํด๋์ค๋ค์ ๊ณตํต ๊ฐ์ฒด(Object), ์ ์ฌํ ์์ ๋ถํฌ(Color Distribution), ๋น์ทํ ๊ณต๊ฐ ๊ตฌ์กฐ(Spatial Layout)๋ฅผ ๊ณต์ ํ๊ธฐ ๋๋ฌธ์ ๋จ์ํ Visual Feature๋ง์ผ๋ก๋ ์์ ์ ์ธ ๋ถ๋ฅ ๊ฒฝ๊ณ๋ฅผ ํ์ฑํ๊ธฐ ์ด๋ ต๋ค.
๋ํ ๊ธฐ์กด ์ด๋ฏธ์ง ๊ฐ์ ์์คํ ์ญ์ ๋๋ถ๋ถ ์ฅ๋ฉด์ ์๋ฏธ๋ฅผ ๊ณ ๋ คํ์ง ์์ ์ฑ Brightness, Contrast, Blur์ ๊ฐ์ ๋ฌผ๋ฆฌ์ ์งํ์๋ง ๊ธฐ๋ฐํ์ฌ ๋์ํ๋ค. ๋ฐ๋ผ์ ์ด๋ฏธ์ง๊ฐ ์ค์ ๋ก ์ด๋ค ๊ณต๊ฐ์ธ์ง, ์ด๋ค ๊ฐ์ฒด๊ฐ ์ค์ํ์ง, ์ด๋ค ์์ญ์ด ๋ณด์กด๋์ด์ผ ํ๋์ง์ ๋ํ ์ดํด ์์ด ๋์ผํ ๋ณด์ ์ ๋ต์ด ์ ์ฉ๋๋ ๊ฒฝ์ฐ๊ฐ ๋ง๋ค.
๊ฒฐ๊ณผ์ ์ผ๋ก ๊ธฐ์กด ์ ๊ทผ ๋ฐฉ์์ ๋ค์๊ณผ ๊ฐ์ ํ๊ณ๋ฅผ ๊ฐ์ง๋ค.
- ์ฅ๋ฉด์ ์๋ฏธ๋ฅผ ๋ฐ์ํ์ง ๋ชปํจ
- ์๊ฐ์ ์ผ๋ก ์ ์ฌํ ํด๋์ค ๊ฐ ํผ๋ ๋ฐ์
- ๋ณด์ ๊ณผ์ ์ ์ค๋ช ๊ฐ๋ฅ์ฑ(Explainability) ๋ถ์กฑ
- ๊ฐ์ฒด์ ์์ญ์ ์ค์๋๋ฅผ ๊ณ ๋ คํ์ง ๋ชปํจ
VisionCraft๋ ์ด๋ฌํ ํ๊ณ๋ฅผ ์ํํ๊ธฐ ์ํด Low-level Image Analysis์ High-level Scene Understanding๋ฅผ ํ๋์ ํตํฉ ํ์ดํ๋ผ์ธ์ผ๋ก ๊ฒฐํฉํ์๋ค.
VisionCraft๋ ์ ๋ ฅ ์ด๋ฏธ์ง์ ๋ํด ๋จ์ํ ํ์ง ๋ถ์๋ง ์ํํ์ง ์๋๋ค. ์์คํ ์ Brightness, Blur, Edge Density, Dynamic Range์ ๊ฐ์ ๋ฌผ๋ฆฌ์ ์งํ๋ฅผ ๊ณ์ฐํ๋ ๋์์, Scene Classification, Object Detection, Semantic Segmentation์ ์ํํ์ฌ ์ด๋ฏธ์ง์ ๊ตฌ์กฐ์ ์๋ฏธ๋ฅผ ํจ๊ป ํด์ํ๋ค.
์ด๋ฅผ ํตํด ์์คํ ์ ๋จ์ผ ์ด๋ฏธ์ง๋ฅผ ์ ๋ ฅ๋ฐ์์ ๋ ๋ค์๊ณผ ๊ฐ์ ํต์ฌ ์ง๋ฌธ๋ค์ ๋ตํ๊ณ ์ ํ๋ค.
- ์ฅ๋ฉด ์ธ์ (Scene Identity) ์ด ์ด๋ฏธ์ง๋ ์ด๋ค ๊ณต๊ฐ์ ยท์ํฉ์ ๋งฅ๋ฝ์ ๊ฐ์ง๋๊ฐ?
- ํ์ง ์ง๋จ (Quality Diagnosis) ์๊ฐ์ ํ์ง ์ ํ์ ์์ธ์ ๋ฌด์์ธ๊ฐ?
- ์์ญ ๋ถ์ (Semantic ROI Analysis) ์ด๋ค ๊ฐ์ฒด์ ์์ญ์ด ๋ณด์กด๋๊ฑฐ๋ ๊ฐ์กฐ๋์ด์ผ ํ๋๊ฐ?
- ๋ฌธ๋งฅ ๊ธฐ๋ฐ ๋ณด์ (Context-aware Enhancement) ํ์ฌ ์ฅ๋ฉด์ ๊ฐ์ฅ ์ ํฉํ ๋ณด์ ์ ๋ต์ ๋ฌด์์ธ๊ฐ?
- ๋ชจ๋ธ ํด์ (Explainability) ๋ถ๋ฅ ๋ชจ๋ธ์ ์ด๋ค ์๊ฐ์ ๋จ์๋ฅผ ๊ทผ๊ฑฐ๋ก ํ์ฌ ์ฅ๋ฉด์ ํ๋จํ์๋๊ฐ?
์ด๋ฌํ ์ ๊ทผ์ ํตํด VisionCraft๋ ๋จ์ํ Filter Application Tool์ ๋์ด, ์ด๋ฏธ์ง ํ์ง ์ง๋จ, ์ฅ๋ฉด ์ดํด, ๊ฐ์ฒด ๋ถ์, ์๋ฏธ๋ก ์ ์์ญ ํด์, ์ฅ๋ฉด ๊ธฐ๋ฐ ๋ณด์ , ๊ทธ๋ฆฌ๊ณ ์ด๋ฅผ ํด์ํ๊ธฐ ์ํ ์๊ฐํ๊น์ง ํ๋์ ํ์ดํ๋ผ์ธ ์์์ ์ํํ๋ ํตํฉ์ ์ธ Computer Vision Framework๋ฅผ ์งํฅํ๋ค.
๋ณธ ํ๋ก์ ํธ์ ์ฃผ์ ๊ธฐ์ฌ์ ์ ๋ค์๊ณผ ๊ฐ๋ค.
-
์ ์์ค ์ด๋ฏธ์ง ํ์ง ๋ถ์๊ณผ ๊ณ ์์ค ์ฅ๋ฉด ์ดํด๋ฅผ ๊ฒฐํฉํ Scene-Aware Image Enhancement Pipeline์ ์ ์ํ์๋ค.
-
Brightness, Contrast, Blur, Exposure ๋ถ์๊ณผ Object Detection, Semantic Segmentation์ ํตํฉํ์ฌ ์ค๋ช ๊ฐ๋ฅํ(Explainable) ์ด๋ฏธ์ง ๋ถ์ ํ๋ ์์ํฌ๋ฅผ ๊ตฌ์ถํ์๋ค.
-
์ฌ์ฉ์๊ฐ ์ด๋ฏธ์ง ํ ์ฅ๋ง ์ ๋ก๋ํ๋ฉด ๋ถ์, ํด์, ๋ณด์ , ์๊ฐํ๋ฅผ ๋ชจ๋ ์ํํ ์ ์๋ ํตํฉํ Gradio Application์ ๊ตฌํํ์๋ค.
-
๊ฐ์ฒด ๊ฒ์ถ๊ณผ ์๋ฏธ๋ก ์ ๋ถํ ๊ฒฐ๊ณผ๋ฅผ ํ์ฉํ์ฌ Semantic-Aware Crop Recommendation ๋ฐ Region-Aware Enhancement ๊ธฐ๋ฅ์ ์ค๊ณํ์๋ค.
-
OCR, Perspective Rectification, Auto Straighten ๊ธฐ๋ฅ์ ํฌํจํ์ฌ ์ค์ ํ๊ฒฝ์์ ํ์ฉ ๊ฐ๋ฅํ ์ข ํฉ์ ์ธ Computer Vision Toolkit์ ๊ตฌ์ถํ์๋ค.
-
Places365 ๊ธฐ๋ฐ ์ฅ๋ฉด ๋ฐ์ดํฐ๋ฅผ ์ฌ๊ตฌ์ฑํ์ฌ Scene-Aware Enhancement์ ์ ํฉํ 14๊ฐ Scene Taxonomy๋ฅผ ์ค๊ณํ์๋ค.
-
CLIP ๊ธฐ๋ฐ Text Embedding์ ํ์ฉํ์ฌ ์ฅ๋ฉด ์๋ฏธ ์ ๋ณด๋ฅผ Latent Space์ ์ฃผ์ ํ๋ Text-Guided Cross-Attention Scene Classifier๋ฅผ ์ ์ํ์๋ค.
-
Visual Representation๊ณผ Class-Level Text Prototype์ Alignment๋ฅผ ๊ฐํํ๊ธฐ ์ํด InfoNCE ๊ธฐ๋ฐ Contrastive Learning ๊ธฐ๋ฒ์ ์ ์ฉํ์๋ค.
-
Accuracy ๋น๊ต๋ฅผ ๋์ด UMAP, t-SNE, Cosine Similarity, Prototype Alignment, Attention Map Visualization์ ํ์ฉํ Latent Space ๋ถ์์ ์ํํ์๋ค.
-
Text Prior๊ฐ Scene Classification ๊ณผ์ ์์ Semantic Smoothing ์ญํ ์ ์ํํจ์ ๊ด์ฐฐํ์์ผ๋ฉฐ, ์ด์ ๋ฐ๋ฅธ ์ฅ์ ๊ณผ Trade-off๋ฅผ ์ ๋์ ยท์ ์ฑ์ ์ผ๋ก ๋ถ์ํ์๋ค.
VisionCraft๋ ๋จ์ํ ์ด๋ฏธ์ง ๋ณด์ ์ ํ๋ฆฌ์ผ์ด์ ์ด ์๋๋ผ, ์ด๋ฏธ์ง ์ดํด(Image Understanding)์ ์ด๋ฏธ์ง ๊ฐ์ (Image Enhancement)์ ํตํฉ์ ์ผ๋ก ์ํํ๊ธฐ ์ํ Scene-Aware Computer Vision Framework์ด๋ค.
๋ณธ ํ๋ก์ ํธ๋ ํฌ๊ฒ ๋ ๊ฐ์ ์ํธ ๋ณด์์ ์ธ ํ์ดํ๋ผ์ธ์ผ๋ก ๊ตฌ์ฑ๋๋ค.
-
Application Pipeline
- ์ค์ ์ด๋ฏธ์ง ๋ถ์ ๋ฐ ๊ฐ์ ์ ์ํํ๋ ํตํฉํ Application System
-
Research Pipeline
- ์ฅ๋ฉด ๋ถ๋ฅ(Scene Classification) ๊ณผ์ ์์ ํ ์คํธ ์๋ฏธ ์ ๋ณด(Text Prior)๊ฐ Latent Representation์ ๋ฏธ์น๋ ์ํฅ์ ๋ถ์ํ๊ธฐ ์ํ ์ฐ๊ตฌ ํ๋ ์์ํฌ
Application Pipeline์ ์ฌ์ฉ์๊ฐ ์ ๋ก๋ํ ์ด๋ฏธ์ง๋ฅผ ๋ถ์ํ๊ณ ๊ฐ์ ํ๋ ๋ฐ ์ด์ ์ ๋ง์ถ๋ฉฐ, Research Pipeline์ Scene Classification ๋ชจ๋ธ์ ํํ ํ์ต(Representation Learning)์ ๋ถ์ํ๋ ๋ฐ ์ด์ ์ ๋๋ค.
flowchart TD
A[Input Image]
A --> B[Optional Preprocessing]
B --> B1[Auto Straighten / Tilt Correction]
B1 --> C[Low-level Quality Analysis]
C --> C1[Brightness / Contrast / Blur]
C --> C2[Exposure / Dynamic Range]
C --> C3[Edge Density / White Balance]
C --> D[Scene Understanding]
D --> D1[Scene Classification]
D --> D2[Object Detection]
D --> D3[Semantic Segmentation]
D --> E[Heuristic Aggregation & Analysis]
E --> E1[Crop Suggestion]
E --> E2[OCR / Perspective Rectification]
E --> E3[Quality Summary & Feedback]
E --> F[Traditional Enhancement]
F --> F1[White Balance / Gamma / CLAHE]
F --> F2[Sharpening / Denoise]
F --> F3[Region-aware Adjustment]
F --> G[Visualization & Report]
G --> G1[Analysis Report]
G --> G2[Detection / Segmentation Results]
G --> G3[Difference Heatmap / ORB Matching]
G --> G4[Enhanced Image & Recommended Crop]
๊ธฐ์กด์ ์ด๋ฏธ์ง ๋ณด์ ์์คํ ์ด ๋จ์ํ ํํฐ๋ฅผ ์ ์ฉํ๋ ๋ฐฉ์์ด์๋ค๋ฉด, VisionCraft๋ ์ ๋ ฅ ์ด๋ฏธ์ง๋ฅผ ๋จผ์ ๋ถ์ํ๊ณ (Analyze), ์ฅ๋ฉด์ ํด์ํ๋ฉฐ(Understand), ์ฌ๋ฌ ๋ชจ๋์ ๊ฒฐ๊ณผ๋ฅผ ์ข ํฉํ ๋ค(Integrate), ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํ์ผ๋ก ๋ณด์ ๊ณผ ์๊ฐํ๋ฅผ ์ํํ๋ค.
์ฆ, ๋ค์๊ณผ ๊ฐ์ process ๋งค์ปค๋์ฆ์ ๋ฐ๋ฅธ๋ค.
Input
โ
Analyze
โ
Understand
โ
Integrate
โ
Enhance
โ
Explain
์ด๋ฌํ ๊ตฌ์กฐ๋ฅผ ํตํด VisionCraft๋ ๋จ์ํ Pixel-level Processing์ ๋์ด, ์ฅ๋ฉด์ ์๋ฏธ๋ก ์ ๋งฅ๋ฝ(Semantic Context)์ ๋ฐ์ํ๋ Scene-Aware Computer Vision Framework๋ฅผ ์งํฅํ๋ค.
Application Pipeline์ ์ฌ์ฉ์๊ฐ ์ค์ ๋ก ์ฌ์ฉํ๋ ๋ฉ์ธ ์์คํ ์ด๋ค.
์ฌ์ฉ์๊ฐ ์ด๋ฏธ์ง๋ฅผ ์ ๋ก๋ํ๋ฉด ๋ค์ํ Computer Vision ๋ชจ๋๋ค์ด ์์ฐจ์ ์ผ๋ก ์คํ๋๋ฉฐ, ์ต์ข ์ ์ผ๋ก ๋ณด์ ๋ ์ด๋ฏธ์ง์ ๋ถ์ ๋ฆฌํฌํธ๋ฅผ ํจ๊ป ์์ฑํ๋ค.
Application Pipeline์ ๋ค์ ๋ค ๋จ๊ณ๋ก ๊ตฌ์ฑ๋๋ค.
์ด๋ฏธ์ง์ ๋ฌผ๋ฆฌ์ ํ์ง ์ํ๋ฅผ ๋ถ์ํ๋ค.
์ฃผ์ ๋ถ์ ํญ๋ชฉ์ ๋ค์๊ณผ ๊ฐ๋ค.
- Brightness
- Contrast
- Blur
- Edge Density
- Dynamic Range
- Exposure Condition
- White Balance
์ด ๋จ๊ณ์์๋ ์ด๋ฏธ์ง ํ์ง ์ ํ์ ์์ธ์ ์ ๋์ ์ผ๋ก ์ง๋จํ๋ค.
์ด๋ฏธ์ง์ ์๋ฏธ๋ก ์ ๊ตฌ์กฐ๋ฅผ ๋ถ์ํ๋ค.
์ฌ์ฉ๋๋ ์ฃผ์ ๋ชจ๋ธ์ ๋ค์๊ณผ ๊ฐ๋ค.
- Scene Classification
- YOLOv8 Object Detection
- SegFormer Semantic Segmentation
์ด๋ฅผ ํตํด ์์คํ ์
- ์ด๋ค ๊ณต๊ฐ์ธ์ง
- ์ด๋ค ๊ฐ์ฒด๊ฐ ์กด์ฌํ๋์ง
- ์ด๋ค ์์ญ์ด ์ค์ํ์ง
๋ฅผ ํ์ ํ๋ค.
ํ์ง ๋ถ์ ๊ฒฐ๊ณผ์ Scene Understanding ๊ฒฐ๊ณผ๋ฅผ ํตํฉํ์ฌ ํ์ ์ฒ๋ฆฌ์ ํ์ํ ํด์ ๋จ์๋ฅผ ๊ตฌ์ฑํ๋ค.
์ด ๋จ๊ณ์์๋ ์๋ฅผ ๋ค์ด ๋ค์๊ณผ ๊ฐ์ ์์ ์ด ์ํ๋๋ค.
- Detection ๊ธฐ๋ฐ ๋๋ Segmentation ๊ธฐ๋ฐ Crop Suggestion
- OCR ์ํ์ ์ํ Perspective Rectification
- ์ฅ๋ฉด, ๊ฐ์ฒด, ์์ญ, ํ์ง ์งํ๋ฅผ ์ข ํฉํ Quality Summary์ Feedback ์์ฑ
- Rule-of-Thirds์ ๊ฐ์ฒด ์์น๋ฅผ ๋ฐ์ํ Composition ๋ถ์
์ฆ, ์ด ๋จ๊ณ๋ ๋ ๋ฆฝ์ ์ธ reasoning engine์ด๋ผ๊ธฐ๋ณด๋ค ์ฌ๋ฌ ๋ถ์ ๋ชจ๋์ ์ถ๋ ฅ์ ์ข ํฉํ์ฌ ์ฌ๋์ด ํด์ ๊ฐ๋ฅํ ์ค๊ฐ ๊ฒฐ๊ณผ๋ฅผ ๊ตฌ์ฑํ๋ rule-based aggregation ๋จ๊ณ์ ๊ฐ๊น๋ค.
๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํ์ผ๋ก ์ค์ ์ด๋ฏธ์ง ๋ณด์ ์ ์ํํ๊ณ , ์ ํ ๋น๊ต์ ์ค๊ฐ ์ฐ์ถ๋ฌผ์ ํจ๊ป ์๊ฐํํ๋ค.
ํฌํจ ๊ธฐ๋ฅ์ ๋ค์๊ณผ ๊ฐ๋ค.
- Exposure Correction
- White Balance Correction
- CLAHE
- Adaptive Sharpening
- Denoising
- Region-aware Enhancement
- Detection / Segmentation Visualization
- Difference Heatmap
- ORB Matching
- Final Analysis Report
ํ์ฌ ๊ตฌํ์ enhancement๋ ํ์ต ๊ธฐ๋ฐ ์์ฑ ๋ชจ๋ธ์ด ์๋๋ผ ์ ํต์ ์์์ฒ๋ฆฌ ๊ธฐ๋ฐ ๋ณด์ ํ์ดํ๋ผ์ธ์ด๋ค. ๋ค๋ง ๋ชจ๋ ์ด๋ฏธ์ง์ ๋์ผํ ํํฐ๋ฅผ ๊ธฐ๊ณ์ ์ผ๋ก ์ ์ฉํ๋ ๋์ , ํ์ง ์งํ์ ์ฅ๋ฉด ํด์ ๊ฒฐ๊ณผ๋ฅผ ํจ๊ป ๋ฐ์ํ์ฌ ๋ณด์ ๊ฐ๋์ ์ ์ฉ ์์ญ์ ์กฐ์ ํ๋ค.
Research Pipeline์ VisionCraft์ ์ฐ๊ตฌ์ ๊ธฐ์ฌ๋ฅผ ๋ด๋นํ๋ ์คํ ํ๋ ์์ํฌ์ด๋ค.
๋ณธ ์ฐ๊ตฌ์ ํต์ฌ ์ง๋ฌธ์ ๋ค์๊ณผ ๊ฐ๋ค.
ํ ์คํธ ๊ธฐ๋ฐ ์๋ฏธ ์ ๋ณด(Text Prior)๋ Scene Classification ๊ณผ์ ์์ Latent Representation์ ์ด๋ป๊ฒ ๋ณํ์ํค๋๊ฐ?
์ด๋ฅผ ๊ฒ์ฆํ๊ธฐ ์ํด ๋ค์ ์ธ ๊ฐ์ง ๋ชจ๋ธ์ ๋น๊ตํ์๋ค.
๊ธฐ๋ณธ์ ์ธ ResNet50 ๊ธฐ๋ฐ Scene Classification ๋ชจ๋ธ์ด๋ค.
flowchart TD
A[Input Image]
A --> B[ResNet50 Backbone]
B --> C[Global Visual Representation]
C --> D[Classifier]
D --> E[Scene Prediction]
CLIP ๊ธฐ๋ฐ Text Embedding์ Latent Space์ ์ฃผ์ ํ๋ ๊ตฌ์กฐ์ด๋ค.
flowchart TD
A[Input Image] --> B[ResNet50 Backbone]
B --> C[Spatial Visual Tokens]
T[Scene Text Prompts] --> U[CLIP Text Encoder]
U --> V[Fixed Scene Text Embeddings]
V --> W[Projected Text Tokens]
C --> X[Visual-to-Text Cross-Attention]
W --> X
X --> Y[Fused Visual Tokens]
Y --> Z[Mean Pooling + LayerNorm]
Z --> P[Classifier]
P --> Q[Scene Prediction]
Cross-Attention ๊ตฌ์กฐ์ Contrastive Learning์ ์ถ๊ฐํ ๋ชจ๋ธ์ด๋ค.
flowchart TD
A[Input Image] --> B[ResNet50 Backbone]
B --> C[Spatial Visual Tokens]
T[Scene Text Prompts] --> U[CLIP Text Encoder]
U --> V[Fixed Scene Text Embeddings]
V --> W[Projected Text Tokens]
C --> X[Visual-to-Text Cross-Attention]
W --> X
X --> Y[Fused Visual Tokens]
Y --> Z[Fused Latent]
Z --> P[Classifier]
P --> Q[Scene Prediction]
W --> R[Class Text Prototypes]
Z -. InfoNCE Alignment Loss .-> R
ํ์ฌ ๊ตฌํ์์ Cross-Attention์ visual token์ด class-level text token์ ์ฐธ์กฐํ๋ ๋จ๋ฐฉํฅ ๊ตฌ์กฐ์ด๋ฉฐ, InfoNCE๋ attention block ๋ด๋ถ์ ์ฝ์ ๋๋ ๊ฒ์ด ์๋๋ผ fused latent์ projected text prototype ์ฌ์ด์ ์ถ๊ฐ๋๋ ๋ณด์กฐ ํ์ต loss๋ก ์๋ํ๋ค.
๋ณธ ์ฐ๊ตฌ์์๋ ๋จ์ํ Accuracy ๋น๊ต๋ฅผ ๋์ด ๋ค์๊ณผ ๊ฐ์ ๋ถ์์ ์ํํ์๋ค.
- Classification Accuracy
- Confusion Matrix
- UMAP Visualization
- t-SNE Visualization
- Cosine Similarity Analysis
- Prototype Alignment Analysis
- Attention Map Visualization
๊ถ๊ทน์ ์ผ๋ก Research Pipeline์ ์ฑ๋ฅ ํฅ์ ์ฌ๋ถ๋ฟ ์๋๋ผ, ํ ์คํธ ๊ธฐ๋ฐ ์๋ฏธ ์ ๋ณด๊ฐ Scene Representation์ ์ด๋ป๊ฒ ์ฌ๊ตฌ์ฑํ๋์ง๋ฅผ ์ ๋์ ยท์ ์ฑ์ ์ผ๋ก ๋ถ์ํ๋ ๊ฒ์ ๋ชฉํ๋ก ํ๋ค.
Brightness Analysis๋ ์ ๋ ฅ ์ด๋ฏธ์ง์ ์ ๋ฐ์ ์ธ ์กฐ๋ ์์ค์ ๊ฐ์ฅ ๋จ์ํ๋ฉด์๋ ํด์ ๊ฐ๋ฅํ ๋ฐฉ์์ผ๋ก ์ ๋ํํ๊ธฐ ์ํ ๋จ๊ณ์ด๋ค. ํ์ฌ ๊ตฌํ์ RGB ์ด๋ฏธ์ง๋ฅผ grayscale๋ก ๋ณํํ ๋ค, ์ ์ฒด ํฝ์ ์ ํ๊ท intensity๋ฅผ ๊ณ์ฐํ๊ณ ์ด๋ฅผ 0์์ 100 ์ฌ์ด์ ์ ์๋ก ์ ๊ทํํ๋ค.
๊ทธ๋ ์ด์ค์ผ์ผ ์์
์ฌ๊ธฐ์
์ด ์ ์๋ brightness.py ์์ ์ง์ ๊ณ์ฐ๋๋ฉฐ, ํ์ ๋จ๊ณ์์๋ ์ ์ญ ๋ฐ๊ธฐ ๋ณด์ ๊ณผ gamma correction์ ์ ์ฉ ์ฌ๋ถ๋ฅผ ํ๋จํ๋ ๊ธฐ์ค์ผ๋ก ํ์ฉ๋๋ค. ์๋ฅผ ๋ค์ด brightness score๊ฐ ๋ฎ์ผ๋ฉด ์ ์ญ
Brightness score๋ ๋จ์ผ ํ๊ท ๊ฐ์ด๊ธฐ ๋๋ฌธ์ spatially localized underexposure๋ฅผ ์์ ํ ์ค๋ช ํ์ง๋ ๋ชปํ๋ค. ๊ทธ๋ฌ๋ VisionCraft์์๋ ์ด ์งํ๋ฅผ blur, contrast, exposure state์ ํจ๊ป ์ฌ์ฉํ๋ฏ๋ก ๋จ๋ ์งํ์ ํ๊ณ๋ฅผ ์ผ์ ๋ถ๋ถ ๋ณด์ํ ์ ์๋ค.
Contrast Analysis๋ ์ด๋ฏธ์ง์ intensity ๋ถํฌ๊ฐ ์ผ๋ง๋ ๋๊ฒ ํผ์ ธ ์๋์ง๋ฅผ ์ธก์ ํ๊ธฐ ์ํ ๋จ๊ณ์ด๋ค. ํ์ฌ ๊ตฌํ์ grayscale intensity์ ํ์คํธ์ฐจ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก global contrast๋ฅผ ์ถ์ ํ๋ค.
๊ทธ๋ ์ด์ค์ผ์ผ ์์์ ํ๊ท ์
VisionCraft๋ ์ด๋ฅผ ๊ฒฝํ์ ๊ธฐ์ค๊ฐ 64๋ก ๋๋์ด 0์์ 100 ์ฌ์ด์ ์ ์๋ก ๋ณํํ๋ค.
์ด ์์์ contrast.py ์ ๊ตฌํ๋์ด ์๋ค. contrast score๊ฐ ๋ฎ์์๋ก ์ ์ญ brightness/contrast scaling์์ scale factor
์ด ๋ฐฉ์์ histogram spread๋ฅผ ์ง๊ด์ ์ผ๋ก ๋ฐ์ํ๋ค๋ ์ฅ์ ์ด ์์ง๋ง, ์ฅ๋ฉด ๋ด๋ถ์ ๊ตญ์ contrast variation๊น์ง๋ ์ถฉ๋ถํ ์ค๋ช ํ์ง ๋ชปํ๋ค. ๋ฐ๋ผ์ VisionCraft๋ ์ ์ญ contrast score๋ฅผ ๋จผ์ ๊ณ์ฐํ ๋ค, ๋ณ๋์ CLAHE๋ฅผ ํตํด local contrast ๋ณด์ ์ ์ถ๊ฐ์ ์ผ๋ก ์ํํ๋ค.
Blur Analysis๋ ์ด๋ฏธ์ง์ ๊ฒฝ๊ณ ์ ๋ณด๊ฐ ์ผ๋ง๋ ๋ ์นด๋กญ๊ฒ ์ ์ง๋๋์ง๋ฅผ ์ถ์ ํ๋ ๋จ๊ณ์ด๋ค. ํ์ฌ ๊ตฌํ์ Laplacian variance๋ฅผ ์ฌ์ฉํ์ฌ ๊ณ ์ฃผํ edge ์ฑ๋ถ์ ๊ฐ๋๋ฅผ ์์นํํ๋ค.
๊ทธ๋ ์ด์ค์ผ์ผ ์์
๋ก ์ ์๋๋ค. VisionCraft๋ ์ด ๊ฐ์ ๊ฒฝํ์ ๊ธฐ์ค๊ฐ 500์ผ๋ก ๋๋์ด ๋ค์๊ณผ ๊ฐ์ด ์ ์ํํ๋ค.
ํด๋น ์์์ blur.py ์ ๊ตฌํ๋์ด ์๋ค. ์ฌ๊ธฐ์ score๊ฐ ๋๋ค๋ ๊ฒ์ edge energy๊ฐ ์ถฉ๋ถํ๋ค๋ ๋ป์ด๋ฉฐ, score๊ฐ ๋ฎ๋ค๋ ๊ฒ์ image๊ฐ ํ๋ฆฌ๊ฑฐ๋ defocus/low-pass degradation์ ์ํฅ์ ๋ฐ์์ ๊ฐ๋ฅ์ฑ์ ์๋ฏธํ๋ค.
์ด blur score๋ ์ดํ adaptive sharpening ๊ฐ๋ ์กฐ์ ์ ํต์ฌ ์ ๋ ฅ์ผ๋ก ์ฌ์ฉ๋๋ค. ์๋ฅผ ๋ค์ด blur score๊ฐ 30 ๋ฏธ๋ง์ด๋ฉด ๋น๊ต์ ๊ฐํ sharpening์ด ์ ์ฉ๋๊ณ , 60 ์ด์์ด๋ฉด sharpening์ ์๋ตํ๋ค. ๋ํ ์ธ๋ฌผ ์ฅ๋ฉด์ด๋ indoor scene์์๋ sharpening ๊ฐ๋๋ฅผ ๋ณ๋๋ก ๋ฎ์ถฐ ๊ณผ๋ํ edge enhancement๋ฅผ ์ต์ ํ๋ค.
Edge Density Analysis๋ ์ด๋ฏธ์ง ์ ์ฒด์์ ๊ตฌ์กฐ์ ๊ฒฝ๊ณ๊ฐ ์ผ๋ง๋ ๋ง์ด ์กด์ฌํ๋์ง๋ฅผ ์ถ์ ํ๋ ๋จ๊ณ์ด๋ค. ํ์ฌ ๊ตฌํ์ Canny edge detector๋ฅผ ์ ์ฉํ ๋ค, edge pixel์ ๋น์จ์ ๊ณ์ฐํ๋ค.
๋จผ์ grayscale ์์์ ๋ํด Canny edge map
๊ทธ ๋ค์ ์ ์ฒด edge density๋
๋ก ์ ์๋๋ฉฐ, ์ต์ข ์ ์๋
์ด๋ค. ํด๋น ๋ก์ง์ edge_density.py ์ ๊ตฌํ๋์ด ์๋ค.
Edge density๋ blur์ ์ ์ฌํด ๋ณด์ผ ์ ์์ง๋ง ์ญํ ์ด ๋ค๋ฅด๋ค. blur score๋ edge sharpness๋ฅผ ์ธก์ ํ๊ณ , edge density๋ ์ฅ๋ฉด์ ๊ตฌ์กฐ์ ๋ณต์ก๋์ ๊ณ ๋น๋ ๊ฒฝ๊ณ์ ์์ ์ธก์ ํ๋ค. VisionCraft์์๋ edge density๊ฐ ๋งค์ฐ ๋ฎ์ ๊ฒฝ์ฐ bilateral filtering์ ์ ํํ์ฌ ๊ตฌ์กฐ๋ฅผ ๋ณด์กดํ๋ฉด์ ๋ ธ์ด์ฆ๋ฅผ ์ค์ด๊ณ , ์ ์กฐ๋์ด๋ฉด์ blur๊ฐ ํฐ ๊ฒฝ์ฐ์๋ median filtering์ ์ ์ฉํ๋ ๋ฑ denoising policy๋ฅผ ์ ํํ๋ ๋ฐ ์ฌ์ฉํ๋ค.
Color Balance Analysis๋ ์ด๋ฏธ์ง๊ฐ ํน์ ์ฑ๋ ๋ฐฉํฅ์ผ๋ก ์ผ๋ง๋ ์น์ฐ์ณ ์๋์ง๋ฅผ ์ถ์ ํ๋ ๋จ๊ณ์ด๋ค. ํ์ฌ ๊ตฌํ์ Gray-World assumption์ ๊ธฐ๋ฐ์ผ๋ก ์ฑ๋ ํ๊ท ๊ณผ ์ ์ฒด ํ๊ท ์ ์ฐจ์ด๋ฅผ ์ธก์ ํ๋ค.
RGB ์ฑ๋ ํ๊ท ์ ๊ฐ๊ฐ
๋ผ๊ณ ๋๋ฉด, ์ฑ๋๋ณ white balance scale์
๋ก ์ ์๋๋ค. ์ด๋ color_balance.py ์์ ๊ทธ๋๋ก ๊ตฌํ๋์ด ์์ผ๋ฉฐ, ์ดํ traditional enhancement์ white balance ๋จ๊ณ์์๋ ๋์ผํ ์ฒ ํ์ด ์ฌ์ฉ๋๋ค.
๋ํ color cast์ ๊ฐ๋๋ ๋ค์๊ณผ ๊ฐ์ด ์ถ์ ํ๋ค.
๊ทธ๋ฆฌ๊ณ ์ด๋ฅผ ์ ์ํํ์ฌ
๋ก ํํํ๋ค. ์ ์ ํฌ๊ธฐ์ ๋ฐ๋ผ mild, moderate, strong ์์ค์ white-balance shift๊ฐ ๊ฒฐ์ ๋๋ฉฐ, ์ด๋ ์ฑ๋์ด high ๋๋ low ๋ฐฉํฅ์ผ๋ก ์น์ฐ์ณค๋์ง๋ ํจ๊ป ๊ธฐ๋ก๋๋ค.
์ด ๋ถ์์ ๋จ์ํ ๋ฏธํ์ ์์ ํ๊ฐ๋ฅผ ๋์ด, ์ ์ญ white balance ๋ณด์ ์ ํ์์ฑ๊ณผ ์ฑ๋๋ณ ๋ณด์ ๊ฐ๋๋ฅผ ์ ํ๋ ๊ทผ๊ฑฐ๋ก ์ฌ์ฉ๋๋ค.
Exposure Analysis๋ ๋จ์ ํ๊ท ๋ฐ๊ธฐ๋ณด๋ค ๋ ํ๋ถํ photometric ์ํ๋ฅผ ์ถ์ ํ๊ธฐ ์ํด shadow ratio, highlight ratio, ๊ทธ๋ฆฌ๊ณ percentile-based dynamic range๋ฅผ ํจ๊ป ์ฌ์ฉํ๋ค. ๊ตฌํ์ exposure.py ์ ์๋ค.
๋จผ์ shadow ratio์ highlight ratio๋ ๋ค์๊ณผ ๊ฐ์ด ์ ์๋๋ค.
๋ํ intensity distribution์ 5th percentile๊ณผ 95th percentile์ ๊ฐ๊ฐ
๋ก ์ ์๋๋ค. ์ด๋ฅผ ์ ์๋ก ์ ๊ทํํ๋ฉด
๊ฐ ๋๋ค.
์ดํ exposure state๋ rule-based๋ก ๊ฒฐ์ ๋๋ค.
-
$\mathrm{ShadowRatio} > 0.32$ ์ด๊ณ$p_{95} < 190$ ์ด๋ฉดunderexposed -
$\mathrm{HighlightRatio} > 0.18$ ์ด๊ณ$p_5 > 40$ ์ด๋ฉดoverexposed -
$\mathrm{DynamicRange} < 85$ ์ด๋ฉดlow_dynamic_range - ๊ทธ ์ธ์๋
balanced
์ด ์ค๊ณ๋ ๋จ์ ํ๊ท ๋ฐ๊ธฐ๋ง์ผ๋ก๋ ๊ตฌ๋ถํ๊ธฐ ์ด๋ ค์ด underexposed image์ low-dynamic-range image๋ฅผ ๋ถ๋ฆฌํ๋ ๋ฐ ์ ์ฉํ๋ค. ์๋ฅผ ๋ค์ด brightness๊ฐ ์ค๊ฐ ์์ค์ด์ด๋ dynamic range๊ฐ ์ง๋์น๊ฒ ์ข์ผ๋ฉด contrast flattening์ด๋ haze-like degradation์ผ๋ก ๊ฐ์ฃผํ ์ ์๋ค.
Scene Classification์ ์
๋ ฅ ์ด๋ฏธ์ง์ high-level semantic identity๋ฅผ ์ถ์ ํ๋ ๋จ๊ณ์ด๋ค. ํ์ฌ ์ฑ์์๋ scene_classifier.py ๊ฐ ๊ธฐ๋ณธ ์ถ๋ก ์ง์
์ ์ด๋ฉฐ, ๊ธฐ๋ณธ ์ฒดํฌํฌ์ธํธ๋ scene_classifier_resnet50_v11_text_crossattn_infonce_A.pt ์ด๋ค.
์ถ๋ก ์ ์ด๋ฏธ์ง๋ ํ์ต ์ ์ฌ์ฉํ transform์ ๊ฑฐ์ณ backbone์ผ๋ก ์
๋ ฅ๋๋ฉฐ, ์ต์ข
logits
์ต์ข ์์ธก ๋ผ๋ฒจ์
๋ก ๊ฒฐ์ ๋๋ค. ์ฑ์ top-3 ํ๋ณด์ confidence๋ ํจ๊ป ์ ์ฅํ์ฌ, ๋จ์ผ hard label๋ง์ด ์๋๋ผ prediction uncertainty๋ฅผ ํด์ํ ์ ์๊ฒ ํ๋ค.
ํ์ฌ ์ ํ๋ฆฌ์ผ์ด์ ๊ด์ ์์ scene classifier์ ์ญํ ์ ๋ค์๊ณผ ๊ฐ๋ค.
- ์ฅ๋ฉด์ high-level identity ์ถ์
- quality summary์ feedback์ semantic context ์ ๊ณต
- scene-aware enhancement policy ์ ํ์ ์ง์ ์ฌ์ฉ
- ์ฐ๊ตฌ ํ์ดํ๋ผ์ธ์ attention ๋ฐ latent ํด์์ ์ํ semantic anchor ์ ๊ณต
๋ค๋ง crop recommendation์ด๋ ๋ชจ๋ ํ์ rule์ด scene label์๋ง ์์กดํ๋ ๊ฒ์ ์๋๋ค. ์ค์ ๋ก๋ detection, segmentation, low-level quality score๊ฐ ํจ๊ป ์ฌ์ฉ๋๋ฉฐ, scene label์ indoor-natural, landscape-natural, urban-balanced์ ๊ฐ์ ๋ณด์ policy๋ฅผ ์ ํํ๋ high-level context๋ก ์๋ํ๋ค. ๋ฐ๋ผ์ VisionCraft์ application pipeline์ scene identity๋ฅผ ๋จ์ ๋ฆฌํฌํธ ํญ๋ชฉ์ผ๋ก๋ง ์ฌ์ฉํ์ง ์๊ณ , ์ต์ข
enhancement ๊ฐ๋์ ์๋ณธ ๋ณด์กด ๋น์จ์ ์กฐ์ ํ๋ ๋ฐ ์ง์ ๋ฐ์ํ๋ค.
๋ํ ์ฒดํฌํฌ์ธํธ๋ฅผ ๋ถ๋ฌ์ค์ง ๋ชปํ๋ ๊ฒฝ์ฐ๋ฅผ ๋๋นํด heuristic fallback๋ ๊ตฌํ๋์ด ์๋ค. ์ด fallback์ HSV์ grayscale ํต๊ณ์์ blue ratio, green ratio, brightness๋ฅผ ๊ณ์ฐํด nature, indoor, urban/outdoor ๊ฐ์ coarse category๋ฅผ ์ถ์ ํ๋ค. ์ฆ ์ฑ์ learned model์ด unavailableํด๋ ์์ ํ ์คํจํ์ง ์๋๋ก ์ค๊ณ๋์ด ์๋ค.
Object Detection์ object_detector.py ์ ๊ตฌํ๋์ด ์์ผ๋ฉฐ, ultralytics์ YOLOv8n์ ์ฌ์ฉํ๋ค. ์ถ๋ก ์ confidence threshold๋ 0.35๋ก ์ค์ ๋์ด ์๋ค.
๊ฐ detection์ bounding box
์ confidence
๊ฐ์ฒด ์ค์ฌ์
๋ผ๊ณ ํ๋ฉด, area ratio๋
์ด๋ค. ๋ํ rule-of-thirds ๊ธฐ์ค์ ์งํฉ
์ ๋ํด ๊ฐ์ฅ ๊ฐ๊น์ด ๊ธฐ์ค์ ๊ณผ์ ์ ๊ทํ ๊ฑฐ๋ฆฌ๋ฅผ
๋ก ์ ์ํ๋ค.
์ด ๊ฐ๋ค์ ๋จ์ ์๊ฐํ์ฉ์ด ์๋๋ผ crop suggestion์์ ํต์ฌ์ ์ผ๋ก ์ฌ์ฉ๋๋ค. ๊ฐ์ฒด๊ฐ thirds point์์ ๋ฉ์๋ก ๋ ๊ฐํ ํฌ๋กญ์ด ์ ์๋๋ฉฐ, main object์ area ratio์ bbox ํฌ๊ธฐ ์ญ์ crop box ํฌ๊ธฐ๋ฅผ ๊ฒฐ์ ํ๋ ๋ฐ ํ์ฉ๋๋ค.
๋ฐ๋ผ์ object detection์ ๋จ์ํ "๋ฌด์์ด ์๋๊ฐ"๋ฅผ ์๋ ค์ฃผ๋ ๊ฒ์ ๋์ด, composition analysis์ subject-centric framing์ ์ํ ์ ๋ ์ ๋ ฅ์ผ๋ก ์ฌ์ฉ๋๋ค.
Semantic Segmentation์ segmenter.py ์ ๊ตฌํ๋์ด ์์ผ๋ฉฐ, nvidia/segformer-b0-finetuned-ade-512-512 ๋ชจ๋ธ์ ์ฌ์ฉํ๋ค. ๋ชจ๋ธ ์ถ๋ ฅ์ ๊ฐ ํฝ์
์ semantic class ID map์ด๋ฉฐ, VisionCraft๋ ์ด๋ฅผ ์๋ณธ ํด์๋์ ๋ง๊ฒ post-processํ๋ค.
ํฝ์
๋จ์ semantic prediction map์
๋ก ์ ์๋๋ค. ๊ฐ ํด๋์ค์ pixel ratio๋
์ด๋ฉฐ, ์ด๋ฅผ ๋ฐฑ๋ถ์จ๋ก ๋ณํํด top semantic component๋ฅผ ์์ฝํ๋ค.
VisionCraft๋ segmentation ๊ฒฐ๊ณผ์์ ํนํ ๋ค์ ์ธ ์ข ๋ฅ์ ์์ญ์ ์ค์ํ๊ฒ ์ฌ์ฉํ๋ค.
person_masksky_maskbackground_mask
์ฌ๊ธฐ์ background mask๋
๋ก ์ ์๋๋ค. ๋ง์ฝ SegFormer๊ฐ person class๋ฅผ ์์ ์ ์ผ๋ก ๋ฐํํ์ง ๋ชปํ๋ฉด, YOLO detection box๋ฅผ ์ด์ฉํด person mask๋ฅผ fallback์ผ๋ก ์์ฑํ๋ค. ์ด๋ ์ฑ ์์ค์์ ์ธ๋ฌผ ์ค์ฌ ์ด๋ฏธ์ง๋ฅผ ์์ ํ ๋์น์ง ์๊ธฐ ์ํ pragmatic design์ด๋ค.
์ด segmentation ๊ฒฐ๊ณผ๋ ๋ค์๊ณผ ๊ฐ์ ํ์ ๋จ๊ณ์ ์ฌ์ฉ๋๋ค.
- segmentation-based crop fallback
- sky/person/background region-aware enhancement
- semantic overlay visualization
- scene composition summary
์ฆ segmentation์ ๋จ์ scene parsing ๊ฒฐ๊ณผ๋ฅผ ๋ณด์ฌ์ฃผ๋ ๋ฐ์ ๋๋์ง ์๊ณ , ์ค์ enhancement์ visualization ๋ชจ๋์ ์ง์ ์ฐ๊ฒฐ๋๋ค.
Auto Straighten์ ํ์ฌ tilt_correction.py ์ ๊ตฌํ๋์ด ์์ผ๋ฉฐ, ํ๊ฒฝ/์ค๋ด/๊ฑด์ถ ์ฅ๋ฉด์์ ์ํ์ ๋๋ ์์ง์ ๊ธฐ๋ฐ์ ์ ์ญ ๊ธฐ์ธ๊ธฐ๋ฅผ ์๋์ผ๋ก ์ถ์ ํ๋ค.
๋จผ์ grayscale image์ Canny edge detector๋ฅผ ์ ์ฉํ ๋ค, probabilistic Hough transform์ผ๋ก ์ ๋ถ ์งํฉ์ ์ถ์ถํ๋ค. ๊ฐ ์ ๋ถ
์ degree ํํ์ผ๋ก ๊ณ์ฐ๋๋ค. near-horizontal line์ ๊ทธ๋๋ก candidate๋ก ์ฌ์ฉํ๊ณ , near-vertical line์ equivalent tilt๋ก ๋ณํํ์ฌ ๋์ผํ correction space์์ ๋ค๋ฃฌ๋ค.
๊ฐ ์ ๋ถ์ ๊ธธ์ด
๋ฅผ weight๋ก ์ฌ์ฉํ์ฌ, ์ต์ข ๋ํ ๊ธฐ์ธ๊ธฐ๋ weighted median์ผ๋ก ๊ณ์ฐํ๋ค.
๋ํ line angle๋ค์ weighted median deviation์ด ์ผ์ threshold๋ณด๋ค ํฌ๊ฑฐ๋, ์ถ์ ๊ฐ๋์ ์ ๋๊ฐ์ด ๊ณผ๋ํ๊ฒ ํฌ๋ฉด ์๋ ๋ณด์ ์ ๊ฑด๋๋ด๋ค. ์ฆ VisionCraft๋ ํญ์ ๊ฐ์ ํ์ ์ ์ํํ๋ ๊ฒ์ด ์๋๋ผ, ์ ๋ถ๋ค์ ํฉ์๊ฐ ์ถฉ๋ถํ ๋๋ง correction preview๋ฅผ ์์ฑํ๋ค.
ํ์ ์ OpenCV์ affine rotation์ผ๋ก ์ํ๋๋ฉฐ, ํ์ ํ ์๊ธฐ๋ invalid border๋ largest valid rectangle์ ์ฐพ์ ๋ค์ cropํ ๋ค ์๋ณธ ํด์๋๋ก resizeํ๋ค. ๋ฐ๋ผ์ ๋ณธ ๋ชจ๋์ ๋จ์ ํ์ ๋ฟ ์๋๋ผ ํ์ ์ดํ ์๊ธฐ๋ black border artifact๊น์ง ํจ๊ป ์ฒ๋ฆฌํ๋ค.
Crop Suggestion์ crop_suggestion.py ์ ๊ตฌํ๋์ด ์๋ค. ์ด ๋ชจ๋์ scene label์ ์ง์ ์์กดํ์ง ์๊ณ , ์ฐ์ ์ ์ผ๋ก object detection ๊ฒฐ๊ณผ๋ฅผ ์ฌ์ฉํ๋ฉฐ, detection์ด ์์ ๊ฒฝ์ฐ segmentation ๊ฒฐ๊ณผ๋ก fallbackํ๋ค.
Detection ๊ธฐ๋ฐ crop์ ๊ฒฝ์ฐ, main object๋ ๊ฐ์ฅ ํฐ area ratio๋ฅผ ๊ฐ์ง detection์ผ๋ก ์ ํ๋๋ค. ๊ทธ ๊ฐ์ฒด ์ค์ฌ
๊ฐ์ฒด์ bbox ํฌ๊ธฐ๋ฅผ
๊ฐ ๋๋๋ก ์ค์ ๋๋ค. ๋ํ ๊ฐ์ฒด๊ฐ thirds point์์ ๋ฉ์๋ก ๋ ๊ฐํ crop scale์ ์ ์ฉํ๋ค.
Segmentation fallback์ ๊ฒฝ์ฐ์๋ sky, water, mountain, tree, road, building ๋ฑ ์ฐ์ label์ ํฉ์ณ ํ๋์ merged mask๋ฅผ ๋ง๋ ๋ค, ๊ทธ bounding region์ ์ค์ฌ์ผ๋ก ์ฅ๋ฉด crop์ ์์ฑํ๋ค.
์ฆ crop suggestion์ aesthetic cropping์ ์ํ ์์ ํ ์์ฑ ๋ชจ๋์ด ์๋๋ผ, ๊ฐ์ฒด ๋๋ semantic region์ ๋ ์์ ์ ์ธ ๊ตฌ๋์ ์์น์ํค๊ธฐ ์ํ heuristic framing module์ ๊ฐ๊น๋ค.
OCR and Perspective Rectification์ document_text.py ์ ๊ตฌํ๋์ด ์์ผ๋ฉฐ, ๋ฌธ์ํ ์ด๋ฏธ์ง์์ ์ ๋ฉด ๋ณด์ ๊ณผ ํ ์คํธ ์ถ์ถ์ ์ํํ๋ค.
Perspective rectification์ ๋ฌธ์ ์์ญ์ ํด๋นํ๋ ์ฌ๊ฐํ contour๋ฅผ ์๋ ๊ฒ์ถํ๋ ๊ฒฝ๋ก์, ์ฌ์ฉ์๊ฐ ์ง์ 4๊ฐ์ ๊ผญ์ง์ ์ ์ง์ ํ๋ ์๋ ๊ฒฝ๋ก๋ฅผ ๋ชจ๋ ์ฝ๋ ์์ค์์ ํฌํจํ๋ค. ๋ค๋ง ํ์ฌ Gradio application์ OCR workflow์์๋ ์ฌ์ฉ์๊ฐ Manual 4-Point Rectification ํญ์์ ๋ค ๊ผญ์ง์ ์ ์ง์ ํ ๋ค, ๊ทธ rectified image๋ฅผ OCR ์
๋ ฅ์ผ๋ก ์ฌ์ฉํ๋ ๋ฐฉ์์ ๊ธฐ๋ณธ์ผ๋ก ํ๋ค. ๋ค ์ ์ด ์ฃผ์ด์ก์ ๋ homography ๊ธฐ๋ฐ ์ฌ์ ๋ณํ์
๋ก ํํ๋๋ฉฐ, OpenCV์ getPerspectiveTransform๊ณผ warpPerspective๋ฅผ ์ฌ์ฉํด ์ ๋ฉด ๋ณด์ ๋ ์ด๋ฏธ์ง๋ก ๋ณํํ๋ค.
์๋ ๊ฒ์ถ ๊ฒฝ๋ก์์๋ edge map, adaptive threshold, contour approximation์ ๊ฒฐํฉํ์ฌ ๊ฐ์ฅ ๊ทธ๋ด๋ฏํ quadrilateral์ ์ฐพ๋๋ค. ๊ฐ ํ๋ณด ์ฌ๊ฐํ์ area, ๋ณ ๊ธธ์ด ๊ท ํ, border proximity, center distance๋ฅผ ํจ๊ป ๊ณ ๋ คํ ์ ์๋ก ํ๊ฐ๋๋ค.
OCR ์์ฒด๋ ํ๋์ ์์ง์ ๊ณ ์ ๋์ง ์๋๋ค. ์ฐ์ ์์๋ ๋ค์๊ณผ ๊ฐ๋ค.
- OpenAI multimodal OCR ๊ฒฝ๋ก
- PaddleOCR
- EasyOCR
- Tesseract
๋จ, OPENAI_API_KEY๊ฐ ์ค์ ๋์ด ์๋ ๊ฒฝ์ฐ์๋ OpenAI multimodal ๊ฒฝ๋ก๋ฅผ ์ฐ์ ์ฌ์ฉํ๋ฉฐ, ์ด ๊ฒฝ๋ก๊ฐ ์คํจํ๋ฉด ์คํจ ์ฌ์ ๋ฅผ ์ฌ์ฉ์์๊ฒ ๋ช
์์ ์ผ๋ก ๋ฐํํ๋ค. ์ด๋ OpenAI OCR์ ์ฌ์ฉํ๋๋ก ์ค์ ํ ์ํฉ์์ ์กฐ์ฉํ ์ฝํ local OCR ๊ฒฐ๊ณผ๋ก degrade๋๋ ๊ฒ์ ํผํ๊ธฐ ์ํ ์ค๊ณ์ด๋ค. OPENAI_API_KEY๊ฐ ์์ ๋๋ PaddleOCR, EasyOCR, Tesseract ์์ผ๋ก local OCR fallback์ด ์๋๋๋ค.
๋ํ OCR ์ ํ๋๋ฅผ ๋์ด๊ธฐ ์ํด grayscale, denoised, adaptive threshold, Otsu threshold, upscaled image ๋ฑ ์ฌ๋ฌ ์ ์ฒ๋ฆฌ variant๋ฅผ ์์ฑํ๊ณ , ๊ฐ์ฅ ์์ ์ ์ธ ๊ฒฐ๊ณผ๋ฅผ ์ ํํ๋ค. ์ฆ VisionCraft์ OCR ๋ชจ๋์ ๋จ์ ํ
์คํธ ์ถ์ถ๋ณด๋ค๋ manual rectification + preprocessing + optional multimodal OCR/local fallback์ ๊ฒฐํฉํ robust document reading pipeline์ ๊ฐ๊น๋ค.
Traditional Enhancement๋ traditional_enhance.py ์ ๊ตฌํ๋์ด ์๋ค. ์ด ๋ชจ๋์ diffusion์ด๋ GAN ๊ธฐ๋ฐ ๋ณด์ ์ด ์๋๋ผ, ํ์ง ๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์ ๋ ฅ์ผ๋ก ๋ฐ์ classical image processing operator์ ์ ์ฉ ๊ฐ๋์ ์์๋ฅผ ์กฐ์ ํ๋ heuristic enhancement pipeline์ด๋ค.
์ ์ฒด ์์๋ ๋๋ต ๋ค์๊ณผ ๊ฐ๋ค.
- White Balance
- Brightness / Contrast Scaling
- Gamma Correction
- CLAHE
- Adaptive Sharpening
- Adaptive Denoising
- Region-aware Adjustment
์ต๊ทผ ๊ตฌํ์์๋ ์ด ๊ธฐ๋ณธ ํ์ดํ๋ผ์ธ ์์ scene classifier ๊ฒฐ๊ณผ๋ฅผ ๋ฐ์ํ๋ scene-aware enhancement policy๋ฅผ ์ถ๊ฐํ์๋ค. ์ฆ ๋ชจ๋ ์ฅ๋ฉด์ ๋์ผํ ๋ณด์ ๊ฐ๋๋ฅผ ์ ์ฉํ์ง ์๊ณ , scene, main_subject, ocr_status, segmentation mask๋ฅผ ํจ๊ป ์ฌ์ฉํ์ฌ ๊ฐ ์ฐ์ฐ์ ๊ฐ๋์ ์๋ณธ blending ๋น์จ์ ์กฐ์ ํ๋ค. ์ด๋ ์ฅ๋ฉด๋ณ๋ก ์๋ก ๋ค๋ฅธ ์๊ฐ์ ํ์ง ์๊ตฌ๋ฅผ ๋ฐ์ํ๋ฉด์๋, ๊ณผ๋ํ ์ ๋ณํ๋ HDR-like artifact๋ฅผ ์ค์ด๊ธฐ ์ํ ๋ณด์์ ์ค๊ณ์ด๋ค.
ํ์ฌ ์ ์ฉ๋๋ ์ฃผ์ policy๋ ๋ค์๊ณผ ๊ฐ๋ค.
indoor-natural: bedroom, restaurant_cafe, kitchen_dining, office_study ์ฅ๋ฉด์ ์ ์ฉ๋๋ค. ์ค๋ด ์กฐ๋ช ๊ณผ ๋ฐ๋ปํ ์๊ฐ์ ๋ณด์กดํ๊ธฐ ์ํด white balance, CLAHE, sharpening ๊ฐ๋๋ฅผ ๋ฎ์ถ๊ณ ์๋ณธ blending์ ์ฆ๊ฐ์ํจ๋ค.landscape-natural: waterfront, mountain_valley, forest_nature, open_field_landscape ์ฅ๋ฉด์ ์ ์ฉ๋๋ค. ํ๋ ์์ญ์ ์๋ณธ ์์ ๊ฐํ๊ฒ ๋ณด์กดํ๊ณ , ์์ ์์ญ์ ์๋ณธ ์ด๋ก ์ฑ๋์ ์๊ฐ์ ์ผ๋ถ ๋ณต์ํ์ฌ ๋ณด์ ํ ์์ด ์ฃฝ๋ ํ์์ ์ค์ธ๋ค.urban-balanced: street_downtown, transportation_hub_road, residential_outdoor ์ฅ๋ฉด์ ์ ์ฉ๋๋ค. ๋์ฌ ์ด๋ฏธ์ง์ ๊ฐํ ์, wet street reflection, ๊ฑด๋ฌผ ๋ช ์์ ๋ณด์กดํ๊ธฐ ์ํด brightness/gamma/CLAHE๋ฅผ ์ฝํ๊ฒ ์ ์ฉํ๊ณ ์ต์ข ์๋ณธ blending์ ๋์ธ๋ค.structure-preserving: corridor_lobby, public_large_indoor, industrial_area ์ฅ๋ฉด์ ์ ์ฉ๋๋ค. ๊ฑด๋ฌผ, ์ค๋ด ๊ตฌ์กฐ, ์ง์ edge๊ฐ ๊ณผํ๊ฒ ๋ญ๊ฐ์ง์ง ์๋๋ก ์ค๊ฐ ๊ฐ๋์ contrast restoration๊ณผ sharpening์ ์ฌ์ฉํ๋ค.person-safe: main subject๊ฐ person์ผ๋ก ๊ฐ์ง๋ ๊ฒฝ์ฐ ์ถ๊ฐ๋ก ์ ์ฉ๋๋ค. ์ธ๋ฌผ ์์ญ์ ์๋ณธ๊ณผ ๋ ๋ง์ด ํผํฉํ์ฌ ํผ๋ถํค๊ณผ ์ผ๊ตด texture๊ฐ ๊ณผ๋ํ๊ฒ ๋ฐ๋์ง ์๋๋ก ํ๋ค.document-readable: OCR์ด ์ฑ๊ณตํ๊ฑฐ๋ ๋ฎ์ ์ ๋ขฐ๋๋ก ํ ์คํธ ํ๋ณด๋ฅผ ์ฐพ์ ๊ฒฝ์ฐ ์ ์ฉ๋๋ค. ์ด ๊ฒฝ์ฐ ์์ฐ์ค๋ฌ์ด ์ฌ์ง ์๊ฐ๋ณด๋ค ํ ์คํธ ๊ฐ๋ ์ฑ์ ์ฐ์ ํ์ฌ contrast์ local detail์ ์กฐ๊ธ ๋ ๋ณด์กดํ๋ค.
๋จผ์ white balance๋ Gray-World assumption์ ์ด์ฉํ๋ค. ์ฑ๋ ํ๊ท ์
์ด๊ณ , ๋ณด์ ํ ํฝ์ ์
๋ก ๊ณ์ฐ๋๋ค.
๊ทธ ๋ค์ ์ ์ญ ๋ฐ๊ธฐ/๋๋น ๋ณด์ ์ OpenCV์ ์ ํ intensity transform
๋ฅผ ์ฌ์ฉํ๋ค. ์ฌ๊ธฐ์
Gamma correction์ brightness๊ฐ ๊ทน๋จ์ ์ผ๋ก ๋ฎ๊ฑฐ๋ ๋์ ๋๋ง ์ ์ฉ๋๋ค.
์ ์กฐ๋์์๋
CLAHE๋ LAB color space์์
์ฌ๊ธฐ์
Denoising ๋จ๊ณ๋ edge density, blur, brightness์ ๋ฐ๋ผ filter๊ฐ ๋ฐ๋๋ค.
- edge density๊ฐ ๋ฎ์ผ๋ฉด bilateral filtering
- blur๊ฐ ๋งค์ฐ ํฌ๊ณ ์ ์กฐ๋์ด๋ฉด median filtering
- ๊ทธ ์ธ์๋ fast non-local means denoising
๋ง์ง๋ง์ผ๋ก segmentation mask๊ฐ availableํ๋ฉด person, sky, background์ ๋ํด region-aware adjustment๋ฅผ ์ํํ๋ค. background๋ ์ถ๊ฐ denoise, sky๋ ์๋ณธ ์ ๋ณด์กด ์ค์ฌ์ soft blending, person์ ์๋ณธ๊ณผ์ soft blending์ผ๋ก ๋ณด์ ๋๋ค. ํนํ landscape ๊ณ์ด์์๋ HSV ๊ธฐ๋ฐ greenery mask๋ฅผ ์ถ๊ฐ๋ก ๊ณ์ฐํ์ฌ ์ํ๊ณผ ์๋์ ์ฑ๋๊ฐ ์ง๋์น๊ฒ ๋ฎ์์ง๋ ๋ฌธ์ ๋ฅผ ์ํํ๋ค. ์ฆ VisionCraft์ enhancement๋ ๋จ์ผ global filter๊ฐ ์๋๋ผ, ์ ์ญ ๋ณด์ ๊ณผ ์ฅ๋ฉด๋ณ policy, ์์ญ๋ณ ๋ณด์ ์ ์์ฐจ์ ์ผ๋ก ๊ฒฐํฉํ hybrid pipeline์ด๋ค.
VisionCraft์ ๋ด๋ถ ํ์ดํ๋ผ์ธ์ ๋ค์์ ๋ชจ๋๋ก ๊ตฌ์ฑ๋์ด ์์ง๋ง, ์ค์ ์ฌ์ฉ ํ๋ฆ ์์ฒด๋ ๋น๊ต์ ๋จ์ํ๋ค. ์ฌ์ฉ์๋ ์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ๊ณ Analyze and Enhance ๋ฒํผ๋ง ์คํํ๋ฉด, ํ์ง ๋ถ์๋ถํฐ ์ฅ๋ฉด ํด์, ๋ณด์ ๊ฒฐ๊ณผ, ์๊ฐํ ๋ฆฌํฌํธ๊น์ง ํ๋์ ํ๋ฆ์ผ๋ก ํ์ธํ ์ ์๋ค. ์ด ์ฅ์ ๋ชฉ์ ์ ์์คํ
์ ๊ตฌํ ์ธ๋ถ๋ณด๋ค ๋จผ์ , ์ค์ ์ฌ์ฉ์๊ฐ ์ด๋ค ์์๋ก VisionCraft๋ฅผ ๊ฒฝํํ๊ฒ ๋๋์ง๋ฅผ ๋ณด์ฌ์ฃผ๋ ๊ฒ์ด๋ค.
๊ธฐ๋ณธ ์ฌ์ฉ ์ ์ฐจ๋ ๋ค์๊ณผ ๊ฐ๋ค.
- ํ๋ก์ ํธ ๋ฃจํธ์์ ์ ํ๋ฆฌ์ผ์ด์ ์ ์คํํ๋ค.
.venv/bin/python app.py-
๋ธ๋ผ์ฐ์ ์์ Gradio UI๋ฅผ ์ด๊ณ ๋ถ์ํ ์ด๋ฏธ์ง๋ฅผ ์ ๋ก๋ํ๋ค. Local ์คํ ๊ธฐ์ค ๊ธฐ๋ณธ ์ฃผ์๋
http://127.0.0.1:7860์ด๋ค. -
Analyze and Enhance๋ฒํผ์ ๋๋ฌ ์ ์ฒด ํ์ดํ๋ผ์ธ์ ์คํํ๋ค. -
์ฐ์ธก์
Enhanced Image์ ํ๋จ์ ์ธ๋ถ ํญ์ ํตํด intermediate result์ ์ต์ข ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ๋ค. -
์๋จ์
Model Statusํจ๋์์ YOLO, Scene Classifier, SegFormer, OCR backend๊ฐ ์ ์ ์คํ๋์๋์ง ๋๋ fallback/disabled ์ํ์ธ์ง ํ์ธํ๋ค. -
ํ๋จ์
Scene Model Comparisonํจ๋์์visual-only baseline,vanilla text cross-attention,text cross-attention + InfoNCE์ธ ๋ชจ๋ธ์ ์์ธก ๊ฒฐ๊ณผ๋ฅผ ๋๋ํ ๋น๊ตํ ์ ์๋ค.
์ฃผ์ ํญ์ ๋ค์๊ณผ ๊ฐ๋ค.
Auto Straighten: ๊ธฐ์ธ๊ธฐ ์ถ์ ๊ณผ straighten preview ํ์ธDetection: YOLO ๊ธฐ๋ฐ ๊ฐ์ฒด ๊ฒ์ถ ๊ฒฐ๊ณผ ํ์ธSegmentation Overlay: semantic segmentation overlay ํ์ธSegmentation Components: ์ฃผ์ semantic region ๋ถํด ํ์ธAuto Crop Preview: ์ถ์ฒ crop box ํ์ธDifference Heatmap: ๋ณด์ ์ ํ ๋ณํ ์์ญ ํ์ธORB Matching: ๋ณด์ ์ ํ ๊ตฌ์กฐ ๋ณด์กด ์ฌ๋ถ ํ์ธManual 4-Point Rectification: ๋ฌธ์ํ ์ด๋ฏธ์ง ์๋ ๋ณด์ ๋ฐ OCR ๋ณด์กฐ
์ค์ฌ์ฉ ์ ์ฃผ์ํ ์ ์ ๋ค์๊ณผ ๊ฐ๋ค.
Difference Heatmap๊ณผORB Matching์ ์ด๋ฏธ์ง๋ฅผ ์ ๋ก๋ํ ์งํ์๋ ๋น์ด ์์ ์ ์์ผ๋ฉฐ, ๋ฐ๋์Analyze and Enhance๋ฅผ ์คํํด์ผ ๊ฒฐ๊ณผ๊ฐ ์์ฑ๋๋ค.Model Statusํจ๋์ YOLO object detection, scene classifier checkpoint, SegFormer segmentation, OCR backend์ ์คํ ์ํ๋ฅผ ์์ฝํ๋ค. ๋ฐ๋ผ์ ํน์ ๊ฒฐ๊ณผ๊ฐ ๋น์ด ์๊ฑฐ๋ fallback์ผ๋ก ์์ฑ๋ ๊ฒฝ์ฐ, ์ฌ์ฉ์๋ ํด๋น ํจ๋์์ ์์ธ์ ๋จผ์ ํ์ธํ ์ ์๋ค.Scene Model Comparison์ ๋์ผํ ์ ๋ ฅ ์ด๋ฏธ์ง์ ๋ํด ์ธ ์ข ๋ฅ์ scene classifier ๊ฒฐ๊ณผ๋ฅผ ํ ๋ฒ์ ๋ณด์ฌ์ฃผ๋ฉฐ, ๊ฐ ๋ชจ๋ธ์ predicted label, confidence, top-3 ํ๋ณด๋ฅผ ๋น๊ตํ ์ ์๋ค.- ์ต์ข
enhancement๋ scene classifier์ predicted label์ ๋ฐ๋ผ ์๋ก ๋ค๋ฅธ ๋ณด์ policy๋ฅผ ์ฌ์ฉํ๋ค. ์๋ฅผ ๋ค์ด
open_field_landscape๋ ํ๋๊ณผ ์์ ์ ๋ณด์กด์ ์ฐ์ ํ๊ณ ,street_downtown์ ๊ฐํ ์๊ณผ ๋์ ๋ช ์์ ๋ณด์กดํ๋ ๋ฐฉํฅ์ผ๋ก ๋ณด์ ๊ฐ๋๋ฅผ ๋ฎ์ถ๋ค. - ์ ์ฒดํ๋ฉด์ด ์๋๋ฉด ํ๋ฉด ๋๋น์ ๋ฐ๋ผ ์ผ๋ถ ํญ์ด ์ ํ ๋ณด์ผ ์ ์์ผ๋ฏ๋ก, ์ ์ฒดํ๋ฉด ์ฌ์ฉ์ ๊ถ์ฅํ๋ค.
- OCR ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ๋ ค๋ฉด
Enable Text Processing (OCR)๋ฅผ ์ผ๊ณ ,Manual 4-Point Rectificationํญ์์ 4๊ฐ ์ ์ ์ง์ ํ ๋ค ๋ค์Analyze and Enhance๋ฅผ ์คํํด์ผ ํ๋ค. - OpenAI API key๊ฐ ๋ฑ๋ก๋์ด ์์ผ๋ฉด OpenAI multimodal OCR ๊ฒฝ๋ก๋ฅผ ์ฐ์ ์ฌ์ฉํ๋ค. ์ด ๊ฒฝ๋ก๊ฐ ์คํจํ๋ฉด ์คํจ ์ฌ์ ๋ฅผ ํ์ํ๋ฉฐ, OpenAI key๊ฐ ์๋ ํ๊ฒฝ์์๋ PaddleOCR, EasyOCR, Tesseract ์์ผ๋ก local fallback์ด ์๋๋๋ค.
๋ค์์ ์ค์ ์ ํ๋ฆฌ์ผ์ด์ ๋ฉ์ธ UI ์์์ด๋ค. ์๋ ์์ ์ด๋ฏธ์ง๋ค์ ํ๋ก์ ํธ ๊ฐ๋ฐ์๊ฐ ์ง์ ์ดฌ์ํ ์ฌ์ง์ ๋ฐํ์ผ๋ก ์์ฑ๋ ์๊ฐํ ๊ฒฐ๊ณผ์ด๋ค.
| Example 1 | Example 2 | Example 3 |
|---|---|---|
![]() |
![]() |
![]() |
๊ฐ ์ธ๋ถ ํญ์์ ์ ๊ณต๋๋ ์๊ฐํ ์์๋ ๋ค์๊ณผ ๊ฐ๋ค.
์ด ์์๋ค์ VisionCraft๊ฐ ๋จ์ํ ์ต์ข ๊ฒฐ๊ณผ ์ด๋ฏธ์ง ํ๋๋ง ๋ฐํํ๋ ๋๊ตฌ๊ฐ ์๋๋ผ, ๊ฐ ๋จ๊ณ์์ ์ด๋ค ๋ถ์๊ณผ ๋ณด์ ์ด ์ผ์ด๋ฌ๋์ง๋ฅผ ์ฌ์ฉ์๊ฐ ์ง์ ์ถ์ ํ ์ ์๋๋ก ์ค๊ณ๋์ด ์์์ ๋ณด์ฌ์ค๋ค.
VisionCraft๋ ํญ๋ณ ์๊ฐํ๋ฟ ์๋๋ผ, ๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ํ๋์ ํด์ ๊ฐ๋ฅํ report ํํ๋ก๋ ์ ๋ฆฌํ๋ค. ๋ค์ ์์๋ ์ค์ ๋ก ์ฌ์ฉ์์๊ฒ ์ด๋ค ์ข ๋ฅ์ ๋ถ์ ์ ๋ณด๊ฐ ์ ๊ณต๋๋์ง๋ฅผ ๋ณด์ฌ์ค๋ค.
| Analysis 1 | Analysis 2 |
|---|---|
![]() |
![]() |
| Analysis 3 | Analysis 4 |
|---|---|
![]() |
![]() |
Scene classification์ ๊ฒ๋ณด๊ธฐ์๋ ๋น๊ต์ ์ง๊ด์ ์ธ ๋ฌธ์ ์ฒ๋ผ ๋ณด์ด์ง๋ง, ์ค์ ๋ก๋ ๋์ intra-class variation๊ณผ ๊ฐํ inter-class similarity ๋๋ฌธ์ ์์ ์ ์ธ decision boundary๋ฅผ ํ์ฑํ๊ธฐ ์ด๋ ต๋ค. ๋์ผํ class label์ ๊ฐ์ง ์ด๋ฏธ์ง๋ค์ด ํญ์ ๋์ผํ visual pattern์ ๊ณต์ ํ๋ ๊ฒ์ ์๋๋ฉฐ, ์๋ก ๋ค๋ฅธ class๋ค์ด ๋งค์ฐ ์ ์ฌํ object composition๊ณผ color distribution์ ๊ฐ๋ ๊ฒฝ์ฐ๋ ๋น๋ฒํ๋ค.
๋ํ์ ์ธ ์๊ฐ restaurant_cafe์ kitchen_dining, waterfront์ mountain_valley, public_large_indoor์ corridor_lobby ๊ฐ์ class pair์ด๋ค. ์ด๋ฌํ ์ฅ๋ฉด๋ค์ ์๋ก ๋ค๋ฅธ semantic identity๋ฅผ ๊ฐ์ง๋ง, visual evidence๋ง ๋๊ณ ๋ณด๋ฉด ๋์ผํ๊ฑฐ๋ ๋งค์ฐ ๊ฐ๊น์ด latent cluster๋ฅผ ํ์ฑํ๊ธฐ ์ฝ๋ค.
ํนํ waterfront์ฒ๋ผ class ์ด๋ฆ์ ๋ถ๋ช
ํ์ง๋ง ์ค์ ์ด๋ฏธ์ง ์์์ ๋ฌผ ์์ญ์ด ์๊ฑฐ๋, ๋ฐ๋๋ก ํ๋๊ณผ ์ฐ์ด ๋ ํฌ๊ฒ ๋ณด์ด๋ ๊ฒฝ์ฐ ๋ชจ๋ธ์ mountain_valley ๋๋ ์ผ๋ฐ outdoor landscape์์ ๊ฒฝ๊ณ๋ฅผ ์์ ์ ์ผ๋ก ์ ์งํ๊ธฐ ์ด๋ ต๋ค. ์ฆ scene classification์ ํต์ฌ ๋์ ๋ class-level semantic identity์ image-level appearance ์ฌ์ด์ ๊ฐ๊ทน์ด๋ผ๊ณ ๋ณผ ์ ์๋ค.
๋ณธ ์ฐ๊ตฌ๋ ์ด ๋ฌธ์ ๋ฅผ ์ํํ๊ธฐ ์ํด, visual feature๋ง์ผ๋ก class๋ฅผ ๋ถ๋ฆฌํ๋ ๋์ class-level text prior๋ฅผ latent space์ ์ฃผ์ ํ๋ ๋ฐฉ์์ ํ๊ตฌํ๋ค. ํต์ฌ ๊ฐ์ ์ ๋ค์๊ณผ ๊ฐ๋ค.
- raw visual feature๋ง์ผ๋ก๋ ambiguousํ sample์ด๋ผ๋ class semantic description์ ํจ๊ป ์ฃผ์ ํ๋ฉด latent representation์ด ๋ณด๋ค semantically organized๋ ๋ฐฉํฅ์ผ๋ก ์ ๋ ฌ๋ ์ ์๋ค.
- ๊ทธ ๊ฒฐ๊ณผ visually similar but semantically different scene pair์ ๊ฒฝ๊ณ๊ฐ ๋ ์์ ํ๋ ์ ์๋ค.
VisionCraft์ ์ฐ๊ตฌ ํ์ดํ๋ผ์ธ์ ์ด ๊ฐ์ค์ ๊ฒ์ฆํ๊ธฐ ์ํด visual-only baseline, vanilla text cross-attention, text cross-attention + InfoNCE์ ์ธ ์ค์ ์ ๋น๊ตํ๋ค.
์ฐ๊ตฌ์ ์ฌ์ฉ๋ ๋ฐ์ดํฐ์
์ ์ถ๋ฐ์ ์ MIT CSAIL์ด ๊ณต๊ฐํ Places365 scene recognition dataset์ด๋ค. Places ๊ณ์ด ๋ฐ์ดํฐ์
์ object-centric classification์ด ์๋๋ผ scene-centric recognition์ ๋ชฉํ๋ก ์ค๊ณ๋ ๋ํ์ ์ธ ๋๊ท๋ชจ ์ฅ๋ฉด ์ธ์ ๋ฐ์ดํฐ์
์ผ๋ก, ์ฌ๋, ์๋์ฐจ, ์ปต์ฒ๋ผ ๊ฐ๋ณ ๊ฐ์ฒด๋ฅผ ๋งํ๋ ๋์ bedroom, street, restaurant, forest์ ๊ฐ์ ํ๊ฒฝ ์์ฒด๋ฅผ ๋ถ๋ฅํ๋ ๋ฐ ์ด์ ์ ๋๋ค.
๊ณต์ ์ฌ์ดํธ์ ๋ฐ๋ฅด๋ฉด Places ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ 10 million ์ด์ ์ด๋ฏธ์ง์ 400+ scene category๋ฅผ ํฌํจํ๋ ๋๊ท๋ชจ ์ฅ๋ฉด ์ดํด ๋ฐ์ดํฐ์ ๊ณ์ด์ด๋ฉฐ, ๊ทธ์ค Places365๋ 365๊ฐ์ ํต์ฌ scene category๋ฅผ ์ค์ฌ์ผ๋ก ๊ตฌ์ฑ๋ widely used benchmark subset์ด๋ค. ๋ํ ๊ณต๊ฐ๋ download page ๊ธฐ์ค์ผ๋ก Places365-Standard๋ 365๊ฐ class์ ๋ํด ์ฝ 1.8 million training image๋ฅผ ํฌํจํ๋ค.
๊ด๋ จ ๊ณต์ ๋งํฌ๋ ๋ค์๊ณผ ๊ฐ๋ค.
- Places ๊ณต์ ์ฌ์ดํธ: Places: A 10 million Image Database for Scene Recognition
- Places download page: Places365 / Places2 Download
Places365๊ฐ ๋ณธ ์ฐ๊ตฌ์ ์ ํฉํ ์ด์ ๋ ๋ค์๊ณผ ๊ฐ๋ค.
- scene category ์์ฒด๋ฅผ ์์ธกํ๋ benchmark์ด๋ฏ๋ก VisionCraft์ scene classification ๋ชฉํ์ ์ง์ ์ ์ผ๋ก ๋ง๋ฟ์ ์๋ค.
- indoor/outdoor, natural/man-made, private/public๊ณผ ๊ฐ์ ๊ณ ์์ค semantic distinction์ ํญ๋๊ฒ ํฌํจํ๋ค.
- ์๋ก ์๊ฐ์ ์ผ๋ก ์ ์ฌํ์ง๋ง ์๋ฏธ์ ์ผ๋ก๋ ๋ค๋ฅธ scene pair๊ฐ ์ถฉ๋ถํ ์กด์ฌํ์ฌ, semantic ambiguity์ representation learning ๋ฌธ์ ๋ฅผ ์คํํ๊ธฐ์ ์ ํฉํ๋ค.
๋ค๋ง Places365 ์๋ณธ label space๋ VisionCraft์ ์์ฉ ๋ชฉ์ ์ ๋นํด ์ง๋์น๊ฒ ์ธ๋ถ๋์ด ์๋ค. ์๋ฅผ ๋ค์ด ์ค์ enhancement ๊ด์ ์์๋ ์ธ๋ถ ์ฅ์๋ช ํ๋ํ๋๋ฅผ ๋ชจ๋ ๊ตฌ๋ถํ๋ ๊ฒ๋ณด๋ค, ์ฅ๋ฉด์ด indoor์ธ์ง outdoor์ธ์ง, ์์ฐ ํ๊ฒฝ์ธ์ง ์ค๋ด ์ํ ๊ณต๊ฐ์ธ์ง, ๊ณต๊ณต ์ค๋ด์ธ์ง ๊ฐ์ธ ์ค๋ด์ธ์ง์ ๊ฐ์ ์์ semantic grouping์ด ๋ ์ค์ํ ์ ์๋ค.
๋ฐ๋ผ์ ๋ณธ ์ฐ๊ตฌ์์๋ Places365 ์๋ณธ ์นดํ ๊ณ ๋ฆฌ๋ฅผ VisionCraft์ ์์ฉ ๋ชฉ์ ์ ๋ง๊ฒ ์ฌ๊ตฌ์ฑํ 14-class scene taxonomy๋ฅผ ์ฌ์ฉํ์๋ค. ์ด taxonomy๋ ๋จ์ benchmark score๋ฅผ ์ํ ํด๋์ค ์งํฉ์ด ์๋๋ผ, ์ค์ ์ด๋ฏธ์ง ๊ฐ์ ๊ณผ ์ฅ๋ฉด ์ดํด ๊ด์ ์์ ์๋ฏธ๊ฐ ์๋ ์์ semantic group์ ๋ง๋ค๊ธฐ ์ํด ์ค๊ณ๋์๋ค.
์ต์ข ํด๋์ค ์งํฉ์ ๋ค์๊ณผ ๊ฐ์ indoor/outdoor, natural/man-made, private/public ์ฑ๊ฒฉ์ ํจ๊ป ๋ฐ์ํ๋ค.
- bedroom
- office_study
- kitchen_dining
- restaurant_cafe
- corridor_lobby
- public_large_indoor
- residential_outdoor
- street_downtown
- transportation_hub_road
- waterfront
- mountain_valley
- forest_nature
- open_field_landscape
- urban_or_misc outdoor ๊ณ์ด ์ฅ๋ฉด
์๋ณธ Places365 label์ visioncraft_scene_mapping.py ์ ๋งคํ ๊ท์น์ ํตํด ์์ VisionCraft class๋ก ์ฌ๊ตฌ์ฑ๋๋ค. ์ด ์ค๊ณ์ ํต์ฌ ๋ชฉ์ ์ ๋ ๊ฐ์ง์ด๋ค.
- ์ ํ๋ฆฌ์ผ์ด์ ๊ด์ ์์ ์ค์ scene-aware enhancement์ ์๋ฏธ ์๋ coarse semantic category๋ฅผ ๊ตฌ์ฑํ๋ ๊ฒ
- ์ฐ๊ตฌ ๊ด์ ์์ visually similar class pair๋ฅผ ์ผ๋ถ๋ฌ ๋จ๊ฒจ ๋์ด representation learning์ ํ๊ณ๋ฅผ ๋๋ฌ๋ด๋ ๊ฒ
์ฆ ๋ณธ ๋ฐ์ดํฐ์ ์ classification ์์ฒด๋ณด๋ค๋, semantic ambiguity๊ฐ ๋์ scene classification ํ๊ฒฝ์ ์๋์ ์ผ๋ก ๊ตฌ์ถํ๊ธฐ ์ํ experimental substrate์ ๊ฐ๊น๋ค.
๋ณธ ์ฐ๊ตฌ์์ ๊ธฐ๋ณธ visual backbone์ผ๋ก ResNet50์ ์ ํํ ์ด์ ๋ ๋จ์ํ ๋๋ฆฌ ์ฐ์ด๋ ๋คํธ์ํฌ์ด๊ธฐ ๋๋ฌธ์ด ์๋๋ผ, scene classification task์ ๊ตฌ์กฐ์ ํน์ฑ๊ณผ ์ฐ๊ตฌ ๋ชฉ์ ์ ๋์์ ๊ณ ๋ คํ๊ธฐ ๋๋ฌธ์ด๋ค.
์ฒซ์งธ, ResNet์ residual block์ ๊น์ ๋คํธ์ํฌ ํ์ต์์ optimization difficulty๋ฅผ ์ํํ๋ค. ์ผ๋ฐ์ ์ธ residual block์ ๋ชฉํ ํจ์
์ ํํ๋ก residual correction
๊ฐ ๋๋ฉฐ, ๋ง์ฝ ์ด๋ค block์ด identity mapping์ ๊ฐ๊น์ด ๋์์ ํด์ผ ํ๋ค๋ฉด residual branch๋ ๋จ์ํ
๋ํ loss
ํํ๊ฐ ๋๋ฏ๋ก, shortcut path์ identity term์ด gradient flow๋ฅผ ์์ ํํ๊ณ degradation problem๊ณผ vanishing gradient๋ฅผ ์ํํ๋ ๋ฐ ๋์์ ์ค๋ค.
๋์งธ, scene classification์ object recognition๋ณด๋ค ๋ ๋์ contextual reasoning์ ์๊ตฌํ๋ค. ๋ฌผ์ฒด ํ๋์ ์กด์ฌ ์ฌ๋ถ๋ง์ด ์๋๋ผ, ๊ณต๊ฐ ๊ตฌ์กฐ, ๋ฐฐ๊ฒฝ ๋ถํฌ, texture arrangement, horizon-like cues, semantic co-occurrence๋ฅผ ํจ๊ป ๋ฐ์ํด์ผ ํ๋ค. ResNet50์ ResNet18๋ณด๋ค ๋ ๊น๊ณ ํ๋ถํ feature hierarchy๋ฅผ ์ ๊ณตํ๋ฏ๋ก, such scene-level compositional pattern์ ๋ ์์ ์ ์ผ๋ก encodingํ ์ ์๋ค.
์ ์งธ, ๋ณธ ์ฐ๊ตฌ์ ๋ชฉํ๋ ๋จ์ผ ์ต๊ณ ์ฑ๋ฅ ๋ชจ๋ธ์ ํ ๋ฒ ์ป๋ ๊ฒ์ด ์๋๋ผ, visual-only baseline, text-guided fusion, InfoNCE extension์ ๋น๊ตํ๋ฉฐ latent representation ๋ณํ๋ฅผ ํด์ํ๋ ๋ฐ ์๋ค. ResNet50์ ํํ๋ ฅ๊ณผ ์คํ ๋ฐ๋ณต ๊ฐ๋ฅ์ฑ ์ฌ์ด์์ ์ ์ ํ ๊ท ํ์ ์ ๊ณตํ๋ฏ๋ก, ์ฐ๊ตฌ์ฉ backbone์ผ๋ก ํ์ค์ ์ธ ์ ํ์ด์๋ค.
ํ์ต์ supervised scene classification์ ๊ธฐ๋ณธ ์ถ์ผ๋ก ํ๋, fusion mode์ ๋ฐ๋ผ auxiliary signal์ด ๋ฌ๋ผ์ง๋๋ก ์ค๊ณํ์๋ค. ๊ธฐ๋ณธ์ ์ธ objective๋ class label์ ๋ํ cross-entropy loss์ด๋ฉฐ, text-guided model์ ๊ฒฝ์ฐ์๋ visual-text fusion ์ดํ์ fused latent๋ฅผ classifier์ ์ ๋ ฅํ๋ค.
Visual-only baseline์ ๊ฒฝ์ฐ ์
๋ ฅ ์ด๋ฏธ์ง
์ต์ข supervised classification loss๋
์ด๋ค.
Text-guided model์์๋ backbone์ด ์์ฑํ spatial feature map์ flattenํ์ฌ visual token sequence๋ฅผ ๋ง๋ค๊ณ , class-level text embedding์ text token sequence๋ก ์ฌ์ฉํ๋ค. ์ดํ cross-attention์ ํตํด fused visual token์ ๊ตฌ์ฑํ๊ณ , mean pooling๊ณผ layer normalization ๋ค classifier์ ๋ฃ๋๋ค.
ํ์ต ์์ ํ๋ฅผ ์ํด ๋ณธ ํ๋ก์ ํธ๋ ๋ค์๊ณผ ๊ฐ์ pragmatic strategy๋ฅผ ์ฌ์ฉํ๋ค.
- ์ด๋ฐ 2 epoch ๋์ backbone freeze
- backbone unfreeze ์ดํ end-to-end fine-tuning
ReduceLROnPlateauscheduler ์ฌ์ฉ- validation accuracy ๊ธฐ์ค best checkpoint ์ ์ฅ
- optional early stopping support
ํนํ backbone freeze๋ multimodal fusion layer๊ฐ ์ด๊ธฐ๋ถํฐ backbone representation ์ ์ฒด๋ฅผ ๊ณผ๋ํ๊ฒ ํ๋๋ ๊ฒ์ ๋ง๊ธฐ ์ํ ๋ชฉ์ ์ด ํฌ๋ค. ์ค์ ๋ก InfoNCE ์คํ์์๋ ์ด๋ฐ freeze๊ฐ ์๋ ์ค์ ๋ณด๋ค freeze 2 epoch ์ค์ ์ด ํจ์ฌ ์์ ์ ์ธ validation behavior๋ฅผ ๋ณด์๋ค.
ํ์ฌ text-guided cross-attention ๊ณ์ด ์คํ์์ ์ฌ์ฉํ ํต์ฌ hyperparameter๋ ๋ค์๊ณผ ๊ฐ๋ค.
- backbone:
ResNet50 - image size:
224 - batch size:
16 - optimizer:
AdamW - learning rate:
1e-4 - weight decay:
1e-5 - label smoothing:
0.1 - freeze backbone epochs:
2 - cross-attention dropout:
0.1
InfoNCE extension์์๋ ์ฌ๊ธฐ์ ๋ค์ ๋ ํ๋ผ๋ฏธํฐ๊ฐ ์ถ๊ฐ๋๋ค.
- text contrastive weight
$\lambda_{con} = 0.05$ - text contrastive temperature
$\tau = 0.10$
์ด ๊ฐ๋ค์ ์์ ํ ์ด๋ก ์ ์ผ๋ก ๋์ถ๋ ์์๋ผ๊ธฐ๋ณด๋ค, representation alignment์ classification accuracy ์ฌ์ด์ trade-off๋ฅผ ๊ณ ๋ คํด ์ ํํ empirical setting์ด๋ค. ๊ธฐ์กด์ ๋ ๊ฐํ ์ค์ ๋ณด๋ค contrastive weight๋ฅผ ๋ฎ์ถ๊ณ temperature๋ฅผ ์๋งํ๊ฒ ๋์์ผ๋ก์จ, prototype alignment ์๋ ฅ์ด ๊ณผ๋ํ๊ฒ ์ปค์ง๋ ๋ฌธ์ ๋ฅผ ์ค์ด๊ณ ์ ํ๋ค.
์ต์ข
A ์ค์ ์ ์ด๋ฌํ ์กฐ์ ์ด ์ค์ ๋ก ์ ํจํ์์ ๋ณด์ฌ์ค๋ค. ๋์ผํ ํ์ต recipe ์์์ contrastive weight๋ฅผ 0.05๋ก ๋ฎ์ถ๊ณ temperature๋ฅผ 0.10์ผ๋ก ์กฐ์ ํ ๊ฒฐ๊ณผ, Text Cross-Attention + InfoNCE ๋ชจ๋ธ์ ์ต์ข
validation accuracy 60.75%๋ฅผ ๊ธฐ๋กํ๋ฉฐ vanilla text cross-attention์ 60.56%๋ฅผ ๋ค์ ๋์ด์ฐ๋ค.
VisionCraft์ ์ฐ๊ตฌ ํ์ดํ๋ผ์ธ์ ๊ฐํ synthetic augmentation๋ณด๋ค, ์ฅ๋ฉด identity๋ฅผ ์ง๋์น๊ฒ ํผ์ํ์ง ์๋ ๋ฒ์์ standard augmentation์ ์ฌ์ฉํ๋ ์ชฝ์ ๊ฐ๊น๋ค. ์ด์ ๋ scene classification์์๋ geometric consistency์ global context๊ฐ ์ค์ํ๊ธฐ ๋๋ฌธ์ด๋ค.
๋ํ ํ์ต ์ฝ๋์๋ optional mixup support๊ฐ ์กด์ฌํ๋ค. mixup coefficient
๋ก mixed sample์ ๋ง๋ค ์ ์๋ค. ๋ค๋ง ํ์ฌ text-cross-attention ์คํ์ ํต์ฌ ๋น๊ต์์๋ mixup์ ์ค์ฌ ์ค์ ์ผ๋ก ์ฌ์ฉํ์ง ์์๊ณ , semantic prior์ ํจ๊ณผ๋ฅผ ๋ ๋ช ํํ ๋ณด๊ธฐ ์ํด relatively conservativeํ augmentation policy๋ฅผ ์ ์งํ์๋ค.
Visual-only baseline์ ๋ณธ ์ฐ๊ตฌ์ ์ถ๋ฐ์ ์ด๋ค. ์ด ๋ชจ๋ธ์ ์ด๋ฏธ์ง ์ธ์ ์ด๋ค semantic prior๋ ์ฌ์ฉํ์ง ์์ผ๋ฉฐ, ์ค์ง visual evidence๋ง์ผ๋ก 14-class scene taxonomy๋ฅผ ๋ถ๋ฅํ๋ค.
ํ์์ ์ผ๋ก๋
์ ๊ตฌ์กฐ๋ฅผ ๊ฐ์ง๋ค. ๋ณธ ์คํ์์ ์ด baseline์ validation accuracy 59.79%๋ฅผ ๊ธฐ๋กํ์๋ค.
์ด baseline์ ๋ ๊ฐ์ง ์ด์ ๋ก ์ค์ํ๋ค.
- text prior๊ฐ ์ ํ ์๋ ์์ visual representation์ ๊ธฐ์ค์ ์ ์ ๊ณตํ๋ค
- ์ดํ text-guided model์ด ๋จ์ํ score gain๋ง์ด ์๋๋ผ latent geometry๋ฅผ ์ด๋ป๊ฒ ๋ฐ๊พธ๋์ง ๋น๊ตํ ์ ์๊ฒ ํด์ค๋ค
ํนํ confusion์ด ์์ฃผ ๋ฐ์ํ๋ class pair๋ ๋๋ถ๋ถ semantic overlap์ด ํฐ ์์ด๋ผ๋ ์ ์์, baseline์ scene classification์ ๊ทผ๋ณธ์ ์ธ ambiguity๋ฅผ ์ ๋๋ฌ๋ด๋ ์ถ๋ฐ์ ์ผ๋ก ๊ธฐ๋ฅํ๋ค.
Text-guided model์ ์ถ๋ฐ์ ์ ๊ฐ scene class๋ฅผ ์ค๋ช ํ๋ class-level text prompt์ด๋ค. ์ด prompt๋ค์ scene_text_prompts.py ์ ์ ์๋์ด ์์ผ๋ฉฐ, ๋จ์ํ class name๋ง์ด ์๋๋ผ ํด๋น ์ฅ๋ฉด์ ์ค๋ช ํ๋ ์งง์ ์์ฐ์ด ๋ฌธ์ฅ์ผ๋ก ๊ตฌ์ฑ๋๋ค.
๊ฐ prompt๋ CLIP text encoder๋ฅผ ํตํด embedding vector
์ฌ๊ธฐ์ .npz ํ์ผ๋ก ์ ์ฅ๋๋ฉฐ, ํ์ต ์ค์๋ fixed class-level text token์ผ๋ก ์ฌ์ฉ๋๋ค.
์ด ์ค๊ณ๋ ํ์ต ๊ณผ์ ์์ text encoder๊น์ง ํจ๊ป ์ ๋ฐ์ดํธํ๋ ๋์ , stable semantic prior๋ฅผ ์ธ๋ถ์์ ์ฃผ์ ํ๋ ์ ๋ต์ ํด๋นํ๋ค.
ํ์ฌ ๊ตฌํ์ text-guided fusion์ text_cross_attention.py ์ ์ ์๋ ๋จ๋ฐฉํฅ cross-attention ๊ตฌ์กฐ์ด๋ค. ResNet50 backbone์ด ๋ง๋ feature map์ flattenํ์ฌ visual token sequence๋ฅผ ๊ตฌ์ฑํ๋ฉด,
๊ฐ ๋๋ค. ํํธ class-level text embedding ์งํฉ์
์ token sequence๋ก ๋ณผ ์ ์๋ค.
๋ ์ํ์ค๋ ๊ฐ๊ฐ hidden dimension์ผ๋ก projection๋ ๋ค,
์ ํํ๋ก attention์ ๋ค์ด๊ฐ๋ค. ์ฆ query๋ visual token์์ ์ค๊ณ , key/value๋ text token์์ ์จ๋ค. ๋ฐ๋ผ์ ์ด๋ visual-to-text cross-attention์ด๋ค.
attention output์
๋ก ๊ณ์ฐ๋๋ฉฐ, ์ต์ข fused token์ residual connection๊ณผ feed-forward block์ ๊ฑฐ์ณ
์ ํํ๋ก ์ป์ด์ง๋ค. ์ดํ token ํ๊ท ์ ์ทจํด pooled fused latent๋ฅผ ๋ง๋ ๋ค.
์ด fused latent๊ฐ classifier ์ ๋ ฅ์ผ๋ก ์ฌ์ฉ๋๋ค.
InfoNCE extension์ ๋ชฉ์ ์ text๋ฅผ ๋จ์ anchor๋ก๋ง ์ฐ๋ ๋ฐ์ ๊ทธ์น์ง ์๊ณ , fused latent๊ฐ ์์ ์ ์ ๋ต class text prototype์ ๋ ์ง์ ์ ์ผ๋ก ์ ๋ ฌ๋๋๋ก ํ์ต ์ ํธ๋ฅผ ์ถ๊ฐํ๋ ๊ฒ์ด๋ค.
๋จผ์ fused latent
๊ทธ ๋ค์ cosine similarity matrix๋ฅผ
๋ก ์ ์ํ๋ค. ์ฌ๊ธฐ์
์ด๋ฉฐ, ์ต์ข ํ์ต objective๋
์ผ๋ก ๊ตฌ์ฑ๋๋ค.
์ค์ํ ์ ์ InfoNCE๊ฐ cross-attention block ๋ด๋ถ ๊ตฌ์กฐ๋ฅผ ๋ฐ๊พธ๋ ๊ฒ์ด ์๋๋ผ, fused latent์ text prototype ์ฌ์ด์ auxiliary supervision์ ์ถ๊ฐํ๋ค๋ ๊ฒ์ด๋ค. ๋ฐ๋ผ์ vanilla text cross-attention์ด semantic anchor injection์ ๊ฐ๊น๋ค๋ฉด, InfoNCE extension์ prototype-aware alignment pressure๋ฅผ ๋ํ๋ variant๋ผ๊ณ ๋ณผ ์ ์๋ค.
์ต์ข
A ์ค์ ์ validation accuracy 60.75%๋ฅผ ๊ธฐ๋กํ์๋ค. ์ด๋ ๊ธฐ์กด visual-only baseline 59.79%, vanilla text cross-attention 60.56%๋ฅผ ๋ชจ๋ ๋์ด์ ์์น์ด๋ฉฐ, InfoNCE๊ฐ ๋จ์ํ semantic smoothing์ ๋์ด prototype-aware alignment๋ฅผ ์ค์ ๋ถ๋ฅ ์ฑ๋ฅ ํฅ์์ผ๋ก ์ฐ๊ฒฐํ ์ ์์์ ๋ณด์ฌ์ค๋ค.
Text prior๊ฐ ๋์์ด ๋๋ ์ด์ ๋ text๊ฐ visual feature๋ฅผ ๋์ฒดํ๊ธฐ ๋๋ฌธ์ด ์๋๋ผ, visual representation์ด semantic direction์ ๊ฐ๋๋ก ์ฝํ ๊ตฌ์กฐ์ bias๋ฅผ ์ ๊ณตํ๊ธฐ ๋๋ฌธ์ด๋ค.
Visual-only baseline์ image appearance์ ํฌ๊ฒ ์์กดํ๋ฏ๋ก, object composition์ด ์ ์ฌํ class pair๋ฅผ ์ฝ๊ฒ ํผ๋ํ๋ค. ๋ฐ๋ฉด class-level text token์ด ํจ๊ป ๋ค์ด์ค๋ฉด, ๋ชจ๋ธ์ "์ด ์ฅ๋ฉด์ด ์ด๋ค semantic category์ ์ํ ์ ์๋๊ฐ"์ ๋ํ ์ถ๊ฐ ๋จ์๋ฅผ ์ป๊ฒ ๋๋ค.
์ด๋ฌํ ํจ๊ณผ๋ ํนํ ๋ค์๊ณผ ๊ฐ์ ์ํฉ์์ ๊ธฐ๋ํ ์ ์๋ค.
- class ๋ด๋ถ ๋ณ์ด๊ฐ ํฐ ๊ฒฝ์ฐ
- image appearance๊ฐ atypicalํ ๊ฒฝ์ฐ
- background context๊ฐ object cue๋ณด๋ค ์ค์ํ ๊ฒฝ์ฐ
- coarse semantic grouping์ด ๋ถ๋ฅ ์์ ์ฑ์ ๋์์ด ๋๋ ๊ฒฝ์ฐ
์ฆ text๋ fine-grained pixel evidence๋ฅผ ์ง์ ์ ๊ณตํ์ง๋ ์์ง๋ง, latent representation์ด scene-level meaning๊ณผ ๋ ์ผ๊ด๋๊ฒ ์ ๋ ฌ๋๋๋ก ๋์์ฃผ๋ semantic prior ์ญํ ์ ํ๋ค.
Text-guided cross-attention์ ํ ๊ฐ์ง ์ค์ํ ํจ๊ณผ๋ semantic smoothing์ด๋ค. ์ด๋ ๋ชจ๋ class boundary๋ฅผ ๋ฌด์กฐ๊ฑด sharpenํ๋ ๊ฒ์ด ์๋๋ผ, ์๋ฏธ์ ์ผ๋ก ๊ฐ๊น์ด class๋ค์ด ๊ฐ์ semantic neighborhood ์์์ ๋ ๋ถ๋๋ฝ๊ฒ ์ฌ๋ฐฐ์น๋๋ ํ์์ ๋ปํ๋ค.
์๋ฅผ ๋ค์ด restaurant_cafe์ kitchen_dining, waterfront์ mountain_valley, public_large_indoor์ corridor_lobby๋ ์์ semantic group์ ๊ณต์ ํ๋ค. text prior๊ฐ ์ฃผ์
๋๋ฉด ์ด๋ฌํ class๋ค์ latent centroid๋ ์์ ํ ๋ฉ์ด์ง๊ธฐ๋ณด๋ค, ๊ณตํต semantic manifold ์์์ ๋ ๊ตฌ์กฐํ๋ ๋ฐฐ์ด์ ํ์ฑํ ์ ์๋ค.
์ด ํ์์ ์ฅ์ ๊ณผ trade-off๋ฅผ ๋์์ ๊ฐ์ง๋ค.
- ์ฅ์ : visually noisyํ๊ฑฐ๋ atypicalํ sample์ semantic identity๋ฅผ ๋ ์์ ์ ์ผ๋ก ์ ์งํ ์ ์๋ค
- trade-off: fine-grained separator๊ฐ ํ์ํ class pair์์๋ ์ผ๋ถ confusion์ด ๋จ๊ฑฐ๋ ์ฆ๊ฐํ ์ ์๋ค
๋ฐ๋ผ์ text-guided model์ ๋จ์ํ margin maximizer๋ผ๊ธฐ๋ณด๋ค, latent geometry๋ฅผ coarse semantic structure์ ๋ง์ถฐ ์ฌ์ ๋ ฌํ๋ semantic smoother๋ก ํด์ํ๋ ํธ์ด ๋ ์ ํํ๋ค.
InfoNCE extension์ ์ semantic smoothing ํจ๊ณผ ์์, ์ ๋ต class text prototype ์ชฝ์ผ๋ก ์ค์ ๋ก ๋ ๋ถ๋๋ก ํ๋ ๋ช
์์ alignment objective๋ฅผ ๋ํ๋ค. ์ด ์ ์ด vanilla text cross-attention๊ณผ์ ๊ฐ์ฅ ํฐ ์ฐจ์ด์ ์ด๋ค.
Vanilla text model์์๋ text token์ด attention ๊ณผ์ ์์ semantic anchor๋ก ์๋ํ์ง๋ง, ์ต์ข fused latent๊ฐ ์์ ์ class text prototype๊ณผ ํญ์ ์ง์ ์ ์ผ๋ก ๊ฐ๊น์์ง ํ์๋ ์๋ค. ๋ฐ๋ฉด InfoNCE๊ฐ ์ถ๊ฐ๋๋ฉด fused latent๋ rival prototype๋ณด๋ค correct-class prototype์ ๋ ๋์ cosine similarity๋ฅผ ๊ฐ๋๋ก ์ง์์ ์ผ๋ก ์๋ฐ๋ฐ๋๋ค.
์ด ๋ฉ์ปค๋์ฆ์ ๋ค์๊ณผ ๊ฐ์ ํจ๊ณผ๋ฅผ ๊ธฐ๋ํ๊ฒ ํ๋ค.
- prototype retrieval accuracy ํฅ์
- same-class compactness ์ฆ๊ฐ
- text-aware decision boundary์ ์์ ํ
๋ฐ๋ฉด alignment pressure๊ฐ ๋๋ฌด ํฌ๋ฉด semantic neighbor class ์ฌ์ด์ separation์ ์คํ๋ ค ๊ณผ๋ํ๊ฒ ๋ถ๋๋ฝ๊ฒ ๋ง๋ค ์ ์๋ค. ๋ฐ๋ผ์ contrastive weight์ temperature๋ accuracy์ representation quality ์ฌ์ด์ ๊ท ํ์ ์ข์ฐํ๋ ํต์ฌ hyperparameter๊ฐ ๋๋ค.
์ต์ข validation accuracy ๊ฒฐ๊ณผ๋ ๋ค์๊ณผ ๊ฐ๋ค.
| Model | Validation Accuracy |
|---|---|
| Visual-only baseline | 59.79% |
| Text-Guided Cross-Attention | 60.56% |
| Text Cross-Attention + InfoNCE | 60.75% |
์ธ ๋ชจ๋ธ ๋ชจ๋ ๊ฒฝ์์ ์ธ ์ฑ๋ฅ์ ๋ณด์์ง๋ง, ์ค์ํ ์ ์ text๋ฅผ ์ฃผ์
ํ ๋ ๋ชจ๋ธ์ด ๋ชจ๋ visual-only baseline์ ๋์ด์ฐ๋ค๋ ์ฌ์ค์ด๋ค. ํนํ ์ด๋ฒ ์ต์ข
์คํ์์๋ Text Cross-Attention + InfoNCE๊ฐ 60.75%๋ฅผ ๊ธฐ๋กํ๋ฉฐ, vanilla text cross-attention์ 60.56%๋ฅผ ๋ค์ ๋์ด์ฐ๋ค.
์ด ๊ฒฐ๊ณผ๋ ๋ ๊ฐ์ง๋ฅผ ์์ฌํ๋ค.
- class-level text prior ์์ฒด๊ฐ visual-only baseline๋ณด๋ค ์ ์๋ฏธํ ๋์์ ์ค๋ค.
- ์ ์ ํ hyperparameter๊ฐ ์ ์ฉ๋ InfoNCE objective๋ accuracy์ latent alignment๋ฅผ ๋์์ ๊ฐ์ ํ ์ ์๋ค.
Visual-only baseline confusion matrix:
Text-guided cross-attention confusion matrix:
Text-guided cross-attention + InfoNCE confusion matrix:
์ธ confusion matrix๋ฅผ ํจ๊ป ๋ณด๋ฉด, ์ฑ๋ฅ ๊ฐ์ ์ ๋ชจ๋ ํด๋์ค์์ ๋๊ฐ์ ๋ฐฉ์์ผ๋ก ๋ํ๋์ง ์๋๋ค. ์ค์ํ ๋ณํ๋ ๋จ์ํ diagonal entry๊ฐ ์ ์ฒด์ ์ผ๋ก ์ปค์ง๋ ๊ฒ์ด ์๋๋ผ, ์๋ก ์๋ฏธ์ ์ผ๋ก ๊ฐ๊น์ด ์ฅ๋ฉด๋ค ์ฌ์ด์ ํผ๋ ํจํด์ด ์ด๋ป๊ฒ ๋ค์ ์ ๋ ฌ๋๋๊ฐ์ ์๋ค. ์ฌ๊ธฐ์ semantic neighborhood๋ ๋จ์ํ ์์ด๋ ์ง๊ฐ์ด ๋น์ทํ ๊ฒฝ์ฐ๊ฐ ์๋๋ผ, ๋ณด๋ค ๊ฑฐ์์ ์ธ ์ฅ๋ฉด ๋งฅ๋ฝ์ ๊ณต์ ํ๋ class pair๋ฅผ ๊ฐ๋ฆฌํจ๋ค.
๋ํ์ ์ธ ์๋ ๋ค์๊ณผ ๊ฐ๋ค.
kitchen_diningโrestaurant_cafewaterfrontโmountain_valleypublic_large_indoorโcorridor_lobby
Visual-only baseline์์ vanilla text cross-attention์ผ๋ก ๊ฐ๋ฉด, ์ผ๋ถ ๋ฐฉํฅ์ confusion์ ์คํ๋ ค ์ฆ๊ฐํ๋ค.
restaurant_cafe -> kitchen_dining:89 -> 139public_large_indoor -> corridor_lobby:85 -> 112waterfront -> mountain_valley:165 -> 171
ํ์ง๋ง ๋ฐ๋ ๋ฐฉํฅ๊ณผ ์ ๋ถ๋ฅ ์๋ฅผ ํจ๊ป ๋ณด๋ฉด, ์ด ๋ณํ๋ ๋จ์ํ ์ฑ๋ฅ ์ ํ๋ผ๊ธฐ๋ณด๋ค decision boundary์ ์ฌ์กฐ์ ์ ๊ฐ๊น๋ค.
kitchen_dining -> restaurant_cafe:117 -> 77๋ก ๊ฐ์kitchen_dining์ ๋ถ๋ฅ ์:174 -> 232๋ก ์ฆ๊ฐmountain_valley์ ๋ถ๋ฅ ์:362 -> 400์ผ๋ก ์ฆ๊ฐoffice_study์ ๋ถ๋ฅ ์:482 -> 509๋ก ์ฆ๊ฐ
์ฆ vanilla text model์ ๋ชจ๋ semantic neighbor๋ฅผ ๊ฐ์ ๋ก ๋ผ์ด ๋๊ธฐ๋ณด๋ค, ๊ฐ์ ์์ ์๋ฏธ ๊ณต๊ฐ ์์์ ๋ ๋ถ๋๋ฝ๊ฒ ์ฌ๋ฐฐ์นํ๋ ๊ฒฝํฅ์ ๋ณด์ธ๋ค.
InfoNCE๋ฅผ ์ถ๊ฐํ๋ฉด ์์์ด ๋ค์ ๋ฌ๋ผ์ง๋ค. ์ต์ข
accuracy๊ฐ 60.75%๊น์ง ์ฌ๋ผ๊ฐ๊ณ , confusion report์์๋ ์ผ๋ถ ํด๋์ค์ ์ ๋ถ๋ฅ ์๊ฐ ๋ ๊ฐํ๊ฒ ์ ์ง๋๋ค. ์๋ฅผ ๋ค์ด:
bedroomrecall:0.8200mountain_valleyrecall:0.7300office_studyrecall:0.7286open_field_landscaperecall:0.7460street_downtownrecall:0.7500
๋ฐ๋ฉด ์ฌ์ ํ ์ด๋ ค์ด ํด๋์ค๋ ๋จ์ ์๋ค.
public_large_indoorrecall:0.3217transportation_hub_roadrecall:0.3533corridor_lobbyrecall:0.4825waterfrontrecall:0.4840
๋ฐ๋ผ์ confusion matrix ๊ด์ ์์ ๋ณด๋ฉด, vanilla text cross-attention์ semantic smoothing ์ชฝ์ ๊ฐ๊น๊ณ , InfoNCE๋ ๊ทธ ์์์ class-aware separation์ ์ผ๋ถ ํ๋ณตํ๋ฉด์ ์ต์ข accuracy๊น์ง ๋์ด์ฌ๋ฆฐ variant๋ก ํด์ํ ์ ์๋ค.
Triplet UMAP comparison:
UMAP์ ์ ์ฒด latent space์ global arrangement๋ฅผ ๊ฐ์ฅ ์ง๊ด์ ์ผ๋ก ๋ณด์ฌ์ฃผ๋ ์๊ฐํ์ด๋ค. Visual-only baseline์์๋ ์ผ๋ถ ํด๋์ค๊ฐ ๊ตญ์์ ์ผ๋ก ๋ชจ์ฌ ์์ง๋ง, ์ ์ฒด์ ์ผ๋ก๋ ์ค์ ์์ญ์ ์ฌ๋ฌ ํด๋์ค๊ฐ ๋๊ฒ ์์ฌ ์์ผ๋ฉฐ class boundary๊ฐ ๋ถ๊ท์นํ๊ฒ ์ฝํ ์๋ค. ํนํ kitchen_dining, restaurant_cafe, public_large_indoor, residential_outdoor, transportation_hub_road ๊ฐ์ ํด๋์ค๋ค์ด ๋์ ์ค์ฌ๋ถ์์ ๋ค์์ด๋ ๊ฒฝํฅ์ด ๋ณด์ธ๋ค.
Vanilla text cross-attention์ผ๋ก ๊ฐ๋ฉด latent๋ ๋จ์ํ ์ ๊ตฌ๋ฆ(cloud)๋ณด๋ค ๋ ๊ธธ๊ฒ ์ด์ด์ง semantic manifold ํํ๋ก ์ฌ๋ฐฐ์น๋๋ค. ๊ฐ์ ํด๋์ค ์ํ๋ค์ด baseline๋ณด๋ค ๋ coherentํ ์์ ๋ฉ์ด๋ฆฌ๋ branch๋ก ์ ๋๋๋ ๊ฒฝํฅ์ด ๋ณด์ด์ง๋ง, ๋์์ semantically ๊ฐ๊น์ด ํด๋์ค๋ค์ ์๋ก ๋ ๊ฐ๊น์ด ๊ณตํต ๊ณต๊ฐ ์์ผ๋ก ๋๋ ค ๋ค์ด๊ฐ๋ค. ์ด๊ฒ์ด ๋ฐ๋ก ์ ์ confusion matrix์์ ๊ด์ฐฐ๋ semantic smoothing์ ๊ธฐํํ์ ํํ์ด๋ผ๊ณ ๋ณผ ์ ์๋ค.
InfoNCE๋ฅผ ์ถ๊ฐํ๋ฉด ์ด ๊ตฌ์กฐ๊ฐ ๋ค์ ํ ๋จ๊ณ ๋ฐ๋๋ค. semantic manifold ์์ฒด๋ ์ ์ง๋์ง๋ง, ํด๋์ค ๊ฒฝ๊ณ๊ฐ ๋ ๋๋ ทํด์ง๊ณ ์ค์ฌ๋ถ์ ๊ณผ๋ํ ํผํฉ์ด ์ค์ด๋ ๋ค. ์ฆ InfoNCE๋ vanilla text model์ด ๋ง๋ semantic prior๋ฅผ ์ ์งํ๋ฉด์, ๊ทธ ์์ class-aware separation์ ๋ค์ ๊ฐํํ๋ ์ญํ ์ ํ๋ค.
Triplet t-SNE comparison:
t-SNE๋ UMAP๋ณด๋ค ๋ local structure์ neighborhood ๊ด๊ณ๋ฅผ ๊ฐ์กฐํ๋ ์๊ฐํ๋ค. Baseline์์๋ ํด๋์ค๋ณ๋ก ๊ตญ์ ๊ตฐ์ง์ด ์กด์ฌํ๋๋ผ๋ ์ ์ฒด์ ์ผ๋ก ๋ง์ ์ํ์ด ์ค์ ๋์ญ๊ณผ ์ธ์ ์์ญ์ ์์ฌ ์์ผ๋ฉฐ, ํนํ ambiguity๊ฐ ํฐ ํด๋์ค๋ค์ด ํ๋์ ๋์ ๋ ์์์ ์ฝํ ์๋ค.
Vanilla text cross-attention์์๋ ์ด ๊ตฌ์กฐ๊ฐ ๋ ๊ธธ๊ณ ์ผ๊ด๋ ๋ฐฉํฅ์ฑ์ ๊ฐ์ง ๋ ํํ ๋๋ ๊ณก์ ํ ๊ตฐ์ง์ผ๋ก ๋ฐ๋๋ค. ์ด๋ latent๊ฐ ๋จ์ํ ์์ถ๋๋ ๊ฒ์ด ์๋๋ผ class-specific semantic axis ์์ ๋ฐฐ์น๋๊ณ ์์์ ๋ปํ๋ค. ๋ค๋ง ์ด ๋จ๊ณ์์๋ semantic neighbor๋ผ๋ฆฌ์ ๊ฐ๊ฒฉ์ด ์ค์ด๋๋ ๊ตฌ๊ฐ๋ ํจ๊ป ์๊ธด๋ค.
InfoNCE๋ฅผ ์ถ๊ฐํ๋ฉด semantic grouping์ ์ ์ง๋๋ฉด์๋ class๋ณ band๊ฐ baseline๊ณผ vanilla text๋ณด๋ค ๋ ๋ถ๋ช
ํ๊ฒ ๋๋๋ ๊ฒฝํฅ์ด ๋ํ๋๋ค. ๋ฐ๋ผ์ t-SNE ๊ด์ ์์๋ baseline -> semantic smoothing -> class-aware re-separation์ด๋ผ๋ 3๋จ๊ณ ๋ณํ๊ฐ ๋น๊ต์ ์ ๋ช
ํ๊ฒ ๊ด์ฐฐ๋๋ค.
์ด ์ ์ ์์น๋ค์ "๊ฐ์ ํด๋์ค ์ํ์ ์๋ก ๊ฐ๊น๊ณ , ๋ค๋ฅธ ํด๋์ค ์ํ์ ์๋ก ๋ฉ์ด์ผ ์ข์ ํํ"์ด๋ผ๋ ์์ฃผ ์ง๊ด์ ์ธ ๊ธฐ์ค์ ์ซ์๋ก ๋ฐ๊พผ ๊ฒ์ด๋ค. ์ฌ๊ธฐ์ cosine similarity๋ ๋ feature vector์ ๋ฐฉํฅ์ด ์ผ๋ง๋ ๋น์ทํ์ง๋ฅผ ๋ํ๋ด๋ฉฐ, ๊ฐ์ด ํด์๋ก ๋ ์ํ์ด latent space์์ ๋ ๋น์ทํ๊ฒ ๋ฐฐ์น๋์ด ์์์ ๋ปํ๋ค.
same-vs-different cosine margin์ ๊ฐ์ ํด๋์ค๋ผ๋ฆฌ์ ํ๊ท ์ ์ฌ๋์์ ๋ค๋ฅธ ํด๋์ค๋ผ๋ฆฌ์ ํ๊ท ์ ์ฌ๋๋ฅผ ๋บ ๊ฐ์ด๋ค. ๋ฐ๋ผ์ ์ด ๊ฐ์ด ํด์๋ก "๊ฐ์ ํด๋์ค๋ ๋ ๋ชจ์ด๊ณ , ๋ค๋ฅธ ํด๋์ค๋ ๋ ๋ถ๋ฆฌ๋๋" ๊ตฌ์กฐ๊ฐ ๊ฐํ๋ค๊ณ ํด์ํ ์ ์๋ค. silhouette score๋ ๊ฐ ์ํ์ด ์๊ธฐ ๊ตฐ์ง ์์๋ ์ ์ํ๊ณ ๋ค๋ฅธ ๊ตฐ์ง๊ณผ๋ ์ ๋จ์ด์ ธ ์๋์ง๋ฅผ ๋ณด๋ ์งํ๋ก, ๊ฐ์ด ๋์์๋ก ์ ์ฒด ๊ตฐ์ง ๊ตฌ์กฐ๊ฐ ๋ ๋๋ ทํ๋ค๋ ๋ป์ด๋ค.
Full 2520-sample latent comparison ๊ฒฐ๊ณผ๋ ๋ค์๊ณผ ๊ฐ๋ค.
| Metric | Baseline | Text Cross-Attention | Text Cross-Attention + InfoNCE |
|---|---|---|---|
| same-vs-different cosine margin | 0.1833 | 0.1886 | 0.3663 |
| silhouette score | 0.07863 | 0.07892 | 0.11291 |
์ด ์์น๋ค์ UMAP๊ณผ t-SNE์์ ๊ด์ฐฐํ ์๊ฐ์ ์ธ์์ ์ ๋์ ์ผ๋ก ๋ท๋ฐ์นจํ๋ค. Vanilla text model์ latent geometry๋ฅผ ์กฐ๊ธ ๋ semanticํ๊ฒ ์ ๋ํ์ง๋ง, ๊ทธ ๊ฐ์ ํญ์ ๋น๊ต์ ์๋งํ๋ค.
๋ฐ๋ฉด InfoNCE๋ ๋ ์งํ๋ฅผ ๋ชจ๋ ํฌ๊ฒ ๋์ด์ฌ๋ฆฐ๋ค. same-vs-different cosine margin์ด ๊ฑฐ์ ๋ ๋ฐฐ ์์ค์ผ๋ก ์ฆ๊ฐํ๊ณ , silhouette score ์ญ์ ๋์ ๋๊ฒ ์์นํ๋ค. ์ด๋ ์ด๋ฒ ์ต์ข
InfoNCE๊ฐ ๋จ์ํ accuracy๋ง ์ข์์ง ๊ฒ์ด ์๋๋ผ, latent space ์ ์ฒด๋ฅผ ๋ class-awareํ๊ณ ๋ ๊ตฌ์กฐํ๋ geometry๋ก ์ฌํธํ๋ค๋ ๊ฐํ ๊ทผ๊ฑฐ๊ฐ ๋๋ค.
์ด ์ ์ ๋ ๊ทธ๋ฆผ์ "ํด๋์ค ๋ด๋ถ ์์ง๋"์ "ํด๋์ค ์ฌ์ด ๋ถ๋ฆฌ๋"๋ฅผ ์๋ก ๋ค๋ฅธ ๊ด์ ์์ ๋ณด์ฌ์ค๋ค. ๋จผ์ boxplot์ ๋ง์ ์ํ์์ ๋ถํฌ๋ฅผ ์์ฝํ ๊ทธ๋ฆผ์ด๋ค. ๊ฐ์ด๋ฐ ์ ์ ๋ํ๊ฐ(์ค์๊ฐ), ์์์ ๋์ด๋ ๊ฐ๋ค์ด ์ฃผ๋ก ๋ชฐ๋ ค ์๋ ๋ฒ์, ๋ฐ๊นฅ์ผ๋ก ๋ป๋ ์ ์ ๋ ๋์ ๋ถํฌ ๋ฒ์๋ฅผ ๋ปํ๋ค. ์ฆ boxplot์ "๋์ฒด๋ก ์ด๋์ ๊ฐ์ด ๋ชจ์ฌ ์๋๊ฐ"๋ฅผ ๋น ๋ฅด๊ฒ ์ฝ๊ฒ ํด์ค๋ค.
์ฌ๊ธฐ์ same-class cosine์ ๊ฐ์ ํด๋์ค ์ํ๋ผ๋ฆฌ์ ์ ์ฌ๋์ด๊ณ , different-class cosine์ ์๋ก ๋ค๋ฅธ ํด๋์ค ์ํ๋ผ๋ฆฌ์ ์ ์ฌ๋์ด๋ค. ์ข์ ํํ์ด๋ผ๋ฉด ๋ณดํต same-class cosine์ ๋๊ณ , different-class cosine์ ๋ฎ๊ฒ ๋์ค๋ ๊ฒ์ด ๋ฐ๋์งํ๋ค. Heatmap์ ํด๋์ค ์ ์ฒด๋ฅผ ๋ํํ๋ centroid๋ผ๋ฆฌ์ ๊ฑฐ๋ฆฌ๋ฅผ ์์ผ๋ก ๋ณด์ฌ์ฃผ๋ ๊ทธ๋ฆผ์ด๋ค. ๋ฐ์์๋ก ๋ ํด๋์ค ์ค์ฌ์ด ๋ ๋ฉ๊ณ , ์ด๋์ธ์๋ก ๋ ๊ฐ๊น๋ค. ๋ฐ๋ผ์ heatmap์ ์ํ ํ๋ํ๋๊ฐ ์๋๋ผ "ํด๋์ค ์ ์ฒด ๊ตฌ์กฐ"๊ฐ ์ด๋ป๊ฒ ๋ฐฐ์น๋๋์ง๋ฅผ ๋ณด์ฌ์ค๋ค.
Triplet intra/inter-class cosine similarity boxplot:
Triplet centroid cosine distance heatmap:
Boxplot์ ๋ณด๋ฉด baseline์์๋ same-class cosine๊ณผ different-class cosine์ด ๋น๊ต์ ๋ฎ์ ์์ญ์ ๋ถํฌํ๋ค. Vanilla text cross-attention์์๋ same-class cosine์ด ํฌ๊ฒ ์์นํ์ง๋ง, different-class cosine ์ญ์ ํจ๊ป ์์นํ๋ค. ์ด๋ text ์ฃผ์ ์ด ๊ฐ์ class sample๋ง ๋ ๊ฐ๊น๊ฒ ๋ง๋ ๊ฒ์ด ์๋๋ผ, latent space ์ ์ฒด๋ฅผ ๋ ๋์ cosine similarity ์์ญ์ผ๋ก ์ด๋์ํค๋ ํจ๊ณผ๋ฅผ ๋ง๋ ๋ค๋ ๋ป์ด๋ค. ์ฆ class ๋ด๋ถ ์์ง๊ณผ ํจ๊ป ์ ์ญ์ ์ธ semantic smoothing๋ ๋์์ ์ผ์ด๋๋ค.
ํ์ง๋ง InfoNCE๋ฅผ ์ถ๊ฐํ๋ฉด ์์์ด ๋ค์ ๋ฌ๋ผ์ง๋ค. same-class cosine์ ๋์ ์์ค์ ์ ์งํ๋ฉด์๋, different-class cosine์ด vanilla text์ ๋นํด ๋ ๋ถ๋ฆฌ๋ ํํ๋ฅผ ๋ณด์ธ๋ค. ์ฆ InfoNCE๋ ๋จ์ smoothing ์ํ์์ ๋๋๋ ๊ฒ์ด ์๋๋ผ, ๊ทธ ์์ class-aware separation์ ๋ค์ ๋ณต์ํ๋ ๋ฐฉํฅ์ผ๋ก ์๋ํ๋ค.
Heatmap์ ์ด ํด์์ ๋ ๊ตฌ์ฒด์ ์ผ๋ก ๋ท๋ฐ์นจํ๋ค. Baseline centroid cosine distance๋ ๋น๊ต์ ๋๊ฒ ํผ์ ธ ์์ง๋ง, vanilla text cross-attention heatmap์ ์ ์ฒด์ ์ผ๋ก ๋ ์ด๋์์ง๋ค. ์ด๋ centroid๋ค์ด ๊ณตํต semantic manifold ์์ผ๋ก ๋ ๊ฐ๊น์ด ๋ชจ์ธ๋ค๋ ๋ป์ด๋ฉฐ, ์์ ๋ณธ semantic smoothing ํด์๊ณผ ์ผ์นํ๋ค.
๋ฐ๋ฉด InfoNCE heatmap์ ๋ค์ ํจ์ฌ ๋ฐ์์ง๋ค. ์ด๋ centroid distance๊ฐ ๋ค์ ์ปค์ก๋ค๋ ๋ป์ด๊ณ , ๋จ์ํ smoothing์ด ์๋๋ผ semantic prior ์์์ class separation์ ๋ ๊ฐํ๊ฒ ํ๋ณตํ๋ค๋ ์ ์ ๋ณด์ฌ์ค๋ค. ๋ฐ๋ผ์ ์ด ์๊ฐํ๋ ์ธ ๋ชจ๋ธ์ ์ฐจ์ด๋ฅผ ๋งค์ฐ ์ ๋ช
ํ๊ฒ ์ ๋ฆฌํด ์ค๋ค.
- Baseline: visual cue ๊ธฐ๋ฐ ๋ถ๋ฆฌ
- Vanilla text: semantic smoothing
- InfoNCE: smoothing ์์ class-aware re-separation
์ด ์ ์ ์ดํดํ๋ ค๋ฉด ๋จผ์ text prototype ๊ฐ๋
์ด ํ์ํ๋ค. ์ฌ๊ธฐ์ text prototype์ ๊ฐ ์ฅ๋ฉด ํด๋์ค์ ๋ํด ์ค๋นํ ํ
์คํธ ์ค๋ช
์ CLIP text encoder๋ก ์๋ฒ ๋ฉํ "ํด๋์ค์ ์ธ์ด์ ๊ธฐ์ค์ "์ด๋ค. ์๋ฅผ ๋ค์ด waterfront๋ restaurant_cafe์๋ ๊ฐ๊ฐ ๊ทธ ์ฅ๋ฉด์ ์ค๋ช
ํ๋ ํ
์คํธ ๋ฒกํฐ๊ฐ ํ๋์ฉ ๋์๋๋ค. ๋ชจ๋ธ์ด ์ด๋ค ์ด๋ฏธ์ง๋ฅผ ๋ณผ ๋, ๊ทธ ์ด๋ฏธ์ง์ latent representation์ด ์๊ธฐ ์ ๋ต ํด๋์ค์ text prototype์ ๋ ๊ฐ๊น์์ง๋ฉด "์ธ์ด์ ์ผ๋ก๋ ๊ทธ ์ฅ๋ฉด ์๋ฏธ์ ์ ๋ง๋๋ค"๊ณ ํด์ํ ์ ์๋ค.
๊ทธ๋ฆผ ์ correct-class cosine์ ์ํ์ด ์๊ธฐ ์ ๋ต ํด๋์ค prototype๊ณผ ์ผ๋ง๋ ๋น์ทํ์ง๋ฅผ ๋ปํ๊ณ , correct-vs-rival margin์ ์ ๋ต prototype๊ณผ์ ์ ์ฌ๋๊ฐ ๊ฐ์ฅ ๊ฐ๊น์ด ๊ฒฝ์ ํด๋์ค prototype๋ณด๋ค ์ผ๋ง๋ ๋ ํฐ์ง๋ฅผ ๋ปํ๋ค. margin์ด ์์์ด๋ฉด ์ ๋ต prototype ์ชฝ์ด ๋ ๊ฐ๊น๋ค๋ ๋ป์ด๊ณ , ์์์ด๋ฉด ์คํ๋ ค ๊ฒฝ์ ํด๋์ค prototype ์ชฝ์ด ๋ ๊ฐ๊น๋ค๋ ๋ป์ด๋ค. ๋ฐ๋ผ์ ์ด ๊ทธ๋ฆผ์ "๋ชจ๋ธ์ด ํ
์คํธ๋ฅผ ๋จ์ ์ฐธ๊ณ ์ ๋ณด๋ก ์ฐ๋๊ฐ, ์๋๋ฉด ์ค์ ๋ก ์ ๋ต ์๋ฏธ ๋ฐฉํฅ์ผ๋ก latent๋ฅผ ์ ๋ ฌํ๋๊ฐ"๋ฅผ ์ง์ ๋ณด์ฌ์ค๋ค.
Triplet prototype alignment overview:
Vanilla text cross-attention์ ๋ณด๋ฉด, correct-class cosine ๋ถํฌ๊ฐ 0 ๋ถ๊ทผ์ ๋จธ๋ฌผ๊ณ correct-vs-rival margin๋ ์๋น ๋ถ๋ถ ์์ ์ชฝ์ ๋ถํฌํ๋ค. ์ค์ full180 report ๊ธฐ์ค์ผ๋ก:
mean_correct_class_cosine:0.0351mean_correct_vs_rival_margin:-0.1204prototype_retrieval_accuracy:0.0972
์ฆ vanilla text model์ text๋ฅผ ์ฐ๊ธฐ๋ ํ์ง๋ง, ๋ง์ ์ํ์ด ์ฌ์ ํ ์ ๋ต prototype๋ณด๋ค rival prototype์ ๋ ๊ฐ๊น๋ค. ๊ทธ๋ผ์๋ accuracy๊ฐ baseline๋ณด๋ค ์ข์์ง๋ค๋ ์ ์, ์ด ๋ชจ๋ธ์ด text๋ฅผ strict nearest-prototype decision rule๋ก ์ฌ์ฉํ๋ค๊ธฐ๋ณด๋ค latent geometry๋ฅผ semanticํ๊ฒ ์ฌ๋ฐฐ์นํ๋ anchor๋ก ์ฌ์ฉํ๊ณ ์์์ ๋ปํ๋ค.
๋ฐ๋ฉด InfoNCE๋ฅผ ์ถ๊ฐํ๋ฉด ๋ถํฌ๊ฐ ์ง์ ์ผ๋ก ๋ฌ๋ผ์ง๋ค.
mean_correct_class_cosine:0.4575mean_correct_vs_rival_margin:0.1465prototype_retrieval_accuracy:0.6016
์ฆ InfoNCE๋ ๋จ์ํ text feature๋ฅผ ์๋ ์์ค์ ๋์ด, fused latent๊ฐ ์์ ์ ์ ๋ต class text prototype์ rival prototype๋ณด๋ค ๋ ๊ฐ๊น๊ฒ ๋ณด๋๋ก loss ์ฐจ์์์ ์ง์ ์๋ฐํ๋ค. ์ด ๊ทธ๋ฆผ์ InfoNCE๊ฐ ์ ๋ง๋ก ์๋ํ ์ผ์ ํ๋ค๋ ๊ฐ์ฅ ์ง์ ์ ์ธ ๊ทผ๊ฑฐ ์ค ํ๋๋ค.
Triplet confusion-pair UMAP comparison:
์ด ๊ทธ๋ฆผ์ ์ ์ฒด latent space๋ณด๋ค ๋ ์ง์ ์ ์ผ๋ก, ์ค์ ๋ก ์์ฃผ ํผ๋๋๋ class pair์์ ์ธ ๋ชจ๋ธ์ด class boundary๋ฅผ ์ด๋ป๊ฒ ๋ค๋ฅด๊ฒ ํ์ฑํ๋์ง๋ฅผ ๋ณด์ฌ์ค๋ค.
kitchen_dining vs restaurant_cafe์์๋ baseline์ด ๋์ ํผํฉ ์์ญ์ ๋ณด์ด๊ณ , vanilla text์์๋ semantic neighbor ๋ด๋ถ์ branch๊ฐ ์ข ๋ ์ ๋ฆฌ๋๋ค. InfoNCE์์๋ ์ด ์์ ์ถ๊ฐ์ ์ธ ๋ถ๋ฆฌ๊ฐ ์๊ธฐ๋ฉฐ, ๋ ํด๋์ค๊ฐ ์ ์ ํ๋ ์์ญ์ ๊ฒฝ๊ณ๊ฐ ๋ ๋ถ๋ช
ํด์ง๋ ๊ฒฝํฅ์ด ๋ํ๋๋ค.
waterfront vs mountain_valley์์๋ ์ธ ๋จ๊ณ๊ฐ ๋น๊ต์ ๋ช
ํํ๋ค. baseline์์๋ ์์ฐ scene ๊ณ์ด ๋ ํด๋์ค๊ฐ ์ค์ ์ฐ๊ฒฐ๋ถ๋ฅผ ๊ณต์ ํ๋ฉฐ ์์ด๊ณ , vanilla text์์๋ ๊ฐ์ ์์ฐ manifold ์์์ semantic organization์ด ๋ ์ ๋๋๋ค. InfoNCE์์๋ ์ด manifold๋ฅผ ์ ์งํ๋ฉด์๋ class๋ณ sub-region ๊ฒฝ๊ณ๊ฐ ๋ ๋๋ ทํด์ง๋ค.
public_large_indoor vs corridor_lobby๋ semantic overlap์ด ํฐ ์ค๋ด ๊ณ์ด ์์ธ๋ฐ, baseline์์๋ ๋ ํด๋์ค๊ฐ ๊ธธ๊ฒ ๋ค์์ด๊ณ , vanilla text์์๋ branch ๊ธฐ๋ฐ ์ฌ๋ฐฐ์น๊ฐ ๋ํ๋๋ค. InfoNCE์์๋ ์ฌ์ ํ ์ด๋ ค์ด ์์ผ๋ก ๋จ์ง๋ง, class๊ฐ ๋จธ๋ฌด๋ ์์ญ์ ์ค๊ณฝ์ baseline๊ณผ vanilla text๋ณด๋ค ๋ ๋ถ๋ช
ํ๋ค.
์ข ํฉํ๋ฉด pairwise UMAP์ ์ธ ๋ชจ๋ธ์ ์ฐจ์ด๋ฅผ ์ ๋ณด์ฌ์ค๋ค.
- Baseline: ํผํฉ ๊ตฌ์กฐ๊ฐ ํผ
- Vanilla text: semantic neighbor ๋ด๋ถ ์ฌ๋ฐฐ์น
- InfoNCE: ์ฌ๋ฐฐ์น ์์ class boundary ๊ฐํ
๋ค์ ๊ฐค๋ฌ๋ฆฌ๋ confusion matrix์ pairwise UMAP์์ ๊ด์ฐฐ๋ ์ฐจ์ด๋ฅผ ์ค์ ์ํ ์์ค์์ ๋ณด์ฌ์ค๋ค. ๊ฐ ํ์ ์ฒซ ๋ฒ์งธ ์ด์ ์๋ณธ ์ด๋ฏธ์ง์ ์ ๋ต class์ด๊ณ , ๊ทธ ๋ค์ ์ธ ์ด์ ๋์ผํ ์
๋ ฅ์ ๋ํด baseline, vanilla text, InfoNCE๊ฐ ๊ฐ๊ฐ ์ด๋ค label์ ์์ธกํ๋์ง์ confidence๋ฅผ ํจ๊ป ๋ณด์ฌ์ค๋ค.
์ฒซ ๋ฒ์งธ ํ์ baseline์ ํ๋ ธ์ง๋ง InfoNCE๋ ๋ง์ถ ์ฌ๋ก๋ฅผ ๋ณด์ฌ์ค๋ค. ์ ๋ต์ kitchen_dining์ธ๋ฐ baseline์ ์ด๋ฅผ restaurant_cafe๋ก ์์ธกํ๋ค. ๋ฐ๋ฉด vanilla text์ InfoNCE๋ ๋ชจ๋ kitchen_dining์ผ๋ก ํ๋ณตํ๋ฉฐ, ํนํ InfoNCE๋ ๋ ๋์ confidence๋ฅผ ๋ณด์ธ๋ค. ์ด๋ text guidance๊ฐ food-related indoor scene pair ์์์ decision boundary๋ฅผ ๋ ์์ ํํ๋ ๋ฐ ์ค์ ๋ก ๋์์ด ๋์์์ ๋ณด์ฌ์ค๋ค.
๋ ๋ฒ์งธ ํ์ ์ธ ๋ชจ๋ธ์ด ๋ชจ๋ ์ฌ์ ํ ํท๊ฐ๋ฆฌ๋ ์ฌ๋ก๋ค. ์ ๋ต์ residential_outdoor์ด์ง๋ง ์ธ ๋ชจ๋ธ ๋ชจ๋ open_field_landscape๋ก ์์ธกํ๋ค. ์ด ์ฅ๋ฉด์ ์ผ์ธ ์๋์ ์ธ๋ฌผ ์ค์ฌ ๊ตฌ์ฑ์ด ๊ฐํ๊ณ , ์ฃผ๊ฑฐ ๊ณต๊ฐ์ ๊ตฌ์กฐ์ ๋จ์๊ฐ ์๋์ ์ผ๋ก ์ฝํด ๋ณด์ธ๋ค. ์ด ํ์ text guidance๊ฐ representation์ ๊ฐ์ ํ๋๋ผ๋, ์
๋ ฅ ์ด๋ฏธ์ง ์์ฒด์ class-defining cue๊ฐ ๋ถ์กฑํ๋ฉด ambiguity๊ฐ ์ฌ์ ํ ๋จ์ ์ ์์์ ๋ณด์ฌ์ค๋ค.
์ธ ๋ฒ์งธ ํ์ semantic neighbor ๋ํ ์ฌ๋ก์ด๋ค. ์ ๋ต์ restaurant_cafe์ด์ง๋ง ์ธ ๋ชจ๋ธ ๋ชจ๋ kitchen_dining์ผ๋ก ์์ธกํ๋ค. ์ฆ ์ด ๊ฒฝ์ฐ์๋ text guidance์ InfoNCE๋ฅผ ์ถ๊ฐํด๋ semantic neighbor ๋ด๋ถ์ ๊ฒฝ๊ณ๊ฐ ์์ ํ ๋ถ๋ฆฌ๋์ง๋ ์์๋ค. ๋ค๋ง ์ธ ๋ชจ๋ธ ๋ชจ๋ ๋์ confidence๋ก ๊ฐ์ ํผ๋์ ๋ณด์ธ๋ค๋ ์ ์, ์ด ์ํ์ด ๋จ์ noisy outlier๋ผ๊ธฐ๋ณด๋ค ๋ ํด๋์ค๊ฐ ์ค์ ๋ก ๋งค์ฐ ๊ฐ๊น๊ฒ ๋ฐฐ์น๋๋ hard case์์ ๋ณด์ฌ์ค๋ค. ์ด๋ฐ ์ฌ๋ก๋ ์ prototype alignment๋ class-aware separation์ด ํ์ํ๋์ง๋ฅผ ์ง๊ด์ ์ผ๋ก ์ค๋ช
ํ๋ ๋ฐ ์ ์ฉํ๋ค.
Attention map์ ๋ชจ๋ธ์ด ์ด๋ฏธ์ง๋ฅผ ๋ณผ ๋ ์ด๋ ์์น๋ฅผ ์๋์ ์ผ๋ก ๋ ์ค์ํ๊ฒ ์ฐธ๊ณ ํ๋์ง๋ฅผ ๋ฐ๊ธฐ๋ ์์ผ๋ก ๋ํ๋ธ ์๊ฐํ๋ค. ์ผ๋ฐ์ ์ผ๋ก ๋ ๊ฐํ๊ฒ ํ์๋ ์์ญ์ ๊ทธ ์ฅ๋ฉด์ ํ๋จํ๋ ๋ฐ ๋ ๋ง์ด ์ฌ์ฉ๋ ๋ถ๋ถ์ผ๋ก ํด์ํ๋ค. ๋ค๋ง attention map์ "๋ชจ๋ธ์ด ์ ํํ ์ ๊ทธ๋ ๊ฒ ํ๋จํ๋์ง"๋ฅผ ์๋ฒฝํ๊ฒ ์ฆ๋ช ํ๋ ๋๊ตฌ๋ ์๋๋ฉฐ, ์ด๋์ ์ฃผ์๋ฅผ ๋๋ ๊ฒฝํฅ์ด ์๋์ง๋ฅผ ๋ณด์ฌ์ฃผ๋ ์ ์ฑ์ ๋ณด์กฐ ์๋ฃ์ ๊ฐ๊น๋ค.
์ฆ ์ด ์ ์ Visualization์ ์ฑ๋ฅ ์์น๋ฅผ ์ง์ ์ค๋ช ํ๋ ์งํ๋ผ๊ธฐ๋ณด๋ค, ์์ confusion matrix๋ latent visualization์์ ๋ํ๋ ์ฐจ์ด๊ฐ ์ค์ ์ด๋ฏธ์ง ๊ณต๊ฐ์์๋ ์ด๋ค ์์ ์ฃผ์ ํจํด์ผ๋ก ๋ํ๋๋์ง๋ฅผ ๋ณด์ฌ์ค๋ค. ๋ฐ๋ผ์ attention map์ ์ ๋ ๊ฒฐ๊ณผ๋ฅผ ๋์ฒดํ๊ธฐ๋ณด๋ค๋, ๋ชจ๋ธ์ด ์ฝ๊ณ ์๋ ๊ณต๊ฐ์ ๋จ์๋ฅผ ์ง๊ด์ ์ผ๋ก ์ดํดํ๋๋ก ๋๋ ์ญํ ๋ก ๋ณด๋ ๊ฒ์ด ์ ์ ํ๋ค.
Vanilla text cross-attention examples:
InfoNCE attention examples:
๊ฐ ํ์ ์ฒซ ๋ฒ์งธ ์ด์ ์๋ณธ ์ด๋ฏธ์ง์ด๊ณ , ๋ ๋ฒ์งธ ์ด์ True-class attention์ ์ ๋ต ํด๋์ค logit์ ๊ธฐ์ค์ผ๋ก ์ญ์ถ์ ํ attention map์ด๋ค. ์ด๋ "์ด ์ด๋ฏธ์ง๊ฐ ์ค์ ์ ๋ต ํด๋์ค๋ผ๊ณ ๊ฐ์ ํ ๋ ๋ชจ๋ธ์ด ์ด๋ ์์ญ์ ๊ทผ๊ฑฐ๋ก ๋ณด๋๊ฐ"๋ฅผ ๋ณด์ฌ์ค๋ค. ์ธ ๋ฒ์งธ ์ด์ Pred attention์ ๋ชจ๋ธ์ด ์ค์ ๋ก ๊ฐ์ฅ ๋๊ฒ ์์ธกํ ํด๋์ค logit์ ๊ธฐ์ค์ผ๋ก ๊ณ์ฐํ attention map์ด๋ค. ๋ฐ๋ผ์ ์ด ์ด์ "๋ชจ๋ธ์ด ์ต์ข
์์ธก์ ๋ด๋ฆด ๋ ์ค์ ๋ก ์ด๋๋ฅผ ๋ณด๊ณ ์์๋๊ฐ"์ ๋ ๊ฐ๊น๋ค.
์ด๋ฒ ๋น๊ต์์๋ ์ฌ์ฏ ๊ฐ์ ๋์ผํ ์
๋ ฅ ์ด๋ฏธ์ง์ ๋ํด vanilla text cross-attention๊ณผ InfoNCE attention์ ๋๋ํ ๋๊ณ ๋ณผ ์ ์๋ค. ํฅ๋ฏธ๋ก์ด ์ ์ ๋ ๋ชจ๋ธ ๋ชจ๋ ๋๋ถ๋ถ์ ์ํ์์ True-class attention๊ณผ Pred attention์ด ๊ฑฐ์ ๊ฐ์ ์์น๋ฅผ ๊ฐ๋ฆฌํจ๋ค๋ ๊ฒ์ด๋ค. ์ด๋ ๋ชจ๋ธ์ด ๋์ confidence๋ก ์ ๋ต์ ๋งํ ๋, ์ต์ข
์์ธก ๋ํ ์ค์ ์ ๋ต ํด๋์ค์ ๊ฑฐ์ ๊ฐ์ ๊ณต๊ฐ ๋จ์๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ์ฑ๋๊ณ ์์์ ๋ปํ๋ค. ํนํ InfoNCE ์ชฝ confidence๋ 0.960 ~ 0.976 ์์ค์ผ๋ก, ๊ฐ์ ์ํ์์ vanilla ๋ชจ๋ธ์ 0.761 ~ 0.956๋ณด๋ค ์ ๋ฐ์ ์ผ๋ก ๋ ๋๊ฒ ๋ํ๋๋ค.
Vanilla text cross-attention์์๋ attention์ด ๋น๊ต์ ๋์ semantic region ์์ ํผ์ง๋ ๊ฒฝํฅ์ด ๋ณด์ธ๋ค. kitchen_dining์์๋ ์ธ๋ฌผ, ์ํ, ์๋ถ ์ค๋ด ๊ตฌ์กฐ๊ฐ ํจ๊ป ๋๊ฒ ๋ฎ์ด๋ฉฐ, restaurant_cafe์์๋ ๊ฐํ๊ณผ ์ฒ์ฅ์ , ์ ๋ฉด ์ ๋ฆฌ ๊ตฌ์กฐ ์ ๋ฐ์ด ํ์ฑํ๋๋ค. waterfront์์๋ ์ํ์ , ์๋ฉด, ํด์์ ์ด ํ๋์ ํฐ ์ฅ๋ฉด ๋จ์๋ก ์ฝํ๊ณ , mountain_valley์์๋ ์์ ์ ๋ฒฝ๊ณผ ํ๋จ ๊ฑด์ถ ๊ตฌ์กฐ๊ฐ ๋์์ ๋ฐ์ํ๋ค. public_large_indoor์ corridor_lobby์์๋ ๊ฐ๊ฐ ์ฒ์ฅ-์์น-ํต๋ก, ๋ฒฝ๋ฉด-๊ธฐ๋ฅ-์์ค์ ์ด ๋ชจ๋ ๋์ ๋ฒ์์์ ํ์ฑํ๋๋ค. ์ด๋ vanilla text model์ด ๊ฐ๋ณ object ํ๋๋ฅผ ๋ ์นด๋กญ๊ฒ ์ง๊ธฐ๋ณด๋ค, ์ฅ๋ฉด์ ๊ท์ ํ๋ ๋์ context๋ฅผ semantic anchor์ ํจ๊ป ์ฝ๊ณ ์์์ ๋ณด์ฌ์ค๋ค.
๋ฐ๋ฉด InfoNCE attention์์๋ ๊ฐ์ ์ฅ๋ฉด ์๋ฏธ๋ฅผ ์ ์งํ๋ฉด์๋, ๋ ์์ถ๋๊ณ class-awareํ ๋ฐ์ ํจํด์ด ๋ํ๋๋ค. restaurant_cafe์์๋ broad storefront ์ ์ฒด๋ณด๋ค ์ค์ฌ ๊ฐํ๊ณผ ์
๋ฉด ๊ตฌ์กฐ ์ชฝ hotspot์ด ๋ ๊ฐํด์ง๊ณ , waterfront์์๋ ๋ฐ๋ค ์ ์ฒด๋ณด๋ค ํด์์ ์ ๊ณก์ ๊ณผ ์ํ ๊ฒฝ๊ณ๊ฐ ๋ ๋ถ๋ช
ํ๊ฒ ๊ฐ์กฐ๋๋ค. corridor_lobby์์๋ ๋จ์ํ ๋ณต๋ ์ ์ฒด๋ฅผ ๋ณด๋ ๊ฒ์ด ์๋๋ผ, ์ข์ธก ๊ธฐ๋ฅ์ด๊ณผ ์ค์ ์์ค ๋ฐฉํฅ์ด ๋ ์ ๋ช
ํ๊ฒ ๋ถ๊ฐ๋๋ค. public_large_indoor ์ญ์ ์ค๋ด ์ ์ฒด๋ฅผ ๊ณ ๋ฅด๊ฒ ๋ฎ๊ธฐ๋ณด๋ค ์์น, ์กฐ๋ช
, ์ค์ ํต๋ก์ฒ๋ผ ๊ณต๊ฐ ๊ท๋ชจ์ ๊ตฌ์กฐ๋ฅผ ๋๋ฌ๋ด๋ ๋จ์์ ๋ ์ง์คํ๋ ๋ชจ์ต์ด ๋ณด์ธ๋ค. ์ฆ InfoNCE๋ semantic prior๋ฅผ ์ ์งํ ์ฑ, ์ฅ๋ฉด์ ๊ตฌ๋ถํ๋ ๋ฐ ๋ ๊ฒฐ์ ์ ์ธ ๊ตฌ์กฐ์ ๋จ์๋ฅผ ์ ํ์ ์ผ๋ก ๊ฐํํ๋ ๋ฐฉํฅ์ผ๋ก ์๋ํ ๊ฒ์ผ๋ก ํด์ํ ์ ์๋ค.
๋ฌผ๋ก attention map์ ๋ณธ์ง์ ์ผ๋ก ์ ์ฑ์ ๋๊ตฌ์ด๋ฏ๋ก, ์ด๊ฒ๋ง์ผ๋ก ์ฑ๋ฅ ํฅ์์ ์์ธ์ ๋จ์ ํ ์๋ ์๋ค. ๋ค๋ง ์ด๋ฒ matched-sample ๋น๊ต๋ ์ ์ด๋ ๋ ๋ชจ๋ธ์ ์ฐจ์ด๊ฐ "๊ฐ์ ์ด๋ฏธ์ง๋ฅผ ๋ณผ ๋ ์ด๋์ ์ฃผ์๋ฅผ ๋๋๊ฐ" ์์ค์์๋ ๋๋ฌ๋๋ค๋ ์ ์ ๋ณด์ฌ์ค๋ค. ์ ๋ฆฌํ๋ฉด vanilla text cross-attention์ด ๋์ semantic context๋ฅผ ์ฝ๋ ์ชฝ์ ๊ฐ๊น๋ค๋ฉด, InfoNCE๋ ๊ทธ ์์์ class discrimination์ ๋ ์ง์ ์ ์ผ๋ก ๊ธฐ์ฌํ๋ ๊ณต๊ฐ ๋จ์๋ฅผ ๋ ์์ถ๋ ํํ๋ก ๊ฐ์กฐํ๋ ๊ฒฝํฅ์ ๋ณด์ธ๋ค.
๊ฒฐ๋ก ์ ์ผ๋ก Chapter 7์ ์๊ฐํ๋ค์ ์ข ํฉํ๋ฉด, ์ธ ๋ชจ๋ธ์ ์ญํ ์ ๋ค์๊ณผ ๊ฐ์ด ์์ฝ๋๋ค.
Visual-only baseline: visual cue ์ค์ฌ์ ๋ถ๋ฆฌText Cross-Attention: semantic smoothing๊ณผ latent reorganizationText Cross-Attention + InfoNCE: semantic prior๋ฅผ ์ ์งํ๋ฉด์ class-aware separation๊ณผ prototype alignment๋ฅผ ๋์์ ๊ฐํ
์ด๋ฒ ์คํ์์ ๊ฐ์ฅ ๋ถ๋ช
ํ๊ฒ ํ์ธ๋ ์ ์, scene classification์์ text prior๊ฐ ๋จ์ํ ๋ถ๊ฐ ์ ๋ณด๊ฐ ์๋๋ผ latent space๋ฅผ ์ฌ๊ตฌ์ฑํ๋ ์ค์ ๊ตฌ์กฐ์ ์ ํธ๋ก ์๋ํ๋ค๋ ๊ฒ์ด๋ค. Visual-only baseline์ 59.79%์ validation accuracy๋ฅผ ๊ธฐ๋กํ๊ณ , vanilla text cross-attention์ ์ด๋ฅผ 60.56%๊น์ง ๋์ด์ฌ๋ ธ๋ค. ์ด๋ text ์ฃผ์
์ด ์๊ฐ์ feature๋ฅผ ๋์ฒดํ๋ค๊ธฐ๋ณด๋ค, ์๊ฐ์ ์ผ๋ก ์ ์ฌํ์ง๋ง ์๋ฏธ์ ์ผ๋ก ๋ค๋ฅธ ์ฅ๋ฉด๋ค ์ฌ์ด์์ ๋ ์์ ์ ์ธ semantic anchor๋ฅผ ์ ๊ณตํ์์ ์์ฌํ๋ค.
๋ํ vanilla text cross-attention๊ณผ InfoNCE variant์ ์ฐจ์ด๋ฅผ ๋น๊ตํ๋ฉด, text guidance๊ฐ ๋ ๋จ๊ณ์ ๊ฑธ์ณ ์๋ํ๋ค๋ ์ ์ด ๋ณด์ธ๋ค. ๋จผ์ vanilla text cross-attention์ semantic smoothing๊ณผ latent reorganization์ ๋ ๊ฐ๊น๋ค. UMAP, t-SNE, pairwise UMAP์์ ๋ํ๋๋ฏ์ด ์ด ๋ชจ๋ธ์ ์๋ก ์๋ฏธ์ ์ผ๋ก ๊ฐ๊น์ด ์ฅ๋ฉด๋ค์ ๋ณด๋ค ๊ณตํต๋ semantic manifold ์์ผ๋ก ์ฌ๋ฐฐ์นํ๋ค. ๊ทธ ๊ฒฐ๊ณผ ์ผ๋ถ confusion pair์์๋ ํผ๋ ๋ฐฉํฅ์ด ๋ฐ๋์ง๋ง, ๊ทธ ๋ณํ๋ ๋จ์ํ ์ฑ๋ฅ ์ ํ๋ผ๊ธฐ๋ณด๋ค decision boundary๊ฐ semantic neighborhood ๋ด๋ถ์์ ๋ค์ ์ ๋ ฌ๋๋ ๊ณผ์ ์ผ๋ก ์ฝํ๋ค.
๋ฐ๋ฉด InfoNCE๋ฅผ ์ถ๊ฐํ๋ฉด ์ด semantic smoothing ์์ class-aware separation์ด ๋ค์ ๊ฐํ๋๋ค. ์ต์ข
๋ชจ๋ธ์ validation accuracy 60.75%๋ฅผ ๊ธฐ๋กํ์ ๋ฟ ์๋๋ผ, same-vs-different cosine margin๊ณผ silhouette score๋ฅผ ๋ชจ๋ ๋์ด์ฌ๋ ธ๊ณ , prototype alignment ์งํ์์๋ ํฐ ๊ฐ์ ์ ๋ณด์๋ค. ํนํ centroid heatmap๊ณผ prototype alignment histogram์ InfoNCE๊ฐ "ํ
์คํธ๋ฅผ ์ฐธ๊ณ ํ๋ ๋ชจ๋ธ" ์์ค์ ๋์ด, fused latent๋ฅผ ์ค์ class text prototype ๋ฐฉํฅ์ผ๋ก ๋ ๊ฐํ๊ฒ ์กฐ์งํํ๊ณ ์์์ ๋ณด์ฌ์ค๋ค. ์ฆ ์ด๋ฒ ๊ฒฐ๊ณผ๋ text guidance์ ํจ๊ณผ๊ฐ ๋จ์ accuracy gain์ด ์๋๋ผ representation geometry์ ๋ณํ๋ก๋ ๊ด์ฐฐ๋๋ค๋ ์ ์์ ์๋ฏธ๊ฐ ์๋ค.
Application ๊ด์ ์์๋ ์ด ์ฐ๊ตฌ๋ ๋ณ๊ฐ์ ์คํ์ ๋จธ๋ฌด๋ฅด์ง ์๋๋ค. Scene classifier๋ VisionCraft์ enhancement pipeline ์์์ ์ฅ๋ฉด identity๋ฅผ ์ ๊ณตํ๊ณ , quality summary์ heuristic-based reasoning์ด ์ฅ๋ฉด ๋จ์ ๋งฅ๋ฝ์ ๋ฐ์ํ๋๋ก ๋๋๋ค. ๋ฐ๋ผ์ ์ฐ๊ตฌ ํ์ดํ๋ผ์ธ์์ ์ป์ multimodal representation learning์ ํต์ฐฐ์ ๋จ์ benchmark ์ฑ๋ฅ ๊ฒฝ์์ด ์๋๋ผ, ์ค์ scene-aware image understanding ์์คํ ์ ํด์ ๊ฐ๋ฅ์ฑ๊ณผ ์์ ์ฑ์ ๋์ด๋ ๋ฐฉํฅ์ผ๋ก ์ฐ๊ฒฐ๋๋ค.
์ฒซ์งธ, accuracy ๊ฐ์ ํญ ์์ฒด๋ ์ ์๋ฏธํ์ง๋ง ์ ๋์ ์ผ๋ก ๋งค์ฐ ํฐ ์์ค์ ์๋๋ค. 59.79% -> 60.56% -> 60.75%์ ์์น์ ์ผ๊ด๋ ์ถ์ธ๋ฅผ ๋ณด์ฌ์ฃผ์ง๋ง, ๋ชจ๋ ํด๋์ค์์ ๋์ผํ๊ฒ ๊ฐํ ๊ฐ์ ์ด ๋ํ๋ ๊ฒ์ ์๋๋ค. ์ค์ confusion matrix๋ฅผ ๋ณด๋ฉด public_large_indoor, corridor_lobby, transportation_hub_road, waterfront ๊ฐ์ ํด๋์ค๋ ์ฌ์ ํ ์ด๋ ค์ด ๋ฒ์ฃผ๋ก ๋จ์ ์์ผ๋ฉฐ, semantic overlap์ด ํฐ pair์์๋ trade-off๊ฐ ๊ณ์ ๊ด์ฐฐ๋๋ค. ์ฆ text prior๊ฐ ํญ์ fine-grained discrimination์ ์๋์ผ๋ก ํด๊ฒฐํด ์ฃผ๋ ๊ฒ์ ์๋๋ค.
๋์งธ, vanilla text cross-attention์ semantic smoothing์๋ ํจ๊ณผ์ ์ด์ง๋ง, ๊ทธ ์์ฒด๋ง์ผ๋ก๋ class prototype๊ณผ์ ์ง์ ์ ์ ๋ ฌ์ด ์ถฉ๋ถํ ๊ฐํ์ง ์์๋ค. Prototype histogram์์ ๋ณด์๋ฏ์ด vanilla ๋ชจ๋ธ์ text๋ฅผ ์ ์ฉํ semantic anchor๋ก ์ฌ์ฉํ์ง๋ง, ๋ง์ ์ํ์ด ์ฌ์ ํ rival prototype๊ณผ ๋ ๊ฐ๊น์ด ์์น์ ๋จธ๋ฌธ๋ค. ์ด๋ text๋ฅผ latent space์ ์ฃผ์ ํ๋ ๊ฒ๋ง์ผ๋ก๋ semantic organization๊ณผ explicit class separation์ ๋์์ ๋ง์กฑ์ํค๊ธฐ ์ด๋ ต๋ค๋ ์ ์ ๋ณด์ฌ์ค๋ค.
๊ฐ์ฅ ์ง์ ์ ์ธ ๋ค์ ๋จ๊ณ๋ text prototype ์์ฒด๋ฅผ ๋ ์ ๊ตํ๊ฒ ์ค๊ณํ๋ ๊ฒ์ด๋ค. ํ์ฌ๋ class๋ณ prompt๋ฅผ ๊ธฐ๋ฐ์ผ๋ก CLIP text embedding์ ๋ง๋ค์์ง๋ง, ๋ณด๋ค ํ๋ถํ scene description, attribute-level prompt, hard negative๋ฅผ ๊ณ ๋ คํ contrastive text design์ ์ ์ฉํ๋ฉด prototype quality๋ฅผ ๋ ๋์ผ ์ ์๋ค. ํนํ restaurant_cafe์ kitchen_dining, public_large_indoor์ corridor_lobby์ฒ๋ผ ํผ๋์ด ์ฆ์ pair์ ๋ํด์๋ class-specific prompt engineering์ด ์ถ๊ฐ์ ์ธ ์ด๋์ ์ค ๊ฐ๋ฅ์ฑ์ด ์๋ค.
ํ์ต ๊ตฌ์กฐ ์ธก๋ฉด์์๋ text guidance์ ๊ฐ๋๋ฅผ ์ ๋ ฅ๋ณ๋ก ์กฐ์ ํ๋ learnable gating ๋๋ adaptive fusion๋ ์ ๋งํ๋ค. ํ์ฌ ๊ตฌ์กฐ๋ ๋ชจ๋ ์ํ์ ๋ํด text branch๋ฅผ ๋น์ทํ ๋ฐฉ์์ผ๋ก ์ฃผ์ ํ์ง๋ง, ์ค์ ๋ก๋ visual evidence๊ฐ ์ถฉ๋ถํ ์ํ๊ณผ semantic ambiguity๊ฐ ํฐ ์ํ์ ์ต์ ์ ๋ต์ด ๋ค๋ฅผ ์ ์๋ค. ๋ฐ๋ผ์ sample-wise confidence๋ ambiguity๋ฅผ ๋ฐ์ํด text influence๋ฅผ ๋์ ์ผ๋ก ์กฐ์ ํ๋ฉด, semantic smoothing์ ์ด์ ์ ์ ์งํ๋ฉด์ ๊ณผ๋ํ overlap์ ์ค์ผ ์ ์์ ๊ฒ์ด๋ค.
Loss ์ค๊ณ๋ ๋ ํ์ฅํ ์ ์๋ค. ์ด๋ฒ InfoNCE๋ prototype-aware alignment์ ๋ถ๋ช ํ ํจ๊ณผ๋ฅผ ๋ณด์์ง๋ง, ์์ผ๋ก๋ hard confusion pair ์ค์ฌ์ contrastive objective, class-conditional margin loss, ํน์ hierarchical semantic regularization์ ๊ฒฐํฉํ๋ ๋ฐฉํฅ๋ ๊ณ ๋ คํ ์ ์๋ค. ์ด๋ ๋จ์ํ ์ ๋ต prototype๊ณผ์ ์ ๋ ฌ๋ง์ด ์๋๋ผ, "์ด๋ค ํด๋์ค๋ค๊ณผ๋ ๊ฐ๊น์๋ ๋๊ณ ์ด๋ค ํด๋์ค๋ค๊ณผ๋ ๋ฐ๋์ ๋ถ๋ฆฌ๋์ด์ผ ํ๋๊ฐ"๋ฅผ ๋ ๋ช ์์ ์ผ๋ก ๋ฐ์ํ๋ ๋ฐฉ์์ด ๋ ์ ์๋ค.
๋ง์ง๋ง์ผ๋ก application pipeline๊ณผ research pipeline์ ์ฐ๊ฒฐ์ ๋ ๊ฐํ๊ฒ ๋ง๋๋ ๊ฒ๋ ์ค์ํ ๊ณผ์ ๋ค. ํ์ฌ๋ scene classification ๊ฒฐ๊ณผ๊ฐ rule-based scene-aware enhancement policy ์ ํ์ ์ง์ ์ฌ์ฉ๋์ง๋ง, policy ์์ฒด๋ ์์ง hand-crafted heuristic์ ๊ฐ๊น๋ค. ์ฅ๊ธฐ์ ์ผ๋ก๋ scene representation, segmentation region, quality score๋ฅผ ํจ๊ป ์ ๋ ฅ์ผ๋ก ์ฌ์ฉํ๋ learned enhancement policy๋ฅผ ์ค๊ณํ ์ ์๋ค. ๊ทธ๋ ๊ฒ ๋๋ค๋ฉด VisionCraft๋ ๋จ์ํ "์ฅ๋ฉด์ ์ดํดํ๋ ๋ณด์ ์์คํ "์ ๋์ด, ์ฅ๋ฉด ์ดํด์ ์๊ฐ์ ๊ฐ์ ์ด ํ๋์ learned policy ์์์ ๋ ๊ธด๋ฐํ๊ฒ ๊ฒฐํฉ๋ framework๋ก ๋ฐ์ ํ ์ ์์ ๊ฒ์ด๋ค.
VisionCraft ์ ์ฅ์๋ ํ๋์ ํ๋ก์ ํธ ์์ application pipeline๊ณผ research pipeline์ ํจ๊ป ๋ด๊ณ ์๋ค. ๋ฐ๋ผ์ ํด๋ ๊ตฌ์กฐ๋ ๋ฐ๋ชจ ์์คํ ์ ์ํ ์ฝ๋์ representation learning ์คํ์ ์ํ ์ฝ๋๊ฐ ๊ณต์กดํ๋ ํํ๋ฅผ ๊ฐ์ง๋ค.
VisionCraft/
โโโ app.py
โโโ requirements.txt
โโโ checkpoint/
โโโ data/
โโโ examples/
โโโ logs/
โโโ src/
โ โโโ analyzer/
โ โโโ enhancer/
โ โโโ models/
โ โโโ utils/
โโโ README_final.md
app.py๋ Gradio ๊ธฐ๋ฐ VisionCraft application์ ์ง์
์ ์ด๋ค. ์
๋ ฅ ์ด๋ฏธ์ง ์
๋ก๋๋ถํฐ quality analysis, scene classification, detection, segmentation, OCR, enhancement, visualization ์ถ๋ ฅ๊น์ง ํ๋์ ์ธํฐํ์ด์ค ์์์ orchestrationํ๋ค.
src/analyzer/๋ brightness, contrast, blur, edge density, exposure, color balance, crop suggestion, OCR rectification, ORB matching, difference heatmap ๋ฑ low-level ๋ถ์ ๋ฐ ๋ณด์กฐ ์๊ฐํ ๋ชจ๋์ ํฌํจํ๋ค.
src/enhancer/๋ ์ ํต์ image enhancement ํ์ดํ๋ผ์ธ์ ๋ด๋นํ๋ค. Gamma correction, CLAHE, white balance, sharpening, denoise, region-aware adjustment์ ๊ฐ์ ์ค์ ๋ณด์ ๋ก์ง์ด ์ด ๋๋ ํ ๋ฆฌ์ ๋ค์ด ์๋ค.
src/models/๋ ์ฐ๊ตฌ ํ์ดํ๋ผ์ธ์ ํต์ฌ ๋๋ ํ ๋ฆฌ๋ค. Scene classifier ํ์ต๊ณผ ํ๊ฐ, text cross-attention / InfoNCE ๋ชจ๋ธ, Places365 subset ๊ตฌ์ถ, scene text embedding ์์ฑ, latent space visualization ์คํฌ๋ฆฝํธ๊ฐ ๋ชจ๋ ์ฌ๊ธฐ์ ํฌํจ๋๋ค.
src/utils/๋ ์ ํ๋ฆฌ์ผ์ด์
๊ณผ ์คํ ๊ฒฐ๊ณผ๋ฅผ ์ ๋ฆฌํ๋ markdown / visualization helper์ ๊ณตํต ์ ํธ๋ฆฌํฐ๋ฅผ ๋ด๊ณ ์๋ค.
data/๋ Places365 ์๋ณธ ๋ฐ์ดํฐ ๋๋ VisionCraft์ฉ subset, scene text embedding cache, object token / segmentation feature ์ ์ฒ๋ฆฌ ์ฐ์ถ๋ฌผ ๋ฑ์ ์ ์ฅํ๋ค. checkpoint/๋ ํ์ต๋ visual-only baseline, text cross-attention, InfoNCE variant์ ๋ชจ๋ธ ๊ฐ์ค์น๋ฅผ ๋ณด๊ดํ๋ค. logs/๋ confusion matrix, UMAP, t-SNE, centroid heatmap, prototype histogram, attention example, ํ์ต ๋ก๊ทธ ๋ฑ ์คํ ์ฐ์ถ๋ฌผ์ ์ ์ฅํ๋ ๋๋ ํ ๋ฆฌ๋ค.
์ค๋ฌด์ ์ผ๋ก๋ logs/latent_comparison_* ์๋์ latent cache์ visualization ๊ฒฐ๊ณผ๊ฐ ๋งค์ฐ ์ค์ํ๋ค. ์ด ํ์ผ๋ค์ ๋จ์ ์ถ๋ ฅ ์ด๋ฏธ์ง๊ฐ ์๋๋ผ, ํ์ triplet visualization์ด๋ README figure๋ฅผ ์ฌ์์ฑํ ๋ ์ฌ์ฌ์ฉ๋๋ ์ค๊ฐ ์ฐ์ถ๋ฌผ ์ญํ ๋ ํ๋ค.
๋จผ์ Python ๊ฐ์ํ๊ฒฝ์ ๋ง๋ค๊ณ ํ์ํ ํจํค์ง๋ฅผ ์ค์นํ๋ค.
macOS / Linux:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtWindows PowerShell:
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install --upgrade pip
.\.venv\Scripts\python.exe -m pip install -r requirements.txtWindows์์๋ ํ๋ก์ ํธ ํด๋์ setup_windows.bat์ ๋๋ธํด๋ฆญํด๋ ์ ๊ณผ์ ์ ์๋์ผ๋ก ์คํํ ์ ์๋ค. ์ด ํ์ผ์ Python 3.11์ ์ฐพ๊ณ , .venv๋ฅผ ๋ง๋ ๋ค requirements.txt๋ฅผ ์ค์นํ๋ค. ์ค์น๊ฐ ๋๋๋ฉด run_visioncraft.bat์ผ๋ก ์ฑ์ ์คํํ๋ค.
Windows์์ python --version์ด ๋ฒ์ ๋ฒํธ ์์ด Python๋ง ์ถ๋ ฅ๋๊ฑฐ๋ Microsoft Store๊ฐ ์ด๋ฆฌ๋ฉด ์ค์ Python์ด ์๋๋ผ Windows App Execution Alias๊ฐ ์กํ ์ํ์ผ ์ ์๋ค. ์ด ๊ฒฝ์ฐ Python 3.11์ ์ค์นํ ๋ค ์ PowerShell์ ์ด์ด ๋ค์ ์๋ํ๋ค.
winget install --id Python.Python.3.11 -e --scope user --accept-package-agreements --accept-source-agreementsPowerShell ์คํ ์ ์ฑ
๋๋ฌธ์ Activate.ps1์ด ๋งํ๋ ํ๊ฒฝ๋ ์์ผ๋ฏ๋ก, Windows์์๋ ์ ์์์ฒ๋ผ ๊ฐ์ํ๊ฒฝ์ Python ์คํ ํ์ผ์ ์ง์ ํธ์ถํ๋ ๋ฐฉ์์ ๊ถ์ฅํ๋ค.
requirements.txt ์ค์น๋ง์ผ๋ก๋ ๋ถ์กฑํ๊ณ , ์ผ๋ถ ๊ตฌ์ฑ ์์๋ ์ต์ด ์คํ ์ ์๋ ๋ค์ด๋ก๋๋๊ฑฐ๋ ๋ณ๋์ ์๋ ์ค์น๊ฐ ํ์ํ๋ค.
-
Tesseract OCRsystem binary
pytesseract๋ Python wrapper์ผ ๋ฟ์ด๋ฏ๋ก, ์ค์ OCR ๋ฐ์ด๋๋ฆฌ๋ ๋ณ๋๋ก ์ค์นํด์ผ ํ๋ค.- Official repository: tesseract-ocr/tesseract
- Installation guide: Tesseract User Manual
macOS(Homebrew) ์์:
brew install tesseract
Windows ์์:
winget install tesseract-ocr.tesseract๋๋
choco install tesseract
ํ๊ตญ์ด OCR๊น์ง ์ฌ์ฉํ๋ ค๋ฉด
korlanguage data๊ฐ ํ์ํ ์ ์๋ค. -
YOLOv8nweights (yolov8n.pt)
Object detection์ultralyticsํจํค์ง์ ํจ๊ปyolov8n.pt๊ฐ์ค์น๋ฅผ ์ฌ์ฉํ๋ค. ์ด ํ์ผ์ด ์ ์ฅ์์ ์ด๋ฏธ ํฌํจ๋์ด ์๋ค๋ฉด ์ถ๊ฐ ์์ ์ ํ์ ์๋ค. ํ์ผ์ด ์๋ ํ๊ฒฝ์์๋ ์ธํฐ๋ท์ด ์ฐ๊ฒฐ๋์ด ์์ผ๋ฉด ์ฒซ ์คํ ์ ์๋ ๋ค์ด๋ก๋๋ ์ ์๋ค. ์๋ ๋ค์ด๋ก๋์ ์คํจํ๋ค๋ฉด ์๋ ๋ช ๋ น์ผ๋ก ์ง์ ๋ฐ์ ์ ์๋ค..venv/bin/python -c "from ultralytics import YOLO; YOLO('yolov8n.pt')"Windows PowerShell:
.\.venv\Scripts\python.exe -c "from ultralytics import YOLO; YOLO('yolov8n.pt')"
Ultralytics documentation: https://docs.ultralytics.com/
-
Hugging Face pretrained models
Semantic segmentation๊ณผ CLIP text embedding์ ์ต์ด ์คํ ์ Hugging Face Hub์์ pretrained model์ ์๋ ๋ค์ด๋ก๋ํ๋ค.- SegFormer:
nvidia/segformer-b0-finetuned-ade-512-512 - CLIP text model:
openai/clip-vit-base-patch32
์ธํฐ๋ท์ด ์ฐ๊ฒฐ๋ ํ๊ฒฝ์ด๋ผ๋ฉด ๋๋ถ๋ถ ์๋์ผ๋ก ๋ฐ์์ง๋ค. ์๋ ๋ค์ด๋ก๋์ ์คํจํ๊ฑฐ๋ ์คํ๋ผ์ธ ํ๊ฒฝ์ด๋ผ๋ฉด ์๋ ๋ช ๋ น์ผ๋ก ๋ฏธ๋ฆฌ ์บ์๋ฅผ ์์ฑํด ๋ ์ ์๋ค.
SegFormer ์บ์ ์์:
python -c "from transformers import AutoImageProcessor, AutoModelForSemanticSegmentation; AutoImageProcessor.from_pretrained('nvidia/segformer-b0-finetuned-ade-512-512'); AutoModelForSemanticSegmentation.from_pretrained('nvidia/segformer-b0-finetuned-ade-512-512')"CLIP ์บ์ ์์:
python -c "from transformers import CLIPModel, CLIPTokenizer; CLIPTokenizer.from_pretrained('openai/clip-vit-base-patch32'); CLIPModel.from_pretrained('openai/clip-vit-base-patch32')"Windows PowerShell์์๋ ๊ฐ์ ๋ช ๋ น์ ๊ทธ๋๋ก
python -c "..."ํํ๋ก ์คํํ๋ฉด ๋๋ค. - SegFormer:
-
VisionCraft scene-classifier checkpoint
์ฑ์ ๊ธฐ๋ณธ scene classifier๋ ๋ค์ ์ฒดํฌํฌ์ธํธ๋ฅผ ๊ธฐ๋ํ๋ค.checkpoint/scene_classifier_resnet50_v11_text_crossattn_infonce_A.pt์ด ํ์ผ์ด ์์ผ๋ฉด ์ฑ์
_heuristic_scenefallback์ผ๋ก ๋์ํ๋ฉฐ, ํ์ต๋ ResNet50 + text cross-attention + InfoNCE ์ถ๋ก ๋์ coarse heuristic scene label๋ง ๋ฐํํ๋ค. -
Training / evaluation dataset
์ฐ๊ตฌ ํ์ดํ๋ผ์ธ์ ํ์ต๊ณผ ํ๊ฐ๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์๋ ๋ฐ์ดํฐ์ ๊ฒฝ๋ก๋ฅผ ์ฌ์ฉํ๋ค.data/visioncraft_subset_small_v11/์ด subset์ด ์๋ค๋ฉด ๊ทธ๋๋ก๋ ์ฌํ๋์ง ์๋๋ค. ํ์ํ ๊ฒฝ์ฐ ๋ค์ ๋ ๊ฒฝ๋ก๋ฅผ ์ฐธ๊ณ ํด ์ง์ ๋ฐ์ดํฐ๋ฅผ ์ค๋นํ ์ ์๋ค.
- Places365 official page: https://places2.csail.mit.edu/
- Places365 download page: https://places2.csail.mit.edu/download.html
์ ์ฅ์์๋ Places365 label์ VisionCraft class๋ก ์ฌ๋งคํํ๋ ์คํฌ๋ฆฝํธ๋ ํฌํจ๋์ด ์๋ค.
python src/models/build_visioncraft_subset.py --help
-
Scene text embedding cache
Text-guided ์คํ์ ์ฌํํ๋ ค๋ฉด CLIP ๊ธฐ๋ฐ scene text embedding cache๊ฐ ํ์ํ๋ค. ์ด ํ์ผ์ ์ฑ์ ๊ธฐ๋ณธ ์คํ์๋ ํ์๋ ์๋์ง๋ง, ํ์ต/ํ๊ฐ ์ฌํ์๋ ํ์ํ๋ค. ํ์ผ์ด ์๋ค๋ฉด ์๋ ๋ช ๋ น์ผ๋ก ์์ฑํ ์ ์๋ค.python src/models/precompute_scene_text_embeddings.py \ --output-path data/scene_text_embeddings_clip_sentence_v1.npz
์ถ๊ฐ๋ก macOS ํ๊ฒฝ์์๋ ์๊ฐํ ์คํฌ๋ฆฝํธ ์คํ ์ MPLCONFIGDIR=/private/tmp/mpl๋ฅผ ์ค์ ํ๋ฉด Matplotlib cache ๊ด๋ จ ๋ฌธ์ ๋ฅผ ์ค์ด๋ ๋ฐ ๋์์ด ๋๋ค. Windows์์๋ ํ๋ก์ ํธ ํด๋ ์์ .mplconfig๋ฅผ ์ฌ์ฉํ๋๋ก ์ค์ ํ๋ฉด ๊ถํ ๋ฌธ์ ๋ฅผ ํผํ ์ ์๋ค.
VisionCraft application์ ์๋ ๋ช ๋ น์ผ๋ก ์คํํ ์ ์๋ค.
macOS / Linux:
python app.pyWindows PowerShell:
$env:MPLCONFIGDIR = "$PWD\.mplconfig"
.\.venv\Scripts\python.exe app.pyWindows ์ฌ์ฉ์๋ ์์กด์ฑ ์ค์น๊ฐ ๋๋ ๋ค ํ๋ก์ ํธ ํด๋์ run_visioncraft.bat์ ๋๋ธํด๋ฆญํด๋ ๋๋ค. ์ด ํ์ผ์ .venv\Scripts\python.exe๋ก ์ฑ์ ์คํํ๊ณ MPLCONFIGDIR๋ฅผ ํ๋ก์ ํธ ๋ด๋ถ .mplconfig ํด๋๋ก ์ง์ ํ๋ค.
์คํ ํ ํฐ๋ฏธ๋์ ๋ค์๊ณผ ๊ฐ์ Gradio ์ฃผ์๊ฐ ์ถ๋ ฅ๋๋ฉด ๋ธ๋ผ์ฐ์ ์์ ์ฐ๋ค.
http://127.0.0.1:7860
์ฑ์ ์คํํ PowerShell ๋๋ .bat ์ฐฝ์ ๋ซ์ผ๋ฉด ๋ก์ปฌ ์๋ฒ๋ ์ข
๋ฃ๋๋ค. ๋ธ๋ผ์ฐ์ ์์ ERR_CONNECTION_REFUSED๊ฐ ๋์ค๋ฉด ์คํ ์ฐฝ์ด ์์ง ์ด๋ ค ์๋์ง ๋จผ์ ํ์ธํ๋ค.
์ ํ๋ฆฌ์ผ์ด์ ์์์๋ ๋ค์ ํ๋ฆ์ ํ์ธํ ์ ์๋ค.
- ์ ๋ ฅ ์ด๋ฏธ์ง ์ ๋ก๋
- low-level quality analysis
- scene classification / object detection / semantic segmentation
- auto straighten / crop preview / OCR
- traditional enhancement ๊ฒฐ๊ณผ์ difference heatmap
OCR ๊ฒฐ๊ณผ๋ฅผ ๋ณด๋ ค๋ฉด Enable Text Processing (OCR)๋ฅผ ์ผ๊ณ , Manual 4-Point Rectification ํญ์์ ๋ค ๊ผญ์ง์ ์ ์ง์ ํ ๋ค ๋ค์ ๋ถ์์ ์คํํด์ผ ํ๋ค.
Visual-only baseline ํ์ต ์์๋ ๋ค์๊ณผ ๊ฐ๋ค.
macOS / Linux / Windows ๊ณตํต:
python src/models/train_scene_classifier.py \
--data-root data/visioncraft_subset_small_v11 \
--output checkpoint/scene_classifier_resnet50_v11_visual_only_e20.pt \
--epochs 20 \
--batch-size 16 \
--image-size 224 \
--backbone resnet50 \
--fusion-mode visual-only \
--optimizer adamw \
--lr 1e-4 \
--weight-decay 1e-5 \
--label-smoothing 0.1 \
--freeze-backbone-epochs 2 \
--num-workers 0Vanilla text cross-attention ํ์ต ์์๋ ๋ค์๊ณผ ๊ฐ๋ค.
python src/models/train_scene_classifier.py \
--data-root data/visioncraft_subset_small_v11 \
--output checkpoint/scene_classifier_resnet50_v11_text_crossattn_e20.pt \
--epochs 20 \
--batch-size 16 \
--image-size 224 \
--backbone resnet50 \
--fusion-mode text-cross-attention \
--scene-text-embeddings-path data/scene_text_embeddings_clip_sentence_v1.npz \
--optimizer adamw \
--lr 1e-4 \
--weight-decay 1e-5 \
--label-smoothing 0.1 \
--freeze-backbone-epochs 2 \
--cross-attention-dropout 0.1 \
--num-workers 0Text Cross-Attention + InfoNCE ํ์ต ์์๋ ๋ค์๊ณผ ๊ฐ๋ค.
python src/models/train_scene_classifier.py \
--data-root data/visioncraft_subset_small_v11 \
--output checkpoint/scene_classifier_resnet50_v11_text_crossattn_infonce_A.pt \
--epochs 20 \
--batch-size 16 \
--image-size 224 \
--backbone resnet50 \
--fusion-mode text-cross-attention \
--scene-text-embeddings-path data/scene_text_embeddings_clip_sentence_v1.npz \
--optimizer adamw \
--lr 1e-4 \
--weight-decay 1e-5 \
--label-smoothing 0.1 \
--freeze-backbone-epochs 2 \
--cross-attention-dropout 0.1 \
--text-contrastive-weight 0.05 \
--text-contrastive-temperature 0.10 \
--num-workers 0ํ์ต์ ๋ฐฑ๊ทธ๋ผ์ด๋์์ ๋ก๊ทธ์ ํจ๊ป ์คํํ๋ ค๋ฉด nohup์ ์ฌ์ฉํ ์ ์๋ค.
nohup python -u src/models/train_scene_classifier.py ... > logs/train.log 2>&1 &Windows์์๋ nohup ๋์ PowerShell์ Start-Process๋ฅผ ์ฌ์ฉํ ์ ์๋ค.
Start-Process python -ArgumentList "src/models/train_scene_classifier.py", "--data-root", "data/visioncraft_subset_small_v11", "..." -NoNewWindowํ์ต๋ ์ฒดํฌํฌ์ธํธ์ confusion matrix์ classification report๋ ๋ค์ ๋ช ๋ น์ผ๋ก ์์ฑํ ์ ์๋ค.
python src/models/evaluate_scene_classifier.py \
--data-root data/visioncraft_subset_small_v11 \
--checkpoint checkpoint/scene_classifier_resnet50_v11_text_crossattn_infonce_A.pt \
--split val \
--batch-size 32 \
--num-workers 0 \
--report-path logs/eval_resnet50_v11_text_crossattn_infonce_A_report.txt \
--figure-path logs/eval_resnet50_v11_text_crossattn_infonce_A_confusion.png๋์ผํ ๋ฐฉ์์ผ๋ก baseline ๋๋ vanilla text cross-attention checkpoint๋ฅผ ๋ฃ์ผ๋ฉด ๊ฐ ๋ชจ๋ธ์ confusion matrix๋ฅผ ๋ณ๋๋ก ์ฌ์์ฑํ ์ ์๋ค.
Latent comparison์ ๋จผ์ cache๋ฅผ ๋ง๋ ๋ค, UMAP / t-SNE / similarity / prototype / attention visualization์ ์์ฑํ๋ ๋ฐฉ์์ผ๋ก ์งํํ๋ค.
Baseline vs vanilla text cache ์์ฑ:
MPLCONFIGDIR=/private/tmp/mpl \
python src/models/analyze_latent_comparison.py \
--data-root data/visioncraft_subset_small_v11 \
--baseline-checkpoint checkpoint/scene_classifier_resnet50_v11_visual_only_e20.pt \
--text-checkpoint checkpoint/scene_classifier_resnet50_v11_text_crossattn_e20.pt \
--split val \
--samples-per-class 180 \
--seed 42 \
--num-workers 0 \
--output-dir logs/latent_comparison_v11_full180 \
--cache-onlyWindows PowerShell์์๋ MPLCONFIGDIR๋ฅผ ์๋์ฒ๋ผ ์ค์ ํ ์ ์๋ค.
$env:MPLCONFIGDIR="$env:TEMP\\mpl"
python src/models/analyze_latent_comparison.py `
--data-root data/visioncraft_subset_small_v11 `
--baseline-checkpoint checkpoint/scene_classifier_resnet50_v11_visual_only_e20.pt `
--text-checkpoint checkpoint/scene_classifier_resnet50_v11_text_crossattn_e20.pt `
--split val `
--samples-per-class 180 `
--seed 42 `
--num-workers 0 `
--output-dir logs/latent_comparison_v11_full180 `
--cache-onlyInfoNCE rerun cache ์์ฑ:
MPLCONFIGDIR=/private/tmp/mpl \
python src/models/build_infonce_rerun_latent_cache.pyWindows PowerShell:
$env:MPLCONFIGDIR="$env:TEMP\\mpl"
python src/models/build_infonce_rerun_latent_cache.pyTriplet visualization ์์ฑ:
MPLCONFIGDIR=/private/tmp/mpl \
python src/models/build_triplet_latent_visualizations.pyWindows PowerShell:
$env:MPLCONFIGDIR="$env:TEMP\\mpl"
python src/models/build_triplet_latent_visualizations.pyScene confusion case gallery ์์ฑ:
python src/models/build_scene_confusion_case_gallery.pyWindows PowerShell:
python src/models/build_scene_confusion_case_gallery.pyVanilla attention example์ InfoNCE์ ๋์ผํ ์ํ์ ๋ง์ถฐ ๋ค์ ์์ฑํ๋ ค๋ฉด ๋ค์ ๋ช ๋ น์ ์ฌ์ฉํ ์ ์๋ค.
MPLCONFIGDIR=/private/tmp/mpl \
python src/models/plot_vanilla_attention_examples_matched_to_infonce.pyWindows PowerShell:
$env:MPLCONFIGDIR="$env:TEMP\\mpl"
python src/models/plot_vanilla_attention_examples_matched_to_infonce.pyScene text embedding cache๊ฐ ์์ง ์๋ค๋ฉด ๋จผ์ ๋ค์ ๋ช ๋ น์ ์คํํด์ผ ํ๋ค.
python src/models/precompute_scene_text_embeddings.py \
--output-path data/scene_text_embeddings_clip_sentence_v1.npzVisionCraft๋ ๋จ์ํ low-level image enhancement๋ฅผ ๋์ด, scene understanding์ ๋ถ์๊ณผ ๋ณด์ ๊ณผ์ ์ ์ฐ๊ฒฐํ๋ ค๋ ์๋์์ ์ถ๋ฐํ ํ๋ก์ ํธ์ด๋ค. Application ๊ด์ ์์ ๋ณธ ์์คํ ์ brightness, contrast, blur, exposure์ ๊ฐ์ ํ์ง ์งํ๋ฅผ ์ง๋จํ๊ณ , scene classification, object detection, semantic segmentation, OCR, crop suggestion, traditional enhancement๋ฅผ ํ๋์ ํตํฉํ ํ์ดํ๋ผ์ธ ์์์ ๊ฒฐํฉํ๋ค. ๊ทธ ๊ฒฐ๊ณผ VisionCraft๋ ๋จ์ํ "๋ณด์ ๋ ์ด๋ฏธ์ง"๋ง์ ๋ฐํํ๋ ๊ฒ์ด ์๋๋ผ, ์ ์ด๋ฌํ ๋ณด์ ์ด ํ์ํ๋์ง์ ๋ํ ์๊ฐ์ ยท์ ๋์ ๊ทผ๊ฑฐ๊น์ง ํจ๊ป ์ ๊ณตํ๋ scene-aware image understanding system์ผ๋ก ๋์ํ๋ค.
Research ๊ด์ ์์๋ visual-only baseline, vanilla text cross-attention, text cross-attention + InfoNCE๋ฅผ ๋จ๊ณ์ ์ผ๋ก ๋น๊ตํจ์ผ๋ก์จ, text prior๊ฐ scene classification์ latent representation์ ์ด๋ค ๊ตฌ์กฐ์ ๋ณํ๋ฅผ ์ผ์ผํค๋์ง๋ฅผ ๋ถ์ํ๋ค. ์คํ ๊ฒฐ๊ณผ, visual-only baseline์ 59.79%, vanilla text cross-attention์ 60.56%, ์ต์ข
InfoNCE variant๋ 60.75%์ validation accuracy๋ฅผ ๊ธฐ๋กํ์๋ค. ๋ ์ค์ํ ์ ์ ์ด ์ฑ๋ฅ ์ฐจ์ด๊ฐ ๋จ์ accuracy ์ซ์์ ๊ทธ์น์ง ์์๋ค๋ ๊ฒ์ด๋ค. UMAP, t-SNE, confusion matrix, centroid heatmap, prototype histogram, attention visualization์ ์ข
ํฉํ๋ฉด, vanilla text cross-attention์ semantic smoothing๊ณผ latent reorganization์ ๊ธฐ์ฌํ๊ณ , InfoNCE๋ ๊ทธ ์์ class-aware separation๊ณผ prototype alignment๋ฅผ ์ถ๊ฐ๋ก ๊ฐํํ๋ ๋ฐฉํฅ์ผ๋ก ์๋ํ์์ ํ์ธํ ์ ์์๋ค.
์ฆ VisionCraft์ ํต์ฌ ๊ธฐ์ฌ๋ ๋ ๊ฐ์ง๋ก ์์ฝํ ์ ์๋ค. ์ฒซ์งธ, scene context๋ฅผ ์ค์ enhancement pipeline ์์ ์ฐ๊ฒฐํ practical computer vision system์ ๊ตฌํํ๋ค๋ ์ ์ด๋ค. ๋์งธ, text-guided multimodal learning์ด scene classification์์ ๋จ์ํ ๋ณด์กฐ ์ ๋ณด๊ฐ ์๋๋ผ latent geometry๋ฅผ ์ฌ๊ตฌ์ฑํ๋ ๊ตฌ์กฐ์ ์ ํธ๋ก ์๋ํ ์ ์์์ ์ ๋์ ยท์ ์ฑ์ ์ผ๋ก ๋ณด์ฌ์ฃผ์๋ค๋ ์ ์ด๋ค.
ํฅํ์๋ ๋ ์ ๊ตํ text prototype ์ค๊ณ, adaptive fusion, confusion-pair ์ค์ฌ contrastive objective, ๊ทธ๋ฆฌ๊ณ scene representation๊ณผ enhancement policy์ ๋ ๊ธด๋ฐํ ๊ฒฐํฉ์ ํตํด VisionCraft๋ฅผ ํ์ฅํ ์ ์๋ค. ๊ทธ๋ผ์๋ ํ์ฌ ๊ฒฐ๊ณผ๋ง์ผ๋ก๋, ๋ณธ ํ๋ก์ ํธ๋ scene-aware image understanding๊ณผ multimodal representation learning์ ํ๋์ ์ผ๊ด๋ ํ๋ ์์ํฌ ์์์ ์ฐ๊ฒฐํ ์๋ฏธ ์๋ ์ถ๋ฐ์ ์ด๋ผ๊ณ ๋ณผ ์ ์๋ค.
-
B. Zhou, A. Lapedriza, A. Khosla, A. Oliva, and A. Torralba, "Places: A 10 million Image Database for Scene Recognition," IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2017.
Dataset / project page: https://places2.csail.mit.edu/ -
E. Xie, W. Wang, Z. Yu, A. Anandkumar, J. M. Alvarez, and P. Luo, "SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers," Advances in Neural Information Processing Systems (NeurIPS), 2021.
-
A. Radford, J. W. Kim, C. Hallacy, et al., "Learning Transferable Visual Models From Natural Language Supervision," Proceedings of ICML, 2021.
CLIP text embedding๊ณผ text prototype ์ค๊ณ์ ๊ธฐ๋ฐ์ด ๋๋ ๋ ผ๋ฌธ -
G. Jocher, A. Chaurasia, and J. Qiu, "YOLO by Ultralytics," 2023.
Documentation: https://docs.ultralytics.com/



























