Hello Computer Vision

비전공생의 FreeMatch(2023) 논문리뷰 본문

Self,Semi-supervised learning

비전공생의 FreeMatch(2023) 논문리뷰

지웅쓰 2023. 12. 18. 21:02

2023 ICLR에 억셉된 논문이고 풀 제목은 FreeMatch: Self-Adaptive Thresholding for Semi-Supervised Learning이다. Flexmatch, AdaMatch의 후속 논문이라고보면 된다.

https://arxiv.org/pdf/2205.07246v3.pdf

 

Introduction

최근 SSL은 pseudo label, consistency regularization으로 이루어진다. 그러나 이러한 fixed threshold, ad-hoc threshold adjusting(Dash 논문에서는 t에 따라 threshold를 변경하지만 learning status 를 반영하지 않는다)은 많은 unlabeled 데이터를 훈련초기에 사용할 수 없을 것이며, class간의 어려움이 존재할 때 이를 잘 대처하지 못한다(초기의 모델은 강아지보다 트럭을 분류하기 어려워할 수 있다). FlexMatch에서는 이러한 부분을 class, 시점마다 다른 local threshold를 주면서 이를 대처하려고 한다(여기서 local threshold란 class threshold를 말한다). 그러나 결국에는 global fixed threshold를 사용한다고 한다(이 부분에 대해서 FlexMatch를 보면 class threshold를 정의는 하지만 결국 global threshold를 사용한다. 그러나 pre-defined하지는 않는데 무슨뜻인지 정확하게 이해할 수는 없었다. 그러나 개인적인 생각으로 저자는 해당 논문의 novelty는 단순히 dynamic threshlold이 아닌 class  불균형이 일어날 때, uniform일 다른 threshlold기법을 사용한다. 그러나 FlexMatch에서는 클래스 분포에 대한 가정은 없는데, 이러한 것을 pre-defined하다고 표현한 것이 아닌가 싶다). 따라서 이 논문에서는 Self-Adaptive class Fairness(SAT)를 사용하여 global, local threshold를 사용한다. 해당 논문의 contribution은 다음과 같다.

1. Using a motivating example, we discuss why thresholds should reflect the model’s learning status and provide some intuitions for designing a threshold-adjusting scheme.

2. We propose a novel approach, FreeMatch, which consists of Self-Adaptive Thresholding (SAT) and Self-Adaptive class Fairness regularization (SAF). SAT is a threshold-adjusting scheme that is free of setting thresholds manually and SAF encourages diverse predictions.

3. Extensive results demonstrate the superior performance of FreeMatch on various SSL benchmarks, especially when the number of labels is very limited (e.g, an error reduction of 5.78% on CIFAR-10 with 1 labeled sample per class).

 

FreeMatch

(논문에서는 해당 chapter 전에 self-adaptive threshold의 중요성을 역설하고 기존의 supervised, unsupervised loss에 대해서 설명한다)

이 논문에서는 learning status를 반영한 global status 사용하고 해당 threshold가 incorrect한 pseudo label을 잘 버릴 수 있도록 stably increase시킨다고 한다. 

초기 global threshold는 1/C로 여기서 C는 class의 개수이다. 여기서 $max(q_{b})$ 값에 따라 threshold가 변경되는데, 클래스에 상관없이 높으면 높을수록 threshold는 높아질 것이다. 더 높아진다는 것은 모델이 초기에는 많은 클래스에 대해 확신이 없어 이 값이 낮겠지만 훈련이 지속될 경우 높아져 global threshold도 높아질 것이다. 추가 t epoch 마다 EMA를 사용해($\lambda$) 천천히 증가시키는 것을 볼 수 있다.

local threshold 같은 경우 global threshold를 바탕으로  추가적으로 조정을 하게 된다.

먼저 local threshold를 사용하는 이유에 대해 다시한번 상기해보자면 class마다 어려움이 다르기 때문에 다른 threshold를 두는 것으로 보면 된다. 각 class마다 threshold를 구하기 위해 $p_{t}(c)$는 위와 같은 식으로 구하는데,  global threshold와 비슷하지만 여기서는 각 클래스의 값들을 고려한다. 만약 모델이 트럭을 분류하기 힘들다면 트럭에 해당하는 값들을 대부분 낮을 것이고 이는 낮은 p값을 갖게된다(여기서 하나의 문제점이라 한다면 어렵다는 것이 단순히 softmax score가 낮은 것을 의미하지는 않을 수 있다. 다른 데이터에 대해 트럭으로 오분류하는 것도 난이도가 높을 수 있는데 여기서는 이러한 케이스는 고려하지 않은 거 같다).

이렇게 각각 구한 p값에 대해서 global threshold와 결합하게 되는데 가장 높은 p 값을 이용해 정규화를 해주는 것을 알 수 있다. 즉 모델이 쉬운 난이도의 클래스에 대해서는 그대로 global threshold를 가져가며, 어려운 난이도의 클래스의 경우 global threshold보다 낮은 local threshold를 가져가는 것이다. 여기서 정규화된 값은 (0, 1] 이다.

 

저자는 class간의 불균형이 일어날 수 있다는 추가적인 가정을 하여서 이에 따른 다른 threshold공식을 사용한다. 그러나 사실 나는 이러한 class imbalance 문제에 대해서는 아직 관심이 없어 넘어가려고 한다.

 

Experiments