ABSTRACT

Neural networks are both computationally intensive and memory intensive, making them difficult to deploy on embedded systems with limited hardware resources. To address this limitation, we introduce “deep compression”, a three stage pipeline: pruning, trained quantization and Huffman coding, that work together to reduce the storage requirement of neural networks by 35× to 49× without affecting their accuracy. Our method first prunes the network by learning only the important connections. Next, we quantize the weights to enforce weight sharing, finally, we apply Huffman coding. After the first two steps we retrain the network to fine tune the remaining connections and the quantized centroids. Pruning, reduces the number of connections by 9× to 13×; Quantization then reduces the number of bits that represent each connection from 32 to 5. On the ImageNet dataset, our method reduced the storage required by AlexNet by 35×, from 240MB to 6.9MB, without loss of accuracy. Our method reduced the size of VGG-16 by 49× from 552MB to 11.3MB, again with no loss of accuracy. This allows fitting the model into on-chip SRAM cache rather than off-chip DRAM memory. Our compression method also facilitates the use of complex neural networks in mobile applications where application size and download bandwidth are constrained. Benchmarked on CPU, GPU and mobile GPU, compressed network has 3× to 4× layerwise speedup and 3× to 7× better energy efficiency.


신경망은 계산 및 메모리 집약적인 특성 떄문에 하드웨어 자원이 제한되어 있는 임베딩 환경에서 작동시키기가 어렵다.

이러한 제한점을 해결하기 위해, 정확도 손실 없이 35배에서 49배 저장 요구를 감소하는 작업을 수행하는 허프만 코딩, 프루닝, 학습 양자화의 세 가지 단계를 가지는 "deep compression"을 소개한다.

이 방법은 먼저 중요한 연결만 학습하도록 네트워크를 프루닝합니다.

다음으로 가중치 공유를 위해 가중치를 양자화하고, 마지막으로 허프만 코딩을 적용한다.

위의 두 가지 단계 이후에 나머지 연결과 양자화된 것들의 미세 조정을 위해 네트워크를 재학습합니다.

프루닝은 연결의 수를 9배에서 13배 감소시키고, 양자화는 각 연결을 나타내는 비트 수를 32에서 5로 줄입니다.

이미지넷 데이터셋에서 이 방법은 정확도 손실 없이 알렉스넷의 저장요구를 35배 줄였다.(240MB -> 6.9MB)

또한, 정확도 손실 없이 VGG-16 모델의 크기를 49배 감소시켰다.(552MB -> 11.3MB)

이는 off-chip DRAM memory이 아닌 on-chip SRAM에서의 모델 피팅을 가능케 한다.

우리의 압축 방법은 애플리케이션 크기와 다운로드 대역폭이 제한된 모바일 앱에서 복잡한 신경망 사용을 가능하게 한다.

CPU, GPU, 모바일 GPU에서 압축된 네트워크는 3 ~ 4배 빠른 속도와 3 ~ 7배 향상된 에너지 효율성을 나타낸다.


요약

  • 논문에서 제안하는 방법의 과정은 Pruning -> Quantization -> huffman coding이다.

  • 허프만 코딩은 확률에 따라 비트의 수가 달라진다는 점과 효과적인 디코딩 방법을 적용한다는 것이다.
  • 프루닝은 의미없는 네트워크 간 연결을 전부 끊어버리는 것을 의미한다. 이 같은 방법을 반복하면서 정확도를 유지하도록 한다.
  • Quantization은 일정 값으로 나누거나 대표값을 저장하는 것을 의미한다. 여기서는 대표값의 인덱스를 저장하여 비트수를 감소시킨다. 이러한 대표값은 quantization 과정의 동일 인덱스는 전부 동일 대표값을 사용하게 된다. 예를 들어, 밑의 그림에서 index 1은 전부 파란색 값을 사용하는 것과 같은 경우이다.

  • Quantization의 초기화는 uniform init이 가장 좋은 결과를 보여주는데, 그 이유는 다른 초기화 같은 경우는 크거나 작은 가중치를 고려하지 않는 결과가 발생하기 때문에 이 부분에서 정확도 감소가 일어난다고 한다.
  • 프루닝 또는 quantization만 사용한 경우보다 동시에 사용한 경우의 weight distribution이 좋게 나타나서 정확도 손실이나 모델 압축 측면에서 효과적이다.

 

 

Reference

Han, S., Mao, H., & Dally, W. J. (2015). Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149.
https://www.youtube.com/watch?v=9mFZmpIbMDs&list=PLWKf9beHi3Tg50UoyTe6rIm20sVQOH1br&index=72