논문읽기

Towards Training-free Anomaly Detection with Vision and Language Foundation Models

띠오니의 IAD 2025. 4. 3. 12:46

why : logical defect와 spatial defect를 동시에 처리하고 싶다.

what : MOT 기반 Segmentation foundation model을 이용한 관심사 분할

how : 이미지레벨, 관심사 레벨을 이용한 spatial defect, MOT를 이용한 matching을 통한 logical defect 처리.


 

이전 논문의 한계는 다음과 같다. local defect에 집중한다. 논리적인 defect, 그리고 조합간의 defect는 무시한다.

조합간의 이상을 무시한다? -> 밀키트에는 A, B, C가 필수적으로 들어가야 한다. 근데 non-defect A, B, D가 들어있다 가정하자. 이전 논문에서는 이런걸 잘 감지하지 못했다.

-> LogSAD를 통해 해결하자

-> non-training-Logical and Structural Anomaly Detection을 이루고자 한다.

그러기위해 다음과 같은 사항을 고려했다.

1. matching of thought : IAD를 위해 matching proposal, 지식과 관심사를 수식화 함.

2. 다중 구조 멀티모달 : consisting of patch tokens을 통해 sets of interests를 조합 매칭 시킴

 


이전 연구에서 사용한 데이터는 local structural anomalies에 biased된 데이터임. 

또한 종종 필수적인 구성품의 부재를 detection하는 능력이 떨어짐

이전 연구는 비전 모델의 비중이 컸는데 이는 logically compositional defect를 aspect하는 능력이 부족함.

또한 이 문제를 해결하기 위해 여러 모델을 mix하게 되면 매우 복잡해짐.

 

LogSAD : VLM의 logical defect aspect strength의 한계를 돌파

1. matching proposal + formulating interests and compositional matching rules of thought with vision and language instructions.

2. 세부 defect를 찾기 위해 멀티 detector를 사용함(VLM)

 

- We present LogSAD, a training-free framework for
anomaly detection utilizing vision and language founda-
tion models, and demonstrate its capability to detect both
logical and structural anomalies.
- We introduce the match-of-thought architecture, illustrat-
ing its effectiveness through intermediate steps in gener-
ating interests and matching rules for anomaly detection
with multi-modal instructions.
- We propose multi-granularity detectors encompassing
patch tokens, set of interests, and composition matching,
as well as fusion strategies within the unified framework
for anomaly detection.

 

GCAD: logical, local defect 둘다 해결하려 시도한 모델


MOT : COT에 영감받음, 사진과 텍스트에서 interest part만을 뽑아냄 동시에 매칭 룰을 만듦.

DETECTOR : focusing on patch, interests, and compositional matching을 사용해서 logical&structural defect를 찾아냄

Match-of-thought : compositional matching rule을 만듦

Multi-granularity Anomaly Detectors : compositional matching rule을 기반으로 matching을 수행하는데 아래 3단계로 나눔

- patch matching : CLIP, DINO2를 이용함. stage별로 internel feature를 추출함. anomaly-free image를 bank에 저장하는데, 이는 path-level-anomaly-detection에 사용됨. 구체적으로는 쿼리 이미지와 bank에 같은 이미지가 있다고 가정하자. 둘을 patch-wise하게 [1-<Q,B>]를 사용해서 anomaly score를 계산함. 

- interests matching : SAM, CLIP을 사용하는데 이를 기반으로 관심영역 segmentation을 진행함. 이후에 각 관심사 segmentation mask를 aggregating함.

- compositional matching : logical-defect를 담당함. SAM에서 세그멘테이션 된 mask를 가지고 interest part에 해당하는 이미지만 준비함. 해당 이미지랑 text를 이용해서 clip을 통해 align 되어있는지 확인.

 

결과 :

segmentation 성능도 좋고 logical defect를 잘 찾아냄

한계 : 

segmentation을 놓치는 경우가 발생했고, 볼트와 너트를 구분하지 못해서 interest extract를 실패함.


전체 요약 : 밀키트를 예로 들자. 정상 이미지를 준비한다. 정상 이미지에는 A, B, C구성요소가 있다.

해당 정상 이미지로 MOT를 만듦.

MOT :

{A : 흰색, B : 녹색, C: 빨간색 || A : 두부, B : 상추, C: 고기}

이제 쿼리 이미지가 들어간다.

 

1. internel feature를 가지고 전체적인 defect를 찾는다. (patch-wise-anomaly-detection)

2. SAM을 활용한 관심 영역 segmentation을 한다. 쿼리 이미지랑, 정상 이미지가 각각 segmentation된다.

각각 쿼리 이미지랑 정상 이미지에서 3장씩 나온다. (두부 segmentation, 상추 segmentation, 고기 segmentation)x2

각각의 segmentation result끼리 헝가리안 알고리즘으로 매칭을 한다. 이후 그 값을 각각 구성요소별 anomaly score로 사용한다.

3. 논리적 defect를 확인한다. 

두부만 segmentation된 mask를 활용해서 두부 이미지만 가져온다.

이후 두부 이미지랑 흰색이라는 텍스트를 clip에 넣어 똑바로 align되었는지 확인한다.

 

max(1,2,3) -> anomaly score로 활용한다.