Giter Site home page Giter Site logo

dl_paper_review's Introduction

header

trophy

Top Langs

📞 Contact

  • Mail Mail
  • LinkedIn Blog

🛠 Tech Stack

📝 Education

Period Institution Major Degree Remarks
2022.06~ Yonsei Univ. Department of Industrial Engineering, Knowledge Fusion Artificial Intelligence Lab Master's Enrolled
2021.12~ Kookmin Univ. Department of Computer Science, Artificial Intelligence Lab Undergraduate Researcher Completed
2021.03~ Kookmin Univ. Data Science Minor Graduated
2020.03~ Kookmin Univ. AI Bigdata & management Major Graduated
2019.03~ Kookmin Univ. Forest & Bio technology - Major changed

🖥️ Research Area

Research Area
Computer Vision with Deep Learning
Anomaly Detection
Open-Set Recognition
Few-Shot Learning
Incremental/Continual Learning
Self-Supervised Learning
Semantic Segmentation with less supervision
Object Detection

🏆 Competition & Project

Year Category Host Project Result
2023 Image CVPR Workshop VPLOW Object Discovery challenge 2nd place
2023 Sensor LG Energy Solution Self-Supervised Learning for sensor-based anomaly detection
2022 Video KMU DREAM: Debiased Representation based Evidential Open Set Action Recognition with Multi-modality link
2022 Image Generation D&A Personal Color Classification and Makeup Style Transfer
2022 Recommendation System KMU ViT(Vision Transformer)-based Recommendation System utilizing Auxiliary Information link
2022 Distributed Computing KMU Implementation of removing duplicate edges and loops from the hyperlink network graph dataset of Wikipedia using MapReduce
2022 Multi-modal AI Spark Challenge Planning and Development of Counseling Support Service through Emotion Analysis Advanced to the Final Round
2021 NLP DACON News Topic Classification AI Competition top 4%
2021 Time Series Big Contest ECO Jeju Division, Predicting Food Waste Amount and Deriving Reduction Strategies
2021 NLP KMU Analysis of Customer Reviews in Musinsa Shopping Mall
2021 Spatial Data Analysis (QGIS) KMU If Seoul's Starbucks stores need to be reduced by 20% due to prolonged COVID-19, which areas and why?
2021 Spatial Data Analysis (QGIS) KMU Mapping and Characteristic Analysis of Restaurants that Survived for 10 Years in the Sungshin Women's University Commercial Area
2021 Speech KMU Prediction of Depression through Voice Emotion Analysis
2021 Machine Learning D&A Prediction of Customer Gender based on Department Store
2020 Machine Learning KMU Customized promotion planning based on gender and age group through analysis of L-point customer purchase data

footer

dl_paper_review's People

Contributors

sy00n avatar

Watchers

 avatar

dl_paper_review's Issues

[49] Barlow Twins: Self-Supervised Learning via Redundancy Reduction

  • 목적 : 하나는 distorted image, 하나는 그냥 image가 동일한 네트워크에 들어가서 cross-correlation matrix를 구해서 최대한 identity matrix로 만들어서 collapse를 피하는 방식.
  • Distorted version의 샘플이 유사해지면, 이 두 벡터 사이의 redundancy가 최소화될 것.
  • 이 방식은 큰 배치 사이즈가 필요하지도 않음.

image
image
image
C는 두 output vector 간 cross-correlation matrix(2)를 의미함.

  • Invariance term: cross-correlation matrix에서 diagonal 값이 1이 되게끔
  • Redundancy reduction term: off-diagonal elements 값이 0이 되게(베딩에서 서로 다른 components에 해당하는 애들은 decorrelate) 학습하면서 distortion에 invariant하게 됨. 이렇게 decorrelation하면 output간의 redundancy를 줄일 수 있어서 output값은 non-redundant information을 갖게 됨.
    • Redundancy reduction term을 soft-whitening operation으로 볼수 있으며 hard-whitening method보다도 잘 한다고 함.
    • 이 redundancy reduction term이 마치 InfoNCE loss의 역할을 하게 됨.
      image
      image
  • 이 두 Loss를 보면 distoration에 invariant한 임베딩을 만들려고 학습하고 학습한 임베딩 사이의 variability를 최대화한다는 점임.
    또 batch statistics에 의존해서 variability를 measure한다는 점임.
  • 하지만 InfoCNE loss의 경우 모든 pair sample 간 거리를 다 측정해서 이 거리를 최대화함으로써 variability를 최대화하는 object인데, - 본 방식의 경우 임베딩 벡터의 components를 decorrelating함으로써 똑같은 역할을 하고 있음.
  • 또 InfoNCE는 임베딩 분포의 엔트로피에 대한 non-parametric estimation으로 볼 수 있어서 차원의 저주로 이어지기 때문에 low-dimensional setting에서만 유효함. 반면 본 방식은 proxy emtropy estimator로 볼 수 있음.

[19] Distilling Self-Supervised Vision Transformers for Weakly-Supervised Few-Shot Classification & Segmentation

링크 : https://openaccess.thecvf.com/content/CVPR2023/papers/Kang_Distilling_Self-Supervised_Vision_Transformers_for_Weakly-Supervised_Few-Shot_Classification__Segmentation_CVPR_2023_paper.pdf

Abstract

  • 본 논문은 self-supervised pretrained ViT를 활용한 weakly-supervised few-shot image classification & segmentation task를 다룬다.
  • Self-supervsed ViT의 token representation의 self-attention을 활용해서 correlation을 반영하고 각각 2개 head를 두어서 classification과 segmentation을 수행한다.
  • Pixel-level label 없이 오직 image-level label만 가지고도 classification과 segmentation을 수행할 수 있는 방식이다.
    • 이를 위해 pretrained ViT backbone에서의 token에 해당하는 attention map을 사용해서 pseudo-label로 사용한다.
  • 더 practical setup인 "mixed" supervision을 사용해서 groud truth가 존재하는 작은 수의 training 이미지와 나머지 only image-level label만 가지는 경우를 다룬다.
    • Mixed setup에서는 pseudo-label enhancer(학습하는 방식)를 사용해서 pseudo-label을 개선한다.

Introduction

본 연구에서는 few-shot classification과 image segmentation을 통합하는 것에 초점을 둠.
그동안 conventional weakly supervised learning은 많이 연구되어 왔지만, weakly supervised few-shot learning은 잘 연구되어 오지 않은 이유는 train시와 test 시의object class가 다르니까 train시의 class에만 과적합 되는 경향이 있기 때문이다. (few shot이라 더더욱 치명적일 수 밖에 없음.)
따라서 본 연구에서는 image-level labels(class labels)에만 접근 가능한 weakly supervised FS-CS 시나리오를 다룬다.

슬라이드3
슬라이드4
슬라이드5
슬라이드6
슬라이드7
슬라이드8
슬라이드9
슬라이드10
슬라이드11
슬라이드12
슬라이드13
슬라이드14
슬라이드15
슬라이드16
슬라이드17
슬라이드18
슬라이드19
슬라이드20
슬라이드21
슬라이드22
슬라이드23
슬라이드24
슬라이드25
슬라이드26
슬라이드27
슬라이드28
슬라이드29
슬라이드30
슬라이드31

[21] Integrative Few-Shot Learning for Classification and Segmentation

Introduction

Few-shot Learning은 학습 시에 제한된 수의 샘플을 supervision으로 활용 가능한 문제를 다룬다. Few-shot classification(FS-C)은 각각의 target class에 대해 적은 수의 support set이 존재하는 경우 query image로 부터 target class 중 하나로 분류한다. Few-shot Segmentation(FS-S)의 경우 유사한 셋업에서 query image에 대한 target class region을 segmentation 한다.

  • 기존 연구들의 한계점
    • 기존 Few-shot classification(FS-C), Few-shot Segmentation(FS-S)은 서로 유사한 점이 있음에도 불구하고 각각 따로 연구되어 왔다.
    • 그리고 기존 FS-C는 query가 항상 target class 중 하나만 포함한다고 가정하는 반면(multiple class를 가지는 상황은 고려하지 않음), FS-S에서는 multiple class를 허용하지만 target class가 없는 경우는 고려하지 않는다.
      image
      예를 들어 fig1처럼 어떤 target class없이 query image만 주어진 경우, FS-S learners는 일반적으로 query의 arbitrary object를 segment한다는 문제점을 확인할 수 있다. (support semantics에 해당하지 않는 salient objects를 그냥 맹목적으로 하이라이트 해버림.)
      위와 같은 문제를 해결하기 위해서, 본 논문에서는 two few-shot learning문제를 multi-label and background-aware prediction 문제와 결합해서 해결한다.
  • query image와 target class에 대한 few-shot support set이 주어지면, 각각의 target class의 존재를 확인하고 query에 대한 foreground mask를 예측한다.
  • 기존 FS-C, FS-S와 다르게 classification의 경우 class exclusiveness를 가정하지 않고 segmentation의 경우 모든 target class가 존재한다고 가정하지 않는다.
  • interegrative few-shot learning(iFSL)은 classification, segmentation 둘 다에서 foreground map을 share한다. 따라서 class-wise foreground map을 공유함으로써 multi-label classification, pixel-wise segmentation을 결합할 수 있다.
  • attentive sqeeuze mask(ASNet)을 설계해서 query와 support image feature 간의 semantic correlation을 계산하고 strided self-attention을 통해 tensor를 foreground map으로 바꾼다.
  • 이를 통해 multi-layer neural features, global self-attention을 활용함으로써 reliable foreground map을 만들 수 있다.

Multi-label background-aware prediction

  • conventional FS-C에서는 query를 target class 중 하나로 할당하기 때문에 이 query가 none이나 multiple target class에 할당되는 경우는 다루지 않았다.
  • 따라서 이런 한계를 다루기 위해 background class를 두어서 multi-label classification이 가능하도록 일반화했다.
  • query와 support image간의 semantic similarities를 비교하고 class-wise occurrences를 구한다. 만약 어떠한 target class도 detect 되지 않을 경우 background class로 분류된다. 이렇게 relaxed constraint 덕분에 꼭 항상 하나의 class로 분류되지 않아도 되기 때문에 좀 더 일반적인 상황을 다룰 수 있다.

Integration of classification and segmentation

  • FS-CS는 multi-label few-shot classification에 pixel-level spatial reasoning을 적용함으로써 semantic segmentation과 통합한다.
  • 기존 FS-S에서는 query class가 항상 support class set과 정확히 매칭된다고 가정한 반면, FS-CS에서는 query class가 support class의 subset이 될 수 있음을 가정함으로써 기존 가정을 완화한다.
  • 이렇게 통합된 Few-shot learner는 multi-label background-aware class occurrences를 예측할 수 있고 relaxed constraint하에서 동시에 segmentation map 또한 예측할 수 있다.

Method

Integrative Few-Shot Learning(iFSL)은 class tag나 segmentation supervision 중에서 하나를 활용한다. integrated few-shot learner를 f라고 정의했는데 이 f는 인풋으로 쿼리 이미지 x와 서포트 셋 S를 받고, 아웃풋으로 class-wise foreground maps Y를 내뱉는다.
image

Inference

inference 시에는 top of the set of foreground maps Y에 대한 segmentation masks, class-wise occurrences 둘다 inference를 수행한다.
image
class-wise occurrences에서는 위처럼 threshold + max pooling에 의해 예측된다. 이 때 average pooling이 multi-label classification에서 small object에 대해 오분류 하는 경향이 있음을 발견했기에 max pooling을 적용했다.
image

segmentation에서는 class-wise foreground map으로부터 segmentation probability tensor를 얻을 수 있다. N개의 class-wise background map을 episodic background map on the fly로 통합한다. foreground에 속하지 않을 probability maps를 평균내서 episodic background map을 얻고 class-wise foreground map과 concat한다.

image
그래서 최종 segmentation mask는 식 5처럼 얻어진다. (각 위치 별로 most probable class로 분류됨)

Learning objective

-classification loss는 spatially average-pooled scores와 ground-truth class label간의 BCE loss로 계산된다.
image
Segmentation loss는 각 개별 위치에 대한 class distribution과 ground-truth segmentation annotation 사이의 average cross-entropy로 구성된다.
image
이 두 loss는 똑같이 분류라는 목적을 가지고 있지만 분류 레벨이 이미지인지, 픽셀인지에 따라 차이가 있다. 둘 중 하나가 선택됨에 따라 학습 시의 supervision level이 정해진다.

Overall flow

image
ASNet은 input으로 쿼리 이미지와 서포트 이미지 간의 pyramidal cross-correlation tensor를 받는다. (feature pyramids, 이를 hypercorrelations 라고 표현하고 있음)
pyramidal correlation은 pyramidal AS layer에 fed되어서 서포트 이미지의 spatial dimension을 gradually squeeze하고 pyramidal output은 bottom-up pathway로 final foreground map과 merge된다. N-way output maps는 parallel하게 연산되고 class-wise foreground map이 계산된다.

Attentive Squeeze Network(ASNet)

  • Hypercorrelation construction
    • NK개의 서포트 이미지와 쿼리 이미지에 대해 NK hypercorrelations를 계산한다. 이 때 resnet50에서의 bottleneck 부분에 해당하는 unit layer에 대해 feature pyramid를 모으고, 이에 해당하는 쿼리와 서포트 feature pyramids 간의 cosine similarity를 구해서 Hq X Wq X Hs X Ws 크기의 4차원 correlation tensor를 얻는다.
    • image
      위 식은 l번째 layer에 대한 각 identical spatial sizes P 별로 그룹된 correlation tensor를 의미한다. 그다음에 각각의 그룹 텐서는 새로운 채널 축을 따라 concat 되어서 hypercorrelation pyramid를 얻게 된다. 이 때의 channel size는 p번째 group의 concat되는 텐서 수에 해당한다.
      image

Attentive squeeze layer (AS layer)

AS 층에서는 strided self-attention을 통해 correlation tensor를 더 작은 support dimension으로 바꾼다. correlation tensor C가 hypercorrelation pyramid로 주어지면, Hq X Wq 크기로 줄인다.
image
AS layer의 목표는 query dimension은 유지되면서 reduced support dimension을 통해 각각의 support correlation tensor에 대한 global context를 분석하는 것이다.
image

각각의 support correlation에서 전체적인 패턴을 학습하기 위해 correlational feature transform으로 global self-attention mechanism을 적용한다. 이 때 self-attention weights는 모든 query positions를 따라 share되고 병렬처리 된다.
자세히 보면, 일반적인 self-attention 연산처럼 일단 처음에 support correlation tensor C에 대해 T(Target), K, V 각각의 embedding을 만들면서 시작한다. 그리고 아래처럼 T,K로 attention context를 계산한다.
image
그리고 attention context는 softmax에 의해 normalized 된다.
image
그다음에 이 attented representation이 MLP layer에 feed 되고, 이 경우 input과 output의 차원이 안맞기 때문에 conv layer에 한번 feed 시키고 나서 다시 MLP layer에 feed 된다.
image

Multi-layer fusion

pyramid correlational representation은 upsampling, addition, non-linear transformation을 통해 merge 될 수 있다.

  • 먼저 bottommost correlational representation을 adjacent earlier 표현의 공간 차원으로 bilinearly upsample한 다음 two representation을 추가해서 mxied 표현을 얻음
  • mised representation은 서포트셋의 H'=W'=1이 될 때 까지 two sequential AS layer에 fed된다.
  • earliest fusion layer의 output은 C차원의 채널을 2(foreground, background)에 매핑하고 출력 공간 크기를 입력 쿼리 이미지 크기에 매핑하는 interleaved 2D convolution and bilinear upsampling으로 구성된 convolutional decoder에 fed된다. 최종적으로 query image size 와 동일한 크기의 spatial size를 가지는 output을 반환하게 된다.

Class-wise foreground map computation

K-shot output foregroud activation map은 각 클래스에 대한 mask prediction을 얻기 위해 평균내어진다. 이 평균낸 output map에 2 channel 방향으로 softmax를 적용해 normalized 시켜서 foreground prediction 확률을 얻는다.

image

[38] Energy-Based Models for Anomaly Detection: A Manifold Diffusion Recovery Approach

Abstract

  • 데이터의 low-dimensional structures를 활용하는 energy-based models(EBMs) 소개
  • Manifold Projection-Diffusion Recovery (MPDR)은 low-dimensional manifold를 따라서 데이터 포인트를 perturb 함.
  • 그리고 EBM은 원본 데이터를 recovering하는 확률을 최대화하도록 학습함.
  • 학습 시에는 conventional EBM training과 마찬가지로 MCMC sampling을 통해 negative sample를 만드는데, near manifold에 집중된 different distribution에서 생성됨.
  • 이렇게 만들어진 near-manifold negative samples는 데이터의 다양한 relevant modes를 반영하기 때문에 highly informative하다.
  • MPDR의 energy function은 학습 데이터의 정확한 바운더리를 효과적으로 학습할 수 있고 OOD sammple detection에 뛰어나다.

Introduction

image

  • 본 논문에서는 MCMC를 전체 space에 할 필요 없는 EBM 알고리즘을 소개함.
  • Manifold Projection-Diffusion Recovery(MPDR)을 통해 가우시안 노이즈를 Manifold projection-diffusion(MPD)로 대체함으로써 recovery likelihood framerwork로 확장함. MPD는 데이터의 low-dimensional structure를 반영하는 novel perturbation operation임.
  • fig1처럼 MPD는 이미지에서 컬러나 모양의 변화와 같은 데이터의 relevant modes of variation을 반영함.
  • MPD-perturbed sample은 negative sample을 생승하는 MCMC의 informative starting point가 되어서 EBM이 학습데이터와 부분적으로 유사한 좀 어려운 outliers를 discriminate 하는 데에 도움을 줌.
  • MPDR의 이점
    1. 학습 시 여러 개의 autoencoder를 쓸 수 있음. 메니폴드 앙상블 방식이 학습 안전성을 높이고 다양한 negative samples로 인해 성능도 개선함
    2. lightweight 인코더로 좋은 이상탐지 성능을 보임

Method

  • negative sample 만드는 과정
    image

  • 기존에는 Gaussian noise를 datum x에 바로 주입해서 recovery likelihood를 구했다면, MPD는 일단 오토인코더로 datum x를 한 번 인코딩하고나서 latent space 상에 noise를 적용함.

[3] Deep Metric Learning for OpenWorld Semantic Segmentation

Abstract

자율주행과 같이 안전이 중요한 task에서 기존 Classical close-set semantic segmentation network들은 OOD object를 detect하는 데 한계가 있다. 본 논문에서는 두가지 모듈로 구성된 Open world semantic segmentation system을 제안한다.
(1) In-distribution / OOD object를 detect하는 역할의 open set semantic segmentation module
(2) 이 OOD object들을 existing knowledge base로 점진적으로 통합하는 Incremental few-shot learning module
로 구성되어 있다. Deep Metric Learning Network(DMLNet)을 적용해서 contrastive clustering을 통해 open-set semantic segmentation을 수행한다.

Introduction

우리는 Open world semantic segmentation problem을 위해 DMLNet을 사용할 것을 제안한다. 그 이유는 아래와 같다.
(1) DMLNet은 contrastive clustering 기반으로 학습해서 anomalous object를 효율적으로 식별한다.
(2) prototype이 few-shot task에 적합하다.
(3) DMLNet의 Incremental Learning 은 새로운 prototype을 추가함으로써 구현된다.

Contribution 요약

  • Robust하고 real-world application에 실용적인 open world semantic segmentation system을 최초로 소개한다.
  • 우리가 제안하는 DMLNet 기반의 open-set segmentation module은 여러 challenging dataset에 대해 SOTA를 달성했다.
  • 우리가 제안하는 few-shot incremental learning module은 catastrophic forgetting문제를 크게 완화한다.

Open world Semantic segmentation

open world semantic segmentation module은 크게 두개의 서브 모듈로 구성되는데 close-set semantic segmentation module/ Anomaly segmentation module이다.
image
(1)에서 C_anomaly는 OOD classes를 의미하고 Y^close는 closed set semantic segmentation의 output map을 의미한다. λ는 OOD threshold 이다. P^은 anomaly segmentation module에서의 output인 anomalous probability map을 의미한다.
image
fig1에서 opoen world semantic segmentation system을 잘 보여주고 있다.
첫 번째 스탭에서 known인지 unknown인지를 detect하고 step 2에서 unknown에 annotate를 부여하고 step3에서 incremental few-shot learning을 적용해서 classification rance를 넓힌다. 마지막으로 step4에서 DMLNet은 larger domain에서의 결과를 얻을 수 있게 된다.

Approach

image
전체적인 프레임워크는 fig3과 같다. 파란색 점선 박스가 close-set segmentation submodule이고 빨간색 점선 박스가 anomaly segmentation submodule이다. 최종 Open-set Segmentation Map은 이 두 서브모듈의 결과를 합친 것이다.

4.1 Deep Metric Learning Network

image
위와 같은 prototype learning에 의해 ID class들은 각각의 class space에 할당되고 OOD sample들은 어떠한 prototype과도 가깝지 않기 때문에 가운데에 모이게 된다. 이 때 clustering이라는 의미가 clustering 알고리즘을 쓴다는게 아니라 metric learning을 수행하게 되면 embedding space상에서 저절로 clustering 된다는 의미 같다.

4.2 Open-set semantic segmentation module

이 모듈은 closed-set segmentation module, open-set semantic segmentation module로 나뉜다. closed set segmentation amp은 class에 속할 확률을 최대로 만들어주는 Y로 분류를 수행한다.
image

반면, anomaly segmentation은 두 개의 unknown identification criteria를 제안한다. 하나는 metric-based maximum softmax probability(MMSP), 하나는 Euclidean distance sum(EDS)이다.
MMSP는 아래 식으로 구성된다.
image
EDS는 OOD의 경우 OOD pixel들이 aggregate된 metric space의 중심에 feature가 위치한다면 모든 prototype과의 유클리디안 거리가 작을 것이라는 loss이다. 식은 아래와 같다.
image
image
image
그런데 위 fig4처럼 ID class들의 분포는 서로 조금씩 다르기 때문에 MMSP와 EDS를 합쳐서 mixure function을 만든다.
image

4.3 Incremental few-shot learning module

위에서 open set segmentation results를 얻었으면 이제 새로운 class에 라벨을 부여할 수 있다. 이 라벨링 프로센스는 굉장히 time-consuming 하므로 우리는 두가지 가정을 한다.
(1) 오직 새로운 클래스만 annotated되고 다른 픽셀들은 무시된다.
(2) 다섯장 이하의 이미지가 annotated 될 것이다.

우리는 DMLNet을 쓰는 두 가지 incremental few-shot learning 방법을 제안한다.

  1. Pesudo Label Method
    image
    trained branch head는 old class에 대한 prediction map을 구할 수 있고 labelers가 새로운 클래스에 annotation을 할당한다. 이 방법으로 전체 이미지가 annotated 되고 학습시에 새로운 branch head를 학습하는데 쓰인다.

  2. Novel Prototype Method
    prototype으로 바로 novel class를 구할 수 있다.

Experiments

image
image
image

image

image

[5] Per-Pixel Classification is Not All You Need for Semantic Segmentation

paper link : https://arxiv.org/abs/2107.06278

이 논문을 처음 읽고 가장 크게 착각했던 부분이 maskformer은 instance/semantic/panoptic segmentation을 모두 할 수 있는 backbone 모델인 줄 알았다. 하지만 후속 연구인 mask2former를 읽고 나서 maskformer에서는 semantic/panoptic segmentation을 할 수 있는 모델이고, 이중에서 panoptic segmentation이 instance level로 예측을 수행하는 task이기 때문에 semantic level, instance level 모두 가능하다는 이야기였다.

Mask Classification

  • commonly used for instance-level segmentation tasks [20, 24].
  • These tasks require a dynamic number of predictions, making application of per-pixel classification challenging as it assumes a static number of outputs.
  • Omnipresent Mask R-CNN [21] uses a global classifier to classify mask proposals for instance segmentation.
  • DETR [4] further incorporates a Transformer [41] design to handle thing and stuff segmentation simultaneously for panoptic segmentation [24].
  • However, these mask classification methods require predictions of bounding boxes, which may limit their usage in semantic segmentation. The recently proposed Max-DeepLab [42] removes the dependence on box predictions for panoptic segmentation with conditional convolutions [39, 44].
  • However, in addition to the main mask classification losses it requires multiple auxiliary losses.

Method

mask classification을 하는데, 우선 image를 N개의 영억으로 구분하여 최종적으로 N개의 binary mask를 output으로 한다. 다음, 각 N개의 segment들을 K개의 class 중 하나로 분류한다. 따라서 output은
image

위와 같다. p는 class probability, m은 binary mask이다. ground truth와 매칭하여 classification loss, mask loss를 구해주어야 하는데, 이 때 bipartite matching-based 방법을 사용해서 gt와의 cost가 가장 적은 매칭으로 설정해서 loss를 구한다. 참고로 이 때 매칭이 되지 않는 output들도 있을 수 있기 때문에 “no object”라는 클래스도 필요하다.
image

OOD붙인 데이터는 y값도 만들어주면 된다. coco의 binary mask + cityscape mask 이렇게 해서 K+2개의 class로 예측하는거다. 하나는 배경, 하나는 OOD.

그럼 학습은 어떻게해야하지? 이미지를 N개의 region으로 나누는데 이 region은 꼭 k랑 같을 필요는 없고 더 크면 좋다. (한 이미지 당 몇 개의 class가 있을지 모르기 때문에 일단 많이 만들어놓는다. 매칭이 안된 부분은 아무것도 해당안되는 N이다.) 카테고리 수가 K라고 하면 N은 no object class 파이를 포함해서 더 크게 구성된다.

Main loss인 mask-cls loss는 cross-entropy classication loss랑 binary mask loss로 구성되어 있다.
image

Pixel-level module

일반적인 segmentation model(encoder-decoder)를 사용해서 image feature와 pixel embedding을 뽑아준다.

Transformer module (detr과 굉장히 유사하다.)

각 image feature F에 대해 N개의 learnable positional embedding을 학습한다. image feature들을 백터 형테로 만들어서 중간에 넣어주고 positionel embedding 역할을 하는 N개의 query들을 input으로 한다. 다음 decoder를 통과해 N개의 per-segment embedding을 뽑아준다. 여기서 N query들은 learnable parameter 이다.

image

Segmentation module

  1. Probability predictions

    → linear classifier + softmax function

    per-segment embedding에 대해 각 segment에 대한 class probability prediction을 구한다.

    이 때 no object category인 파이도 있기 때문에 이 경우에는 어떠한 region해도 해당하지 않는다.

  2. Mask Prediction

    → Multi-layer Perceptron with 2 hidden layers converts the per-segment embeddings to N mask embeddings

image
MLP layer를 통과시켜서 per-pixel embedding과 dot-product를 해서 N개의 mask prediction을 구한다.

최종적으로 이 둘이 합쳐서저 semantic segmentation 결과가 나오게 된다. 이 때 최종 mask를 구하기 위해 argmax를 사용하는데, class probability와 mask probability가 모두 높아야 선택될 수 있는 방법이다.

[40] AnoVL: Adapting Vision-Language Models for Unified Zero-shot Anomaly Localization

핵심: Training-free Adaptation(TFA), unified domain-aware contrastive state prompting template, Test-Time Adaptation(TTA)

Method

image

Training-free Adaptation(TFA)

  1. local-aware token computation via value-to-value attention 도입
  • CLIP의 경우 global level로 image-text를 비교하며 학습하기 때문에 Q-K-V attention 매커니즘은 patch token들이 global feature를 나타낼 수 있게 함.
  • Visual transformer로부터 informative local features를 뽑기 위해 본 논문에서는 attention을 modify해서 추가적인 학습 없이 local patch token을 얻음
  • 기존 Q-K-V attention은 아래처럼 LN, Q-K-V projection layer, Projection layer, MLP로 구성되어 있음 (아래 식처럼)
    image
  • Query key가 contextual relation을 연관짓는 데에 중요한 역할을 하였고 이전 연구에서 last layer에서 Q-K retrieval이 마치 visual globap discription을 위한 GAP 역할처럼 작용함을 확인함.
  • 여기서 patch token의 specific locality를 더 개선하기 위해 각 레이어마다 residual linking을 두어서 novel Value-to-Value self-attention을 제안함.
    • visual transformer의 layer를 l이라고 했을 때 아래 식 7처럼 adapt 됨
      image
    • Original Q-K-V와 달리 V-V attention은 쿼리랑 키를 value로 대체하고 top MLP 층을 제거함.
    • Local anomaly score를 구할 때는 visual transformer 마지막 층의 patch token이 식 2로 feed됨.
    • 이러한 V-V attention은 training-free이면서도 ZSAD에 효과적임.

Domain-aware State Prompting

  • Traditional visual models와 달리 visual language model의 에측은 주로 semantic texts의 영향을 매우 많이 받음
  • 특히 anomaly detection은 fine-grained visual recognition task여서 더 precise specific prompts가 중요하다.
  • Perfect task-specific prompt 설계는 거의 불가능하고 extensive effort가 필요로 하지만, well-designed template가 task-related concepts을 커버할 수 있는 충분한 prompt를 만들 수 있음.
  • 따라서 prompt engineering을 크게 3가지로 나눔: 1) base prompts 2) contrastive-state prompts 3) domain-aware prompts
  1. Base Prompts
  • default prompt를 의미함.
  • 이런 base prompt 들을 앙상블하면 zero shot 성능이 향상됨을 실험에서 증명함 -> prompt engineering이 CLIP zero-shot transfer에 중요한 역할을 함
  • 특히 여러 프롬포트 앙상블이 text guided classifier의 robustness를 강화한다고 주장
    • ”a photo of a [class]”
    • ”a cropped photo of a [class]”
    • ”a bright photo of a [class]”
  1. Contrastive-state
  • 정상 이상 state에 대한 antagonistic concepts을 강조함.
  • S_AD, S_AL에서 pair of antagonistic state tokens로 normalized anomaly score 계산함
  • Opposing state words("perfect vs imperfect"/ "with flaw vs without flow")로 설계함
  • 하지만 anomalies가 unknown으로 가정되므로 이 경우 "broken", "imperfect"와 같은 common state words로 구성함.
  • 반면 specific anomalies가 known인 경우, 예를 들어 defect type이 "hole"임을 알고 있는 경우 ("with a hole" vs "without a hole")이렇게 contrastive-state prompt로 설계
  1. Domain-aware(DA) prompting
  • CLIP과 downstream tasks간의 도메인 갭을 연결하기 위해 제안됨.
  • visual inspectoin에서 사용되는 industrial image처럼 fine-grained vision task의 경우 specific distribution을 가짐
  • 이러한 visual tokens를 text token distribution이랑 align하기 위해 domain-aware prompt engineering을 제안해서 specific domain에 adapt함.
  • "Industrial photo", "textual photo" 이런식으로 설계함
  • domain-agnostic prompt와 반대로 domain-aware prompt engineering이 non-parametric manner로 disribution shift를 제거할 수 있음.

image

  • 최종적으로 unified template는 위와 같음.
  • 정상에 대한 text token, 이상에 대한 text token이 각각 prompt list로부터 만들어지면 avegared token을 계산해서 AD, AL 수행.
    image

Test-time Adaptation(TTA)

  • fig 3처럼 Non-linear residual-like adapter를 둠.
    image
  • visual-langauge alignment를 위해 specific query image에 대해 patch token을 tailor함
  • 여기서 파라미터인 w는 self-supervised tasks처럼 업데이트함.
  • 기존 TTA는 주로 data-augmentation이나 forward propagation 시의 multiple-pass로 수행이 되어와서 real-time anomaly localization에 time-comsuming하다는 한계 존재
  • 따라서 visual token에 perturb를 직접적으로 가함.
  • 쿼리에 대해 adapt된 패치 토큰에 noise-corrupted tokens를 합성함. (가우시안 노이즈)
  • 두 self-supervised discriminative tasks를 통해 w 최적화
    1. original과 noise-corrupted toekn을 discriminate함 (CE loss)
      image

    2. anomaly localization 수행
      : P를 pseudo lalel로 써서 encourage adaptor
      image

최종 loss는 두 loss의 합임.
image

[25] Catching Both Gray and Black Swans: Open-set Supervised Anomaly Detection

Abstract

  • 그동안 대부분의 anomaly detection 연구들은 일반적으로 train 시에 normal data만 접근 가능하고 때로는 a few labeled anomaly examples만 접근 가능하다는 가정이 존재한다.
  • 그리고 real world에서 anomaly data를 확보해 학습에 사용한다 하더라도 매우 적은 양의 labeled 된 example만 확보할 수 있다는 어려움이 있다.
  • 하지만 학습 시에 사용 가능한 anomalies가 항상 가능한 모든 anomaly class를 포괄하고 있지 않기 때문에 unseen anomaly class에 대한 generalizing이 어려울 수 있다.
  • 본 논문에서는 seen anomalies와 unseen anomalies 둘 다 detect할 수 있도록 anomaly examples를 사용하는 open-set supervised anomaly detection task를 다룬다.
  • 핵심 아이디어는 anomaly 유형을 세 가지(seen, pseudo, latent residual)로 나누어 각각 다른 head로 학습한다는 것이다.

Introduction

  • 대부분의 anomaly detection method들은 large-scale의 anomaly data를 수집하는 것이 어렵기 때문에 train시에 normal data로만 학습을 수행하는 unsupervised method로 접근하는 흐름이 강했다.
    하지만 적은 수의 labeled anomaly examples이 존재하는 경우 또한 real world application에 존재한다. 이 경우 anomaly examples가 valuable knowledge를 제공할 수 있지만, knowledge 부족으로 인해 unsup으로 학습한 모델의 학습된 features가 anomaly를 구분하기에 충분히 discriminative하지 못하다. (fig 1 참고)
    image

  • 최근 연구들 중에 어떤 연구들은 supervised detection 패러다임으로 접근했다. 이 연구들은 주로 anomaly를 negative sample로 삼아서 one-class metric learning을 수행하거나 one-sided anomaly-focused deviation loss로 접근했다.

  • 이런 연구들은 제한된 양의 anomaly data만으로도 유의미한 성능 개선폭을 보였지만 seen anomalies는 모든 가능한 anomaly의 경우를 다 포함하지 못한다.

    • 왜냐면 anomalies 자체는 unknown임
    • seen anomaly와 unseen anomaly는 서로 크게 다르기 때문
  • 결과적으로 seen anomalies에 오버피팅 되어서 unseen/unknown anomaly class(거의 발생하지 않고 이전에 알려지지 않은 exceptional case -> a.k.a. black swans)에 일반화하지 못한다.

  • fig1에서 DevNet과 KDAD를 비교해보면 supervised model이 given anomaly에만 피팅되어서 unseen anomalies를 detection하는데 덜 효과적임을 확인할 수 있다.

  • 이러한 문제를 다루기 위해 본 연구에서는 detection 모델이 open-set 시나리오 하에서 적은 수의 anomaly examples로 학습하는 open-set supervised anomaly detection을 다룬다.

    • 즉, objective가 seen anomalies(graw swans)와 unseen anomalies(black swan)을 모두 detect 할 수 있는 task를 수행한다.
    • 본 논문에서는 generalized detection이 가능한 disentangled representations of abnormalities(DRA)라는 새로운 anomaly detection approach를 제안한다.
    • unbounded anomalities를 disentangle해서 3개의 general categories로 나눈다.
      1. anomalies similar to the limited seen anomalies
      2. anomalies that are similar to pseudo anomalies created from data augmentation or external data sources
      3. unseen anomalies that are detectable in some latent residual-based composite feature spaces

[43] Segment Anything

  • 이 논문의 목적은 promptable하게 학습되어서 새로운 이미지나 task에 zero-shot transfer가 가능한 foundation model을 만드는 것임.
  • 확인하며 읽어야 할 점들
    1. What task will enable zero-shot generalization?
    2. What is the corresponding model architecture?
    3. What data can power this task and model?


image

Segment Anything Task

본 논문에서는 promptable segmentation task를 통해 powerful pretraining objective로 학습하고 넓은 범위의 downstream applications를 가능하게 함.다양하고 큰 스의 소스 데이터가 필요로 하기 때문에 새로 수집함.

  • 본 논문의 task는 어떤 segmentation prompt를 주든 valid segmentation mask를 반환하는 것임.

    • NLP에서는 next token prediction 방식으로 foundation model을 pre-train 시킴. 이 아이디어에 착안함.
    • prompt가 어떤 이미지의 어떤 부분을 segment할 것인지를 특정지어주는 역할을 함. (object를 식별할 수 있는 spatial 정보나, text 정보를 prompt가 포함)
    • prompt는 다양한 형태가 가능한데, foreground/background points, rough box or mask, free-form text, 또는 이미지에서 뭘 segment해야 하는지에 대한 어떤 information이든 다 입력으로 받을 수 있음.
    • 어떤 prompt를 입력받던 (여러 object에 해당할 수 있는ambiguous prompt 등) 최소 하나의 object에 대해 reasonable한 valid segmentation mask를 return한다. (마치 NLP에서 language model이 ambiguous prompt에 대해서 일관성있는 결과를 기대하는 것과 유사함)
    • valid segmentation mask를 반환해야 함. valid segmentation mask의 의미는 prompt가 모호하거나 object가 여러개 있는 상황에서도 최소 하나의 object에 대해 reasonable mask를 반환해야 함.
    • Promptable segmentation task는 pre-training objective가 됨과 동시에 general downstream segmentation task를 풀기도 함.
    image

    위 fig3이 ambiguous prompt 예시를 보여줌. 같은 포인트여도 셔츠를 의미하거나 사람을 의미하는 등 그 의미가 다를 수 있음 .

Pre-training

  • promptable segmentation task는 각 train sample에 대해 sequence of prompts(ex. points, boxes, masks, Free-form Text 등)를 시뮬레이트 하는 natural pre-training 알고리즘을 제안함.
  • 모델의 예측을 GT와 비교함. 이 방식은 interactive segmentation이랑 유사하지만 차이가 있다면 interactive segmentation은 충분한 사용자 입력 후에 valid mask를 최종 예측 하지만 본 논문의 경우 프롬포트가 모호한 경우에도 언제든지 valid mask를 예측하는 것이다.
  • Ambiguous한 prompt에 대해서도 학습을 했기 때문에 어떤 prompt가 와도 valid 한 mask를 생성할 수 있었음..

Zero-shot transfer

  • pre-training task는 inference시에 어떤 프롬포트든 적절히 응답할 수 있다.
  • 예를 들어 고양이를 위한 bounding box detector가 있다면 이 detector의 box output이 prompt가 되어서 instance segmentation 수행함.
  • Prompting과 Composition은 단일 모델이 설계 당시에는 알 수 없는 task를 수행할 수 있다는 장점이 있음. (ex. CLIP의 경우 DALL-E 이미지 생성 시스템의 image-text align component임)
  • 고정된 task를 위해 학습된 시스템보다 더 다양한 응용을 가능케 함.

Segment Anything model

image
  • Image encoder, Prompt encoder, Mask decoder 영역으로 나누어짐 (이 때 Prompt encoder, Mask decoder를 묶어서 Prompt 모델이라고 부름)
  • 위와 같이 세 가지 모듈로 구성함으로써 같은 이미지 임베딩이더라도 서로 다른 prompt로 재사용 될 수 있다.
  1. Image encoder

    • MAE pre-trained ViT로 embedding 뽑음.
  2. Prompt encoder

    • Sparse prompt(points, box, text), dense prompt(mask) 를 입력
      • Sparse prompt는 256차원 임베딩으로 매핑
      • Point는 point location과 학습 가능한 foreground/background embedding 중 하나와의 합
      • Box: Top-left corner, bottom-right corner에 대한 learned embedding의 합
      • Text: CLIP text embedding
  3. Mask decoder

    • Image embedding과 prompt embedding, output token embedding을 입력받아서 mask로 매핑하는 역할을 함. self-attention, cross-attention을 통해 mask prediction 함.

      1. Token에 대한 Self-attention

      2. Token을 Query로 하여 Image Embedding에 Cross-Attention

      3. Point-wise MLP로 각 Token을 업데이트

      4. Image Embedding을 Query로 하여 Token에 Cross-Attention

    • Attention layer에 입력할 때마다 image embedding에 positional encoding을 더해주며, attention layer 입력마다 updated token에 original token prompt 전체를 합산함.

    • Decoder 수행하고 나서 Transposed convolution으로 이미지 임베딩 크기 4배로 upsampling하고 token을 query로 해서 한번 더 이미지 임베딩에 어텐션 한 다음, output token embedding에 3개의 MLP 적용

    image
  • Resolving Ambiguity
    • Mask ambiguity란 같은 점이라도 서로 다른 마스크가 의도될 수 있음을 의미함.
    • 따라서 mask output이 여러개로, multiple output masks를 예측함. 3개가 most common cases를 다루기 충분한 것을 발견함. (하나이게 되면 ambiguous prompt에 대해 multiple valid mask를 평균내게 될 것임)
    • 각 마스크마다 confidence score(ex. estimated IoU)로 랭킹 매기는 식.
    • 그럼 back propagation 어떻게하지? → 마스크 들 중 minimum loss인 것만 수행
  • loss: focal loss, dice loss의 linear combination으로 학습함.
    • focal loss: 더 어려운 객체에 가중치를 줌
    • Dice loss: IoU보다 GT를 얼마나 많이 포함했는가(Recall에 집중)
  • efficiency: prompt encoder + mask decoder 수행 시간이 50ms 이내여서 real-time interactive prompting 가능한 수준

Segment Anything Data Engine

  • 크고 다양한 셋의 마스크로 학습해야 하는데 기존 foundation model들은 데이터를 online으로 수집했기 때문에 mask가 자연스럽게 풍부하지 않음.

  • data engine을 통해 model-in-the-loop dataset annotation을 co-develop함.

    1. assisted-manual stage (SA-1B dataset 구축 단계): Annotator + seg tool
      • Classic interactive segmentation setup처럼 SAM으로 마스크를 달음.
      • annotation 전문가 팀이 브라우저 기반 interactive segmentation tool을 사용해서 foreground/background object point를 클릭해서 레이블링 함.
      • 즉 tool을 써서 일단 brief하게 마스크 얻고 사람이 세부 수정하는 식임.
      • Common public segmentation dataset을 사용함. 충분한 데이터 annotation이 이루어진 이후에는 SAM이 새로 annotation 된 마스크만 가지고 재학습됨.
      • 마스크가 더 많이 수집됨에 따라 이미지 인코더도 ViT-B → ViT-H로 확장됨
    1. semi-automatic: 사람이 라벨링한 GT + 모델이 예측한 mask
    • 가능한 object에 대해 location으로 프롬프팅해서 mask를 만들고 남은 object는 annotator가 annotating 함.
    • annotator들은 less prominent objects에 집중하기 위해 먼저 confident masks를 자동으로 디텍션 한 다음에 annotator에게 추가로 unannotated objects가 있는지 묻는 방식.
    • confident mask detect를 위해 모든 첫번째 stage에서 generic ‘object’ category로 bounding box detector 학습함.
    1. fully automatic : 모델이 예측한 mask로만 학습
    • 앞단계들에서 이미 많은 마스크가 충분히 수집되었고 성능이 올라왔기 때문에 모호한 경우에도 어느정도 알아서 유효한 마스크를 예측할 수 있게 됨. (ambiguity-aware)
    • SAM으로 regular grid of foreground points로 prompting해서 이미지 한장당 평균 100개의 고퀄 마스크 생산함. → 최종적으로 11억개 mask

Experiments

image
  • Single point valid mask evaluation

    • Task: foreground에 해당하는 곳의 중점만 prompt가 주어졌을 때 foreground segmentation mask 반환하기
    • Result:
      • (a)에서 23개 중 16개에서 가장 높은 성능, (b)는 사람이 정성적으로 평가한 결과도 포함함. 정성 평가에서는 더 높은 결과를 보이기도
      • (c),(d)는 propmt로 주는 point 개수 ablation인데, point가 적은 경우 SAM이 우세함
  • Zero-Shot Edge Detection

    • Segmentation을 진행한 결과에 sobel filder를 써서 edge만 뽑아냄
    • Edge detecion에 대해서는 전혀 학습하지 않았음에도 견줄만한 성능
    image
  • Zero-shot object proposals

    • Output이 mask 대신 box가 되도록 zero-shot transfer
    • 전체적으로 OD 모델이 더 좋은 성능을 보이긴 했지만 rare한 케이스에서는 더 좋은 성능을 보이기도 함.
    image
  • Zero-shot instance segmentation

    • object proposal로 얻은 box prompt를 가지고 segmentation을 수행한 결과
    • ViTDet-H보다 안좋은 box를 prompt로 넣어서 segmentation을 했음에도 불구하고 segmentation 결과는 비슷함.
    image
  • Zero-Shot Text-to-Mask

image
  • 학습은 CLIP image embedding을 prompt로 주고, inference시에서는 text prompt를 사용하는데 간단한 prompt에 대해 좋은 성능을 보임.
  • Text만 줬을때 틀렸던 것들은 point를 같이 주면 잘함.

[37] SANFlow: Semantic-Aware Normalizing Flow for Anomaly Detection and Localization

Abstract

  • 기존 NF-based methods는 모든 feature를 강제로 하나의 distribution( unit normal distribution)으로 바꾸는데, features는 locally distinct semantic information을 가질 수 있기 때문에 distribution이 다를 수 있음.
  • 따라서 기존 방식은 학습을 어렵게 하고 nomal/abnormal를 구분하는 데 있어 network의 discriminate 역량을 제한함.
  • 본 논문에서는 input image의 각각의 위치에 대한 feature distribution을 different distribution으로 transform 하는 방법을 제안함
    • NF 방식으로 주어진 이미지에서의 각각의 위치에서 feature distribution을 매핑하는 것을 학습한다.
    • 추가로 discriminability를 강화하기 위해 abnormal data 분포를 정상 데이터와 확실히 다른 분포로 매핑한다.

Introduction

  • Normalizing Flow(NF) 방식이란?
    • density estimation을 더 잘하기 위해서 reversible function sequence를 학습해서 인풋 데이터의 복잡한 분포를 간단한 분포(ex. normal distribution)로 매핑하는 방식임.
    • NF의 목표는 정상 샘플에 대한 reliable density estimation을 통해 정확한 이상 탐지를 수행하는 것임.
  • 기존 NF 방식들의 문제
    • 복잡한 분포를 단지 하나로 매핑하는 데에만 모델이 의존함.
    • 다른 location, scale, image에 해당하는 features는 다른 분포를 따를 수 있지만 이전 연구들은 이런 multi-modal distribution을 단순히 하나의 normal distribution으로 매핑하려고 시도했다.
    • different locations, images에서의 features는 다른 분포를 따를 수 있음을 고려해서 본 논문에서는 이미지의 각 위치에 해당하는 features에 대해 각각 다른 분포로 adaptively embed 함.
    • (related work에서도 classification에서 different semantics를 가지는 이미지를 different distribution으로 변환하는 것의 이점을 발견한 바 있었음에도 기존 연구들은 single normal distribution으로 매핑하고 있다고 지적.) 본 논문에서는 locally varying base distributions를 가정하면서 더 나은 density estimation capability를 가지는 NF 방식 제안함.
  1. 정상 데이터의 각 location을 평균이 0, 분산은 다 다른 가우시안 분포로 매핑. 즉, locally different distribution으로 feature를 embedding 함
  2. 배경과 같은 간단한 지역의 경우 추정한 분산이 작음을 확인했고 좀 더 복잡한 지역에서는 분산이 증가함을 확인.
    image

Method

image

Synthetic anomaly generation

  • 이 논문에서도 data augmentation(CutPaste) 수행해서 synthesize local anomalies -> NF 학습할 때 anomaly features도 학습해서 정상 특징으로부터 distinct 되는 분포 학습함.
  • 근데 CutPaste에서 좀더 realistic하게 하기 위해서 blurring the borders of extracted patches, 이 패치들에 diverse color jittering values 적용.
  • 패치 크기는 랜덤으로 해서 다양한 abnormal region 얻었고 학습 시에 이 모든 type의 patch랑 정상 데이터랑 동일 비율로 학습함.
  • 인풋 이미지에 대해 locally different base distribution을 가진다고 가정하기 때문에 binay mask M을 각 synthetic anomaly image마다 수행해서 각 pixel location이 정상에 해당하는지 이상에 해당하는지 알도록 함.
    image

Feature Extractor

  • multi-scale feature pyramid는 다양한 크기의 anomalies를 다루기 좋음. 각각 다른 스케일은 해당하는 사이즈의 region에 대한 information을 캡쳐할 수 있기 때문임.
  • 따라서 pre-trained CNN으로 k-level feature pyramid 씀. (k=3)

Semantic-aware normalizing flow

  • K independent NF model 써서 k-level 피라미드 피쳐에 대해 different scale을 다룸.
  • spatial information을 다루기 위해 각각의 feature vectors는 해당하는 position embedding vector랑 concat됨.
    image
  • 하지만 이렇게만 해서는 feature vector v에 대해 locally varing base distribution을 만들기에 부족.

semantic-aware base distribution

  • semantic-dependent base distribution을 Gaussian distribution with statistics로 인스턴스화 함.
  • lightweight statistics prediction을 통해 주어진 feature v에 대한 statistics를 추정함. 그런데 평균, 분산을 모두 추정하는 것은 어렵기 때문에 분산만 추정하는 것이 이득이라고 주정.
  • 따라서 정상 region에 대해 평균을 0, 이상에 대해 평균을 1로 고정함. 이렇게함으로써 정상과 이상 간의 minimal overlap -> NF가 정상 이상에 대한 distinct distribution을 학습하는 것을 도움.
  • 샘플이 non i.i.d일 경우 inverse Gamma distribution으로부터 추정함. 이미지 픽셀과 semantic features는 non-d.i.d이기 때문에 아래와 같이 추정
    image

loss function

image

  • m은 binary mask(indicator)임. 정상이면 0 이상이면 1
  • 정상일 경우 Za가 base distribution을, 이상일 경우 Zn이 base distribution을 represent 하게 됨.
  • k-th scale의 likelihood를 계산하기 위해 binary mask M이 resize되어서 feature map 크기랑 매칭함. (nearest-neighbor interpolation으로 resize 수행)
    image
    image
  • 최종 loss
    image
  • inference시에는 test image에 대해 각각 k-th scale feature에 대해 log-likelihood를 계산하고 exponential -> log-likelihood map
  • 이미지 해상도만큼 likelihood map upsample (bilinear interpolation)
  • 여기서 부호 반대로 하면 anomaly score map이 됨.

Experiments

  • dataset: MvTec, STC (ShanghaiTech Campus) video 데이터
  • 백본을 WRN으로 고정해서 비교 (근데 이 고정이 무슨 의미가 있지? ViT Patchcore 보다 못하면 소용없는거 아닌가)
    image
    image
    image
    image
    image

[28] Tuning Multi-mode Token-level Prompt Alignment across Modalities

  • 이 논문은 hierarchical OT(Optimal Transport)를 통해 multiple modality를 통합하고 token-level alignments를 수행하는 novel prompt tuning famework임
  • Prompt-level OT는 image, language domain에서 class의 diverse semantics를 학습하며, token-level OT는 토큰 임베딩 간의 fine-grained alignments를 수행
  • Few-shot classification, dataset transfer learning, domain generalization에서도 실험을 진행함

Abstract

  • 이전 연구들은 주로 single mode(only one prompt for each modality), holistic level(image or sentence) semantic alignmnet에 초점을 두어서 sample diversity를 캡쳐하지 못하고 sub-optimal prompt discovery하는 결과를 보였다.
  • 이러한 한계를 다루기 위해 본 논문에서는 multi-mode token-level tuning framework를 제안해서 optimal transportation을 사용해서 학습하고 modalities간에 prompt token을 align한다.
  • 특히 아래 두 사실을 기반으로 함.
    1. multi-mode prompts discovery, which guarantees diverse semantic representations.
    2. token-level alignment, which helps explore fine-grained similarity.

Consequently, the similarity can be calculated as a hierarchical transportation problem between the modality-specific sets.

Introduction

  • PVLs(pre-trained vision language models)에 대한 optimal prompt를 찾는 것은 쉽지 않다. 일반적으로 textual/visual modality 간의 intricate semantic alignment가 필요하다.

    • TPT(textual)와 VPT(visual)를 결합하는 multi-modal prompt를 함께 학습하는 연구들이 있었음(MaPLe, Unified vision and language prompt learning).
    • 하지만 이 연구들은 주로 single-mode prompt discovery에만 집중하고 있으며, 즉, 한 모달리티에 대해 하나의 prompt 만 사용하고 있으며 이는 하나의 클래스를 대표하기에 충분하지 않을 수 있다.
    • 또 이미지와 레이블을 global features만으로 표현하는 것은 target object의 local region features를 상실할 수 있기 때문에 sub-obtimal classification 결과를 만들게 된다.
  • 이를 위해 본 연구는 multi-modal multi-model prompt를 학습하기 위해 prompt 및 token-level optimal transport를 구축하는 comprehensive prompt tuning framework를 제안한다.

  • Modality-specific encoder에 multiple prompts를 피드시키고 나서 prompt-level OT는 각각의 이미지를 visual prompt space에서 discrete distribution P로, 각 레이블을 textual prompt space에서 discrete distribution Q로 모델링한다. 그렇게 되면 classification task는 P와 Q 사이의 거리를 측정하는 문제가 된다.

  • Global prompt-level features와 함께 patch(or token) embeddings는 target object에 대한 local region features를 캡쳐한다.

image

Method

  • 직관적으로, 인간은 하나의 class에 대해 색, 레이아웃, 모양 등과 같은 sufficient semantic features와 같은 다양한 컨셉을 학습할 수 있다.
  • 이로부터 영감을 받아서, 본 연구의 목표는 M개의 visual prompts와 N개의 textual prompts를 동시에 학습하는 것이다.
  • prompt-level OT는 각 이미지와 레이블에 대해 M-차원의 visual space -> discrete distributions P으로, N-차원의 textual space -> discrete distributions Q으로 모델링한다.
  • prompts output을 하나의 point로 표현하지 않고 (e.g., global features z and h) CLIP에서의 token-level knowledge를 distill한다.

image

Prompt-level Optimal Transport

  • M개 그룹의 visual prompts, N개 그룹의 textual prompts가 있으면, (여기서는 한 이미지에 대해 텍스트랑 이미지 프롬프트 개수가 각각 다를 수 있음) 두 empirical distribution P,Q로 모델링 할 수 있다.
    image

    • eq 3d은 가중치를 uniform distribution으로 모델링함.
    • 이로서 이미지와 레이블 간의 거리를 코사인 유사성을 사용하여 이미지와 레이블을 각각 single point으로 나타내고 거리를 측정하는 방식에서 벗어나 multi-mode features를 mine해서 class concepts를 얻는다. 이로써 더 나은 표현을 얻게 된다.

    image

    • 식 4는 P와 Q 간의 최적 운송 거리를 계산하는 함수이다. 즉, 이미지와 레이블 간 거리를 정의하는 방법이 entropy-regularized prompt-level OT 문제로 공식화된다. 여기서 OT는 두 분포 사이의 최적의 매칭을 찾는 문제임.
    • T는 m-th visual prompt로부터 n-th textual prompt로의 transposed probability를 측정한다. 따라서 식 4는 P와 Q 사이의 expected transport cost을 추정하며, 이는 곧 이미지와 라벨 간의 유사성을 계산하는 과정임.
    • Cost matrix C는 이미지와 텍스트 간 transport cost를 의미한다. 직관적으로 생각해보면 두 프롬프트 간 transport cost가 클수록 transport probability가 낮아질 것.

Token-level Optimal Transport

  • prompt-level representation만 고려하게 되면 detailed token-level features를 캡쳐하기에 한계가 있을 수 있다. (image내의 다양한 패치들이 다양한 local region features를 캡쳐할 수 있기 때문)
  • Token-level OT를 도입해서 이미지 아웃풋 x와 텍스트 아웃풋 y를 토큰 임베딩 공간에서 discrete distribution으로 모델링한다.
    image
  • 이미지 패치(x)와 텍스트 토큰(y) 사이의 총 Transport costs을 나타내며, Transport plan(ˆT)은 j번째 이미지 패치가 l번째 토큰 특성으로 얼마나 전송될 가능성이 있는지를 제공하여 token-level features를 align한다.
    • 최종적으로 prompt와 token-level features를 함께 고려하는 combined cost matrix C_mn을 설계했는데, 앞 항은prompt-level features간 cosine distance, 뒤에 항은 token-level embedding 간 OT distance이다.
      image
    • 이미지에 대한 레이블 예측은 이전 연구처럼 수행하는데 Q_K는 클래스 레이블 K의 여러 text prompt를 포함하는 discrete uniform distribution으로 볼 수 있으며 분류 결과를 향상시킨다.
    • 위와 같은 방식에 의해 Prompt-level OT에서 학습 transport plan T가 M visual and N textual features과의 fine-grained matching을 할 수 있어서 최종적으로 detaied allignments를 가능하게 하고 더 나은 representation을 얻을 수 있다.
  • 제안된 ALIGN 모델은 모든 파라미터를 미분 가능한 Sinkhorn 알고리즘을 통해 최적화함으로써 end-to-end로 학습함.

image

Experiments

image
image
image
image
image

[46] Segment Any Anomaly without Training via Hybrid Prompt Regularization

Abstract

  • 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 할 지 고민함.

image

  • 전체적인 과정은 먼저 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은 아래 식처럼 효현될 수 있음.
  • image

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를 만듦.
    • image
    • 그럼 confidence score S에 해당하는 high quality segmentation mask를 얻을 수 있음.
    • image
    • 이 때의 prompt는 naive class-agnostic language prompt인 "anomaly" 임.

Analysis on the ZSAS Performance of Vanilla Foundation Model Assembly

image
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로 나눠짐.
  1. Class-agnostic prompt: Anomlay, defect와 같은 general
    prompt
  2. 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을 만듦.
      image
      image
      Saliency prompts는 해당하는 region mask에 대한 exponential average saliency로 정의됨.
  • 이 Saliency prompts는 anomaly region에 대한 confidence를 제공해서 foundation model로부터의 confidence score를 recalibrate해서 new rescaled score를 얻을 수 있게 함.

  • image

  • 이 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을 선택함.
    • image
    • 이 K candidate region으로부터 final anomaly map 예측함.
    • image
  • 이렇게 제안하는 hybrid prompt(Pl, Pp, Ps, Pc)를 통해 SAA를 regulaize(SAA+)해서 더 reliable한 anomaly prediction을 얻음.

Experiments

  • Datasets: ViSA, MVTec-AD, KSDD2, MTD
  • Metrics: max-F1-pixel, max-F1-region
  • Model: GoundingDINO, SAM, WideResNet50(for saliency prompt)
  • confidence prompt K = 5

image

image

image

  • PL: class-agnostic prompt가 class-specific prompt보다 더 큰 영향을 미침. 이는 직접적으로 이상을 프롬포팅 하는 역할이 class-agnostic 한 부분이기 떄문이지 않을까
  • Pp: 특히 드라마틱함. falsely detection anomaly region을 필터링한 역할이 컸음.
  • Ps: Region saliency가 clear evidence를 더 주는 역할을 함.
  • Pc: false positives를 효과적으로 줄이기 위해 anomaly region을 제한함. 전체적인 카테고리에 대해 성능 개선이 있음을 확인 가능.

image
k=5로 설정

Conclusion

  • Prompt design을 통해 foundation model을 어떻게 adapt할 지 연구함.
  • 핵심은 off-the-shelf foundation model을 활용한 것임.
  • Expert knoweldge와 Target image context를 활용해서 hybrid prompt를 설계해서 학습 없이 adaptation을 수행함.
  • 최종적으로 다양한 밴치마크에서 SOTA 성능을 보이면서 zero-shot anomaly segmentation을 수행

[11] Towards Open World Object Detection

if논문 링크: https://openaccess.thecvf.com/content/CVPR2021/papers/Joseph_Towards_Open_World_Object_Detection_CVPR_2021_paper.pdf

Abstract

Open World Object Detection(OWOD) task에서는 아래와 같이 크게 2가지를 수행한다.

  1. unknown instances를 explicit supervision 없이 "unknown 이다." 라고 특정한다.
  2. unknown categories에 대해 forgetting 없이 incremental learning 한다.
    즉 open set + incremental learning이라고 보면 된다.
    본 논문에서는 contrastive clusteringenergy based unknown identification을 통해 OWOD 문제를 푼다.

추가적인 방법론적 노력 없이도 SOTA를 달성하면서 unknown instances를 indentifying하고 characterizing하는 것이 incremental object detection setting에서 confusion을 줄이는 데 도움이 됨을 발견했다.

Introduction

기존의 object detection에서는 모든 class들이 training 단계에서 이미 주어졌다는 강력한 가정이 있지만 실제로는 저 가정이 맞지 않다. 실제로는 test 시에 unknown class를 포함할 수 있고, unknown class에 대한 정보(라벨)이 있을 때 모델은 새로운 클래스를 점진적으로 배워갈 수 있어야 한다.

image
fig 1은 기존 연구들의 흐름과 본 연구의 위치를 보여주고 있다. ( 본 연구는 Difficult problem인 Detection을 다루면서 Open Set Learning, Incremental Learning을 모두 가능하게 하는 Open-world Detection을 수행하는 연구임. )

Key Contribution

  • Real world에 더 가까운 Open World Object Detection 이라는 novel problem setting을 제시했다.
  • ORE라는 contrastive clustering, unknown-aware proposal entwork, energy based unknown identification에 기반한 새로운 방법론을 제시한다.
  • 중요한 실험 셋팅을 소개하고 SOTA 달성했다.

Open World Object Detector

OWOD를 잘 하려면 명시적인 supervision없이도 unknown instances를 식별할 수 있어야 하고 스크레치부터 학습하지 않고도 이전 instances들을 잊어버리지 않고 새로운 instances를 찾아낼 수 있어야 한다.
본 논문에서는 latent spaces 상에서 클래스들을 확실히 분리시키는 방법의 효과에 대해 크게 두 가지 가정을 한다.

  1. unknonw instance의 feature representation은 known instance들과 어떻게 다른지를 식별하는데 도움이 된다.
  2. 이전에 존재하는 class들의 latent space와 overlap되지 않기 때문에 forgetting 없이 incrementally learning을 수행하는 데 도움이 된다.

이 가정들을 바탕으로 contrastive clustring 방법론을 제안한다. 그런데 contrastive clustering을 하려면 뭐가 unknown instance인지를 알 수 있는 supervision이 필요하다. 따라서 본 논문에서는 Region Proposal Network를 통해 unknown instance에 pseudo-label을 달아준다. 이 auto-labeled 방법을 통해 논문에서 제안하는 energy based classfication head가 known과 unknown을 구별하게 해준다.

image
fig2를 보면 전체적인 과정을 보여준다. 백본 detector로 2 stage 모델인 Faster R-CNN을 썼다. (one stage YOLO 보다 좋았기 때문)

첫 번째 stage에서, class-agnostic Region Proposal Network(RPN)을 통과하고 두 번째 stage에서 각 proposed region마다 bounding box coordinates를 분류하고 조정한다. RoI head에 있는 residual block을 통해 생성된 features는 contrastive learning을 통해 클러스터링 된다. RPN과 classification head는 각각 auto-labeling, unknown detection을 잘 하게 되는 방향으로 학습된다. 델타는 얼마나 유사한지/ 유사하지 않은지를 의미힌다. 이 loss를 최소화해가면서 latent space상에서 class separation을 하게 된다.

근데 이 때 class prototype은 어떻게 구할까? end-to-end로 학습하는 과정에서 stochastic gradient descent로 weight를 incremental하게 업데이트 해 갈 때마다 feature가 바뀌면 class prototype도 같이 incremental하게 업데이트 되어야한다. 그래서 이 features들을 저장하기 위해서 fixed length queue qi를 써서 class 별로 feature를 저장한다. (Fstore ={q0 · · · qC})

4.1 Contrastive Clustering

class seperation을 위해 같은 class끼리는 가깝게 먼 class끼리는 게 학습한다.
image
contrastive loss는 식 (1)과 같다.
각 known class마다 prototype vector p_i를 구한 다음, OD backbone에서의 intermediate layer feature f_c와 비교한다. D는 어떤 distance function이든 다 올 수 있다.

image
수도 코드를 보면 clustering loss를 계산하는 과정에서 어떻게 class prototype을 만들어가는지 알 수 있다. 처음에 Ib(특정 횟수번 만큼 반복) iteration이 완료된 후에만 loss를 계산하기 시작한다. 이렇게 하면 초기 feature embedding 자체로도 class 정보를 encoding 할 수 있다. 모든 Ip iteration을 반복한 후, 새로운 class prototype set P_new가 계산된다(8번째 라인). 그 다음 모멘텀 파라미터 뉴로 P랑 P_new에 가중치를 줘서 업데이트 한다. 이렇게 프로토타입은 점진적으로 이전 context를 추적해갈 수 있다.

4.2 Auto-labeling Unknowns with RPN

clustering loss를 계산할 때 input feature vector랑 prototype vector랑 비교한다. (c ∈ {0, 1, .., C} where 0 refers to the unknown class). 근데 이렇게 할려면 unknown에 대한 실제 class label을 지정해줘야 하는데 이걸 일일히 라벨링하는것은 현실적으로 불가능하다. 대신, 이미지의 일부 object에 potential unknown object라고 automatically labeling해준다. 이를 위해 RPN을 쓴다. RPN은 class agnostic하다.

이미지가 들어오면 RPN은 foreground, background에 대해 각각 bounding box 예측 셋을 만들게 된다. 이 때 high objectness score를 가지면서 ground-truth object와는 overlap되지 않는 그런 애들을 potential object로 달아준다. 즉, objectness scores로 sort한 다음에 top-k background region proposals를 select한다. 이런 단순한 heuristic 방법이 좋은 성능을 달성해줬다.

4.3 Energy Based Unknown Identifier

Energy based model(EBM)처럼 energy function E(F,L)을 학습한다. F는 observed variables이고 L은 possible set of output variables이다. (single scalar 값임.) EBM을 통해 in-distribution data에 대해서는 low energy 값을 주고, 반대로는 높은 값을 주는 방식으로 unknown measure를 수행한다.

그 주에서도 특히 Helmholtz free energy formulation을 쓴다.
image
image

  • p(l|f) : the probability density for a label l
  • g_l(f) : the lth classification logit of the classification head g(.)

위 notation 들을 활용해서 본 논문 상황에 맞는 free energy를 아래와 같이 정의했다.
image
식 (4)처럼 faster R-CNN classfication head에서 energy function으로 자연스럽게 변환할 수 있다.
Contrastive clustering을 통해 latent space상에서 feature들이 확실히 분리되었기 때문에 energy level도 known/unknown이 뚜렷하게 구별됨을 아래 fig3에서 확인할 수 있다.
image
weibull distribution에 fitting시킨 모습이다.

Alleviating Forgetting

unknown을 식별하고 나서 중요한건 새로운 클래스를 학습할 수 있어야 한다. 대부분의 이전 연구들은 이 단계를 거치지 않았다. 그냥 단지 new class instances를 학습하는 방법은 이전 class에 대해 catastrophic forgetting 한다는 문제가 있다. 이전 연구들이 이런 forgetting을 피하기 위해서 parameter regularization ,exemplar replay, dynamically expanding networks, meta-learning 등을 활용했다.
우리는 exemplar replay를 활용한다. balanced set을 저장하고 이에 대한 각 incremental step을 거친 후 모델을 fine-tuning 한다. 각 point에서 각 class에 대한 최소 N_ex instances가 exemplar set에 있는지 확인한다.

Experiments and Results

image
데이터 셋팅은 table1처럼 구성했다. task T1에서는 Pascal VOC(known class), 나머지 task들에서는 MS-COCO를 그룹핑하는데 3개로 쪼개서 incremental하게 셋팅했음.

  • Evaluation Metrics
  1. WI
    image
    p_k: known class에 대한 precision
    PK∪U : known_unknown class에 대한 precision (recall = 0.8일때의 precision)
    이상적으로 ,test dataset에 unknown object가 추가되어도 precision이 떨어져서는 안되기 때문에 WI값은 항상 낮아야 한다.
  2. Open-Set Error
    추가로 Open-Set Error도 평가지표로 써서 몇 개의 unknown objects가 known으로 잘못 분류됐는지도 측정한다.
  3. mAP(IoU threshod = 0.5)
    Incremental learning capability를 정량화하기 위해 Iou threshod 0.5에서의 mAP를 측정한다.
    image
    image
    image
    table4에서 ablation study 결과를 잘 구성해서 보여주고 있다. (근데 생각보다 EBUI는 큰 영향이 없었다. 그냥 measure 도구 정도라고 생각하면 될듯?)

image
너무 많이 늘려가면 성능 떨어짐.

image
image
image

[39] ANOMALYCLIP: OBJECT-AGNOSTIC PROMPT LEARNING FOR ZERO-SHOT ANOMALY DETECTION

Abstract

  • Zero-shot anomaly detection(ZSAD)은 target dataset에 대한 training sample 없이 auxiliary data을 사용해서 학습된 모델을 필요로 한다.
  • ZSAD는 학습 데이터가 충분치 못한 상황에서 중요하지만, 모델이 다양한 도메인에서의 anomalies에 generalize되는 것은 여전히 challenging한 문제임.
  • CLIP과 같은 pre-trained vision-language models(VLMs)이 anomaly detection을 포함한 다양한 task에서 zero-shot 성능이 좋았지만, VLMs는 이미지에 대한 abnormality/normality보다 foreground object에 대한 class semantics에만 포커스하게 됨.
  • 따라서 본 논문에서는 여러 도메인에 대해 정확한 ZSAD을 위해 CLIP을 adapt하는 AnomalyCLIP을 제안함.
  • 모델이 object semantics보다 abnormal image regions에 더 집중할 수 있어서 generalized normality and abnormality recognition이 가능해짐.

Introduction

  • data privacy policies로 인해 학습 데이터에 접근하지 못하거나, target domain과 연관된 학습 데이터가 없는 상황 등에서 ZSAD task가 필요로 하다.
  • 일반적으로 여러 application 시나리오에서 이상은 visual appearance, foreground objects, background features에 상당한 변화가 있기 때문에 모델이 strong generalization ability를 갖추려면 이러한 variation을 고려해야 함.
  • 하지만 기존 CLIP 모델들의 경우 이미지에 대한 정상성/이상성 보다 foreground object에 대한 class semantics을 align하기 위해 학습되었기 때문에 visual abnormality/normality를 이해하는 generability가 떨어진다는 한계가 있음.
  • 또한 현재 prompting approach들을 보면, manually defined prompt나 learnable prompts는 효과적인 object semantic alignments를 위해 global feature에 집중하는 경향이 있어서 fine-grained, local features에서 종종 나타나는 이상은 캡쳐하지 못함.
image

Method

image

Object-Agnostic Text Prompt Design

  • CLIP에서 일반적으로 쓰이는 텍스트 프롬포트 탬플릿 (A photo of a [cls])은 object semantics에 초점을 두기 때문에 정상, 이상 semantics를 캡쳐하는 text embeddings를 만들지 못한다.
  • 따라서 anomaly-discriminative textual embedding을 학습하기 위해 prior anomaly semantics를 text prompt templates와 통합한다.
  • trivial solution으로는 specific anomaly types로 템플릿을 설계하는 것이겠지만 (A photo of a [cls] with scratches), anomaly의 패턴은 일반적으로 다양하고 unknown이기 때문에 모든 possible anomaly types를 다 리스트하는 것은 어렵다.
  • 따라서 본 논문에서는 damaged [cls] 형태로 설계해서 comprehensive anomaly semantics를 커버하고 scratches, hole과 같은 다양한 defect detection을 가능하게 한다.
  • 그럼에도 불구하고 이러한 text prompt templates는 generic anomaly-discriminating textual embeddings을 만들기 어려울 수 있다.
    • CLIP에서의 original pre-training이 이미지 내에서의 정상성/이상성 대신에 object semantics의 align에 초점을 두었기 때문
    • 이러한 한게를 해결하기 위해 learnable text prompt templates를 두고 AD-auxiliary D-relevant data를 사용해서 prompt를 tuning 함.
    • fine-tuning 단계에서 이 learnable templates가 broad하면서 detail한 정상성/이상성을 학습하게 되고, textual embeddings가 더욱 discriminative하다.
    • 따라서 extensive engineering이 필요한 manually defined text prompt templates 즉, object-aware text prompt templates 설계를 안해도 된다.

image

  • 위 경우가 object-aware text prompt templates인데, [v]랑 [w]는 각각 정상성과 이상성에 대한 learnable word embeddings임.
  • ZSAD는 unseen target dataset에 대해 이상을 탐지할 수 있어야 함. 하지만, 이런 데이터셋들은 다른 object에 대해 상당한 variations가 존재함. (다른 상품 간, industrial defects와 의료 이미지 간 discrepancies 등)
  • 하지만 object semantics의 substantial difference에도 불구하고 기본 이상 패턴은 유할 수 있음. (metal nuts나 plates의 스크레치, transistors와 PCB의 misplacement 등) 비슷한 anomaly pattern을 공유할 수 있음..
  • 따라서 본 논문에서는 정확한 ZSAD의 핵심은 다른 objects 간의 다양한 semantics에 상관 없는 generic한 이상 패턴을 학습하는 것이다.
  • 따라서 object-aware text prompt templates 설계는 ZSAD에서 불필요하다고 주장. 오히려 unseen anomalies의 detection을 방해할 수 있음.
  • 반면, text prompt templates로부터 object semantics를 배제하는 것이 learnable text prompt templates가 object보다 이상 그 자체의 특성을 캡쳐하는 데 집중할 수 있도록 함.
  • 따라서 object-agnostic prompt learning을 제안함. 이 때 class name을 object로 대체하고 object에 대한 class semantics는 block out함.
    image
  • 이러한 디자인은 object-agnostic text prompt templates가 다른 이상에 대한 공유되는 패턴을 학습할 수 있도록 하고 결과적으로 이렇게 생성된 textual embedding는 더 generic 하고 다른 도메인에서의 다양한 object의 이상을 더 잘 캡쳐함.
  • 또한 어떠한 modification 없이 다른 타겟 도메인에 적용하기 쉬움 (target dataset에 대한 object name이나 anomaly types 정보가 필요 없음)

Global context optimization

  • 효과적으로 object-agnostic text prompts를 학습하기 위해 global, local 각각의 측면에서 정상성과 이상성을 학습할 수 있는 joint optimization approach를 소개함.
  • Global context optimization
    image
    • object-agnostic textual embeddings가 global visual embeddings와 잘 매칭될 수 있도록 도움으로써 global 측면에서 정상/이상 semantics를 더 효과적으로 캡쳐 가능
    • Cross entropy loss로 textual embedding이랑 auxiliary data의 visual embedding 간 cosine similiarity match하는 부분임
  • Local context optimization
    image
    • local은 반대로 fine-grained, local abnormal regions를 더 잘 집중할 수 있도록 하는데, vision encoder의 M 번째 중간 레이어에서 local한 정보 가져옴.
    • S는 gt segmentation mask여서 1이면 이상, 0이면 정상 픽셀임.
    • Focal, Dice loss를 적용.
      • focal loss는 일반적으로 이상 지역이 정상 지역보다 더 작기 때문에 imbalance 문제를 해결하기 위함임
      • dice loss는 모델의 정확한 decision boundary 학습을 위해 predicted segmentation S_n/S_a 그리고 gt mask 간의 overlap을 측정하는 loss임.

Refinement of textual space

  • More discriminative textual space를 학습하기 위해 text encoder에 추가적인 learnable token을 추가해서 CLIP의 original textual space를 refine 함.
  • 처음에 random initialized learnable token embeddigs를 clip text encoder에 붙임
  • 그리고 original token embedding이랑 채널 차원을 따라서 concat 해서 CLIP text encoder에 넣음.
    image
  • self-attention 매커니즘에 의해 t_m+1 이 t'm의 정보를 포함하게 됨.

Refinement of the local visual space

  • CLIP의 visual encoder가 global object semantics를 align 하기 위해 사전학습 되었기 때문에 self-attentnion 메카니즘으로 global 정보를 local 정보로 propagate하게 될 경우, fine-grained abnormality를 학습하는 것을 방해할 수 있다.
  • 이런 현상을 완화하기 위해 diagonally prominent attention map(DPAM)을 통해 local visual space를 refine 함. (학습 시에 visual encoder는 frozen 됨)
  • original Q-K attention을 Q-Q, K-K, V-V와 같은 diagonally prominent attention으로 대체하는 것임. 이중에서도 특히 V-V self-attention을 씀.
  • Fig 3에서 볼 수 있듯이 refined DPAM attention maps가 더 diagonally prominent하고 상당히 개선된 seg map을 보임.

Training and Inference

  • 학습 시에는 auxiliary AD related dataset으로 eq 2 loss로 학습함.
  • inference 시에는 image-level anomaly score의 경우 similarity score, pixel-level prediction의 경우 anomaly seg map이랑 normal seg map을 interpolation & smoothing 으로 merge 함
    image

Experiments

Datasets and Evaluation Metrics

  • Dataset: 17개의 공개 데이터셋으로 실험함.
    • Industrial inspection: MVTecAD, ViSA, MPDD, BTAD, SDD, DAGM, DTD-Synthetic
    • Medical imaging: cancer detection dataset ISBI, colon polyp detection datasets CVC-ClinicDB, CVC-ColonDB, Kvasir, Endo, thyroid nodule detection dataset TN3k, brain tumor detection datasets HeadCT, BrainMRI, Br35H, COVID-
      19 detection dataset COVID-19
  • SOTA와의 비교: CLIP, CLIP-AC, WinCLIP, VAND, CoOp
  • Metric: AUROC, AP, AUPRO

Main Results

image

  • CLIP보다는 Manually defined text prompts를 쓰는 경우 즉, WinCLIP이랑 VAND가 더 좋은 결과를 보임
  • CoOp의 경우 global feature에만 집중하여서 fine-grained local anomaly semantics는 무시해서 anomaly seg 성능이 좋지 않다고 주장함.
    image

image

  • 메디컬 도메인의 경우 AnomalyCLIP이랑 VAND가 defect detection dataset으로 tune되었음에도 promising한 ZSAD 결과를 보임.
  • fig 4를 보면 WinCLIP, VAND 보다 locating도 더 잘 하고 있다고 주장.

image

  • industrial dataset에 비해 상대적으로 성능이 안좋은데, 그 이유는 학습에 쓰인 auxiliary data의 impact 때문임.
  • 따라서 medial image를 auxiliary 데이터로 써서 학습하고 ZSAD 성능을 비교했음
  • 하지만 pixel-level annotation 된 이미지가 없기 때문에 ColonDB라는 데이터셋을 직접 만듦.

object-agnostic vs object-aware prompt learning

image

  • Image/pixel level 모두 object-agnostic 결과가 더 좋았음.

Ablation

image
DPAM (T1), object-agnostic text prompts (T2), adding learnable tokens in text encoders (T3), multi-layer visual encoder features (T4)

Conclusion

  • target dataset에 대한 학습 데이터가 없는 상황에서 ZSAD는 여전히 challenging한 문제이다.
  • 본 논문에서는 AnomalyCLIP을 제안해서 ZSAD의 CLIP의 일반화 성능을 개선했다.
  • Object-agnostic prompt learning을 통해 다양한 foreground objects를 가지는 이미지 데이터셋에 대해 일반화된 ZSAD을 위한 정상성/이상성 학습이 가능함.
  • Global local anomaly semantics를 통합하기 위해 joint global and local context optimization 수행함
  • 17개의 공개 데이터셋으로부터 좋은 성능을 증명해 보임.

[17] Foundation Model Drives Weakly Incremental Learning for Semantic Segmentation

Abstract

슬라이드4

  • Semantic segmentation task에서 incremental learning은 dense annotation에 기반해서 새로운 카테고리를 학습한다. 하지만 pixel-by-pixel 라벨링은 비용이 많이들고 time-consuming하다.
  • Weakly incremental learning for semantic segmentation(WILSS)는 image-level annotation만 활용하기 때문에 비용이 저렴하고 넓게 적용할 수 있다. 하지만 이런 image-level label은 segment 각각을 locate 하는 디테일한 정보를 주지 못해서 성능이 제한적이다.
  • 따라서 어떻게 image-level labels만 주어진 new classes를 활용해서 forgetting을 피하고 효과적으로 성능을 높일 수 있을지를 고민했다.
    • 본 논문에서는 teacher-student 구조를 활용해서 noisy pseudo masks를 최적화해간다.
    • 그리고 memory-based copy-paste augmentation을 활용해서 catastrophic forgetting 문제를 해결한다.

Introduction

슬라이드6

Sematic segmentation의 성능이 매우 좋음에도 불구하고 하나의 데이터셋으로 pre-train 된 하나의 모델을 가지고 새로운 클래스를 가지는 다른 데이터셋에 retrain 시키면 학습한 지식을 까먹는 문제가 있다.
이러한 문제를 catastrophic forgetting이라고 하며, 과거 샘플에 접근하지 않고 새로운 카테고리로 모델링할 때 모델의 파라미터가 너무 크게 바뀌는 문제로 인해 발생한다.

슬라이드7
이를 해결하기 위한 접근법은 incremental learning이다. Incremental Learning Semantic segmentation(ILSS)에서는 현재 스텝에서 학습 샘플의 new class pixel annotation으로 예측하고 이전 스텝에서의 old class는 background로 예측되는 식이다.

현대 ILSS에서는 크게 두 가지 접근 방식으로 나눌 수 있는데, 1) Regularization-based, 2) Replay-based이다.

  1. Regularization-based 방법은 knowledge distillation 방식이다.
  2. Replay-based 방법은 memory를 따로 두고 저보를 저장해뒀다가 새로운 학습 스탭에서 활용하는 방식이다.
    그러나 위 두 방식의 한계는 new class에 대한 pixel level annotation이 필요하다는 점이다. 그래서 WILSON은 최초로 weakly incremental learning for semantic segmentation task를 제안했지만 이미지 레벨의 라벨이 유의미한 성능 향상에 도움이 되지 못했다.

본 연구에서는 old 데이터에 대한 지식을 보존하면서 이미지 레벨의 label이 주어진 new class에 대해 효과적으로 supervision을 활용할 수 있는 방법을 연구했다.
image
일단, fig1처럼 최초로 pre-trained foundation model을 활용해서 training-free 방식으로 주어진 image-level label supervision을 개선했다.

  • Pre-training based co-segmentation을 활용해서 vision-language pretraining model(CLIP)의 knowledge를 distill한다.
  • Self-supervised pre-training models(IBOT)을 활용해서 보완한다.

먼저 clip으로 category-aware dense mask generation을 통해 initial mask를 뽑아낸다. 그럼 각 new class의 initial mask를 가지고 self-supervsed model를 활용한 seeds guidance로 compact category-agnostic attention map을 뽑아내서 mask fusion을 통해 pseudo mask를 refine한다. 그래도 여전히 noisy한 pseudo mask를 최적화하기 위한 teacher-student구조를 제안하는데, plug-in teacher는 dense contrastive loss로 최적화된다. 이러한 방법으로 pseudo dense supervision을 더 효과적으로 활용할 수 있다.

Related Work

슬라이드10
슬라이드11

3. Method

슬라이드14

일단, incremental learning에는 multiple step(t)가 존재한다. 하지만 original incremental setting 과는 조금 다르게 novel weakly incremental learing for semantic segmentation (WILSS) 셋팅에서는 t=0 즉, 초기 스텝에서만 pixel annotations가 주어진다. 이후 스텝에서는 new class에 대해 오직 image-level annotations로만 접근할 수 있고 이전 스텝에서의 training sample에는 더이상 접근할 수 있다. 목표는 old class에 대한 forgetting 없이 모델을 학습시키고 업데이트하는 것이다.

Pre-training Based Co-segmentation

슬라이드15
오직 image-level label만 사용해서 dense prediction tasks를 supervise하기에는 여전히 한계가 있다.
Q. 그렇다면 어떻게 image-level abel로 새로운 클래스에 대한 supervision을 개선할 수 있을까?
본 논문에서는 pre-training based co-segmentation method를 활용해서 두 종류의 foundation model(vision language pretrained model로는 CLIP, self-supervised pretrained model로는 iBOT, DINO)의 knowledge를 distill한다.

슬라이드13
전체적인 과정은 위와 같다.

Initial Mask

슬라이드16
Pre-trained vision-language model(CLIP)에 태워서 주어진 image-level labels로 category-aware pixel annotations를 뽑는다. Fig 2처럼 구체적으로 보면 t시점에 이미지가 image-level label인 C^T와 함께 주어지면 처음에 CLIP encoder(f_I)로부터 image feature(F)를 뽑고, final linear projection layer(f_proj)에 통과시킨다.
image
여기서 L2 normalization은 channel 차원으로 진행되고 d는 feature dimension을 의미한다.

그리고 나서, t step에서의 target class C^T를 input prompt로 해서 text embedding을 계산한다.
image
위 식에서 f_T는 CLIP text encoder를 말하고, prompt는 CLIP에서 multiple prompt templates를 ensemble하는 prompt engineering을 의미한다.

그러고 나서 language-compatible image feature embedding, text embedding으로 pixel-text score map를 계산한다. (dot product 연산)
image
M_init은 initial segmentation results가 될 것이다.

Refine Mask via Seeds Guidance

슬라이드17

앞에 CLIP을 통해 만든 pseudo mask M_init은 rich-category-aware pixel annotations 일 수 있지만, image-text pairs로 학습된 CLIP은 segmentation task보다 instance-level classification에서 유리하기 때문에 mask가 noisy하다. 이 마스크 퀄리티를 높이기 위해, local feature modeling에서 좋은 성능을 낸 다른 종류의 foundation model(self-supervised pre-traininig models)에 knowledge를 distill하는 것을 제안한다. 이 모델들은 compact category-agnostic attention map을 얻을 수 있다.

Q. 하지만, 이미지가 여러 개의 object를 포함할 수 있는 경우에는 어떻게 해야 할까?
-> 이 문제를 다루기 위해 category-specific seeds guidance로 initial mask를 refine할 것을 제안한다. 우선 각 target class마다 initial mask에서 랜덤 시드 포인트를 고르고 pre-trained self-supervised model로부터 해당하는 category-aware attention map을 뽑는다. 이 때의 attention map은 last self-attention block에서 뽑아온다.
image
여기서 n은 attention head의 수를 의미한다. N은 seed point 수를 의미하며 각각의 새 클래스, training step마다 binarized M_init의 foreground로부터 랜덤으로 N개만큼 샘플링한다. ([]는 binarization operation을 의미하며, 특정 threshold보다 크면 1, 아니면 0으로 설정한다. 이 때의 threshold는 averaged attention map이 top K(k=70%) locations를 유지하며 dynamically updated된다.)
image
FIg 5는 2개의 class(horse, dog)에 대한 attention map을 시각화한 것인데 시드 수(N) = 9 일 때 좋은 clustering performance를 보였다.

마지막으로, 간단한 mask fusion으로 union연산 거쳐서 refine 된 마스크를 얻는다.
image

3.3 Pseudo Label Optimization

슬라이드18
슬라이드19

여전히 noisy한 pseudo mask를 더욱 최적화하기 위해 teacher-student구조를 사용할 것을 제안한다.
구체적으로, segmentation model은 student model로 함으로써, 학습 중에 더 나은 pseudo mask를 dynamically learn하기 위해 plug-in-teacher module(ASPP)를 도입한다. teacher module를 학습하기 위해 먼저 pixel-wise binary cross-entropy loss를 사용할 것을 제안한다.
BCE는 t 단계에서 new clas prediction을 supervise하고, 이전 클래스 최적화는 다음 섹션에 남긴다.
image
여기서 P^c,i는 pixel i의 new class c에 대한 predicted probability를 의미한다. 그러나 pixel-wise BCE loss는 주로 현재 이미지에 대한 foreground class c의 최적화에 초점을 맞추고 다른 클래스들은 모두 배경으로 처리하기 때문에 픽셀 간의 상관관계를 무시한다. 따라서 unsupervised representation learning에서 쓰이는 InfoNCE loss에서 영감을 받아서 전체 데이터셋 간에 multi-class predictions와 해당하는 pixel-wise pseudo labels을 더 잘 활용하기 위해 dense contrastive learning을 수행할 것을 제안한다.
image
fig3과 같이 새로운 클래스 이미지의 픽셀 i와 해당 pseudo annotation에 대해 i와 동일한 class를 가지는 모든 픽셀을 수집하여 positive sample Pi를 구성하고, 다른 클래스 point들은 negative sample Ni로 구성했다. 이 dense contrastive loss는 아래 식 7과 같이 계산된다.
image
타우는 temperature term으로 0.1을 디폴트로 한다. 학습 효율성을 위해 현재 미니배치에 포함된 class들에 대해 ten point만 랜덤으로 샘플링해서 계산한다.
pixel-wise BCE loss(식 6)과 dense contrastive loss(식 7)은 서로 보완적이다. teacher module이 discriminative pixel features를 잘 학습할 뿐만 아니라 intra-class와 inter-class pixel feuatre modeling을 통해 pixel feature regularize 또한 할 수 있다.

3.4 Memory-based Copy-Paste Augmentation

슬라이드20

추가로 new class에 대한 supervision을 개선하고 효과적으로 활용하는 것 외에도, 학습을 안정화하고 segmentation model 성능을 더욱 향상시킬 수 있는 memory-based copy-paste augmentation strategy를 제안한다.
image
Fig4처럼, 각각의 old class마다 memory bank를 두고 각 class archive는 base model training 중에 B개의 foreground instaces와 segmentation labels를 저장한다. 그 다음 t 단계에서 랜덤으로 선택된 이전 class archive에서 foreground image와 label 쌍을 랜덤으로 선택해서 new class image에 랜덤으로 paste한다. 이제 training sample에는 t 단계에서 new class image 뿐만 아니라 t-1 단계에서 old class image와 pixel label이 포함되어 있다. 따라서 teacher module의 old class lerning을 다음과 같이 최적화한다.
image
g는 logistic function이다.

3.5. Overall Optimization

슬라이드21

이전 단계(t-1)에서 학습된 모델과 t시점에서 동적으로 업데이트 된 teacher module에 대한 knonwledge를 distill해서 segmentation model을 최적화한다. 이 teacher module은 주로 BCE loss로 최적화되기 때문에 우리는 BCE loss를 사용해서 teacher module의 prediction을 segmetation model로 distill한다. 학습된 pseudo mask가 완벽하지 않다는 점을 고려해서 soft pixel label을 new class에 대한 최종 supervision으로 사용하고, 이전 모델과 teacher module 출력의 가중 평균 값을 old class에 대한 supervision으로 사용한다.
image
여기서 hard는 one-hot operation을 의미해서 각 픽셀 별로 maximum score를 설정하고 나머지는 0으로 한다. 알파와 베타는 trade-off 파라미터이고 알피는 0.5, 베타는 0.9를 디폴트로 설정했다.

segmentation model의 BCE loss는 아래와 같다.
image
y^t는 all seen classes를 의미하고 p는 t시점에서의 segmentation model의 output을 의미한다.

따라서 최종 objective는 다음과 같다.
image

(loss 총정리)
슬라이드22

Experiments

4.1. Datasets and Protocols

슬라이드24

공정한 비교를 위해 SOTA 실험 셋팅과 데이터셋, 프로토콜을 따랐다. new class에 대해 pixel-wise annotation을 사용했던 기존 연구들과 달리 우리는 novel class에 대해 image-level labels만 사용했다.

  • Datasets : 2개의 standard evaluation benchmarks PascalVOC2012, COCO를 사용했다.
  • Protocols: 이전 연구들은 disjoint , overlap 이 2개의 incremental learning protocols를 소개한다. disjoint는 각 training step에서는 이전에 본 클래스랑 현재의 클래스만 포함한다. overlap인 경우에는 각 training step이 모든 이미지를 포함하고 픽셀은 어느 class에도 속할 수 있다. 따라서 overlap protocol이 disjoint에 비해 더 현실적이고 challenge한 task이다.
    • 15-5 VOC: 15 base class는 처음 training step에서 학습되고, 5개의 new classes는 second step에서 연속적으로 학습된다.
    • 10-10 VOC: 10 base class는 처음 스텝에서 학습되고 나머지 10개의 new class는 두번째 step에서 추가된다.
    • COCO-to-VOC: 첫 step에서는 60개의 COCO class로 학습하고(VOC랑 겹치는 20개 버림). 그리고 연속적으로 VOC의 20개의 class를 학습시킨다.
      평가지표로는 mIoU를 썼다.

4.2. Implementation Details

VOC에 대해서는 image pretrained Deeplab V3 with a Resnet-101 backbone을 썼고 COCO에 대해서는 image pretrained Wide-ResNet-38 dataset을 썼다. 모든 model은 40에폭에 배치사이즈 24로 학습했고 optimizer로는 SGD, lr는 1e^-3, momentum 0.9, weight decay 1e^-4로 학습했다. segmentation model을 학습하기 전에 warm up 과정을 거쳐서 teacher module을 먼저 5에폭 학습시켰다. 람다는 0.1, 알파는 0.5, 베타는 0.9로 학습시켰다.

image
이전 연구들과 공정한 비교를 위해 똑같이 5개의 class(plant, sheep, sofa, train, tv monitor)를 incremetal step으로 두었다. table 1을 보면 disjoint, overlap 셋팅 모두에서 SOTA를 달성했다.
image
10-10 VOC나 COCO-to-VOC 에서도 마찬가지로 SOTA를 달성했다.
image

4.5. Ablation Studies

image
M_seeds를 계산할 때 number of seeds를 바꿔가면서 실험한 결과이다. 더 많은 random seeds를 guidance가 더 compact한 attention maps를 만들어주고 9개정도가 좋은 학습 효율성과 함께 좋은 클러스터링 결과를 보여주었다. 그리고 category-agnostic M_seeds가 M_init을 보완해준다는 걸 red box로 표시하고 있다.

image
mask fusion의 두 가지 operation을 비교하고 있고 fusion 없는 경우도 비교하고 있다. Union fusion 방식이 눈에띄는 성능 향상을 보였다. Table 5에서는 람다를 0.1로 셋팅한 이유에 대한 ablation이다. 그리고 0인 것과도 비교한 결과, 우리가 제안하는 Dense contrastive learning 방식이 더 효과적으로 촤적화할 수 있고 dense supervision을 더 잘 할 수 있다는 것을 보여준다.

image

image

Conclusion

슬라이드31

[32] DualPrompt: Complementary Prompting for Rehearsal-free Continual Learning

Introduction

  • 기존 연구들은 주로 test time task identity를 안다는 가정이 있는 task-incremental setting을 다룬다면 본 연구에서는 test-time task identity를 모르는 더 어려운 class-incremental setting을 다룸.
  • L2P에서는 하나의 prompt pool을 써서 모든 task간 commonfeatures와 각 task 별 uniqe feature들을 구분하지 않고 knowledge를 transfer했음. 이 방식은 Complementary Learning Systems(CLS) 측면에서 sub-optimal 일 수 있음.
  • 반면 본 논문에서는 인간의 해마가 특정 경험으로부터 pattern-seperated representations를 학습하는 데 중점을 두며, 뉴로코퍼스는 과거 경험 시퀀스에서 보다 general, transferable representations를 학습하는 데 중덤을 두는 것 처럼 두 prompt를 둠.
  • 하지만 이전 CLS 기반 방법은 여전히 백본 파라미터를 decouple하거나 확장해서 두 종류의 knowledge를 학습하기 때문에 이런 decoupled knowledge를 consolidate시키고 catastrophic forgetting을 방지하기 위해 반복적으로 rehearsal buffer를 구축해야 함.
  • 반면, 본 연구에서는 rehearsal-free continual learning approach를 제안해서 두 셋의 disjoint prompt spaces를 명시적으로 학습함.
  • 직접적으로 higher-level prompt space를 decouple하기 때문에 기존 lower-level latent representatio nspace보다 더 effective하고 memory efficienty 함.
    image

Method

  • prompt를 사용하기 위한 위치(where)와 방법(how)에 대한 분석
  • 2개의 prompt를 두어서 역할을 나눔
  1. G-Prompt : 모든 task에 공유되는 task-invariant information
  2. E-Prompt : task-specific knowledge
    image
  • where?
    • ViT layer 마다 G-prompt와 E-prompt 위치를 서로 다르게 구성
    • 각 prompt는 start-end position layer에 할당됨.
  • How?
    • Prompt-Tuning(Pro-T): MSA 내 query, key, value 모든 hidden representation과 함께 반영되어 학습
    • Prefix-Tuning(Pre-T): MSA내 key, value 만 각각의 hidden representation 함께 반영되어 학습
  • objective function
    • classifier와 prompt 학습을 위한 cross-entropy loss
    • query와 key를 위한 matching loss

Strength

  • Rehearsal Free 즉, 메모리 효율적이라는 점이 가장 큼. 사실 prompt를 여러개로 두어서 그 역할을 각각 다르게 설정하는 방식은 기존에도 (L2P) 있었는데, 본 논문에서는

[14] Unsupervised Learning of Visual Features by Contrasting Cluster Assignments

(Facebook AI Research에서 작성한 논문임.)

개인적인 생각으로는, self-supervised learning, representation learning 분야가 발전하면서 대부분 instance discrimination을 기반으로 한 instance-wise contrastive learning 방향으로 연구가 되어왔는데, 이는 사실상 안정적인 학습을 하려면 큰 배치가 필요해서 리소스에 따라 학습이 어려울 수 있으므로 현실적인 활용 측면에서의 치명적인 단점이 존재했지만, SwAV는 feature를 직접적으로 비교하지 않고 cluster간 비교를 통해 (cluster assignments간의 consistency를 강화하는 방식으로 학습하기 때문에) pair-wise comparison 없이도 online clustering based 방식으로 self-sup을 수행할 수 있다는 점에서 큰 의의가 있다고 생각함.

Abstract

기존 contrastive learning 방식들(MoCo, SimCLR)은 배치사이즈 크기에 영향을 많이 받는다. SwAV는같은 이미지로부터 생성된 representation vector가 같은 prototype class(cluster로 할당)를 예측하도록 학습하고 서로의 cluster를 맞바꾸어 예측한다. 그리고 개별 이미지의 positivie/negative pair를 직접적으로 비교하는 것이 아니라 같은 이미지로부터 agumentation 시킨 이미지에 cluster를 할당하고 이를 서로 바꿔서 맞추도록 한다. 또 multi-crop augmentation 방법을 계산효율적으로 적용했다.

Introduction

SSL에서 모든 instance간의 contrastive learning을 수행하는 것은 현실적으로 불가능하기에 batch끼리 비교하거나 clustering을 통해 code끼리 비교한다. (ex. DeepCluster에서는 prorotype matrix를 encoder로부터 분리해서 생성하고 역전파가 따로 흘러간다. ) 이 방식은 결국 모든 dataset image를 사용해야 하기 때문에 scalable하지 않다.

  • 본 논문에서는 cluster code끼리의 consistency는 유지하면서 online방식으로 code를 계산하는 새로운 방법론을 제안한다.
  • 또한 multi-crop 방식으로 생성된 small size 이미지들도 loss 계산에 넣어서 성능을 개선한다.

Method

일반적인 clustering은 전체 data에 대한 image feature에 대해 cluster를 할당해주는 방식으로 학습되는 offilne 방식이다. 반면에 SwAV의 목표는 어떠한 supervision 없이 online으로 visual features를 학습하는 것을 목표로 한다. SwAV는 같은 이미지에서 파생된 augmented image code(군집)의 consistency를 강화하는 방향으로 학습을 진행한다. 즉 타겟 자체가 code인 것이 아니라 같은 이미지로부터 파생된 이미지는 같은 code에 할당되도록 일관화하자는 것이다. 그리고 multiple image view에 대 feature간의 비교가 아닌 cluster간의 비교를 수행하는 것이다.
image
fig 1을 보면, 한 이미지에 다른 augmentation을 적용해서 encoder를 통과시킨 representation을 z1, z2이라고 하면, z를 trainable한 prototype matrix C를 통해 각각의 code(cluster) q1, q2를 생성한다. 이 때 다른 augmentation을 적용했더라도 동일한 이미지에서 나온 code이기 때문에 z1로 q2를 예측할 수 있어야 하고 z2로 q1을 예측할 수 있어야 한다. 따라서 consistency loss를 다음과 같이 설정했다.
image

image
z는 non-linear mapping(encoder)를 통해 생성되고 각 feature는 normalize되어 unit sphere상에 projection된다. 그리고 z를 prototype vector C를 활용해서 q로 만든다. 이 때 q는 z와 c를 이어주는 그래프 형태이다. c는 k개의 대표 prototype vector를 가지는 matrix와 z들을 비교했을 때, q1은 z1이 k개 중 몇 번째 prototype vector와 가장 가까운지를 계산해서 어떤 prototype vector에 할당하면 될지를 안내해주는 일종의 path, 혹은 label 정도로 생각하면 된다.

Swapped predicion problem

image

  • 첫번째 loss term은 zi를 모두 내적한 후 모든 prototype ck와 softmax를 취해서 얻은 pt와 code인 qs의 cross entropy loss이다. s와 t는 각각 다른 augmentation을 뜻한다.
  • 우측 infoNCELOSS를 보면 z_t와 다른 prototype vector간의 거리에 비해 상대적인 prototype k vector c_k 사이의 거리를 뜻한다.
    즉 q는 실제로 z_s가 어떤 prototype과 가장 가까운지를 알고리즘을 통해 일종의 pseudo label을 만드는 것이고 p는 z와 c_k 사이의 상대적인 거리를 구한 것이다. 이렇게 해서 두 확률이 다르면 loss가 커지게 된다.

즉, 주어진 prototype matrix C와 z_s를 통해 어떤 prototype과 가까운지에 대한 pseudo label을 생성하고 z_t와 C prototype vector와의 상대적인 거리를 구한 p_t를 생성하여 qs와 ct간의 CE를 구한다. 그리고 그 반대인 p_s, q_t 사이에서도 CE loss를 구해서 더하면 최종 loss 가된다.

Computing codes online

Q. 그럼 이제 code는 어떻게 구해지는 것일까?
onlie으로 학습하기 위해서는 전체 이미지 feature가 아니라 batch내의 이미지 feature만을 사용해서 code를 계산해야 한다. 따라서 prototypes C가 서로 다른 배치에서 공유되어 batch내의 sample에 code를 할당한다. 이 때 모든 이미지가 같은 code로 매핑되는trival solution을 방지하기 위해 서로 다른 이미지들이 C에 의해 서로 다른 code로 균등배분 될 수 있게 code를 계산해야 한다.

배치 사이즈 B개의 feature vector Z와 C로 매핑된 code 벡터 Q가 있다고 할 때, 먼저 Z^TC로부터 계산된 code와 Q의 유사도가 높아야 한다. 따라서 내적 <Q, Z^TC>를 최대화시킨다. 또 배치 안 샘플들이 서로 다른 code로 균등분배되기 위해 엔트로피 항 H(Q)(정규화로 작용함)를 추가한다. 크기가 같은 행렬 A,B에 대해 <A,B> = Tr(A^TB)인 것을 이용해서 아래와 같이 code vector Q를 유도할 수 있다.
image

입실론을 너무 크게 주면 엔트로피 항이 너무 정규화되어 모든 Qij가 같아버리는 trivial solution이 발생할 수 있다. 또 Q에 대해 optimal transport를 이용할 수 있도록 행렬의 합이 일정하도록 제약을 부여한다.
image

이런 최적화 문제는 optimal transport문제이다. 서로 다른 분포를 가지는 데이터셋이 있을 때 하나의 데이터셋을 다른 데이터셋으로 옮기는 것으로, 다음 그림에서 빨간색을 파란색으로 옮기기 위한 최적의 couping matrix P를 구하는 문제이다.
image
image
이를 SwAV에 적용한 것이 아래와 같은 식의 형태가 되고 sinkhorn-knopp 알고리즘을 통해 3번의 반복만으로도 충분히 좋은 결과를 얻었다고 한다 .
image

Experiments

image
linear probing, semi-supervised learning 방법의 결과를 보면 feature를 frozen 했을 때 MoCov2보다 정확도가 4%만큼 증가했고 supervised와 2%밖에 차이나지 않는다.

참고:

[26] DenseCLIP: Language-Guided Dense Prediction with Context-Aware Prompting

Abstract

  • CLIP에서의 original image-text matching 문제를 pixel-text matching problem으로 접근하고 pixel-text score maps를 사용해서 dense prediction model을 학습시킴.
  • 이미지에 대한 contextual information을 활용해 Language model을 prompt 함으로써 pre-trained knowledge를 더 잘 활용할 수 있음.
  • Model-agnostic한 방법이기 때문에 CLIP + ImageNet pre-trained models를 사용하는 다양한 pre-trained visaul backbones, arbitrary dense prediction systems에 모두 적용될 수 있음.

Introduction

  • 이 논문은 어떻게 Pre-trained CLIP 모델을 잘 fine-tuning해서 dense prediction tasks를 수행할지에 대한 연구임.

Q. Whether the impressive ability of CLIP can be transferred to more complex vision tasks like dense prediction?

  • Conventional ImageNet pre-trained model의 경우 upstream task는 contrastive pre-training, downstream task는 per-pixel prediction task임.

    • 전자는 image-text 둘 다에 해당하는 instance-level representation을 포함한다면, 후자의 경우에는 오직 pixel level에서의 visual information만 기반으로 하고 있다는 문제가 있음.
    • 이를 해결하기 위해 본 논문에서는 new language-guided dense prediction framework, DenseCLIP을 제안함.
    • Fig1처럼 CLIP 모델을 downstream datasets에 fine-tuning함으로써 explicit/implicit 하게 pretrained CLIP knowledge를 활용해서 다양한 Dense prediction task를 수행 가능함.
  • Motivation

    1. Vision-language pre-trained model을 dense prediction task에 활용하는 연구가 활발히 진행되지 않았음. 단순히 pre-trained 2D backbone과 같은 이미지 인코더만 사용할 것이 아니라 텍스트 인코더에 포함됨 language priors 또한 매우 중요함.
    2. Upstream task(contrastive pre-training)와 Downstream task(per-pixel prediction)와의 갭차이로 인해 dense prediction task에 knowledge transfer하기가 훨씬 더 어려움. Dense prediction task에서는 upsetream task의 경우 이미지와 텍스트 둘 다에 해당하는 instance-level representation을 고려하지만 downstream task의 경우 visual information만 가지고 pixel-level 예측을 수행해야 하기 때문.

Method

image
우선 important finding 중 하나는, global image feature과 별개로 CLIP image encoder의 마지막 layer에서 language-compatible feature map을 뽑을 수 있다는 것임.

  • 이에 대한 예시로 ResNet encoder에서 총 4 stages가 있으면, CLIP의 경우 오리지널 ResNet과는 달리 attention pooling layer가 추가됨. 마지막 4번째 stage에 해당하는 feature map에 대해 global average pooling 연산을 수행하여 1XC 차원의 global feature를 얻어서 image embedding과 concat함. 그리고 multi-head self-attention layer에 feed함.
    image

  • standard CLIP training의 경우, global feature가 이미지 인코더의 아웃풋으로 쓰임(다른 output인 z들은 무시). 그러나 본 논문에서는 z(other outputs)가 2가지 특징을 가지는 것을 발견함.

    1. Z는 여전히 sufficient spatial information을 가지기 때문에 feature map으로 쓸 수 있음.

    2. MSHA는 각각의 input에 대해 symmetric하기 때문에 z는 global feature와 유사하게 작용할 수 있으며 language features와 잘 align 될 것.

-> 위 observation을 바탕으로 이미지 임베딩을 language-compatible feature map으로 활용할 수 있음. (ex. ViT와 같은 구조들에서 z는 output에서 class token을 제외한 것)

그렇다면 text features를 어떻게 구하냐

  • “a photo of a [CLS]” template을 CLIP text encoder에 feed시켜서 t를 뽑음.

  • 그러고 나서 Language-compatible feature map z를 사용해서 pixel-text score maps를 계산. (^표시는 l2 normalized version을 의미함) Score maps는 pixel-text matching의 결과를 characterize함.

    image

    1. Score maps를 lower resolution의 segmentation 결과로 볼 수 있기 때문에 auxiliary segmentation loss로 학습해서 사용할 수 있음

    2. Score map을 last feature map에 concat해서 explicit하게 language prior와 결합할 수 있음.

      image

      이 방법론은 간단한 modifications만으로 직접적으로 다양한 segmentation이나 detection에 사용될 수 있음. (ex. input dimension 맞춰주기)

Context-Aware Prompting

CoOp과 동일한 방식으로 learnable textual context를 학습시킴.

image

가장 기본적인 방식으로, P는 learnable textual context를 의미하고 e_k는 k번째 클래스에 대한 word embedding을 의미함.

Vision-to-language prompting

  • Visual contexts에 대한 descriptions를 포함하는 것은 text를 더 정확하게 만들 수 있음.(ex. "a photo of cat" 보다 "a photo of a cat in the grass" 이런식으로 좀 더 정확한.)

  • 따라서 어떻게 visual contexts를 잘 사용해서 text features를 refine할지를 연구함.

  • 본 연구에서는 Transformer decoder의 cross-attention mechanism을 사용해서 vision-language간의 interaction을 모델링함.> 2가지 방식의 Context-aware prompting을 제시함.

    image

아래 1,2, 방식은 transformer decoder의 query를 뭘로 주냐에 따라 설계 방식이 다름.

  1. Pre-model prompting : 직접적으로 image context를 사용해서 desired text input를 생성하는 과정임. (fig 4 참고)

    image

    q는 learnable queries이고, v는 extract 된 visual context.

    즉, 식 3에서 learnable textual context P를 여기선 v로 대체해서 text encoder에 피드해주는 것.

  2. Post-model prompting : class embedding을 refine하는 과정임. (fig 4 참고)

    image

    • CoOp처럼 text features를 만들면 이걸 직접적으로 Transformer decoder의 queries로 씀.
    • 이렇게 학습하게 되면 text features가 조금 더 연관있는 visual clues를 찾을 수 있음.
    • 그리고 text features를 residual connection으로 업데이트함.
      image
      여기서 감마는 residual의 스케일을 조절하는 learnable paremeter.임. 감마는 매우 작은 값으로 initialized 서 text feature로부터의 language priors를 최대한 보존함.

    두 varient target 모두 목적은 같지만 다음과 같은 이유로 post-model prompting을 선호함

    1. post-model prompting은 efficient하다.
      • pre-model prompting은 input이 image에 dependent하기 때문에 inference시에 text encoder로의 추가적인 forward pass가 들어가게 된다.
      • 하지만 post-model prompting의 경우 학습 시의 extracted text features를 저장해놨다가 쓸 수 있기 때문에 inference 시의 overhead를 줄일 수 있다.
    2. empirical results가 post의 성능이 더 좋음을 보여줌.

Instantiations

  • Semantic segmentation

    • segmentation 시에 pixel-text score maps를 더 잘 만들기 위한 auxiliary objective를 제시함.

    image

    위 auxiliary segmentation loss는 feature map이 locality를 더 빨리 recover하게 도움.

  • Object detection & Instance segmentation

    • Ground truth segmentation labels가 없는 경우이다.
    • segmentation처럼 마찬가지로 auxiliary loss를 설계하기 위해 bounding box와 label을 써서 binary target을 만든다.

    image

    image

  • Applications to any backbone models

    • 사실상 CLIP의 이미지 인코더 백본을 어떤 다른 백본으로든 바꿀 수 있다는 장점이 있음 (e.g., ImageNet pretrained models and self-supervised models).
    • visual backbone과 text encoder간 강한 relation이 없더라도 backbone이 language guidance를 통해 빨리, 잘 학습할 수 있음
    • 다시 말해 사전 학습된 텍스트 인코더로부터의 language priors를 써서 어떤 pre-trained image backbone이던 개선시킬 수 있다는 것이고, 이는 곧 DenseCLIP이 dense prediction을 위한 generic framework임을 보여줌

    Experiments

    Semantic segmentation

    image

    Ablations

    image

    • backbone은 resnet50으로 고정해서 ablation을 수행했다.
    • post, pre 둘 다 성능이 오르지만 post-model prompting이 더 성능이 좋고 computationally efficient했다.

    Effects of language-guided pre-training and fine-tuning.

    language-guided paradigm의 potential을 보여주기 위해 ADE20K 데이터셋으로 각각 다른 pre-training, fine-tuning strategies 성능을 비교했다.

    image

    • CLIP이 vanilla fine-tuning으로 ImageNet1K pre-trained model 성능을 outperform하는 결과를 보임
    • 게다가 language-guided fine-tuning을 통해 context-aware prompting을 수행하는 DenseCLIP은 ImageNet21K pre-trained model의 성능을 훨씬 능가하는 결과를 보임.

    Language priors can largely facilitate vision models in downstream dense prediction tasks.

Object Detection and Instance Segmentation

image

image

DenseCLIP for Any Visual Backbone

  • Is Dense-CLIP only suitable to CLIP image encoders?

실험 결과에 의하면 DenseCLIP can also perform well with other backbones.

Although there are no strong correlations between the feature maps of the new backbone and the text features output by the CLIP text encoder, we hypothesize that if we preserve the language priors by freezing the text encoder as before, the text encoder will guide the backbone to better adapt to downstream tasks.

image

ResNet+Semantic FPN, SwinT+UperNet를 비교했다.

We demonstrate that our DenseCLIP can consistently improve all the baseline models notably.

Text encoder는학습때만 쓰면 되기 때문에 low-cost solution이다.

Visualization

image

[10] Continual Detection Transformer for Incremental Object Detection

Abstract

Incremental Object Detection(IOD)에는 catastrophic forgetting 문제가 있다. 문제를 단순히 knowledge distillation이나 exemplar replay처럼 접근해서 바로 Deformable DETR이나 UP-DETR에 적용하면 성능이 잘 안나온다. 본 논문에서는 knowledge distillation이나 exemplar replay를 잘 적용할 수 있는 새로운 방법론인 Continual DEtection TRansformer(CL_DETR)을 제안한다.
핵심은 이하 2가지이다.

  1. Detector Knowledge Distillation(DKD) loss
  2. Calibration Strategy를 통한 exemplar replay 개선

Introduction

(KD(knowledge Distillation은 아니까 설명 패스)
ER(Exempler replay) 방법론은 과거 학습 데이터에서(예시) 일부를 기억하고 다음단계에서 replay하여 old object categories를 기억하는 방식이다.
image
fig1을 보면 KD(knowledge Distillation), ER(Exempler replay) 방법을 Deformable DETR에 바로 적용했을 시(그림에서 남색) standard non-incremental setting(그림에서 초록색) 에비해 성능이 훨씬 떨어지는 것을 확인할 수 있다.

위와 같은 performence drop의 원인을 다음과 같이 분석함.

  1. transformer-based detectors work by testing a large number of object hypotheses in parallel.
  • 일반적으로 이미지에 해당하는 objects 수보다 훨씬 많고 대부분은 negative기 때문에 KD Loss가 unbalance된다.
  • 그리고 training image에는 old/new object categories가 둘다 존재할 수 있기 때문에 KD loss, regular training objective loss로 하급하게 되면 contradictory evidence문제가 발생할 수 있다.
  1. ER 방법론은 각 카테고리에 대해 동일한 수의 exemplars로 샘플링하는데 IOD에서는 object category distribution이 skewed 되어있기 때문에(마치 long tail 분포에 가까움) 적절하지 않다. 즉, Balanced sampling을 하게 되면 training , testing data statistics 의 mismatch 문제가 생긴다.

Method

image
Fig2를 보면 standard방식과 본 논문에서의 방식을 비교하고 있다. 먼저 old modeld에서 most confident foregroud prediction을 select해서 이를 pseudo label로 쓴다. 의도적으로 background prediction을 무시하는 이유는 백그라운드가 훨씬 많아서 imbalanced되기도 하고 new class label이랑 contradict될 수도 있기 때문이다. 그다음, pseudo label을 ground-truth labels랑 merge시키고 bipartite matching을 통해 joint labels로 학습한다.

[7] WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation

paper link : https://arxiv.org/pdf/2303.14814v1.pdf

Visual Anomaly Classification & Segmentation task의 Challenge

Visual Anomaly Classification(AC) & Segmentation(AS) task는 제조 산업에서 이상을 분류하고 localize하여 이미지나 픽셀이 정상인지 비정상인지 예측한다. Visual Inspection은 long tail 문제인데 object와 defect의 종류가 매우 다양하다. 따라서 두 메인 callenge로 이어진다.

image

문제 1) Defects는 넓은 범위의 variations로 인해 학습 시 anomaly sample의 representation이 부족하다.

  • 따라서 Normal image만 가지고 학습하는 One-class나 Unsupervised 방향으로 연구되어 왔는데, 이런 방법은 모델을 normal image에만 fit시켜서 acceptable deviation 까지도 anomalous로 간주한다는 문제가 있다.
  • 또 위 방법의 경우 수백, 수천 개의 정상 이미지가 있을 때는 오픈 밴치마크에서 높은 성능을 달성하지만, few-normal-shot에서는 특히 fully-supervised와 비교했을 때 성능을 개선할 여지가 여전히 있다.

image

문제 2) 이전 연구들은 각각의 visual inspection task에 specific한 model을 학습하는 데 중점을 두었는데, 이는 여러 task의 long-tail문제로 확장할 수 없다. (여기서 말하는 task는 제조업이나 회로 기판, 나무 크랙 탐지 등과 같은 도메인을 말하는 것 같음. )

  • 이 때, 대부분의 defects는 정상 이미지로부터 정의되기 때문에 정상 이미지가 최소 몇 개는 필요하다. 따라서 zero-shot 뿐만 아니라 few-normal-shot anomaly classification and segmentation도 함께 고려한다.

본 논문에서의 접근

이 논문은 zero-shot , few-normal-shot에 초점을 두고 다음과 같이 가설을 세운다.
'Language is perhaps even more important for zero-shot/few-normal-shot anomaly classification and segmentation.'
그 이유는 아래와 같다.

  1. "정상"과 "비정상"은 상황에 따라 달라지는 state 이며 Language는 이러한 state를 명확히 하는 데 도움이 된다.
    ex) 옷감의 구멍은 이상일 수도 있고 패션을 위해 만든 구멍이라면 정상일 수도 있음.
    Language는 이러한 맥락과 특수성을 광범위한 정상, 비정상 상태로 다룰 수 있다.

  2. Language는 defect를 정상으로부터 허용 가능한 편차(acceptable deviation)와 구별하기 위한 추가적인 정보를 제공할 수 있다.
    image
    fig2에서 Language는 soldering defect에 대한 정보를 제공하지만 배경에서의 사소한 긁힘/얼룩은 허용된다. 이러한 장점에도 불구하고 anomaly segmentation/classification에서 vision-language model을 쓰는 연구가 많이 진행되지 않았다.

그런데 CLIP을 그냥 쓰게 되면 몇개의 문제가 있다.

  1. naive prompt는 효과적이지 않다. (table3 참고) 그래서 우리는 state-level word ensemble을 통해 normal/anomalous states를 더 잘 설명한다.
  2. CLIP은 이미지와 텍스트의 global embedding에서만 cross-modal alignment를 수행하도록 학습한다. 그러나 anomaly segmentation을 위해 pixel-level의 분류를 수행하고 dense visual feature를 얻기는 쉽지 않다. 따라서 vision-language alignment를 보장하면서 multi-level feature를 추출하고 aggregate하는 새로운 window 기반의 clip(WinCLIP)을 제안한다.

Contribution 요약

  1. naive CLIP 기반 zero-shot classification보다 zero-shot anomaly classification을 개선한 compositional prompt ensemble을 소개한다.
  2. we propose Win-CLIP, that efficiently extract and aggregate multi-scale spatial features aligned with language for zero-shot anomaly segmentation. As far as we know, we are the first to explore language-guided zero-shot anomaly classification and segmentation.
  3. We propose a simple reference association method, which is applied to multi-scale feature maps for image based few-shot anomaly segmentation. WinCLIP+ combines the language-guided and vision-only methods for few-normal-shot anomaly recognition.
  4. We show via extensive experiments on MVTec-AD and VisA benchmarks that our proposed methods Win-CLIP/WinCLIP+ outperform the state-of-the-art methods in zero-/few-shot anomaly classification and segmentation with large margins.
    (+붙은게 few-shot, 안붙은게 zero-shot)

Method

image
전체적인 작동 방식은 fig4와 같다. various state/template로부터 정상과 이상에 대해 각 average state vector를 구한다. (class protytpe을 구한다고 볼 수 있음.) 이 text 정보를 가지고 image encoder에서 multi scale feature와 association 한다. 만약 few-shot 이미지가 있는 경우 아래처럼 normal reference를 추가로 활용한다. 이 때 multi-level window로 각각 anomaly score map을 생성하고 aggregate 되는데 zero-shot의 경우는 language-guided score map 만으로 scoring을 하고 few-shot의 경우는 vison-based와 language-guided anomaly score map을 모두 활용해서 scoring한다. image classification task에서는 patch embedding만 활용해서 scoring하고 image segmentation task에서는 multi scale을 모두 aggregate해서 scoring 한다.

Two-class design

CLIP을 adapting해서 binary zero-shot anomaly classification framework CLIP-AC를 도입한다. 이 때 정상과 비정상을 모두 사용해서 two-class로 학습한다. 우리는 two-class design이 one-class dseign보다 성능이 더 좋음을 실험적으로 확인했다. 이를 통해 다음과 같은 점들을 알 수 있다.

  1. large web dataset에서 pre-train 된 clip이 anomaly task에 대한 text와 image사이의 align을 잘 해서 좋은 representation으로 이어진다.
  2. 좋은 성능을 위해서는 anomaly에 대한 특정 정의가 필요하다.

Compositional prompt ensemble (CPE)

object level classifiers와 달리 CLIP-AC는 주어진 object의 two state, 즉 task에 따라 다양하고 주관적인 정의를 가지는 정상 또는 이상 사이의 분류를 수행한다. (ex) "missing transistor"는 circuit board에 대한 anomaly state이고 "cracked"는 wood에 대한 anomaly state임. )

이 때 object의 두 가지 abstract states를 더 잘 정의하기 위해 우리는 abstracted state를 자유롭게 정의하는 대신 (a) state words per label , (b) text template 의 pre-defined lists 조합을 생성하는 compositional prompt ensemble을 제안한다.

  • state words는 대부분의 object가 공유하는 공통 state가 포함된다. (ex. flawless, normality, damaged for anomaly)
  • 또 optional하게 defect에 대한 prior knowledge가 있는 경우 task-specific state work를 추가할 수 있다. (ex. "bad soldering” on PCB.)
  • 또 anomaly tasks를 위한 specific template list를 선별한다. (supplementary에 아래 사진 가져)
    image

아래 그림은 ViSA dataet에 대 state words per labels 예시이다. 두 class에 대해서만 예시로 첨부하였지만, task-specific state가 굉장히 구체적이다.
image

image

위 그림과 같이 state와 template의 모든 조합을 가져온 후 레이블 당 평균 텍스트 임베딩을 계산하여 정상 및 비정상 클래스를 나타낸다. CPE는 object label(ex. Cat)을 설명하지 않고 오직 trial-and-error로 select 된 template을 augment한다(ex. a Cartoon [c]). 따라서 CPE는 CLIP의 joint embedding space에서 더 잘 align된다. (한마디로 object level이 아닌 state/template level로 supervision을 주니까 더 좋다는 뜻)

Remark

two-class design with CPE는 기존에 one-class 접근법과 비교했을 때 anomaly을 정의하는 새로운 접근 방식이다. Anomaly detection은 open-ended nature로 인한 ill-posed problem이다. 이전 방법들은 정상에서 벗어난 것은 모두다 이상으로 간주하여 정상 이미지만으로 모델링한다. 이러한 방법은 정상에서 허용 가능한 편차와 실제 이상을 구별하기 어렵다. (ex. ”scratch on circuit” vs. ”tiny yet acceptable scratch”.) 그러나 language는 구체적인 단어로 state를 정의할 수 있다.

4.2 WinCLIP for zero-shot AS

WinCLIP의 수행 방식은 아래와 같다. window를 만들때 binary mask로 scale을 조정해주는 방식이다. (MAE처럼 마스킹 된 부분을 reconstruction하는게 아니라 그냥 scale조정 용도로 마스킹을 하는 것임.)
image

fig3을 보면 CLIP image encoder를 통한 멀티 스케일 feature extraction을 보여주고 있다.

또 추가로 natural dense representation candidate인 penultimate feature map을 쓴다.
풀링하기 전에 특히 fig3 상단에 있는 ViT 기반 CLIP의 patch embedding map의 경우 segmentation을 위해 ascore0을 적용한다. 그러나 patch-level features가 language space에 잘 align되지 않아 dense prediction이 좋지 않음을 발견했다. 이러한 원인이 CLIP에서 language signal로 directly supervise되지 않았기 때문일 것이라고 추측한다. 또한 이러한 patch features는 이미 self -attention에서 global context가 aggregated 되었기 때문에 segmentation을 위한 local details 캡쳐를 방해한다.

image

Penultimate features와 비교했을 때 WinCLIP으로 얻은 dense features가 language에 더 잘 align된다. 또 sliding window를 통해 feature가 local details에 더 집중할 수 있다. 마지막으로 WinCLIP은 특히 ViT 아키텍쳐를 사용하여 효율적으로 연산할 수 있다. (2)번 식의 계산은 마스킹 된 오토인코더와 유사한 방식으로 전달하기 전에 마스킹된 패치를 모두 삭제함으로써 효율적인 연산을 할 수 있다. (reference : MAE)

Harmonic aggregation of windows

각 local window에 대해 zero-shot anomaly score은 window featrue와 (CPE에서 구한) text embeddding의 similiarity이다. 이 점수는 local window의 모든 픽셀에 대해 계산된다. 그리고 각각의 pixel에서 overlapping window에서 여러 점수를 aggregate해서 harmonic averaging으로 segmentation을 개선하고 score에 정규성 예측(0값)에 더 많은 가중치를 부여한다. 식은 (3)과 같다.
image

Multi-scale aggregation

Kenel size k는 WinCLIP feature(2) 연산에서 각 위치에 대한 주변 컨텍스트의 양에 해당한다. segmentation에서 local details와 global information 사이의 벨런스를 조절하는 역할을 한다. small 부터 large scale까지 다양한 크기의 defects를 캡쳐하기 위해서 우리는 multi-scale feature로 prediction을 aggregate한다.
(ex. (a) small-scale (2 × 2 in patch scales of ViT; corresponds to 32×32 in pixels), (b) mid-scale (3×3 in ViT; 48×48), and (c) image-scale feature (ViT class token capturing image context due to self-attention. )
이 때, harmonic averaging 방식으로 aggregation 한다. (fig 3에서 멀티 스케일 보여주고 있음.)

4.3 WinCLIP + with few-normal-shots

포괄적인 anomaly classification 및 segmentation의 경우 특정 defect은 텍스트가 아닌 visual reference만으로만 정의할 수 있으므로 language-guided zero-shot approach는 충분하지 않다. (MVTec AD의 Metalnut에는 flipped upside down이라는 이상 유형이 있으며 이는 일반 이미지에서만 상대적으로 식별 가능하다. ) anomaly state를 보다 정확하게 정의하고 인식하기 위해 K개의 normal reference 이미지를 통합해서 WinCLIP, WinCLIP로의 확장을 제안한다.
image

먼저, cosine similiarity를 기반으로 D의 memory features를 간단히 저장하고 검색할 수 있는 given reference images를 통합하는 핵심 모듈로 reference assosiation을 제안한다. 이러한 모듈에 대해 쿼리 이미지 feature F가 주어지면 anomaly semgnetation 예측 M은 아래 식과 같다.
image
그 다음 assosiation module을 multiple scale의 feature map에 적용한다. 3개의 reference memory를 얻으면 (Rz, Rm, Rp) 주어진 쿼리에 대한 multi scale prediction을 평균낸다.
image
그 다음 language guided prediction M-와 합친다.

anomaly classification을 수행하기 위해 Mw의 maximum value, zero-shot classification score를 결합한다. 두 score는 서로 보완되는 정보를 가진다. (few shot reference로부터의 spatial features + CLIP knowledge retrieved via language)
image

anomaly segmentation 시에도 역시 zero shot에서 구한 score map이랑 few shot segmentation을 합쳐서 구한다. (image only + language supervision 합쳐줌)

Experiments

image

table 1에서 비교하는 CLIP-AC는 original CLIP zero-shot classification with labels of the form {“normal [c]”, “anomalous [c]”} 이다. 그리고 CLIP-AC with the prompt ensemble from engineered for imageNet과 비교한다. 제로샷 ,퓨샷에서 모두 WinCLIP의 성능이 기존 연구들보다 개선되었다. 또기존 연구들과 비교했을 때 제로샷 성능이 견줄만 함을 보여주고 있음.

image
table 4는 segmentation 성능, 나머지는 ablation study 이다.

image
정량평가 결과이다.

추가적인 ablation study이다. small-scale, mid-scale, penultimate feautre(global context) 활용 정도에 대한 ablation도 있다.

image

Conclusion and Discussion

image
개인적으로 느낀 점은, 기존 연구들은 대부분 few-shot task정도까지는 다루었으나 (patchcore같은 경우에도 메모리뱅크를 활용하는 방식이다보니 zero-shot까지의 확장은 불가능한 구조였다.) 본 논문에서는 zero-shot task, few-shot task 모두 가능한 anomaly detection inference 방법론 최초로 제안했다는 점에서 의의가 있다고 생각한다. 그리고 segmentation 성능을 높이기 위해 multi-scale로 이미지를 feed해주기 위한 window-based 방법론을 사용해서 이미지와 랭귀지를 잘 align시키고 계산효율적인 점 또한 장점이라고 생각한다.

한계를 꼽자면, 개인적으로 task-specific prompt를 보면 이미지의 정보를 너무 많이 노출하고 있다는 생각이다. 거의 위치정보(edge, corner 등)까지 state로 날려주고 있기에 (코드 공개는 안되어있지만 CVPR conference base code에서 state를 제공하고 있음) 과연 zero-shot task로 봐도 될지는 잘 모르겠음.

그리고 그렇게 구체적인 state를 날려준거에 비해 성능 개선 폭이 매우 뚜렷하지 않았던 점도 아쉬움. table 7을 보면 PCB같이 state의 효과가 컸던 class들만 보여주고 있고 전체 class에 대한 성능은 supplymentary에서도 찾아볼 수 없는데, 전체 평균 성능 향상 폭에 비해 특정 class의 성능 향상 폭이 훨씬 크므로 어떤 class들에 대해서는 구체적인 state가 오히려 성능 저하를 야기했을 것으로 보임. 그래서 과연 이 논문에서 제시하는 prompt engineering이 anomaly detection에 매우 효과적인 방법론일지는 조금 의구심이 들음.

또한, 구체적인 prompt를 사용하는거에 비해 CLIP 방법론과 동일하게 모든 class별 임베딩을 평균내버려서 클래스 당 하나의 평균 prototype vector를 구해서 이 representation vector로 similarity를 구해가기 때문에 구체적인 prompt를 잘 활용하고 있지 못하는 것으로 보임. 그래서 차라리 앞단에서 바로 평균내지 말고, 좀더 다양한 조합으로 similarity를 구하고 나서 뒤쪽에서 통합하는 방식으로 실험해보는 것도 성능 개선에 도움이 되지 않을까? 하는 생각이다. (물론 연산량은 매우 많아질듯)

[30] Learning Token-Based Representation for Image Retrieval

Abstract

  • To generate compact global representations while maintaining regional matching capability, we propose a unified framework to jointly learn local feature representation and aggregation.
  • In our framework, we first extract deep local features using CNNs. Then, we design a tokenizer module to aggregate them
    into a few visual tokens, each corresponding to a specific visual pattern. This helps to remove background noise, and capture more discriminative regions in the image.
  • Next, a refinement block is introduced to enhance the visual tokens with self-attention and cross-attention.
  • Finally, different visual tokens are concatenated to generate a compact global representation. The whole framework is trained end-to-end with image-level labels.

image
여기서는 CNN 백본을 써서 deep local representation F를 얻는다. 이러한 local features는 input image에 대해 limited receptive field를 가질 것이다. 따라서 Local Feature Self-Attention을 수행해서 context-aware local features를 만든다.
그리고 spatial attention mechanism에 의해 L개의 그룹으로 나누고 각 그룹의 local feautres를 aggregate해서 visual token t를 형성한다.

이 T를 업데이트하는 refinement block을 둔다. 최종적으로 모든 visual token들이 concat되고 차원을 줄여서 final global descriptor를 만든다. ArcFace margin loss로 학습한다.

Tokenizer

noisy backgrounds, occlusions과 같은 데이터에서는 이미지 간의 patch-level match가 중요하다. 여기서도 1x1 conv layer를 두어서 local features F에 대해 attention map을 얻는다.
image

Relation to GMM

Gaussian Mixture Model, GMM과 유사하다. GMM은 모든 데이터 포인트가 unknown 평균 벡터와 데이터 분산을 가진 a mixture of a finite number of Gaussian distributions 에서 생성되었다고 가정하는 확률 모델임.

image
image
image

Eq. (3)의 σ는 1로 설정하고 p(z = j)를 φ(kwik^2)로 설정한다. a(i)h,w는 local feature F_c h,w를 i번째 visual pattern에 soft cluster assignment로 해석할 수 있으며, 이는 p(z = j|fi)의 의미와 동일하다.

Refinement Block

  1. Relation modeling
    Tokenizing 중에 다른 attention maps가 별도로 사용된다. 서로 다른 visual token 사이의 relationship을 모델링하기 위해 self-attention을 써서 relation-aware visual tokens를 만든다.
    image
    visual token을 Q,K,V로 매핑하고 MHSA으로 토큰 간 silimarity S를 계산한다. head별로 계산해서 aggregate하고 learnable projection을 시킨다.
  2. Visual token enhancement
    cross-attention으로부터 feature를 뽑음. F_c를 시퀀스로 펼치고 각각 다른 FC layer를 써서 Q,k,v와 매핑하고 visual token과 Original local feautres 간의 similarity를 계산한다.
    image
    image

[34] Rethinking Visual Prompt Learning as Masked Visual Token Modeling

Abstract

  • NLP에서 Large-scale pre-trained model을 활용해서 prompt learning을 하는 것이 성공적이었다. 이 경우 downstream task를 generative pre-training으로 reformulate한다.
  • 하지만, vision의 경우 visual prompt learning 방법론들이 discriminative pre-trained model로 디자인되었기 때문에 pre-training과 downstream task 간의 통합을 위한 careful design이 부족하고 pre-training과 downstream task 간 통합이 부족했다.
  • 본 논문에서는 Visual Prompt Learning을 masked visual Token Modeling(VPTM)으로 보고 downstream visual classification을 pre-trained masked visual token prediction으로 전환한다.
    • prototypical verbalizer를 두어서 implicit semantics인 predicted visual token을 explicit downstream label로 매핑한다.
    • VPTM은 최초로 generative pre-trained visual model에 대한 visual prompt method이며, task reformulation을 통해 최초로 pre-training과 downstream visual classification 사이의 consistency를 수행한다.

Introduction

image
  • NLP 에서는 'Pre-train, then fine-tune' 패러다임에서 'pre-train, prompt, then predict' 패러다임으로 변화하였다. (different task-specific objective를 설계해줘야 해서 prohibitive 하다는 문제가 있었기 때문)
  • GPT3과 같이 generative pre-trained models를 바탕으로 downstream task를 마치 pre-training language modeling tasks로 해결한다.
  • 이러한 방식으로 pre-trained modeld의 knowledge는 pre-training tasks와 동일한 objectives를 활용하게 된다.
image
  • 이에 대한 예시로 Masked Language Modeling(MLM) pretrained task에서 classification task에 대해 'cloze prompt'로 reformulate된다.

  • input에 mask prompt를 넣고 prompt tuning을 수행하고 masking 된 부분의 단어를 맞추고 verbalizer를 통해 predicted words를 downstream label과 매칭한다.

  • VPT의 경우 ViT에 prepend하는 식으로 discriminative 방식으로 설계되었고 Visual prompting의 경우 CLIP을 써서 visual prompt learning을 수행한다. 하지만 task reformulation을 통해 pretraining과 downstream applications를 통합하기 위해 consistency를 달성하는 연구는 시도되지 않았다.

[9] DenseHybrid: Hybrid Anomaly Detection for Dense Open Set Recognition

0. Abstract

  • 기존 Anomaly detection에 존재하는 한계

    Anomaly detection은 크게 regular data로 generative modeling하는 방법, negative training data에 대해 discriminating 하는 방법으로 구분지어 생각할 수 있다. 그런데 이 두가지 접근은 각각 다른 failure mode를 가진다. 따라서 본 논문에서는 이 둘을 합치는 하이브리드 알고리즘을 연구 목표로 한다.

본 논문은 3개의 dense prediction을 recover하는 shared convolutional representation을 기반으로 한다.

  1. The closed-set class posterior P(y|x) (기존 방식)
  2. The dataset posterior P(d_in|x) (추가)
  3. Unnormalized data likelihood P^(x) (추가)

이 때 2,3번은 standard training data, generic negative dataset 둘 다에서 학습된다.

이렇게 해서 얻은 두 prediction에 의해 하이브리드 anomaly score를 산출해서 natural image에 대해 dense open set recognition을 수행할 수 있다.

  • Loss function

    custom loss 설계를 통해 backpropagation 시에 다루기 힘든 normalizing constant Z(θ)를 피함.

  • Evaluation Metrics

    Open-mIoU(dense open-set performance를 위한 새로운 평가지표) 제시함.

1. Introduction

  • 해결해야 할 문제

    현대 딥러닝의 standard training procedure은 closed-set이기 때문에 심각한 안전 문제를 일으킬 수 있다. 예를 들어 unknown object가 도로에 등장했을 때 misclassification하게 되면 자율주행 자동차는 심각한 사고로 이어질 것이다. 이런 위험은 dense anomaly detection으로 semantic segmentation을 보완하여 완화할 수 있다. 실제 세계에서는 dense open-set recognition은 anomalous pixel에 대해 decision을 reject 할 수 있기 때문에 더욱 적합하다.

image

  • 기존 연구들과 그 한계점

    • Generative approaches (density estimation이나 image resynthesis)
      • inaccurately disperse the probability volume
      • rely on risky image resynthesis
    • Discriminative appraches (classification confidence, binary classifier, Bayesian inference를 기반으로 함)
      • 전체 input sapce에 대해 학습하는 것을 가정하기 때문에 unknown unknowns까지 포함될 수 있다.
  • 본 논문에서 극복

    이 연구에서는 두 접근법을 hybrid anomaly detector로 합친다. 두 가지 추가적인 예측으로 standard semantic segmentation model를 보완한다. (closed set 하에서의 class posterior 뿐만 아니라 거기에 이 두개 추가)

    1. Unnormalized dense data likelihood p^(x)
    2. Dense data posterior P(d_in|x)

    두 예측은 모두 negative data를 써서 학습시킨다. 두 output을 join함으로써 정확하면서도 효과적인 dense anomaly detector DenseHybrid를 만든다.

  • Contribution

  1. Pixel-level에서 end-to-end learning을 가능하게 하는 최초의 하이브리드 anomaly detector를 제안한다.
  2. likelihood evaluation, off-the-shelf negative dataset을 활용한 discrimination 이 둘을 합친다.
  3. 우리의 실험은 minimal computational overhead임에도 불구하고 정확한 이상 탐지를 한다.
  4. novel performance metric open-mIoU로 SOTA를 달성한다.

image

2. Related Work

(기존 연구들의 한계를 잘 짚어주어서 이 파트도 정리해 보았음)

Training data에서 벗어난 데이터를 탐지하는 것은 수십년 된 문제이다. machine learning 커뮤니티에서는 anomaly detection 또는 Out-of-distribution detection으로도 알려져 있다.

  • Early Image-wise approach

    초기 image-wise approach에서는 max-softmax probability, input perturbations, ensembling, Bayesian uncertainty 등을 사용했음. 이후에는 broad negative dataset을 사용하거나 생성 기반 모델들로 학습시킨 데이터로부터 구분되게 학습하는 방식들 등이 좋은 성능을 보였음.

  • Generative approach

    • 또 하나의 접근 방식은 Generative model에서 likelihood를 추정하는 것임.
    • 이 방식은 anomalies가 inliers보다 더 높은 likelihood를 가질 수 있다는 문제가 있다.(Calibration문제 라고도 함)
    • 추가 연구에 따르면 group-wise anomaly detection에서 더 나은 성능을 기대할 수 있지만 실질적으로 중요한 문제는 아님.
    • 생성 모델은 negative training data에서 낮은 likelihood를 할당하는 방향으로 학습할 수도 있는데, 이 방법이 probability volume의 sub-optimal dispersion 문제를 완화해 줄 수 있음.
  • Image-wide anomaly detection approach

    • 기존 생성 접근 방식은 dense likelihood estimate를 할 수 없었던 반면 max-softmaxnegative data로 discriminative training을 하는 방식은 dense prediction에 쉽게 적용할 수 있음.
    • 많은 dense anomaly detector는 일반 training data에 negative data를 붙여서 mixed-content images로 학습됨.
    • Standard classification head와 features를 공유하는 OOD head에 의해 discriminative anomaly detection이 가능해짐. Shared feature는 OOD performance를 개선하고 baseline semantic segmentation model과 관련해 neglectable compuational overhead를 발생시킨다는 장점이 있음
    • 최근 negative pixel에 대해 large softmax entropy를 갖게 하는 연구도 존재함.(Entropy maximization and meta classification for out-of-distribution detection in semantic segmentation, ICCV (2021))
  • Other approach

    • Anomalies는 feature space에서도 recognize될 수 있지만 subsampled된 feature representationfeature collapse로 인해 작은 물체 감지를 잘 못한다.
    • 이전 접근 방식과 달리 input과 resynthesised image 사이의 dissimilarity에 따라 anomaly detector를 구현할 수 있다. 그러나 이 방법은 도로와 같은 균일한 배경에만 적잡하고 상당한 계산 오버헤드로 인해 실시간성이 떨어진다는 문제가 있다.
  • Our approach

    • 본 논문의 접근은 Discriminative detection과 likelihood evaluation의 hybrid combination이다. Discriminative OOD detection에 대한 기존 연구들도 있지만 그 접근들과는 달리 likelihood testing와의 시너지 효과를 통해 discriminative OOD detection을 개선함.
    • dense likelihood evaluation은 generative model을 discriminative feature에 fitting시키는 방식으로 수행되어 옴. 하지만 이 접근 방식은 two-phase training으로 인해 feature collapse에 취약하다. 또 작은 이상의 감지는 subsampling으로 인해 불안정해짐.

    → 따라서 기존 접근방식과는 달리 우리는 standard dense prediction model과 full resolution에서의 anomaly detection의 joint training을 수행함.

3. Method(Dense Recognition with Hybrid Anomaly Detector)

간단하게만 설명하면, standard dense classifier를 Dense Open-Set Recognition model로 확장해서 만들고 이 모델은 mixed content image로 학습된다.

3.1. Hybrid Anomaly Detection for Dense Prediction

Discriminative model P(y|x) = softmax(fθ2 (qθ1 (x)))에 의해 생성된 logits s으로 reinterpretation 한다. 즉 아래와 같이 input x와 label y의 unnormalized joint log-density로 reinterpret한다.
image
이 때 Z는 normalization constant를 나타낸다. 보통 이 Z를 계산하려면 모든 x,y에 대한 unnormalized joint density를 평가해야하므로 intractable하다. 이 연구는 효율적인 학습과 inference를 위해 z evaluation을 피한다.

어떻게 피하냐면, Standard discrimination prediction은 베이즈 룰에 의해 다음과 같이 표현할 수 있다.
image
따라서 unnormalized joint density (1)을 recover할 수 있고 primary discriminaive task와 logit을 공유할 수 있고, pretrained classifier를 이용할 수도 있다.

y를 marginalizing out 하여 dense likelihood p(x)를 아래와 같이 표현할 수 있다.
image
여기서 p(x)를 바로 구하는 걸 생각해 볼 수 있다. p(x)보다 낮으면 thresholding 해서 anomaly라고 분류하는 것이다. 그러나 이 방법은 당연히 over-generalization 문제가 있다. (outlier임에도 inlier보다 더 큰 likelihood를 갖게 될 수도 있다는 문제가 있다.) 그래서 학습 시에 negative data를 추가로 사용해서 likelihood를 최소화하는 방향으로 위 문제를 해결한다.

logit reinterpretation외에도 dataset poseterior P(d_in|x)에 non-linear transformation을 적용한다.

image
본 논문의 경우, 함수 g는 pre-logit에 적용하는 BN-ReLU-Conv1x1이고 이후에 non-linearity 함수 sigmoid를 통과한다. Anomaly는 오직 P(d_in|x)이 부분에서만 Detection 된다. inlier sample이면 높은 posterior를 가져야 하는데 실험을 통해 이 방식은 하이브리드 접근 방식에 비해 차선임을 보여준다. (아래 fig2)

image
fig 2는 toy problem에 대한 discriminative, generative detector의 단점을 보여준다. 파란색 점은 inlier data, 초록색 점은 negative data, 빨간색 점은 anomalous test data를 나타낸다. negative data가 sample space를 충분히 커버하지 못하는 경우 모델 P(d_in|x)은 inlier를 잘 구분하지 못한다.(왼쪽)

반면에 P(x)를 모델링하는 generative detector는 공간 중앙에 probability volume을 잘못 분배하는 경향이 있다. 하이브리드 모델에서 두 방식을 결합함으로써 앞선 두 문제를 해결한다.

본 논문에서의 하이브리드 모델은 P(d_out|x), p(x) 사이의 log-ratio 이다.
image

  • Z를 무시할 수 있는 이유
    : ranking performance는 monotonic transformation(ex. logarithm, adding a constant)에 불변하기 때문이다. 다른 수식도 효과적일 수 있으며 이는 향후 흥미로운 해결 방안이다.

3.2. Dense Open-Set Recognition based on Hybrid Anomaly Detection

image
Fig 3에서 제안하는 open-set recognition setup에서의 inference 과정을 표현하였다.

  1. 먼저 RGB input이 hybrid dense model을 통과해서 pre-logit activation t와 s를 만든다.
  2. 그리고 closed-set class posterior P(y|x)=softmax(s) 를 구한다. (사진에서 노랑색)
  3. unnormalized data likelihood p^(x)도 구한다. (사진에서 초록색)
  4. 별개의 head g는 pre-logits t를 dataset posterior P(d_out|x)로 바꾼다.
  5. anomaly score s(x)는 마지막 두 분포 사이의 log ratio이다. (likelihood, data posterior)
  6. 최종 anomaly map은 threshold 되고, discriminative output과 합쳐져서 최종 dense open-set recognition map이 된다.
  • Discriminative Loss
    image
    (7)번 식이 closed world에서의 standard training에 해당되는 수식이다. 여기에 negative data D_out을 추가로 활용해서 P(d_in|x), p(x)를 설계하는데, negative pixel에 대해서는 저 두 값이 모두 낮은 확률값을 가져야 한다. 따라서 inlier에 대해서는 p(x) 즉 likelihood를 최대화, outliers에 대해서는 likelihood를 최소화하는 방향으로 학습한다.

본 논문에서는 loss의 upper bound를 다음과 같이 설계해서 normalization constant z를 피한다.
image
이렇게 (7),(12) 식을 비교했을 때 standard classification loss를 최소화하면 inlier pixel의 p(x)를 증가시키는 경향이 있지만 softmax output의 negative logarithm을 쓸 경우 correct class의 logit값을 키우는 경향이 있다.

또, p(x)는 inlier에 대해서만 학습시킬 수 있는데 이 방식은 Z를 approcimation하기 위해 MCMC sampling과 backpropagation을 거쳐야 하는 문제가 있다. 큰 이미지에 대해서는 사실상 불가능하다고 보면 됨.

따라서 본 논문에서는 hallucinate 대신에 negative samples를 활용해서 loss를 설계했다.
image
(15)처럼 joint loss로 설계해서 two phase가 아닌 하나의 loss로 통합하여 학습시킨다. 이 때 베타 하이퍼파라미터로 negative data의 영향을 조절할 수 있다.

image
fig 4는 학습 과정을 설명한 그림이다. Standard training 이미지에 negative object를 붙여서 만들어진 Mixed-content image가 Open Set recognition model에 들어간다. 각각의 output은 compound loss에 의해 최적화된다.

4. Measuring Dense Open-set Performance

본 논문에서는 Open-Set 성능 평가를 위한 open-IoU 메트릭을 새롭게 제시했다.
image
image

fig 5는 Open world confusion matrix를 보여준다. 부정확한 anomaly detection은 FP(노랑색), FN(빨간색)의 증가로 인해 영향을 받게 된다. (closed mIoU와 k inlier class에 대한 averaged open-IoU의 차이는 inaccurate anomaly detection 성능을 나타낸다. )

위 open_IoU로 성능을 측정하려면 K+1 labeled dataset으로 구성해야 한다. (ex. StreetHazards dataset)

[27] Token-Label Alignment for Vision Transformers

Abstract

  • While they are shown effective for vision transformers(ViTs), we identify a token fluctuation phenomenon that has suppressed the potential of data mixing strategies(e.g., CutMix).
    • We empirically observe that the contributions of input tokens fluctuate as forward propagating, which might induce a different mixing ratio in the output tokens.
  • To address this, we propose a token-label alignment (TL-Align) method to trace the correspondence between transformed tokens and the original tokens to maintain a label for each token.
    • We reuse the computed attention at each layer for efficient token-label alignment, introducing only negligible additional training costs.

Introduction

  • We find that self-attention in ViTs causes a fluctuation of the original spatial structure.
    • CNN의 경우 global label consistency가 보장되는 translation equivalence와 달리, ViT의 self-attention은 global consistency를 약화시키고 token과 label간 misalignment를 발생시킴
    • 이러한 misalignment로 인해 output token의 mixing ratio가 달라지게 되기 때문에 original data mixing straties로 연산되는 training target이 부정확해질 수 있고 결과적으로 ineffective training이 됨.
  • 이를 위해 token-label alignment(TL_Align) method for ViTs를 제안해서 학습 시 더 정확한 target을 얻음.
    • 먼저 token source에 따라 각 input token에 대해 레이블을 할당함.
    • input token과 transformed token 간의 correspondence를 추적하고 그것을 바탕으로 레이블을 align 함.
    • 이 때 channel MLP와 layer norm은 각 token을 독립적으로 처리하기 때문에 self-attention과 residual connection 만이 input token의 presence를 변경한다고 가정한다.
    • transformed tokens를 만들 때 input token의 label을 linearly mix할 때 계산된 attentions를 재사용한다.
    • Class-token based classification같은 경우 tarining target으로 output class token으로 aligned label을 직접적으로 사용한다.
      image

Method

ViT모델의 경우 input-dependent weights가 flexibility하게 만들지만, processed token과 initial token간의 mismatch를 일으키기도 한다. 이를 위해 token-label alignment 방식을 제안해서 input과 transformed token간 trace를 수행해서 aligned label을 얻는다.
image

구체적으로, ViT는 처음에 mixed input을 패치로 쪼개고 flatten 시켜서 토큰화한다. projection을 수행하고 positional embedding을 더해준다.

  • label Initialization
  1. 먼저 각 token에 class에 대한 label 임베딩을 할당해준다.
    이 때 label 임베딩은 class 수 C만큼에 대한 확률 분포를 나타낸다. (yi: i번째 토큰이 해당 클래스에 속할 확률, 이들의 합은 1

    • Class token

      • CutMix로 X1, X2를 섞는 경우, class token은 mixing ratio를 고려해서 initialize 됨. (즉, 클래스 j와 클래스 k에 속한 이미지를 혼합하는 경우, ˜ycls,j는 λ로 초기화되고, ˜ycls,k는 1 - λ로 초기화)
    • Patch token

      • 해당 패치가 X1에서 오면 ˜yi,j = 1로 , X2에서 오면 ˜yi,k = 1로 초기화.
      • 만약 패치가 mixed images를 포함하는 경우 mixing ratio를 label로 씀.
      • For MixUp, we can simply set all label embeddings {˜yi} with ˜y,j = λ and ˜y,j = 1 − λ.
  2. Spatial Mixing
    image
    layer-wise manner로 TL-align을 수행한다.

    • Q,K,V를 사용해서 Attention matrix A(Q,K)를 계산함. 이 A는 토큰 간 spatial mixing을 만드는 과정임. 즉 A는 token과 label 간의 consistency를 나타냄.
  3. Label Alignment

    • 이 메트릭스 A를 사용해서 label을 alignment함.
      image
  4. MSA
    image
    MSA연산을 head별로 수행하면, 각 attention matrix에 대한 head 별 평균을 계산해서 label alignment를 수행함.
    image
    image

  5. Transformer block
    image
    spatial & clannel mixing을 수행해서 token을 처리함. (Laner norm, MLP)

  6. Hierarchical Vision Transformers, Patch merging
    패치를 채널 방향으로 concatenate하지 않고, 레이블 임베딩을 추가한 후 normalization를 수행하여 레이블을 align 함

TL-Align은 각 레이어에서 레이블과 토큰을 algin해서 consistency를 유지함. 이미지의 최종 representation은 class token이나 모든 spatial token의 average pooling으로 얻음. (모델 구조마다 다름)

[15] Object Discovery via Contrastive Learning for Weakly Supervised Object Detection

(포항공대에서 작성한 논문임)

Abstrack

Weakly Supervised Object Detection(WSOD)는 오직 image-level annotations만으로 학습한 모델을 사용해서 이미지의 objects를 detection 하는 task이다. 최근 SOTA 모델들은 self-supervised instance-level supervision을 활용하지만, weak supervison은 count나 location information을 포함하지 않고 대부분 argmax labeling method를 사용해서 종종 objects의 많은 instance를 무시하게 된다. 이를 완화하기 위해서, 본 논문에서는 'object discovery'라는 multiple instance labeling method를 제안한다. contrastive loss를 통해 sampling시에 어떠한 instance-level information도 사용 불가능한 weakly supervised contrastive loss(WSCL)을 제안한다. 이 loss를 통해 같은 class에 해당하는 embedding vector는 consistency를 가지도록 object discovery를 위한 credible similarity threshold를 구성하는 것을 목표로 한다.

Introduction

Object detection task에서 fine-grained object bounding box annotation을 large dataset에 대해 다 확보하는 것은 너무 time-consuming하다. 따라서 좀더 cost-efficient annotations를 마련하기 위한 시도인 WSOD task가 있었다. (이 때 이미지, point, scribble labels를 사용함.)
그러나, WSOD에서의 한게는 fully-supervised counterparts보다 성능이 여전히 한참 못미친다는 점이다. 여기서는 에 대한 이유를 3가지 정도로 분석했다.
image

  1. Part domaination : WSOD 모델은 오직 object의 discriminative part에만 집중하기 때문에 근본적으로 WSOD task가 Multiple Instance Learning (MIL) problem에서의 local minima를 불러일으킨다.
  2. Grouped Instances : 같은 카테고리들은 one large proposal로 그룹핑된다. image-level lannotation은 객체의 위치나 개수에 대한 정보 없이 class에 대한 정보만 있기 때문에 단순히 highest-score propoasl를 "pseudo groundtruth"로 간주한다. 이 방법은 false-positives를 피할 수는 있지만 object가 누락되어 less-obvious instances는 무시되는 경우가 많다.
  3. argmax-based 알고리즘은PASCAL VOC 기준 12608개 중에서 7306개 (40%), MS-COCO 데이터 기준 894204 중에서 533396개(60%) missing되는 결과를 보였다.

본 논문에서의 해결

  • Explores all proposed candidates using a similarity measure to the highest-scoring representation.
  • We further suggest a weakly supervised contrastive loss (WSCL) to set a reliable similarity threshold.
  • WSCL encourages a model to learn similar features for objects in the same class, and to learn
    discriminative features for objects in different classes.
  • We provide a large number of positive and negative instances for WSCL through three feature augmentation methods suitable for WSOD.
    -> well-behaved embedding space를 확보함으로써 더 사실적인 pseudo groundtruths를 만들 수 있다.

Method

image

Multiple Instance Learning Head

위 fig2를 보면, RoI feature vectors를 input으로 넣으면 classification scores와 detection scores를 반환한다. (이 classification score에 softmax 함수를 씌워서 구하고 detection score는 region을 따라 구한다.) Proposal scores는 classification, detection score의 element-wise product 연산 결과이다. c번째 class에 대한 image score는 모든 region에 대한 proposal score를 합친 값이다.
image-level의 classification loss L_mil 수식은 아래와 같다.
image

Refinement Head

refinement head의 역할은 instance-level supervision을 통해 self-supervised training strategy를 통합하는 것이다. M개의 proposal이 있고 C개의 class가 있으면 background class까지 추가해서 C+1 개의 class를 둔다. K-th stage에서의 Instance-level supervision은 이전 stage에서 결정된다. 예를들어 첫 번째 instance classifier는 MIL head output을 supervision 삼는다. Instance-level pseudo labels는 해당하는 proposal을 충분히 높은 스코어로 overlap하고 있으면 1, 아니면 0으로 결정한다. 이 때의 threshold는 0.5이다.

image

classification loss는 위와 같이 정의된다.

[23] A Zero-/Few-Shot Anomaly Classification and Segmentation Method for CVPR 2023 VAND Workshop Challenge

Abstract

  • 본 연구는 이상 탐지를 위해 extra linear layer를 추가해서 CLIP 모델을 활용하는 솔루션을 제안한다.

Introduction

  • State/template ensembles를 통해 text prompts를 만든다.
  • Abnormal region localization을 위해 extra linear layer를 학습해서 image features를 text features가 위치한 linear space상에 매핑시킨다.
  • Few-shot case의 경우, zero-shot phase에서의 extra linear layer를 retaion해서 weight을 그대로 쓴다. 추가로 이미지 인코더를 서서 reference image로부터 feature를 뽑고 메모리 벵크에 저장해서 test image들과 비교한다.
  • Shallow / deep features의 장점을 온전히 가져가기 위해서 zero/few shot 셋팅에서 모두 다른 stage의 features를 활용한다.

Method

image

2.1 Zero-shot AD setting

  • Anomaly classification

    • text prompt ensemble strategy: state-level에는 excessively detailed description 말고 generic text를 적용했다. (ex. flawless, damaged 등) 그리고 template-level에서는 ImageNet CLIP에서 쓴 85개의 template 중에서 이상탐지에 적합하지 않은 템플릿은 제거해서 사용했다.
      image
      text encoder에서의 지막 층에서의 text features를 평균내고 이미지 feature와 곱해서 이상 확률값을 얻는다.
  • Anomaly Segmentation

    • 이미지랑 text feature 간의 유사도를 계산해서 anomaly map을 만드는 것이 일반적인데, CLIP 모델은 분류를 이해 디자인되었기 때문에 이미지 feature가 joint space 상에 잘 매핑되지 않는다. 즉, space 상에서 text feature와 직접적으로 비교할 수 없는 것이다.
    • 따라서 본 논문에서는 이 이미지 feature들을 joint embedding space상에 mapping시키기 위해서 별도의 linear layer를 학습해서 text features와 비교할 수 있는 방법론을 제안한다.
    • 이미지 인코더의 얕은 층과 깊은 층의 distinct features를 활용한다.
    • ViT에서 모든 층을 4 stage로 나누고 각 stage에서 linear layer을 두어서 output feature를 joint embedding space로 매핑한다.
      image
      (2)에서 F는 패치 토큰 feature를 의미하고 k,b는 각각 해당하는 linear layer의 weight,bias를 의미한다.
      stage별로 anomaly map을 얻고 나서 모든 stage를 다 더한다.
      image
  • Losses
    linear layers를 학습시킬 때 linear combination of focal loss, dice loss로 supervise해서 anomaly map을 예측함

2.2 Few-shot AD setting

  • Anomaly Classification
    1. zero-shot setting과 마찬가지로 text prompt로부터 guied한 anomaly score
    2. maximum value of the anomaly map
      이 두 파트를 모두 최종적인 anomaly score로 썼다.
  • Anomaly Segmentation
  • Training: CLIP 이미지 인코더에 refenece image(few개)를 feed해서 feature를 뽑아서 stage 별 메모리뱅크에 넣는다. 이 때 인코더에서의 multi-layer feature를 저장한다.
  • Test: test이미지도 이미지 인코더에 태우고 각 stage 별로 메모리뱅크 reference feuatres들과 cosine similarity를 구해 anomaly map을 구한다.

image
그다음 모든 anomaly map을 합친다. 이렇게 만들어진 식 4에서의 anomaly map은 zero-shot 에서 구한 anomaly map이랑 합쳐진다.
여기서 중요한 건, few-shot의 경우 reference image를 가지고 linear layer를 fine-tuning하지 않고 zero-shot 셋팅에서 얻은 weights를 그대로 활용한다는 점이다.

[36] Zero-Shot Anomaly Detection via Batch Normalization

Abstract

  • normal training data에 drift가 생기는 상황, 특히 new normal에 대한 training data가 없는 상황을 위해 zero-shot AD setting이 개발되어 오고 있음.
  • off-the-shelf deep anomaly detectors(such as deep SVDD)를 adapt시켜서 inter-related training data distributions in combination with batch normalization을 통해 unseen AD에 대한 zero-shot generalization 성능을 확보함.

Introduction

  • We propose Adaptive Centered Representations (ACR), a lightweight zero-shot AD method that combines two simple ideas: batch normalization and meta-training.
    • 가정: "normal" sample의 majority를 가정하면서 randomly-sampled batch에는 abnormalities보다 normalities가 더 많을 것이다.
    • Batch normalization을 수행함으로써 이 normal sample을 center로 가도록, abnormal sample은 바깥쪽으로 가도록 함.
    • 이런 scaling and centering 방식은 input의 domain shift에 강건하기 때문에 self-supervised anomaly detector가 학습 시 보지 못한 distribution을 만나더라도 generalize 되게 해준다.
    • meta-training scheme도 제안함.
    • 이런 ACR 방식의 장점은 theoretically grounded, simple, domain-independent, and compatible with various backbone model 라고 주장함.

Method

  • adaptive batch-level AD를 통해 1) normal과 abnormal 간의 discriminations를 가능하게 하고 2) common frame of reference를 통해 서로 다른 분포로부터 데이터를 가져오기 때문에 unseen distribution에 generalize할 수 있다.

image
fig1 처럼 학습때 보지 못했던 geese를 lion 사이에서 찾아내는 것이다. DSVDD를 통해 임베딩 스페이스 상에서 pre-specified point로 매핑하고 그 포인터로부터의 거리를 기반으로 scoring한다.

  • 주로 zero-shot learning이나 meta-learning에서 쓰이는 interrelated data ditribution으로 meta-training set을 구성한다.
  • 이 때 inter-relatedness는 k개의 training distribution이 있고 meta distribution으로부터 *개의 test distribution을 샘플링해옴.
    image
    image
    이렇게 배치 샘플을 conditioning 함으로써 context에 대한 reference를 반영한 anomaly scoring이 가능해지며 distributional information을 반영할 수 있음. (배치 내 context 상에서 고양이가 정상일 수 있지만 강아지 이미지 배치 사이에서는 이상일 수 있음)

그럼 어떻게 batch-level information을 anomaly detection에 conjuction할 수 있을까?

몇 가지 가정이 필요함

  1. 항상 meta-training set에 available 하다고 가정 (meta-set으로 re-training없이 adapt가 가능)
  2. Batch-level anomaly detection (test 시에 batch-level prediction이 이루어짐.)
  3. Majority of normal data (모든 i.i.d sampled test batch 마다 정상 데이터가 주를 이룬다고 가정)
    Test 시에는 abnormaly labels가 없기 때문에 가정 2,3 없이는 정확한 inference가 불가능함.

Adaptively Centered Representations

  • Batch Normalization as Adaptation module
    • parameter-free zero-shot batch-level anomaly detector로써 batch normalization을 적용 (평군 0, 분산 1로)
      image
    • 평균은 가정 3에 의해 대부분의 배치에서 정상 데이터가 훨씬 많다. 만약 x가 informative한 feature space 상에 있다면 이상은 평균과 비교해서 더 먼 거리에 있게 되는 간단한 방식임.
    • 하지만 사실 일반적으로 정상 샘플은 original data에서 평균 주변에 집중되지 않는다고 함.
    • 따라서 이 아이디어를 DNN에 통합해서 zero-shot adaptively centered representation을 학습하는 법을 배움.

Training Objective

  • 학습할 때 batchnorm으로 optimization convergence를 수행함.
  • 최적화하는 loss가 anomaly score 자체이다. (배치에 대한 평균)
    image
  • 일반적으로 loss는 DSVDD, neural transformation learning (NTL)이 있음.
  • 이게 가능한 이유는, batch normalization은 서로 다른 분포의 데이터 배치를 re-calibrate 하는 데에 도움이 된다. 정상 데이터는 origin 주변에 몰리게 됨.
  • 이러한 calibration은 low-level에서 ligh-level features로 이어지면서 powerful feature learning, adaptation ability를 갖게됨.
    image
  • 따라서 eq.5를 optimize하게 되면 모든 k개의 different training distributions에 adapt 될 수 있고, unseen에 generalize 될 수 있다.

Meta Outlier Exposure

  • eq5에서 더 개선하기 위해 meta-data에 속하지 않는 다른 분포로부터 데이터를 뽑아와서 씀.
  • synthetic anomalies가 학습 시 normal data에 대한 tighter decision boundary를 만드는 데 쓰일 수 있다.
  • 각각의 P 분포에 대해 mixture distribution 수행
    image
  • admixed anomalies를 위한 additional loss 구성함
    • 일반적으로 많은 anomaly scoring은 inversely하게 score를 구성해서 정상 샘플에 대해서는 크고, 이상치에서는 작을 것
    • 하지만, 이 때 두 점수가 동일한 파라미터를 공유함.
    • DSVDD에서는 1/A로 정의하지만, 여기서는 binary indicator variable y_ij를 정의함(i는 정상, 이상 여부를 의미하고 j는 P_j 즉 어떤 분포인지를 의미함)

image
위 loss는 outlier exposure loss와 유사하지만 이미지 단에서의 generated sample이 아니라 학습 시에 나온 분포로 pseudo anomaly 만듦.

Batch-level Prediction

inference시에는 batch-level prediction이 수행됨. 이때도 마찬가지로 대부분의 샘플이 정상이라고 가정하고 anomaly score에 thresholding 함. 시간복잡도는 딥러닝 프레임워크가 대부분 병렬처리가 가능하다보니 배치사이즈랑 연관되어 O(1)

image
image

meta outlier exposure 실험이랑 tabular 데이터 실험, 다른 nomalization 실험과의 비교 등은 다 supp에 있음.
image
image
image

[2] Open-Set Semi-Supervised Object Detection

paper link : https://www.ecva.net/papers/eccv_2022/papers_ECCV/papers/136900142.pdf

Introduction

본 논문에서 제안하는 방법론은 Open-Set Semi-Supervised Object Detection task이다. 기존에 Semi-Supervised object detection 모델들은 unlabeled data(open-set 카테고리 포함)을 더 많이 추가해서 학습할수록 낮은 성능을 보임을 발견했는데, 이는 기본적으로 SSL에서 unlabeled data를 더 활용할수록 좋을 것이라는 belief와는 반대되 결과이다. 이러한 현상을 semantic expansion issue라고 하며, OOD object가 high confidence를 가지고 in-distribution object로 잘못 예측하게 되고 이로 인해 pseudo-label로 잘못 사용하게 되서 성능 저하로 이어지게 되는 것이라고 주장한다. (아래 fig1 참고)

image

이렇게 OOD sample을 사용했을때 오히려 성능을 저하시키는 해로운 영향을 제거하기 위해 기존 SSOD 학습 파이프라인에 추가 OOD filtering process를 추가할 것을 제안한다. 구체적으로는 먼저 OOD filtering을 수행하기 위해 oneline OOD detector를 사용한다. 하지만 그냥 적용할 경우 bounding box localization, box classification과 같은 다른 task와의 간섭 때문에 만족스러운 결과를 보이지 못했다. 따라서 object detector와 분리된(따로 학습하는) offline detection module을 제안한다. 그리고 Self-sup DINO 모델을 기반으로 하는데, 이것의 장점은 1) pre-training Dino는 label annotation을 필요로 하지 않아 low-level setting에 적절하고 2) Online OOD 방법과 비교했을 때 pseudo-label에서 OOD object를 탐지하는 데 더 효과적이며 이는 위에서 언급한 해로운 영향을 제거한다. 3) OOd detector와 object detector가 서로 독립적이기 때문에 각각 따로 학습되고 위에서 언급한 간섭을 방지할 수 있다.

Contribution

  • 최초로 open-set semi-supervised object detection(OSSOD) task를 다루고 기존 SSOD 방법의 한계를 분석한다.
  • OSSOD task에서의 문제점을 밝히고 online 및 offline OOD detector를 제시하며 이 두 모듈간의 체계적인 비교를 제공한다.
  • 광범위한 실험을 진행함.

Semantic Expansion in Open-Set scenarios

image
image

fig3을 보면 Open-set 설정에서는 제한된 성능 향상 폭을 보임을 발견했고 이러한 원인이 semantic expansion(fig 2a) 때문이라고 주장한다. 구체적으로 말하면 OOD/novel object가 unlabeled set에 있으면, closed-set classifier(Faster-RCNN에서는 ROI head)가 high confidence를 가지고 ID object로 예측하게 되는 것이다. 이로 인해 Over-confident, incorrect OOD instance는 confidence threesholding 후에도 ID object로 분류되는 경향이 있으며 train시에 당연히 잘못된 pseudo-label을 써서 EMA update를 하기 때문에 teacher network가 더 많은 OOD를 ID로 잘못 예측하게 된다. fig 2b처럼 모델이 오래 훈련될수록 OOD의 FPR이 증가한다.

이러한 문제를 해결하기 위해 본 논문에서는 detrimental effect를 제거하는 통합 프레임워크를 제안한다. instance-level task(e.g., object detection)에서 OOD detection을 더 잘하기 위해서 online/offline OOD detectior를 모두 고려했다.
image

Online/offline을 비교한 결과, online OOD detector는 pseudo-labeling의 불안정성(classification noise) 으로 인해 성능을 저하시키고 OOD detection, object detection 두 task를 shared architecture로 설계하게 되면 sub-optimal performance를 보였다. 따라서 본 논문은 Offline OOD detection 방법론을 사용할 것을 제안한다. 즉, object detector와 OOD detector가 서로 구조상 분리되고 따로 학습된다.
이 구조의 장점은 1) 기존 SSOD 방법론들과 호환되며 2) OOD detector과 obejct detection 간의 competing task objectives를 완화한다는 점이다.

그렇다면 어떤 offline OOD detector를 쓸까?
간단하게 pretrained ViT-B를 fine-tuning 할 수 있겠지만, 이 경우 ImageNet-21k로 pretraining을 해야 하고 large amount of annotated label이 필요하기 때문에 semi-supervised setting에 적절하지 않고 불공정한 비교를 초래할 수 있다. 따라서 OOD detector로 label annotation을 전혀 쓰지 않은 ImageNet-1k 로 학습된 Self supervised DINO를 쓴다. Multi-class(K+1) training으로 DINO를 fine tuning 한 다음 OOD score를 계산한다. 여기서 K는 ID class 수이고 1은 OOD class에 해당한다.

또 이전연구들과 달리 학습에 더 많은 OOD 데이터가 있을수록 좋다고 가정하지 않는다. 따라서 사용가능한 ID labeled data만을 학습에 쓰고, 그 ID labeled data에 있는 background proposal patches를 OOD sample로 간주할 것을 제안한다.

  • 구체적으로는 ground-truth box에 따라 이미지 패치를 자르고, 배경 패치는 ground-truth boxes에 대한 IoU가 낮은 proposal boxes로부터 랜덤으로 샘플링해온다.
  • Loss는 ID 패치를 해당하는 ID foreground label로 분류하도록, 배경 패치는 OOD class로 분류하도록 cross entropy loss를 계산한다.
  • background instance를 OOD로 사용하는것은 sub-optimal이지만 OOD가 없을때 충분한 negative grad를 보인다고 주장한다.

DINO model을 fine-tuning 한 후 DINO층을 freeze하고 OOD detection을 수행한다.

1. Mahalanobis Distance

image
(2)식에서 f(x)는 패치 x를 통과시켜 DINO에서 뽑은 intermediate feature vector를 의미한다. ˜μk는 k class에 대해 추정된 평균 벡터이고 ˜Σ는 공분산 행렬이다. 이 평균과 공분산은 모두 available labeled data로부터 추정된 값이다

2. Inverse Abstaining Confidence

image
˜pK+1는 DINO classifier에서 K+1 th class의 prediction confidence이다.

3. Energy Score

image
(4)에서 T는 temperature value, k는 class 수, fi(x)는 logit을 의미한다. Energy loss 말고도 shannon entropyEuclidean Distance도 고려해서 실험했다. threshold를 정해놓고 이것보다 낮으면 OOD sample로 간주했다.

Integration with Semi-Supervised Object Detection

pseudo label에서 OOD object를 필터링하는 것을 목표로 fig4처럼 confidence threshold를 거친 이후에 OOD filtering을 추가해서 trained OOD detector를 SSOD 방법과 통합한다. 즉, pseudo-boxes는 Teacher모델의 predicted boxes에 confidence threshold, OOD filtering을 순차적으로 적용한 다음 (3)으로 student 모델을 학습한다. Teacher-Student Framework에서 Teacher model은 weakly-augmented unlabeled data를 input으로 해서 box prediction을 뽑고 confidence thresholding을 하면 Student가 같은 이미지에 강한 augmentation을 적용해서 인풋으로 받고 consistency loss를 최소화해간다.
image
위 loss function은 supvervised, unsupervised가 합쳐져서 구성된다. ˆy이 pseudo-label을 의미한다.
이 pseudo label의 퀄리티를 높이기 위해 기존 연구들처럼 exponential moving average로 weight을 탐색한다.
(이 loss function은 일반적인 semi-supervised learning에서 주로 쓰이는 loss와 동일한 구성이다. )

Experiments

image
Table 1을 보면 모든 metric에서 Onlife OOD가 훨씬 높은 결과를 통해 object detector와 OOD detector 간의 분리가 효과적이었음을 증명한다.
image
fig 6을 보면 더 많은 OOD objects를 쓴다고 해서 더 좋은 성능을 보이지 않는다. 반면에 우리의 OOD filtering을 수행했을 시 performance drop을 막고 정확도를 개선했다.

image
개인적으로 table 2가 주목할만했는데, In-distribution data class 가 많지 않아도 성능 저하가 크지 않다는 점이다.

image
labeled data sample은 많을 수록 즉 supervision을 더 줄수록 (당연한거겠지만) 좋은 결과를 보였다.
UT는 기존 semi-supervised model인데 여기에 제안하는 self sup DINO 방법론을 결합한 결과가 더 좋은 성능을 보였다.

image
좀더 극단적인 실험 셋팅을 위해 OpenImagesv5에서 unlabeled data를 가져와서 실험을 한 결과, 놀랍게도 label을 가지고 supervision을 줘서 실험했을 때 보다 Self sup DINO가 더 좋은 성능을 보였고 이러한 원인을 human annotation에서 비롯된 noisy label 때문일 것이라고 추측한다.

Liminations and future work

(논문에 기재된 내용) 우리는 데이터셋 간의 covariate shift나 object category distribution의 mismatch등은 고려하지 않는다. 2-stage로 학습하다 보니 학습시에 컴퓨팅 리소스를 더 많이 요구한다. 물론 inference시에는 상관없긴 하다. 즉 하고싶은 말은 2-stage를 개선할 여지가 많다는 점이다. 통합 프레임워크로 잠재적인 성능 제고를 이끌 수 있는 연구가 나오기를 기대한다.

[4] End-to-End Object Detection with Transformers

paper link : https://www.ecva.net/papers/eccv_2020/papers_ECCV/papers/123460205.pdf

Q. (이 논문이 나오기 이전의) 일반적인 OD 모델들은 어떻게 작동했을까?

  • 크게 1-stage, 2-stage로 나눌 수 있다.
    • Proposals에 대한 box를 만들어서 detector 앞단에 Proposal region을 추천하는 RPN(Region Proposal Network)가 존재하는 two-stage detectors(대표적으로 faster R-CNN)
    • anchors나 사물의 중심에 대한 grid와 관련하여 예측하는 single-stage methods(대표적으로 YOLO)
  • 이러한 방법론들은 처음 guess를 어떻게 하는가에 대해 성능이 크게 좌우된다.
  • 또한, 해당 박스가 실제로 객체일 가능성을 계산한 것이 objectness score인데 threshold를 기준으로 일정 기준 이상의 score인 박스만 남겨주는 과정을 거치고 여기에 추가로 NMS(Non-Maximum Suppression) 알고리즘을 적용해 중복되는 박스를 제거한다.
  • 따라서 objectness의 threshold와 NMS 알고리즘의 기준이 되는 IoU threshold를 별도로 지정해 주는 작업이 필요하다.
    image
    NMS란 최대값을 제외한 값들을 억제하는 알고리즘이다. 여러 개의 bbox가 생기는 문제를 막기 위해 사용된다.

Q. 그렇다면 본 논문에서는?
image

  • Object detection문제를 direct set prediction 문제로 재정의함으로써 사전에 정의된 앵커 박스, NMS와 같은 hand-designed feature를 제거한다.
  • 본 논문의 방법론은 이런 손수 처리하는 수고를 덜고 anchor대신에 input image와 관련해서 absolute box prediction으로 직접 set을 detection할 수 있게 된다. 또 bipartite matching으로 loss function을 설계해서 end-to-end로 학습이 가능하다.
  • 사전에 정의된 앵커 박스를 사용하지 않기 때문에 train 데이터와 다른 결의 데이터가 test 시에 나타났을 때에도 대응 가능하다.
    (다만 사전에 object query를 정해주어야 한다. 이것도 결국엔 사전지식이 주입되는 것이 아닌가. 라는 견해들도 있음.)

Method

image
전체적인 구조는 fig 2와 같다. 충분히 큰 N개의 종류의 prediction이 이루어진다고 가정한다. 왜 충분히 큰 N개로 해야할까? 이미지에 object 종류가 총 몇 개가 있을지 모르기 때문이다. 그래서 충분히 큰 N개 종류가 있다고 가정해놓고 object에 해당하지 않는 부분은 No object로 예측한다.

그러고 나서 예측된 값과 실제 값을 이분매칭 하게 되고, 이를 최적화한다.
image

매칭된 loss값은 pair-wise한 matching cost이다. 결과적으로 sigma를 찾는 task는 최적 할당 문제로 생각할 수 있고 다시 말해 가중 이분 매칭(bipartite matching)이다. 이 과정은 hungarian algorithm에 따라 이루어진다. (bipartite matching에 관한 설명은 생략하겠다.) 이 매칭 과정은 학습과는 상관이 없다. 즉 backpropagation이 흘러가지 않는다. loss를 계산하기 전에 이분 매칭을 통해 예측값과 ground truth 간 1:1 매칭을 해준다.

해당 task를 수행하면서 결과적으로 생성되는 아웃풋은 class와 bounding box가 나온다. 그리고 bounding box는 일반적으로 중심 좌표, 높이, 너비에 한 정보를 담는다. 본 논문에서는 bounding box 관련 값들을 0과 1 사이로 normalize 한다.

image

매칭된 loss값의 수식이다. class가 잘 맞고 bounding box 또한 잘 맞춘다면 loss가 줄어드는 형태이다.
즉, classification loss, IoU loss 둘 다 최소로 해야 한다. 그런데 이 때 대부분의 정답이 no object이기 때문에 class imbalance 문제가 생겨 no object의 경우 probability term을 1/10으로 줄여주게 된다. (Fast-RCNN에서 subsampling 개념과 유사함.)

image

두 bounding box가 유사해지도록 하는 역할이다.

이분 매칭을 통해 기존 region proposal 혹은 anchor와 같은 heuristic한 방법론과도 잘 맞는다. 이분 매칭의 결과로 set prediction의 중복된 결과를 피할 수 있게 된다.

구조를 파트별로 나눠서 살펴보겠다.

  • Input
    image
    backbone CNN에 이미지를 태워 feature map을 얻고 1x1 conv를 통해 이 feature map을 d차원(256)으로 축소하고 flatten 시켜 인코더에 들어간다. 이 때 2D positional encoding 방식으로 element-wise로 feature map을 더해준다.

  • Encoder & Decoder
    image

encoder에서는 multi-head self-attention을 수행한다. Decoder에서는 object query와 encoder의 output을 입력으로 한다. 이 object query는 입력 이미지에 어떤 object가 존재하는지 query를 날리는 것이다. 구현상으로는 초기에는 랜덤하게 초기화된 embedding vector, 혹은 학습된 positional embedding vector가 들어가게 된다. 즉 정보를 받는 빈 그릇이라고 생각하면 되겠다. Decoder는 병럴적으로 인코딩되어서 해당 정보들이 기본적으로 하나의 인스턴스가 되어 prediction 하게 된다.

Encoder-Decoder attention을 통해 이미지의 어느 부분을 위주로 봐야할지 학습하고 self attention을 통해 역할을 어떻게 분배하여 최적의 1:1 매칭을 수행할 수 있을지 학습한다.

이미지의 특정 부분에서는 object query를 재사용한다. 말그대로 class 정보를 학습하는게 아니라 spatial한 정보를 학습하는 것이 object query의 역할임을 실험적으로 밝혔다.
(It turns out experimentally that it will tend to resuse a given slot to predict objects in a given area of the image.)

  • Prediction feed-forward networks(FFNs)

    • Decoder를 거쳐 최종적으로 예측되는 정보는 bounding box 예측(바운딩 박스의 중심 정보, 높이, 너비)과 class 예측이다. 이는 3-layer perceptron with ReLU를 거쳐 계산된다.
    • 만약 class가 없다면 no-object로 결과가 산출되고 이미지 상 background에 해당한다. (위 예시 그림에서 새가 두마리니까 100개의 N 중에서 2개를 제외한 나머지 98개는 모두 no object label로 할당된다. )
  • 장점

    • direct prediction을 통한 간소화
    • Transformer 구조 사용
  • 단점

    • 학습 시간 오래걸림
    • small object에 대한 탐지력은 약함
      • yolo,ssd와 같은 detector들은 multi-scale feature를 사용하지만, DETR는 한 레벨의 featuremap만 사용한다.
      • Transformer encoder의 경우 계산 복잡도가 feature map의 길이의 제곱에 비례하기 때문에 높은 해상도의 feature map을 사용하기 어려움.

image
큰 object에 대해서는 성능이 좋지만 확실히 small object에 대해서는 faster-RCNN에 뒤쳐지는 것을 볼 수 있다. CNN을 태우고 나온 이미지 중 마지막 layer를 사용하기 때문에(receptive field가 커지니까) 작은 feature에서 성능이 낮은 결과를 보였을 것이다. 따라서 multi-scale feature를 사용하면 이 문제를 해결할 수 있다. (Deformable DETR)

마치 maskformer에서 작은 물체 segmentation 성능이 안좋아서 multi-scale feauture를 쓴 mask2former와 비슷한 느낌임. (maskfomer -> mask2former / DERT -> Deformable DETR)

[18] Few-Shot Class-Incremental Learning from an Open-Set Perspective

링크 : https://arxiv.org/abs/2208.00147
코드 : https://github.com/CanPeng123/FSCIL_ALICE

Abstract

본 논문에서는 Few-Shot Class-Incremental Learning(FSCIL) 그리고 extreme data scarcity condition of one-shot을 다룬다.

슬라이드4

Introduction

슬라이드6
슬라이드7

  • 현대 딥러닝의 인기에도 불구하고 여전히 딥러닝 기술들은 큰 large-scale supervised data에 의존해서 학습한다.
  • DNN은 파라미터가 많아서 적은 샘플로 학습하면 쉽게 adapt 되지 못한다.
  • 또 conventional deep learning model들은 새로운 테스크에 대해 이전 previous knowledge를 보존하는 능력이 떨어진다. (catastrophic forgetting)
  • 본 논문에서는 Few-Shot Class-Incremental Learning(FSCIL)을 다룬다. FSCIL은 지속적으로 추가되는 새로운 taks에 빠르게 적응할 뿐만 아니라 이전에 학습한 task에 대한 기존 지식을 유지해야 한다.
  • 이상적으로 FSCIL 모델이 갖추어야 할 조건:
    1. 학습 단계에 상관없이 모든 클래스에 대해 동등하게 잘 수행해야 한다.
    2. One-shot 시나리오와 같은 extreme data scarcity에도 robust해야 한다.
  • 하지만, 현재 SOTA 방법론들은 하나의 class-wise average accuracy를 주로 사용함으로써 클래스 불균형 및 데이터 불균형으로 인한 prediction bias가 있는지 여부는 다루지 못한다.
  • 일반적으로는 incremental class보다 base class 수가 더 많고 incremental data는 수가 적다보니 base class에 편향되기 쉽다. 그리고 기존 SOTA 방법론들은 real world에 가까운 extreme one-shot setting은 거의 고려하지 않았다.

  • 본 논문은 face recognition, data augmentation으로부터 영감을 받았다.
  • base session에서 학습된 feature extractor가 카테고리에 국한되지 않게 discriminative features를 뽑을 수 있어야 한다고 생각했다.
  • 재학습 없이 새로운 identity를 다룰 수 있어야 하는 face recognition의 메인 취지가 FSCIL task에서 필요한 부분에 적합했다.
  • Data augmentation방식에서도 영감을 받아서 genaralization 능력을 높였다.

Contribution

  1. FSCIL의 현재 밴치마크 셋팅을 재평가했고 추가적인 실험 셋팅과 평가 메트릭을 제시했다.
  2. FSCIL task를 새로운 측면인 open-set 문제로 해결한다. face recognition에서 쓰이는 angular penalty loss를 분석했고 FSCIL에 적용해서 모델의 discrimination을 개선하였다.
  3. class augmentation, data augmentation, balanced data embedding이 어떻게 FSCIL 성능에 영향을 미치는지, 모델의 일반화 성능을 어떻게 높일지와 같은 데이터 처리를 분석했다.
  4. Significant improvements on three benchmark datasets, CIFAR100, miniImageNet, and CUB200, demonstrate the effectiveness of our method against SOTA methods.

Related Work

슬라이드9
슬라이드10

Method

슬라이드12
슬라이드13

간단하게 요약하면 ALICE는 angular penalty loss, class and data augmentation , data balancing을 적용했다. angular penalty loss로 feature extractor를 학습해서 compact intra-class clustering, wide inter-class seperation을 확보했다. class augmentation and data augmentation은 feature extractor의 generalization 성능을 높이기 위해 적용했다. 그리고 incremental session에서 각 클래스의 prototype을 생성하기 위해 specifically chosen balanced data를 사용했다.

Angular Penalty

슬라이드14
슬라이드15

FSCIL setting에서 continually coming new tasks에도 빠르게 적응할 뿐만 아니라 catastrophic forgetting 문제도 극복하는 안정적인 feature extractor를 얻기를 원한다. 따라서 loss는 1) intra-class feature vectors를 최소화하고 2) inter-class feature vectors 간의 거리를 최대화 해야 한다. compact intra-class clustering, wide inter-class seperation은 새로운 클래스가 incremental하게 등장했을 때 latent feature space상에 더 많은 공간을 남겨줄 것이기에 더 나은 open-set classification 성능으로 이어질 수 있다.
image
위 그림처럼 cosFace penalty strategy를 적용했다.
먼저 cosine similarity를 distance metric으로 써서 data similarity와 score를 측정한다. 이를 통해 latent feature space의 절대 거리 대신에 normalized features를 써서 angles에 초점을 맞출 수 있고 fully connected layer의 normalized weight parameter가 각 카테고리 별 센터로 여겨질 수 있다.

image
마지막 fc layer에서 bias는 편의상 0으로 고정해놓고 위처럼 계산했다. f는 feature를 의미하고 F는 feature extractor이다. feature f와 weighted parameter W는 l2 normalization을 통해 normalization 되기 때문에 magnitude가 1이 된다. y_i는 class i에 대한 feature f와 weight W와의 코싸인 유사도를 의미한다. 이 코싸인 유사도를 통해 이미지 x에 대해 class i를 향한 angular similarity를 구할 수 있고 이는 곧 이미지가 class i에 속할 likelihood를 의미한다.
일반적으로, 코싸인 유사도 예측은 cross-entropy loss와 함께 사용되어서 ground-truth class에 대한 확률값을 최대화함으로써 서로 다른 클래스 간 feature를 구분짓는다. 따라서 loss는 아래와 같다.
image
N는 학습 이미지 수를 의미하고 C는 클래스 수를 의미한다. p_j는 이미지 j에 대한 softmax probability를 의미하고 y_j는 이미지 의 ground truth에 대한 cosine similarity를 의미한다.

슬라이드16
feature cluster를 개선하기 위해 cosFace에서 영감을 받아서 classification boundary인 cosine margin m을 두었다. 이 추가 margin을 둠으로써. intra-class feature들이 더 compatly cluster 될 수 있고 inter-class feature들이 더 widely seperate 될 수 있다. cosFace를 따라 preset scale factor s를 두어서 normalized feature에 대해 re-scale도 적용했다.

s는 30으로 지정했고 margin은 모든 실험에서 0.4로 고정하였다.

Augmented Training

슬라이드18

diverse, transferable representation은 open-set 문제의 핵심이다. 이 논문에서는 auxiliary class를 활용한다. Mixup, IL2A에서 영감을 받아서 랜덤으로 다른 클래스 샘플을 합쳐서 auxiliary new class data를 합성한다.
image
여기서 xi, xj는 base section classes C로부터 랜덤으로 선택된 각각 다른 클래스 i,j 샘플이다. 람다는 interpolation coefficient이다. x_k는 생성된 new class data이다.
image

fig이 그 에시이다. IL2A를 따라서 본 논문에서는 람다를 0.4, 0.6 사이에서 랜덤으로 선택해서 augmented data와 original data 사이의 overlap을 줄인다. 이렇게 pair combination을 통해 (C X (C-1) /2 ) 개의 새로운 클래스가 만들어지기 때문에 오리지널 C-class classification task에 더해져서 (C +C X (C-1) /2 )-class classification으로 수행한다.
아렇게 학습 시에 다양한 이미지 조건을 노출하는것은 general feature extractor를 얻기 위한 좋은 방법이다. self-supervised learning에서 영감을 얻어서 2개의 augmentation 이미지를 사용해서 training data diversity를 확보한다. fig1에서 augmentation 절차를 잘 보여준다. 학습 과정에서 각각의 이미지 입력에 대해 랜덤으로 두 개의 augmentations를 적용한다. utilized transformation methods에 대해 랜덤으로 resized crop, horizontal flip, color jitter, grayscale을 적용한다. 그리고 trasnformed data는 backbone network에 피드된다. 두 augmentation set의 loss는 평균내진 후에 역전파가 흘러가서 모델 파라미터를 업데이트 한다. 추가로, feature extractor가 base session data에 over-specialize 되는 것을 피하기 위해 SimCLR처럼 final fully connected layer에 extra projection layer를 두었다. nonlinear projection head를 둠으로써 feature extractor 단에서 더 많은 정보를 얻을 수 있고 유지할 수 있다.

Balanced Testing

슬라이드19

base session training 후에, projection head와 augmented classification ead는 버려진다. 오직 feature extractor만 남기고 overfitting과 catastrophic forgetting을 막기 위해 freeze시킨다. testing 시에 nearest class mean, cosine similarity가 사용되서 분류를 수행한다. 그런데 incremental session에서는 제한된 데이터가 쓰이기 때문에 data imbalanc로 인해 생길 수 있는 prediction bias를 없애기 위해 incremental step에서 같은 양의 few-shot data를 incremental step마다 사용해서 balance class prototype을 생성했다. 예를 들어 처음으로 모든 base session data를 사용해서 class-wise mean을 계산하고, 계산된 평균과 가장 작은 코싸인 거리를 갖는 required few-shot amout of data를 사용해서 각 base session class에 대한 최종 프로토타입을 생성한다.

Harmonic Accuracy

슬라이드20

현재 SOTA 방법론들은 class-wise average accuracy로 평가되고 있는데, base session에서의 클래스 수가 전체에서 큰 비중을 차지하는 경우가 많기 때문에 이 방식은 FSCIL 방법의 성능을 측정하기에 충분하지 않다. 벤치마크 논문에 의하면 CIFAR 100, miniImageNet에서는 60 out of 100% (60%) 카테고리를 base class로 썼고 CUB200에서는 100 of 200 (50%) 카테고리를 base class로 썼다. 그렇기 때문에 base session에서 좋은 성능을 보이고 incremental session에서는 저조한 성능을 보이는 경우도 전체 클래스에서 높은 base class 비중을 차지하기 때문에 높은 accuracy를 갖게 된다. 그래서 new task에 대해 학습하기 전에도 accuracy 값을 갖게 된다. 이를 해결하기 위해 harmonic accuracy를 제안한다.
image

Ab는 average accuracy for base session classes를 의미하고 Ai는 incremental session class의 평균 accuracy를 의미한다. 그래서 위 평가지표에 의하면 모델이 학습하기 전까지는 0%의 정확도를 갖게 된다. 이상적으로 balanced FCIL classifier는 average accuracy와 harmonic accuracy 모두에서 좋은 성능을 보여아 한다.

Dataset and Evaluation Metric

사용한 세 가지 벤치마크 데이터: CIFAR 100, miniImageNet, Caltech-UCSD Birds-200-2011(CUB200)

  • 5-shot setting을 따랐고 추가적으로 1-shot 실험도 진행했다.
  • CIFAR100, miniImageNet 실험에서 8-step 5-way 5-short, 8-step 5-way 1-shot incremental setting
    • 60개의 class는 base class로 쓰고 40개의 class는 1-shot/5-shot 셋팅에서 5-way manner in 8 step으로 피드되었다.
  • CUB200에서는 10-step 10-way 5-shot, 10-step 10-way 1-shot setting을 썼다.
  • 100 class는 base class로 쓰이고 나머지 100개의 class는 incremental class로 1-shot/5-shot setting에서 10-way manner in 10 step 으로 feed 되었다.
  • 평가 메트릭으로는 average accuracy, harmonic accuracy가 쓰였다.

Implementation Details

  • ResNet19을 backbone network로 썼다.
  • 2개의 2048차원 MLP projection head + RELU
  • SGD with momentum
  • initial LR : 0.01, CUB200 데이터만 0.001
  • CIFAR100, miniImageNet은 스크레치에서 학습했고 CUB 200 은 ImageNet pretrained model로 initialized
  • class augmentation 시에 CIFAR100은 128 배치, miniImageNet은 64 배치 크기

Experiments

슬라이드22
슬라이드23
슬라이드24
슬라이드25

[35] Generating Instance-level Prompts for Rehearsal-free Continual Learning

요약

  • 기존 prompt pool을 쓰는 연구들은 group-level instructions에 대해 inherent encoding을 하기 때문에 pre-training과 continual learning 사이의 domain scalability 문제가 발생한다는 점을 지적함.
  • 따라서 본 논문에서는 adpative prompt generator를 학습시켜서 각각의 인풋에 대해 instance-specific fine-grained instructions를 만드는 방식으로 위 문제를 해결함.
  • Poolless instance-level prompts로 설계해서 conditional transposed input의 instance-specific information을 학습함.
    (보자마자 든 생각은 마치 CoCoOp 논문에서 meta token을 추가로 학습시켜서 각 instance에 대해 condition된 prompt를 설계해서 generability를 확보하는 흐름이랑 비슷한 것 같음.)

Introduction

  • L2P나 dualprompt의 경우 ImageNet-pretrained ViT as a frozen feature extractor를 쓰기 때문에 natural image로만 제한되어 있고 CL에서의 data domain에 대한 가정이 없다. CL task의 경우 다양한 level의 domain similiarity를 가지는 이미지들로 구성될 수 있기 때문에 prompt가 domain-relevant knowledge를 학습할 수 있어야 한다고 지적함.

existing prompt-based CL methods의 한계

  1. target domain에 대해 하이퍼파라미터 튜닝을 해야함.
    : 기존 연구의 경우 prompt pool, domain coverage를 사전에 정하고 시작해야하는데, CL setup에서 target domain에 대한 prior knowledge가 있다고 가정하는 것은 unrealistic 하다.
  2. prompt pool이 커지면 memory budget도 증가함.
  3. 전체 인스턴스 수 보다 prompt 수가 더 적음. group-level fashion으로 업뎃해가기 때문에 per data instance를 위한 학습이 어렵게 되고 domain generalization이 떨어지는 결과로 이어짐.

Method

Motivation

  • L2P나 dualprompt의 경우 pool size M을 정해두고 prompt pool을 구성하는데 각각 다른 방식으로 이 pool에서 select을 해서 input token에 prepend하는 식임.
    • 하지만 여기서 가장 큰 motivation이 되었던 점은 prompt pool의 limited scalability임.
    • poolsize를 predefine하게 되면 pool size가 training instances 수 보다 훨씬 적기 때문에 available prompts를 제한하게 되고 group-wise fasion으로 optimize를 수행하게 됨.
    • 현실 CL시나리오에서는 source와 target domain의 domain gap이 매우 클 수 있기 때문에 fine-grained instruction을 인코드 할 수 있어야 함. 하지만 prompt pool의 경우 오직 poolsize 만큼에 해당하는 constrained partial knowledge를 학습하게 된다는 문제가 있음.
    • 이로 인해 하이퍼파라미터 튜닝에 더더욱 종속적이게 됨. (pool size 등)

Approach

image image
  • 식 7처럼 Domain-adaptive Prompt (DAP)은 adaptive prompt generator( LN, MLP, and a linear transformation layer (LT)로 구성)로 affine transformation parameters 학습해서 conditioning 함.
  • 이렇게 만들어진 instance-level fine-grained instruction이 correct prediction을 하려면 패치 개별적인 고려 보다는 각 인풋 패치들 간 상관관계를 고려해야 함. 따라서 normalization 수행하고 나서 한번 transpose 시킨 다음에 MLP layer에 feed해서 학습됨.
    -> 이렇게 한번 학습함으로써 instance-wise domain-related knowledge를 더 잘 확보할 수 있음. catastrophic forgetting 때문에 이 MLP층은 학습 에폭을 어느정도 수행하고 나면 frozen시킴.

즉, feature-wise transformation framework (LT)으로 affine transformation을 수행해서 conditional input embedding에 해당하는 scaling 파라미터, shifting 파라미터를 업데이트 함.
image
그다음 식 5처럼 task embedding을 써서 task-relevant instructions도 얻음. 이 경우 DualPrompt와 동일한 방식하지만, 명확히 다른 점은 DualPrompt는 prompt pool에서 prompt를 select 하는 용도로 식 5를 수행하지만, 본 논문에서는 supplementary instruction을 임베딩해서 instance-level prompt를 보완하는 역할임.

Optimization of DAP

image Transformer layer 각각에 대해 separate generator를 씀. 여기서는 single adaptively generated prompt로 업데이트 해가니까 L2P나 DualPrompt에서의 prompt수를 1로 보면 됨. image 최종 loss는 위처럼 CE loss + matching loss임.

[45] Anomaly Detection via Reverse Distillation from One-Class Embedding

Abstract

  • knowledge distillation은 unsupervised anomaly detection의 promising results를 달성해 옴.
  • Teacher-student 모델의 anomaly의 representation discrepancy가 AD를 위한 essential evidence를 제공함.
  • 하지만 Teacher, Student 모델을 설계할 때 유사하거나 동일한 구조로 설계하면 anomalous representation의 다양성을 방해함.
  • 이러한 문제를 다루기 위해 teacher encoder와 student decoder로 구성된 T-S model과 "Reverse distillation" 패러다임을 제안함.
    • Raw image를 바로 사용하는 것이 아니라, student network는 teacher model의 one-class embedding을 input으로 하고 teacher의 multi-scale representation을 restore 함.
    • 본질적으로 본 연구에서의 knowledge distillation은 abstract, high-level presentations에서 출발해서 low-level features 방향임.
    • 추가로, Trainable one-class bottleneck embedding module (OCBE)를 둠.
    • 이렇게 만든 compact embedding은 normal pattern에 대한 필수적인 정보를 효과적으로 보존할 수 있고 anomaly perturbation은 막을 수 있음.

Introduction

image

  • E: Pre-trained teacher encoder (extracts multi-scale representation)

  • Trainable one-class bottle-neck embedding module

  • Student decoder D (restore the features from the bottleneck embedding)

  • T-S 간 abnormality score가 낮다는 것은 높은 abnormality score를 의미함.

  • Heterogeneous encoder, decoder 구조와 knowledge distillation 순서가 anomaly에 대한 discrepant representation에 크게 기여함을 주장함.

  • Trainable OCBE 모듈이 mult-scale pattern을 downstream normal representation reconstruction을 위한 low-dimensional space로 통합함.

Reverse Distillation

  • conventional KD에서 student network는teacher모델과 유사하거나 동일한 구조를 적용해서 raw data/image를 input으로 받고 teacher 모델의 feature activation을 target으로 함.
  • Unsupervised AD one-class distillation에서 이상 샘플이 query로 들어왔을 때 student 모델은 teacher 모델과 크게 다른 representatikon을 만들어야 함.
  • 하지만 anomaly에 대한 activation discrepancy가 때로는 사라지며, 결국 이상 탐지 실패로 이어짐.
  • 본 논문에서는 이 이유를 teachet와 student 네트워크가 비슷한 아키텍쳐이기 때문일 것이라고 주장함.
  • T-S model의 unknown, OOD 샘플에 대한 representation diversity를 개선하기 위해, novel reverse distillation paradigm을 제안함.
  • T-S model은 encoder-decoder 구조를 적용하고 teacher의 deep

[29] PatchCT: Aligning Patch Set and Label Set with Conditional Transport for Multi-Label Image Classification

Abstract

image

  • This paper considers the semantic consistency of the latent space between the visual patch and linguistic label domains and introduces the conditional transport (CT) theory to bridge the acknowledged gap.
  • We find that by formulating the multi-label classification as a CT problem, we can exploit the interactions between the image and label efficiently by minimizing the bidirectional CT cost.
    • Specifically, after feeding the images and textual labels into the modality-specific encoders, we view each image as a mixture of patch embeddings and a mixture of label embeddings, which capture the local region features and the class prototypes, respectively.
    • CT is then employed to learn and align those two semantic sets by defining the forward and backward navigators
    • Importantly, the defined navigators in CT distance model the similarities between patches and labels, which provides an interpretable tool to visualize the learned prototypes.

Method

image

  • Now we present the details of our proposed PatchCT, which aligns visual Patch and textual label domains under CT - framework for multi-label image classification.
    As shown in Fig. 2, PatchCT consists of four components, the visual P set, the textual label Q set, the adaptive layer, and the CT distance between P and Q,

P set over patch embeddings

  • 보통 전통적인 CT 셋팅은 각 point를 동등하게 취급하는 경우가 많다. (e.g., θi는 N개의 지점에 대한 uniform distribution)

  • 하지만 multi-label tasks에서는 few key patches만이 final prediction에 contribute하기 때문에 uniform distribution은 잘 맞지 않는다. 이에 PatchCT는 다음과 같이 sparse and label guided θi를 정의한다.
    image

  • Ei ∈ Rd×N 및 L ∈ Rd×M은 각각 xi의 패치 임베딩 행렬 및 라벨 임베딩 행렬임.

  • yˆi는 normalized label vector로, oi는 label-aware representation of xi를 의미하며 ground-truth label과 가까운 semantics를 가지는 core patch를 선택하는 데 사용된다.

  • TopK(·, k)는 similarity score에 기반하여 상위 k개의 패치를 1로 마스크하고, 나머지 패치에 대해 0으로 만드는 sparsity operation이다.

  • 이렇게 patch embedding matrix Ei와 그때의 weights θi가 있으면, PatchCT는 visual set에 대해 discrete distribution Pi를 얻게 된다.

  • Pi는 local patch에 대한 detailed visual features를 얻기 때문에 downstream multi-label task에 이점을 제공:

    1. (2)의 θi는 Pi의 희소성을 보장하며, 이는 PatchCT의 계산 비용을 줄이고 PatchCT의 해석 가능성을 강화하는 데 유용하다.
    2. Introduced label-aware selection strategy를 통해 Pi가 core patches에 더 집중하기 때문에 더욱 discriminative features를 만들 수 있음.

Q set over textual label embeddings

여기서는 A photo of {label} prompt를 써서 M개의 class에 해당하는 문장을 만든다.
image
Qi가 textual representation으로 ground-truth label features를 얻음을 의미한다.
BERT같은 pre-trained text encoder를 쓰게 되면 1) the textual semantics for each label, 2) the correlations
among labels, which help to improve the identification of label representations 를 캡쳐할 수 있다.

요약

PatchCT는 multiclass classification task를 Conditional Transport 문제로 간주하고, visual patch 및 text label 임베딩에 대해 2개의 discrete distribution Pi, Qi를 생성한다. 이 두 representation은 semantic consistency를 공유하지만 서로 다른 support를 갖는다.
PatchCT의 주요 아이디어 중 하나는 multi-class classfication을 위해 P와 Q의 bidirectional CT distance를 최소화하여 vision-text modality를 align 하는 것이다.

objective function

  • 최종 objective function은 layer-wise CT distance의 합으 구성됨.

  • Layer-Wise CT distance

    • 이미지 xi에 대해 두 discrete distribution Pi, Qi는 두 가지 다른 도메인에서의 semantic representation이다.
    • PatchCT는 Pi와 Qi의 CT 거리를 최소화하여 semantic gap을 극복한다. (두 모달리티 간 deep ineteractions를 만들고 더 잘 align 할 수 있음)
    • 각 layer에서 CT distance를 greedy하게 최소화하는 Layer-wise CT distance를 통해 두 모달리티 간 deep interaction을 가능케 함.

    image

    • 여기서 l은 레이어의 인덱스이며, θ(l)i는 식 2에 의해 해당 레이어 l의 패치 임베딩 행렬 및 label-aware 임베딩을 대체하여 계산됩니다. 방정식 1의 cost matrix C(l)은 cosine distance로 계산됨.

Asymmetric loss

image

  • label 불균형 문제를 효과적으로 다루기 위해 ASL loss를 채택했다. (focal loss의 변형임)
  • 최종 loss는 다음과 같이 구성됨
    image
    즉 첫번째 항은 두 도메인 별 인코더의 각 layer에 해당하는 vision-text 모달리티 간의 align을 수행하고, 두 번째 항은 multi-class classification에 대한 supervised information을 주는 부분이다.

[12] Towards Open-Set Object Detection and Discovery

논문 링크: https://openaccess.thecvf.com/content/CVPR2022W/L3D-IVU/papers/Zheng_Towards_Open-Set_Object_Detection_and_Discovery_CVPRW_2022_paper.pdf

image
이 논문도 앞에서 본 논문들과 비슷함. 먼저 처음에 object detector로 known인지 unknown인지 detection을 수행하고(여기서의 디텍터도 faster r-cnn) unknown instances를 working memory에다 저장하고 known instances는 known memory에다 저장한다. 그리고 두번째 stage에서 unsupervised로 memory buffer로 전처리를 수행한다. 그리고 object-wise contrastive learning, constrained k-means clustering을 수행해서 새로운 카테고리르 발견한다.

Object Detector

image
[12] issue에서 읽은 논문이랑 똑같이 여기서도 faster rcnn으로 위와 같은 과정으로 prototype이랑 input vector를 비교해서 유사도를 계산한다.

Open Set Classifier

그리고 open set classifier도 똑같이 energy-based model을 쓴다. 그래서 known data에는 낮은 energy value를 할당해준다.

Memory module

여기서는 듀얼 메모리 모듈을 쓴다. 하나는 working memory, 다른 하나는 known memory이다.

Object Category Discovery

k-means clustering 방법을 쓴다.

Representation learning

representation learning을 통해 더 discriminative feature를 만든다.
여기서는 수도레이블을 쓰는게 아니라 augmentation을 시켜서 augmented version은 positive pair로 해서 가까워지는 방향으로 학습하고 다른 object instances들에 대해서는 멀어지는 방향으로 학습한다.

contrastive loss는 아래 (3)와 같이 구성된다.
image

  • q: query object representation
  • {k}: queue of key object samples
  • k+ : augmented version of q (positive key)
  • k-: representations of other samples (negative key)
  • τ: temperature parameter

Contrastive learning head부분에서 unsupervised augmentation stategy를 통해 모든 샘플들을 mixed sample로 만듦으로써 다양한 패턴을 학습하고 더 많은 학습 데이터를 확보할 수 있다.

각각의 sample queue{k}에서 query object representation q랑 linear interpolation을 통해 합치고 새로운 view k_m,i를 만든다. 결과적으로 수도레이블처럼 virtual label vi를만들어준다.

image
q랑 k+는 positive sample pair이고 같은 object instance로부터의 mixing pair일 경우 virtual label은 1로 할당된다.

Novel Category labeling

constrained k-means clustering을 통해 label을 assign해준다.
constrained kmeans clustering의 input으로 working/known memory object encoding이 둘 다 들어간다. 그리고 labelled object representatiion이 ground truth class에 hard-assign되도록 함으로써 기존 standard k-means clustering에서 constraint algorithm으로 변환한다. 즉, known memory의 object instances를 labelled sample로 간주한다. 그리고 각각 labelled class마다 cenroid를 다 계산한다. 이 centroid가 k-means 알고리즘에서 initial centoid가 된다. 레이블 없는 새로운 카테고리들에 대해서는 그냥 랜덤 초기화해서 출발한다.(이때는 k-means ++ 알고리즘)

(일단 아무 공간에나 중심점을 k개 찍고 시작하는 게 아니라) 가지고 있는 데이터 포인트 중에서 무작위로 1개를 선택하여 그 포인트를 첫번째 중심점으로 지정한다. 나머지 데이터 포인트들에 대해 그 첫번째 중심점까지의 거리를 계산한다.
두번째 중심점은 각 점들로부터 거리비례 확률에 따라 선택한다. 즉, 이미 지정된 중심점으로부터 최대한 먼 곳에 배치된 데이터포인트를 그 다음 중심점으로 지정한다는 뜻이다.

iteration마다 labelled object들은 pre-defined cluster로 할당되고 unknown object instances들은 최소거리에 해당하는 class로 어싸인된다. 이렇게함으로써 known class임에도 unknown으로 할당되는 문제를 줄여서 centroid update에 영향을 미치지 않도록 효과적으로 방지한다. 그리고 마지막 cluster aggison은 novel centroid만 가지고 클러스터링 한다.

[33] Prototypical Residual Networks for Anomaly Detection and Localization

이 논문 핵심

  • supervised anomaly classification을 수행함. 이 때 data imbalance로 인해 오바피팅 되는 상황을 막기 위해 multiple instance learning으로 접근해서 다양한 스케일 patch size에 대해 prototype으로 cluster를 업데이트 하는 방식을 수행하고 다양한 augmentation 방식을 수행해서 대응함.
  • anomaly image와 그에 대한 GT mask도 써서 학습함. decoder를 직접적으로 두는 방식.

image

Multi-scale Prototypes

  • Prototype initialization
    • ResNet feature map의 랜덤한 레이어에서 K개의 feature를 랜덤 샘플링하고, k-means clustering으로 업데이트 함
    • L2 distance를 써서 두 feature map 간의 거리를 비교함
    • 이 때 prototype의 개수는 데이터셋마다 정상 샘플의 수가 다 다르므로 normal sample 수의 특정 비율 만큼으로 설정함 (즉 데이터마다 프토로타입 개수 다름, 비율은 10%로 설정)
  • Residual Representation
    image
    anomalous residual representation은 가까운 prototype으로부터 정의됨. L2 norm으로 계산해서 가장 가까운 cluster prototype 찾음.
    프로토타입은 scale마다 각각 따로 학습되므로 input sample은 각 다양한 scale의 prototype과 매칭될 수 있음.
  • Multi-scale Fusion
    • multi-scale representation간의 학습을 위해 Multi-scale fusion blocks(MF)를 두어서 합침.
      image
    • Fig 4처럼 3개의 input image에 대한 transformed representation의 합임. 이 때 transform function은 input feature map index r과 output feature map의 index j따라 다름.
    • r=j이면 입출력 feature map 동일
    • r<j 이면 input feature map을 downsampling 한다. downsampling은 입력 이미지의 spatial resolution을 낮추는 즉 feature map의 크기를 줄이는 역할을 함. 이 때 depth-wise seperable convolution으로 수행됨
    • r>j인 경우 input feature map을 upsampling 함.

3.3 Multi-size Self-Attention

  • patch를 다른 크기로 split하고 (2x2씩 줄여감) head마다 patch-wise self-attention을 수행함.
  • 처음에 2cj × ps × ps 패치를 뽑고 1원 백터로 flatten 시킴. 그리고 fc layer을 학습시켜서 query , key, value embedding을 구함. 그
  • 리고 원본 spatial resolution으로 resize 함.
  • 최종적으로 이 feature들은 concat되고 2D residual block을 통과해서 최종적인 output을 구하게 됨.
  • MSA는 총 3개로 stack했음.

Anomaly Generation Strategies

  • 데이터 불균형을 해결하기 위해 다음과 같은 과정들을 추가로 수행
    image
  1. Extened anamalies(EA)
    : normal image에다가 seen anomaly로부터 augmented anomalous regions를 위치시키는 방식 (in-distribution anomalies)
  2. Simulated anomalies(SA)
    : seen anomalies에 대한 지식 없이 normal sample로부터 만들기

Extended Anomalies

  • 이미지 전체에 대해 단순히 augmentation을 수행하는게 아니라 seen anomalies의 specific anomalous region을 augment해서 정상 이미지의 랜덤 위치에 붙이는 식.
  • augmentations (Fig. 5, Aug1) are applied to a randomly selected
    anomaly from the seen anomalies in order to generate
    color varieties.
  • { equalize, solarize, posterize, sharpness, autocontrast,
    invert, gamma-contrast } 중에서 2개 랜덤선택하고 { rotate, shear, shift }중에서 랜덤하게 선택해서 위치도 정함.
  • 여기서 좀더 현실적이게 하기 위해서 soft position constrain을 둬서 Target Areas를 어느정도 특정해줌.
  • 랜덤 샘플링된 target areas로 anomaly의 실제 위치를 표현하는 binary mask로 만들어서 ground trutb mask를 확보함
    image

Simulated Anomalies

DRAEM과 비슷하게, multiply Perlin nosie + DTD dataset으로부터의 랜덤 texture를 정상 이미지에 적용함.

Training and Inference

decoder가 anomaly sore map을 만들면 focal loss랑 sooth L1 loss로 최적화함.

[44] SegFormer : Simple and Efficient Design for Semantic Segmentation with Transformers

Abstract

  1. Hierarchically structured Transformer encoder 구조
    : multiscale features를 내뱉음. positional encoding이 필요 없기 때문에 학습 이미지와 다른 해상도의 테스트 이미지의 positional code를 interpolation 할 필요가 없음.

  2. Lightweight 디자인의 MLP decoder
    : Complex decoder가 필요 없음. MLP로 다른 층들의 information을 aggregate하고 local attention과 global attention을 combining함으로써 powerful representation을 얻음.

image

Introduction

  • 기존 Segmentation은 두 방법에 의해 연구되어 옴.

    1. 특징을 잘 추출하기 위해 Encoder, 즉 backbone을 개선하여 성능 향상시키는 방법
    2. 이미지 내의 context 정보를 효율적으로 추출하기 위한 모듈과 연산을 추가하여 성능을 향상시키는 방법
  • 이후 ViT의 등장으로 ViT를 encoder에, CNN을 Decoder에 사용하는 방식으로 좋은 성능을 내는 SETR이 등장함.

  • 하지만 ViT의 Limitations 존재

    1. multi-scale이 아닌 single-scale low-resolution features를 반환

    2. Large image에 대해서 high computation cost

    (ViT는 이미지의 크기가 커지면 패치가 그만큼 늘어나게 되고, 모든 패치들과의 유사도를 계산하는 self-attention의 특성상 연산량이 제곱배로 늘어나게 됨)

  • 이러한 한계 극복을 위해 pyramid vision transformer(PVT)를 제안해서 VIT를 피라미드 구조로 확장하기도 하였다. 또다른 방법으로 Swin Transformer나 Twins가 등장했지만, 이런 방법론들은 주로 Transformer encoder에 초점을 두고 있고 decoder의 추가 개선을 위한 contribution은 neglecting한다는 한계가 있었음. 반면 SegFormer는 encoder와 decoder를 모두 re-design함.

  1. 본 연구에서 제안하는 인코더는 inference시에 학습 데이터와 다른 해상도를 가지는 이미지의 positional code를 interpolate하지 않아도 됨.
    • 결과적으로 성능에 영향을 미치지 않으면서 임의의 테스트 해상도에 쉽게 adapt 될 수 있음.
    • 또한 hierarchical 부분은 인코더가 high-resolution fine features와 low-resolution coarse features 둘 다 생성할 수 있도록 함. 이는 고정된 해상도의 single raw resolution feature map만 생성 가능한 ViT와 다른 점임.
  2. Lightweight MPL decoder의 핵심 아이디어는 Transformer-induced features의 장점을 활용해서 lower layers의 attention은 local, highest layer는 highly non-local하다는 특성을 활용함.
    • 즉, local하고 global한 문맥 정보를 모두 잘 활용할 수 있음.
    • 결과적으로 간단하고 직관적인 디코더로 powerful representation을 만들 수 있음.
  • model size, run-time, accuracy면에서 장점을 demonstrate함. (데이터셋은 ADE20k, Cityscapes, COCO-Stuff)

Method

가장 큰 특징 두가지

  1. Hierarchical Transformer encoder
    : 고해상도의 coarse한 특징들과 저해상도의 Fine-grained 특징들을 추출함. 특히 PE(Positional Encoding)를 사용하지 않았기 때문에 inference 시에 다른 크기의 이미지를 사용해도 성능 저하 적음.

  2. 경량화된 Decoder
    : 더 적은 연산량을 가지며 인코더에서 얻은 모든 특징들을 모두 활용해서 최종출력을 얻어냄
    image

  • 먼저 이미지를 4x4 크기의 패치로 나눔. ViT는 패치 크기 16x16으로 나누었지만 dense prediction task에서는 더 작은 패치 크기가 낫기 때문.
    (하지만 패치 크기가 작아진 만큼 self attention 시에 패치 수의 제곱만큼의 연산량이 증가할 것임. 따라서 이를 어떻게 효율적으로 접근할 수 있을지 또한 중요, 뒤에 나옴.)
  • 그리고 이 패치들은 hierarchical Transformer encoder의 input이 되어서 오리지널 이미지 해상도의 1/4, 1/8, 1/16, 1/32 크기의 multi-level features를 얻음
  • 이 multi-level features를 ALL-MLP decoder에 넣어서 H/4 x W/4 X N_cls resolution의 segmentation mask를 예측함.

1. Hierarchical Transformer Encoder (Mix Transformer, MIT)

  • Hierarchical Feature Representation

    • ViT는 single-resolution feature map만 만들 수 있는 반면 이 모듈의 목표는 CNN-like multi-level features를 만들어서 high-resolution coarse features, low-resolution fine grained features를 모두 만들어서 semantic segmentation의 성능을 끌어올리는 것임.
    • 더 정확히는, HxHx3 크기의 이미지가 주어지면, patch merging을 통해서 hierarchical feature map F_i를 만듦.

    image

    • 즉 1/4, 1/8, 1/16, 1/32 크기의 피쳐맵이 만들어짐.
    • High-resolution feature는 coarse feature를, low-resolution feature는 fine-grained feature를 만듦.
  • Overlapped Patch Merging

    • 기존 ViT에서는 NxNx3 패치를 1x1xC의 벡터형태로 합침. 이를 기반으로 2x2xCi의 패치를 1x1xCi+1의 벡터 형태로 변환시켜 hierarchical feature map을 얻게 됨.
    • 하지만 기존 non-overlapping image/feature patches의 경우 local contiuity를 보존하지 못함.
    • 따라서 patch size K, adjacent patches 간의 stride S, padding size P를 정해서 overlapping patch merging을 수행함. (K=7, S=4, P=3/ K=3, S=2, P=1로 해서 같은 크기의 feature를 만듦.)
    • 즉, convolution network를 사용하여 overlap 되는 patch를 sampling 함.
      • ex. CNN 커널 사용할 때 overlap해서 계산되듯이 패치 머징을 할때도 padding을 하나를 주고 stride 2를 주면 1/2로 merge 될 수 있음.
  • Efficient Self-Attention

    • Encoder의 연산량이 가장 많은 곳은 Self-attention layer 부분임.

    • 기존의 multi-head self attention process는 Q,K,V가 모두 NxC의 같은 차원을 가짐. (N=HXW)

    • Computational complexity가 O(N^2)이 되어서 큰 이미지 해상도의 경우 문제가 됨.

    • Segformer의 인코더는 4x4 크기의 패치를 쓰기 때문에 ViT 보다 패치 수가 많아지고 self-attention 연산이 매우 복잡해짐.

      image

    • 따라서 sequence reduction process를 통해 reduction ration R만큼 시퀀스 길이를 줄임.

    image

    • Linear layer를 거쳐서 지정한 output channel demension 크기의 텐서를 반환함.
    • 따라서 결과적으로 계산 복잡도가 O(N^2/R)로 줄어들음.
    • 본 논문에서는 R을 [64, 16, 4, 1]로 설정함.
    • 간단히 생각하면 linear layer로 channel 수를 줄인 다음 multi-head self attention을 수행한다는 뜻인듯 함.
  • Mix-FFN

    • ViT 에서는 positional encoding으로 location information을 주지만, positional encoding의 resolution이 고정되기 때문에 학습 이미지와 다른 해상도가 테스트 시에 나타나게 되면 positional code가 interpolated 되어야 하고 종종 성능 저하로 이어짐.
    • 이를 막기 위해 CPVT에서는 3x3 convolution을 PE와 함께 써서 data-driven PE를 구현함.
    • 하지만 semantic segmentation에서는 positional encoding이 꼭 필요한 것은 아님. 대신에 Mix-FFN을 통해서 location information을 leak하기 위해 zero padding을 이용해서 PE를 대체함.
    • Feed-forward network(FFN)에 3x3 conv를 쓰는 형태임.

    image

    • 이 3x3 conv 연산이 positional encoding을 대체함.
    • 또한 Depth-wise conv를 사용해서 파라미터 수 줄이고 효율성 증가시킴
  1. Lightweight ALL-MPL Decoder
  • 오직 MLP 층으로만 구성된 lightweight decoder을 통해 다른 방법론들에서 전형적으로 쓰이는 hand-crafted, computationally demanding components를 피함.
  • 이렇게 간단한 디코더가 가능했던 이유는 Hierarchical Transformer encoder가 traditional CNN encoder보다 large effective receptive field(ERF)를 가지기 때문임.

image

  1. MiT 인코더에서 나온 multi-level feature을 MLP layer에 넣어서 channel 차원을 동일하게 통합함.
  2. feature를 원본이미지의 1/4로 upsample하고 concat함.
  3. concat하면 채널이 4배 증가되었기 때문에 MLP층 거쳐서 원래 채널 차원으로 projection
  4. fused feature로 predict (카테고리 수만큼의 demension으로)

Effective Receptive Field Analysis

image

  • Deeplab V3+의 receptive field를 살펴보면 Segformer 보다 상대적으로 작다.
  • Segformer는 빈 부분 없이 골고루 인식하며 encoder만으로도 global context 또한 잘 인식할 수 있다.
  • CNN의 제한된 receptive field로 인해 ASPP같은 무거운 모듈을 사용해야 했다면 Segformer는 MiT Encoder의 ERF 덕분에 간단한 decoder 만으로도 넓은 receptive field를 가짐.

Relationship to SETR

  • SETR과 달리 더 작은 imagenet-1k로 사전학습함
  • encoder가 계층적 구조를 가지기 때문에 고해상도의 coarse한 특징과 저해상도의 fine한 특징을 잘 얻을 수 있음.
  • Positional embedding을 사용하지 않아 inference 시에 다른 크기의 이미지를 사용해도 성능 저하 적음.
  • 가벼운 decoder로 더 적은 연산량을 지님.

Experiments

image
Table 1은 모델 규모에 따른 성능 비교임. 인코더 크기, 디코더 MLP 차원, PE vs Mix-FFN, CNN과의 비교를 하고 있음. 디코더 MLP demension은 256을 디폴트로 함. 특히 Mix-FFN의 경우 두 가지 해상도에 대해 실험을 진행했는데, inference image의 크기가 극단적으로 다를 경우 mIoU가 PE에 비해 확실히 좋은 것을 확인할 수 있음. 또 1d를 보면 CNN based encoder랑 MLP decoder를 coupling하게 되면 확실히 transformer encoder보다 accuracy가 떨어진는 것을 볼 수 있음. 이는 직관적으로 CNN이 Transformer보다 작은 receptive field를 가지기 때문에 decoder가 충분힌 global representation을 얻지 못했을 것으로 해석하고 있음.
image
Table 3은 동일한 deocder에 대해 두 개의 인코더(ViT, Swin)와 비교하고 있음. 본 연구에서 제안하는 MiT 인코더가 Swin,ViT보다 나은 결과를 보임.

image
Table2는 SOTA method와의 비교실험임. (FLOPS, latency, accuracy 비교)
모든 데이터셋에 대해 mIoU가 outperform하는 결과를 보임.

image
Table 5는 자율주행을 위한 데이터셋에 대한 실험 결과인데 corruption, perturbation에 얼마나 robustness한지를 평가하기 위함임. Citiscapes-C는 Cityspaces의 validation dataset임. 그 결과, CNN-based 방법론보다 확실히 좋은 성능을 보였으며 여러 환경에서도 robust한 결과를 보임. (이 실험은 zero-shot 실험이라고 주장하는 것 같은데 살짝 애매함. 본문에는 없고 결론에서 zero-shot이라고 함...하지만 개인적으로는 zero-shot으로 볼 수 있을것같다는 생각)

Conclusion

  • 간단하고 깔끔하지만 강력한 semantic segmentation method인 Segformer 제안함.
  • Positional encoding-free, hierarchical Transformer encoder, lightweight All-MP decoder로 구성됨.
  • 이전 방법론들과 같이 복잡한 디자인을 피했고 효율성과 성능을 모두 잡음.

[20] Forward Compatible Few-Shot Class-Incremental Learning

PROSER 저자와 동일한 저자가 작성한 논문.

Abstract

  • we suggest learning prospectively to prepare for future updates, and propose ForwArd Compatible Training (FACT) for FSCIL
  • we seek to realize it by reserving embedding space for future new classes
  • we assign virtual prototypes to squeeze the embedding of known classes and reserve for new ones.
  • we forecast possible new classes and prepare for the updating process

Introduction

image
fig1 처럼 모델은 old class에 대한 discriminability를 해치지 않으면서 적은 수의 새로운 데이터로 통합할 수 있어야 한다. forgetting ㅔproblem과 별개로 few-shot instances에 overfitting 되는 문제도 있다. 이 논문에서는 모델이 forgetting 문제를 극복하는 능력을 backward compatibility라고 표현하고 있다. 그래서 만약 업데이트 된 모델이 이전의 class들도 잊지 않고 잘 분류한다면 compatibility가 있다고 말할 수 있다.
현재 방법론들은 주로 backward compatibility에 집중해서 이후 모델의 forgetting을 막는 것에 집중하고 있지만, 사실 이전 모델이 잘 작동하지 않으면 이후 모델의 성능이 떨어질 것이다. 따라서 더 나은 방식은 이전 모델에 대해 future extension을 고려해서 발전시키는 것이다. 이러한 compatibility를 forward compatibility라고 칭하고 있다. ( 즉 요약하면 base session에서부터 feature extractor 단에서 성능을 개선하는 것의 중요성을 주장하고 있다. )

  • 본 논문에서 제안하는 FACT는 future class를 준비하는 모델이다.
  • 모델을 growable하게 만들기 위해 임베딩 공간 상에서 multiple virtual prototypes를 pre-assign한다.
  • 이 virtual prototypes를 최적화함으로써 같은 클래스끼리는 더 가까이 밀고 new class를 위한 공간의 여지를 더 많이 확보해줄 수 있다.
  • instance mixture 방식으로 virtual instances를 생성함으로써 explicit supervision으로 embedding space를 reserve할 수 있다.

Method

image
image
이 식에서 mask의 의미가 ground-truth logit을 지우고 나머지 파트들을 수도 라벨 y^과 매칭시키는 방식이다. 즉, PROSER 방식과 동일한데 표현만 달리 한 것.
식 5에서 f(x)는 l2 normalized cosine similarity를 의미한다. v는 virtual class수를 의미한다. 이 loss를 optimize 함으로써 모든 non-target class 들은 reserved virtual prototype으로 push된다. 그래서 other class에 대한 임베딩이 더 콤팩트해지고, virtual class는 reserved 될 것이다. 따라서 모델이 더 growable 하고 forward compatibility가 강화된다. (virtual class 수는 V=NB를 디폴트로 설정함)

Forecasting Virtual Instances

모델의 future-proof ability를 위해 이전 스테이지에서 novel patterin을 본 적이 있으면 앞으로의 스텝에서의 new class에 더 적합해 질 것이다. 따라서 이를 위해 instance mixutre를 통해 new class를 만들어서 이 생성된 이미지로 embedding space를 확보한다.
두 개의 다른 클러스터로부터 interpolation하는 방법이 종종 low-confidence prediction을 한다는 점에서 영감을 받아서 본 논문에서는 manifold mixup을 통해서 인스턴스를 fuse하고 중간 층에서의 임베딩을 두 개의 파트로 decouple한다.

image
image

Effect of Virtual Instances

[42] OmniAL: A unified CNN framework for unsupervised anomaly localization

  • 이 논문의 핵심 : synthesis, reconstruction, localization
  • 기존의 one-model-N-classes 셋팅의 경우 storage, time cost, fearful degradation 문제가 존재함.
  • 본 논문에서는 unified CNN framework OmniAL을 제안함. 기존 UniAD보다 성능또한 개선함.
  • 정상 데이터로만 학습함. 간략히만 요약하면,
  1. photo-realistic anomalous를 5개의 pre-defined panels로부터 고른 지역에 syntesize함.
  2. anomaly-free reconstruction and an anomaly localization sub-networks(Alternative basic blocks, DCSA blocks로 구성)에 피드돼서 학습됨.

Introduction

image

  • fig 1a처럼 conventional 학습 패러다임은 N models for N classes임. 이 경우 class수가 증가함에 따라 storage와 training time cost가 증가함.
  • 또 fig 1b를 보면 one model for N class 패러다임으로 바꾸게 될 경우 anomaly localization 성능이 하락함. (JNLD라는 연구는 reconstruction-based unified method인데, reconstruction failure or localization failure하는 결과를 보임.)
  • 따라서 unsupervised anomaly localization을 위한 robust unified framework인 OmniAL 제안.
    • Panel guided anomaly synthesis 방식을 통해서 각 학습 방식마다 정상 비정상의 부분을 컨트롤 함. 이렇게 함으로써 identical shortcut 문제 해결.
    • Dilated channel and Spatial Attention(DCSA) blocks로 구성된 reconstruction and a localization sub-networks를 구성해서 anomaly reconstruction error 키움.
    • Anomaly region에 대한 localization을 잘 하기 위해 reconstruction and localization sub-networks 사이에 DiffNeck module을 적용

슬라이드20

Method

Panel-guided anomaly synthesis

image

  • 학습 시에 정상 샘플을 직접적으로 사용하게 될 경우, gt mask supervision이 직접적으로 인풋에 연관되기 떄문에 학습에 정상 샘플을 바로 쓰게 되면 information leak이 발생해서 곧 identical short-cut으로 이어짐.
  • 이를 방지하기 위해 synthetic anomaly를 사용함. 근데 또 정상 샘플을 아예 안쓰게 될 경우 false alarm 문제로 이어지기 때문에 어떻게 synthetis anomaly를 더 잘 만드냐가 문제임.

image

Pseudo anomaly 만드는 법

  • 5가지 종류의 panels('left', 'right', 'top', 'bottom', 'all')을 설계해서 정상과 이상 지역의 부분을 조절함. 즉 패널에 해당하는 부분에만 anomaly를 생성하는 것.
  • 이 때 all을 제외한 나머지 protion들은 이미지 w,h 기준으로 범위 [0.5~0.8]배 사이에서 조절. (생각보다 범위가 크네?)
    image
  • 여기서 3 defect level(easy, medium, hard)가 있고 I는 anomaly-free image, T는 I에 ranodm augmentation(resize, crop, flip, color-jitter)을 적용해서 만들거나 DTD 데이터셋으로부터 random augmentation을 적용해서 만듦.

Q. 그럼 저 3개의 defect level은 어떻게 정의하는가? -> weight map을 통해.

  1. baseline anomaly fusion weight map 찾기: JNLD 논문처럼 JND를 써서 anomaly synthesis를 guide 함.
    image
    image
  • 여기서 J가 나타내는것이 JND map이고 베타는 different level of noticeable에 대한 bias term.
  • 알파는 마스크에 적용되 smooth kernel, 정상과 이상 사이에 soft boundary를 만들어줌. easier-level anomaly일 경우 더 작은 smooth kernel을 사용한다.
  • 랜덤 시드를 사용하기 때문에 different level anomaly regions가 서로 오버렙 될 수 있고 이로인해 anomaly segmentation task에 대한 gt mask가 label inconsistency를 가질 수 있음.
  • 따라서 anomaly-free image I와 synthesized anomaly image A 사이에 structure similarity index measure(SSIM)을 통해서 3 defect level의 segmentation mask를 refine하고 quantify 함.

Anomaly reconstruction

  • reconstruction sub-network는 encoder, decoder로 구성되어 있음. 둘 다 alternating basic, DCSA blocks로 구성됨.
    • basic block의 경우 2층의 consecutive 3x3 convolution + instance normalization + ReLU 로 구성되어 있어서 각각 다른 level의 피쳐를 뽑음.
    • 이 추출된 패쳐맵은 DCSA block으로 integrated 됨. 이 DSCA는 channel and spatial attention sequential sub-block으로 구성됨.
      • Average pooling, two consecutive 1x1 convolutions를 통해 패쳐 채널 간 채널 어텐션을 수행함.
      • Spatial attention의 경우 일단 앞에서 refine 된 피쳐맵에 average and maximun pooling으로 공간 정보를 concat 함.
      • 그리고 나서 standard dilated 3x3 convolution-norm-relu 단계를 한번 거쳐서 spatial importance를 spot함.
      • 이 dilated path랑 나머지 path랑 둘이 더해서 최종적인 spatial attention map 만듦.

슬라이드21
슬라이드22

[22] Learning to Prompt for Vision-Language Models

Abstract

  • 본 논문에서는 CLIP과 같은 pre-trained vision-language model의 디벨 측면에 있어서 중요한 것은 prompt engineering임을 보인다.
  • NLP에서의 prompt learning research에서 영감을 받아서 downstream image recognition task를 위한 CLIP-like vision-language models에 adaptiong 한 Context Optimization(CoOP)를 제안한다.
  • CoOp는 pre-trained 된 파라미터를 전부 freeze해논 상태로 learnable vectors의 context words를 모델링한다.
  • 구현한 버전은 unified context 와 class-specific context로 두 가지다.

Introduction

  • SOTA visual recongition에서의 일반적인 접근법은 discrete labels를 써서 fixed set object caterogires를 예측함. (기술적인 측면에서 보면 ResNet,ViT와 같은 모델에서 뽑은 visual features랑 fixsed weight set과 매칭시키는 식)

    • 하지만 문제는 Training categories는 일반적으로 계산의 편의성을 위해 discrete label로 변환해서 cross entropy로 학습하기 때문에 text자체가 갖고있는 정보들은 거의 활용되지 못한다.
    • 따라서 closed-set visual concepts로 제한해서 새로운 카테고리로 분류를 하려면 추가 데이터가 필요하기 때문에 new category는 처리하지 못한다는 한계가 존재했다.
  • 최근 CLIP, ALIGN 등의 vision-language pre-training model이 등장하면서 위와 같은 한계를 지닌 visual representation learning의 대안이 되었다.

  • 특히, 새로운 classification task의 경우에도 task-relevant categories를 설명하는 문장을 text encoder에 넣고 image encoder에서 뽑은 image feature와 비교할 수 있다.

  • pre-trained vision-language model에서의 prompt가 downstream task에 핵심 역할이 됨을 발견했지만 사실 적절한 prompt를 찾는다는건 non-trivial task이고 튜닝에 매우 많은 시간이 소요된다. 단어를 조금만 바꿔도 성능 차이가 매우 클 수 있다. (실제로 class token 앞에 'a'라는 단어를 추가한 것이 정확도 5% 상승의 결과를 보인 사례도 있음)

  • 또 prompt engineering은 task에 대한 사전 지식을 필요로 한다.

image
fig1처럼 task-relevant context를 추가하는 것이 상당한 성능 향상을 이끄는 결과를 보였다. 그러나, 이런식으로의 extensive한 튜닝의 결과가 과연 downstream task를 위한 최적의 결과일지에 대한 보장 또한 없다.

  • NLP에서의 최근 연구에 영감을 받아서 본 논문에서는 간단한 Context Optimization(CoOp) approach를 제안해서 audomate prompt engineering을 제안한다.
  • prompt's context words를 learnable vector로 두고 랜덤값으로 초기화되거나 pre-trained word embedding으로 initiazlie시킨다.
  • 각각 다른 task의 범위를 다루는 상황을 고려해서 하나는 unified context, 하나는 class-specific context 두 가지로 구현했다.

Method (Context Optimization)

image
t = [V]1[V]2 . . . [V]M[CLASS]
CLIP에서의 word embedding이랑 동일한 차원의 vector [V]_m(m∈{1, . . . , M})로 prompt를 구성해서 text encoder에 넣는다. 이 때의 M은 context tokens 수를 지정하는 하이퍼파라미터이다. 이 prompt t를 text encoder에 feed하면 visual concept(still from the [EOS]token position)에 해당하는 classification weight vector를 얻게 되면 아래처럼 similarity에 의해 분류를 수행하게 된다.
image
이 때 각각의 prompt t_i는 i번째 class name에 해당하는 워드 임베딩 백터로 대체된다.

또, class token을 문장 끝에 두는게 아니라 중간에 두었다. (다른 연구들에서도 flexible을 위해 이렇게 하나..?아님 여기서만?)
image

이렇게함으로써 학습의 flexibility를 증가시킨다. (뒤의 cell를 보충 설명으로 채우거나 마침표 같은 종료 신호를 써서 문장을 더 일찍 cut off 할 수 있게 됨)

Class-Specific Context

특정 fine-grained classification task를 위해 class-specific context(CSC)를 구성했다. context vector가 각 class마다 독립적인 경우를 말한다.
image

학습은 standard cross-entropy loss로 진행된다.

Discussion

본 접근은 CLIP의 adaptation을 다루기 위한 접근이다. 기존의 prompt learning method들과의 차별점을 정리하면,

  1. backbone architectures가 clip-like model, language model 확실히 다르다.
    (전자의 경우 visual/textual data를 입력으로 받아서 alignment scores를 구해서 image recognition을 수행한다. 후자의 경우에는 textual data를 다루는 데에만 치중되어 있다.)
  2. pre-training objectives가 다르다.
    (contrastive learning vs autoregressive learning)

Experiments

image
image
image

[13] Learning to Discover and Detect Objects

논문 링크 : https://arxiv.org/pdf/2210.10774.pdf

기존 object discovery 논문들은 대부분 representation learning을 위해 contrastive learning을 수행하고 k-means와 같은 clustering알고리즘을 쓰는 방식이 많았지만, 본 논문은 offline clustering 알고리즘 없이 head를 추가하는 등의 과정을 거쳐 end-to-end로 접근하는 새로운 방법론을 시도했고, 결론적으로 더 좋은 성능을 보였다는 점에서 큰 의미가 있다고 생각함. (SwAV와 접근방식이 비슷하고 Sinkhorn-Knopp algorithm을 사용했음)

Abstract

  • 이 논문에서는 novel class discovery and localization (NCDL) task를 다룬다.
  • 실험 셋팅을 간단히 보면 source domain dataset에서는 object class에 대한 supervision이 있고 test시의 target domain class들은 어떠한 human supervision 없이 오직 visual similarity로만 discover, classify, localize한다.
  • 아키텍쳐는 2-stage OD network로, region proposal network를 써서 RoI를 구하고 이 RoI각각을 분류하기 위한 네트워크를 또 학습시킨다.

Introduction

Object class discovery는 visual pattern을 그룹핑할때 유사한 패턴(색상 또는 방향)들이 많기 때문에 어려운 task이다. Novel Class Discovery는 어느 정도 supervision을 사용해서 semantic classes를 그룹화하는 방법에 prior knowledge를 주입함으로써 data-driven manner로 잘 배치시킬 수 있다. 그러나 기존 방법들은 대부분 curated 된 데이터셋을 가정한다. 여기서 object of insterests는 pre-cropped되고 semantic class들은 fairly balanced 되어 있다. 반면에 본 논문에서는 raw, unlabeled, uncurated data에 대해 novel class discovery와 localization을 동시에 다룬다. 이미지에는 항상 labeled, unlabeled class가 섞여 있는 더 어려운 셋팅을 다룬다.

전체적인 과정을 간단하게 요약해보면,

  • 먼저 labeled source domainsupervised training으로 학습시키고 unlabeled target domainself-supervised로 학습시킨다.
  • 그 후 source domain에서 target domain으로 weight를 retaining함으로써 knowledge transfer를 수행한다. (이 때 weight은 RPN, boundig box regression, instance segmentation heads)
  • classification 시에는 primary known classification head(secondary head)를 두어서 a-priori known semantic classes에 해당하지 않는 region의 분류를 수행한다.
  • 모든 region of interests를 하나의 네트워크 forward pass로 분류할 수 있고 inference 시에 clustering 알고리즘이 필요 없다.
  • 게다가, 이전 연구들 중에서 contrastive learning으로 object representation을 학습하고 k-means clustering을 수행하는 방법론들보다 성능을 능가한다.

Contribution

(i) pre-localize하지 않고 object가 rougly centered되었다는 가정 없이 (strong photographer bias 없이) in-the-wild using standard object detection datasets으로 novel object discovery, localization을 수행한다.
(ii) We propose a simple yet effective and scalable method that can be trained end-to-end on the unlabeled domain.

  • First, our network is bootstrapped using a labeled dataset to learn features suitable for categorizing future instances.
  • Then, we learn feature representations suitable for categorization for arbitrary objects using the self-supervised objective.
    (iii) We show that our method can discover and detect novel class instances and outperform prior work, demonstrating the generalization to datasets beyond COCO.

Method Overview

image
two-stage Faster/Mask R-CNN을 기반으로 해서 label이 있는 dataset에 대해서는 supervised manner로 학습해서 각 localized RoI 마다 object-centered feature representation이 만들어진다. 그러면 novel class를 discover하기 위해 간단한 방법으로 feature space상에서 clustering을 수행할 수 있다 (k-means). 그런데 novel instance에 대해서는 하나의 background class로 분류(collapse문제)되는 방향으로 학습되었기 때문에 novel instances에 대해 not discriminative enough하기 때문에 다른 접근법이 필요하다.

따라서 본 논문에서는 source domain, target domain의 region proposal을 모두 end-to-end로 jointly training시킨다.

  • source domain에 대해 class-agnostic model(RPN, bounding box regression head, instance segmentation head(optional), classifier for known classes)을 먼저 학습시킨다.
  • target domain에 대해서 self-supervised training으로 학습시키고 secondary classification head를 추가해서 primary classification head랑 동시에 학습된다
  • 이 때 multiple transformation(augmentation을 주어서 여러 view를 만듦)으로부터 일관된 분류를 수행하는 방향으로 학습되고, class assignments의 marginal distribution이 long-tail distribution을 따른다는 제약 조건이 있는 constraint objective를 최적화한다.

image

Supervised training on the source domain(Labeled)

먼저 self-supervised backbone training on ImageNet으로 R-CNN backbone을 initialize한다. 그리고 source (labeled) domain을 학습시키는데 C^k개의 known class supervision을 사용한다. (80 COCO classes)
Shared feature extractor(backbone)이랑 1) class-agnostic RPN, 2) class-agnostic box regression head, 3)classification head for the categorization of C^k classes를 학습시키는 데 labeled data를 사용한다. 각각을 좀더 구체적으로 보면

  1. RPN을 학습시켜서 각 이미지마다 class-agnostic proposal를 예측하고
  2. RoIAlign을 통해 back본으로부터 RoI feature를 crop하고 최종 예측을 얻는다.
  3. class-agnostic box head를 학습시켜서 각각의 RoI를 K class 중 하나로, 또는 background class로 분류한다.

loss는 아래와 같이 standard R-CNN loss를 쓴다.
image

Discovery on the target Domain(Unlabeled)

먼저, weight matrix에서 background class를 버려서 primary (known) classification head를 수정한다. 그리고 RoI box features 끝에 secondary(novel) classification head를 붙였다.(이 head는 MLP랑 linear classification layer로 구성되어 있음).
이 단계에서 classification heads만 빼고 모든 layer를 freeze시키고 아래 loss와 같이 self sup classification loss 'L_ss'랑 supervised classification loss 'L_cls'를 써서 classification head를 jointly train 시킨다.
image
위 식에서 알파는 supervised loss scale coefficient 하이퍼파라미터여서 알파를 downscale할수록 known class에 대해 weight forgetting을 완화하는 반면 알파를 크게 줄 경우 RoI를 known class로 분류할 때 unwanted bias를 유도할 수 있다.

이 때 Classification loss는 둘다 CE loss이다. L_cls는 provided label로 학습되는 반면 L_ss는 pseudo-label로 학습된다.

간단히 말해 이 loss는 네트워크가 모든 region proposal를 multiple transformation 하에서 일관되게 분류하도록 하고, 중요한 것은 마지막 배치에 대한 predicted class assignments의 marginal distribution이 long-tail distribution을 따른다는 제약 조건 하에서 라는 것이다. annotation-matched region proposal에 대해서만 supervised loss를 계산한다. 이렇게 joint training objective를 통해 네트워크는 known object를 분류하는 기능과 함께 RPN으로 샘플링된 지역에 존재하는 다양한 클래스를 구별하는 기능 또한 갖도록 학습하게 되는 것이다.

Secondary classification head

discovery 단계에서 box features f^이 frozen되면, several non-linear projection layer를 거친다.
image
여기서 g^n은 MLP+ReLU 구조이다. 이렇게 transformation을 거침으로써 RoI box features f^에 영향 없이 novel class 구별을 위한 disentangle feature를 학습한다. projection feature 끝부분에서 cosine classification layer를 써서 novel-class logits를 구한다.
image
여기서 I는 predicted novel-class logits이다.

Self-Supervision via Online Constrained Clustering

Self-sup을 위해 online model training 동안 constrained clustering을 통해 pseudo-labeling을 수행해서 각 RoI마다 soft pseudo-label을 할당한다. 모든 input image의 RoI에 대해 pseudo-label Q을 생성해준다. (SwAV처럼) 이 수도라벨 q를 supervisory signal로 사용해서 CE loss Lss를 학습한다.

Pseudo Label 생성 시 standard clustering method(k-means)를 쓰는 방법을 생각해볼 수 있는데, offline clustering 방법은 학습 시간도 오래걸리고 unstable한 결과를 보였다. 대신에, 우리는 최근 self-supervised representation learning, minimize clustering energy function online during the mode training을 따른다. (cross entropy loss)
image

즉, 현재 network weight에 기반해서 constrained clustering method를 통해 pseudo label q를 생성하고, p^을 optimizing해가는 과정에서 weight를 업데이트해간다.

class pseudo-label를 생성하기 위해 먼저 target clusters의 marginal probability distribution(prior distribution)을 선택한다. 경험적으로, non-symmetrical log-normal distribution을 선택했다. 이 분포는 right-skewed 되어있기 때문에 long-tail 모델링에 적합했다. q는 choson marginals에 가깝게 매치되어야 하고 E를 최소화해야 한다. 기존 연구에서는 이를 constrained optimization문제로 보고 fast online Sinknorn-knopp algorithm을 사용해서 optimal transport problem으로 해결할 수 있음을 보여주었다. 본 논문에서도 이 방식을 차용했다.
image

Memory module

pseudo label을 더 잘 만들기 위해서 메모리 모듈을 둔다. small set feature를 쓰면 noisy cluster assignments될 수 있기 때문이다. 1000 class 이상을 discover하는 시나리오를 위해, Memory module을 두고 RoI box features를 저장한다. queue로 구현해서 각 iteration 마지막마다 oldest set의 sotred feature를 현재 배치로 대체한다. pseudo-labeling 과정에서 extended set의 feature들을 Sinkhorn algorithm에 통과시킨다. 특히, 현재 배치의 RoI feature extract를 한 후 메모리 모듈에 저장된 feature랑 concat하고 logit을 계산해서 Sinkhorn algorithm에 넣는다.
image
메모리 feature로부터 만들어진 수도라벨은 버리고 현재 배치 proposal에서 생성된 라벨만 쓴다. 즉, 이 메모리 모듈의 역할은 오직 현재 배치의 수도 라벨 퀄리티를 향상시키기 위함으로 쓰인다.

Swapping multi-view cluster assignments

image
사진 출처: SWAV paper

self sup 방식에서는 같은 이미지에서 다른 augmentation이 적용된 이미지를 생성하고 그들끼리는 가깝게, 다른 이미지로부터 생성된 augmentated image와는 멀게 학습하는 것이 기본적인 방식이다. 하지만 모든 instance끼리 비교하기는 불가능하기에 batch안의 instance끼리 비교하거나 clustering을 통해 instance discrimination을 수행한다. SwaV라는 논문에서는 같은 이미지로부터 다른 augmentation을 적용한 code끼리의 consistency는 유지하면서 online 방식으로 code를 계산한다. 즉, k prototype set에 매시켜 code qt와 qs를 계산한다. loss는 prototypes에 softmax를 취해서 얻은 확률과 code간의 CE loss이다.
image

본 논문에서도 마찬가지로 이미지 한장 당 two augmented views를 생성한다.

위 사진처럼 하나의 이미지에 다른 augmentation을 적용해서 인코더에 통과시켜 representation을 얻는다. 그리고 z를 trainable한 prototype matrix를 통해 q,q'를 생성한다. 이 때 다른 aug를 적용했더라도 한 이미지에서 나온 code이기 때문에 swap해도 z로 q'를 예측할 수 있어야 하고 z'으로 q'을 예측할 수 있어야 한다는 아이디어이다.
multiple augmentation을 통해 additional supervisiory signal을 사용한다. 그리고 각각의 view마다 Sinkhorn algorithm을 통해 각각 pseudo-label을 생성한다. augmentation에 대한 feature invariance를 강화하고 proposal의 semantic similairty를 캡쳐하기 위해 두 view의 pseudo label을 swap하고 E loss를 계산한다.
image

그래서 total loss는 두 view loss의 평균으로 계산된다. 각각의 view마다 각각 다른 memory module을 쓴다.

Inference and Evaluation

Inference시에는 각 이미지마다 RoI를 뽑고 localization refinement, class prediction head에 통과시킨다.
image
그리고 두 classification head로부터 나온 logit을 concatenate해서 k known, N novel semantic classes의 output class p probabilities를 구한다.

Semantic Class assigments

이 방법론은 novel class에 대해 오직 분류만 수행한다. class ID는 직접적으로 class로 매핑되지 않기 때문에 predicted class ID를 groud truth에 매핑해야 한다. 이를 위해 기존 연구들의 전략을 따른다. 네트워크를 학습하면 evaluation set의 GT annotation에 대한 분류 예측이 만들어진다. 그런 다음 hungarian 알고리즘을 사용해서 GT 레이블과 valication class 사이의 1:1 매핑을 구한다. 이때 GT class에 매핑되지 않은 predicted class의 instance는 무시한다. 그 다음, 생성된 매핑을 적용하고 standard R-CNN post processing /evaluation으로 inference를 수행한다.

Experiments

  • Dataset
    • coco2017, LVIS v1 dataset을 썼다. COCO에서 80 class + 1000+ LVIS classes를 써서 supervised training phase를 거쳤고 이 중 50k의 이미지만 사용했다. 나머지 50k의 이미지는 self sup 단계에서의 unlabeled data로 활용했다.
      image

image
Table3을 보면 projection MLP ablation이 an MLP feature projector on top of RoI box features for novel head classification 효과를 보여주고 있다. 그리고 swap의 효과도 보여주는데 생각보다 큰 차이는 없었다. (전체적으로 0.18정도, 그리고 novel에 대해서는 오히려 떨어짐)
image
image

[41] CLIP Surgery for Better Explainability with Enhancement in Open-Vocabulary Tasks

image

1. CLIP Architecture Surgery to Correct

Opposite Visualization

  • CLIP의 similarity map의 문제는 opposite visualization임. target category에 대해 identifying 할 때 CLIP은 forground region 보다 background region에 집중하는 경향을 보임. (다양한 백본에 대해 동일한 결과.)
image
  • self-attention에서 key랑 value가 opposite semantic regions를 연결하는 경향이 있음.
  • fig 4를 보면 original q-k가 opposite semantic region에 더 집중하는 경향이 있고, 이는 곧 confused relation map이라는 의미임.
image
  • fig 5를 보면 final classification feature의 cosine angle을 계산할 때 FFN 모듈이 self-attention 모듈보다 더 큰 갭을 가지는 결과를 보임.
  • negative label의 코싸인보다 더 큰 값을 가졌고 FFN의 처음 3개의 feature가 negative label feature에 매우 가까움.
  • FFN이 positives를 identifying 할 때 negatives 방향으로 push함을 의미함.
  • 따라서 self-attention module에서 FFNs를 없애서 reform함.

Dual path 설계

  • multiple v-v self attention feature를 merge하는 dual path를 제안함
  • 목적은 안정적인 인풋을 얻고 classification task에서 original features를 유지하는 것임.
  • path를 하나로만 두게 되면 처음에 modification하게 되면, 이후 모듈의 인풋이 바뀌기 때문에 이 차이가 레이어에서 레이어로 전달될수록 증폭되어서 모델이 crash되고 collapse로 이어짐.
  • 따라서 original path를 같이 둠으로써 이 path는 modify 되지 않았기 때문에 새로운 path는 이전 아웃풋을 안정적인 안풋으로 받게 됨.
  • 이 때 dual path는 inference 시에만 merge하고, 학습시에 new path는 쓰이지 않음. 따라서 back-propagation이 필요가 없고 빠르고 직관적임.
image

2. CLIP Feature Surgery to Mitigate Noisy Activations

  • Predicted similarity map in CLIP은 noisy activation 때문에 설명력이 떨어진다는 문제가 있음.
image
  • fig 6을 보면 discriminative areas 대신에 noisy-region을 하이라이트해서 의사 결정을 하는 경향을 보임.
  • 이런 noisy activation은 시각화 퀄리티를 떨어뜨리며, spotty heatmap, irregular shapes를 보임.

그럼 왜 이러 노이지 맵이 생긴것일까?

  1. false prediction
    : 모델이 잘못 예측했을 때 false region에 집중하는 경우
  2. Related context
    : redundant features in CLIP. CLIP은 특정 클래스에 대해 몇 개의 피쳐만 활성화되고 나머지 피쳐들은 non-activated 되기 때문에 이런 non-activated features들이 redundant되어 feature space상에 상당한 영향을 미치게 됨.
  • 이 redundant feature들을 제거했을 때 성능이 상당히 개선됨.

CLIP Feature Surgery (noisy activation 문제를 어떻게 해결할 것인가)

  • class dimension을 따라서 평균 feature를 계산하는 것이 효과적인 접근법일 수 있다.
  • high scoring obvious classes로부터 영향을 받은 카테고리들은 false activations를 보임.
  • 따라서 이미지 피쳐와 택스트 피쳐 각각을 expand 시키고 나서 element-wise multiplication 수행.
  • text token, image token 수만큼 copy해서 expand함. 그리고 channel 축으로 L2 norm.
  • 그다음에 class token이랑 text feature 간의 similarity score를 구함.
image
  • 그다음에 피쳐에 대한 평균값을 구해서 redundant feature는 제거함.

[16] Out-Of-Distribution Representation Learning for Time Series Classification

논문을 읽기 전 정리해야 할 개념: Domain Generalization

이미지에서의 Domain Generalization

우선 domain 이라는 것은 image의 distribution이 다 다른 것을 의미한다.
image
보통은 학습 데이터와 테스트 데이터가 같은 분포라는 가정이 있다. 하지만 위 상황처럼 네 개의 그림이 각각 다른 style을 가지고 있지만 모두 같은 강아지 라는 라벨을 갖는 경우가 있다. 여기서 하나의 style로 학습시키고 다른 style의 강아지를 예측하려고 하면 잘 안된다. 따라서 여러 도메인에 걸쳐 잘 학습시키는 것을 domain generalization이라고 한다.

시계열에서의 Domain generalization 이란?

  • 우선 시계열에서의 domain은 latent distribution을 의미한다.
  • 시계열은 수많은 unknown latent distributions(domains)를 가질 수 있다. 예를 들어 세 명의 사람으로부터 수집된 센서는 서로 다른 distribution을 가질 수 있고 이를 spatial distribution shift라고 부른다.
  • 그리고 한 사람으로부터의 데이터여도 시간에 따라 변할 수 있고 이를 temporal distribution shift 라고 부른다.

Abstract

  • In this paper, we propose to view time series classification from the distribution perspective
  • We argue that the temporal complexity of a time series dataset could attribute to unknown latent distributions that need characterize.
  • To this end, we propose DIVERSITY for out-of-distribution (OOD) representation learning on dynamic distributions of times series.

Introduction

본 논문에서는 dynamically changing distribution을 다루기 위해 distribution 측면에서 OOD representation Learning algorithm을 다룬다. "DIVERSITY"(다양성이 아니라 알고리즘 이름)는 min-max adversarial game 방식을 적용을 했는데, Max부분에서는 diversity를 보존하면서 segment-wise distribution gap을 최대화함으로써 time series data를 여러개의 latent sub-domain으로 나누는 것을 학습한다(worst-case를 학습하는것임) .반대로 Min부분은 latent domain간의 distribution divergence를 최소화하는 방향으로 domain-invariant representation을 학습한다.

What are domain and distribution shift in time series?

예를 들어 세명의 다른 사람들로부터 각각 측정된 센서 데이터는 dissimilarities에 의해 다른 분포를 따를 수 있고 이를 spatial distribution shift 라고 부른다. 또 한 사람이 측정했을지라도 temporal distribution shift가존재할 수 있다.(실험적으로도 증명함)

OOD generalization requires latent domain characterization

비정상성 측면 때문에 나이브한 접근들은 time series data에 대해 one distribution으로 접근하는데, 이렇게 되면 데이터셋 내부의 diversities를 무시하게 되어 domain-invariant(OOD)feature를 포착하는 데 실패한다.
image
fig1의 c를 보면 알 수 있음.

A brief formulation of latent domain characterization

time series data는 (1개의 고정된게 아닌) K개의 unknown latent domain을 가질 수 있다. 학습의 목표는 maximize하는 상황에서 worst-case distribution senario를 학습하는 것이다. (각각의 latent domain 사이의 다양한 정보를 최대한 보존하는 방향이기 때문)

전체적인 프로세스

image
크게 4단계로 요약한다.

  1. Pre-processing: sliding window를 적용해서 전체 학습 데이터를 고정된 크기의 윈도우로 자른다. 이 하나의 윈도우를 smallest domain unit으로 여긴다.
  2. Fine-grained feature update: 이 단계에서는 feature extractor 학습 스텝을 업데이트하는데 pesudo domain-class label을 supervision으로 둬서 업데이트한다.
  3. Latent distribution characterization(Maximization): domain label을 구분하도록 학습한다. diversity를 극대화하기 위해서 distribution gap을 최대화한다.
  4. Domain-invariant representation learning(Minimization): 2에서 만든 pseudo domain label을 사용해서 domain-invariant representations를 학습하고 generalizable model을 학습한다.

2단계부터 좀더 자세히 설명하면

Fine-grained Feature Update

새로운 컨셉인 pseudo domain-class label를 둬서 domain/class level의 knowledge를 사용해서 feature extractor의 supervision으로 사용한다. 그냥 domain이나 label로만 했을 때 보다 둘 다 했을 때 더 fine-grained하다. (뒤에 ablation에서 결과적으로도 확인할 수 있음)

처음 iteration에서는 일단 domain label d'를 0으로 모두 초기화한다. 그리고 per category per domain S를 새로운 클래스로 두는데, S=K * C 이다. (K는 하이퍼파라미터로, pre-defined number of latent distribution 즉 사전 정의한 도메인 갯수를 의미함. C는 라벨을 의미함. )
s = d'*C+y로 supervision을 줘서 pseudo domain-class assignment를 수행한다.

Latent Distribution Characterization

adversarial training을 거쳐서 class label로부터 domain label을 구분한다. 하지만 초기에는 domain label이 없기 때문에 self-supervised pseudo-labeling strategy로 domain label을 얻는다. 이 때 self-sup 방법은 DeepClustering(ECCV'18) 방법롡을 차용했다.

Domain-invariant Representation Learning

latent distribution을 얻고 나면, 일반화를 위해 domain-invariant representations을 학습한다. DANN에서 아이디어를 차용해서 Gradient Reversal Layer(GRL)을 이용한 adversarial training을 통해 classification loss와 domain classifier loss를 동시에 업데이트 한다.

Training, Inference, Complexity

일반적인 학습 방법과의 차이는 마지막 2 steop에서 마지막 few개 layer만 최적화한다. 마지막 step에서는 inference를 수행한다.

슬라이드2
슬라이드3
슬라이드4
슬라이드5
슬라이드6
슬라이드7
슬라이드8
슬라이드9
슬라이드10
슬라이드11
슬라이드12
슬라이드13
슬라이드14
슬라이드15
슬라이드16
슬라이드17
슬라이드18
슬라이드19
슬라이드20
슬라이드21
슬라이드22
슬라이드23
슬라이드24
슬라이드25
슬라이드26
슬라이드27
슬라이드28
슬라이드29

[31] POP: Prompt Of Prompts for Continual Learning

Abstract

  • Continual Learning의 컨셉은 catastrophic forgetting 없이 학습하는 것인데, 여전히 기존 연구들은 학습된 feature space 상에서 semantic drift가 발생하는 경향이 있음.
  • 최근 연구에서는 representation의 generalilty를 해치지 않는 prompt tuning을 통해 specific task를 풀 수 있음을 보여주었음.
  • 하지만 open question은 task specific, global prompt를 모두 학습하는 것. (i.e. capture cross-task information)
  • 본 연구에서는 group of task-specific prompts 와 global prompts를 progressive 하게 학습하는 POP 모델을 제안함.

Introduction

  • 기존 continual learning 연구들은 여전히 forgetting에 취약하고 task 수가 증가함에 따라 메모리와 시간 복잡성이 무한히 증가할 수 있으며 모든 task를 joint training 할 경우 substantial gap을 보일 수 있음.

  • foundation model은 prompt tuning 기술을 적용함으로써 적은 수의 파라미터만 학습하면 되기 때문에 specific tasks에 효율적으로 adapt 될 수 있음. 따라서 generalizable feature representation with great potential for few-shot learning이 가능해짐.

  • 본 연구에서는 2개의 prompts로 구성되어 있는 POP을 제안함.

    • 첫번째는 task prompts P_t로, task t개마다 학습되고 frozen되어서 foundation model이 tas의 class 간의 local한 정보를 discriminate 할 수 있는 prompt
    • 두번째는 모든 task에 대해 continual하게 학습하는 부분으로, 모델이 모든 task의 모든 class 간 global한 정보를 discriminate할 수 있게 하는 prompt

Related work

  • knowledge transfer 방법은 이전 task에서 학습한 정보가 new task에 덮어씌워지면서 이전 task knowledge를 까먹을 수 있음
  • 기존 contrastive learning 중 Network expansion, parameter isolation 등의 방법은 task가 추가될 때마다 모델의 크기가 빠르게 커진다는 것임.

Method

image

  • figure 설명

    • embedding E는 patch를 token으로 매핑하며, prompt set을 학습해가면서 complemented 됨.
    • step t에선s Pt와 POP만 업데이트 됨.
    • 이러한 token은 foundation model에 feed 되며 RPt아 RPOP(task 별, 전체 task의 representation)을 얻게 됨
    • 최종적으로는 RPOP을 평균내서 RPt와 concat하는 방식으로 prompt들을 fuse하고 cross-task feature, task-specific feature를 얻게 됨.
  • build-up 과정

    • Shallow Prompt Tuning: 모델의 input layer에 prompt 두는 방식
    • Deep Prompt Tuning: 모델의 여러 layer에 prompt 두는 방식.
    • Prompt tuning의 가장 큰 장점이라고 볼 수 있는 부분은, A로 학습된 모델을 B에 adaptation 시키기 위해 B로 fine-tuning 하게 될 경우 A에서 학습한 representation이 파괴되고 robustness, generality가 모두 떨어지게 됨. 반면 prompt tuning은 모델의 size와 adaptation 간의 더 나은 trade-off를 찾을 수 있음.
    • foundational feature concatenation 방법은 각 task에 대한 prompt set을 학습하고 메모리 버퍼에 저장해두고, 이러한 prompt를 잘 결합해서 transformer 모델을 모든 task에 adaptation 시키는 것임. 하지만 이런 방법의 경우 이전 task에서 new task로 knowledge를 transfer할 때 주로 특정 task의 데이터로 학습되기 때문에 서로 다른 task representation 간 상당한 redundancy가 있을 수 있다.
  • proposal

    • 본 연구에서는 t시점만이 아니라 이전에 학습한 i<t의 prompt set을 고려할 수 있도록 Pt prompt set을 sequential하게 학습하는 방법을 제안함.
    • t step에서는 i<t prompt sets이 frozen 되고 Pt부분이 learnable한 prompt가 되어 모델에 feed 됨.
    • 이렇게 설계하면 overall model adaptation이 시간에 따라 증가하게 되며 RPt는 이전 task에서 학습한 모든 특징을 Transformer attention을 통해 reuse할 수 있고, 때문에 new task의 novel한 부분을 포착해서 adaptation을 specializate할 수 있음.
    • 그렇다면 각각 다른 task에서 학습한 표현을 어떻게 결합하나?
      • 모델에 feed 될 때 attention layer를 통해 x와 pt간의 연관성이 이미 고려가 되었기 때문에 이전 task representation 중에 다시 mix 하게 됨. (이중으로)
      • 이를 피하기 위해 task 간 information을 integrate하는 방식을 제안한다.
      • 모든 task의 prompt에 추가적인 prompt group을 학습하는 방식이고 이를 prompt for prompts 라고 지칭하고 POP이라고 부름
      • POP sets은 모든 task에서 continually learned 되서 information을 integrate한다.
      • 최종적으로는 POP끼리 평균내서 하나의 feature로 만든 뒤 task specific representation이랑 concat함

Objective Loss

RPOP이 모든 task의 모든 class를 구별하도록 해주는 CIL loss, 각 task RPt가 task t의 class를 구별하도록 해주는 auxiliary loss를 씀.
image
최종적으로 구성된 prompt set Pt는 task t에 속하지 않는 class를 하나의 (none or obove) 카테고리로 분류(reject느낌)하게 하면서 class 간 구별을 하게 함.
image
그다음은 task , class indentity loss임
image
최종 loss는 세 loss의 가중평균임.

Strength

기존 continual learning 연구의 한계를 보완하기 위해 task specific, global prompt를 모두 학습하는 방식을 제안함.

weakness

  • task specific prompt, global prompt를 따로 두는 concept 자체는 이미 dualprompt에서도 제안되었기 때문에 그렇게 novel해보이지 않음.
  • 그렇다면 다른 점은 feature fusing 방식인데, 사실상 feature fusing 방식이 너무너무 간단함. (averaging -> concat)
    image
    실험에서 다양한 fusing methods를 비교해서 보여준 바 있으나, 그럼에도 방법 자체가 너무 간단해서 여전히 novelty 확보가 어려워보임.

[6] Masked-attention Mask Transformer for Universal Image Segmentation

paper link : https://openaccess.thecvf.com/content/CVPR2022/papers/Cheng_Masked-Attention_Mask_Transformer_for_Universal_Image_Segmentation_CVPR_2022_paper.pdf

이 논문을 읽기 전에는 2021년 NIPs에 나온 MaskFormer의 2번쨰 버전인 줄 알았으나, 알고보니 Mask2Former에서 2가 version2가 아니라 이름에 mask가 2개이기 때문이다. 그리고 전체적인 방법론은 MaskFormer의 아이디어를 이어가지만 Mask2Former만의 contribution이나 개선사항이 분명했기 때문에 CVPR에 어셉된 것으로 보임. 특히 배포를 위한 연산적인 측면을 많이 고려하고, specialized 된 개별 task 별 SOTA 알고리즘의 성능을 unified model로 능가할 수 있다는 점이 가장 흥미로웠고 유의미하게 느껴짐.

Abstract

  • 어떤 segmentation에도 다 적용 가능한(semantic, instance, panoptic) new architecture인 Mask2Former를 제안한다.
  • 핵심 요소는 predicted region 내에서만 cross-attention을 제한되게 수행해서 localized feature를 추출하는 masked attention이다.
  • 추가로 3배의 노력을 감소했음에도 best specialized architecture를 압도하는 성능을 보였다.

Introduction

  • Instance/Semantic/Panoptic segmentation은 semantics 만 다름에도 불구하고 각 segmentation task 별로 독립적인 연구가 진행되어 왔다 . 따라서 다른 task 에 일반화되는 유연성이 부족하다.
    • 예를들면 FCNs 의 경우 semantic segmentation 에 쓰이고 mask classification architecture 은 instance level architecture 에 dominate 하다.
  • 이러한 Fragmentation 문제를 다루기 위해 , 최근 연구들은 동일한 아키텍쳐로 여러 segmentation task를 다룰 수 있는 universal architecture 설계를 시도했다. (MaskFormer, K net)
    • 이 Architecture 들은 end to end set prediction 이며 Architecture, loss, traininig process 수정 없이도 여러 task 에 대해 좋은 성능을 보였다.
    • 하지만 Universal architecture 들은 같은 구조를 가짐에도 불구하고 여전히 각각 학습되고 각각 다른 데이터로 학습이 된다 . 즉 , 여전히 specialized architecture 에 중점을 두고 있다.

image
fig 1을 보면 maskformer는 specialized 모델들을 이기지 못하는(특히 instance seg에서 많이 저조함.) 반면에 Mask2Former는 각 task마다 specialized SOTA 모델을 모두 능가함을 확인할 수 있다.

-> We propose a universal image segmentation architecture named Masked attention Mask Transforme(Mask2Former) that outperforms specialized architectures across different segmentation tasks, while still being easy to train on every task.

Related Work

재밌는 점이, Panoptic segmentation의 경우 instance seg랑 semantic seg 구조를 통합한다거나 semantic regions와 instance obejct를 다루는 새로운 구조로 발전해오고 있으니까 instance/semantic/panoptic 성능을 모두 report하는 것이 가능하다. 그럼에도 불구하고 보통 single panoptic segmentation 성능만 report하고 있다. 그 이유는 나머지 두 task에서 성능이 좋지 않기 때문이다. (아까 위에서 fig1에서도 볼 수 있었음.)

  • Contribution 요약
  1. We use masked attention in the Transformer decoder which restricts the attention to localized features centered around predicted segments , which can be either objects or regions depending on the specific semantic for grouping.
  2. We use multi scale high resolution features which help the model to segment small objects/regions.
  3. We propose optimization improvements such as switching the order of self and cross attention , making query features learnable, and removing dropout ; all of which improve performance without additional compute.
  4. we save 3 x training memory without affecting the performance by calculating mask loss on few randomly sampled points.

Method

image

Masked attention

"Local feature들은 self-attention시에 모든 쿼리와 context information을 업데이트하기에 충분하다" 라고 가정함.
-> For this we propose masked attention, a variant of cross attention that only attends within the foreground region of the predicted mask for each quer. instead of attending to the full feature map.

High-resolution features

항상 high-resolution feature map만 쓰는 대신 feature pyramid 구조로 mutli-sclae feuate로 구성해서 저해상도에서 고해상도까지의 feature들을 디코더에 피드해준다. (한번 피드할때 여러 계층을 한번에 넣은 식)
구체적으로는 원본 이미지의 1/32, 1/16, 1/8 resolution으로 구성한다. 각각의 resolution에는 sinusoidal positional embedding(DETR), learnable scale level embedding(Deformable DETR)이 적용된다.
( 저 두 positional embedding이 구체적으로 어떻게 다른지 좀 더 설명하면, sinusoidal positional embedding은 연속된 시퀀스 토큰의 위치를 학습하는 자연어나 음성 인식 등에 쓰이는 반면 learnable scale level embedding은 feature scale이나 magnitute를 학습하기 때문에 feature scale이 중요한 dense prediction에서 주로 쓰인다. )

Optimization improvements

  1. Switch the order of self and cross attention(여기서는 즉 masked attention).
    image
    그림에서 오른쪽은 standard transformer decoder, 왼쪽은 본 논문에서의 디코더이다. masked attention과 self attention의 위치를 바꿔서 연산량을 효율적으로 개선했다.
    생각해보면 ,첫번쨰 self-attention layer은 image-independent하고 이미지로부터의 signal을 포함한다고 볼 수 없다. 따라서 self attention을 수행한다고 해서 정보를 더 많이 가져갈 수 없는 것이다. 그래서 먼저 masked attention을 수행함으로써 연산량을 더 효율적으로 개선했다.
  2. Make query features learnable as well
    (여기서 새롭게 추가한건 아니고 기존처럼 여전히 learnable query positional embedding을 유지했다. )
    learnable query feature는 transformer decoder에서 마스크를 예측하기 전에 supervised 된다. 이 learnable query feature funtion이 마치 region proposal network역할을 해서 mask를 생성하는 능력이 있음을 발견했다.
  3. Remove Dropout
    dropout은 딱히 필요 없고 오히려 성능을 감소시키기에 decoder에서 dropout을 완전히 없애버렸다.

Improve training efficiency

  • Universal architecture를 학습하는데 한 가지 한계는 high-resolution mask prediction에 대해 너무 큰 메모리가 소요된다는 점이다. (ex. MaskFormer는 이미지 한장에 GPU 32G memory를 잡아먹는다...!)
  • M2F에서는 matching할때랑 final loss calcutation을 할때 모든 샘플에 대해 다 계산하는게 아니라 sampled points에 대해서만 masked loss를 적용한다.
  • bipartite matching을 할 때 모든 prediction, ground truth mask에 대해 K개의 point를 uniformly sampling했다. (이 때 K = 112x112= 12544로 설정함)
  • 이런 stategy는 메모리를 3배나 줄이기 때문에 (18 -> 6GB) computational resources 측면에서 user들에게 더 accesible해진다.

Experiments

image
Panoptic seg 성능인데 전부 개선됨과 동시에 더 적은 epoch으로 더 높은 성능을 달성한 것을 볼 수 있다. PQ평가지표는 panoptic quality 이다.
image
Instance segmentation 성능을 보면 대체로 성능은 올랐지만 여전히 samll objects에 대해서는 잘 못잡아내고 있다. (Mask R_CNN 보다 못함.)

image
semantic segmentation 성능도 개선된 것을 볼 수 있다.

image

fig 3은 learnable query가 마치 region proposals의 역할을 한다는 점을 보여주고 있다. 대체로 위치를 잘 하이라이트 하고 있는 것 같다.

image
다양한 ablation table들이다.

image
loss 연산 시 point를 sampling해서 계산했을 때 성능도 개선되면서 메모리가 3배나 줄어들었다는 점은 특히 획기적인 것 같다.

image
Cityscapes dataset에서 panoptic/semantic 둘다 잘 하고 있다.

image

table 7은 m2f의 한계를 보여주고 있다. 여전히 각각 다른 task에 대해 따로 학습하게 된다는 것이다. 3개의 데이터셋애 대해Panoptic seg 결과가 specifically 설계된 instance/semantic seg task보다 안좋음. 이를 통해 m2f가 여러 task를 generalize할 수 있지만 여전히 specific task로 학습되어야 한다는 한계가 존재한다는 것을 알 수 있다.

Conclusion

• Mask2Former obtains top results in all three major image segmentation tasks (panoptic, instance and semantic) on four popular datasets, outperforming even the best specialized models designed for each benchmark while remaining easy to train.
• Mask2Former saves 3 x research effort compared to designing specialized models for each task, and it is accessible to users with limited computational resources.
• We hope to attract interest in universal model design.

[1] The Pursuit of Knowledge: Discovering and Localizing Novel Categories using Dual Memory

Paper : https://rssaketh.github.io/data/ICCV2021_PoHa.pdf

이 논문은 Object Category Discovery Problem task를 다루는 논문이다. train 시에 정의되지 않은 object가 test 시에 등장할 시 이를 Discovery 할 수 있는 방법으로, 기존 closed-set assumption 하에서 진행된 object detection task 보다 더 real-world에 가까운 settting 이라고 볼 수 있다.

또한 인간의 '기억' 방식에 영감을 받아 Incremental Learning(Never-Ending Learning)으로 학습을 하는데, 이를 위해 2개의 메모리를 활용하여 하나의 메모리에는 장기 기억을, 다른 하나의 메모리에는 단기 기억을 저장해서 inference시에 instance를 이 메모리들에 할당해가며 분류를 수행하는 방식이다.

그런데 이 할당하는 방식이 다소 복잡하게 설계되어 있고 후처리가 많은 느낌이라 조금 아쉬웠다. seen class가 20개임에 반해 unseen class가 60개인 극단적인 setting이므로 metric learning과 같은 학습을 개입하기에는 어려웠을 것으로 보이며 ablation study 결과 테이블을 보면 후처리를 여럿 도입한 이유도 이해는 가지만, 좀 더 간단화할 수 있는 assosiation 방법을 고민해보고 싶다. 또 어떻게보면 논문에서의 assosiation 방법론은 rule-based approach인데, 학습을 통해 수행하는 방법을 더 고민해보고 싶다.

또 task 자체가 어려운 셋팅인걸 고려해도 성능이 많이 저조해서 (AUC 1%...) 성능 제고를 위한 효과적인 방법론을 고민할 필요가 있다.

Abstract

  • 본 논문은 large unlabeled dataset에서 novel object를 discovering/localizing하는 문제인 object category discovery problem를 다룬다.
  • 기존 방법론들은 덜 복잡한 scene이나 각 이미지 당 적은 object를 가지는 데이터셋에 대한 결과를 제시하는 반면에, 우리는 challenging COCO dataset에 대한 결과를 제시한다.
  • 또한 Scratch로 새로운 카테고리를 발견하는 대신에 이미 알려진 정보를 활용하고 unknown에 집중한다.
  • 두 memory modules인 Working memory / Semantic memory를 두어서 new category를 discover할 때 prior knowledge를 이용한다.

1. Introduction

Unsupervised visual category discovery는 모델을 학습해서 minimal human supervision으로 large collection of unlabeled images에서 패턴을 식별하는 것을 목표로 한다.

이 Task의 한계:

  1. 일관된 task 정의가 부족
    approach들마다 다양한 목표로 인해 evaluation protocol이 imcompatible하다.

  2. Scalability of contemporary approaches

    • 대부분의 기존 연구 작은 데이터셋을 사용하기 때문에 real-world에 가까운 큰 이미지, 한 이미지 당 많은 수의 object나 categories를 가지는 그러한 경우까지 확장하지 못한다.
    • lack of Online processing of new data

따라서 unsupervised object discovery와 같은 task의 real-world requirements를 보다 밀접하게 반영하는 standardized protocol(datasets and metrics)을 정의할 필요가 있다.

→ 이를 위해 본 논문은 대규모 벤치마크와 real-world complexities를 처리할 수 있는 scalable never-ending discovery approach를 제안한다.

  • 인간의 학습 방식으로부터 영감을 받았다.
  • 마치 인간이 살면서 한 번도 접하지 못한 사물을 계속해서 우연히 접하고, 시간이 지남에 따라 사물들을 인식하는 방법을 배우는 과정과 유사하다
  • 우리가 새로운 물체를 발견하고, 현재 내가 가지고 있는 지식과 연관짓고 업데이트(새로운 개념을 배우거나, 기존 개념을 업데이트)하는 지속적인 학습 패러다임과 유사하다.
  • 우리가 자연스레 위처럼 학습할 수 있는 이유는 바로 ‘기억’ 때문이다. 메모리의 중요성에 대한 압도적인 증거에도 불구하고 메모리는 컴퓨터 비전에서 적게 연구되어 온 요소 중 하나이다. (오히려 신경망의 pretrained weight, konwledge graphs 등에 초점이 맞춰진 채 연구되어옴을 지적.)

본 논문에서 우리는 memory process로부터 영감을 받은 continuous learning approach를 개발하기 위해 memory가 어떻게 사용될 수 있는지 조사한다.

Contribution

  1. A never-ending concept discovery and localization framework, is built using two memory modules: Semantic and Working memory, jointly referred to as dual memory.
  2. A simple, realistic benchmark for never-ending concept discovery, not only to evaluate our approach, but also to enable future works to compare on a standardized protocol.

3. Overview

image

전체적인 구조는 3개의 main module인 Encoding, Storage, Retrieval로 구성되어 있다.

  1. Encoding : Region Proposal Network(RPL)로 candidate region과 그에 해당하는 feature를 학습한다.

  2. Storage: dual memory 즉, 두 메모리 블럭으로 구성되어 있는데 하나는 Semantic memory, 하나는 Working memory이다.

    • Semantic memory:
      • the portion of long-term memory that contains concepts from past experience (current knowledge).
      • “known” 혹은 이전에 discovered된 region에 해당하는 object representation을 slots에 저장한다.
    • Working memory:
      • short-term memory and is responsible for accumulating and temporarily holding information for processing.
      • potentially “discoverable” object representatoin을 slots에 저장한다.
  3. Retrieval : region이 semantic memory에 속하는지, working memory에 속하는지 결정한다.

4. Framework Details

image

세 가지 모듈 Encoding, Storage, Retrieval 각각을 좀 더 자세히 설명하고, 어떻게 상호작용하는지 살펴보고자 한다.

Encoding

  • Encoding module의 목표는 object detector를 써서 이미지를 처리하고 representation을 뽑는 것이다.
  • 여기서는 Faster R-CNN(trained with PASCAL VOC consisting of a set of 20 known objects)을 사용했다.
    (proposals/boxes는 N=150개로 설정했다. )

Storage

Storage module은 두 메모리 블럭(Semantic memory M_s, Working memory M_w)을 포함한다.

  1. M_s
    • M_s는 prior, discovered concepts를 저장하는 목적이다.
    • 처음에 known classes로 object detector를 통해 학습된 ‘semantic priors’로 초기화된다.
    • prior이나 acquired knowledge를 저장한다는 점에서 인간의 long-term memory 측면과 유사하다.
  2. M_w
    • M_s와 달리 M_w는 temporarly store을 위한 storage로, 잠재적으로 discovered될 수 있는 recently encountered objects representation을 다룬다.
    • 처음에는 null값으로 초기화된다.
    • working memory는 인간의 short-term memory와 유사하다.
    • 충분한 instance를 encounter하게 되면, 이들을 다시 할당해서(working memory→semantic memory) 새로운 class를 학습할 때 discovered로 간주된다.

Storage Slots

  • 두 메모리 모듈은 모두 슬롯으로 구성되는데 슬롯은 지금까지 발견된 데이터에서 해당 슬롯에 속한 regions을 represent한다.
  • 이 slot이 object를 나타내는 경우, slot representation은 곧 class를 의미하며 이 class/slot에 속하는 모든 인스턴스를 사용해서 train된다. 이 representation들은 retrieval module에서 new region/instance가 어느 slot에 대응하는지를 결정하는데 쓰인다.
  • 즉, 이 slot은 (어떠한 association rule에 의해)grouping 된 representation들이 모여있는 집합으로 이해하면 되겠다.
  • Slot representation needs to be
    • 해당 slot의 large-set of instance를 representing하는 데 효율적이어야 한다.
    • retireval operation에서 효율적이어야 한다. (associate new instances, updates),
    • large number of object instances and classes로 확장 가능해야 한다.

본 연구에서는 slot representation에 대한 두 가지 chioce인 1) feature centroids 2) classifier에 대해 탐구하며, 각각의 speed/accuracy trade-off가 다르다.

feature → Slot Assosiation 을 판단하는 두 가지 방법 : 1. Cosine similarity 2. LDA Classifier

1. Centroid representation

  • Centroid Representation은 slot u^c에 속하는 모든 인스턴스의 straightforward centroid이다.
  • Cumulative moving average를 써서 효율적으로 업데이트 할 수 있다.
  • Instance feature f와 slot centroid u^c 사이의 Cosine similarity로 association을 판단한다.

2. Classifier representation

  • slot에 속하는 모든 instance를 사용해서 classifier를 학습하고 classification score는 association을 평가하는 데 사용된다.
  • 각 slot에 대해 LDA classifier를 학습한다.
    • 더 구체적으로는, instance를 slot에 associating 하는 문제를 slot vs background 문제로 제시한다.

    • LDA classifier는 closed form solution w,b로 구성된 linear classifier이다.

      image

      image

      여기서 µ^+는 slot에 있는 모든 instance의 평균이다. µ^-는 background class의 평균, π^+/π^-는 positive/background 각각의 샘플 수를 의미한다.

    • background class staticstics는 데이터셋의 모든 이미지에서 box에 대한 online update formula를 사용해서 offline에서 효율적으로 추정할 수 있다. (유도는 supplementary에 있음.)

    • 결론적으로, classifier score(w^T f + b)로 instance feature이 slot에 속할지를 평가한다. 이러한 closed-form solution의 이점은, classifier를 새로운 instance로 업데이트할려면 π^+만 업데이트 하면 된다는 것이다.

Retrieval

  • Decision making task를 수행하는 부분이다. (intuitive item recognition model로부터 영감받음)
  • current state of storage와 고려중인 region의 features를 입력하고 decision making을 수행하는 방식이다.

Process를 차례대로 살펴보면,
image

  • Region이 주어지면, known(previously discovered) objects에 대한 semantic memory M_s를 호출해서 new region이 known class에 해당하는지 여부를 결정한다. 이 때 M_s slot과의 association은 classifier score를 사용해서 평가된다.

    Q. Semantic Memory 중에서 known 인가 아닌가?

    • 만약 known class에 해당한다면? 업데이트

    • known object와 일치하지 않으면? 해당 region에 잠재적으로 새로운 object가 포함되어 있음을 의미할 수 있으므로 Working memory 호출한다. 이 때 region’s feature 와 M_w의 모든 slot의 centroid 사이의 cosine similarity에 의해 계산된다.

      Q. Working Memory 중에서도 known 인가 아가?

      • M_w에 있던 slot이면 그 slot으로 업데이트 (slot centroid는 moving average로 업데이트됨)
      • 기존 slot에 없으면 새로운 slot(new singleton slot)을 만든다.

Memory Consolidation

  • Working Memory M_w는 새로운 컨셉을 발견하는 역할을 하며, 이 과정이 지속적/반복적으로 발생한 후에는 semantic memory와 통합되어야 한다.
  • 이를 위해 working memory에 만들어진 representation을 semantic memory에 추가하는 메모리 통합 단계를 거친다.

진행 방식을 살펴보면,

  • M_s의 slot은 본질적으로 online learned cluster이기 때문에 종종 fragmented cluster가 있다. (cluster에 하나만 할당되는 경우)

  • 따라서 동일한 카테고리에 대한 여러 cluster를 병합하기 위해 graph clustering problem으로 iterative merge step을 수행한다.

    • 여기서 slot은 노드이며 edge weight는 classifier가 다른 slot에 얼마나 잘 작동하는지에 따라 결정된다.
    • MinCut을 사용해 connected componets를 얻고 다른 slot에 재할당할 수 있는 유연성을 제공한다.
  • 하지만 이 방식을 적용할 시 fregment는 덜하지만, merge 후 결과는 일관성이 없고 semantic drift로 이어질 수 있다.
    (ex. 소화기가 마치 병 모양처럼 생겨서 둘이 다른 object임에도 하나로 merge 됨.)

  • 따라서, Ms에 통합된 slot이 일관성을 갖도록 하기 위해, 우리는 classifier를 활성화하지 않는 slot 모든 샘플(예: wTx + b < 0)을 슬롯에서 제거하는 final refine step 을 수행한다.

  • Memory Consolidation 후에 M_w는 original state(null)로 reinitialized 되고 M_s의 slot의 수가 많아지게 된다.

Discovery Set

image

  • 데이터가 주어지면 sequential 하게 discovery process가 진행된다. 따라서 data availability에 대한 assumption을 한 번에 수행하는 것을 자제하고 있다.
  • Network가 기존 내용을 기억하는것을 방지하고 서로 다른 이미지에 대해 classifier에 의한 error가 다를 것이라는 사실을 활용하기 위해 Discovery dataset을 D1, D2로 분할한다.
    • 먼저 D1에서는 discovery & localization을 수행하고 storage slots을 채운다.
    • 그리고 memory consolidation 후에 Ms의 classifier를 D2(validation)에 적용해서 더 많은 example을 찾는다.

이렇게함으로써 정확하고 다양한 샘플을 찾을 수 있을 것 같지만 첫 번째 셋 D1에서 error mode를 detect 하지는 못한다.

→ 따라서 D1으로 M_s를 업데이트 하고 나서 D1, D2를 swap하고 프로세스를 동일하게 진행한다.

5. Experimental Setup

5.1 Benchmark Datasets: 2가지로 설정

  1. known set : Pascal VOC 2007
  • 10k images with annotations for 20 classes.
  • 20개 class를 knonw set으로함
  1. Real-world dataset: COCO
  • 2014 which has 80k train and 5k validation images with annotations for 80 classes.
  • 전체 80개의 class중에서 Pascal VOC와 오버렙되지 않는 60개의 class가 evaluation 시에 novel or unknown으로 쓰인다.

(Pre training에는 ImageNet을 썼지만 60개의 unknown class와 어떠한 유사 class도 학습에 사용하지 않았음)

Justification and Discussion

실험을 어떻게 셋팅했는지 자세히 살펴보면,

  1. Unknown class가 무려 60개나 됨. 매우 어려운 task이며 이러한 scale을 다룰 수 있는 기존 approach들은 없었음.

  2. 이미지의 distribution이 다양함.

    • COCO image가 더 복잡하고 하나의 이미지 당 더 많은 objects를 포함하며 discovery dataset의 비중이 높다.
    • 따라서 모든 이미지들이 최소 하나의 object를 가지며 strong signal을 가지는 Standard discovery dataset보다 우리의 셋팅이 더 어렵다.
  3. Semantic Drift

    • COCO에는20개의 known class와 꽤 비슷한 class들이 있다. Discovery와 never-ending approach는 semanic drift를 피하기 위해 이 class들까지도 잘 분리해야 한다. (헷갈리는 class도 잘 분류하게끔)
  4. Localization focus

    Unlabeled unknowns: 사실 60개의 unknown objects보다 많이 커버할 수 있어 하는데, label 부족으로 인해 일부는 quantitative performance만 평가할 수 있다.

    Pretraininig Dataset

    이미지넷 1000개의 class로 pretrain 할 때 unknown class와 overlap되지 않도록 60개의 novel COCO dataset과 유사한 68개의 class를 지웠다. (이를 ImageNet^-로 부르겠다) backbone network/known detector는 Faster-RCNN을 썼다.

5.2. Evaluation Metrics

  • Co-localization/Recall Metrics

    기존 approach들은 concept discovery를 위해 아래 3가지 metric을 썼다.

    • CorLoc(Corrected Localization) : single object가 ground truth에 대해 IOU>0.5 로 correctly localized 된 퍼센트
    • CorRet(Correct retrieval): 이미지와 동일한 (ground truth) 클래스에 속하는 각 이미지에 대해 Retrieval로 식별되는 가장 가까운 이웃의 평균 백분율(k=10)
    • DetRate(Detection rate): standard recall measure이다.
  • 위 Metric들이 우리의 벤치마크에 적잘하지 않은 이유

    • CorLoc, DetRate는 localization capabilities만 측정하고 discovery performance는 반영하지 않는다.
    • 따라서 이러한 metric은 co-segmentation/localization task에만 적합하다.
    • 게다가 이미지 당 측정하는 instance가 1개여서 너무 단순하며 COCO같은 데이터셋에 적합하지 않다.
    • 따라서 아래의 추가 Metrics 도입
  • Discovery/Pattern-mining Metrics

    • Purity-Coverage plots and/or mean Average Prevision(mAP)로 mining or discovery methods를 평가했다.
    • 이와 함께 discovery process의 효율성을 평가하기 위해 발견된 새로운 물체의 수도 평가한다.
  • Details

    • Cumulative purity를 계산하려면 먼저 모든 cluster의 purity를 계산하고 내림차순으로 정렬한다.
    • 그다음 curve의 k번째 포인트에 대해 top-k clusters의 average purity를 계산하고 coverage(커버되는 ground truth box와의 비율)에 대해 plot한다.
    • 우리는 cluster의 purity를 아래와 같이 정의했다.

    image

    여기서 c는 COCO의 모든 class 수를 의미한다. 마냥 cluster가 많다고 좋은 성능을 내지 못하게 분모를 둔다.

    즉, Cluster의 sample이 어떠한 class로 분류되고 IoU>threshold를 넘으면 그 class에 할당된다. coverage는 커버되는 ground truth box의 비율로 정의한다.

  • Oracle Detection Metric

    • COCO-minival로도 평가한다.

    • 다수결 투표 기반으로 각 cluster에 class label을 할당하기 위해 ground truth annotation 형태로 ‘oracle’의 availability를 가정한다. class assignment에 대해 서로 다른 IoU threshold를 사용한다. (0.2/0.5)

    • Detector를 훈련한 후 모든 class에 대해 reject된 bounding box는 모두 배경으로 처리된다.

    • 제안하는 방법론은 bounding box regression을 수행하지 않는다는 장점도 있다.

      Q. Bounding box regression 이란?

      Selective search(ex. NMS)를 통해 찾은 박스 위치는 정확하지 않기 때문에 Predicted box와 ground truth box와의 차이를 줄여주는 과정이다.

      즉, 성 능을 끌어올리기 위해서 이 박스 위치를 교정하기 위해 predicted box가 ground truth box와 유사하도록 학습한다.

6. Results and Analysis

6.2. Object Discovery Results

  • Large-scale Quantitative Evaluation
    image

  • Smaller-scale Quantitative Evaluation
    image

  • OSD와 비교하기 위해 COCO 2.5k 이미지에서 실행되도록 코드를 수정했다.

  • CorLoc , DetRate에서는 OSD보다 높지만 CorRet에선 OSD이 더 높다.

    • One explanation is that deep features are typically trained for image classification while OSD requires region matching.
    • Moreover, since only few regions are localized by OSD, it results in fewer false positives, thereby resulting in a higher CorRet.

→ 위 세 개 metric 중 어느 것도 object discovery를 적절하게 평가하지 못함

image
정성평가 결과이다. labeled unknown에 대해서 대체로 잘 분류된 것으로 보이고(이 경우 위에서 설명한 oracle 방식으로 class 할당함) unlabeled unknown에 대해서 대체로 유사한 class끼리 grouping된 것을 확인할 수 있다.

6.3. Object Detection Results

image
image
image
image

fig6은 0.5 IoU에 대해 per-class AP를 보여준다.

신호등에 대해 최저(0.08%), 곰에 대해 최대(~17.38%) mAP를 달성했다.

6.4 Ablation Analysis

image

  • (row1-2)Semantic Memory Initialization: Null로 했을때보다 prior knowledge를 썼을 때가 더 좋다.
  • (row3) 각각의 known category에 대해 모든 box에 대한 feature centroid를 계산한다. 이렇게 했을 때 더 많은 object를 discover할 수 있었다.

image

  • Memory Consolidation Componet Analysis

    • 5개 이하로 cluster 된 이미지는 버렸다.
    • Merge step을 거치니까 성능이 좋아졌다. (affinity scores를 기반으로 cluster memberships를 재할당하기 때문에 unknown class에 대한 AuC를 개선한다.)
    • 거기에 Refine step까지 거쳤더니 incoherent samples를 모두 버림으로써 cluster purity를 개선해준다.
  • Recall Analysis
    image
    ImageNet 에서 overlap class 68개를 train에서 빼고 학습했을 때가 오히려 recall 성능이 더 좋았다는 점이 신기했다.

Conclusion and Future Work

  • 우리는 in-the-wild에서 novel categories를 발견하고 localize하기 위해 known objects의 prior knowledge를 활용할 수 있는 dual memory 방식을 제안했다.
  • 그러나 복잡한 장면과 realistic benchmarks의 경우 current object discovery and localization methods를 개선할 여지가 많다.
  • One immediate future work: DNN based Region proposal method를 활용해서 training datasets, seen classes 이상으로 generalize 하는 방법이다.
  • 또 하나의 future work는 in-the-wild에서의 discovery setup에 더 적합한 supervised recognition의 새로운 패러다임이다.
    ( -> assosiation을 대체할 수 있는 더 효율적인 supervised recognition을 말하는 것 같다. 당장에는 zero-shot learning처럼 semantic information을 어느정도 supervision으로 줘서 학습하는 것 밖에 생각나지 않음...! )

[48] Unsupervised Continual Anomaly Detection with Contrastively-learned Prompt

개인적인 의문

  • Anomaly Detection에서 Continual이 왜 필요한지?
  • Pixel-level AUROC는 왜 report 하지 않았을까?

문제 정의

  • Unsupervised Anomaly Detection 최근 연구들 주로 test 시에 class identity 정보에 의존하는 방향으로 진
  • Anomaly detection은 그동안 주로 one model per one class scheme으로 연구가 되어 왔고 이런 효율성의 한계를 극복하고자 multi-class setting으로 연구가 확장되어옴.
  • 하지만, 이런 unified model의 경우 모든 데이터가 한번에 동시에 학습되어야 한다는 한계가 있음. 또한 sequential하게 학습시켜서 continual 하게 adapt하면 이전에 학습한 지식을 retain하는 능력이 부족함.
  • 일반적으로 continual learning은 test단계에서 task identities를 아는지 아는지에 대한 requirement로 나눌 수 있음.
    • Task-aware approach는 explicit하게 task identities를 활용해서 가이드로 해서 학습함.
    • 하지만 항상 inference시에 task identities를 안다고 볼 수 없음. 예를 들어 mvtec dataset 같은 경우에는 screw, hazelnut 이런 class 정보 없이 inference 한다고 생각하면 됨.
    • 이렇게 test 시에 task idenity를 모른다고 가정하는 연구들이 있었는데 (L2P 등) UAD(Unsupervised Anomaly Detection)에서도 잘 된다는 보장이 없음. anomaly data를 많이 확보하는 것이 어렵기 때문에 CL을 UAD에 적용하는 것에 대한 연구가 필수적이라고 주장.
    • DNE라는 논문 이외에는 CL을 UAD에 통합하려는 연구가 없었음. 하지만 DNE는 augmentation에 의존해서 pseudo-supervision을 줌. 이는 anomaly segmentation에 적용하기에 좋지 않음.
    • DNE는 continual anomaly detection보다 continual binary image classification method로 보는게 맞음.

image
이렇게 task identity가 없어도 되는 셋팅임.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.