반응형

논문 

Mingxing Tan 1 Quoc V. Le 1

Abstract

model scaling을 체계적으로 연구하고 network depth, width, and resolution 을 조정하여 성능 향상

a new scaling method → uniformly scales all dimensions of depth/width/resolution using a simple yet highly effective compound coefficient.

EfficientNets

소스 코드 : https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet

1. Introduction/2. Related Work

depth more layer ResNet, VGG
width channel의 개수 Wider Residual Networks, MobileNets
image resolution input image의 resolution을 키움 Gpipe

compound scaling method

효과적인 이유 : input image is bigger → the network needs more layer to increase the receptive field and more channels to capture more fine-grained patterns on the bigger image.

3. Compound Model Scaling

3.1. Problem Formulation

3.2. Scaling Dimensions

Depth (d): 자주 사용하는 방식

depth 를 깊이 할 경우 high level의 feature를 뽑을 수 있고 generalize 잘 되고 성능이 올라간다

하지만 어느 정도 까지 갈 경우 saturate 상태가 된다.

The intuition is that deeper ConvNet can capture richer and more complex features, and generalize well on new tasks.

하지만 , networks 가 깊어지면 깊어질수록 학습하기 어렵고 vanishing gradient problem이 있다.

skip connection, batch normalization 으로 학습 문제를 완화하지만 매우 깊은 network의 정확도 이득은 감소한다. 예를 들어 ResNet-1000은 ResNet-101 비슷한 정확도를 가진다.

width(w) : small size models에 자주 사용

fine-grained features 쉽게 뽑아내고 train을 쉬운 경향이 있다.

channel을 널리면 network depth를 줄이기 때문에 higher level features이 덜 얻게 되는 문제가 있을 수 있다.

Resolution (r): capture more fine-grained patterns

Resolution  
224x224 early ConvNets
299x299 Rethinking the inception architecture for computer vision
331X331 Learning transferable architectures for scalable image recognition. CVPR, 2018. NasNet
480x480 Gpipe: Efficient training of giant neural networks using pipeline parallelism.
600x600 Mask-RCNN, FPN

너무 크면 정확도도 떨어지고 계산량도 많아진다.

위의 그림을 보시면 width scaling, depth scaling 은 비교적 이른 시점에 정확도가 saturation 되며 그나마 resolution scaling이 키우면 키울수록 정확도가 잘 오르는 것을 확인할 수 있다.

Observation 1 – 네트워크의 width, depth, resolution 중 어느 차원을 scale up 시켜도 성능은 향상된다. 그러나 너무 큰 모델에 있어서는 그 성능 향상이 saturate된다.

3.3. Compound Scaling

직관적으로 생각해보면 Input image가 커지면 그에 따라서 receptive field도 늘려줘야 하고 더 많은 layer가 필요하고 , resolution 이 커져서 특징들을 뽑아낼려면 더 많은 channel이 필요한 것

resolution 키우면 그것에 맞게 depth와 width도 키워야 될 것이다.

Observation 2 –성능과 효율성을 높이기 위해서 ConvNet scaling을 진행할 때, width, depth, resolution의 모든 차원의 밸런스를 맞추는게 중요하다.

compound scaling method

4. EfficientNet Architecture

MnasNet과 비슷한데 latency가 들어있지 않는다.

5. Experiments

5.1. Scaling Up MobileNets and ResNet

기존에 존재한 모델 baseline, depth, width, resolution, compound scale를 변경하여 하였지만 그중에서 compound scale의 정확도가 높았다.

5.2. ImageNet Results for EfficientNet

MnasNet: Platform-aware neural architecture search for mobile. CVPR, 2019 RMSProp optimizer with decay 0.9 and momentum 0.9 batch norm momentum 0.99 weight decay $1e^{-5}$ initial learning rate 0.256 that decays by 0.97 every 2.4 epochs SiLU (Swish-1) activation AutoAugment stochastic depth (Huang et al., 2016) with survival probability 0.8 As commonly known that bigger models need more regularization, we linearly increase dropout (Srivastava et al., 2014) ratio from 0.2 for EfficientNet-B0 to 0.5 for B7.

Table 2

정확도는 비슷하지만 parameter 수와 FLOPS수 가 적다.

parameters-accuracy and FLOPS-accuracy

our EfficientNet models are not only small, but also computational cheaper.

latency을 검증하기 위해 inference latency 도 측정 → Table 4

5.3. Transfer Learning Results for EfficientNet

Table 5 shows the transfer learning performance:

(1) Compared to public available models, such as NASNet-A (Zoph et al., 2018) and Inception-v4 (Szegedy et al., 2017),

(2) Compared to stateof-the-art models, including DAT (Ngiam et al., 2018) that dynamically synthesizes training data and GPipe (Huang et al., 2018)

Figure 6 compares the accuracy-parameters curve for a variety of models.

6. Discussion

Figure 8 Compound scaling에서 2.5%

Figure 7 class activation map (Zhou et al., 2016),

해당 통계는 Table 7에서 보여준다.

Images는 random으로 ImageNet validation set에서 선택되였다.

Figure 7에서 볼 수 있듯이 compound scaling 이 있는 model은 object details 정보가 더 많은 관련 region에 focus을 맞추는 경향이 있는 반면, 다른 models은 object details 정보가 부족하거나 이미지의 모든 objects를 capture 할 수 없다.

반응형
반응형

AN IMAGE IS WORTH 16X16 WORDS: TRANSFORMERS FOR IMAGE RECOGNITION AT SCALE

 

Alexey Dosovitskiy∗,† , Lucas Beyer∗ , Alexander Kolesnikov∗ , Dirk Weissenborn∗ , Xiaohua Zhai∗ , Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby∗,†

Google Research, Brain Team

 

ABSTRACT

Transformer architecture는 NLP task의 de-facto standard이 되었지만, computer vision에 대한 적용은 여전히 제한적이다. vision 분야에서 , attention 는 convolutional networks와 함께 적용되거나 전체 구조를 유지하면서 convolutional networks의 certain components 를 대체하는데 사용한다. 우리는 CNNs 에 대한 이러한 의존이 필요하지 않으며  image patches sequences 에 직접 적용된 pure transformer가 image classification tasks에서 매우 잘 수행할 수 있음을 보여준다. large amounts of data에 대해 pre-trained을 받고 multiple mid-sized  혹은 small image recognition benchmarks (ImageNet, CIFAR-100, VTAB, etc.)로 transferred 했을 때 , Vision Transformer (ViT) 는 state-of-the-art convolutional networks에 비해 우수한 결과를 얻으며 , 학습에 필요한 computational resources가 상당히 작다. 

de facto standard : 사실상 표준

 

1 INTRODUCTION

Self-attention-based architectures, 특히 Transformers (Vaswani et al., 2017)는 NLP 에서 선택된 모델이 되었다. dominant approach은 large text corpus에 pre-train다음 더 작은 task-specific dataset (Devlin et al., 2019)에서 fine-tune 하는 것이다. (large data로 pre-train한다음 작은 data(필요한 작업에 대해서 )로 fine-tune한다.) Transformers’ computational efficiency and scalability 덕분에 100B 이상의 parameters (Brown et al., 2020; Lepikhin et al., 2020)를 사용하여 unprecedented size의 모델을 학습할 수 있게 되었다. models and datasets이 증가해도 performance이 saturating 상태를 이를 기미는 없다. 

하지만 , computer vision에서는 convolutional architectures가 지배적이다(LeCun et al., 1989; Krizhevsky et al., 2012; He et al., 2016) NLP successes의 영향을 받아 multiple works은 CNN과 유사한 architecture를 self-attention (Wang et al., 2018; Carion et al., 2020)와 결합하려고 시도하거나 , 일부 convolutions(Ramachandran et al., 2019; Wang et al., 2020a) 을 완전히 대체한다.  latter models은 이론적으로 효율적이지만  specialized attention patterns을 사용하기 때문에 modern hardware accelerators 에 대해서는 아직 효과적으로 확장되지 않았다. 따라서 large-scale image recognition에서 classic ResNet와 같은 architectures 은 여전히 state of the art (Mahajan et al., 2018; Xie et al., 2020; Kolesnikov et al., 2020)이다. 

NLP의 Transformer scaling 성공에서 영향을 받아 가능한 최소의 수정으로 images에 standard Transformer를 직접 적용하는 실험을 한다. 이를 위해, image를 patches 로 분할하고 Transformer에 대한 입력으로 이러한 patch의 linear embeddings sequence 를 제공한다. Image patches는 NLP application에서  tokens (words)과 동일한 방식으로 처리된다. 우리는 supervised fashion하는 방식으로 image classification에 대한 모델을 학습한다. 

  • image split to patch
  • Transformer의 input에 대한 patch의 linear embeddings sequence 를 제공

strong regularization없이 ImageNet과 같은 mid-sized datasets에 대해 학습한 경우, 이러한 모델은 비슷한 크기의 ResNet보다 몇 % point 더 낮은 정확도를 산출한다. 겉으로 보기에는 실망스러운 결과는 다음과 같다 : Transformers 는  translation equivariance and locality과 같이 cnn에 inherent 된 inductive biases을 일부 결여하고 있으므로 불충분한 양의 data에 대해 학습했을 떄 잘 일반화되지 않는다.

그러나 모델이 더 큰 datasets (14M-300M images)에 대해 학습된 경우 picture 이 변경된다. 우리는 대규모 학습이 inductive bias편견을 능가한다는 것을 발견했다. Vision Transformer (ViT)는 충분한 규모로 pre-trained하고 datapoints 수가 적은 tasks 으로 전송했을 떄 우수한 결과를 얻는다.  public ImageNet-21k dataset또는 in house JFT-300M dataset에 대해 pre-trained 을 받은 경우 ViT 는 multiple image recognition benchmarks에서 state of the art에 접근하거나 능가한다. 특히 best model은 ImageNet에서 88.55% ,  ImageNet-ReaL에서 90.72%, CIFAR-100에서 94.55%, VTAB suite of 19 tasks에서 77.63%의 정확도에 도달한다.

 

2 RELATED WORK

Transformers는 machine translation을 위해 Vaswani et al. (2017)에 의해 제안되었으며, 그 이후 많은 NLP 작업에서 state of the art이 되었다. Large Transformer-based models 은 종종 대형 corpora 에서 pre-trained 을 받은 다음  task at hand에 대해 fine-tuned한다. BERT (Devlin et al., 2019) 는 self-supervised pre-training task를 사용하는 반면 GPT 작업 line 은 pre-training task (Radford et al., 2018; 2019; Brown et al., 2020)로 language modeling을 사용한다. 

images 에 대한 self-attention을 적용하기 위해서는 각 픽셀이 다른 픽셀에 모두 집중해야 한다. pixels수의 2차 비용에서는 현실적인 input sizes로 확장되지 않는다. 그러므로 , image processing에서 transformer를 적용하기 이해 과거에 몇 가지 근사치가 시도되었다. Parmar et al. (2018) 은 globally이 아닌 각 query pixel에 대한 local neighborhoods에 만 self-attention를 적용했다. 이러한 local multi-head dot-product self attention blocks은 convolutions  (Hu et al., 2019; Ramachandran et al., 2019; Zhao et al., 2020)을 완전히 대체할 수 있다.  different line of work에서 Sparse Transformers (Child et al., 2019) 는 이미지에 적용하기 위해 glocal attention에 대한 확장 가능한 근사치를 사용한다. scale attention는 다른 방법은 individual axes (Ho et al., 2019; Wang et al., 2020a)을 따라 극단적인 경우에만 다양한 size (Weissenborn et al., 2019) blocks 으로 적용하는 것이다. 이러한 전문화된  attention architectures 중 다수는 computer vision tasks에서 유망한 결과를 보여주지만 hardware accelerators에서 복잡한 engineering을 효율적으로 구현해야 한다. 

우리와 가장 관견이 있는 model은 input image에서 2 × 2 size의 patches를 추출하고 위에 full self-attention 을 적용하는  Cordonnier et al. (2020) model이다. 이 모델은 ViT와 유사하지만, 우리의 연구는 large scale pre-training makes vanilla transformers competitive 를  (or even better than) state-of-the art CNNs 만든다는 것을 입증하기 위해 더 나아가고 있다. 또한  image classification (Bello et al., 2019) 를 위한 feature maps을 augmenting하거나 object detection (Hu et al., 2018; Carion et al., 2020), video processing (Wang et al., 2018; Sun et al., 2019), image classification (Wu et al., 2020) unsupervised object discovery (Locatello et al., 2020), or unified text-vision tasks (Chen et al., 2020c; Lu et al., 2019; Li et al., 2019) 과 같은 self-attention 를 사용하여 CNN의 output을 추가로 처리함으로써 convolutional neural networks (CNNs) 을 self-attentin 형태와 결합하는데 많은 관심이 있다. 

또 다른 최근 관련 model은 image resolution and color space을 줄인 후 image pixels에 Transformers을 적용하는 image GPT (iGPT) (Chen et al., 2020a)이다. 이 model은 generative model로 unsupervised fashion 방식으로 학습되며 , 그 결과  representation은 classification performance을 위해 fie-tuned 되거나 linearly으로 탐색되어 ImageNet에서 maximal accuracy of 72%를 달성할 수 있다. 

우리의 연구는 tandard ImageNet dataset 보다 더 큰 규모로 image recognition을 탐구하는 papers collection의 증가에 추가된다. additional data sources를 사용하면 standard benchmarks (Mahajan et al., 2018; Touvron et al., 2019; Xie et al., 2020) 에서 state-of-the-art 결과를 얻을 수 있다. 또한 Sun et al. (2017)은 dataset size에 따라 CNN이 어떻게 확장되는지, Kolesnikov et al. (2020); Djolonga et al. (2020) 는 ImageNet-21k and JFT-300M과 같은 large scale datasets 에서 CNN transfer learning에 대한 empirical exploration 수행하고 연구한다. two latter datasets 에도 초점을 맞추지만 prior works에서 사용된 ResNet-based models을 대신 Transformers를 학습한다. 

 

3 METHOD

 model design 에서 우리는 original Transformer (Vaswani et al., 2017)를 최대한 가깝게 따른다. 의도적으로 간단한 이 설정의 장점은 확장 가능한 NLP Transformer architectures 와 그 효율적인 구현이 거의 즉시 사용가능하다는 것이다. 

3.1 VISION TRANSFORMER (VIT)

model의 개요는 Figure 1에 설명되어 있다. standard Transformer 는 token embeddings의 1D sequence를 입력으로 받는다. 2D images을 처리하기 위해, 우리는 image x ∈ R ^(H×W×C ) 를 flattened 2D patches x_p ∈ R ^ {N×(P^2·C)}로 sequence 재구성한다. 여기서  (H, W) 는 original image의 resolution이고 , C는 number of channels이다. (P, P) 는 each image patch의 resolution이다. N = HW/P^2는 patch의 결과로 생성된 수이며 , 이는 Transformer의 effective input sequence length로도 사용된다. Transformer는 모든 layer를 통해  constant latent vector size D를 사용하기 때문에 우리는 학습 가능한 linear projection (Eq. 1)으로 flatten하게 하고 D dimensions으로 mapping한다.  

BERT’s [class] token과 유사하게(NSP next sentence prediction) ,우리는 학습 가능한 embedding을 Transformer encoder (z^0_L) ouput에서의 상태가  image representation y (Eq. 4)로 작동하는 embedded patches (z_0^0 = x_class)의 sequence에 추가한다. pre-training과 fine-tuning중에 classification head가 z^0_L에 부착된다.  classification head 는 pre-training 에 하나의 hidden layer가 있는 MLP와 fine-tuning time에  single linear layer 에 의해 구현된다. 

Position embeddings은 해당 위치 정보를 보존하기 이해  patch embeddings에 추가된다. advanced 2D-aware position embeddings (Appendix D.4)을 사용하여 상당한 향상을 관찰하지 못했기 때문에 학습 가능한 표준 1D position embeddings을 사용한다. embedding vectors 의 sequence결과는 encoder에 대한 입력 역할을 한다. 

Transformer encoder (Vaswani et al., 2017)는 multiheaded selfattention (MSA, see Appendix A) 과  MLP blocks (Eq. 2, 3). Layernorm (LN) 의 alternating layers로 구성된다. Layernorm (LN) 은 모든 block 앞에 적용되며 , 모든 block (Wang et al., 2019; Baevski & Auli, 2019) 뒤에 residual connections 부가 적용된다. 

MLP에는 GELU non-linearity을 가진  two layers가 포함되어 있다. 

 

 

 

 

Inductive bias. 우리는 Vision Transformer가 CNNs보다  image-specific inductive bias가 훨씬 적다는 점에 주목한다. CNNs에서는 locality(지역적), two-dimensional neighborhood structure및 translation equivariance이 전체 model에 걸쳐 각 층에 baked된다. ViT에서는 MLP layers만 local 및 translationally equivariant 반면 , self-attention layers은 global 이다. two dimensional neighborhood structures는 model 시작시 image를 patch로 cutting하고 다른 resolution의 image에 대한 position embeddings 을 조정하기 위해 fine-tuning time등 매우 드물게 사용된다. (아래 설명 참조 ) . 그외에는 초기화 시 position embeddings은 patches의 2D positions에 대한 정보를 제공하지 않으며 patch사이의 모든 공간 관계를 처음부터 학습할 필요가 없다. =>generation 문제  , position 으로 

Hybrid Architecture. raw image patches의 대안으로 , input sequence는 cnn(LeCun et al., 1989) 의 feature maps 에서 혈성될 수 있다.  hybrid model에서 , patch embedding projection E (Eq. 1) 는 CNN feature map에서 추출된 patch에 적용된다. 특별한 경우, patch 는 spatial size 1x1을 가질 수 있는데, 이는 input sequece가 feature map의 spatial dimensions 를 flattening하게 하고 Transformer dimension에 projecting함으로써 얻어짐을 의미한다. classification input embedding및 position embeddings 은 위에서 설명한 대로 추가된다. 

3.2 FINE-TUNING AND HIGHER RESOLUTION

일반적으로 ,  large datasets에서 ViT를 pre-train하고 (smaller) downstream tasks에 fine-tune한다(BERT).  이를 위해, 우리는  pre-trained prediction head를 제거하고 zero-initialized D × K feedforward layer를 부착한다. 여기서 K는 downstream classes의 수이다. 종종 pre-training (Touvron et al., 2019; Kolesnikov et al., 2020)보다 higher resolution으로 fine-tune  하는 것이 유익하다. higher resolution의 images 를 feeding할 때 patch size를 동일하게 유지하여 effective sequence length가 커진다. Vision Transformer 는 arbitrary sequence lengths (up to memory constraints)를 처리할 수 있지만 pre-trained position embeddings은 더 이상 의미가 없을 수 있다. 우리는 pre-trained position embeddings의 original image 내 위치에 따라 2D interpolation을 수행한다. 이 해상도 조정및 patch extraction은 영상의 2D구조에 대한 inductive bias이 Vision Transformer에 수동으로 주입되는 유일한 지점이다. 

 

 

4 EXPERIMENTS

ResNet, Vision Transformer (ViT) 및 hybrid 의 representation learning capabilities을 평가한다. 각 model의 요구사항을 이해하기 위해 다양한 size의 dataset를 pre-train하고 benchmark task를 평가한다. model pre-training의 computational 을 고려할 때 , ViT는 매우 우수한 성능을 발휘하여 낮은 pre-training cost으로 대부분의 ecognition benchmarks에서 state of the art을 달성한다. 마지막으로 , 우리는  self-supervision을 사용하여 작은 실험을 수행하고 self-supervised ViT가 미래에 대한 가능성을 가지고 있음을 보여준다. 

4.1 SETUP

Datasets. model scalability을 탐구하기 위해 1k classes와 1.3M images (we refer to it as ImageNet in what follows), superset ImageNet-21k with 21k classes and 14M images (Deng et al., 2009), and JFT (Sun et al., 2017) with 18k classes and 303M high-resolution images를 사용한다.  Kolesnikov et al. (2020)에 이어 downstream tasks의 test sets를 사용하여 pre-training datasets를 de-duplicate한다. 이러한 dataset에 대해 학습된 모델을 여러 benchmark tasks에 transfer 한다. ImageNet   original validation labels 및  cleaned-up ReaL labels (Beyer et al., 2020), CIFAR-10/100 (Krizhevsky, 2009), Oxford-IIIT Pets (Parkhi et al., 2012), and Oxford Flowers-102 (Nilsback & Zisserman, 2008). 이러한 datasets의 경우 pre processing는  Kolesnikov et al. (2020)을 따른다. 또한 19-task VTAB classification suite (Zhai et al., 2019b에서도 평가한다. VTAB 는 per task 1 000 training examples를 사용하여 다양한 task로의 low-data transfer을 평가한다. tasks 는 Natural – tasks like the above, Pets, CIFAR, etc. 세그룹으로 나뉜다. medical and satellite imagery -전문적인 및 Structured – task로 localization 와 같은 geometric understanding가 필요하다. Model Variants. Table1 에 요약된 것 처럼 BERT에 사용되는 (Devlin et al., 2019) ViT configurations을 기반으로 한다. “Base” and “Large” models은 BERT에서 직접 채택되었으며 우리는 더 큰 "Huge" 모델을 추가했다. 다음의 내용에서는 model size와 input patch size를 나타내기 위해 간단한 notation을 사용한다. 예를 들어 , ViT-L/16 은 16×16 input patch size를 가진 "Large" variant 을 의미한다. Transformer’s sequence lengths는 patch size의 square 에 proportional 하므로 patch size가 smaller 모델은 computationally이 더 많이 듭니다.

baseline CNNs의 경우  ResNet (He et al., 2016)을 사용하지만 Batch Normalization layers (Ioffe & Szegedy, 2015)을 Group Normalization (Wu & He, 2018)로 교체하고  standardized convolutions (Qiao et al., 2019)을 사용했다. 이러한 수정은 transfer (Kolesnikov et al., 2020)을 개선하며, 수정된 모델  “ResNet (BiT)”을 나타낸다. hybrids의 경우, intermediate feature maps을 하나의  “pixel” patch size로 ViT에 공급한다. different sequence lengths하기 위해 

 (i) regular ResNet50 의 4 stage  output을 취하거나 

(ii)  stage 4 제거, stage 3 (keeping the total number of layers)에 동일한 수의 layer batch 및 이 extended stage 2의 출력을 취한다. 

옵션 (ii)은 sequence length 가 4배 더 길어지고 ViT model은 더 비싸다. 

Training & Fine-tuning. 

batch size : 4096  Adam (Kingma & Ba, 2015) with β1 = 0.9, β2 = 0.999을 사용하여 ResNets를 포함한 모든 모델을 학습하고 , 

high weight decay of 0.1 -> 이는 모든 model의 transfer에 유용한 것으로 나타냈다(Appendix D.1은 일반적으로 practices과 대조적으로 ResNets에서 Adam이  SGD보다 약간 더 잘 작동하는 것을 보여준다. ). 우리는 linear learning rate warmup 과 decay를 사용한다. 자세한 내용은 Appendix B.1를 참조한다. fine-tuning의 경우 모든 model에 대해 momentum과 함께 SGD를 사용하고 , 

batch size : 512를 사용(Appendix B.1.1 참조)

 Table 2의 ImageNet results의 경우  ViT-L/16의 경우 512 및  ViT H/14의 경우 518의 resolution로 fine-tuned했으며 0.9999 (Ramachandran et al., 2019; Wang et al., 2020b) factor 로 Polyak & Juditsky (1992) 평균값을 사용했다. 

Metrics. few-shot 또는fine-tuning accuracy를 통해 downstream datasets에 대한 결과를 보고한다. Few-shot accuracies는 training images subset 의 (frozen) representation 을 

{−1, 1}^K target vectors에 mapping하는 regularized 된 least squares regression problem을 해결함으로써 얻어진다. 이 formulation 을 사용하면 exact solution을 closed form로 복구할 수 있다. 주로 ine-tuning performance에 focus을 맞추고 있지만  fine-tuning 비용이 너무 많이 드는 즉각즉인 evaluation를 위해 linear few-shot accuracies를 사용하기도 한다. 

4.2 COMPARISON TO STATE OF THE ART

우리는 먼저 가장 큰 모델 -  ViT-H/14 and ViT-L/16 을 논문의 state-of-the-art CNNs 과 비교한다. 

  1. 비교 point는 large ResNets로 supervised transfer learning 을 수행하는 Big Transfer (BiT) (Kolesnikov et al., 2020)이다.
  2. Noisy Student (Xie et al., 2020) 으로 , label이 제거된 상태에서 ImageNet 과 JFT300M  에 대한  semi-supervised learning  학습된 대규모 EfficientNet 이다. 현재 Noisy Student 는 여기에 보고된 다른 dataset 의 ImageNet and BiT-L the state of the art이다.

모든 mode은 TPUv3 hardware에 대해 학습을 받았으며, 각 모델을 pre-train 하는데 걸리는 TPUv3-core days,즉 학습에 사용되는 TPU v3 cores (2 per chip)를 일 단위로 곱한 값으로 보고한다. 

Table 2는 결고를 보여준다. JFT-300M 에서 pre-trained된 smaller ViT-L/16 model 은 모든 작업에서 BiT-L (which is pre-trained on the same dataset) 을 능가하는 동시에 학습에 필요한 computational resources 가 훨씬 더 적다. 더 큰 larger model,  ViT-H/14는 특히ImageNet, CIFAR 100, and the VTAB suite 등 challenging datasets에서 성능을 더욱 향상시킨다. 흥미롭게도, 이 모델은 여전히 이전의 state of the art보다 pre-train 하는데 훨씬 적은 compute 시간이 소요되었다. 그러나pre-training efficiency은 architecture choice 뿐만 아니라 training schedule, optimizer, weight decay, etc과 같은 다른 parameters에 의해 영향을 받을 수 있다는 점에 주목한다. Section 4.4에서 서로 다른 architecture에 대한 performance vs. compute 에 대한 통제된 연구를 제공한다. 마지막으로 public ImageNet 21k dataset에서  pre-trained  ViT-L/16 model은 대부분의 데이터 세트에서도 우수한 성능을 발휘하는 동시에 사전 학습에 필요한 dataset에서도 우수한 성능을 발휘하는 동시에 사전 학습에 필요한 resource를 적제 사용한다. 약 30 days내에 8개의 cores가 있는 standard cloud TPUv3 를 사용하여 학습할 수 있다. 

Figure 2 는 VTAB 작업을 각각의 group으로 나누고, ImageNet과 Youtube(Tschannen et al., 2020)  에서 co-trained 한 ResNet 및 S4L – supervised plus semi-supervised learning on ImageNet (Zhai et al., 2019a) 의 previous SOTA methods 과 비교한다. ViT-H/14 는 Natural and Structured tasks에서 BiT R152x4 및 기타 방법을 능가한다. Specialized 에서 top two models 의 성능은 비슷하다. 

4.3 PRE-TRAINING DATA REQUIREMENTS

Vision Transformer는 arge JFT-300M dataset에서 pre-trained했을 때 성능이 우수하다. ResNets보다 vision에 대한 inductive biase이 적은 경우 dataset size가 얼마나 중요 합니까? 우리는 two series 의 실험을 수행한다.

  1. ViT models 을 size가 증가하는 dataset에 pre-train을 한다. ImageNet, ImageNet-21k, and JFT300M. 더 작은 datasets에서 성능을 향상 시키기 위해 weight decay, dropout, and label smoothing 이라는 세가지 basic regularization parameters를 최적화 한다. Figure 3 은 ImageNet (results on other datasets are shown in Table 5) finetuning  한 후의 결과이다. 가장 작은 dataset에 대한 pre-trained을 받은 mageNet, ViT-Large models은 regularization(moderate)에도 불구하고 ViT-Base models에 비해 성능이 떨어진다. ImageNet-21k pre-trainin으로 , 그들의 성능은 비슷하다. JFT-300M에서만 larger models의 이점을 충분히 누릴 수 있다. Figure 3으 또한 다양한 크기의 BiT 모델에 의해 확장된 성능 영역을 보여준다. BiT CNNs은 ImageNet에서 ViT를 능가하지만 dataset가 클수록 ViT를 능가한다. 
  2. 9M, 30M, and 90M 의 random subsets 과 full JFT300M dataset에 대해 모델을 학습한다. smaller subsets 에 대해 additional regularization를 수행하지 않으며 모든 설정에 동일한 hyper-parameters를 사용한다. 이러한 방식으로 regularization의 효과가 아닌  intrinsic model properties을 평가한다. 그러나 early-stopping을 사용하고 학습 중에 달성한 최고의 검증 정확도를 보고한다. 컴퓨팅을 절약하기 위해 full finetuning accuracy 대신  few-shot linear accuracy를 보고한다. Figure 4 는 결과를 나타낸다. Vision Transformers는 소규모 datasets에서 비슷한 계산 비용으로 ResNet보다 더 많이 적합하다.예를 들어 , ViT-B/32는 ResNet50보다 약간 빠르다. 9M subset에서는 성능이 훨씬 떨어지지만 90M+ subsets에서는 더 우수하다. ResNet152x2 and ViT-L/16도 마찬가지이다. 이 결과는 convolutional inductive bias가 너무 작은 datasets에 유용하다는 직관을 강화하지만 , 더 큰 dataset의 경우 데이터에서 직접 관련 pattern을 학습하는 것으로 충분하고 심지어 유익하다. 

Note that the ImageNet pre-trained models are also fine-tuned, but again on ImageNet. This is because the resolution increase during fine-tuning improves the performance. => ImageNet pre-trained models are도 ImageNet에서 fine-tuned된다. fine-tuning 중 에 resolution 가 높아지면 향상되기 때문이다. 

 

전반적으로 ImageNet (Figure 4)의 few-shot 결과와  VTAB (Table 2)의 low-data 결과는 매우 낮은 data 전송에 대해 유망해 보인다. ViT의 few-sho properties에 대한 추가 분석은 향후 작업의 흥미로운 방향이다. 

 

 

 

4.4 SCALING STUDY

우리는 JFT-300M의 전송 성능을 평가하여 다양한 모델에 대한 제어된 sacling 연구를 수행한다. 이 설정에서 data size는 model의 성능에 bottleneck 현상을 일으키지 않으며, 각 model의 성능 대 pre-training cost을 평가한다. model set에는 7 ResNets, R50x1, R50x2 R101x1, R152x1, R152x2, pre-trained for 7 epochs, plus R152x2 and R200x3 pre trained for 14

epochs; 6 Vision Transformers, ViT-B/32, B/16, L/32,  L/16, pretrained for 7 epochs, plus L/16 and H/14 pre-trained for  4 epochs; 5 hybrids, R50+ViT-B/32, B/16, L/32, L/16 pretrained for 7 epochs, plus R50+ViT-L/16 pre-trained for 14 epochs (hybrids의 경우, model 이름 끝에 있는 숫자는 patch size가 아니라 ResNet Backbone의 총 sampling 비율을 나타낸다. ) 

Figure 5는 총 pre-traing compute(계산 비용에 대한 자세한 내용은  Appendix D.5 참조). model 별 세부 결과는 몇 가지 패턴을 관찰할 수 있는 Appendix. A Table 6 에 제공된다. 

첫째 ,Vision Transformers 가 performance/compute trade-off를 통해 ResNet을 지배한다. ViT의 동일한 성능 (평균 5개 이상의 dataset)을 달성하기 위해 약 2-4 배 적은 compute을 사용한다. 

두번째, hybrids는 적은 계산으로 ViT를 약간 능가하지만 대형 model에서는 그 차이가 사라진다. 이 결과는 다소 놀랍다. 어떤 size에서도 ViT를 지원할 수 있는 convolutional local featrue  processing가 예상될 수 있기 때문이다. 

셋쨰, Vision Transformers는 시도한 범위내에서 saturate 상태가 아닌것으로 보여 향후 scaling efforts에 동기를 부여한다. 

4.5 INSPECTING VISION TRANSFORMER

Vision Transformer가 이미지 data를 처리하는 방법을 이해하기 위해  internal representations을 분석한다. Vision Transformer 의 첫번째 layer는 lower-dimensional space (Eq. 1)에  linearly projects한다. Figure 7 (left) 은 learned embedding filters의 top principal compenents 를 나타낸다. components 는 가 patch 내의 fine structure의 low dimensional representation을 위한 그럴듯한 기본 기능과 유사하다. 

투영 후 학습된 position embedding이 patch representation에 추가된다. Figure 7 (center) 은 모델이 position embedding의 유사성으로 이미지 내 거리를 encoding 하는 방법을 학습한다는 것을 보여준다. 즉 더 가까운 patch는 position embedding이 더 유사한 경향이 있다. 또한 row-column structure가 나나난다. 동일한 row/column 에 있는 patch에 유사한 embedding이 있다. 마지막으로 , sinusoidal structure는 떄때로 더 큰 grids(Appendix D) 에서 명백하다.  position embeddings이 2D image topology 를 나타내는 방법을 배운다는 것은 수작업으로 만들어진 2D 인식 embedding 변형이 개선(Appendix D.4)을 산출하지 못하는 이유를 설명한다. 

ViT는 Self-attention을 통해 가장 낮은 layer에서도 전체 이미지에 걸쳐 정보를 통합할 수 있다. 우리는 network 가 이 기능을 어느 정도 사용하는지 조사한다. 특히 attention weights (Figure , right) 를 기준으로 정보가 통합되는 이미지 공간의 평균 거리를 계산한다. 이 “attention distance”는 CNN의  receptive field size 와 유사하다. 우리는 몇몇 head가 이미 가장 낮은 계층에 있는 대부분의 이미지에 주의를 기울이는 것을 발견했는데, 이는 전 세계적으로 정보를 통합하는 기능이 실제로 모델에 사용되고 있음을 보여준다. 다른 attention  head는 lower layer에서 attention distances가 지속적으로 작다. 이러한 highly localized attention는 Transformer (Figure 7, right) 이전에 ResNet을 적용하는 hybrid model에서는 덜 두드러지며, 이는 CNN 초기 convolutional  layer와 유사한 기능을 제공할 수 있음을 시사한다. 또한 , attention distance는 network depth에 따라 증가한다. 전체적으로 , model이 classification (Figure 6)와 의미적으로 관련이 있는 이미지 영역에 해당하는 것을 발견했다. 

 

4.6 SELF-SUPERVISION

Transformers는 NLP task에서 인상적인 성능을 보여준다. 그러나  이러한 성공의 대부분은 뛰어난 확장선 뿐만 아니라 대규모 elf-supervised pre training (Devlin et al., 2019; Radford et al., 2018)에서 비롯한다.우리는 또한 BERT에 사용되는  masked language modeling task 을 모방하여 self supervision을 위한 maskted patch prediction에 대한 예비 탐사를 수행한다. self-supervised pre-training을 통해 , smaller ViT-B/16 model 은 ImageNet에서 79.9% accuracy를 달성하여 처음부터 2%의 대폭 향상되었지만 supervised pre-training에는 여전히 4% 뒤처져 있다. Appendix B.1.2에는 자세한 내용이 포함되어 있다. contrastive pre-training (Chen et al., 2020b; He et al., 2020; Bachman et al., 2019; Henaff et al., 2020)에 대한 탐구는 미래 작업에 맡긴다. 

5 CONCLUSION

image recognition에 Transformers 를 직접 적용하는 방법에 대해 알아봤다. computer vision에 self-attention 를 사용한 이전 작업과 달리 , initial patch extraction step와 는 별도로 image-specific inductive biases 을 arichitecture에 도입하지 않는다. 대신에 image patches를 sequence로 해석하고 NLP에서 사용되는 standard Transformer encoder에 의해 처리한다. 이는 단순하지만 scalable 전력은 대규모 datasets에 대한 pre-training 과 결합했을 때 놀라울 정도로 잘 작동한다. 따라서 Vision Transformer는 많은 image classification datasets에서 최신 기술과 일치 하거나 이를 초과하지만 pre-train은 상대적으로 저렴하다. 

이러한 initial results는 encouraging만 , 여전히 많은 challenges 가 남아있다. 

1. ViT 를 detection and segmentation과 같은 다른 computer vision tasks에 적용하는 것이다. 우리의 결과는 Carion et al. (2020)의 결과와 결합되어 이 접근 방식의 가능성을 나타낸다. 

2. elfsupervised pre-training methods을 게속 탐구하는 것이다. 우리의 initial experiments은 self-supervised pre-training보다 개선 되었음을 보여주지만, self-supervised and large-scale supervised pretraining 사이에는 여전히 큰 차이가 있다. 

ViT 의 further scaling 으로 인해 성능이 향상될 가능성이 높다. 

 

 

APPENDIX

A MULTIHEAD SELF-ATTENTION

Standard qkv self-attention (SA, Vaswani et al. (2017))

Multihead self-attention (MSA) is an extension of SA in which we run k self-attention operations, called “heads”, in parallel, and project their concatenated outputs.

 

B EXPERIMENT DETAILS

B.1 TRAINING

B.1.1 FINE-TUNING

384 resolution

B.1.2 SELF-SUPERVISION

 

C ADDITIONAL RESULTS

 

D ADDITIONAL ANALYSES

D.1 SGD VS. ADAM FOR RESNETS

D.2 TRANSFORMER SHAPE

D.3 HEAD TYPE AND C L A S S TOKEN

D.4 POSITIONAL EMBEDDING

D.5 EMPIRICAL COMPUTATIONAL COSTS

D.6 AXIAL ATTENTION

D.7 ATTENTION DISTANCE

D.8 ATTENTION MAPS

D.9 OBJECTNET RESULTS

D.10 VTAB BREAKDOWN

 

출처 : AN IMAGE IS WORTH 16X16 WORDS:TRANSFORMERS FOR IMAGE RECOGNITION AT SCALE

파파고 번역을 많이 참조했다. 

반응형
반응형

arxiv.org/abs/1311.2901

 

Visualizing and Understanding Convolutional Networks

Large Convolutional Network models have recently demonstrated impressive classification performance on the ImageNet benchmark. However there is no clear understanding of why they perform so well, or how they might be improved. In this paper we address both

arxiv.org

Abstract

Large Convolutional Network models 은 ImageNet benchmark(AlexNet) classification에서 상당히 인상적인  성능을 주었다. 하지만 그것들은 왜 성능이 좋은지 왜 향상이 되였는지에 대한 명확한 이해가 없습니다.  => 이 이유에 대해 논문에서 재기한다.

intermediate feature layer 과 operation of the classifier의 통찰력을 제공하는 새로운 시각화 기법을 소계하였다.

diagnostic role에 사용되는 이러한 시각화를 통해 ImageNet Classification benchmark AlexNe보다 성능이 뛰어난 모델 아키텍츠를 찾을수 있다.

또한 다른 모델 계층에서 성능 기여를 발견하기 위해 ablation study를 수행한다.

데이터 세트에 대해 일반화 잘됨

softmax classifier is retrained하면 Caltech-101 및 Caltech-256 sota

 

ablation study :의학이나 심리학 연구에서, Ablation Study는 장기, 조직, 혹은 살아있는 유기체의 어떤 부분을 수술적인 제거 후에 이것이 없을때 해당 유기체의 행동을 관찰하는 것을 통해서 장기, 조직, 혹은 살아있는 유기체의 어떤 부분의 역할이나 기능을 실험해보는 방법을 말한다. 이 방법은, experimental ablation이라고도 알려져 있는데, 프랑스의 생리학자 Maria Jean Pierre Flourens이 19세기 초에 개척했다. Flourens은 동물들에게 뇌 제거 수술을 시행하여 신경계의 다른 부분을 제거하고 그들의 행동에 미치는 영향을 관찰했다. 이러한 방법은 다양한 학문에서 사용되어왔으며, 의학이나 심리학, 신경과학의 연구에서 가장 두드러지게 사용되었다.

 

 

Machine learning에서, ablation study는 "machine learning system의 building blocks을 제거해서 전체 성능에 미치는 효과에 대한 insight를 얻기 위한 과학적 실험"으로 정의할 수 있다. 

 

cumulu-s.tistory.com/8

 

Ablation study란 무엇인가?

논문을 읽던 중, ablation study 라고 하는 단어를 종종 마주할 수 있었다. 따로 논문에 이게 어떤 것인지에 대해서 설명이 없어서, 이에 대해서 정리해보고자 한다. In the context of deep learning, what is an.

cumulu-s.tistory.com

1. Introduction

Convolution Networks(convnets)  : hand-written digit classification and face detection에 우수한 성능을 보여주었다.

visual classification tasks 에서도 탁월한 성능을 제공한다.

주목말한 것은 2012년 ImageNet 2012 classification benchmark, with their convnet model achieving an error rate of 16.4%, compared to the 2nd place result of 26.1%.

convnet 모델에 대한 이러한 새로운 관심에 대한 몇 가지 요인은 다음과 같습니다.

(i) the availability of much larger training sets, with millions of labeled examples;

(ii) powerful GPU implementations, making the training of very large models practical and

(iii) better model regularization strategies, such as Dropout (Hinton et al., 2012).

visualization technique

diagnose potential problems with the model =>  observe

multi-layered Deconvolutional Network (deconvnet)

 

1.1. Related Work

네트워크에 대한 직관을 얻기 위해 기능을 시각화하는 것은 일반적인 관행이지만 대부분 픽셀 공간에 대한 투영이 가능한 첫 번째 레이어로 제한됩니다. 상위 계층에서는 그렇지 않으며 활동을 해석하는 방법이 제한적입니다.

 

문제는 더 높은 계층의 경우 불변성이 매우 복잡하여 간단한 2차 근사로 제대로 캡처되지 않는다는 것입니다.

 

top-down projections

 

2. Approach

standard fully supervised convnet models

2.1. Visualization with a Deconvnet

Then we successively (i) unpool, (ii) rectify and (iii) filter to reconstruct the activity in the layer beneath that gave rise to the chosen activation.

Unpooling :

convnet에서  the max pooling operation 는 non-invertible 이지만 , 우리는  switch variables set의 각 pooling region내에서 maxima 의 위치를 기록하여 대략적인 역함수를 얻을 수 있다.

Rectification : relu non-linearities 

relu 는 max(0, x) 이여서 기능 맵이 항상 양수임을 보장한다.

Filtering :  deconvnet  

flipping each filter vertically and horizontally

 

3. Training Details

One difference is that the sparse connections used in Krizhevsky’s layers 3,4,5 (due to the model being split across 2 GPUs) are replaced with dense connections in our model.

sparse connections-> dense connections 

 

4. Convnet Visualization

Feature Visualization:

Feature Evolution during Training:

The lower layers of the model can be seen to converge within a few epochs. However, the upper layers only develop develop after a considerable number of epochs (40-50), demonstrating the need to let the models train until fully converged.

Feature Invariance: 

4.1. Architecture Selection

4.2. Occlusion Sensitivity

4.3. Correspondence Analysis

 

5. Experiments

5.1. ImageNet 2012

Varying ImageNet Model Sizes:

5.2. Feature Generalization

Caltech-101:

Caltech-256:

PASCAL 2012:

5.3. Feature Analysis

 

6. Discussion

First, we presented a novel way to visualize the activity within the model.

We also showed how these visualization can be used to debug problems with the model to obtain better results, for example improving on Krizhevsky et al. ’s (Krizhevsky et al., 2012) impressive ImageNet 2012 result.

then demonstrated through a series of occlusion experiments that the model, while trained for classification, is highly sensitive to local structure in the image and is not just using broad scene context.

Finally, we showed how the ImageNet trained model can generalize well to other datasets.

 

 

 

참조 : 구글 번역기

반응형
반응형

[논문]:Gradient-Based Learning Applied to Document Recognition

LeNet5 

 

LeNet5  간단하게 요약  :

모델 구조 

Convolutional Neural Network 

subsmapling 

우편번호와 필기체 인식하기 위한

 

XI. Conclusions

학습

CNN을 통해 직접 특징 추출하는 것을 할 필요 없게 되었음.

GTN을 통해 파라메터 튜닝, 레이블링, 경험에 의존한 방법들의 사용을 줄일 수 있었음.

학습할 데이터가 많아지고 , 컴퓨터도 빨라졌다.

그래서 학습이 중요하다. 

 

bACK-propagation algorithm

multi-ayer neural networks

gradient-based learning  for Graph transformer Netorks

 

Maximum Likelihood Principle

 

해당 GTN은 전체적인 성능 향상을 위해 여러 모듈들에 대해 Gradient 기반 학습을 하도록 합니다.
GTN에 대해 대략적으로 읽어본 결과, 수표 인식을 위해 캐릭터 하나 하나를 분할하기 위한 방법에 대해 설명하는 내용이었습니다

1. Feature extration 전통저긍로 fixed transform

2. segmentation and recognition of objects in image cannot be compeletely decoupled.

3. Hand truthing images to obtain segmented characters for training a character recognizer  is expensive and does not take into account the way in which a whole document or sequence of characters will be recognized.

4. Ambiguities inherent in the segmentation, character recognition, and linguistic model should be integrated optimally.

5. traditional recognition systems rely on many hand-crafted heuristics to isolate  individually recognizable objects.

Space Displacement Neural Network

 

Abstract--

Gradient-Based Learning Technique  

back-propagation algorithm  -> gradient-based learning technique  ->high-dimensional patterns

이 논문은 다양한 방법으로 handwriten character recognition 를 지원하고 표준화 손글때 digit recognition 을 비교하는 작업이다.

Graph Transformer Networks:

주요한 역할은 original image에서 아직 연결되지 않는 노드들의 유용한 연결을 식별한다.

Two systems for on-line handwriting recognition

experiments demonstrate global training

GTN: flexibility  bankcheck 

 

1. Introduction 

pattern recognition systems

이 논문에서의 주오한 메시지는 

better pattern recognition systems can be built by relying more on automatic learning, and less on hand-designed heuristics.

 

End-to-end & Hand-crafted

End-to-end : input original data , output result

Hand-crafted: End-to-end와 대비된다. 사람이 수동으로 설계하여 한 step 마다 step마다 설명이 가능한 것이다.

 

character recoginition as a case study -> hand-crafted feature extraction

document understanding as a case stuty-> GTN

GTN : that allow training all the modules to optimize a global performance criterion

 

most pattern recognition systems are built using a combination of automatic learning techniqes and hand-crafted algorithms.

recognizing individual patterns consists in dividing the system into two main moduls

first module, feature extractor, transforms the input patterns so that they can be represented by low-dimensional vectors or short strings of sysmbols 

(a) can be easily matched or compared

(b) relatively invariant with respect to transformations and distortions of the input patterns that do not change their nature.

feature extractor : contains most of the prior knowledge and is rather specific to the task. It is also the focus of most of the design effort, because it is often entirely hand-crafted.

classifier , general-purpose and trainable.

1. 특징 추출

Raw input-> Feature vector(특징을 추출한다.)->class scores(거의 변하지 않는다.)

특징 추출이 어렵다.

feature extractors

a combination of three factors have changed this visin over the last decade

1. the availability of low-cost machines with fast arithmetic units allows to rely more on brute-force "numerical" methods than on algorithmic refinements =>계산

2. the availability of large databases for problems with a large market and wide interest, such as handwriting recognition, has enabled designers to rely more on real data and less on hand-crafted feature extraction to build recognition systems => databases

3. 매우 중요한 요인 is the avilability of powerful machine learning techniques that can haldle high-dimensinal inputs and can generate intricate decision functions when fed with these large data sets. => high-dimensional

 

OCR systems use some form of multi-layer Neural Network trained with back-propagation.

 

multi-layer neural network

Convolutional Neural  Network

LeNet-5 -> this system is in commercial use in the NCR Corporation line of check recognition systems for the baking industry.

 

Section 소계 :

 

A. Learning froam Data'

이미지는 크다. pixel로 구성되였다. 수천 만 개 의 weight가 있다. 

"numerical" or gradient-based learning

P is the number of training samples, 

h is a measure of "effective capacity" or complexity of the machine Statistical Learning

알파 is a number between 0.5 and 1.0 and k is a constant.

h increace Etrain decreases  

Etrain줄이는 목적으로 한다.

 

In practical terms, Structural Risk Minimization is implemented by minimizing

H(W) IS called a regularization fuction 

베타 is constant

H(W) is chosen such that it takes large values on parameters W that belong to high-capacity subsets of the parameter space.

minimizing H(W) in effect limits the capacity of the accessible subset of the parameter space, 

ghereby controlling the tradeoff between minimizing the training error and minimizing the 

expected gap between the training error and test error.

에러를 줄여야 한다. 

 

B. Gradient-Based Learning => loss fuction

Efficient learning algorighms can be devised when the gradient vector can be computed analytically

W is a real-valued vector, with respect to which E(W) is continuous, as well as differentiable almost ererywhere

 a popular minimization procedure is the stochastic gradient algorithm -> online updatae

C. Gradient Back-Propagation

the suprising usefulness of such simple gradient descent techniques for complex machine learning tasks was not widely realized unitil the following three events occurred.

1. realization ,  loss function 은 학습할떄 중요한 원인이 아니다.

2. back-propagation algorighm, to compute the gradient in a non-linear systen compused of several layers of processing. 

3. back-propagation procedure applied to multi-layer neural networks with sigmoidal units can solve complicated learning tasks.

기울기 줄이는 것 

 

back-propagation

 

D. Learning in Real Handuriting Recoginition Systems

Gradient-Based Learning 

Convolutional Netwoks

The best neural networks , called Convolutional Networks , are designed to learn to extract relevant features directly from pixel images

Heuristic over-segmentation:

은닉 마르코프 모형(영어: hidden Markov model, HMM)은 통계적 마르코프 모형의 하나로, 시스템이 은닉된 상태와 관찰가능한 결과의 두 가지 요소로 이루어졌다고 보는 모델이다. 

 

마르코프 모형 - 위키백과, 우리 모두의 백과사전

위키백과, 우리 모두의 백과사전.

ko.wikipedia.org

label 등 

 

training the system at the level of whole strings of characters, rather than at the chracter level

eliminate segmentation altogether

 

 

E. Globally Trainable Systems

multiple modules.

 

Convolutianal Neural Networks for isolated character recognition

a trainable classifier then categorizes the resulting feature vectors into classes.

in this scheme, standard, fully-connected multi-layer networks can be used as classifiers.

 

1. typical images are large, often with several hundred variables(pixels).

100개 의 hidden units in the first layer,  수많은 weights가 있다.

capacity -> memory 

2. a deficiency of fully-connected architectures is that the topology of the input is entirely ignored.

convolutional networks force the extraction of local features by restricting the receptive fields of hidden units to be local

 

A. Couvolutional Networks

Convolutioanl Networks combine three architectural ideas to ensure some degree of shift, scale, and distortion invariance: 3가지 구조 

local receptive fields,

shared weights(or weight replication)

spatial or temporal sub-sampling.

 

LeNet-5 구조

the input plane receives images of characters that are appoximately size-normalized and centered.

each unit in a layer receives inputs from a set of units located in a small neighborhood in the previous layer.

 

subsampling:  출력의 일부분만 취하는 것이다.

6 planes

gas 25 uboyts cibbected ti a 5x5

 

feature map

 

 

B. LeNet-5 구조 

7 layers (not couting the input)

input 32x32 pixel image

hight-level feature detectors.

 

Cx: convolutional layers

Sx: subsampling layers 

Fx: fully-connected layers

x : layer index.

 

layer C1 : covolutional layer with 6 feature maps.

Each unit in each feature map is connected to a 5x5 neightborhood in input

The size of the feature map is 28x28 which prevents connection from the input from falling off the boundary

파라미터 156 , 그리고 122,304 개 연결되여있다.

 

layer S2 sub-sampling layer with 6 feature maps of size 14x14 .

Each unit in each feature map is connected to a 2x2 neighborhood in the corresping feature map in C1.

2x2 receptive fields are non-overlapping

 

layer C3 : covolutional layer with 16 feature maps.

ach unit in each feature map is connected to a 5x5 neightborhoodS at identiacal locations in a subset of S2's feature maps.

Table1 . shows the set of S2 feature maps conbined by each C3 feature map.

 

Why not connect every S2 feature map to every C3 feature map?

the reason is twofold.

a non-compelete connection scheme keeps the number of connections within reasonable bounds. 더 중요한것은 이미지의 대칭을 깬다. different feature maps are foreced to extract different(hopefully complementary) features because they get differnt sets of inputs. 

the 처음의 6개 feature maps take inputs from every contiguous subsets of three feature maps in S2.

다음의 6개는 take input from every contiguous subset of four

finally the last one takes input from all S2 feature maps.

1,516 trainable parameters and 151,600 connections

 

layer S4 subsampling layer with 16 feature maps of size 5x5 

32 trainable parameters and 2,000 connections

 

Layer C5 is a convolutional layer with 120 feature maps.

feature map is 1x1

C5 is labeled as a convoluional layer, instead of a fully-connected layer, because if LeNet-5 input were made bigger with everything else kept constant, the feature map dimension would be larger than 1x1.

48,120 trainable connections

 

Layer F6, contains 84 units. 10,164 trainable parameters.

classical neural networks , units in up to F6 compute a dot product between their input vector and their weight vector, to which a bias is added.

 

RBF: Radial Basis Function units

그림 초기화 파라미터 -> output RBFs 

layer output layer: 10 classes, 0-9 , softmax

 

C.Loss function

Maximum Likelihood Estimation criterion 

Minimum Mean Squared Error(MSE)

 

Results and Comparison with other methods 결과에 대한 비교

A. database: the modified NIST set -> MNIST

B. Results

학습 에러가 테스트 에러 보다 크다. 

transformations: horizontal and vertical translations, scaling, squeezing(simultaneous horizontal compression and vertical elonggation, or the reverse) and horizontal shearing.

 

비뚤어진 패턴으로 학습을 하였다. 정확도가 떨어진다. 0.95% -> 0.8%

misclassified test examples

C. Comparison with Other Classifiers

C.1 Linear Classifier, and Pairwise Linear Classifier

Linear Classifier 선형 분류 : Each input pixel value contributes to a weighted sum for each output unit.

The output unit with the hightest sum(including the contribution of a bias constant) 

error rate is 12% 8.4% 7.6%

 

C.2 Baseline Nearest Neighbor Classifier

K-nearest neighbor classifier 

메모리가 많이 필요하다.

Euclidean distance

 

C.3 Pricinpal Component Analysis(PCA) and Polynomial Classifier

C.4 Radial Basis Function Network

C.5 One-Hidden Layer Fully Connected Multilayer Neural Network

C.6 Two-Hidden Layer Fully Connected Multilayer Neural Network

C.7 A Small Convolutional Network: LeNet-1

The images down-sampled to 16x16 pixels and centered in the 28x28 input layer

C.8 LeNet-4

C.9 Boosted LeNet-4

C.10 Tangent Distance Classifier(TDC)

nearest-neighbor mehod where the distance function is made in-sensitive to small distortions and translations of the input image

C.11 Support Vector Machine(SVM)

D. discussion

E. Invariance and Noise Resistance

 

 

Multi-Module Systems and graph Transformer networks

A. An Object-Oriented Approach

"backward propagation"

"forward propagation

 

B. Special Modules

C. Graph Transformer Networks

Multiple Ojbect Recogniton: Heuristic Over-Segmentation

 

A. segmentation Graph

B. Recognition Transformer and Viterbi Transformer

Global Training for graph transformer networks

 

A. Viterbi Training

B. Discriminative Viterbi Training

C. Forward Scoring, and Forward Training

D. Discriminative Forward Training

E. Remaks Discriminative Training

 

Multiple Object Recognition: Space displacement Neural Network

A. Interpreting the Output of an SDNN with a GTN

B.Experiments with SDNN

B.Global Training of  SDNN

 

D.Object Detection and Spotting with SDNN

 

Graph Transformer networks and Transducers

A. previous work

B. Standard Transduction

C. Generalized Transduction

D. Notes on the Graph Structures

E. CTN and Hidden Markov Models

 

An on-line handwriting Recognition system

A.Preprocessing

B.Network architecture

C.Network Training

D. Experimental Results

A check reading system

A. A GTN for check Amount Recognition

B. Gradient-Based Learning

C. Rejecting Low Confidence Checks

D. Results

 

APPENDICES

A. Pre-conditions for faster convergence

B. Stochastic Gradient vs Batch Gradient

C. Stochastic Diagonal Levenberg-Marquardt

 

 

 

 

arclab.tistory.com/150

 

[논문 요약 3] Gradient-Based Learning Applied to Document Recognition

[업데이트 2018.03.21 17:16] 세번째 요약할 논문은 "Gradient-Based Learning Applied to Document Recognition" (yann.lecun.com/exdb/publis/pdf/lecun-01a.pdf) 입니다. 이 논문을 기점으로 Convolutional Ne..

arclab.tistory.com

 

반응형
반응형

Abstract

우리는 mobile and embedded vision applications 효율적인 모델 클라스 제시하며 MobileNets이라고 한다. MobileNets은 streamlined architecture을 기반으로 하고 ,  depthwise separable convolutions  을 사용하여 light weight deep neural networks 로 만들었다. 우리는 두가지 간단한 latency and accuracy사이에서의 global hyperparameters that efficiently trade off 를 소계한다. 이러한 hyper-parameters를 통해 model builder는 문제의 제약 조건에 따라 애플리케이션에 맞는 올바른 크기 모델을 선택할 수 있다. 또한 리소스 및 정확도 절충에 대한 저자의 광범위한 실험은 MobileNet이 ImageNet 분류 문제 및 기타 인기있는 모델에서 매우 강력한 성능을 가지고 있음을 보여준다. 그런 다음 저자는 object detection, finegrain classification, face attributes and large scale geo-localization을 포함한 광범위한 애플리케이션 시나리오에서 MobileNet의 효율성을 입증했다.

finegrain classification : 세밀하게 구분하는것 

 

1. Introduction

AlexNet [19] popularized deep convolutional neural networks 가 ImageNet Challenge ILSVRC 2012 [24]. 에서 우승을 그듭한후 Convolutional neural network은 computer vision에서 어디에서 있는 모습을 드러냈다.  더 깊거나 더 복잡한 networks은 높은 정확도 [27, 31, 29, 8] 를 가질 수 있다 .  

[27] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. 1, 6

[31] C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. arXiv preprint arXiv:1512.00567, 2015. 1, 3, 4, 7

[29] C. Szegedy, S. Ioffe, and V. Vanhoucke. Inception-v4, inception-resnet and the impact of residual connections on learning. arXiv preprint arXiv:1602.07261, 2016. 1

[8] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015. 1

 

논문에서는  efficient network architecture와  mobile and embedded vision applications모델에서 아주 작고, low latency 을 만들기 위한 두가지 hyper-parameters  들을 소계한다. 

Section 2 : small models을 만들기 위한 prior work

Section 3 : describes the MobileNet architecture and two hyper-parameters width multiplier and resolution multiplier to define smaller and more efficient MobileNets

Section 4 describes experiments on ImageNet as well a variety of different applications and use cases. => 경험적으로 연구 결과 

Section 5 closes with a summary and conclusion. => 결론

 

2. Prior Work

building small and efficient neural networks in the recent literature

pretrained networks or training small networks directly

choose a small network that matches the resource restrictions (latency, size) for their application

mobilenet 기본적으로 optimnizing for latency, samll networks에 관심을 한다.

하지만 매우 많은 논문에서는 small networks에만 집중을 하고 속도에 고려 하지 않는다.

 

MobileNet은 주로 L. Sifre. Rigid-motion scattering for image classification. PhD 논문, Ph. D. 논문, 2014. 1, 3에서 처음 소개 된 deep separable convolutions로 구성되며, 마지막으로 Inception 모델에서 초기를 줄이기 위해 사용되었습니다. 여러 계층의 계산. 플랫 네트워크는 완전히 분해 된 네트워크를 통해 설정되어 네트워크를 분해 할 수있는 큰 잠재력을 보여줍니다. Factorized Networks는이 기사와 거의 관련이 없으며 분해 및 컨볼 루션과 유사한 방법과 topological 연결 사용을 소개합니다. 그런 다음 Xception 네트워크는 Inception V3보다 더 나은 네트워크 성능을 달성하기 위해 분리 가능한 컨볼 루션 커널 (텍스트의 필터, 이전 CNN 연구 노트에서 필터도 컨볼 루션 커널, 커널을 참조 함)의 깊이를 확장하는 방법을 시연했습니다. 또 다른 소규모 네트워크는 SqueezeNet입니다. 병목 방식을 사용하여 소규모 네트워크를 설계합니다. 계산량을 줄이는 다른 네트워크로는 structured transform networks和deep fried convents가 있습니다.

 

소규모 네트워크를 얻는 다른 방법은 축소하는 것입니다. 즉, 네트워크를 분해하거나 압축하고 훈련시키는 것입니다. literature의 압축 방법에는 제품 양자화, 해싱, 프 루닝, 벡터 양자화 및 Huffman 코딩이 포함됩니다. 사전 훈련 네트워크를 가속화하기 위해 제안 된 다양한 인수 분해 방법도 있습니다. 소규모 네트워크를 훈련시키는 또 다른 방법은 대규모 네트워크를 사용하여 소규모 네트워크를 가르치는 증류입니다. 증류 방법은 저자의 방법을 보완하는 것으로 섹션 4에서 예제와 함께 사용됩니다. 또 다른 새로운 방법은 low bit networks 입니다.

Figure 1. MobileNet models can be applied to various recognition tasks for efficient on device intelligence.

기존에는 pre-train된 모델을 줄였고, 주로

  • compression
  • quantization
  • hashing
  • pruning

등을 통해 모델을 줄였는데, 주로 '속도’를 위한 것이라기 보다는 네트워크 '크기’에 초점이 맞추어져 있었는데, 이 논문은 '속도’를 타겟으로 합니다.

 

3. MobileNet Architecture

우리는 먼저 the core layers that MobileNet is built on which are depthwise separable filters에 대해서 소계드린다. 그다음 the MobileNet network structure and conclude with descriptions of the two model shrinking hyperparameters width multiplier and resolution multiplier 에 대해서 소계르린다.

 

3.1. Depthwise Separable Convolution

MobileNet 모델은 표준 회선을 깊이 별 회선과 1 * 1 회선, 1 * 1 회선으로 분해하는 분해 된 회선의 한 형태 인 깊이 별 분리 가능한 회선을 기반으로합니다. pointwise convolution이라고도합니다. MobileNet의 경우 딥 컨볼 루션은 각 채널에 컨볼 루션 커널을 적용합니다. 그런 다음 점별 컨볼 루션은 1 * 1 컨볼 루션을 적용하여 출력 및 깊이 컨볼 루션을 결합합니다. 표준 컨볼 루션은 컨볼 루션 커널과 입력을 한 번에 새 출력으로 결합합니다. 깊이 분리 가능한 컨볼 루션은 필터링을위한 레이어와 결합을위한 레이어의 두 레이어로 나눕니다. 이 분해 프로세스는 계산량과 모델 크기를 크게 줄입니다.Figure 2 shows how a standard convolution 2(a) is factorized into a depthwise convolution 2(b) and a 1 × 1 pointwise convolution 2(c).

Figure 2. The standard convolutional filters in (a) are replaced by two layers: depthwise convolution in (b) and pointwise convolution in (c) to build a depthwise separable filter.

Depthwise separable convolution are made up of two layers:

depthwise convolutions and pointwise convolutions.

We use depthwise convolutions to apply a single filter per each input channel (input depth). Pointwise convolution, a simple 1×1 convolution, is then used to create a linear combination of the output of the depthwise layer. MobileNets use both batchnorm and ReLU nonlinearities for both layers.

Depthwise convolution is extremely efficient relative to standard convolution.

 

MobileNet uses 3 × 3 depthwise separable convolutions which uses between 8 to 9 times less computation than standard convolutions at only a small reduction in accuracy as seen in Section 4.

MobileNets는 3 * 3 깊이 분리형 컨볼 루션을 사용하므로 표준 컨볼 루션을 사용하는 것보다 계산량이 8-9 배 감소합니다.

공간 차원의 추가 분해는 깊이 컨볼 루션의 계산량이 본질적으로 작기 때문에 계산량을 너무 많이 줄이지 않습니다.

 

3.2. Network Structure and Training

앞서 언급했듯이 MobileNet 구조는 첫 번째 레이어가 완전 컨볼 루션 레이어라는 점을 제외하고는 분리 가능한 깊은 컨볼 루션을 기반으로합니다. 이러한 간단한 방법으로 네트워크를 정의하면 네트워크 토폴로지를 탐색하여 좋은 네트워크를 찾을 수 있습니다. 표 1은 MobileNet의 아키텍처입니다. 비선형 활성화 함수가 없지만 분류를 위해 소프트 맥스 계층에 직접 입력되는 최종 완전 연결 계층을 제외하고 모든 계층은 batchnorm 및 ReLU 비선형 활성화 함수입니다. 그림 3은 표준 컨볼 루션과 깊이 분리 가능한 컨볼 루션을 비교하며, 둘 다 batchnorm 계층과 ReLU 비선형 활성화 함수를 따릅니다. 딥 컨볼 루션 레이어와 첫 번째 레이어 모두 다운 샘플링을 처리 할 수 ​​있습니다. 최종 평균 풀링 계층은 완전히 연결된 계층 이전의 공간 차원을 1로 줄입니다. Deep convolution과 point-by-point convolution을 독립적 인 레이어로 생각하십시오 .MobileNet에는 (1 + 13 * 2 + 1 = 28) 레이어가 있습니다.

Table 1. MobileNet Body Architecture
Figure 3. Left: Standard convolutional layer with batchnorm and ReLU. Right: Depthwise Separable convolutions with Depthwise and Pointwise layers followed by batchnorm and ReLU.
Table 2. Resource Per Layer Type

적은 수의 다중 추가를 통해 네트워크를 정의하는 것만으로는 충분하지 않습니다. 이러한 작업을 효율적으로 구현할 수 있는지 확인하는 것도 중요합니다. 예를 들어, 비정형 희소 행렬 연산은 일반적으로 희소 행렬의 정도가 충분하지 않으면 조밀 행렬 연산보다 빠르지 않습니다. 저자의 모델 구조는 거의 모든 계산 복잡성을 1 * 1 컨볼 루션에 넣습니다. 이는 고도로 최적화 된 GEMM (General Matrix Multiplication)을 통해 달성 할 수 있습니다. 일반적으로 회선은 GEMM에 의해 구현되지만 im2col이라는 메모리에서 초기 정렬도 필요합니다. 예를 들어,이 방법은 인기있는 Caffe 패키지에서 유용합니다. 1 * 1 컨볼 루션은 메모리에서 이러한 정렬이 필요하지 않으며 가장 최적화 된 수치 선형 대수 알고리즘 중 하나 인 GEMM에 의해 직접 구현 될 수 있습니다. MobileNet은 1 * 1 컨볼 루션에서 계산 시간의 95 %를 소비하며 매개 변수의 75 %도 포함합니다 (표 2). 거의 모든 추가 매개 변수는 완전 연결 계층에 있습니다.

 

MobileNet 모델은 Inception V3과 유사한 비동기 경사 하강 법 RMSprop를 사용하여 TensorFlow에서 학습됩니다. 그러나 큰 모델을 훈련하는 것과는 반대로, 작은 모델은 과적 합하기 쉽지 않기 때문에 저자는 정규화 및 데이터 증가 기술을 덜 사용합니다. MobileNet을 훈련 할 때 저자는 side headslabel smoothing을 사용하지 않고 이미지 왜곡을 줄이기 위해 대규모 Inception 훈련에 사용되는 작은 자르기 크기를 사용했습니다. 또한 저자는 depthwise filters에 매개 변수가 거의 없기 때문에 weight decay(L2 정규화)를 적게 또는 전혀 두지 않는 것이 중요하다는 것을 발견했습니다. 다음 섹션의 ImageNet 벤치 마크에서 모든 모델은 동일한 매개 변수로 학습되지만 모델의 크기는 고려되지 않습니다.

 

3.3. Width Multiplier: Thinner Models

기본 MobileNet 아키텍처는 충분히 작고 대기 시간이 충분히 낮지 만 특정 사용 사례 또는 애플리케이션은 모델을 더 작고 빠르게 만들 수 있습니다. 더 작고 계산 비용이 덜 드는 모델을 만들기 위해 저자는 폭 승수 α라는 간단한 매개 변수를 도입했습니다. 그 기능은 네트워크의 각 계층에 대한 부담을 균등하게 줄이는 것입니다. 주어진 레이어 및 폭 승수 α에 대해 입력 채널 M은 αM이되고 출력 채널은 αN이됩니다.

 

Width multiplier는 모든 모델 구조에서 사용되어 합리적인 정확도, 지연 및 크기로 새롭고 작은 모델을 정의 할 수 있습니다. 재교육이 필요한 새로운 단순화 된 구조를 정의하는 데 사용됩니다.

 

3.4. Resolution Multiplier: Reduced Representation

신경망의 계산 비용을 줄이는 두 번째 하이퍼 파라미터는 resolution multiplier ρ 입니다. 작성자는이 매개 변수를 입력 이미지에 적용하고 각 레이어의 내부 특징을 동일한 승수로 뺍니다. 실제로 저자는 입력 해상도를 설정하여 암시 적으로 ρ를 설정합니다.

Table 3. Resource usage for modifications to standard convolution. Note that each row is a cumulative effect adding on top of the previous row. This example is for an internal MobileNet layer with DK = 3, M = 512, N = 512, DF = 14.

MobileNet의 일반적인 레이어를 예로 살펴보고 width multiplierresolution multiplier를 사용한 깊이 분리형 컨볼 루션이 비용과 매개 변수의 양을 줄이는 방법을 확인할 수 있습니다. 표 3은 다른 프레임 워크 축소 방법이이 계층에 적용될 때 계산량과 매개 변수 수를 보여줍니다. 첫 번째 줄은 완전 연결 계층에서 Mult-Adds의 수와 매개 변수입니다. 입력 특성 맵 크기는 14 * 14 * 512이고 컨볼 루션 커널 크기는 3 * 3 * 512 * 51입니다. 다음 섹션에서는 모델 리소스와 정확성 간의 타협에 대한 세부 정보를 볼 수 있습니다.

width multiplier는 논문에서 α로 표현하였고 인풋과 아웃풋의 채널에 곱해지는 값입니다

반면 resolution multiplier는 인풋의 height와 width에 곱해지는 상수값입니다. 

 

4. Experiments

이 섹션에서는 먼저 압축 모델을 선택하기 위해 레이어 수를 줄이는 대신 딥 컨볼 루션의 영향을 탐색하고 네트워크 폭을 줄입니다. 그런 다음 네트워크는 width multiplierresolution multiplier라는 두 개의 하이퍼 파라미터를 기반으로 축소되고 현재 주류 모델과 비교됩니다. 그런 다음 다양한 애플리케이션에서 MobileNet의 애플리케이션을 논의합니다

 

4.1. Model Choices

첫째, 깊은 분리 가능한 컨볼 루션과 완전 컨볼 루션 모델을 사용한 MobileNet의 결과를 비교합니다. 표 4는 ImageNet에서 심도 분리 가능 컨볼 루션을 사용하는 정확도가 전체 컨볼 루션에 비해 1 % 만 감소하지만 다중 추가 및 매개 변수의 수가 크게 감소 함을 보여줍니다.

 

그런 다음 저자는 width multiplier를 사용하는 더 얇은 모델과 더 적은 레이어를 사용하는 더 얕은 모델의 결과를 비교했습니다. MobileNet을 더 얕게 만들기 위해 표 1에서 분리 가능한 컨볼 루션 커널의 5 개 계층이 제거되었습니다 (기능 크기 : 14 * 14 * 512). 표 5는 계산 및 매개 변수의 양이 유사한 경우 Thinner의 MobileNet의 정확도가 얕은 모델보다 3 % 더 높다는 것을 보여줍니다.

 

 

4.2. Model Shrinking Hyperparameters

표 6은 width multiplier α를 사용하여 MobileNet 아키텍처를 축소 한 후 정확도, 계산량 및 크기 간의 균형을 보여줍니다. 모델이 작아지면 정확도가 떨어집니다.

표 7은 reduced input resolutions로 MobileNet을 훈련 할 때 다른 resolution multiplier ρ 값의 정확도, 계산량 및 크기 사이의 절충안입니다. 해상도가 낮아지면 정확도가 감소합니다.

Figure 4 shows the trade off between ImageNet Accuracy and computation for the 16 models made from the cross product of width multiplier α ∈ {1, 0.75, 0.5, 0.25} and resolutions {224, 192, 160, 128}. Results are log linear with a jump when models get very small at α = 0.25.

Figure 4. This figure shows the trade off between computation (Mult-Adds) and accuracy on the ImageNet benchmark. Note the log linear dependence between accuracy and computation.

Figure 5 shows the trade off between ImageNet Accuracy and number of parameters for the 16 models made from the cross product of width multiplier α ∈ {1, 0.75, 0.5, 0.25} and resolutions {224, 192, 160, 128}.

Figure 5. This figure shows the trade off between the number of parameters and accuracy on the ImageNet benchmark. The colors encode input resolutions. The number of parameters do not vary based on the input resolution.

Table 8 compares full MobileNet to the original GoogleNet [30] and VGG16 [27]. MobileNet is nearly as accurate as VGG16 while being 32 times smaller and 27 times less compute intensive. It is more accurate than GoogleNet while being smaller and more than 2.5 times less computation.

Table 9 compares a reduced MobileNet with width multiplier α = 0.5 and reduced resolution 160 × 160. Reduced MobileNet is 4% better than AlexNet [19] while being 45× smaller and 9.4× less compute than AlexNet. It is also 4% better than Squeezenet [12] at about the same size and 22× less computation.

 

 

4.3. Fine Grained Recognition

 fine-grained image classification은 무엇일까? 새의 종, 꽃의 종, 동물의 종 또는 자동차의 모델 같이 구분하기 어려운 클래스들을 분류하는 과제다. 

bskyvision.com/643

 

image classification과 fine-grained image classification의 차이

image classification은 이미지가 개에 관한 것인지, 고양이에 관한 것인지, 사람에 관한 것인지, 자동차에 관한 것인지 분류하는 컴퓨터 비전 과제다. 그렇다면 fine-grained image classification은 무엇일까?.

bskyvision.com

4.4. Large Scale Geolocalizaton

4.5. Face Attributes

4.6. Object Detection

4.7. Face Embeddings

 

=>

상용화를 위하여 필요한 여러가지 제약 사항을 개선시키기 위하여 경량화 네트워크

가벼운 네트워크 

small and latency

 

  • Channel Reduction : MobileNet 적용
    • Channel 숫자룰 줄여서 경량화
  • Depthwise Seperable Convolution : MobileNet 적용
    • 이 컨셉은 Xception에서 가져온 컨셉이고 이 방법으로 경량화를 할 수 있습니다.
  • Distillation & Compression : MobileNet 적용
  • Remove Fully-Connected Layers
    • 파라미터의 90% 정도가 FC layer에 분포되어 있는 만큼 FC layer를 제거하면 경량화가 됩니다.
    • CNN기준으로 필터(커널)들은 파라미터 쉐어링을 해서 다소 파라미터의 갯수가 작지만 FC layer에서는 파라미터 쉐어링을 하지 않기 때문에 엄청나게 많은 수의 파라미터가 존재하게 됩니다.
  • Kernel Reduction (3 x 3 → 1 x 1)
    • (3 x 3) 필터를 (1 x 1) 필터로 줄여서 연산량 또는 파라미터 수를 줄여보는 테크닉 입니다.
    • 이 기법은 대표적으로 SqueezeNet에서 사용되었습니다.

 

 

 

[논문] MobileNets Efficient Convolutional Neural Networks for Mobile Vision Applications

참조사항:

gaussian37.github.io/dl-concept-mobilenet/

 

MobileNets - Efficient Convolutional Neural Networks for Mobile Vision Applications

gaussian37's blog

gaussian37.github.io

openresearch.ai/t/mobilenets-efficient-convolutional-neural-networks-for-mobile-vision-applications/20

 

MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications

구글에서 나온 논문입니다. 모바일에서(내지는 cpu에서) realtime으로 network forward가 되는 결과를 보여줍니다. Key Idea는 Convolution Layer가 무거우니 이를 줄일건데, 일종의 Factorization을 제시합니다. Dep

openresearch.ai

blog.csdn.net/qq_31914683/article/details/79330343

 

【论文学习】MobileNets:Efficient Convolutional Neural Networks for Mobile Vision Applications_斯丢劈德的博客-CSDN

MobileNets是谷歌公司在2017年发布的一种可以在手机等移动终端运作的神经网络结构。 论文地址:点击打开链接 作者给出了移动端和嵌入式视觉应用的MobileNets模型。MobileNets基于流线型结构设计,�

blog.csdn.net

 

반응형
반응형

Franc¸ois Chollet Google, Inc. fchollet@google.com 

Xception: Deep Learning with Depthwise Separable Convolutions

 

Abstract

우리는 이 논문에서는 Inception module을 regular convolution과 depthwise separable convolution(depthwise convolution 뒤에 pointwise convolution이 뒤따르는 형태이다.)의 중간 단계로 해석하는 것을 제시한다. 이러한 관점에서 depthwise separable convolution은 가장 많은 수의 tower가 있는 inception module로 볼 수 있다. 이러한 통찰은 Inception 기반의 새로운 CNN 구조를 제안하는데 기여됐다. 새로운 구조에서는 Inception module들이 depthwise separable convolution으로 대체된다. Xception이라 부르는 이 아키텍처는, ImageNet datasett (which Inception V3 was designed for)에서 Inception-V3보다 성능이 약간 좋았으며, 3.5억개의 이미지와 17000개의 class로 구성된 dataset에서는Inception-V3보다 훨씬 뛰어난 성능을 보였다. Xception 구조는 Inception-V3과 동일한 수의 parameter를 가지므로, 성능의 향상은 capacity의 증가가 아닌, 모델 parameter의 효율적인 사용으로부터 얻어진 것이다.

 

depthwise convolution:기본적인 개념은 쉽다. 위 처럼 H*W*C의 conv output을 C단위로 분리하여 각각 conv filter을 적용하여 output을 만들고 그 결과를 다시 합치면 conv filter가 훨씬 적은 파라미터를 가지고서 동일한 크기의 아웃풋을 낼 수 있다. 또한 각 필터에 대한 연산 결과가 다른 필터로부터 독립적일 필요가 있을 경우에 특히 장점이 된다. =>나누고 합치기 

pointwise convolution:흔히 1x1 Conv라고 불리는 필터이다. 많이 볼 수 있는 트릭이고 주로 기존의 matrix의 결과를 논리적으로 다시 shuffle해서 뽑아내는 것을 목적으로 한다. 위 방법을 통해 총 channel수를 줄이거나 늘리는 목적으로도 많이 쓴다.

Tower는 inception module 내부에 존재하는 conv layer와 pooling layer 등을 말한다. 

 

1. Introduction

최근에는 Convolutional neural networks 가 컴퓨터 vision 분야에서 master algorithm 으로 등장하였으며 , 이를 설계하기 위한 기법의 개발에 상당한 관심을 기울이고 있다. convolutional neural network 설계의 역사는 feature extraction을위한 간단한 convolutions 과 spatial sub-sampling 을 위한 max-pooling으로 이루어진 LeNet-style models [10]으로 시작됬다. 이 아이디어는 2012년에 AlexNet에서 개선됐으며 Max-pooling 사이에는 convolution이 여러 번 반복되어, 네트워크가 모든 spatial scale에 대해 풍부한 feature를 학습 할 수 있게 됐다.What followed was a trend to make this style of network increasingly deeper, mostly driven by the yearly ILSVRC competition; first with Zeiler and Fergus in 2013 [25] and then with the VGG architecture in 2014 [18].

 

이 시점에서 새로운 스타일의 network가 등장하였으며, the Inception architecture, introduced by Szegedy et al. in 2014 [20] as GoogLeNet (Inception V1), later refined as Inception V2 [7], Inception V3 [21], and most recently Inception-ResNet [19]. Inception으로 소계된 이 후로 , ImageNet dataset [14]과 Google 에서 사용하는 internal dataset JFT [5]에 대해 가장 성능이 우수한 모델 군 중 하나였다.

 

Inception 스타일 모델의 기본적인 building block은, 여러 버전이 존재하는 Inception module이다.Fig.1에서는 canonical Inception module Inception-v3에서 볼 수 있는 표준 형태의 Inception module을 보여준다.Inception 모델은 이러한 모듈들의 stack으로 이해할 수 있다. 이것은 simple convolution layers의 스택이었던 이전 VGG-style networks에서 출발 한 것이다.

 

Inception module은 개념적으로 convolutions (they are convolutional feature extractors)과 유사하지만, 실험에서는 적은 parameter로도 풍부한 표현을 학습할 수 있는 것으로 나타났다. 이들은 어떻게 작동하며, 일반적인 convolution과 어떻게 다른 것일까? Inception 이후에는 어떤 디자인 전략이 나올까?

 

1.1. The Inception hypothesis

Convolution layer는 2개의 spatial dimension(width and height)과 channel dimension로 이루어진 3D 공간에 대한 filter를 학습하려고 시도한다. 따라서 single convolution kernel은 cross-channel correlation spatial correlation을 동시에 mapping하는 작업을 수행한다.

 

Inception module의 기본 아이디어는 cross-channel correlation spatial correlation을 독립적으로 볼 수 있도록 일련의 작업을 명시적으로 분리함으로써, 이 프로세스를보다 쉽고 효율적으로 만드는 것이다. 더 정확하게 , 일반적인 Inception module의 경우, 우선 1x1 convolution으로 cross-correlation을 보고, input보다 작은 3~4개의 분리 된 공간에 mapping한다. 그 다음 보다 작아진 3D 공간에 3x3 혹은 5x5 convolution을 수행하여 spatial correlation을 mapping한다. Fig 1 참조 . 실제로 Inception의 기본 가설은 cross-channel correlations 과 spatial correlations는 충분히 분리되어 공동으로 매핑하지 않는 것이 좋다. 

 

convolution (e.g. 3x3)를 하나만 사용하고 average pooling tower (figure 2)을 포함하지 않는 simplified 버전의  an Inception module를 고려한다. 이 Inception module은 a large 1x1 convolution을 수행하고 , output channels (figure 3)

들의 겹치지 않는 segment에 대한 spatial convolutions이 오는 형태로 재구성한다. 이 관찰은 자연스럽게 다음의 문제를 제기한다 :  Partition 내의 segment 개수나 크기가 어떤 영향을 갖는가? nception의 가설보다 훨씬 강력한 가설을 세우고, cross-channel correlation spatial correlation을 완전히 분리시켜 mapping 할 수 있다고 가정하는 것이 합리적인가?

Figure 1. A canonical Inception module (Inception V3).
Figure 2. A simplified Inception module.
Figure 3. A strictly equivalent reformulation of the simplified Inception module.
Figure 4. An “extreme” version of our Inception module, with one spatial convolution per output channel of the 1x1 convolution.

1.2. The continuum between convolutions and separable convolutions

“extreme” version of an Inception module 강렬한 가설의 기반으로 , 우선 우리는 1x1 convolution으로 cross-channel correlations 매핑하고 , 각각의 output channel 들의 spatial correlations을 따라 매핑한다. figure 4에서 볼 수 있다. We remark that this extreme form 의 an Inception module 이 depthwise separable convolution 거의 almost identical 하며 , an operation that has been used in neural network design as early as 2014 [15] and has become more popular since its inclusion in the TensorFlow framework [1] in 2016. 

 

depthwise separable convolution는  deep learning frameworks such as TensorFlow and Keras에서  일반적으로 “separable convolution”부르며 , depthwise convolution으로 구성된다. 즉 input의 각 channel에 대해 , 독립적으로 , a spatial convolution이 수행되고 , 그 뒤로는 pointwise convolution 따라오는 형태이다. 1x1 convolution은 depthwise convolution 의 output을 새로운 channel space 에 projecting한다. spatially separable convolution과 혼동되서는 안되며 image processing community에서는 일반적으로 “separable convolution”라고 한다.

 

“extreme” version의 Inception module과 depthwise separable convolution 간의 두가지 차이점은 아래와 같다.

operations의 순서 : Inception에서는 1x1 convolution을 먼저 수행하는 반면, 예를 들면 TensorFlow에서와 같이 일반적으로 구현된 depthwise separable convolution channel-wise spatial convolution을 먼저 수행한 뒤에 1x1 convolution을 수행한다.

첫 번째 operation 뒤의 non-linearity presence or absence . Inception에서는 두 operation 모두 non-linearity로 ReLU가 뒤따르는 반면, separable convolution은 일반적으로 non-linearity 없이 구현된다.

우리는 operation들이 stacked setting에서 사용되기 때문에, 첫 번째 차이점은 중요하지 않다고 주장한다. 두 번째 차이점은 중요할 수 있으므로 실험 파트에서 조사한다.(in particular see figure 10)

 

또한 , 일반  Inception module 과 depthwise separable convolutions 사이의 intermediate formulations도 가능함에 주목한다. 사실은, there is a discrete spectrum between regular convolutions and depthwise separable convolutions, parametrized by the number of independent channel-space segments used for performing spatial convolutions.

일반적인 convolution , (preceded by a 1x1 convolution) , at one extreme of this spectrum,  single-segment case에 해당한다;  a depthwise separable convolution channel당 하나 해당한다; Inception modules은 수백개의 channel을 3 or 4 segments 다루기 때문에 이 둘 사이에 있다. 

 

이러한 관측으로 부터 우리는 Inception modules을 depthwise separable convolutions으로 대체함으로써 Inception family 의 구조를 개선하는 것이 가능할 것이라 제안한다. i.e. depthwise separable convolution을 stacking한 모델을 building 한다. 이는 Tensorflow에서 사용할 수 있는 효율적인 depthwise separable convolution으로 실현된다. 다음에서 우리는 이 아이디어를 기반으로  Inception V3와 유사한 수의 매개 변수 를 사용하는 convolutional neural network architecture를 제시하고  ,  two large-scale image classification task Inception V3에 대한 성능을 평가한다.

 

2. Prior work

이 연구는 다음 분야의 이전 연구들에 크게 의존한다.

• Convolutional neural networks [10, 9, 25], 특히  VGG-16 architecture [18] 는 몇 가지 측면에서 우리가 제안한 아키텍처와 개략적으로 유사하다.

The Inception architecture family of convolutional neural networks [20, 7, 21, 19], 여러개의  branches 로 factoring하여 ,channel들과 이 공간에서 연속적으로 등장하는 것에 대한  중점을 두었다.

 

• Depthwise separable convolutions는 아키텍처가 전적으로 기반으로 제안되였다. 네트워크에서 spatially separable convolution이 사용됐던건 2012[12] (but likely even earlier) 년 이전이지만, depthwise version은 더 최근에 사용됐다. Laurent Sifre는 2013년에 Google Brain internship 과정에서 depthwise separable convolution을 개발했으며, 이를 AlexNet에 적용하여 큰 수렴 속도 향상과 약간의 성능 향상, 모델 크기의 감소 등의 성과를 얻었다. 그의 작업에 대한 개요는 ICLR 2014[23]에서 처음 공개되었다. 자세한 실험결과는 Sifre’s thesis, section 6.2 [15]에서 보고됐다.Depthwise separable convolution에 대한 초기 연구는, Sifre and Mallat on transformation-invariant scattering [16, 15]에서 영감을 받았으며, 이후에는 depthwise separable convolution이 Inception V1와 Inception V2 [20, 7]의 첫번째 레이어에 사용되였다. Google의 Andrew Howard [6] 는 depthwise separable convolution을 사용하여 MobileNets이라는 효율적인 모바일 모델을 도입했다. Jin et al. in 2014 [8] and Wang et al. in 2016 [24] 연구에서도 separable convolution을 사용하여 CNN의 크기 및 계산 비용을 줄이는 연구를 수행했다. 또한 우리의 작업은 TensorFlow 프레임 워크에 깊이 별 분리 가능한 컨볼 루션을 효율적으로 구현 한 경우에만 가능하다 [1].

 

• Residual connections, introduced by He et al. in [4], which our proposed architecture uses extensively.

 

3. The Xception architecture

우리는 전적으로 depthwise separable convolution layers에 기반한 convolutional neural network구조를 기반으로 제안한다. 사실은 다음과 같은 가설을 세운다. convolutional neural networks의 feature maps에서 cross-channels correlations and spatial correlations의 mapping 은 완전히 분리될수 있다. 이는 Inception 구조에 기반한 강력한 버전의 가설이므로, 제안하는 구조를 “Extreme Inception“을 나타내는 이름인 Xception으로 명명한다.

 

network에 대한 자센한 정보는 figure 5를 참조한다. Xception 구조는 36개의 conv layer로 feature extraction을 수행한다. 실험 평가에서는 image classification에 대해서만 조사하므로, 제안하는 CNN에는 logistic regression layer가 뒤따른다.선택적으로 logistic regression layer 앞에 완전히 연결된 계층을 삽입 할 수 있다.이것은 experimental evaluation section (in particular, see figures 7 and 8)에 나와있다. 36개의 conv layer는 14개의 모듈로 구성되며, 첫 번째와 마지막 모듈을 제외한 나머지의 주위에는 linear residual connection이 있다.

 

간단하게 말하자면 ,  Xception 구조는 residual connection이 있는 depthwise separable convolution의 linear stack으로 볼 수 있다. 따라서 Xception 구조는 정의와 수정이 매우 쉽게 이루어질 수 있다. Keras [2] 나 TensorFlow-Slim[17] 과 같은 high-level library를 사용하면 30~40줄의 코드로 구현이 가능하다. VGG-16[18]이나 훨씬 복잡한  Inception-v2혹은 Inception-v3과는 차이가 있다. 오픈 소스 구현은 Keras 애플리케이션 모듈 , MIT 라이센스에 따라 Keras 및 TensorFlow를 사용하는 Xception은 다음의 일부로 제공된다. 

 

4. Experimental evaluation

우리는 규모의 유사성을 고려해 , Xception to the Inception V3 architecture 비교한다. Xception과 Inception-v3의 parameter 수는 거의 동일하므로, 성능 차이는 네트워크 capacity의 차이에서 비롯된 것이 아니다. (Table.3 참조) 우리는 성능은 두 개의 image classification task에 대해 비교한다. 하나는 우리가 알고있는 1000-class single-label classification task on the ImageNet dataset [14], 또 다른 하나는 17,000-class multi-label classification task on the large-scale JFT dataset.

 

4.1. The JFT dataset

JFT는 large-scale image classification dataset을 위한  internal Google dataset  으로, Hinton et al. in [5] 처음으로 도입했다. 데이터는 17000-class label로 분류 된 350 million 의 고해상도 이미지로 구성된다.  JFT에 대해 학습 된 모델의 성능 평가를 위해, 보조 dataset인 FastEval14k를 사용한다.

 

FastEval14k is a dataset of 14,000 images with dense annotations from about 6,000 classes (36.5 labels per image on average).  이 dataset에서는 top-100 prediction에 대한 Mean Average Precision(이하 MAP@100)으로 성능을 평가하고, MAP@100의 각 class에 기여도를 가중치로 부여하여, 소셜 미디어 이미지에서 해당 class가 얼마나 흔하게 사용되는지 추정한다.이 평가 절차는 소셜 미디어 이미지에서 자주 발생하는 label의 성능을 측정하기 위한 것으로, Google의 production models에 중요하다고 한다.

 

4.2. Optimization configuration

ImageNet과 JFT에서는 서로 다른 optimization configuration을 사용했다.

• On ImageNet:

– Optimizer: SGD

– Momentum: 0.9

– Initial learning rate: 0.045

– Learning rate decay: decay of rate 0.94 every 2 epochs

• On JFT:

– Optimizer: RMSprop [22]

– Momentum: 0.9

– Initial learning rate: 0.001

– Learning rate decay: decay of rate 0.9 every 3,000,000 samples

 

두 dataset 모두, Xception과 Inception-v3에 동일한 optimization configuration이 사용됐다.이 configuration은 Inception-v3의 최고 성능에 맞춘 것이며, Xception에 최적화 된 hyperparameter로 조정하려는 시도를 하지 않았다. 두 네트워크의 학습 결과가 다르기 때문에, 특히 ImageNet dataset에서는 Inception-v3에 맞춰진 configuration이 최적값이 아닐 수 있다. (Fig.6 참조) 

 

모든 모델은 inference time에 Polyak averaging [13] 을 사용하여 평가된다.

 

4.3. Regularization configuration

 

• Weight decay:

Inception-v3은 rate가 4e-5인 weight decay(L2 regularization)를 사용하여, ImageNet의 성능에 맞게 신중하게 조정됐다. Xception에서는 이 rate가 매우 부적합하기 때문에, 1e-5를 사용한다.우리는 Optimal weight decay rate에 대한 광범위한 탐색은 하지 않았으며, ImageNet과 JFT에 대한 실험 모두에서 동일한 weight decay rate가 사용됐다.

 

• Dropout:

ImageNET 실험의 경우  , 두가지 모델의 dropout layer of rate 0.5 before the logistic regression layer포함한다 . JFT 실험의 경우, dataset의 크기를 고려하면 적절한 시간 내에 overfitting 될 수가 없으므로 dropout이 포함되지 않는다.

 

• Auxiliary loss tower:

Inception-v3 아키텍처에서는 네트워크의 초반부에 classification loss를 역전파하여, 추가적인 regularization 메커니즘으로 사용하기 위한 auxiliary loss tower를 선택적으로 포함할 수 있다. 단순화를 위해, auxiliary tower를 모델에 포함하지 않기로 했다.

 

4.4. Training infrastructure

모든 networks 의 TensorFlow framework [1] 구성했으며  NVIDIA K80 GPUs 에서 60가지를 학습하였다. ImageNet 실험의 경우, 최상의 classification 성능을 달성하기 위해 synchronous gradient descent과 data parallelism을 이용했으며, JFT의 경우에는 학습 속도를 높이기 위해 asynchronous gradient descent를 사용했다. ImageNet에 대한 실험은 각각 약 3일이 걸렸고, JFT에 대한 실험은 1개월이 넘게 걸렸다. JFT 모델 에 대해 full convergence로 학습하려면 3개월씩 걸리기 때문에, 이렇게까지 학습하진 않았다고 한다.

Figure 5. The Xception architecture: the data first goes through the entry flow, then through the middle flow which is repeated eight times, and finally through the exit flow. Note that all Convolution and SeparableConvolution layers are followed by batch normalization [7] (not included in the diagram). All SeparableConvolution layers use a depth multiplier of 1 (no depth expansion).

4.5. Comparison with Inception V3

4.5.1 Classification performance

모든 평가는 single crop과 single model에 대해 수행됐다.ImageNet에 대한 결과는 test set이 아닌 validation set에 대해 측정됐다. (Table.1, Fig.6 참조) JFT에 대한 결과는 full convergence 후가 아닌  30 million회의 iteration (one month of training)후에 측정됐다.  결과는 in table 1 and table 2, as well as figure 6, figure 7, figure 8 에 있다. 우리는  JFT에서는 fully-connected layer가  포함되지 않은 버전과, logistic regression layer 이전에 4096개의 노드로 이루어진 fully-connected layer가 2개 포함 된 버전을 테스트했다.

 

ImageNet에서 Inception V3은 Xception보다  약간 더 나은 결과를 보여준다. JFT에서의 Xception은 FastEval14k에 대한 MAP@100에서 4.3%의 상대적 개선을 보여줬다. 또한 Xception은, ResNet에서 보고 된 ResNet-50, ResNet-101, ResNet-152의 ImageNet classification 성능보다 우수하다.

Table 1. Classification performance comparison on ImageNet (single crop, single model). VGG-16 and ResNet-152 numbers are only included as a reminder. The version of Inception V3 being benchmarked does not include the auxiliary tower

Xception 아키텍처는 ImageNet dataset보다 JFT dataset에 대해 더 큰 성능 향상을 보여줬다. 이는 Inception-v3가 ImageNet dataset에 중점을 두고 개발됐기 때문에, 디자인이 특정 작업에 과적합 된 것으로 볼 수 있다. 즉, ImageNet dataset(부분적인 optimization parameters 와 regularization 파라미터들 )에 더 적합한 hyperparameter를 찾는다면 상당한 추가적 성능 향상을 얻을 수 있을거라 볼 수 있다.

 

Table 2. Classification performance comparison on JFT (single crop, single model).
Figure 6. Training profile on ImageNet
Figure 7. Training profile on JFT, without fully-connected layers

4.5.2 Size and speed

Table 3. Size and training speed comparison.

table 3에서 우리는 Inception V3 와  Xception 사이즈 및 속도에 대해 비교한다. Parameter의 개수는 ImageNet(1000 가지 종류, fully-connected layers가 없다. )에 대한 학습 모델에서 측정됐으며, 초당 training step(gradient update)은 ImageNet dataset에 대한 synchronous gradient descent 횟수를 측정했다. 두 모델의 크기 차이는 거의 같으며(약 3.5% 이내로), 학습 속도는 Xception이 약간 느린 것으로 나타났다. 두 모델이 거의 동일한 수의 parameter를 가지고 있다는 사실은, ImageNet과 JFT에 대한 성능 향상이 capacity의 증가가 아니라, 모델의 parameter를 보다 효율적으로 사용함으로써 이뤄졌다는 것을 나타낸다.

 

4.6. Effect of the residual connections

Figure 9. Training profile with and without residual connections.

Xception 구조에서의 residual connection 효과를 정량화하기 위해, residual connection을 포함하지 않는 버전의 Xception을 ImageNet에 대해 벤치마크했다. 결과는 figure 9에서 참조한다. 수렴 속도나 최종 classification 성능 측면에 있어, residual connection은 반드시 필요한 것으로 보여진다. 물론, residual 버전과 동일한 optimization configuration으로 non-residual 버전을 벤치마킹했기 때문에 차이가 더 크게 나온 것일 수도 있다.

 

추가적으로 , 이 결과는 Xception에서 residual connection의 중요성을 보여준 것일 뿐이지, depthwise separable convolution의 stack인 이 모델의 구축에 필수 조건은 아니다. 또한, non-residual VGG-style 모델의 모든 conv layer를 depthwise separable convolution(with a depth multiplier of 1)으로 교체했을 때, 동일한 parameter 수를 가지고도 JFT dataset에서 Inception-v3보다 뛰어난 결과를 얻었다.

 

4.7. Effect of an intermediate activation after pointwise convolutions

Figure 10. Training profile with different activations between the depthwise and pointwise operations of the separable convolution layers.

우리는 전에서 depthwise separable convolution Inception module의 다른 점이, depthwise separable convolution의 depthwise operation pointwise operation 사이에 non-linearity를 포함해야할 수도 있음을 시사한다고 언급했었다. 지금까지의 실험 파트에서는 non-linearity가 포함되지 않았다. 이 절에서는 intermediate non-linearity로 ReLU 또는 ELU [3]의 포함 여부에 따른 효과를 실험적으로 테스트한 결과를 보인다. ImageNet에 대한 실험 결과는 Fig.10에 보이듯, non-linearity가 없으면 수렴이 빨라지고 최종 성능도 향상됐다.

 

이는 Inception module에 대한 Szegedy et al.와 반대되는 놀라운 관찰이다. 이는 spatial convolution이 적용되는 intermediate feature space의 depth가 non-linearity의 실용성에 매우 중요하게 작용되는 것으로 볼 수 있다: 즉, Inception module에 있는 deep feature space(e.g. those found in Inception modules)의 경우에는 non-linearity가 도움이 되지만, shallow feature space (e.g. the 1-channel deep feature spaces of depthwise separable convolutions)의 경우에는 오히려 정보 손실로 인해 해로울 수가 있다.

 

5. Future directions

우리는 전에서 일반적인 convolution과 depthwise separable convolution 간에는 별개의 스펙트럼이 존재한다고 언급했었다. Inception module은 이 스펙트럼의 한 지점에 해당한다. 우리는 실험적인 평가에서 Inception module의 extreme formulation 인 depthwise separable convolution이 일반적인 Inception module보다 이점을 가질 수 있음을 보여줬지만, depthwise separable convolution이 optimal이라고 믿을 이유는 없다.일반적인 Inception module과 depthwise separable convolution의 스펙트럼 사이에 위치한 아키텍처가 추가적인 이점을 가질 수도 있다. 이는 향후 연구를 위해 남겨졌다.

 

6. Conclusions

Convolution과 depthwise separable convolution이 어떻게 양 극단의 스펙트럼에 놓여 있는지를 보여줬다. Inception module은 둘의 중간 지점에 위치한다. 이러한 관찰에 따라, 컴퓨터 비전 아키텍처에서 Inception module을 depthwise separable convolution으로 대체 할 것을 제안했다.이 아이디어를 기반으로 Xception이라는 새로운 아키텍처를 제시했으며, 이는 Inception-v3과 유사한 수의 parameter를 갖는다. Xception을 Inception-v3과 성능을 비교했을 때, ImageNet dataset에 대해서는 성능이 조금 향상됐으며, JFT dataset에 대해서는 성능이 크게 향상됐다. 우리는 Depthwise separable convolution은 Inception module과 유사한 속성을 지녔음에도 일반 conv layer만큼 사용하기가 쉽기 때문에, 향후 CNN 아키텍처 설계의 초석이 될 것으로 기대된다.

 

 

 

Depth-wise-separable convolution

depth-wise separable convolution 연산은 각 채널 별로 convolution 연산을 시행하고 그 결과에 1x1 convolution 연산을 취하는 것이다. 기존의 convolution이 모든 채널과 지역 정보를 고려해서 하나의 feature map을 만들었다면, depthwise convolution은 각 채널 별로 feature map을 하나씩 만들고, 그 다음 1x1 convolution 연산을 수행하여 출력되는 피쳐맵 수를 조정한다. 이 때의 1x1 convolution 연산을 point-wise convolution이라 한다.

 

https://www.youtube.com/watch?v=T7o3xvJLuHk

 

 

 

 

[논문] : Xception Deep Learning with Depthwise Separable Convolutions

[참고]

https://sike6054.github.io/blog/paper/fifth-post/

 

(Xception) Xception: Deep Learning with Depthwise Separable Convolutions 번역 및 추가 설명과 Keras 구현

 

sike6054.github.io

https://wingnim.tistory.com/104

 

Depthwise Separable Convolution 설명 및 pytorch 구현

Depthwise Convolution 우선 Depth-wise Seperable Convolution에 대한 설명을 하기에 앞서 Depth-wise Convolution에 대한 설명을 먼저 할까 한다. 기본적인 개념은 쉽다. 위 처럼 H*W*C의 conv output을 C단위..

wingnim.tistory.com

https://datascienceschool.net/view-notebook/0faaf59e0fcd455f92c1b9a1107958c4/

 

Data Science School

Data Science School is an open space!

datascienceschool.net

 

반응형
반응형

[논문]Deep Residual Learning for Image Recognition

Microsoft Research

Kaiming He Xiangyu Zhang Shaoqing Ren Jian Sun

 

residual learning framework

residual function

stacking more layer : vanishing/exploding gradients

deeper network : accuracy gets saturated => overfitting 이 아니다. 

shortcut connections

identity mappings

 

 

Abstract

 

neural networks는 깊으면 깊을수록 학습하기 힘들다.  우리는 이전 연구에서 사용된 네트워크들보다 훨씬 학습하기 용이한 residual learning framework 을 제안한다. 여기서 우리는 unreferenced functions을 학습하는 대신, layer의 input을 참조하는 residual function을 명시적으로 재구성한다.  우리가 제공하는 residual networks 는 optimize하기도 쉬우며, 상당히 깊은 네트워크의 경우에도 합리적인 정확도를 얻어낼 수 있음을 실험 결과로 보여준다. ImageNet dataset에서는 VGG nets [41](still having lower complexity ) 보다 8배 깊은 152 layers ResNet을 평가하였다.  이들 residual nets 과 앙상블을 한 결과 ImageNet test set에서 3.57%의 top-5 error를 보였다. the ILSVRC 2015 classification task에서 1등을 하였다. 우리는 CIFAR-10 with 100 and 1000 layers 에서도 분석하였다.

depth of representations는 다양한 visual recognition tasks 에서  매우 중요한 역할을 한다. residual network로부터 얻어낸 deep representation으로부터 COCO object detection dataset에서 28%의 개선 효과를 얻었다. Deep residual network의기초는 ILSVRC & COCO 2015 competitions  에 제출하였다. ImageNet detection/localization, COCO detection/segmentation부문에서 1위를 차지했다.

 

1. Introduction

Figure 1. Training error (left) and test error (right) on CIFAR-10 with 20-layer and 56-layer “plain” networks. The deeper network has higher training error, and thus test error. Similar phenomena on ImageNet is presented in Fig. 4.
Figure 2. Residual learning: a building block.

Deep convolutional neural networks [22, 21]의 는 image classification [21, 50, 40]에서 여러가지 돌파구로 이어졌다 . Deep networkslow/mid/highlevel features [50]와 classifiers를 end-to-end multi-layer fashion으로 자연스럽게 통합하며, features 들의 풍부한 ‘level’은 해당 feature를 추출하기 위해 stacked  layer의 depth에 따라 달라진다. 최근의 증거 [41, 44] 따르면 network depth은 결정적 중요하며 ,  challenging ImageNet dataset [36]주요 결과[41, 44, 13, 16] 들은 모두 depth가 16 [41]~30[16] 정도인 “very deep” [41]을 활용했다. 다른 non-trivial visual recognition [8, 12, 7, 32, 27] 에서도 ‘very deep’ model이 큰 도움이 됐다. 깊이의 중요성에 따라 다음과 같은 의문이 생긴다.

더 나은 네트워크를 배우는 것이 stacking more layers 쉬운가? 이 질문에 대한 걸림돌은 처음부터 수렴을 방해하는  vanishing/exploding gradients [1, 9] 의 악명 높은 문제점이 있다. 그러나 이 문제는 주로 normalized initialization [23, 9, 37, 13]와 intermediate normalization layers [16]에 의해 해결되었으며, 이 계층의 수십개의 layers가  있는 network의 back-propagation [22]를 통해 stochastic gradient descent (SGD)에 대한 수렴을 하게 한다. 

deeper networks가 수렴하기 시작할 때, 또 다른 성능 저하 문제가 드러난다. 이는 network depth 가 늘어남에 따라

정확도가 포화상태(놀랍지 않을 수 있습니다)에 도달하게 되면 성능이 급격하게 떨어지는 현상을 말한다. 놀랍게도 , 하락문제는 overfitting 때문에 생긴것이 아니라 , depth가 적절히 설계된 모델에 더 많은 layer를 추가하면 training error가 커진다는 이전 연구[11, 42] 결과에 기반한다. 아래 Fig.1에서는 간단한 실험을 통해 성능 저하 문제를 보여준다.

예기치 않게, 그러한 저하는 overfitting 에 의해 야기되지 않으며, 적절히 깊은 모델에 더 많은 레이어를 추가하면 [11, 42]에서 보고되고 우리의 실험에서 철저히 검증된 바와 같이 더 높은 ttraining error 로 이어진다. 그림 1은 대표적인 예이다.( Depth 가 깊어질 수록 높은 training error가 높았으며 이에 따른 test error도 높았다. ) 이와 같은 성능 저하(training accuracy의 ) 문제는, 모든 시스템의 최적화 난이도가 쉬운 것은 아님을 나타낸다. shallower architecture와 deeper model를 추가하는 더 깊은 아키텍처를 고려해보자. 이를 만족하는 deeper architecture를 위한 constructed solution이 있긴 하다. added layers 는identity mapping 이며, other layers 는 shallower architecture에서 복사된다. (기존에 학습된 shallower architecture에다가 identity mapping인 layer만 추가하여 deeper architecture를 만드는 방법이다.) 이미 존재한 constructed solution에서 ej deeper model 이 shallower counterpart 보다 더 높은  training error 를 생성해서는 안 된다는 것을 나타낸다. 하지만, 실험을 통해 현재의 solver들은 이 constructed solution이나 그 이상의 성능을 보이는 solution을 찾을 수 없다는 것을 보여준다(or unable to do so in feasible time). 

이 논문에서는 우리는 deep residual learning framework을 도입하여 성능 저하 문제를 다룬다.  이 방법은 few stacked layer를 underlying mapping을 직접 학습하지 않고, residual mapping에 맞추어 학습하도록 한다. 공식적으로, 원하는 underlying mappin을  H(x)로 나타낸다면, stacked nonlinear layer의 mapping인 F(x)는 H(x)-x 를 학습하는 것이다. F(x) := H(x)−x 따라서 original mapping은 F(x)+x 로 재구성 된다. 또한, 저자들은 unreferenced mapping인 original mapping보다, residual mapping을 optimize하는 문제가 더 쉽다고 가정한다. 극단적으로 identity mapping 이 optimal일 경우 , nonlinear layers stack에 의한 identity mapping을 맞추는 것보다 residual  0으로 밀어넣는 것이 더 쉬울 것이다. F(x)+x의 공식은 “shortcut connections” 이 있는 feedforward neural networks 으로 구현할 수 있다(Fig. 2). Shortcut connections [2, 34, 49]는 하나 이상의 계층을 건너뛴다. 우리의 예에서는 ,  shortcut connection은 단순한  identity mapping을 수행하고, 그 출력을 stacked layer의 출력에 더하고 있다(Fig. 2). 이와 같은 identity shortcut connection은 별도의 parameter나 computational complexity가 추가되지 않는다. 전체 네트워크는 여전히 backpropagation를 통해 SGD에 의해 end-to-end 로 학습이 가능하며, solver 수정 없이도 common library를 사용하여 쉽게 구현할 수 있다 (e.g., Caffe [19]).

우리는 degradation problem를 보여주고 방법을 평가하기 위해 , ImageNet[36]에 대한  comprehensive experiments을 제시한다. 

우리는 다음과 같이 보여준다. 

1). 우리의 extremely deep residual nets을 최적화하기 쉽지만, 상대적인 “plain” nets (that simply stack layers)은 깊이가 증가할때 더 높은  training error를 나타낸다. 

2). deep residual nets는 훨씬 더 깊어진 깊이에서 정확도 향상을 쉽게 누릴 수 있어며 , 이전 네트워크보다 훨씬 향상된 결과를 얻을 수 있다. 

CIFAR-10 set[20]에도 유사한 현상이 나타나는데, 이는 우리 방법의 최적화 어려움과 효과가 특정 데이터 세트와만 유사한 것이 아님을 시사한다.우리는 100 이상의 layers를 가진 이 데이터 세트에 대해 성공적으로 훈련된 모델을 제시하고 1000개 이상의 레이어를 가진 모델을 탐색한다. 

ImageNet classification dataset [36]에서, 우리는 extremely deep residual nets를 통해 우수한 결과를 얻었다. 우리의 152-layer residual net 는 VGG nets [41]보다 complexity보다 여전히 낮으면서도 ImageNet에 제공된 네트워크 중 가장 깊다. 우리의 ensemble 모델은 ImageNet test set에서 3.57% top-5 error를 기록했으며, ILSVRC 2015 classification competition에서 1등을 차지했다.   또한 extremely deep representations은 other recognition tasks에서 탁월한 성능을 가지고 있으며, ILSVRC & COCO 2015 competitionsImageNet detection, ImageNet localization, COCO detection, and COCO segmentation 부문에서 1등을 차지했다. 이 strong evidence는  residual learning principle이 일반적이라는 것을 보여주며 , 우리는 그것이 다른 시각 및 비전 문제에 적용될 수 있을 것으로 기대한다. 

 

2. Related Work

Residual Representations.

In image recognition에서 VLAD [18]는 dictionary에 대한 residual vectors로 encodes 하는 표현이며, Fisher Vector [30]은 VLAD의 probabilistic version [18] 으로 공식화할 수 있다. 둘 다 image retrieval and classification [4, 48] 를 위한 강력하고 얕은 표현이다. vector quantization의 경우, residual vectors [17]를 encoding 하는 것이 original vectors를 encoding하는 것보다 더 효과적이다. 

low-level vision 과 computer graphics에서 Partial Differential Equations (PDEs)를 해결하기 위해, 널리 사용되는 Multigrid method [3] 은 시스템을 multiple scales에서 subproblems 로 재구성하며, 여기서subproblems 는 a coarser와 a finer scale 사이의 residual solution을 담당한다. Multigrid 의 대안으로는 hierarchical basis pre-conditioning [45, 46]가 있는데 , two scales사이의 residual vectors를 나타내는 변수에 의존한다. [3,45,46] these solvers는 residual nature of the solutions을 인식하지 못하는 standard solvers보다 훨씬 빠르게 수렴하는 것으로 나타났다. 

 

Shortcut Connections.

shortcut connections [2, 34, 49]로 이어지는 Practices and theories은 오래 동안 연구되어 왔다. multi-layer perceptrons(MLPs) 을 학습하는 초기 방법은 네트워크 입력에서 출력 [34, 49]으로 연결된  a linear layer를 추가하는 것이다. [44, 24]에서 , a few intermediate layers은 vanishing/exploding gradients를 다루기 위한 auxiliary classifiers에 연결된다. [39, 38, 31, 47]의 논문은 shortcut connections에 의해 구현되는 layer responses, gradients, and propagated errors의 중심을 맞추는 방법을 제안한다. [44]에서 “inception” layer은 a shortcut branch and a few deeper branches로 구성된다. 

본 연구와 동시에 , “highway networks” [42, 43]는 gating functions [15]과의 shortcut connections를 제공한다. 이러한 gates는 data-dependent이며 parameter-free our identity shortcuts달리 parameters를 가지고 있다. gated shortcut is “closed” (approaching zero)일 때, highway networks의 layer은 non-residual functions를 나타낸다. 반대로 , 위리의 공식은 항상 residual functions를 학습한다 : 우리의 identity shortcuts가 결코 닫히지 않으며, 모든 정보는 항상 전달되며 additional residual functions 를 학습한다. 또한  high-way networks 는 극단적으로 increased depth (e.g., over 100 layers)에도 정확성을 보여주지 않았다. 

 

3. Deep Residual Learning

 

 

3.1. Residual Learning

H(x)를 몇 개의 stacked layers(꼭 전체 네트는 아님) 에 의해 적합한 underlying mapping 으로 간주하고, x는 이러한 레이어 중 첫 번째 레이어에 대한 입력을 나타낸다. 만약 multiple nonlinear layers이 complicated functions 2에 점근적으로 근사할 수 있다는 가설이 있다면, H(x) − x (assuming that the input and output are of the same dimensions)와 같은 점근적으로 근사할 수 있다는 가설과 같다. 따라서  stacked layers 이 대략 H(x)일 으로 예상하는 대신, 우리는   layers들이 residual function F(x) := H(x) − x에 근접하도록 명시적으로 한다. 따라서 original function는  F(x)+x가 된다. 비록 두 형태 모두 (as hypothesized) 로 원하는 기능을 점근적으로 근사할 수 있어야 하지만, 학습의 용이성은 다를 수 있다. 

이 reformulation 는 degradation problem에 대한 counterintuitive phenomena의해 자극을 받는다(Fig. 1, left). introduction에서 논의 한것과 같이 , added layers이 identity mappings으로 구성될 수 있다면, deeper model 은 shallower counter-part보다 training error를 가져야 한다. degradation problem는 solvers 가 여러 nonlinear layers에 의한 identity mappings을 근사화하는데 어려움이 있을 수 있음을 시사한다.residual learning을 통해 , identity mappings이 최적인 경우, solvers 는 단순히 identity mappings에 접근하기 위해 multiple nonlinear layers weights 를 0으로 유도할 수 있다.  

실제의 경우, identity mappings이 최적일 가능성이 낮지만, 우리의 reformulation은 문제를 precondition 하는 데 도움이 될 수 있다. optimal function가  zero mapping보다 identity mapping이 더 가까울 경우, solver 는 새로우 기능으로 함수를 학습하는 것보다 identity mapping을 참조하여 perturbations 을 찾는 것이 더 쉬워야 한다. 

실험에서는 학습된 residual function에서 일반적으로 작은 반응이 있다는 결과를 보여준다(Fig.7 참조). 이 결과는 identity mapping이 합리적인 preconditioning을 제공한다는 것을 시사한다. 우리는 실험(Fig.7)을 통해 , 학습된 residual functions가 일반적으로 작은 반응을 가지고 있다는 것을 보여주며, identity mappings이 합리적인 preconditioning을 제공한다는 것을 시사한다. 

 

3.2. Identity Mapping by Shortcuts

우리는 모든 few stacked layers마다 residual learning을 사용한다. building block은 Fig.2에서 나와있다. 공식적으로 , 이 논문에서는 우리는 a bulding block 을 아래와 같이 정의했다.  

y = F(x,{W i }) + x.                         (1)

x와 y는 각각 building block의 input와 output vector이다.

function F(x,{W_i })는 학습 해야 할 residual mapping이다. 

Fig. 2 에서 two layers가 있는 예를 들면, F = W_2 σ(W_1 x)로 나타낼 수 있다. 

여기서 σ는 ReLU [29]를 나타내며 간소화를 위해 biases 는 생략되었다.  

F + x연산은 shortcut connection 및 element-wise addition으로 수행된다. addition 후에는 second nonlinearity로 ReLU를 적용한다. (i.e., σ(y), see Fig. 2) 

Eqn.(1) 의 shortcut connection 연산은 별도의 parameter나 computational complexity가 추가되지 않는다. 이는 실제로 매력적일 뿐만 아니라  plain network와 residual network 간의 를 비교하는 데에도 중요하다.(공정한 비교를 가능하게 해준다. ) 우리는 parameters의 수, depth, width, 및 computational cost(except for the negligible element-wise addition-> element-wise addition은 무시할 정도이다. )  동일한 plain/residual networks를 공정하게 비교할 수 있다. 

Eqn.(1)에서 x와 F의 dimensin이 같아야 한다. 그렇지 않은 경우 (예: 입력/출력 채널을 변경할 때), shortcut connections을 통해 a linear projection W_s 를 수행하여 dimensions maching 시킬 수 있다. 

y = F(x,{W i }) + W s x.                       (2)

Eqn.(1)에서 square matrix W_s를 사용할 수 있다. 하지만 우리는 실험을 통해 identity mapping이 degradation problem를 해결하기에 충분하고  경제적이므로 W_s는 dimensions maching 시킬 때만 사용하는 것을 보여줄 수 있다. 

residual function F 의 형태는 유연하게 결정할 수 있다. 즉, 본문에서는 two or three layers (Fig. 5)가 function F를 사용하지만, 더 많은 layer를 포함하는 것도 가능하다.  하지만, F가 단 하나의 layer만 갖는 경우에는 Eqn.(1)은 단순 linear layer와 유사하다. y = W_1 x+x 이 layer에서는 이점을 관찰하지 못했다. 

우리는 또한 위의 수식이 단순성을 위해 fully-connected layers에 대한 것이지만, convolutional layers에 적용할 수 있다는 점에 주목한다. function F(x,{W_i })는 multiple convolutional layers를 나타낼 수 있다 . element-wise addition는 channel by channel(channel 별)로  two feature maps에서 수행된다. 

 

3.3. Network Architectures

이 논문에서는 다양한 형태의 plain/residual network에 대해 테스트 했으며, 일관된 현상을 관찰한다. instances for discussion을 증명하기 위하여 , 우리는  ImageNet dataset을 위한 두 모델을 다음과 같이 정의했다.

Plain network

우리의 plain의 baseline(Fig.3 middle)은 주로 VGG net(Fig.3 left)의 철학에서 영감을 받았다. convolutional layers는 대부분 3x3 filter를 가지며, 다음과 같이 두 가지의 간단한 규칙에 따라 디자인 된다.

1). 동일한 output feature map size에 대해, layer의 filters수는 동일하다. 

2).  feature map size가 절반으로 줄어들  경우, layer 당  time complexity를 보전하기 위해 filter의 수를 2배로 한다.

stride 2인 convolutional layers에 의해 직접 downsampling을 사용했다. 네트워크의 마지막에는 global average pooling layer 와 activation이 softmax인 1000-way fully-connected laye로 구성된다 . Fig. 3 (middle)에서 총 weighted layers 수는 34이다. 우리의 모델은 VGG nets [41] (Fig. 3, left)보다 filter수가 작고 complexity 가 lower 다는 것을 주목할 필요가 있다. 우리의 34개의 layer로 구성된 이 baseline plain network(Fig.3 가운데)는 3.6 billion FLOPs이며, 이는 VGG-19(19.6 billion FLOPs)의 18%에 불과하다.

Residual network

위의 plain network의 가반으로, 우리는 shortcut connections((Fig. 3, right) 을 삽입하여  residual version의 network를 만든다. (Fig.3 오른쪽) identity shortcut(Eqn.1)은 input과 output이 동일한 dimension인 경우(Fig.3의 solid line shortcuts)에는 직접 사용할 수 있다. 

dimension이 증가하는 경우(Fig.3의 dotted line shortcuts)에는 아래의 두 옵션을 고려한다. 

(A) shortcut 는 여전히 identity mapping을 수행하며, 

zero entry padding 를 추가되어서  dimensions을 널린다.  이 옵션은 별도의 parameter가 추가되지 않음

(B) Eqn.2의 projection shortcut을 dimension matching에 사용한다. (done by 1x1 convolutions). shortcut connection이 다른 크기의 feature map 간에 mapping될 경우, 두 옵션 모두 strides를 2로 수행한다.

y = F(x,{W i }) + W s x. (2) 

FLOPS :플롭스는 컴퓨터의 성능을 수치로 나타낼 때 주로 사용되는 단위이다. 

 

3.4. Implementation

논문에서 ImageNet dataset에 대한 실험은 [21, 41] 방법에 따른다.  이미지는  scale augmentation [41]를 위해 [256, 480]에서 무작위하게 샘플링 된 shorter side를 사용하여 rescaling된다. 224x224 crop은 horizontal flip with per-pixel mean subtracted [21] 이미지 또는 이미지에 무작위로 샘플링 된다. standard color augmentation in [21] 도 사용된다. 우리는 [16]에 이어 , 각 convolution 직후와 activation 전에 batch normalization (BN) [16]를 사용했다. [13] 과 같이 weights 를 초기화하고 모든 plain/residual nets를 처음부터 학습한다. 우리는 SGD 사용하고 mini-batch size는 256이다.  learning rate는 0.1에서 시작하여, error plateau 나올때 rate를 10으로 나누어 적용하며, 모델은 최대 iteration은 6X10^4회이다. 우리는 weight decay는 0.0001, momentum은 0.9로 한 SGD를 사용했다. [16]의 관례에 따라 dropout[14]을 사용하지 않는다. 

테스트에서 , 비교 연구를 위해 ,  standard 10-crop testing [21]를 채택한다. 

최상의 결과를 위해 , 우리는  [41, 13] 와 같은 fully convolutional form 적용하였으며 , multiple scales를 평균화하였다 (images are resized such that the shorter side is in {224, 256, 384, 480, 640}).multiple scale은 shorter side가 {224, 256, 384, 480, 640}인 것으로 rescaling하여 사용한다.

 

 

4. Experiments

 

4.1. ImageNet Classification

우리는 1000 classes로 구성된  ImageNet 2012 classification dataset[36] 에서 제안하는 방법을 평가한다. 

모델의 학습및 테스트 에 사용된 데이터는 아래와 같다.

training images : 1.28 million

validation images : 50k 

test images images : 100k => final result 

테스트 결과는 top-1 error와 top-5 error를 모두 평가한다. 

Plain Networks

우선 우리는 18-layer and 34-layer plain nets에 대해서 평가한다. 34-layer plain net은 Fig. 3 (middle)에 있다.  18-layer plain net 는 비슷한 형태로 구성된다 . 상세한 구조는  Table 1에서 보여준다.

plain net  = > Table 2 의 결과에서는 18-layer plain net 에 비해, deeper 34-layer plain net 의  validation error가 높다는 것이다. => deeper 34-layer plain net의 validation error가 높다 .

이유를 알아보기 위 Fig. 4 (left)에서 우리는 학습 중의 training/validation error를 비교한다. 우리는 degradation problem 를 관찰했다. -  18-layer plain network의 solution space는 34-layer plain network의 subspace임에도 불구하고, 오히려 34-layer plain net 인 경우 학습 과정 전반에서  더 높은 training error 를 갖는다.  

논문의 저자들은 여기서 직면하는 optimization difficulty가 vanishing gradients에 의한 것과 같지 않다고 하였다. 그 이유는 plian network 가 BN [16]을 포함하여 학습하기 때문에 forward propagated signal의 분산이 0이 아니도록 보장한다. 우리는 또한 backward propagated gradients가 BN과 함께 healty norm을 보이는 것도 확인했기 때문이다. 따라서forward/backward signal은 vanishing 하지 않았다고 볼 수 있다. 실제로 ,  Table 3 의 결과를 따르면 34-layer plain network가 여전히 경쟁력 있는 정확도를 달성했으며, 이는 solver의 작동이 이루어지긴 한다는 것을 의미한다. 저자들은 또한, deep plain network는 exponentially low convergence rate를 가지며, 이것이 training error의 감소에 영향 끼쳤을거라 추측하고 있다. optimization difficulties의 원인에 대해서는 미래에 배울 것이다. 

=> 층이 깊을 수록 training error가 낮은 것 보다 낮다. optimization difficulties가  gradient vanishing 문제가 아닌것 같고  exponentially low convergence rate를 가지고 있으서 training error의 감소에 영향 끼쳤을거라 추측하고 있다.

We have experimented with more training iterations (3×) and still observed the degradation problem, suggesting that this problem cannot be feasibly addressed by simply using more iterations. => 저자들은 더 많은 training iterations (3×) 으로 실험했지만 여전히 degradation problem를 관찰하였으며 , 이는 단순히 더 많은 반복을 사용하는 것으로 이 문제를 해결할 수 없음을 시사한다.

Residual Networks

다음으로 18-layer 및 34-layer residual network(이하 ResNet)를 평가한다. baseline architecture는 위의 plain network와 동일하며, Fig.3의 오른쪽과 같이 각 3x3 filter pair에 shortcut connection을 추가했다. In the first comparison (Table 2 and Fig. 4 right),  모든 shortcut connection은 identity mapping을 사용하며, dimension matchings (option A)을 위해서는 zero-padding을 사용한다(3.3절의 옵션 1 참조). 따라서, 대응되는 plain network에 비해 추가되는 parameter가 없다.

Table.2와 Fig.4에서 알 수 있는 3가지 주요 관찰 결과는 다음과 같다.

1. residual learning으로 인해 상황이 바뀌었다. 34-layer ResNet이 18-layer ResNet(by 2.8%)보다 우수한 성능을 보인다. 또한, 34-layer ResNet이 상당히 낮은 training error를 보였으며, 이에 따라 향상된 validation 성능이 관측됐다. 이는 성능 저하 문제가 잘 해결됐다는 것과, 증가된 depth에서도 합리적인 accuracy를 얻을 수 있다는 것을 나타낸다.

2. 34-layer ResNet은 이에 대응하는 plain network와 비교할 때, validation data에 대한 top-1 error를 3.5% 줄였다(Table.2 참조). 성공하게 training errors을 줄이는 것은 (Fig. 4 right vs. left) 결곽 있다.  이는 extremely deep systems에서 residual learning의 유효성을 입증하는 결과다.

3. 마지막으로는 , 18-layer plain/residual network 간의 정확도(Table 2) 유사한 성능을 보였지만, Fig.4에 따르면 18-layer ResNet이 더욱 빠르게 수렴한다r (Fig. 4 right vs. left). 이는 network가 “not overly deep”한 경우(18-layers의 경우), 현재의 SGD solver는 여전히 plain net에서도 좋은 solution을 찾을 수 있다는 것으로 볼 수 있다. 하지만, 이러한 경우에도 ResNet에서는 빠른 수렴속도를 기대할 수 있다.

Identity vs. Projection Shortcuts

앞에서 parameter-free한 identity shortcut이 학습에 도움 된다는 것을 보였다. 이번에는 Eqn.2의 projection shortcut에 대해 조사하자. Table.3에서는 다음 3가지 옵션에 대한 결과를 보여준다.

  1. zero-padding shortcut는 dimension matching에 사용되며, 모든 shortcut는 parameter-free하다(Table.2 및 Fig.4의 결과 비교에 사용됨).
  2. projection shortcut는 dimension을 늘릴 때만 사용되며, 다른 shortcut은 모두 identity다.
  3. 모든 shortcut은 projection이다.

Table.3에서는 3가지 옵션 모두 plain network보다 훨씬 우수함을 보여준다. 우리는 이것이 A의 zero-padded dimensions이 실제로 esidual learning이 없기 때문이라고 주장한다. C에 비해서 B보다 약간 낫고 , 우리는 이것을 많은 (thirteen) projection shortcuts에 의해 도입된 추가 parameters 때문이라고 본다. 그러나  A/B/C 간의 작은 차이는 projection shortcuts가 degradation problem를 해결하는데 필수적이지 않다는 것을 나타냅니다. 따라머 memory/time complexity와 model size를 줄이기 위해 이 논문의 나머지 부분에서는 옵션 C를 사용하지 않느다. Identity shortcuts은 아래에 소개된 bottleneck architecture의 complexity를 증가시키지 않는데 특히 중요하다. 

Deeper Bottleneck Architectures. 

다음으로 mageNet을 위한 deeper nets에 대해 설명한다. 학습 시간에 대한 우려로 인해 building block as a bottleneck desig으로 설계한다. 

Deeper non-bottleneck ResNets (e.g., Fig. 5 left) also gain accuracy from increased depth (as shown on CIFAR-10), but are not as economical as the bottleneck ResNets. So the usage of bottleneck designs is mainly due to practical considerations. We further note that the degradation problem of plain nets is also witnessed for the bottleneck designs. =>Deeper non-bottleneck ResNets  (예: Fig. 5 lef ) 도 증가된 depth (CIFAR-10에 표시된 대로)에서 정롹도를 얻지만 bottleneck ResNets만큼 경제적이지는 않는다. 그래서 bottleneck designs의 사용은 주로 실용적인 고려 사항 때문이다. 우리는 또한  bottleneck designs에서도 plain nets의  degradation problem 가 목격된다는 것을 주목한다. 

각 residual function F 에 대해, 우리는 2 layers 대신 3 layers의 stack을 사용한다(Fig.5 참조). three layers는 1×1, 3×3, and 1×1 convolutions이며 , 여기서 

1×1 layers는 (restoring) dimensions 크기 를 을 줄이거나 증가시키는 용도로 사용하며 ,

3×3 layer의 input/output의 dimentsion을 줄인 bottleneck 으로 둔다. Fig.5에서는 2-layer stack과 3-layer stack가 유사한 디자인과 유사한 time complexity을 갖는 예를 보여준다 . 둘은 유사한 time complexity를 갖는다.

여기서 parameter-free는  identity shortcuts는 bottleneck architectures에서 특히 중요하다. 만약 Fig. 5 (right) 의 identity shortcut가 projection으로 대체된다면,  shortcut이 두 개의 high-dimensional 출력과 연결되므로 time complexity와 model size가 두 배로 늘어난다. 따라서 identity shortcut은 이 bottleneck design을 보다 효율적인 모델로 만들어준다.

50-layer ResNet:

우리는 34-layer ResNet의 2-layer block들을 3-layer bottleneck block으로 대체하여 50-layer ResNet(Table 1)을 구성했다. 우리는 크기를 늘리기 위해 option B 를 사용한다. 이 모델은 3.8 billion FLOPs 를 가지고 있다. 

101-layer and 152-layer ResNets: 우리는 더 많은 3-layer bottleneck block을 사용하여 101-layer 및 152-layer ResNet을 (Table 1) 구성했다. depth가 상당히 증가했음에도 상당히 높은 정확도가 결과로 나왔다. 152-layer ResNet (11.3 billion FLOPs)은 VGG-16/19 nets (15.3/19.6 billion FLOPs)보다 복잡성이 낮다. 

50/101/152-layer ResNets는 34-layer ResNets 보다 상당한 margins 으로 정확하다 (Table 3 and 4).  

Comparisons with State-of-the-art Methods

Table.4에서는 previous best single-model  결과와  비교한다. 우리의 baseline인 34-layer ResNet은 previous best에 비준하는 정확도를 달성했다.  152-layer ResNet의 single-model top-5 error는 4.49%를 달성했다. 이 single-model result 결과는 이전의 모든 ensemble result를 능가하는 성능이다(Table.5 참조). 또한, 우리는 서로 다른 depth의 ResNet을 6개 모델을 (ensemble)을 형성한다. (submitting시 152-layer 모델 2개만 있음)이로 하여 tes set에서 top-5 test error를 3.57%까지 달성했다(Table 5). 이는 ILSVRC 2015 classification task에서 1위를 차지했다.

4.2. CIFAR-10 and Analysis

논문에서는 CIFAR-10 dataset[20]에 대한 더 많은 연구를 수행했다. 

CIFAR-10 dataset : 

10개의 classes

training images가 50 k

testing images 10k

우리는 training set에서 학습되고 test set에서 평가된 실험을 제시한다. 우리는 extremely deep networks의 동작에 초점을 맞추고 있지만 state-of-the-art results를 추진하는 데는 초점을 맞추지 않기 때문에 의도적으로 다음과 같은 간단한 architecture를 사용했다.

plain/residual architectures는 Fig. 3 (middle/right)의 양식을 따른다. 

network의 input은 per-pixel mean subtracted 32x32 이미지이다.

첫 번째 layer는 3x3 cconvolutions이다.그런 다음 sizes {32, 16, 8} respectively  feature maps 에서 각각3×3 convolutions을 가진 stack of 6n layers를 사용하고 각 feature map size에 대해  2n layers를 사용한다. filters  수는 각각 {16, 32, 64}개이다. 그 subsampling 은 stride 2으로 convolutions 을 수행된다. network의 ends는 global average pooling, a 10-way fully-connected layer, and softmax로 구성된다. 총  6n+2 stacked weighted layers가 있다. 다음 표는 아키텍처가 요약되어 있다. 

shortcut connections가 사용될 때 , 3×3 layers 쌍 (totally 3n shortcuts) 에 연결된다. 이 dataset에서 우리는 모든 경우(즉 option A) 에 identity shortcuts를 사용하므로 우리의 residual models은 plain counterparts와 정확히 동일한 depth, width, and number of parameters수를 갖는다. 

학습 진행 방법은 다음과 같다.

weight decay : 0.0001

momentum : 0.9

weight initialization in [13] and BN [16]수렴하고 but with no dropout.

2개의 GPU에서 mini-batch size를 128로 학습했다. 

learning rate는 0.1부터 시작하여 , 32000/48000번 째 iteration에서 10으로 나누고, 45k/5k train/val split 결정되는 64k iterations에서 학습을 종료한다. 

학습을 위해 [24]의 간단한 data augmentation을 따른다 :

4개의 pixel이 각 side에 padded 있으며 32×32 crop이 padded 된 이미지 또는  horizontal flip에서 무작위로 샘플링된다. 

테스트를 위하여 우리는 original 32×32 image의 single view만 평가한다. 우리는n = {3, 5, 7, 9}에서는  20, 32, 44, and 56-layer networks를 비교한다. Fig. 6 (left)은 plain network의 결과를 보여준다.  deep plain nets 은 depth가 증가하여 , going deeper수록  training error 가 커진다. 이 현상은 ImageNet (Fig. 4, left) 및 MNIST (see [42])의 현상과 유사하며 , 이는 이러한 최적화 어려움이 근본적인 문제임을 시사한다. 

Fig. 6 (middle) 는 ResNets의 학습 결과를 보여준다. 또한 ImageNet cases (Fig. 4, right)와 유사하게 ResNets은 optimization 어려움을 극복하고 깊이가 커질 때 정확도가 향상됨을 입증한다. 

110-layer ResNet으로 이어지는 n = 18에 대해서 자세히 살펴본다. 이 경우 initial learning rate가 0.1인 것이  수렴을 시작하기에는 약간 너무 크다는 것을 알 수 있다. 

With an initial learning rate of 0.1, it starts converging (<90% error) after several epochs, but still reaches similar accuracy. =>  initial learning rate of 0.1으로 , 몇 epoches후 수렴(<90% error)을 시작하지만 여전히 유사한 정확도에 도달한다. 

따라서 0.01을 사용하고 training error가 80% (약 400 iterations)미만으로 떨어질 때까지 학습 warm up을 수행한 다음 0.1로 다시 돌아가서 학습을 계속 한다. 나머지 learning schedule은 이전과 같다. 110-layer network 는 잘 수렴된다(Fig. 6, middle). FitNet [35] 및 Highway [42](Table 6)와 같은 다른  deep and thin networks 보다 parameters가 적지만 state-of-the-art results (6.43%, Table 6)을 달성했다 . 

 

Analysis of Layer Responses. 

Analysis of Layer Responses.

Fig.7은 layer response의 std(standard deviation)를 보여준다. response는 BN 이후와 다른 nonlinearity(ReLU/addition) 이전의 각 3x3 conv layer의 output이다. ResNets의 경우, 이 분서을 통해 residual functions의 response strength 를 확인할 수 있다.  Fig.7에서는 ResNet이 일반적으로 plain counterparts보다 반응이 적다는 것을 보여준다. 이러한 결과는 residual function이 non-residual function보다 0에 가까울 수 있다는 우리의 basic motivation (Sec.3.1)를 뒷받침한다. 우리는 또한 Fig.7의 ResNet-20, 56 및 110 사이의 비교에서 증명된 바와 같이 더 깊은  ResNet의 Response가 더 작다는 것을 알 수 있다. layers가 많을 수록 ResNets 의 개별 layer은 신호를 덜 수정하는 경향이 있다.

Exploring Over 1000 layers.

우리는 100개 이상의 layer로 구성된 

aggressively deep model을 탐구한다. 위에서 설명한 대로 학습되는 1202-layer network로 이어지는 n = 200을 설정한다. 우리의 방법은 optimization  어려움이 없으며, 이 103-layer network 는 training error <0.1% (Fig. 6, right). test error는 여전히 상당히 양호한 결과를 보였다. (7.93%, Table 6)

 그러나 그러한 aggressively deep models에 대해서는 아직 해결되지 않은 문제들이 있다. 1202-layer network의 test 결과는 110-layer ResNet의 test결과보다 더 나쁘다. 우리는 이것이 과적합 때문이라고 주장한다. 1202-layer network는 CIFAR-10 작은 dataset에 test용으로 불필요하게 클 수 있다. (19.4M) maxout [10] 또는 dropout [14]와 같은 강력한 regularization 를 적용하여 이 dataset에 대한 최상의 결과([10, 25, 24, 35]) 를 얻는다. 이 논문에서 우리는 maxout/dropout을 사용하지 않고, optimization의 어려움에 집중하는 것을 방해하지 않고 설계상 deep and thin architectures를 통해 regularization 만 시행한다.  하지만 더 강력한 

regularization 와 결합하면 결과가 향성될 수 있는데, 앞으로 우리가 연구할 것이다. 

 

4.3. Object Detection on PASCAL and MS COCO

우리의 방법은 다른 recognition tasks에서 좋은 generalization performance 가지고 있다. 

Table 7 and 8에는 PASCAL VOC 2007 and 2012 [5] and COCO [26]의  object detection baseline results가 표시된다. detection method으로 Faster R-CNN [32]을 채택한다. 여기서는 VGG-16 [41] with ResNet-101로 교체하는 개선 사항에 대해 살펴봅시다. 두 모델을 사용하는 detection implementation (see appendix) 은 동일하므로 이득은 더 나은 networks에만 얻을 수 있다. 가장 주목할 만한 점은 까다로운 COCO 데이터 세트에서 COCO 의  standard metric (mAP@[.5,.95])이 6.0%증가하여 상대적으로 28% 향상되었다. 이 이득은 오로지 학습된 표현에 기인한다.

deep residual nets 기반으로 , ILSVRC & COCO 2015 competitions에서 , 여러 tracks에서 1위를 차지 했다: ImageNet detection, ImageNet localization, COCO detection, and COCO segmentation. 자세한 내용은 appendix에 있다. 

 

 

 

 

 

 

A. Object Detection Baselines

이 section에서는 baseline Faster R-CNN [32] 시스템을 기반으로 detection method을 소개한다. 모델은 ImageNet classification models에 의해 초기화된 다음 bject detection data에서 fine-tuned 된다. 우리는 ILSVRC & COCO 2015 detection competitions 당시 ResNet-50/101으로 실험했다.

[32]에서 사용 되는  VGG-16과 달리 ResNet에는 hidden fc layers이 없다 . 우리는이 문제를 해결하기 위해“Networks on Conv feature maps”(NoC) [33]라는 아이디어를 채택했다.  이미지에 대한 strides 이  16 pixels (i.e., conv1, conv2 x, conv3 x, and conv4 x, totally 91 conv layers in ResNet-101; Table 1)를 사용하여 전체 이미지 shared conv feature maps을 계산한다. 우리는 이러한 레이어가 VGG-16의 13 개 conv 레이어와 유사하다고 간주하며, 그렇게 함으로써   ResNet과 VGG-16은 모두 동일한 총 stide (16 pixels)  conv feature maps을 갖게 된다. 이러한 layer은 egion proposal network (RPN, generating 300 proposals) [32]와 Fast R-CNN detection network [7]에 의해 공유된다. RoI pooling [7] 은 conv5-1 이전에 수행된다. 이 RoI-pooled feature에서는 VGG-16’s fc layers역할을 수행하는 모든 conv5 x 이상의 계층이 각 지역에 채택된다. 마지막  classification layer은 두개의 sibling layers (classification and box regression [7])으로 대체된다. 

BN layer를  사용하기 위해 pre-training 후 ImageNet training set에서 각 layer에 대한 BN statistics(means and variances)를 계산한다.  그런 다음 object detectoin를 위한  fine-tuning 에 BN layer가 고정된다. 따라서 BN layer는 일정한 offsets and scales로 linear activations 가 되며 ,  BN statistics 은 fine-tuning 할때 업데이터되지 하지 않는다.  우리는 주로 Faster R-CNN training에서 메모리 소비를 줄이기 위해 BN layer를 고정한다.

PASCAL VOC

[7, 32]에 따라 ASCAL VOC 2007 test set의 경우 , VOC 2007의 5k trainval 이미지와 VOC 2012의 16k trainval 이미지를 학습에 사용한다(“07+12”). PASCAL VOC 2012 test set의 경우, VOC 2007의  10k trainval+test images와 VOC 2012의 16k trainval images를 학습에 사용한다. Faster R-CNN 학습을 위한 hyper-parameters는 [32]와 동일하다.  Table 7은 결과를 보여준다. ResNet-101 은 VGG-16에 비해 mAP를 3% 이상 향상시켰다. 러한 이점은 전적으로 ResNet에서 학습한 향상된 기능 때문이다.

MS COCO

MS COCO dataset  [26]는 80개의 object categories로 포함한다. PASCAL VOC metric (mAP @IoU = 0.5)과 standard COCO metric (mAP @ IoU =.5:.05:.95)을 평가한다. 학습을 위해 train set의 80k 이미지를 사용하고 평가를 위해  val set 의 40k를 사용한다. 우리의 detection system은 PASCAL VOC와 유사하다. 우리는  8-GPU implementation으로 COCO 모델을 교육하므로 RPN단계는 8 images (i.e., 1 per GPU) 의 mini-batch size를 가지며  Fast R-CNN step은 16 images mini-batch size를 갖는다.  RPN step 와 Fast RCNN step는 모두 learning rate가 0.001인 240k iterations 과 0.0001인 80k iterations 에 대해 훈련 된다. 

Table 8 은 MS COCO validation set의 결과를 보여준다. ResNet-101은 VGG-16에 비해 mAP@[.5, .95]가 6% 증가했으며, 이는 더 나은 네트워크에 의해 학습된 기능에 대해서만 28%의 상대적 개선이다. 놀랍게도, mAP@[.5,.95]의 absolute increase (6.0%)은 mAP@.5’s (6.9%)와 거의 같다. 이것은 network가 더 깊어질수록 ecognition and localization과 모두 향상될 수 있음을 시사한다. 

B. Object Detection Improvements

completeness를 위해 competitions 개선사항을 보고 드린다. 이러한 개선 사항은 deep features을 기반으로 하므로 residual learning에서 이득을 얻을 수 있다. 

MS COCO

Box refinement. box refinement은 부분적으로 [6]의 iterative localization 파악을 따른다. Faster R-CNN에서 final output은 proposal box와 다른 regressed box이다. 그래서 추론을 위해, 우리는 regressed box 에서 새로운 기능을 pool 하고 새로운 classification score와 새로운 regressed box를 얻는다. 우리는 이  300 new predictions  과 original 300 predictions을 결합한다. Non-maximum suppression (NMS)는 0.3 [8]의 IoU threshold을 사용한 다음 box voting [6]를 사용하여 predicted boxes의 union set에 적용된다. Box refinement 는 mAP 를 2 points (Table 9) 개선한다. 

Global context. Fast R-CNN step에서 global context를 결합한다. full-image conv feature map이 주어지면 전체 이미지의 bounding box를 ROI로 사용하여 “RoI” pooling으로 구현할 수 있는 global Spatial Pyramid Pooling [12] (with a “single-level” pyramid)  에 의해 feature를 pooling한다. 이 pooled feature 은 global context feature을 얻기 위해 post-RoI layers 에 공급된다. 이 global feature는 original per-region feature와 연결된 다음 sibling classification and box regression layers 과 연결된다. 이 new structure는end-to-end로 학습된다. Global context는 mAP@.5를 약 1 point (Table 9)향상시킨다. 

Multi-scale testing. 위에서 모든 결과는 [32]와 같이 single-scale training/testing을 통해 얻을 수 있으며, 여기서 영상의 더 짧은 면은 s = 600 pixels입니다. Multi-scale training/testing 는 feature pyramid에서 scale 을 선택하여   [12, 7]에서 개발되었으며 [33] 에서는 maxout layers를 사용하여 개발되었다. 현재 구현에서는 [33]에 따라 multi-scale testing 를 수행했지만 시간이 제한되어 multi-scale training 을 수행하지 않았다. 또한 Fast R-CNN step (but not yet for the RPN(region proposal network) step)에 대해서만 multi-scale testing을 수행했다.  

Using validation data. 다음으로 우리는 학습에 80k+40k trainval set 와 평가에 20k test-dev set를 사용한다. testdev set에서 공개적으로 사용할 수 있는 ground truth가 없으며 결과는 evaluation server에 의해 보고된다. 이 설정 하에서 결과는 mAP@.5 of 55.7% and an mAP@[.5, .95] of 34.9% (Table 9)이다. 이것은 우리의 single-model result이다. 

Ensemble. Faster R-CNN에서 시스템은 region proposals과 object classifiers를 학습하도록 설계되어 있으므로 ensemble 을 사용하여 두 작업을 모두 향상시킬 수 있다. 우리는 regions을 제안하기 위해 앙상블을 사용하고 , 제안의 union set는 per-region classifiers 에 의해 처리된다. Table 9는 3개의 networks의 ensemble을 기반으로 한 우리의 결과를 보여준다. mAP 는  test-dev set에서 59.0% and 37.4%이다. 이 결과는 2015년 COCO  detection task에서 1위를 차지했다. 

PASCAL VOC

위의 모델을 기반으로 PASCAL VOC dataset를 다시 살펴본다. COCO dataset의 single model(55.7% mAP@.5 in Table 9) 를 사용하여 PASCAL VOC sets에서 이 모델을 fine-tune한다. box refinement, context, and multi-scale testing의 개선 사항도 채택되었다. 이를 통해 PASCAL VOC 2007 (Table 10) 85.6%를 달성하고 and  PASCAL VOC 2012 (Table 11)에서 83.8% 를 달성했다. ASCAL VOC 2012에서의 결과는 이전의 state-of-the-art result [6] 보다 더 높다.

ImageNet Detection

ImageNet Detection (DET) 작업은 200개의 object categories를 포함한다. 정확도는 mAP@.5로 평가된다. ImageNet DET 에 대한 우리의 object detection algorithm은 Table 9의 MS COCO와 동일하다. 이 networks 들은 1000-class ImageNet classification set에서 pretrained 되며  DET data에서  fine-tuned 된다. validation set 를   [8]에 이어 두 부분 (val1/val2)으로 분할했다.  DET training set와 val1 set를 사용하여  detection models 을 fine-tune한다. val2 set 가 검증에 사용된다.  ILSVRC 2015 data에서 사용하지 않는다. ResNet-101을 사용하는 single model 은 58.8%의 mAP를 가지며 3 models의 ensemble은 DET test set (Table 12)에서 2.1%의 mAP를 가진다(Table 12). 이 결과는 ILSVRC 2015에서 ImageNet detection task 1위를 차지해 2위를 8.5 points (absolute) 앞섰다. 

C. ImageNet Localization

 ImageNet Localization (LOC) task [36] 에서는 objects를 classify and localize를 요구한다. [40, 41]에 이어 , 우리는 image-level classifiers가 image의 class label을 예측하기 이해 먼저 채택되고 , localization algorithm 은 예측된 class를 기반으로 bounding boxes 예측만 설명한다고 가정한다. 우리는 각 class에 대한 bounding box regressor 를 학습하는 “per-class regression” (PCR) strategy [40, 41]을 채택한다. 우리는 ImageNet classification 를 위해 network를 pre-train 한 다음 localization을 위해 fine-tune한다. 제공된 1000-class ImageNet training set에서 network를 학습한다. 우리의 localization algorithm은 몇 가지 수정을 거친  [32] 의  RPN(Region proposal network) framework 를 기반으로 한다. category-agnostic [32]의 방식과 달리, localization 에 대한 RPN 은  per-class form으로 설계되었다. 이 RPN 은 [32]에서와 같이 binary classification (cls) and box regression (reg)를 two sibling 1×1 convolutional layers로 끝난다. [32]와 대조적으로 , cls와 reg layers은 둘 다 per-class에 있다. 특히 cls layer는 1000-d output를 가지며 , 각 차원은 object class 유무를 예측하기 위한 binary logistic regression이다 ;  [32]에서와 같이 bounding box regression는 각 위치에 있는 multiple translation-invariant “anchor” boxes 를 참조한다. 

ImageNet classification training (Sec. 3.4)에서 처럼 data augmentation를 위해 224×224 crops 을 무작위로 샘플링한다. fine-tuning을 위해 256 images 의 mini-batch size를 사용한다. negative samples이 지배되는 것을 방지하기 위해 각 이미지에 대해 8개의 anchors 를 샘플링하며 , 여기서 샘플링된 positive and negative anchors의 비율은 1:1 [32]이다. 테스트를 위해 network는 image fully-convolutionally 적용된다. Table 13은 localization results를 비교한다. [41]에 이어 먼저 classification prediction으로 ground truth class를 사용하여 “oracle” testing를 수행한다. VGG’s paper [41]은 ground truth classes를 사용하여 33.1% (Table 13) 의 center-crop error를 보고한다. 동일한 설정에서 , ResNet-101 net을 사용하는 RPN method은 center-crop error를 13.3 %로 크게 줄인다. 이 비교는 우리 framework의 우수한 성능을 입증한다. dense (fully convolutional)및 multi-scale testing에서 ResNet-101은 ground truth classes를 사용하여 11.7%의 error를 가진다. classes  예측에 ResNet-101사용할 경우 (4.6% top-5 classification error, Table 4) , top-5 localization error is 14.4%이다. 

위의 결과는 Faster R-CNN [32]의 roposal network (RPN)에만 기반한다. 결과를 개선하기 위해 Faster R-CNN의 detection network (Fast R-CNN [7])를 사용할 수 있다. 그러나 이 dataset에서는 일반적으로 하나의 이미지가 하나의 dominate object를 포함하고 proposal regions 이 서러 매우 겹쳐서 매우 유사한 ROI 풀 기능을 가지고 있다는 것을 알 수 있다. 결과적으로 , Fast R-CNN [7]의 image-centric training은 stochastic training에는 바람직하지 않을 수 있는 작은 변화의 샘플을 생성하다. 이에 자극을 받아 current experiment에서는 Fast R-CNN 대신 RoI-centric의 original RCNN [8]을 사용한다. 

우리의 R-CNN 구현은 다음과 같다. 우리는 training images 에 위에서 학습된 per-class RPN을 적용하여 ground truth class에 대한 경계 상자를 예측한다. 이러한 predicted boxes는 class-dependent proposals의 역할을 한다. 각 training image에 대해 가장 높은 점수를 받은 200 proposals이 R-CNN classifier를 학습하기 이한 학습 샘플로 추출된다. image region은 proposal에서 cropped내어 224×224 pixels로 뒤틀린 다음 R-CNN [8]에서와 같이 classification network에 공급된다. 이 network의 출력은 cls와 reg에 대한 두개의 sibling fc layers으로 구성되며 , per-class form로도 구성된다. 이 R-CNN network 는  RoI-centric fashion의 방식으로 256개의 mini batch size를 사용하여 training set에서 fine-tuned 된다. testing를 위해 RPN은 각 예측 클래스에 대해 가장 높은 점수를 200 proposals 을 생성하고 , R-CNN network를 사용하여 이러한 proposals’ scores and box positions을 업데이터한다. 

이 방법은 top-5 localization error를 10.6% (Table 13) 줄였다. 이것은 validation set에 대한 우리의 single-model result 이다. lassification and localization에 network ensemble 을 사용하여 test set에서  top-5 localization error of 9.0%에 이른다. 이 수치는 ILSVRC 14 results (Table 14)를 크게 능가하며, 상대적인 error 감소를 보여준다. 이 결과는  ILSVRC 2015에서  ImageNet localization task에서 1위를 차지했다. 

 

 

 

[출처] Deep Residual Learning for Image Recognition

[참조]

https://sike6054.github.io/blog/paper/first-post/

 

(ResNet) Deep residual learning for image recognition 번역 및 추가 설명과 Keras 구현

Paper Information

sike6054.github.io

파파고 번역을 많이 사용하였다. 

반응형
반응형

논문출처: Wide Residual Networks

Abstract

Deep residual networks는 수천 개의 레이어로 확장 할 수 있으며 여전히 성능이 향상되는 것으로 입증되었다. 그러나 각 네트워크의 훈련 정확도는 거의 두 배가되어 각 네트워크의 훈련 정확도가 두 배된다. 이러한 문제에 대응하여 본 논문에서는 ResNet 블록의 구조에 대한 자세한 실험적 연구를 수행하고이를 바탕으로 ResNet 네트워크 깊이를 줄이고 ResNet 네트워크 폭을 증가시키는 새로운 구조를 제안한다. 이 네트워크 구조를 WRN (Wide Area Residual Network)이라고하며 이러한 네트워크 구조가 일반적으로 사용되는 얇고 ​​매우 깊은 네트워크 구조보다 훨씬 우수하다는 것을 보여준다. 예를 들어, 우리는 단순한 16-layer-deep wide residual network 조차도 CIFAR, SVHN 및 COCO의 최신을 달성 한 천 계층 딥 네트워크를 포함하여 이전의 모든 deep wide residual network 보다 정확도와 효율성이 더 우수하다는 것을 증명했다. ImageNet에 대한 성과와 상당한 개선이 이루어졌습니다. 우리의 코드와 모델은 https://github.com/szagoruyko/wide-residual-networks에서 확인할 수 있다. 

 

Introduction

지난 몇 년간 Convolutional neural networks의 계층 수가 AlexNet [16], VGG [26], Inception [30]에서 많은 이미지 인식 작업의 개선에 해당하는 잔여 네트워크 [11]로 점차 증가했다 . 최근 몇 년 동안 일부 연구에서 딥 네트워크의 우월성을 발견했다 [3,22]. 그러나 심층 신경망의 훈련에는 exploding/vanishing gradients and degradation 등 몇 가지 어려움이 있다. 잘 설계된 초기화 전략 [1,12], better optimizers [29], 연결 건너 뛰기 [19,23], 지식 전달 [4,24]과 layer-wise training [25] 같은 심층 신경망과 을 훈련하기위한 다양한 기술이 제안되었다. 

 

최신 residual networks [11]는 ImageNet 및 COCO 2015 대회에서 큰 성공을 거두었으며 ImageNet 및 CIFAR의 개체 분류, PASCAL VOC 및 MS COCO의 개체 감지를 포함한 여러 벤치 마크 테스트에서 최신 수준을 달성했다. 그리고 분할. 초기 아키텍처와 비교하여 더 나은 일반화 능력을 보여 주므로 이러한 기능을 전이 학습에서 더 효과적으로 사용할 수 있다. 또한 follow-up 작업은 나머지 링크가 딥 네트워크의 수렴을 가속화한다는 것을 보여준다 [31]. 최근 follow-up 작업은 나머지 네트워크에서 활성화 순서를 탐색하고 나머지 블록에서 identity 매핑을 제안하고 [13] 매우 심층 네트워크의 훈련을 개선했다. 고속도로 망 [28]을 사용하면 나머지 네트워크보다 먼저 제안 된 아키텍처 인 매우 심층적 인 네트워크 [28]를 성공적으로 훈련시킬 수 있습니다. 잔여 네트워크와 도로 네트워크의 근본적인 차이점은 후자의 경우 잔여 링크가 차단되고 이러한 게이트의 가중치가 학습된다는 것이다.

 

Figure 1: Various residual blocks used in the paper. Batch normalization and ReLU precede each convolution (omitted for clarity)

 

따라서 지금까지 residual networks에 대한 연구는 주로 ResNet 블록 내의 활성화 시퀀스와 residual networks의 깊이에 중점을 두었다. 이 작업에서 우리는 위의 관점을 뛰어 넘는 실험적 연구를 수행하려고합니다. 이를 통해 우리의 목표는 더 풍부한 ResNet 블록 네트워크 아키텍처 세트를 탐색하고 활성화 순서 이외의 여러 측면이 성능에 미치는 영향을 철저히 조사하는 것입니다. 아래에서 설명하는 바와 같이, 이러한 아키텍처 탐색은 residual networks에 대한 새롭고 흥미로운 발견을 이끌어 냈으며, 이는 매우 중요한 실질적인 중요성을 가지고 있습니다.

 

Width vs depth in residual networks. 머신 러닝에서 얕은 네트워크와 딥 네트워크의 문제는 오랫동안 논의되어 왔으며 [2, 18] 회로 복잡성 이론 문헌에 따르면 얕은 회로는 딥 회로보다 기하 급수적으로 더 많은 구성 요소를 필요로한다는 점을 지적했습니다. residual networks의 작성자는 깊이를 늘리고 매개 변수를 줄이기 위해 가능한 한 얇게 만들려고 노력했으며 심지어 ResNet 블록을 더 얇게 만들기 위해 «bottleneck» 블록을 도입했습니다.

 

그러나 identity mapping이있는 residual block은 매우 깊은 네트워크의 훈련을 허용하고 residual networks의 약점이기도합니다. gradient 네트워크에서 흐를 때, 어떤 것도 나머지 블록 가중치를 전달하도록 강요 할 수 없으며 훈련 중에 학습하는 것을 피할 수 있으므로 유용한 표현을 학습하는 블록이 몇 개뿐이거나 아주 적은 정보를 공유하는 많은 블록이있을 수 있습니다. 최종 목표에 대한 기여도는 적습니다. 이 질문에서 [28]는 "재사용 감소"로 언급됩니다. [14]의 저자는 훈련 중 남은 블록에 대한 아이디어를 무작위로 비활성화하여이 문제를 해결하려고했습니다. 이 방법은 각 잔여 블록이 단위 스칼라 가중치를 가지며이 가중치에 드롭 아웃이 적용되는 특별한 손실 상황 [27]으로 볼 수 있습니다. 이 방법의 효과는 위의 가설을 입증합니다.

 

위의 관찰을 바탕으로 우리의 작업은 [13]에 기초하여 깊은 잔차 네트워크가 얼마나 넓어야 하는가에 대한 질문에 답하고 훈련 문제를 해결하려고 노력합니다. 이 경우 ResNet 블록의 확장 (올바르게 처리 된 경우)이 깊이를 증가시키는 것에 비해 나머지 네트워크의 성능을 개선하는 더 효과적인 방법을 제공함을 보여줍니다. 특히 [13]보다 크게 개선 된 더 넓은 딥 레지 듀얼 네트워크를 제안하고, 레이어 수는 50 배, 속도는 2 배 이상 증가한다. 우리는 이것을 widening of ResNet blocks라고 부릅니다. 예를 들어, 우리의 넓은 16-layer deep network 는 훈련 속도가 몇 배 더 빠르지 만 1000-layer thin deep network와 동일한 정확도와 상당한 수의 매개 변수를 가지고 있습니다. 따라서 이러한 유형의 실험은 deep residual networks의 주 에너지가 residual blocks에 있고 깊이의 영향이 보완적임을 보여주는 것으로 보입니다. 원래 매개 변수의 두 배 (또는 그 이상)를 사용하여 더 넓은 잔여 네트워크를 훈련 할 수 있다는 것을 알았습니다. 즉, 성능을 더욱 향상시키기 위해 thin networks의 깊이를 늘려야합니다.이 경우에는 수천 개의 레이어를 추가합니다.

 

Use of dropout in ResNet blocks.

Dropout은 [27]에서 처음 도입되었고 나중에 [16,26] 등 과 같은 많은 성공적인 아키텍처에서 채택되었으며, 협업 적 적응 및 기능의 과적 합을 방지하기 위해 많은 매개 변수를 사용하여 주로 최상위 계층에 적용됩니다. 그런 다음 주로 batch normalization [15]로 대체되었는데, 이는 특정 분포를 갖도록 신경망 활성화를 정규화하여 내부 공변량 이동을 줄이는 기술입니다. 저자의 실험은 배치 정규화를 사용하는 네트워크가 손실이있는 네트워크보다 정확도가 더 높다는 것을 보여줍니다. 이 예에서는 residual blocks의 확장으로 인한 매개 변수 수가 증가하여 정규화 훈련에 대한 드롭 아웃의 영향과 과적 합 방지를 연구했습니다. 이전에는 [13]에서 나머지 네트워크의 손실을 연구하고 블록의 식별 부분에 드롭 아웃을 삽입했는데 저자는 이 상황의 부정적인 영향을 보여 주었다. 대신, 우리는 드롭 아웃이 컨볼 루션 레이어 사이에 삽입되어야한다고 믿습니다. 넓은 residual 네트워크에 대한 실험 결과는 이것이 일관된 이득과 심지어 새롭고 최신 결과로 이어진다는 것을 보여줍니다 (예를 들어 손실이있는 16 계층 딥 와이드 잔류 네트워크는 SVHN에서 1.64 %의 오류를 가짐).

 

요약하면 이 작업의 기여는 다음과 같습니다.

잔여 네트워크 구조에 대한 자세한 실험적 연구를 제시하고 ResNet 블록 구조의 몇 가지 중요한 측면을 철저히 조사합니다.

ResNet 블록에 대한 새로운 확장 아키텍처를 제안하여 나머지 네트워크의 성능을 크게 향상시킬 수 있습니다.

우리는 훈련 중 과적 합을 방지하기 위해 적절하게 정규화하기 위해 deep residual networks의 드롭 아웃 현상을 활용하는 새로운 방법을 제안합니다.

마지막으로 제안 된 ResNet 아키텍처가 여러 데이터 세트에서 최신 결과를 달성하여 잔여 네트워크의 정확성과 속도를 크게 향상 시켰음을 보여줍니다.

 

2 Wide residual networks

 identity mapping이있는 Residual block은 다음 공식으로 표현할 수 있습니다.

Residual network는 sequentially stacked residual blocks으로 구성되여 있다.

 

In [13] residual networks 두가지 타입의 block으로 구성되여 있다.

• 기본- with two consecutive 3 × 3 convolutions with batch normalization and ReLU preceding convolution: conv3×3-conv3×3 Fig.1(a)

• bottleneck - with one 3 × 3 convolution surrounded by dimensionality reducing and expanding 1×1 convolution layers: conv1×1-conv3×3-conv1×1 Fig.1(b)

Table 1: Structure of wide residual networks. Network width is determined by factor k. Original architecture [13] is equivalent to k = 1. Groups of convolutions are shown in brackets where N is a number of blocks in group, downsampling performed by the first layers in groups conv3 and conv4. Final classification layer is omitted for clearance. In the particular example shown, the network uses a ResNet block of type B(3,3).

[13]의 원래 아키텍처 [11]와 비교하여 나머지 블록의 배치 정규화, 활성화 및 컨볼 루션 순서는 conv BN ReLU에서 BN-ReLU-conv로 변경됩니다. 후자는 더 빠른 훈련 속도와 더 나은 결과를 가지고 있기 때문에 우리는 원래 버전을 고려하지 않습니다. 또한, 소위 «bottleneck»블록은 원래 블록의 계산 비용을 줄여 레이어 수를 늘리는 데 사용되었습니다. 확장의 효과와 네트워크를 더 얇게 만드는 데 사용되는 «bottleneck»을 연구하고자하므로 고려하지 않고 «basic» residual 구조에 초점을 맞 춥니다.

 

기본적으로 나머지 블록의 표현 능력을 높이는 세 가지 간단한 방법이 있습니다.

 

• to add more convolutional layers per block

• to widen the convolutional layers by adding more feature planes

• to increase filter sizes in convolutional layers

 

작은 필터는 [26,31]을 포함한 많은 프로젝트에서 매우 효과적인 것으로 입증되었으므로 3x3보다 큰 필터는 사용하지 않습니다. 또한 심화 계수 l과 확대 계수 k의 두 가지 요인을 소개합니다. 여기서 l은 블록의 컨볼 루션 수이고 k는 컨벌루션 계층의 특징 수로 곱해 지므로베이스 라인«기본»블록은 l = 2, k에 해당합니다. = 1. 그림 1 (a)와 1 ©은 각각«basic»및«basic wide»블록의 개략적 인 예를 보여줍니다.

 

residual networks 의 일반적인 구조는 표 1에 나와 있습니다. 초기 convolutional layer conv1, 그 다음 residual blocks conv2, conv3 및 conv4 (각 크기는 N), 평균 풀 및 최종 분류 레이어로 구성됩니다 . 모든 실험에서 conv1의 크기는 고정되고 도입 된 확장 계수 k는 conv2-4의 세 그룹에서 나머지 블록의 너비를 조정합니다 (예 : 원래의 "기본"아키텍처는 k = 1과 동일 함). 잔여 블록의 표현력이 미치는 영향을 연구하고자합니다.이를 위해«Basic»아키텍처를 몇 가지 수정하고 테스트했습니다. 이러한 수정 사항은 다음 하위 섹션에서 자세히 설명합니다.

 

2.1 Type of convolutions in residual block

B (M)은 resisdual 블록 구조를 나타내며, 여기서 M은 block에있는 convolutional layers의 kernel sizes 목록입니다. 예를 들어, B (3,1)은 3x3 및 1x1 convolutional layers가있는 resisdual 블록을 나타냅니다 (우리는 항상 공간 커널이 정사각형이라고 가정합니다). 앞에서 설명한«bottleneck»블록을 고려하지 않았기 때문에 기능 평면의 수는 블록 전체에서 일정하게 유지됩니다. 우리가 대답하고 싶은 질문은 "기본"잔류 아키텍처의 3x3 컨벌루션 레이어가 얼마나 중요한지, 그리고 더 저렴한 1x1 레이어 또는 1x1 및 3x3 컨볼 루션 레이어에 대해 계산할 수 있는지 여부입니다. 조합으로 대체됩니다 (예 : B (1,3) 또는 B (1,3)). 이것은 블록의 힘을 증가 시키거나 감소시킬 수 있습니다. 따라서 다음 조합으로 실험했습니다 (마지막 조합, 즉 B (3,1,1)은 네트워크 [20] 아키텍처의 유효 네트워크와 유사합니다).

 

1. B(3,3) - original «basic» block

2. B(3,1,3) - with one extra 1×1 layer

3. B(1,3,1) - with the same dimensionality of all convolutions, «straightened» bottleneck

4. B(1,3) - the network has alternating 1×1 - 3×3 convolutions everywhere

5. B(3,1) - similar idea to the previous block 6. B(3,1,1) - Network-in-Network style block

 

2.2 Number of convolutional layers per residual block

또한 block deepening factor l을 사용하여 성능에 미치는 영향을 테스트합니다. 매개 변수 수가 동일한 네트워크간에 비교를 수행해야하므로이 경우 l과 d (d는 총 블록 수를 나타냄)가 다른 네트워크를 구축하는 동시에 네트워크 복잡성이 거의 동일하게 유지되도록해야합니다. 이는 예를 들어 l이 증가하면 d가 감소해야 함을 의미합니다.

 

2.3 Width of residual blocks

위의 수정 외에도 블록 확장 계수 k에 대한 실험도 수행했습니다. 매개 변수 수가 l (deepening factor) ) 및 d (ResNet 블록 수)에 따라 선형 적으로 증가하면 GPU가 큰 텐서에서 병렬 컴퓨팅에 더 효율적이기 때문에 매개 변수 수와 계산 복잡성은 k에서 2 차가됩니다. , 그래서 우리는 최고의 d / k 비율에 관심이 있습니다.

 

wider residual networks에 대한 한 가지 주장은  [13]에 비해 가장 성공적인 초기 Inception [30] 및 VGG [26]를 포함하여 잔여 네트워크의 거의 모든 이전 아키텍처가 훨씬 더 넓다는 것입니다. 예를 들어 residual networks  WRN-22-8 및 WRN-16-10 (이 기호에 대한 설명은 다음 단락 참조)은 너비, 깊이 및 매개 변수 수에서 VGG 아키텍처와 매우 유사합니다.

 

또한 k = 1 인 original residual networks를 «thin» 네트워크로, k> 1 인 네트워크를 «wide»네트워크라고합니다. 이 기사의 나머지 부분에서는 다음 표기법을 사용합니다. WRN-nk는 총 컨볼 루션 레이어 수 n과 확장 계수 k가있는 resisdual 네트워크를 나타냅니다 (예를 들어, 40 개 레이어와 k = 2 배인 네트워크가 원래 레이어로 표시됩니다. WRN-40-2로). 또한 해당하는 경우 WRN-40-2-B (3,3)와 같은 블록 유형을 첨부합니다.

Table 2: Test error (%, median over 5 runs) on CIFAR-10 of residual networks with k = 2 and different block types. Time column measures one training epoch.
Table 3: Test error (%, median over 5 runs) on CIFAR10 of WRN-40-2 (2.2M) with various l.

2.4 Dropout in residual blocks

매개 변수가 증가함에 따라 regularization 방법을 연구하려고합니다. Residual networks는 일괄 표준화되어 정규화 효과를 제공하지만 많은 데이터 확장이 필요하므로 피해야하며 항상 가능한 것은 아닙니다. 그림 1 (d)에서 볼 수 있듯이 ReLU 이후, convolution 사이의 각 resisdual 블록에 드롭 아웃 계층을 추가하여 다음 resisdual 블록에서 배치 정규화를 perturb시키고 과적 합을 방지합니다. very deep residual networks에서 이는 감소 된 기능 재사용 문제를 처리하고 다른 resisdual  블록에서 학습을 강제하는 데 도움이 될 것입니다.

 

3 Experimental results

실험에서 유명한 CIFAR-10, CIFAR-100, SVHN 및 ImageNet 이미지 분류 데이터 세트를 선택했습니다. CIFAR-10 및 CIFAR-100 데이터 세트 [17]는 10 개 및 100 개 레벨에서 추출한 32x32 컬러 이미지로 구성되며 이러한 이미지는 50,000 개의 기차 이미지와 10,000 개의 테스트 이미지로 나뉩니다. 데이터 향상을 위해 우리는 horizontal flips를 수행하고 각면에 4 픽셀로 채워진 이미지에서 무작위로 자르고 누락 된 픽셀을 원본 이미지의 반사로 채 웁니다. 우리는 [9]에서 제안 된 무거운 데이터 증가를 사용하지 않았습니다. SVHN은 훨씬 더 어려운 실제 문제에서 가져온 약 600,000 개의 디지털 이미지를 포함하는 Google 스 Street View House Numbers 이미지의 데이터 세트입니다. SVHN 실험에서는 이미지를 255로 나누어 [0,1] 범위의 이미지를 입력으로 제공한다는 점을 제외하고는 이미지 전처리를 수행하지 않습니다. ImageNet을 제외한 모든 실험은 [13] 아키텍처의 사전 활성화 된 잔여 블록을 기반으로하며이를 기준으로 사용합니다. ImageNet의 경우 계층이 100 개 미만인 네트워크에서 사전 활성화를 사용해도 큰 차이가 없음을 발견 했으므로이 예제에서는 원래 ResNet 아키텍처를 사용하기로 결정했습니다. 달리 명시되지 않는 한, CIFAR의 경우 [8]의 이미지 전처리 및 ZCA 화이트닝을 따릅니다. 그러나 일부 CIFAR 실험의 경우 간단한 평균 / 표준 표준화를 사용하므로이 전처리를 사용하는 [13] 및 기타 ResNet 관련 작업과 직접 비교할 수 있습니다.

 

다음에서는 다양한 ResNet 블록 구조에 대한 결과를 설명하고 제안 된 넓은 resisdual 네트워크의 성능을 분석합니다. "블록 내 컨볼 루션 유형"및 "블록 당 컨볼 루션 수"와 관련된 모든 실험에 대해 훈련 속도를 높이기 위해 k = 2를 사용하고 [13]에 비해 감소 된 깊이를 사용합니다.

 

Type of convolutions in a block

먼저 다른 블록 유형 B의 훈련 된 네트워크를 사용하여 결과를 보고합니다 (보고 된 결과는 CIFAR-10에 있음). 블록 B (1,3,1), B (3,1), B (1,3) 및 B (3,1,1)에 대해 WRN-40-2를 사용합니다. 회선. 매개 변수 수의 비교 가능성을 유지하기 위해 WRN-28-2-B (3,3) 및 WRN-22-2-B (3,1,3)의 더 적은 계층으로 다른 네트워크를 훈련했습니다. 평균 5 회 테스트의 정확도와 각 교육 단계의 시간을 포함하여 표 2에 테스트 결과를 제공합니다. 블록 B (3,3)의 정확도는 B (3,1,3)의 정확도와 매우 유사하며 매개 변수와 레이어 수가 적습니다. B (3,1,3)은 다른 방법보다 약간 빠릅니다.

 

위의 결과를 바탕으로 비슷한 수의 매개 변수를 가진 블록에 대해 얻은 결과는 거의 동일합니다. 이 사실로 인해 다른 방법과 일관성을 유지하기 위해 3x3 컨볼 루션 만있는 WRN에 대한주의를 제한합니다.

 

Number of convolutions per block

다음으로 deepening factor l (각 블록의 컨볼 루션 레이어 수를 나타냄) 변경과 관련된 실험을 계속 진행합니다. 표 3에 표시 결과를 제공했습니다.이 예에서는 3x3 컨볼 루션으로 WRN-40-2를 사용하고 다른 심화 계수 l∈ [1,2,3,4]로 여러 훈련을 수행합니다. , 동일한 수의 매개 변수 (2.2 × 10 ^6) 및 동일한 수의 convolutional layers.

 

B (3,3)의 성능이 가장 좋은 반면 B (3,3,3) 및 B (3,3,3,3)의 성능이 가장 낮다는 것을 알 수 있습니다. 이는 마지막 두 경우에 남아있는 연결 수가 감소하여 최적화의 어려움이 증가했기 때문일 수 있습니다. 또한 B (3)의 상황은 더 나쁩니다. 결론은 B (3,3)이 각 블록의 컨볼 루션 수 측면에서 최적이라는 것입니다. 따라서 나머지 실험에서는 B (3,3) 유형 블록이있는 넓은 잔차 네트워크 만 고려합니다.

 

Width of residual blocks

확대 매개 변수 k를 늘리려 고 할 때 총 레이어 수를 줄여야합니다. 최적의 비율을 찾기 위해 k를 2에서 12로, 깊이를 16에서 40으로 실험했습니다. 결과를 표 4에 나타냈다. 폭이 1 ~ 12 배 증가하면 40, 22, 16 계층의 모든 네트워크에서 일관된 이득을 볼 수 있음을 알 수 있습니다. 반면에 동일한 고정 확장 계수 k = 8 또는 k = 10을 유지하고 깊이를 16에서 28로 변경하면 지속적으로 개선되지만 깊이를 40으로 더 늘리면 정확도가 감소합니다 ( 예를 들어 WRN-40-8의 정확도는 WRN-22-8로 감소합니다.

 

다른 결과는 표 5에 나와 있습니다. 표 5에서는 thin resisdual  네트워크와 wide resisdual  네트워크를 비교합니다. wide WRN-40-4는 CIFAR-10과 CIFAR-100 모두에서 더 나은 정확도를 가지고 있기 때문에 thin ResNet-1001보다 낫다는 것을 알 수 있습니다. 그러나 이러한 네트워크에 8.9x10^6 및 10.2x10^6이라는 비슷한 수의 매개 변수가 있다는 것이 흥미 롭습니다. 이는이 수준에서 깊이가 너비에 비해 정규화 효과를 증가시키지 않음을 보여줍니다. 벤치 마크 포인트에서 더 살펴 보았 듯이 WRN-40-4의 훈련 속도는 원본의 8 배이므로 원본 씬 잔여 네트워크의 종횡비가 최적과는 거리가 멀다는 것이 분명합니다.

 

또한 CIFAR-10에서 wide WRN-28-10의 성능은 thin ResNet-1001보다 0.92 % 더 우수하고 (훈련 중 동일한 미니 배치 크기로) CIFAR-100에서는 wide WRN-28-10이 thin ResNet-1001보다 우수합니다. ResNet-1001은 3.46 % 더 높고 레이어 수가 36 배 적습니다 (표 5 참조). ResNet-1001의 결과는 4.64 %이고 배치 크기는 64 인 반면 모든 실험에서 사용한 배치 크기는 128입니다 (즉, 표 5에보고 된 다른 모든 결과의 배치 크기는 128 임). . 이러한 네트워크의 훈련 곡선은 그림 2에 나와 있습니다.

Table 4: Test error (%) of various wide networks on CIFAR-10 and CIFAR-100 (ZCA preprocessing).

깊이가 regularization 효과를 생성하고 너비로 인해 네트워크가 과적 합된다는 이전 의견이 있었지만 ResNet-1001보다 몇 배 더 많은 매개 변수를 사용하여 네트워크를 성공적으로 훈련 시켰습니다. 예를 들어, wide WRN-28-10 (표 5) 및 wide WRN-40-10 (표 9)의 매개 변수는 ResNet-1001보다 각각 3.6 배 및 5 배이며, 둘 다 ResNet-1001보다 훨씬 우수한 성능을 보입니다.

Table 5: Test error of different methods on CIFAR-10 and CIFAR-100 with moderate data augmentation (flip/translation) and mean/std normalzation. We don’t use dropout for these results. In the second column k is a widening factor. Results for [13] are shown with minibatch size 128 (as ours), and 64 in parenthesis. Our results were obtained by computing median over 5 runs.

일반적으로 CIFAR 평균 / 표준 전처리는 WRN-40-10 및 56x106 매개 변수를 사용하여 CIFAR-100에서 18.3 %를 달성함으로써 더 넓고 깊은 네트워크를 더 정확하게 훈련 할 수 있습니다. (표 9), ResNet-1001보다 4.4 % 높으며이 데이터 세트에 대한 새로운 최신 결과가 확립되었습니다.

Figure 2: Training curves for thin and wide residual networks on CIFAR-10 and CIFAR-100. Solid lines denote test error (y-axis on the right), dashed lines denote training loss (y-axis on the left).

결론적으로 :

• widening consistently improves performance across residual networks of different depth;

• increasing both depth and width helps until the number of parameters becomes too high and stronger regularization is needed;

• there doesn’t seem to be a regularization effect from very high depth in residual networks as wide networks with the same number of parameters as thin ones can learn same or better representations. Furthermore, wide networks can successfully learn with a 2 or more times larger number of parameters than thin ones, which would require doubling the depth of thin networks, making them infeasibly expensive to train.

 

Dropout in residual blocks

모든 데이터 세트의 컨볼 루션 사이에 residual block을 삽입하도록 네트워크를 훈련시킵니다. cross-validation을 사용하여 dropout probability values를 결정합니다. CIFAR은 0.3, SVHN은 0.4입니다. 또한 드롭 아웃이없는 기준 네트워크에 비해 훈련 기간 수를 늘릴 필요가 없습니다.

 

WRN-28-10과 비교하여 손실은 CIFAR-10 및 CIFAR-100의 테스트 오류를 ​​각각 0.11 % 및 0.4 % 감소 (5 회 이상 실행 및 평균 / 표준 전처리의 중앙값)하고 다른 RESNET과 비교합니다. 비교에서도 개선 사항이 있습니다 (표 6). 우리가 아는 한, 이것은 큰 데이터 볼륨 확장 방법보다 훨씬 더 나은 20 % 오류에 가까운 CIFAR-100의 첫 번째 결과입니다. CIFAR-10에서 WRN-16-4의 정확도는 약간만 감소합니다. 이것은 상대적으로 적은 매개 변수 때문이라고 추측합니다.

 

첫 번째 학습률이 감소한 후 손실 및 검증 오류가 갑자기 증가하고 높은 값으로 진동하면 다음 학습률이 감소 할 때까지 잔여 네트워크 학습이 간섭 효과를 생성한다는 것을 알았습니다. 무게 감쇄로 인해 발생하는 것으로 나타 났지만이를 줄이면 정확도가 크게 저하됩니다. 흥미롭게도 대부분의 경우이 효과를 부분적으로 제거하면 그림 2와 3을 참조하십시오.

 

dropout가 SVHN에 미치는 영향은 더 분명합니다. 이는 데이터 확장 및 배치 정규화 과적 합을 수행하지 않았기 때문에 드롭 아웃이 정규화 효과를 증가 시켰기 때문일 수 있습니다. 이에 대한 증거는 그림 3의 훈련 곡선에서 찾을 수 있습니다. 여기서 흘리지 않는 손실이 매우 낮은 값으로 떨어집니다. 결과를 표 6에 나타냈다. thin and wide 네트워크에서 드롭 아웃을 사용하는 데있어 상당한 개선이 관찰되었습니다. 임의의 깊이에서 Thin 50-layer deep network는 Thin 152-layer deep network보다 훨씬 좋습니다 [14]. 또한 WRN-16-8 (표 9)에 대한 SVHN dropout 교육도 실시하여 SVHN에 대한 1.54 %에 도달했으며 이는 우리가 알고있는 최고의 공개 결과입니다. dropout 율은 1.81 %입니다.

Table 6: Effect of dropout in residual block. (mean/std preprocessing, CIFAR numbers are based on median of 5 runs)
Figure 3: Training curves for SVHN. On the left: thin and wide networks, on the right: effect of dropout. Solid lines denote test error (y-axis on the right), dashed lines denote training loss (y-axis on the left).

일반적으로 일부 사람들은 일괄 정규화 결합을지지하지만 드롭 아웃은 이것이 효과적인 씬 네트워크 및 광범위한 네트워크 정규화 기술임을 보여줍니다. 확대 결과를 더욱 향상시키는 데 사용할 수 있으며 보충제로 사용할 수도 있습니다.

 

ImageNet and COCO experiments

ImageNet의 경우 먼저 병목 현상이없는 ResNet-18 및 ResNet-34로 실험하고 폭을 1.0에서 3.0으로 점진적으로 늘리려 고합니다. 결과를 표 7에 나타냈다. 너비를 늘리면 두 네트워크의 정확도가 점차적으로 증가하고 비슷한 수의 매개 변수를 가진 네트워크는 깊이가 다르더라도 유사한 결과를 얻을 수 있습니다. 이러한 네트워크에는 매개 변수가 많지만 병목 네트워크가 그들보다 낫습니다. 병목 구조가 ImageNet 분류 작업에 더 적합하거나이 복잡한 작업에 더 깊은 네트워크가 필요하기 때문일 수 있습니다. 이를 확인하기 위해 ResNet-50을 채택하고 내부 3x3 레이어의 너비를 늘려 더 넓게 만들려고했습니다. widening factor가 2.0이면 WRN-50-2-bottleneck의 성능이 ResNet-152보다 우수하고 계층 수가 3 배 감소하며 속도가 훨씬 빠릅니다. WRN-50-2- bottleneck은 매개 변수가 약간 더 많음에도 불구하고 성능이 가장 우수한 사전 활성화 된 ResNet-200보다 거의 2 배 더 빠릅니다 (표 8). 일반적으로 CIFAR와 달리 ImageNet 네트워크는 동일한 정확도를 달성하기 위해 동일한 깊이에서 더 큰 너비가 필요하다는 것을 발견했습니다. 그러나 계산상의 이유로 50 개 이상의 레이어가있는 잔여 네트워크를 사용할 필요가 없다는 것은 분명합니다.

 

8-GPU 시스템이 필요하기 때문에 더 큰 병목 네트워크를 훈련 시키려고하지 않았습니다.

Table 7: ILSVRC-2012 validation error (single crop) of non-bottleneck ResNets for various widening factors. Networks with a comparable number of parameters achieve similar accuracy, despite having 2 times less layers.
Table 8: ILSVRC-2012 validation error (single crop) of bottleneck ResNets. Faster WRN50-2-bottleneck outperforms ResNet-152 having 3 times less layers, and stands close to preResNet-200.

또한 WRN-34-2를 사용하여 MultiPathNet [32] 및 LocNet [7]의 조합을 사용하여 COCO 2016 Object Detection Challenge에 참여했습니다. 레이어가 34 개에 불과하지만이 모델은 가장 진보 된 단일 모델 성능을 달성하며 ResNet-152 및 Inception-v4 기반 모델보다 훨씬 좋습니다.

마지막으로 표 9에는 일반적으로 사용되는 다양한 데이터 세트에 대한 최상의 WRN 결과가 요약되어 있습니다.

Table 9: Best WRN performance over various datasets, single run results. COCO model is based on WRN-34-2 (wider basicblock), uses VGG-16-based AttractioNet proposals, and has a LocNet-style localization part. To our knowledge, these are the best published results for CIFAR-10, CIFAR-100, SVHN, and COCO (using non-ensemble models).

Computational efficiency

Thin 잔여 네트워크와 적은 수의 코어가있는 깊은 잔여 네트워크는 시퀀스 구조로 인해 GPU 컴퓨팅의 특성에 반합니다. 너비를 늘리면보다 최적화 된 방식으로 계산의 균형을 효과적으로 조정하는 데 도움이되므로 벤치 마크 테스트에서 알 수 있듯이 넓은 네트워크의 효율성은 씬 네트워크의 몇 배입니다. cudn v5 및 Titan X를 사용하여 여러 네트워크의 forward+backward 업데이트 시간 (미니 배치 크기 32)을 측정하며 그 결과는 그림 4에 나와 있습니다. 우리는 최고의 CIFAR wide WRN-28-10이 thin ResNet-1001보다 1.6 배 빠르다는 것을 보여줍니다. 또한 Wide WRN-40-4의 정확도는 ResNet-1001과 거의 동일하며 속도는 ResNet-1001의 8 배입니다.

gure 4: Time of forward+backward update per minibatch of size 32 for wide and thin networks(x-axis denotes network depth and widening factor). Numbers beside bars indicate test error on CIFAR-10, on top - time (ms). Test time is a proportional fraction of these benchmarks. Note, for instance, that wide WRN-40-4 is 8 times faster than thin ResNet1001 while having approximately the same accuracy.

 

Implementation details

모든 실험에서 Nesterov momentum 및 cross-entropy loss과 함께 SGD를 사용했습니다. 초기 학습률은 0.1, 가중치 감쇠는 0.0005, dampening 0, momentum 0.9, 미니 배치 크기는 128로 설정됩니다. CIFAR에서 학습률은 60, 120, 160 epoch에서 0.2 감소했으며 총 200 epoch 동안 훈련했습니다. SVHN에서 초기 학습률은 0.01로 설정되어 있으며 총 160주기의 훈련을 위해 80 및 120주기에서 0.1만큼 감소시킵니다. 우리의 구현은 Torch [6]를 기반으로합니다. 모든 네트워크의 메모리 공간을 줄이기 위해 [21]을 사용합니다. ImageNet 실험 fb.resnet.torch를 사용하여 [10]을 구현합니다. 우리의 코드와 모델은 https://github.com/szagoruyko/wide-residual-networks에서 확인할 수 있습니다.

 

4 Conclusions

We presented a study on the width of residual networks as well as on the use of dropout in residual architectures.  이 연구를 기반으로 우리는 일반적으로 사용되는 여러 벤치 마크 데이터 세트 (CIFAR-10, CIFAR-100, SVHN 및 COCO 포함)의 최신 결과를 제공하고 ImageNet을 크게 개선 한 광범위한 잔여 네트워크 아키텍처를 제안합니다. . CIFAR에 16 개 계층 만있는 광역 네트워크의 성능이 1000 계층 딥 네트워크의 성능보다 훨씬 우수하다는 것을 증명했으며, ImageNet에서는 50 계층 네트워크의 성능도 152 계층 네트워크의 성능보다 뛰어나 나머지 네트워크의 주요 기능이 나머지에 있음을 나타냅니다. 앞에서 설명한대로 극단적 인 깊이가 아닌 차단합니다. 또한 넓은 잔여 네트워크의 훈련 속도는 몇 배 더 빠릅니다. 우리는 이러한 흥미로운 발견이 심층 신경망 연구의 발전에 도움이 될 것이라고 생각합니다.

 

5 Acknowledgements

우리는 스타트 업 VisionLabs와 Eugenio culuciello가 클러스터에 액세스 할 수 있도록 해주신 것에 감사 드리며, 이들 없이는 ImageNet 실험이 불가능할 것입니다. 또한 유용한 토론에 대해 Adam Lele과 Sam Gross에게 감사드립니다. Work supported by EC project FP7-ICT611145 ROBOSPECT.

반응형

+ Recent posts