DenseNet

ph
이동: 둘러보기, 검색

Densely connected convolutional networks

by Facebook
arXiv:1608.06993
CVPR2017 best paper 다른 하나는 애플꺼
github
Zuckerberg도 축하해주는 논문[1]

fully connected라는 점이 약간 식상할 수도 있을것 같고..

또 보다보면 hyper column이용하는거랑 같은 맥락이겠다 싶기도 함. ResNet단점 설명을 ‘the identity function and the output of \(H_l\) are combined by summation, which may impede the information flow in the network.’ 이렇게 하는데, 그 대안으로 feature 처리하는 방식(concatenation)이 hyper column과 동일. DSN[2]과 훨씬 훨씬 더 비슷하긴 하다

Abstract

Recent work has shown that convolutional networks can be substantially deeper, more accurate, and efficient to train if they contain shorter connections between layers close to the input and those close to the output.

they alleviate the vanishing-gradient problem, strengthen feature propagation, encourage feature reuse, and substantially reduce the number of parameters.

1. Introduction

ResNets, Highway Networks, Stochastic depth, FractalNets, etc ... they all share a key characteristic: they create short paths from early layers to later layers.

we connect all layers. (so all connections = \(\frac{L(L-1)}{2}\) where \(L\) is the number of all layers)

DenseBlock.png

feature를 다음 layer에 넘기기 전에 합(summation)하는 ResNet과 달리, 그냥 계속 쌓는다(combine features by concatenating them)

전통적인 fead-foward는 state의 전이로 볼 수 있다. 정보가 단계를 거칠때마다 적절히 가공되어 필요한 정보만 남겨서 다음 상태(state)로 넘어간다. ResNet은 identity transformation을 더해서 정보의 preservation을 명확히 한 것으로 볼 수 있다. ResNet에서 layer를 randomly drop하면서 관찰해보면, 대부분의 layer가 별다른 영향을 미치지 않음을 알 수 있다[3]. 마치 unrolled recurrent neural net같이 동작한다.[4] 반면, DenseNet은 net의 입력으로 쓸 정보와 preserved되어야 하는 정보를 명확하게 구분하며, 층이 얕다.(12 feature-maps per layer) (여기서 층이 narrow하다는게, 층의 총 개수가 적다는 뜻이 아니고 channel의 수가 적다는 뜻)

DenseNet은 모든 layer가 input과 loss(output)에 직접 연결되어 있기 때문에, implicit deep supervision[2]이 된다.

Regularizing effect도 관찰할 수 있었다.

We significantly outperform the current state-of-the-art results on most of the benchmark tasks.

2. Related Work

Parallel to our work, Cortes et al.[5] derived a purely theoretical framework for networks with cross-layer connections similar to ours.

Recently, stochastic depth[3] was proposed as a way to successfully train a 1202-layer ResNet.

ResNets with pre-activation also facilitate the training of state-of-the-art networks with \(> 1000\) layers.[6]

In Targ et al.[7], a variant of ResNets with wide generalized residual blocks was proposed. In fact, simply increasing the number of filters in each layer of ResNets can improve its performance

Compared to Inception networks[8][9], which also concatenate features from different layers, DenseNets are simpler and more efficient.

The augmentation of networks with pathways that minimize reconstruction losses was also shown to improve image classification models[10].

3. DenseNets

DenseNet.png

ResNets는 다음과 같고 $$ \mathbf{x}_l = H_l(\mathbf{x}_{l-1}) + \mathbf{x}_{x-1}$$ DenseNet은 다음과 같다. $$ \mathbf{x}_l = H_l ([\mathbf{x}_0, \mathbf{x}_1, \dots , \mathbf{x}_{l-1} ])$$ we concatenate the multiple inputs of \(H_l(·)\) into a single tensor.

\(H_l(·)\):

BN — ReLU — \(3 \times 3\) conv

여기에, bottleneck을 앞에 더해서 DenseNet-B라고 한다.

\(1\times 1\) — BN — ReLU — \(3 \times 3\)

실험에 쓰인 모든 bottleneck은 입력을 \(4k\)로 줄인다.

위 DenseNet그림에서, DenseBlock사이의 layer를 transition layers라 한다. 각 transition layer는 다음과 같다.

BN — \(1\times1\) conv — \(2\times2\) avg. pooling

transition layer에서 feature map의 개수를 줄일 때, compression factor \(\theta = 1\)이면, 압축하지 않는 것이고, \(\theta < 1\)이면 압축한 것이다. 이렇게 한 것을 DenseNet-C라 하고 실험에서는 모두 \(\theta=0.5\)로 두었다.

bottleneck도 붙이고 압축도 한것은 DenseNet-BC라고 한다.

\(l^{th}\) layers는 \(k \times (l -1) + k_0\)의 input을 가지게 된다(\(k_0\)는 입력 이미지의 채널 수). net이 지나치게 커지는 것을 막기 위해 \(k\)는 작은 수로 고정하고, 이 hyper parameter를 growth rate라고 부르겠다. 실제로 실험해보면 \(k\)가 작은 수여도 충분했다(ImageNet을 위한 실험에서는 \(k=32, 48\)). 다른 net들과는 달리, original data를 항상 쓸 수 있으므로, 추가정보가 많을 필요가 없는 것으로 보인다.

DenseNet-121의 구조는 논문의 표1 참고.

4. Experiments

4.1. Datasets

  • CIFAR-10, CIFAR-10+('+' means augmentation), CIFAR-100, CIFAR-100+
    normalize the data using the channel means and standard deviations.
    Augmentation:
    1) zero padding 4 pixels around and crop same with original size
    2) mirror
  • SVHN
    Following common practice, we use all the training data without any data augmentation
  • ImageNet
    same data augmentation scheme for the training images as in [11][12][6], and apply a 224×224 center crop to images at test time. Following common practice [12][6][3], we report classification errors on the validation set.

4.2. Training

refer the paper

4.3. Classification Results on CIFAR and SVHN

Accuracy

DenseNet-BC with L = 190 and k = 40 outperforms the existing state-of-the-art consistently on all the CIFAR datasets.

Capacity

Without compression or bottleneck layers, there is a general trend that DenseNets perform better as L and k increase.

모델이 복잡해짐에 따라 error rate이 일관성 있게 작아지는 것으로 보아, overfitting이나, optimization 문제가 residual net[12]보다 적은 것으로 보인다.

Parameter Efficiency

fewer parameters compared to ResNet or FractalNet.

Overfitting

more efficient use of parameters → less prone to overfitting.

The DenseNet-BC bottleneck and compression layers appear to be an effective way to counter overfitting.

4.4. Classification Results on ImageNet

ResNet used in this exp. : Torch implementation [11]. preprocessing등 모든 요소를 같게 하기 위해서 DenseNet도 여기에서 net부분만 바꾸어서 실험.

ResNet에 최적화된 hyper parameters를 썼는데도 결과가 훨씬 좋다(적은 크기로 validation error가 작고, FLOPS도 훨씬 작다. (다만 최종적으로 도달하는 error rate은 차이가 없거나 ResNet보다는 못한 것 같다 그러니 논문에 명시적으로 안써놨겠지). 향후 parameter조정으로 더 좋은 결과를 노려볼 수 있을 것이다.

5. Discussion

Model compactness

DenseNet-BC is the best.

Implicit Deep Supervision.

DCN[2] has classifiers attached to every hidden layer, enforcing the intermediate layers to learn discriminative features. 하지만 DenseNet이 훨씬 간단하지

Stochastic vs. deterministic connection.

ResNet에서 임의로 layer를 버리면 앞뒤의 net이 그대로 이어지는 효과가 나는데 DenseNet에서 모든 layer가 연결을 가지는 것(stochastic depth regularization)과 구조가 같다. Regularizer를 설계할 때 이와 같은 통찰이 도움이 될 수 있다.

Feature Reuse

Densenet heatmap.png

  • ①: early layers에서 나오는 feature들은 모두 쓰인다.(low-level feature가 버려지지 않는다)
  • The weights of the transition layers also spread their weight across all layers within the preceding dense block, indicating information flow from the first to the last layers of the DenseNet through few indirections.(diagonal이 대개 붉다)
  • ②: The transition layer outputs many redundant features (with low weight on average). This is in keeping with the strong results of DenseNet-BC where exactly these outputs are compressed.
  • ③: final classification layer는 주로 뒤쪽(final에 가까운 쪽)의 feature-map을 쓴다.(high-level feature)

6. Conclusion

앞의 요약


References

  1. https://www.facebook.com/zuck/posts/10103917877434011 Densenet-zuckerberg.png
    저커버그의 논문링크는 여기
  2. 2.0 2.1 2.2 C.-Y.Lee, S.Xie, P.Gallagher, Z.Zhang, and Z.Tu. Deeply-supervised nets. In AISTATS, 2015.
  3. 3.0 3.1 3.2 G. Huang, Y. Sun, Z. Liu, D. Sedra, and K. Q. Weinberger. Deep networks with stochastic depth. In ECCV, 2016.
  4. Q. Liao and T. Poggio. Bridging the gaps between residual learning, recurrent neural networks and visual cortex. arXiv preprint arXiv:1604.03640, 2016.
  5. C. Cortes, X. Gonzalvo, V. Kuznetsov, M. Mohri, and S. Yang. Adanet: Adaptive structural learning of artificial neural networks. arXiv preprint arXiv:1607.01097, 2016.
  6. 6.0 6.1 6.2 K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. In ECCV, 2016.
  7. S. Targ, D. Almeida, and K. Lyman. Resnet in resnet: Generalizing residual architectures. arXiv preprint arXiv:1603.08029, 2016.
  8. C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In CVPR, 2015.
  9. C.Szegedy, V.Vanhoucke, S.Ioffe, J.Shlens, and Z.Wojna. Rethinking the inception architecture for computer vision. In CVPR, 2016.
  10. Y.Zhang, K.Lee, and H.Lee. Augmenting supervised neural networks with unsupervised objectives for large-scale image classification. In ICML, 2016.
  11. 11.0 11.1 S. Gross and M. Wilber. Training and investigating residual nets, 2016.
  12. 12.0 12.1 12.2 K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016.