Conv layers는 modern deep NN에서 basic building blocks 중 하나임.
이에 대한 한가지 기초적인 assumption은 conv kernels이 한 dataset의 모든 examples에 대해서 공유되어야 한다는 것임.
We propose conditionally parameterized convolutions (CondConv), which learn specialized convolutional kernels
for each example.
normal conv를 CondConv로 바꿈으로써 efficient inference를 유지하면서, network의 size and capacity를 증가시킬 수 있음.
We demonstrate that scaling networks with CondConv
improves the performance and inference cost trade-off
of several existing convolutional neural network architectures on both classification and detection tasks.
conv layers의 design에 대한 한가지 fundamental assumption은
the same conv kernels이 한 dataset 내의 모든 example에 대해 적용되어야 한다는 것이다.
이러한 assumption과 mobile deployment에 초점을 맞추기 때문에, 현대의 computationally efficient models은 very few parameters를 갖는다.
그러나 inference 시 엄격한 latency requirements를 가진,
real-time server-side video processing 및 self-driving cars의 perception과 같은
computer vision applications이 점점 늘어나고 있다.
이 논문에서, 우리는 이러한 apps에 더 적합한 models을 design하는 것을 목표로 한다.
우리는 input에 따라 convolutional kernels을 computing하는
conditionally parameterized convolutions (CondConv)를 제안하며,
기존의 static convolutional kernels의 paradigm에 도전한다.
구체적으로, CondConv layer에서 convolutional kernels을 개의 experts 조합으로 parameterize한다.
, 여기서 은 gradient descent를 통해 학습되는 input의 functions이다.
CondConv layer의 capacity를 증가시키기 위해, model developers는 #experts를 늘릴 수 있다.
이는 convolutional kernel의 size 자체를 늘리는 것보다 훨씬 더 computationally efficient하다.
왜냐하면 convolutional kernel은 input의 여러 위치에 반복적으로 적용되는 반면, experts의 조합은 input당 한 번만 이루어지기 때문이다.
이를 통해 model developers는 efficient inference를 유지하면서 model capacity and performance를 증가시킬 수 있다.
CondConv처럼, conditional computation은 computation cost의 비례적인 증가 없이 model capacity를 증가하는 것을 목표로 한다.
conditional computation models에서, 이는 each example당 entire network의 일부분만을 activating함으로써 달성되어졌다.
하지만, conditional computation models은 각각의 examples들이 서로 다른 experts로 가는 discrete routing deicions을 필요로 하기 때문에 train하기에 challenging하다.
이러한 approaches와 달리, CondConv는 discrete routing of examples을 필요로 하지 않아서, gradient descent로 쉽게 optimized될 수 있다.
Shazeer et al. [37]은 sparsely-gated mixture-of-experts layer를 제안했다.
이는 noisy top-k gating을 활용하여 LLM에서 siginificant success를 달성했다.
computation에 대한 이전 연구들은 different sets of examples을 different sub-networks와 함께 process시키어 large models을 designing하는 potential을 입증했다.
우리의 CondConv 연구는 each individual example이 서로 다른 weights로 처리될 수 있도록 함으로써 이 pardigm의 boundaries(한계)를 확장했다.
(skip)
(skip)
a regular conv layer에서, all input examples에 대해 같은 conv kernel이 사용된다.
a CondConv layer에서는, conv kernel이 input example에 따라 계산된다. (Fig 1a)
구체적으로, CondConv에서 conv kernels은 다음과 같이 parameterize된다:
where
each 는 routing function에 의해 학습된 parameters를 사용해 계산되는 example-dependent scalar weight이며,
은 #experts,
는 activation function이다.
a conv layer에 CondConv를 적용할 때, 각 kernel 는 original conv의 kernel과 same dimensions이다.
일반적으로 conv layer의 capacity를 증가시키려면 kernel의 height/width 또는 #input/output channels을 늘린다.
그러나 convolution에서 추가되는 각 추가의 parameter는 input feature map의 #pixels에 비례하여 추가적인 multiply-adds을 요구하므로,
input size가 클수록 computation이 급격히 증가한다.
반면, CondConv layer에서는 각 example별로 expert 명의 linear combination을 통해 conv kernel을 계산한 후 이를 적용한다.
중요한 점은, 각 conv kernel은 한 번만 계산되지만 input image에서 many different positions에 반복적으로 사용된다는 것이다.
따라서 을 늘림으로써, network의 capacity를 효과적으로 증가시킬 수 있으며, inference cost는 소폭만 증가한다.
추가되는 각 parameter는 only 1 additional multiply-add만 요구된다.
CondConv layer는 더 많은 expensive linear MoEs formulation과 수학적으로 동일하다.
각 expert는 a static conv에 대응한다 (Fig 1b):
그러므로, CondConv는 개의 experts를 갖는 a linear MoEs formulation과 동일한 capacity를 갖지만
only one convolution만 필요로 하기 때문에 computationally efficient하다.
per-example routing function은 CondConv performance에 중요한 역할을 한다:
만약 learned routing function이 모든 examples에 대해 동일하다면, Cond Conv layer는 a static conv layer와 동일한 capacity를 갖는다.
우리는 computationally efficient하고, input examples 사이에 의미있는 differentiate(미분)과 easily interpretable한
a per-example routing function을 design하길 원한다.
우리는 three steps으로부터 example-dependent routing weights 를 계산한다: GAP, FC layer, Sigmoid activation
여기서 은 pooled inputs을 expert weights로 mapping하는 learned routing weights이다.
normal conv operation은 local receptive fields에서만 작동하므로, 우리의 routing function은 global context를 사용하여 local operations을 적응할 수 있도록 한다.
CondConv layer는 network의 모든 conv layer를 대신하여 사용할 수 있다.
이 approach는 depth-wise convs and fc layers에도 쉽게 확장할 수 있다.
우리는 MobileNetV1, V2, ResNet-50, MnasNet, and EfficientNet을 scaling up함으로써
ImageNet classification and COCO object detection에 대해서 CondConv를 평가했다.
CondConv model을 train하는 두 가지 options이 있다.