Training BatchNorm and Only BatchNorm: On the Expressive Power of Random Features in CNNs
Jonathan Frankle, David J. Schwab, Ari S. Morcos
ICLR 2021
Paper link: https://arxiv.org/abs/2008.09093
Video presentation link: https://youtu.be/bI8ceHOoYxk
reviewed by Sunghoon Joo (주성훈)
PR-159 : Synergistic Image and Feature Adaptation: Towards Cross-Modality Dom...
PR-313 Training BatchNorm and Only BatchNorm: On the Expressive Power of Random Features in CNNs
1. PR-313
주성훈, Samsung SDS
2021. 4. 18.
https://arxiv.org/pdf/2003.00152.pdf
Training BatchNorm and Only BatchNorm:
On the Expressive Power of Random Features in CNNs
Jonathan Frankle1, David J. Schwab2,3, Ari S. Morcos3
1 MIT CSAIL
2 CUNY Graduate Center, ITS
3 Facebook AI Research
Published as a conference paper at ICLR 2021
3. 1. Research Background
Learning affine transformations of features
• Feature의 Batch, Layer, Instance, Group 단위의 평균과 분산을 이용해 feature를 normalization 한 후, 학습 가능한 scale, shift
parameter를 적용함
Yuxin Wu, Kaiming He, Group Normalization, CVPR, 2018
3 / 19
4. 1. Research Background
Exploiting the expressive power of affine transformations
• Residual Adaptor modules를 설계해 하나의 task에 대해 학습된 모델을 다른 visual domain에 적용할 수 있도록 함
Multi-task learning
• Per-task BatchNorm (Mudrakarta et al., ICLR, 2019)
:하나의 task에 대해 학습된 network을 가지고 다른 task에 적용할때는 BatchNorm parameters만 학습하는 방법
Style transfer and Style generation
• Instance Normalization을 활용해, content feature를 다양한 style feature로 인코딩 하는 데에 적용
• StyleGAN (Karras et al., CVPR, 2019), (PR-131)
• Adaptive instance normalization (AdaIN) (Huang and Belongie, CVPR, 2017) (PR-186)
4 / 19
5. 1. Research Background
Batch Normalization
• Scale and shift를 결정하는 trainable parameter인 γ와 β의 역할과 표현 능력에 대해 잘 알지 못함
• BatchNorm is nearly ubiquitous in deep convolutional neural networks (CNNs) for computer
vision
5 / 19
6. 1. Research Background
Training only BatchNorm
• 이전의 시도들
• Rosenfeld & Tsotsos, CRV, 2019
Network의 다양한 부분을 freeze하면서 Batch normalization parameter(γ,β)만을 학습시킴
CIFAR-10 networks (DenseNet and an unspecified Wide ResNet)에서 61% and 30% 정확도
• Mudrakarta et al., ICLR, 2019
하나의 task에 대해 학습된 network을 가지고 다른 task에 적용할때는 BatchNorm parameters만 학습하는 방법 제안
• 연구의 필요성
• 어떻게 BatchNorm parameters만을 학습했을 때 좋은 성능이 나오는지에 대한 깊은 연구 필요.
• 소수의 parameter를 학습한 결과와 BatchNorm parameter training 결과를 비교해 BatchNorm parameter의 표현력 확인
• 다양한 범위의 network에서 BatchNorm parameter training가 가능한지 확인
6 / 19
7. Objective & Approach
• We aim to understand the role and expressive power of affine parameters used to transform
features in this way (BatchNorm).
• We investigate the performance achieved when training only these parameters in BatchNorm
and freezing all weights at their random initializations.
• Random initialization network의 대부분의 parameters를 유지하면서 높은 정확도를 보인 논문들이 있음. (Zhou et al. NIPS 2019, Zhang et al. ICML 2019)
1. Research Background
CONV
All params trainable
BatchNorm
ReLU
Input
Train only Batch normalization parameter(γ,β)
…
Output
CONV
BatchNorm
CONV
BatchNorm
ReLU
Input
…
Output
CONV
BatchNorm
freezing all weights
freezing all weights
freezing all weights
7 / 19
9. Architectures
• ResNet for CIFAR-10과 ResNet for ImageNet 을 기본 구조로 활용 (Random initialization)
• Depth와 Width 조절해가며 실험 (ResNet을 기본 구조로 선택한 이유)
• Depth 조절: Kaiming He et al., CVPR 2015 논문을 따라서 layer를 더 쌓음
• Width 조절: layer당 채널을 늘림
• Activation전에 BatchNorm을 배치 (Kaiming He et al., ECCV 2016)
• Parameter initialization: β to 0, sample γ uniformly between 0 and 1
2. Methods 9 / 19
11. - Batch normalization parameter(γ,β)를 제외한 모든 weight freeze (random initialization)
: 전체 parameter의 0.64% (CIFAR-10 ResNet), 0.27% (ImageNet ResNet)
3. Experimental Results
BatchNorm parameter만 학습했을 때의 accuracy
In ResNet-110,
93.3% test accuracy
In ResNet-110,
69.5% test accuracy
5 runs
• Finding 1: Random feature를 rescaling, shifting 하는 parameter를 학습하는 것 만으로도 높은 CIFAR-10 accuracy를
달성
11 / 19
12. 3. Experimental Results
모델 architecture에 따른 성능 – Depth & Width
48 %
73 %
Widening network
48 %
82 %
Deepening network
• 네트워크를 더 깊게 쌓을 때가 더 넓게 만드는 것보다 batchnorm parameter training의 효과가 높아짐
ResNet-434가 7% 정도 성능이 더 높음
Figure 3: The relationship between BatchNorm parameter count and accuracy
when scaling depth and width of CIFAR-10 ResNets.
• 네트워크의 Width와 Depth를 늘림에 따라 정확도가 높아짐
12 / 19
13. * 1000개의 classes가 있는 ImageNet의 경우, Output layer를 같이 학습시켜 1000개의 class간의 fine-
grained distinctions을 학습하는 것이 필요함
3. Experimental Results
32 %
17 %
57 %
32%
CIFAR-10 (10 class)의 경우,
차이가 적음
BatchNorm params가 중요
Parameter에 따른 CNN 성능 – ResNet for ImageNet
3 runs
5 runs
13 / 19
14. 3. Experimental Results
Are affine parameters special?
Batch normalization parameter(γ,β)가 아닌 다른 임의의 2개의 parameter만을 학습 -> 성능이 낮아짐
• Batch normalization parameter(γ,β)가 다른 종류의 parameter들 보다 정확도에 더 큰 영향을 미치는 것을 확인
• Scaling parameter를 통해 전체 random features를 조정하는 것이 일부 parameter를 수정하는 것 보다 중요하다.
• Finding 2: γ 와 β로 인한 feature scaling and bias만으로도 상당한 표현력을 가질 수 있다.
14 / 19
15. 3. Experimental Results
어떻게 대부분의 parameters를 freezing 하고도 좋은 성능이 나왔는지 – γ value 의 역할
• γ를 0에 가깝게 설정함으로써 네트워크의 1/4 ~ 1/3를 비활성화하는 방법을 배우는 것으로 보임
• 저자들은 γ가 0에 가까워지는 것이 exploding activations를 막기 위함이라고 생각함
• Finding 3: γ 와 β 가 per-feature sparsity를 부과함으로서 모델의 높은 정확도에 기여한다.
27% 33%
Network이 깊고 넓어질수록,
γ가 0에 가까워지는 경향이 있음
15 / 19
16. 3. Experimental Results
• γ가 0에 가깝긴 한데 0은 아닌 것 같다
어떻게 대부분의 parameters를 freezing 하고도 좋은 성능이 나왔는지 – γ value 의 역할
16 / 19
17. 3. Experimental Results
• Only training BatchNorm: 0에 가까운 γ 값, activations 비활성화
• All parameters are trainable: activation이 disabled된 비율은 낮았음. BatchNorm parameters가 여전히 역할을 한다.
• Finding 4: BatchNorm parameter γ가 activation을 조정하는 역할을 한다.
어떻게 대부분의 parameters를 freezing 하고도 좋은 성능이 나왔는지 – γ, β value 의 역할
Network이 깊고 넓어질수록,
γ가 0에 가까워지는 경향이 있음
activations 비활성화
17 / 19
19. Thank you.
4. Conclusions
2. Random initialized feature로 구성된 network를 훈련시키는 새로운 방법
• Output layer만 학습하는 것 보다 Batchnorm parameters만 학습하는게 더 성능이 좋았다.
• Training cost 를 줄이는 방법은 아니지만, inference를 위해 random seed와 BatchNorm parameter만 저장해도 괜찮겠
다.
• 이와 관련해 특정 task의 성능을 높일 수 있는 random initialization 방법 자체를 연구할 필요도 있겠다.
1. Affine parameters가 learned features와 관계없이 그 자체로 상당한 표현력을 갖는다는 결론을 내린다.
• Finding 1: Random feature를 rescaling, shifting 하는 parameter를 학습하는 것 만으로도 높은 CIFAR-10 accuracy를 달
성
• Finding 2: γ 와 β로 인한 feature scaling and bias만으로도 상당한 표현력을 가질 수 있다.
• Finding 3: γ 와 β 가 per-feature sparsity를 부과함으로서 모델의 높은 정확도에 기여한다.
• Finding 4: BatchNorm parameter γ가 activation을 조정하는 역할을 한다.
3. Limitations and future work
• 다른 network (Inception net., Transformer) 에서의 연구
• Training only batchnorm 조건일때의 Hyperparameter tuning 연구
• Batchnorm이 없는 경우에도 (e.g. WeightNorm (Salimans & Kingma), FixUp initialization (Zhang et
al.)) affine parameter만을 학습시키는 방법을 적용할 수 있는지
19 / 19