Skip to content

Very Deep CNN(VDCNN) for NLP

hwkim94 edited this page Jan 16, 2018 · 28 revisions

Abstract

  • character level의 연산
  • 적은 convolution과 pooling 사용으로 메모리 절약
  • 모델을 깊게 만들어 성능의 향상(29 convolution layers)

Introduction

간략한 배경 설명

  • neural network를 NLP에 적용하면 효과가 좋다

  • NLP의 단어들은 sequential하다고 생각되어 RNN으로 처리되는 경우가 많음

  • RNN 중 LSTM이 좋은 성능을 가지고 있다. 하지만, generic learning machine for sequence proccesing which is lacking task-specific structure

  • word embedding이 좋은 결과를 내고 있음

  • convNet은 원래 이미지의 특징을 뽑아내고 분류하기 위하여 사용되는 것이지만, NLP에도 적용

  • 좋은 모델의 경우 layer의 수가 계속 증가하는 추세

  • NLP에서는 문장의 계층적 구조를 잘 파악하는 것이 관건

Related Work

이전 연구들에 대한 간략한 설명

  • cbow, n-gram, TF-IDF

  • RNN

  • CNN

  • 최근엔 RNN과 CNN을 혼합한 모델도 활발하게 연구되고 있음

  • CNN을 더 깊데 만들어보자!!

VDCNN architecture

architecture

architecture

  • 2 x (2+2+2+2) + 1 = 17 층의 convolution layers의 architecture

  • resNet과 VGG를 기반으로 모델링

  • look-up-table

    • input layer 역할, 2D tensor
    • size = (fo, s) = s개의 단어 embedding, f0 = input text의 차원, RGB 역할
  • temp conv layer

    • VGG 처럼 64 convolution layer of size 3
  • 두 가지 design rule

    • 같은 resolution을 가진 output이 출력되면, layer의 feature map 수는 같다
    • resolution이 절반이 되면, layer의 feature map 수를 두배해준다
    • => 메모리 사용량을 줄여줌
  • 기존에는 6층이 최고였지만, 이 방법을 통하여 더 많이 내려갈 수 있게 됨

  • optional shorcut : resNet의 방식대로 적용

  • filter : VGG의 방식대로 size 3만을 적용하여 3-gram 처럼 사용

    • character level에서 연산하기 위하여 size를 키우지 않음
  • 마지막에 k-max pooling을 통하여 512 x k개의 feature를 뽑아낸 후, 벡터로 만들어 fully connected ReLU classifier로 분류

  • regularization을 위하여 temporal batch norm만 사용했으며, dropout은 사용하지 않음

convolutional block

convoulutional block

  • sequential of two convolution layers, each followed by a temporal Batch Norm and ReLU
  • Temporal batch normalization 는 batch normalization과 비슷한 regularization 사용 (mini-batch size일 경우 제외, 그 경우 다른 방식 사용)
  • filter의 크기가 작아서 필요한 parameter가 적기 때문에 convolution layer를 통하여 network의 depth를 많이 늘리는 것이 가능
  • 전체적인 architecture에서 depth 조절을 convolutional block 개수를 통해 조절
  • three types of down-sampling between blocks Ki and Ki+1 :
    • (i) The first convolutional layer of Ki+1 has stride 2 (ResNet-like).
    • (ii) Ki is followed by a k-max pooling layer where k is such that the resolution is halved
    • (iii) Ki is followed by max-pooling with kernel size 3 and stride 2 (VGG-like).
    • ** 이 부분이 잘 이해가지 않음 ㅜㅜ

**Batch normalization : gradient vanishing이 일어나지 않도록 하는 아이디어 중 하나 (아래 참조에 링크)

Experimental evaluation & result

pooling 비교

result1

  • character embedding size 16, mini-batch size 128, learning rate 0.01, momintum 0.9로 학습
  • max-pooling이 다른 pooling기법보다 효과가 좋았다.
  • 모델이 깊어질수록 성능이 좋아졌다.
  • 다른 convNet보다 성능이 졸다.
  • layer가 29개일때 성능이 가장 좋았으며, layer 49개에 대해서는 학습에 실패

residual network 비교

result2

  • resNet을 적용한 것이 적용하지 않은 것보다 더 결과가 좋다.
  • resNet을 통하여 모델이 깊어질 때 accuracy degradation문제를 해결 할 수 있다.

결론

NLP에 CNN을 적용할 때에도, resNet을 활용해 더 깊은 모델을 만드는 것이 성능에 좋다.

Reference

Clone this wiki locally