Paper) Manifold Mixup: Better Representations by Interpolating Hidden States 리뷰

2021. 7. 11. 09:58관심있는 주제/뉴럴넷 질문

728x90

다른 분과 논의 중에, 내가 고민하고 있는 것을 다른 관점에서 풀어내고 있는 논문이 있다고 하셔서 보게 된 논문(감사합니다 :))

Title

  • journal
  • 출간 년도
    • 2018년도
  • 그룹

Abstract

딥러닝이 트레인은 잘되지만, 약간 다른 테스트에서는 부정확하지만 확신 있는 예측을 제공함.

  • distribution shifts, outliers, and adversarial examples.

Manifod Mixup을 제시함

  • 신경 네트워크가 hidden representation의 interpolations(보간버)에 대해 덜 자신 있게 예측하도록 장려하는 간단한 규칙화 장치
  • → semantic interpolations을 추가 데이터로 사용하여, 여러 표현 수준에서 보다 부드러운 decision boundaries를 확보할 수 있다고 기대함.
  • 보다 분산이 적은 방향으로 class-representation을 학습한다고 함.

본 눈문에서는 이론 입증, 실제 상황 검증

sl, adversarial task에서 견고성, 테스트 log-likelihood를 향상

Conclusion

  • 심층 신경 네트워크는 종종 부정확하지만 훈련 중에 보이는 것과 다른 예에 대해 극도로 자신 있는 예측을 제공
    • 이 문제는 딥러닝에서 가장 중요한 난제 중 하나

→ 본 논문에서는 딥 뉴럴 네트워크가 학습한 representation의 관점에서 조사함.

  • 저자는 기본 신경 네트워크가 학습 데이터를 representation space 전체에 널리 퍼트리고, 거의 모든 representation volume에 높은 신뢰도 예측을 할당한다는 것을 관찰했다고 함.
    • 네트워크가 높은 신뢰도로 예측을 하기 때문에 discriminative representation을 학습하게이 충분한 동기가 부족하게 돼서 주요한 결점이 된다.
  • 그래서 저자들은 hidden representation의 interpolation에 네트워크를 학습하는 manfiod-mixup을 제시함.
    • manifold mixup은 훈련 중에 보이지 않는 표현 공간의 볼륨 전체에 걸쳐 신경 네트워크가 불확실하도록 장려합니다.
    • 저 차원의 하위 공간에 실제 데이터의 representation을 모음으로써, 더 discriminative 한 피처를 얻을 수 있게 됨
  • 즉 저자들은 하나의 regularization tool로써 다음 논문을 제시함.

result & discussion

  • 어떤 종류의 데이터 사용하였는지?
  • 어떤 분석 방법을 사용하여, 논리를 뒷 밤 침하고 있는지
  • 지도 학습에서 참신한 input deformation에 대한 강건성과 adversarial 예에서 확인해보고 있다.

 

Introduction

training에는 잘되고 test에는 잘 안 되는 경우가 많음

본 논문에서, 최신 신경 네트워크의 hidden representation과 decision boundray와 관련된 몇 가지 곤란한 특성을 깨달았다고 합니다. 첫째, decision boundary가 종종 날카롭고 데이터에 가깝다는 것을 관찰한다. 둘째, hidden representation space의 대부분이 데이터 매니폴드의 온/오프 모두에서 높은 신뢰도 예측에 해당한다는 것을 알 수 있다.

본 논문에서는 선형 조합에 대해서 학습함으로써 결함 중 몇 가지를 해결하는 manifold mixup을 제안하고, 단어 임베딩(king-man+woman = queen)을 통한 유추 연구를 포함한 이전 연구는 보관법이 요인들을 결합하는 효과적인 방법이라는 것을 보여주었다고 한다.

높은 수준의 representation은 종종 저 차원이며 선형 분류자에 유용하기 때문에 hidden representation의 liner interpolations은 특징 공간의 의미 있는 영역을 효과적으로 탐색해야 한다.

데이터 hidden representation의 조합을 새로운 학습 신호로 사용하기 위해, 저자는 또한 연관된 한 쌍의 원할 라벨에서 동일한 선형 보관법을 수행해 소프트 표적을 가진 혼합 예제로 이어지는 것일 제시했다.

이러한 경우는 distributional shifts. Adversarial examples에 의해서 발생하게 됨.

 

manifold mixup은 다중 계층에서 신경 네트워크의 숨겨진 표현과 의사결정 경계를 개선한다고 주장합니다.

manifold mixup가 일반화를 향상할 수 있는 이유는 다음과 같다고 합니다.

  • 다양한 수준의 대표성을 갖춘 학습 데이터에서 멀리 떨어져 있는 보다 원활한 의사 결정 한계로 이어집니다. 부드러움과 여유는 일반화의 잘 확립된 요인이다(Bartlett & Shawe-tayler, 1998; Lee 등, 1995).
  • 더 깊은 숨겨진 계층에서 보간법을 활용하여 더 높은 수준의 정보를 캡처합니다(Zeiler & Fergus, 2013).
  • 클래스 표현을 평탄화하여 분산을 크게 감소시킨다(섹션 3) 이는 잘 확립된 이론(Tishby & Zaslavsky, 2015; Shwartz-Ziv & Tishby, 2017)과 광범위한 실험(Alemi et al., 2017; Belghazi et al., 2018; Achille & Soto, 2018)에 의해 일반화된 압축의 형태로 볼 수 있다.

Manifold Mixup

$Mixλ(a, b) = λ · a + (1 − λ) · b$

$minibatches (x, y) and (x', y') \text{ as usual, until reaching layer k}$

loss와 각 행마다 섞는 작업을 반복함.

def mixup_criterion(criterion, pred, y_a, y_b, lam):
        return lam * criterion(pred, y_a) + (1 - lam) * criterion(pred, y_b)

def mixup_process(out, target_reweighted, lam):
    indices = np.random.permutation(out.size(0))
    out = out*lam + out[indices]*(1-lam)
    target_shuffled_onehot = target_reweighted[indices]
    target_reweighted = target_reweighted * lam + target_shuffled_onehot * (1 - lam)
    
    #t1 = target.data.cpu().numpy()
    #t2 = target[indices].data.cpu().numpy()
    #print (np.sum(t1==t2))
    return out, target_reweighted


def mixup_data(x, y, alpha):

    '''Compute the mixup data. Return mixed inputs, pairs of targets, and lambda'''
    if alpha > 0.:
        lam = np.random.beta(alpha, alpha)
    else:
        lam = 1.
    batch_size = x.size()[0]
    index = torch.randperm(batch_size).cuda()
    mixed_x = lam * x + (1 - lam) * x[index,:]
    y_a, y_b = y, y[index]
    return mixed_x, y_a, y_b, lam

def get_lambda(alpha=1.0):
    '''Return lambda'''
    if alpha > 0.:
        lam = np.random.beta(alpha, alpha)
    else:
        lam = 1.
    return lam
content url
코드 https://paperswithcode.com/paper/manifold-mixup-better-representations-by
논문 http://proceedings.mlr.press/v97/verma19a.html
   
728x90