
1. Introduction
3. Methodology

3.1 Preliminaries
- Problem Statement
- $D_{train} = \left\{X_{train}, Y_{train} \right\}$ : 정상과 비정상 샘플을 포함한 auxiliary training dataset
- $X_{train}=\left\{x_i \right\}^N_{i=1}$ : $N$개의 이미지 집합
- $Y_{train} = \left\{y_i, G_i \right\}_{i=1}^N$ : 대응하는 GT labels과 pixel-level anomaly masks
- $y_i=0$이면 정상 이미지, $y_i=1$이면 비정상 이미지
- $G_i$ : $x_i$의 pixel-level annotation
- $T=\left\{D^1_{test}, D^2_{test}, … , D^t_{test} \right\}$ : target dataset
- $D^j_{test}=\left\{X^j_{test}, Y^j_{test} \right\}$ : 학습 데이터 $D_{train}$와 다른 정상과 비정상 샘플
- ZSAD의 목표는 $D_{train}$에 대해 학습해 $T$의 다양한 test set에 대해 이상치를 탐지하는 일반화 능력을 가진 모델 개발
- 입력 RGB 이미지 $X \in R^{h \times w \times 3}$이 주어지면 ZSAD 모델은 다음과 같은 output을 생성
- image-level anomaly score $s_x \in R$와 pixel-level anomaly map $M_x \in R^{h \times w}$
- $h$와 $w$는 $x$의 height와 width
- $s_x$와 $M_x$의 값은 $[0,1]$에 존재하며, 그 값이 1에 가까울수록 이상치일 가능성이 높음
3.2 Overview of FAPrompt
FAPrompt
은 Compound Abnormality Prompting(CAP)
와 Data-dependent Abnormality Prior(DAP)
로 구성
CAP
는 하나의 정상 프롬프트에 여러 이상 프롬프트를 추가하는 compound prompting
방식으로 이상 프롬프트를 얻음
- 이러한 정상과 비정상 text prompt는 CLIP의 text encoder $f_t(\cdot)$를 통해 임베딩 생성
- 이미지 $x$가 주어지면
FAPrompt
는 이미지 토큰 임베딩 $f_v(x)$와 패치 토큰 임베딩 집합 $F_v \in R^{l \times d}$를 추출
- 이후 이미지와 텍스트 임베딩 간의 유사도를 기반으로 $D_{train}$을 사용하여 프롬프트를 학습
- fine-grained abnormality prompt는 유사도 계산 이전에 aggregate
DAP
는 fine-grained abnormality prompt의 dataset에 걸친 일반화 능력을 향상시키기 위해 도입
- DAP는 주어진 query/test image $x$에 기반해 가장 관련있는 abnormality feature를 도출
- CAP의 abnormality prompt를 주어진 target dataset의 특성에 맞게 동적으로 adapt하기 전에
sample-wise abnormality prior
로 사용
- 학습 시 CLIP의 원본 파라미터들은 frozen된 채로 유지
- text encoder layer에 부착된 학습 가능한 토큰들만 정상과 fine-grained abnormality prompt를 따라 최적화
3.3 Compound Abnormality Prompt Learning