Hybrid prompt regularization을 통해 modern foundation model의 adaptability를 개선하기 위한 zeroshot anomaly segmentation 방법론인 Segment Any Anomaly + (SAA+)를 제안함.
Segment anything 모델의 zero-shot generalization ability에서 영감을 받아서 anomaly localization에 다양한 multi-modal prior knowledge를 활용함.
Foundation model adaptation을 non-parametric하게 domain expert knowledge , target image context를 regularization으로써 hybrid prompt로 구성함.
Method
foundation model은 Prompting을 통해서 prior knowledge를 retrieving해서 좋은 zero-shot visual perception ablility를 가짐. 이를 활용해서 본 논문에서도 zero-shot setting 하에서 anomaly segmentation을 위해 어떻게 foundation model을 adaptation 할 지 고민함.
전체적인 과정은 먼저 language를 initial prompt로 써서 rough하게 coarse anomaly region proposals를 retrieve 함.(Anomaly Region Generator)
이 때 foundation model로는 language-driven visual grounding foundation model인 GroundingDINO를 씀.
이후, anomaly region proposal은 pixel-wise high quality segmentation mask로 refine됨 (Anomaly Region Refiner)
이 때는 prompt-driven segmentation foundation model인 SAM 씀
Anomaly Region Generator
Foundation model이 language prompt를 통해 이미지의 object를 retrieve 할 수 있는 ablity를 활용함.
e.g. "Anomaly" 같이 detected되기를 원하는 region을 describe하기 위해 language prompt를 날리면, foundation model은 query image I에 대해 원하는 region을 생성할 수 있음.
이 때의 foundation model로는 visual grounding을 위하s text-guided open-set object detection architecture인 GroundingDINO을 base로 함. (large-scale language-vision dataset으로 pre-trained 됨)
구체적으로는 Text encoder로부터 language prompt를 뽑고 Iamge encoder로부터 query image를 뽑으면 cross-modality decoder로부터 bounding box 형태의 rough object region이 만들어짐.
Bounding box level region set R^B랑 그에 해당하는 confidence score set S가 있으면 anomaly region generator은 아래 식처럼 효현될 수 있음.
Anomaly Region Refiner
이 부분은 Bounding box level anomaly region candidate를 anomaly segmentation mask set으로 refine 하는 과정임.
이 때는 open-world visual segmentation을 위한 정교한 foundation model인 SAM을 씀.
SAM은 ViT-based backbone, 그리고 prompt-conditioned mask decoder로 구성되어 있음.
Prompt-conditioned mask decoder는 다양한 타입의 prompt를 input으로 받을 수 있음. 따라서 bounding box candidates를 prompt로 날려서 pixel-level segmentation mask를 만듦.
그럼 confidence score S에 해당하는 high quality segmentation mask를 얻을 수 있음.
이 때의 prompt는 naive class-agnostic language prompt인 "anomaly" 임.
Analysis on the ZSAS Performance of Vanilla Foundation Model Assembly
fig 1처럼 False alarm 문제가 있음. "anomaly"라고 prompt를 날리게 되면 weak한 부분이 모두 잡히게 됨. 따라서 overlong weak만 잡게 할 필요가 있음. 이를 본 논문에서는 "Language ambiguity issue"라고 칭하고 있음.
이런 Language ambiguity issue가 발생하는 이유를 pretraining language-vision dataset과 targeted ZSAS dataset과의 domain gap차이 라고 주장.
정확한 "Anomaly"는 object-specific 하고 object에 걸쳐서 매우 다양할 것. 따라서 domain expert knowledge와 target image context를 추가로 활용함.
이 prompt들이 desired properties를 만족하지 못하는region candidates는 지워주는 역할을 함.
또 Target image context를 fully 활용하기 위해 image saliency와 region confidence ranking을 prompt로 써서 이미지 내에서 다른 영역이랑 이상 영역 사이의 유클리디안 거리로 유사도를 고려해서 anomaly degree of a region을 추가로 고려함.
SAA+: Foundation Model Adaption via Hybrid Prompt Regularization
Domain expert knowledge를 통해 "count", "area"와 같은 알기 어려운 부분을 보완함.
Anomaly Language Expression as Prompt
potential open-world anomalies를 설명하기 위해 더 정확한 language prompt를 설계했고 이는 크게 두 가지 타입인 class-agnostic, class-specific prompt로 나눠짐.
Class-agnostic prompt: Anomlay, defect와 같은 general
prompt
Class-specific prompt: "black hole", "white bubble"과 같이 pre-trained visual-linguistic dataset에 서 활용된 prompt 사용해서 원하는 지역에 대한 query를 날림.
Anomaly Object Property as Prompt
이 부분의 역할은 anomaly의 location과 area를 반영하기 위함임.
현재 foundation model은 size나 location과 관련된 specific property description으로 query를 날릴 때 제한이 있음. (ex. "The small black hole on the left of the cable")
이런 expert knowledge를 통합하기 위해 언어가 아닌 anomaly property prompts를 씀.
Anomay Location
Background context의 영향으로 인해 inspected object 바깥쪽에 anomaly가 나타날 수 있기 때문에 foundation model의 open-world detection capability를 활용해서 potential anomaly region과 inspected object 간의 IoU를 계산함.
expert-derived IoU threshold를 통해 IoU값으로부터 anomaly candidates를 필터링 할 수 있음.
Anomaly Area
Anomaly의 크기(reflected by its area)는 유용한 정보를 줄 수 있음. 예를 들어 일반적으로 anomaly는 object보다 클 수 없음.
적절한 threshold 값을 통해 Object area에 해당하지 않는 영역들을 필터링 할 수 있음.
따라서 이 두 측면의 prompt를 모두 활용해서 filter function을 통해 confidence scor에 해당하는 candidate region을 필터링할 수 있음.
Prompts Derived from Target Image Context
Anomaly Saliency as Prompt
Domain gap이 포함된 prediction의 confidence score를 calibrate하기 위해 visual saliency를 활용함.
Anomaly degree를 알려주는 정보를 포함하고 있음. 따라서 Nearest neighbor와 해당하는 픽셀 feature 사이의 평균 거리를 계산해서 saliency map을 만듦.
Saliency prompts는 해당하는 region mask에 대한 exponential average saliency로 정의됨.
이 Saliency prompts는 anomaly region에 대한 confidence를 제공해서 foundation model로부터의 confidence score를 recalibrate해서 new rescaled score를 얻을 수 있게 함.
이 rescaled scores를 통해 foundation model로부터의 confidence와 region candidate에 해당하는 saliency를 얻게 됨.
Anomaly Confidence as Prompt
일반적으로 anomaly region의 수는 제한되기 때문에 anomaly confidence prompts를 제안해서 image content와 final anomlay region detection의 average value를 바탕으로 가장 높은 confidence scores 중 K개의 candidates를 indentify함.
즉 해당하는 confidence core의 Top K candidate region을 선택함.
이 K candidate region으로부터 final anomaly map 예측함.
이렇게 제안하는 hybrid prompt(Pl, Pp, Ps, Pc)를 통해 SAA를 regulaize(SAA+)해서 더 reliable한 anomaly prediction을 얻음.
Abstract
Method
foundation model은 Prompting을 통해서 prior knowledge를 retrieving해서 좋은 zero-shot visual perception ablility를 가짐. 이를 활용해서 본 논문에서도 zero-shot setting 하에서 anomaly segmentation을 위해 어떻게 foundation model을 adaptation 할 지 고민함.
Anomaly Region Generator
Anomaly Region Refiner
Analysis on the ZSAS Performance of Vanilla Foundation Model Assembly
SAA+: Foundation Model Adaption via Hybrid Prompt Regularization
Anomaly Language Expression as Prompt
Anomaly Object Property as Prompt
Prompts Derived from Target Image Context
Anomaly Saliency as Prompt
이 Saliency prompts는 anomaly region에 대한 confidence를 제공해서 foundation model로부터의 confidence score를 recalibrate해서 new rescaled score를 얻을 수 있게 함.
이 rescaled scores를 통해 foundation model로부터의 confidence와 region candidate에 해당하는 saliency를 얻게 됨.
Anomaly Confidence as Prompt
이렇게 제안하는 hybrid prompt(Pl, Pp, Ps, Pc)를 통해 SAA를 regulaize(SAA+)해서 더 reliable한 anomaly prediction을 얻음.
Experiments
Conclusion