Best CNN ≠ the most accurate CNN

이미지 분류를 위한 효율적인 컨볼루션 신경망(CNN) 설계는 딥러닝 모델의 성능과 효율성을 균형있게 유지하고자 하는 중요한 과제입니다. 하지만, 최고의 성능을 내는 것만이 중요한 것은 아닙니다. 효율적인 모델은 고품질의 출력을 유지하면서 작은 모델 크기, 낮은 계산 부하, 실시간 제약과 같은 다양한 측면을 고려해야 합니다.
SqueezeNet과 Shift operation은 'Efficient CNN'을 위한 다양한 설계 전략을 대표하는 좋은 예시입니다.
본 글에서는 효율적인 연산을 도입하여 CNN을 설계하는 아이디어를 제시한 주요 논문을 간략하게 정리해보려고 합니다.



💭 Best CNN ≠ the most accurate CNN

  • What is ‘Practivally’ best?
    • high-quality output, or abundant within feature map
    • small neural network size
  • Low computation overhead
    • Snapdragon 865 GPU ~1450 Gflops
    • Real-time constraint
  • Low battery consumption

💭 Way to Make Efficient

  • Improving operator design
    • Depthwise-separable convolution
    • Shift-based convolution
  • Improving architecture design
    • Residual structure
    • Inverted-residual structure
    • Squeeze-excitation module
  • Applying optimization techniques
    • Low-precision computation
    • Pruning
    • Low-rank approximation


SqueezeNet

*SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and < 0.5MB model size, Iandola et al., 2016

SqueezeNet은 아키텍처와 연산자 디자인을 효율적으로 개선하여 작은 크기의 모델을 구축
ex. "Fire Module"이라 불리는 구조를 사용하여 입력 채널을 줄이고(1x1 컨볼루션으로), 동시에 다양한 특성을 학습하여 작은 모델에도 풍부한 정보를 담을 수 있게 함

특징

  • Replace 3x3 filters with 1x1 filters - 9X fewer parameters
  • Decrease the number of input channels to 3x3 filters
  • Downsample late in the network so that convolution layers have large activation maps
    ; convolution layer의 activation max pool을 뒤쪽으로 보냄 → 앞에서 줄어든 파라미터 수만큼 손실이 있을텐데 feature resolution을 키우면서 feed forwarding을 해서 더 좋은 표현력을 얻음


Shift operation

*Shift: A Zero FLOP, Zero Parameter Alternative to Spatial Convolutions (Wu et al., CVPR 2018)

  • motivation : spatial convolution이 필요없을 수도 있다
  • idea : 읽고 다 summation되는 정보라면 그 정보에 대해 위치만 유지되면 되지 않느냐

기존의 공간 합성곱과 다르게 입력 데이터의 위치를 변화시켜 다양한 위치에서 특성을 추출함

효과

  • 하드웨어(SIMD pipeline / systolic array)에 최적화되어있음

  • high-dimension operation is hard to handle

  • 채널 내부에서 값을 인코딩할 수 있으니까 high order tensor에 대해 hardware circuit을 minimize할 수 있음


Active Shift

*Constructing Fast Network through Deconstruction of Convolution (Jeon et al., NIPS 2018)

shift 기법을 active shift로 개선

일반적인 컨볼루션 연산과 다르게, 입력 데이터의 특성을 다양한 방향으로 이동시켜 특성을 추출하는 방법

→ grouped shift를 relaxation함; 기존 shift는 전후좌우로 움직였는데 active shift는 모든 방향으로 움직일 수 있고 정수 shift 안해도 됨

문제점 : bilinear interpolation 때문에 구현 자체가 unrealistic


Active Shift + Quantization

*All You Need is a Few Shifts: Designing Efficient Convolutional Neural Networks for Image Classification(Chen et al., CVPR 2019)

  • shift 파라미터를 round approximation해서 interpolation이 필요없도록 함

  • straight-through estimation

  • apply L1 requluarization for sparsity

profile
✉️ qtly_u@naver.com

0개의 댓글