sy00n / DL_paper_review

issues에 논문 요약
0 stars 0 forks source link

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

Open sy00n opened 1 year ago

sy00n commented 1 year ago

0. Abstract

본 논문은 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을 수행할 수 있다.

1. Introduction

image

  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으로도 알려져 있다.

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

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이 된다.

본 논문에서는 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)