반응형

EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks

[Efficient Net 논문]

arxiv.org/pdf/1905.11946.pdf

 

** 아래의 내용은 위의 논문에서 사용되는 사진과 제가 재해석한 내용입니다.

 

[코드]

github.com/tensorflow/tpu/tree/master/models/official/efficientnet

 

예시)

Top 4 Pre-Trained Models for Image Classification with Python Code

 

Abstract

관찰을 바탕으로, 단순하지만 매우 효과적인 compound coefficient를 사용하여 depth(깊이)/width(너비)/resolution(해상도)의 모든 dimension을 균일하게 scale..하는 새로운 scaling 방법을 제안한다.

Based on this observation, we propose a new scaling method that uniformly scales all dimensions of depth/width/resolution using a simple yet highly effective compound coefficient.

 

MobileNets과 ResNet을 scaling up 할 때 이 방법의 효과를 볼 수 있다.

We demonstrate the effectiveness of this method on scaling up MobileNets and ResNet.

 

1. Introduction

ConvNets(Convolution Networks)를 scaling up(확장)하는 과정을 연구하고 재고하고자 한다.

In this paper, we want to study and rethink the process of scaling up ConvNets.

 

우리(Google Research, Brain Team)의 경험적 연구에 따르면 network width/depth/resolution의 모든 dimensions의 균형을 맞추는 것이 중요하며, 놀랍게도 이러한 균형은 단순히 일정한 비율로 각 크기를 조절하여 달성할 수 있다.

Our empirical study shows that it is critical to balance all dimensions of network width/depth/resolution, and surprisingly such balance can be achieved by simply scaling each of them with constant ratio.

 

그러나 우리가 아는 한 우리는 network width/depth/resolution의 모든 dimensions간의 관계를 경험적(?)으로 정량화한 최초의 기업이다.

but to our best knowledge, we are the first to empirically quantify the relationship among all three dimensions of network width, depth, and resolution.

 

efficientnet_fig1

Figure 1은 EfficientNets이 다른 ConvNets을 훨씬 능가하는 ImageNet 성능을 요약한 것이다.

Figure 1 summarizes the ImageNet performance, where our EfficientNets significantly outperform other ConvNets.

 

2. Related Work

ConvNet Accuracy:

많은 application에서 더 높은 정확도가 중요하지만 이미 HW 메모리 한계에 도달했기때문에 더 높은 accuracy를 얻으려면 더 나은 efficiency이 필요하다.

Although higher accuracy is critical for many applications, we have already hit the hardware memory limit, and thus further accuracy gain needs better efficiency.

ConvNet Efficiency:

이 논문에서는 state-of-the-art accuracy를 능가하는 super large ConvNets model efficiency를 연구하는 것이 목표다. 이 목표를 달성하기 위해 모델 scaling을 이용한다.

In this paper, we aim to study model efficiency for super large ConvNets that surpass state-of-the-art accuracy. To achieve this goal, we resort to model scaling.

Model Scaling:

network width, depth, and resolutions의 3가지 dimensions 모두에 대해 ConvNet scaling을 체계적이고 경험적으로 연구한다.

Our work systematically and empirically studies ConvNet scaling for all three dimensions of network width, depth, and resolutions.

3. Compound Model Scaling

3.1. Problem Formulation

ConvNet layers는 (모든 Conv가 그런 것은 아니지만) 여러 단계로 분할되며 각 단계의 모든 layers는 동일한 architecture를 공유한다.

(의역)

ConvNet layers are often partitioned into multiple stages and all layers in each stage share the same architecture: ex) ResNet

Therefore, we can define a ConvNet as:

efficientnet_1
efficientnet_fig2

 

$\hat{F_{1}}$ : layer architecture/baseline network

$\hat{L_{1}} , \hat{W_{1}}$ : the network length, width

$\hat{H_{1}} , \hat{C_{1}}$ : resolution

 

보통 ConvNet designs에서 가장 좋은 architecture를 찾는 것에 집중했던 것과 달리, model scaling은 미리 정의한 baseline network 변경 없이 network length, width, and/or resolution을 확장하는 것을 시도한다.

Unlike regular ConvNet designs that mostly focus on finding the best layer architecture $\hat{F_{1}}$, model scaling tries to expand the network length, width, and/or resolution without changing $\hat{F_{1}}$ predefined in the baseline network.

 

우리의 목표는 주어진 resource의 제약에 따라 모델 정확도를 최대화하는 것이다.

Our target is to maximize the model accuracy for any given resource constraints, which can be formulated as an optimization problem:

efficientnet_2

where **w, d, r are coefficients for scaling network width, depth, and resolution; $\hat{F_{1}}, \hat{L_{1}}, \hat{H_{1}}, \hat{W_{1}}, \hat{C_{1}}$ are predefined parameters in baseline network (see Table 1 as an example)

 

3.2. Scaling Dimensions

efficientnet_fig4

Depth (d): Scaling network depth is the most common way used by many ConvNets.

The intuition is that deeper ConvNet can capture richer and more complex features, and
generalize well on new tasks. However, deeper networks are also more difficult to train due to the vanishing gradient problem. (Although several techniques, such as skip connections and batch normalization.)

Width (w): Scaling network width is commonly used for small size models.

wider networks tend to be able to capture more fine-grained features and are easier to train. However, extremely wide but shallow networks tend to have difficulties in capturing higher level features.

Resolution (r): With higher resolution input images, ConvNets can potentially capture more fine-grained patterns.

the results of scaling network resolutions, where indeed higher resolutions improve accuracy, but the accuracy gain diminishes for very high resolutions (r = 1.0 denotes resolution 224x224 and r = 2.5 denotes resolution 560x560)

 

관찰 1 - network width, depth, or resolution의 dimension 중 하나라도 scaling up하면 accuracy가 향상되지만 bigger models에서는 accuracy 향상을 기대하기 어렵다.

(의역)

Observation 1 – Scaling up any dimension of network width, depth, or resolution improves accuracy, but the accuracy gain diminishes for bigger models.

 

3.3. Compound Scaling

efficientnet_fig4

We empirically observe that different scaling dimensions are not independent.

 

관찰 2 - 더 나은 accuracy와 efficiency를 위해, ConvNet scaling할 때 network width, depth, and resolution의 모든 dimensions의 밸런스가 중요하다.

Observation 2 – In order to pursue better accuracy and efficiency, it is critical to balance all dimensions of network width, depth, and resolution during ConvNet scaling.

In this paper, we propose a new compound scaling method, which use a compound coefficient φ to uniformly scales network width, depth, and resolution in a principled way:

efficientnet_3

where α, β, γ are constants that can be determined by a small grid search.

 

4. EfficientNet Architecture

모델 스케일링은 baseline network의 layer operators를 변경하지 않기때문에, 좋은 baseline network를 사용하는 것이 중요하다.

Since model scaling does not change layer operators $\hat{F_{1}}$ in baseline network, having a good baseline network is also critical.

 

우리의 scaling 방법으로 이미지 존재하는 ConvNets를 이용할 것이지만 우리의 scaling 방법의 effectiveness의 더 나은 증명을 위해, 새로운 mobile-size baseline인 EfficientNet 또한 개발했다.

We will evaluate our scaling method using existing ConvNets, but in order to better demonstrate the effectiveness of our scaling method, we have also developed a new mobile-size baseline, called EfficientNet.

efficientnet_table1

Our search produces an efficient network, which we name EfficientNet-B. Since we use the same search space as (Tan et al., 2019), the architecture is similar to MnasNet, except our EfficientNet-B0 is slightly bigger due to the larger FLOPS target (our FLOPS target is 400M).

 

** MnasNet: Platform-Aware Neural Architecture Search for Mobile

https://arxiv.org/pdf/1807.11626.pdf

 

baseline EfficientNet-B0을 시작하며, 우리의 compound scaling method를 scale up하는 2가지 step을 제안한다.

Starting from the baseline EfficientNet-B0, we apply our compound scaling method to scale it up with two steps:

  • STEP 1: we first fix φ = 1, assuming twice more resources available, and do a small grid search of α, β, γ based on Equation 2 and 3. In particular, we find the best values for EfficientNet-B0 are α = 1.2, β = 1.1, γ = 1.15, under constraint of α · β 2· γ 2 ≈ 2.
  • STEP 2: we then fix α, β, γ as constants and scale up baseline network with different φ using Equation 3, to obtain EfficientNet-B1 to B7 (Details in Table 2).

우리의 방법은 작은 규모의 baseline network에서 한번만 search(a small grid search of α, β, γ)를 한 다음(1단계) 한 다음 다른 모든 모델(different compound coefficient φ)에 대해 동일한 scaling coefficients를 사용하여(2단계) 이 문제를 해결한다.

Our method solves this issue by only doing search once on the small baseline network (step 1), and then use the same scaling coefficients for all other models (step 2).

 

5. Experiments

** 논문 참고

efficientnet_table2

 

6. Discussion

efficientnet_fig8

 

일반적으로, 모든 scaling 방법은 accuracy가 향상된다. 하지만 우리의 compound scaling 방법은 다른 single-dimension scaling 방법보다 더욱 더 accuracy가 향상시킬 수 있다.

In general, all scaling methods improve accuracy with the cost of more FLOPS, but our compound scaling method can further improve accuracy, by up to 2.5%, than other single-dimension scaling methods, suggesting the importance of our proposed compound scaling.

 

efficientnet_fig7

위의 그림을 보면, compound scaling 모델이 더 개체의 details한 relevant regions에 더 focusing하는 경향이 있다.

As shown in the figure, the model with compound scaling tends to focus on more relevant regions with more object details.

 

7. Conclusion

ConvNet scaling을 체계적으로 연구하고, network width, depth을 주의 깊게 조정하는 것과 중요하지만 놓치고 있던 resolution(해상도)를 주의 깊게 조정하지 않는 것이 정확성과 효율성을 향상을 방해한다는 것을 확인했다.

(의역)

In this paper, we systematically study ConvNet scaling and identify that carefully balancing network width, depth, and resolution is an important but missing piece, preventing us from better accuracy and efficiency.

 

compound scaling 방법으로 구동(?)되는 mobile-size EfficientNet 모델이 매우 효과적으로 scaled up될 수 있다는 것을 증명한다(?)

Powered by this compound scaling method, we demonstrate that a mobile-size EfficientNet model can be scaled up very effectively, surpassing state-of-the-art accuracy with an order of magnitude fewer parameters and FLOPS, on both ImageNet and five commonly used transfer learning datasets.

 

나의 결론

  • 장점: compound scaling(width, depth, resolution) 방법을 경험적으로 식을 구현(formulated)할 수 있게 되었다는 점에서 큰 도약(?)임. classification 시 object를 더 잘 인식하여 분류할 수 있을 것으로 기대됨
  • 단점: 확장성에 대한 의문..? compound scaling을 여러 ConvNet에 대한 테스트 해봐야할 듯 (모든 layers가 동일한 architecture를 공유하는 ConvNets에 한정된다)

 

** 첨언 및 조언 환영합니다!

반응형
반응형

 

본문 내용의 내용 및 그림의 출처는 "OSCAR(Object-Semantics Aligned Pre-training for Vision-Language Tasks)" 논문입니다.

 

 

microsoft/Oscar

Oscar: Object-Semantics Aligned Pre-training for Vision-Language Tasks - microsoft/Oscar

github.com

 

Oscar: Objects are the secret key to link between language and vision

In vision-and-language pretraining (VLP), objects can be used as anchor points to make aligning semantics between image-text pairs easier. Learn how Oscar, a novel VLP framework utilizing objects, sets new state of the art on six vision-and-language tasks.

www.microsoft.com

 

[OSCAR] 출처:  https://github.com/microsoft/Oscar

오스카는 버트, 엘모 등과 같이 세서미 스트리트에 등장하는 캐릭터라고 합니다~ (사설)

 

Abstract

image-text 쌍을 이용한 cross-modal representations 학습하는 Large-scale pre-training 방법이 vision-language tasks에서 널리 사용되고 있다.

 

 

OSCAR에서는 기존 방법과 달리 detected image의 object tags를 anchor points로 이용하여 alignments 학습을 쉽게 한다.

 

OSCAR model을 6.5 million text-image 쌍으로 pre-train하고 downstream tasks에서 fine-tune하여 잘 알려진 6개(4. Adapting to V+L Tasks)의 vision-language Understanding 및 generation tasks에서 새로운 SoTA를 만든다.

 

  • downsteam task란, 해당 field에서 pre-train된 모델이나 component를 활용한 supervised-learning tasks를 의미한다.

downstream tasks is what the field calls those supervised-learning tasks that utilize a pre-trained model or component ( 출처: http://jalammar.github.io/illustrated-bert/)

 

1. Introduction

cross-modal representations를 학습하는 것은 vision-language(V+L) tasks의 기본이다.

 

이 논문은 image와 text 사이의 semantic alignments 학습을 쉽게 하기 위해 이미지에서 detect된 objects tags를 anchor poins로 도입하여 cross-modal representations 학습을 상당히 향상시킬 수 있음을 보여준다.

 

또한, 새로운 VLP(Vision-Language Pre-training) 방법인 OSCAR를 제안한다.

여기서 훈련 샘플은 3가지(1. 연속적인 word sequence, 2. object tags, 3. image region features)로 정의한다.

 

OSCAR 모델은 large-scale V+L dataset에 pre-train되어 있고 7개의 V+L understanding과 generation tasks에 fine-tune, evaluate 된다.

 

Fig.1: OSCAR pipeline

 

요약

  1. V+L understanding과 generation tasks를 위한 generic image-text representations 을 학습하는 강력한 VLP방법인 OSCAR 소개한다.
  2. 새로운 SoTA 모델 OSCAR는 기존 접근 방식(여러 V+L 벤치마크)을 크게 능가한다.
  3. cross-modal representation 학습과 downsteam tasks를 위해 object tags를 anchor points로 사용하는 효과에 대한 insights를 제공하기 위해 광범위한 실험과 분석을 제시한다.

 

2. Background

많은 V+L tasks의 training data는 image-text 쌍으로 구성된다.(Fig.2)

 

Fig.2 Illustration on the process

 

pre-training의 목적은 self-supervised manner에서 image-text쌍의 cross-modal representations을 학습하는 것이다.

 

VPL는 일반적으로 각 modality의 singular embedding을 기반으로 cross-modal contextualized representations 학습하기 위해 multi-layer self-attention Transformers를 사용한다. 따라서 VLP의 성공은 기본적으로 input singular embeddings 퀄리티에 의존한다.

 

기존의 VLP 방법의 2가지 issues가 있다.

  1. Ambiguity(모호성). visual region features는 보통 over-sampled region(overlaps among image regions at different positions) 에서 추출된다.

    예를 들어, Fig2(a)에서 dog와 couch의 regions가 heavily overlap 되어있다.

  2. Lack of grounding(기초의 부족). VLP는 본래 이미지의 regions 또는 object와 text의 words 혹은 phrases 사이의 명시적으로 label된 alignments가 없기 때문에 weakly-supervised learning 문제가 있다.

    하지만, OSCAR에서는 Fig2(a)에서와 같이 dog와 couch를 이미지와 text 쌍으로 표현된 두드러진 objects가 제시되고, Fig2(b)에서와 같이 image regions와 textual unis사이의 의미적 alignments 훈련을 위한 anchor points로 사용될 수 있음을 알 수 있다.

 

3. OSCAR Pre-training

사람들은 여러 channels를 통해 세상을 이해한다. 심지어 각 채널의 incomplete 혹은 noisy가 있지만, 여러 channel에서 중요한 factors는 여전히 공유된다. (oscar's motivation)

 

Oscar는 input image-text 쌍이 표현되는 방식과 pre-training 목표가 기존의 VLP와 다르다.(Fig.3)

 

Fig.3 Illustration of OSCAR

 

Input

OSCAR는 Word-Tag-Image 3가지(w, q, v)로 각 input image-text 쌍을 표현한다.

(w: text's word embeddings sequence, q: object tags(image에서 detect된)의 word embedding sequence, v: image's region vectors set)

 

OSCAR는 기존 VLP와 달리 image-text alignment 학습을 쉽게 하기 위한 anchor points로 q를 소개한다.

text에서 q와 w 사이의 alignments는 사전 훈련된 BERT를 사용하여 비교적 쉽게 식별될 수 있기 때문에 text에서 의미적으로 관련된 단어가 query 가 될 때 다른 영역보다 object tag가 dectect된 이미지 영역은 더 높은 attention 가중치를 가질 가능성이 높다.-Fig2(b)

이 과정은 image objects의 ground(기초?바탕?)를 학습하는 것으로 해석될 수 있으며 Fig2(a) 에서 dog와 couch가 vision space에서 애매하게 표현되지만, Fig2(c)에서 표현된 것 처럼 language space에 뚜렷하게 표현될 수 있다.

 

  • BERT(Bidirectional Encoder Representations from Transformer): 구글이 공개한 NLP 모델

 

인공지능(AI) 언어모델 ‘BERT(버트)'는 무엇인가 - 인공지능신문

지난해 11월, 구글이 공개한 인공지능(AI) 언어모델 ‘BERT(이하 버트, Bidirectional Encoder Representations from Transformers)’는 일부 성능 평가에서 인간보다 더 높은 정확도를 보이며 2018년 말 현재, ...

www.aitimes.kr

 

Pre-Training Objective

Pre-Training Objective 2가지 관점

Oscar의 input은 2가지 관점으로 볼 수 있다. x는 text와 image 간의 representations을 구별하기 위한 modality view이다. x'은 두 개의 다른 semantic space를 구별하기 위한 dictionary view이다.

 

 

A Dictionary View: Masked Token Loss(MTL)

object tags와 work token은 같은 linguistic semantic space를 공유하지만 image region feature는 visual semantic space에 있다. 이산(discrete) token sequence를 h ≜ [w,q]로 정의하고, pre-training을 위해 MTL을 적용한다.

훈련의 목표는 negative log-likelihood를 최소화하는 주변 token h\i과 모든 이미지 features v를 기반으로 masked token을 예측하는 것이다. BERT에서 사용된 masked language model과 비슷하다.

Masked Token Loss(MTL)

 

A Modality View: Contrastive Loss.

image modality를 h' ≜ [q,v] 그룹으로 표현하고, w는 language modality로 고려했다. 그런 다음 q의 각 object tag를 50%로 대체하여 dataset D에서 랜덤하게 샘플링된 다른 tag로 "polluted(오염된)" image representations 샘플링 한다.

 

Contrastive Loss

(f: FC layer on of it as a binary classifier, y: polluted ones = 0, image representation = 1)

 

The full pre-training objective of OSCAR is:

Full Pre-Training Objective of OSCAR

 

Discussion.

  1. 각 loss는 representative learning signal을 제공한다.
  2. 모든 loss는 기존 VLP 방법보다 훨씬 simple하다.

 

Pre-Training Corpus

Pre-training Corpus

 

Implementation Details

BERT 기반의 parameters로 initialize된 OscarB 과 OscarL 2가지 모델의 variants를 pre-train했다. image region features는 BERT와 동일한 input embedding size를 갖도록 했고, AdamW Optimizer 사용했다.

**참고: 자세한 사항은 논문 참고

 

4. Adapting to V+L Tasks

pre-trained model을 7개의 downstream V+L taskes에 적용

** 간략한 설명입니다. 자세한 부분은 논문을 참고하세요.

** 참고: 각 task에 관한 Fine-tuning Settings에 관해 논문에 자세히 기재되어 있음

 

Image-Text Retrieval

image-text retrieval(검색)은 representations와 깊은 관련이 있다.

retrieved target으로 사용된 modality에 의존하는 image retrieval 과 text retrieval 2가지 sub-tasks가 있다.

binary classification loss를 사용하는 것이 ranking losses보다 더 나은 결과를 보인다.

Image Captioning

image captioning을 사용하려면 모델이 image content의 natural language description을 생성해야한다.

sentence를 생성하기위해 seq2seq objective여 사용하여 OSCAR를 fine-tune한다.

self-attention mask는 uni-directional 생성(generation) 프로세스를 시뮬레이션하기 위해 이전 token에서만 사용할 수 있도록 제한된다.

Novel Object Captioning (NoCaps)

(image captioning task의 확장버전)

VQA

VQA는 image를 기반으로 natural language 질의(questions)에 모델이 응답(answer)을 요구한다. image 와 질문이 있을 때, multi-choice list에서 알맞은 정답을 선택하는 task이다.

VQA는 multi-label classification 문제로 cross-entropy loss를 최소화하여 모델을 fine-tune한다.

GQA

VQA와 비슷하지만, GQA는 추가 질문에 답해야한다.

Natural Language Visual Reasoning for Real (NLVR2)

NLVR2의 목적은 image에 대해 natural language 설명이 참인지 여부를 결정하는 것이다.

 

5. Experimental Results & Analysis

** 자세한 부분은 논문을 통해 표와 함께 확인하세요.

  • Pre-trained 모델: object tags 유무에 따른 비교

object tags 유무에 따른 비교

  • generated captions: 모델 비교

generated captions: 모델 비교

 

6. Related Work

Vision-Language Pre-training

다양한 V+L 문제를 해결하기 위해 pre-training generic 모델에 대한 관심이 증가했다.

이 논문에서, OSCAR 모델은 understanding과 generation tasks를 포함하여 넓은 범위의 downstream tasks에 적용되었고, 대부분의 새로운 SoTA에 달성했다. 실제로, OSCAR 모델은 대부분의 V+L tasks에서 기존의 large VLP 모델보다 더 좋은 성능을 보였다.

Object Tags

이 논문에서, pre-trained linguistic semantic space에서 object-region features를 aligne하기 위해 object tags 사용을 제안했다.

object tags(with 해당하는 region features & word embeddings)의 구성은 특히 linguistic entity embeddings가 pre-train되었을 때 object에 대해 보다 완전하고 유익한 representations를 제공한다.

Multimodal Embeddings

V+L tasks에서 image 와 text 간의 공유된 embedding space는 이점을 가진다.

 

Socher et al.의 초기 시도에서 word와 image regions를 kernelized canonical correlation 분석을 사용여 common space에 project(투영?)하고 annotation과 segmentation에서 좋은 결과를 얻었다.

 

DeViSE은 un-annotated text에서 수집된 semantic 정보를 사용하여 visual objects를 식별할 것을 제안한다. 이러한 semantic 정보는 훈련 중에 관찰되지 않는 이미지 label의 예측을 위해 활용되며, vision 모델에서 볼 수 없었던 새로운 label로 zero-shot 예측을 드라마틱하게 개선한다.

 

 

실제로, novel(새로운) object captioning에 대한 결과는 Oscar가 pre-train된 모델의 일반화(generalizability)를 향상시키는데 도움이 된다는 것을 보여준다.

 

7. Conclusion

object tags를 (공유된 semantic space에서 image와 language modalities를 결합하는) anchor points로 사용하는 새로운 pre-training 방법인 OSCAR를 소개했다.

 

내가 생각하는 결론

딥러닝 분야의 양대 산맥이라고 할 수 있는 Computer Vision과 NLP를 모두 아우르는(?) Vision-Language Tasks의 BERT 가 될 수 있을지 흥미가 생기는 논문이었다.

 

개인적인 의견을 최대한 제하고 단순 해석하여 논문 리뷰를 작성했기 때문에, 본문에서 반복해서 언급되는 내용이 결국 이 논문이 이야기 하고자 하는 핵심 아이디어라고 할 수 있다.

 

요약하자면,

다른 VLP 모델과 달리 3가지 Input(Word, Tag, Image 특히 Object-Tags)을 사용하여 pre-train된 OSCAR를 이용하면 더 좋은 cross-modal representations를 생성할 수 있다. 여러 V+L downstream tasks에서 보다 좋은 성능을 기대할 수 있다.

 

 

 

(본문에 부족한 내용 혹은 오류가 있다면 첨언 부탁드립니다. 감사합니다!)

 

반응형
반응형

Aggregated Residual Transformations for Deep Neural Networks: https://arxiv.org/pdf/1611.05431.pdf

 

위 논문을 재해석(?)하여 리뷰입니다. 또한, 아래의 내용과 그림의 출처는 위의 논문임을 밝힙니다!

 

Abstract

동일한 블록을 반복적으로 구축하여 더 적은 파라미터로 이미지 Classification이 가능하다.

더 깊고 넓은 디멘션(demension)보다는 cardinality를 키우는 것이 분류의 정확도를 향상시킬 수 있다.

  • "cardinality" (the size of the set of transformations): 똑같은 형태의 빌딩 블록(building block)의 갯수

 

1. Introduction

[Left: (bottleneck)ResNet, Right: ResNeXt]

특히 많은 층(layers)을 가진 경우 하이퍼파라미터가 증가하는 어려움(문제)이 있다.

ResNets를 기반으로 하는 VGG의 경우, 같은 shape의 blocks을 가졌다.

이 간단한 룰은 하이퍼파라미터를 줄였다. 또한 이 룰은 특정 데이터셋에 over-adapting하는 위험을 줄일 수 있을 것이다.

 

 

"Split-Transform-Merge"

 

Inception 모듈은 인풋을 저차원의 임베딩으로 split하고, 특화된 필터셋(3×3, 5×5, etc.)으로 transform하여 결합(concatenation)으로 merge한다.

(In an Inception module, the input is split into a few lower-dimensional embeddings (by 1×1 convolutions), transformed by a set of specialized filters (3×3, 5×5, etc.), and merged by concatenation.)

 

ResNeXt는 split-transform-merge구조로, VGG/ResNets의 반복되는 layers 구조를 가진다.

 

 

[ResNeXt 와 동등한 blocks]

[ResNeXt blocks]

  1. (a)는 누적 잔차 변환(Aggregated residual transformations)
  2. (b)는 (a)보다 early concatenation(초기 결합)한다.
  3. (c) (a,b)와 동등한, grouped convolution

 

ResNeXt는 동일한 topology(네트워크 형식?)를 공유하기 때문에 인자(factor)로 경로(path)를 더 쉽게 분리할 수 있다.

 

cardinality는 네트워크의 층이 깊어(deeper)지거나 넓어(wider)지는 것보다 정확도를 얻는 것에 더 효과적이다.

 

ResNeXt(suggesting the next dimension)는 다른 모델들(ResNet-101/152 , ResNet200 , Inception-v3 , and Inception-ResNet-v2 ) 보다 더 간단한 디자인(구조)을 가졌지만, 월등히 나은 성능(정확도)을 보인다.

 

 

2. Related Work

  1. Multi-branch convolution networks

  2. Grouped convolutions

    AlexNet 이 그룹별 컨볼루션의 예이다. Input을 GPU1과 GPU2 로 전달된 후 각 GPU에서 따로 따로 다음 hidden layer로 전달되다가 나중에 하나로 합쳐진다.

    • 입력 이미지의 채널을 여러 그룹으로 나눠 독립적인 컨볼루션을 수행
  3. Compression convolutional networks

    Decomposition은 중복성을 줄이고 가속/압축하기 위해 선택된 방법이다. 이 방법은 더 적은 복잡성, 더 작은 모델 사이즈와 정확도의 타협(compromise)을 보여준다. ResNeXt에서의 방법은 압축보다 더 강력한 표현력을 보여준다.

  4. Ensembling

    ResNeXt에서의 방법은 일련의 변환으로 addition을 이용하지만 각각이 독립적으로 훈련되는 것이 아니기때문에 앙상블로 보는 것은 적합하지 않다.

3. Method

1. Template

[ 원래 ResNet-50과 유사한 Capacity를 가진 ResNeXt-50 비교 ]

 

  • C=32: 32개 그룹별 컨볼루션

ResNeXt의 네트워크는 residual blocks를 쌓아서 구성한다.

이러한 블록은 두가지 간단한 룰이 있다. 먼저, 같은 사이즈의 spatial maps를 사용한다면 그 blocks는 같은 파라미터를 공유한다.

두 번째 룰은 계산적 복잡성이 모든 blocks에서 같다는 것이다.

이러한 두가지 룰에 따르면 template 모듈을 구축하고, 몇가지 중요한 요인(factor)에만 집중하면 된다.

 

 

2. Revisiting Simple Neuron

 

인공신경망의 가장 간단한 뉴런의 내적(가중합)은 fully connected, convolution 층에서 이루어지는 기본적인 변환이다.

이러한 연산은 splitting, transforming, aggregating 으로 recast(다시 작성)할 수 있다.

 

(i)splitting 자르기

벡터 X 가 X1, X2...XD 의 저차원 값으로 잘라진다.

(ii) Transforming 변환

저차원의 정보 X1, X2...XD 가 각각 가중치 Wi 와 곱해져서 크기(Scale)가 변한다(Transform).

(iii) aggregating

변환된 저차원 정보를 합친다

 

 

3. Aggregate Transformations

 

뉴런 자체도 더 일반적인 기능을 하는 기본 변환을 대체할 수 있는 네트워크가 될 수 있다.

깊이의 차원을 늘리는 것으로 밝혀진 Network-in-Network 와 대조적으로 ResNeXt의 Network-in-Neuron 은 새로운 차원을 따라 확장된다.

 

cardinality는 필수적인 차원이고 깊이와 폭의 차원보다 더 효과적이다.

ResNeXt는 모든 Ti가 같은 topology를 갖는 변환 함수를 설계하는 간단한 방법을 고려한다. (Ti는 여러함수가 될 수 있다)

동일한 층을 반복하는 VGG 스타일의 방법을 확장시켜, 몇 가지 요인을 분리하고 많은 수의 변환으로 확장할 수 있게 한다. ResNeXt에서는 bottleneck 모양으로 구축하고 각 첫번째 1x1 층은 저차원 임베딩을 생성한다.

 

  • bottleneck: 차원을 줄였다 늘리는 것, 연산 시간을 줄이기 위해 사용

[Inception-resnet.v1]

그림 출처: 구글 인셉션 모델

Relation to Inception-ReNet: ResNeXt는 Inception-ReNet과 비슷한 residual 기능을 가지고 있지만 여러 경로에서 같은 topology를 공유한다는 점에서 다르다.

 

Relation to Grouped Convolutions: Splitting은 input channel이 grouped convolution 층으로 분리될 때 필수적이다.

grouped convolutional 층은 output 층으로써 concatenate(결합)된다.

 

Discussion: 같은 차수의 형태(homogenous forms)가 더 단순하고 확장성이 있기 때문에 선택했다.

 

 

4. Model Capacity

 

[cardinality C와 bottleneck 너비(width)의 관계]

bottleneck은 input과 output block을 분리(독립적으로 만들)하기 때문에 사용했다.

이 방법은 다른 하이퍼파라미터를 변경하지 않기 때문에 cardinality의 영향에 집중하는데 도움이 된다.

 

 

4. Implementation details

input image: 224 x 224 randomly cropped (ImageNet dataset)

shortcuts & Downsampling

optimizer: SGD

mini-batch size: 256 (32 per 1 gpu)

gpu: 8

weight decay: 0.0001

momentum: 0.9

learning rate: 0.1, 0.01, 0.001

 

aggregating 이후 Batch Normalization을 적용 후 shortcut과 합한다.

 

(a), (b), (c) 블록 모두 같은 결과를 얻었고, 다른 두개의 블록(block)보다 더 간결하고 빠른 (c) 선택했다.

*(c) : (a,b)와 동등한 grouped convolution 임

 

 

5. Experiments

1. Experiments on ImageNet-1K

 

Cardinality vs. Width.

[네트워크 구조를 바꿔가며 성능 실험, 복잡도가 비슷한 ResNet과 ResNeXt 비교]

 

 

Cardinality가 1에서 32로 증가할수록 error가 줄어든다.

 

Increasing Cardinality vs. Deeper/Wider.

Resnet-101의 너비와 폭을 늘리는 것보다 ResNeXt-101의 에러율이 더 낮다.

: 깊이보다는 너비, 너비보다는 cardinality가 에러율을 더 낮출 수 있다.

 

Residual connections.

 

[ResNet-50 과 ResNeXt-50에 shortcut을 제거했을 때 비교]

 

Comparisons with state-of-the-art results.

 

Inception v3,4, Inception-resnet보다 ResNeXt의 에러율이 더 낮다.

 

 

 

6. ResNext를 어디에 활용하면 좋을까?

 

더~~ 깊은 모델, 더~~~ 넓은 모델보다 더 적은 파라미터로 더 높은 성능을 낼 수 있다.

 

단, 절대적으로 높은 성능은 아니다.

 

 

p.s.

첫 논문 리뷰라 내용이 부족할 수 있습니다.

첨언 환영합니다!

반응형

+ Recent posts