안녕, 세상!

SlimYOLOv3: Narrower, Faster and Better for Real-Time UAV Applications 논문리뷰 본문

It공부/딥러닝논문리뷰

SlimYOLOv3: Narrower, Faster and Better for Real-Time UAV Applications 논문리뷰

dev_Lumin 2022. 1. 7. 19:27

Abstarct

  • UAV의 카메라 시점에 의한 컴퓨터 비전에 관심이 많아짐
  • 하지만 UAV에서의 object detection을 실시간으로 처리하는 작업은 어려움
  • 마지막에는 channel scaling factor에 L1 Regulation을 적용시켜서 convolution 계층의
    channel-level 희소성(sparsity)을 적용시키고 ‘slim’한 object detectors을 얻기 위해서
    덜 중요한 feature channel을 제거함
  • fewer trainable parameters와 FLOPS를 original YOLOv3와 비교하여 제시함
  • SlimYolov3을 VisDrone2018-Det benchmark dataset으로 평가
  • unpruned 놈과 비교했을 때 FLOPS가 90.8%줄어들었고, parameter크기가 92% 줄었고
    running time이 2배 더 빠름

다른 pruning 비율에 대한 실험 결과는 더 작은 구조의 SlimYOLOv3가 기존 YOLOv3보다 더 효율적이고 빠르다고 일관적으로 확인해준다.

Introduction

challenging problems

(1) 어떻게 다양한 변화를 다룰것인가 (항공사진에서 객체의 시각적 외형에 대한)

(variation : illumination, view, small sizes and ration)

(2) 제한된 메모리와 computing power을 가진 기기에 어떻게 deploy 할지

(3) detection 정확도와 실시간 요구에 대한 균형을 어떻게 맞출지

주요 인기 있는 네트워크 구조

  • 수동적(manually)으로 설계되었고,
  • 그 구조들에서 각 구성요소의 중요성은 학습되기 전에 결정될 수 없음
  • Training 과정에서 network는 학습 가능한 계층의 weigth를 조절해가면서
    각 component의 중요성을 학습할 수 있음
  • 결과적을 network안의 몇몇 connection과 computations들은 불필요하거나 중요하지 않는 요소들이 될 수 있고 그러므로 성능에서 큰 저하 없이 제거될 수 있다.

→ 이러한 추정으로 model pruning 방식은 모델을 단순화시키는 데 사용됨

Channel Pruning

  • pruned model에 단지 구성 파일들 안의 대응되는 channel(or filter)의 개수를 수정함으로써
    적용하기 편리함

fine-tuning

  • 그 후에 잠재적 일시적 저하를 보충하기 위해서 pruned models에서 수행됨

→ 전문가에 의해 수동적으로 설계된 deep object detectors는 고유의 불필요한 중복성이 feature channels에 존재한다고 생각해서 parameter 크기와 FLOPS를 channel pruning으로 줄이려고 함

2. Related Work

2.1 Deep Object Detector

발전되면서 two-stage detectors와 single-stage detector로 구분됨

2-stage Detector

  • Regional Proposal과 Classification이 순차적으로 이뤄짐
  • Regional Proposal 진행 후 Classification 진행
  • 비교적 느리지만 정확도가 높음

Regional Proposal

  • 물체가 있을만한 영역을 빠르게 찾아내는 알고리즘
  • ex) Selective search : 비슷한 질감, 색, 강도를 갖는 인접 픽셀로 구성된 다양한 크기의 window를 생성)
  • object의 위치를 찾는 localization 문제

(기존의 sliding window의 방식은 모든 영역을 window로 탐색)

1-stage Detector

  • Regional Proposal과 Classification이 동싱 이뤄짐
  • ex) YOLO, SSD 계열
  • 비교적 빠르지만 정확도가 낮음

2.2 Model pruning

존재하는 model compression(모델 경량화) 방식은

  1. model pruning
  2. knowledge distillation
  3. parameter quantization
  4. dynamic computation

Model Pruning

model pruning 방식에서 deep models들로부터 제거되는 components는

독립적인 neural connection 혹은 네트워크 구조들 자체가 될 수 있음

Weight Pruning

  • small weights로 덜 중요한 연결을 제거함(prune)
  • 개념적으로 이해하기 쉽지만, pruned model을 기억하고(store) 빠르게 하는 것이 어려움
    → 생성된 불규칙한 네트워크 구조 때문
  • 기술적으로 weight pruning은 특별한 소프트웨어 라이브러리 혹은 그에 맞는 하드웨어가 pruned model을 지원하도록 설계되지 않는다면, 실제 applications에 적합하지 않을 수 있음

Structured pruning(channel pruning)

  • Weight pruning과 달리 structured pruning이 더 규칙적이고 다루기 쉬운 네트워크 구조를 생성할 가능성이 높음
  • structured pruning을 위한 structured unimportance를 얻기 위해서
    연구원들은 structured sparsity learning을 포함하고 있는 structured sparsity regularization을 가진 sparsity trainingchannel-wise scaling factors의 sparsity에 의지함
  • network slimming - 효율적인 channel pruning방식

network slimming

  • batch normalizationscaling factorschannel-wise scaling factors로서 채택함
  • scaling factorsL1 regularization을 사용하여 networks를 학습시킴
  • hardware과 software에 한정되지 않고 pruned models를 실행하기 편함

3. SlimYOLOv3

  • channel pruning을 YOLOv3에 적용하여 SlimYOLOv3을 얻음
  • 최소한의 수정으로 deep feature을 풍부하게(enrich) 하기 위해서 spatial pyramid pooling (SPP) module을 YOLOv3에 적용한 YOLOv3-SPP3가 있음

YOLOv3-SPP3

  • SPP 모듈은 kernel size가 각각 1x1, 5x5, 9x9, 13x13의 크기인 4개의 병렬 maxpool 계층으로
    구성되어 있음
  • SPP 모듈은 다른 receptive 영역을 가진 multiscale deep features을 추출하고
    feature maps의 channel dimension크기로 연결하여 이들을 통합할 수 있음
  • 같은 layer 내에서 얻은 multiscale features은 적은 computation cost로
    YOLOv3의 detection 정확도를 더 개선시킬 것이라고 기대함
  • SPP 모듈에서 소개된 additional feature channels은 추가적인 FLOPS를 줄이거나 refined 할 수 있음
  • SPP module을 YOLOv3의 각 detection header 앞의 5번째와 6번째 convolution 계층 사이에 넣어 통합함

Sparcity training

  • 모델의 channel-wise sparsity는 channel pruning과
    후에 제거될 잠재력이 있는 덜 중요한 channel들의 수를 설명하는데 도움이 됨
  • channel pruning을 사용하기 위해서 scaling factors을 각 channel마다 할당함
  • scaling factors의 절댓값이 channel의 중요도를 나타냄(denote)
  • detection header를 제외하고 BN layer는 YOLOv3의 각 convolution layer 후 적용

BN Layer

  • $\gamma$ : trainable scale factors
  • $\beta$ : bias
  • ${\sigma}^2$ : mini-batch안의 input features의 variance(변화량)
  • $\bar{x}$ : mini-batch안의 input features의 mean(평균)

BN Layer들 안의 trainable 한 scale factors은 channel의 중요도를 나타나는데 사용됨

L1 normarlization

  • 중요하지 않는 channel들로부터 중요한 channel을 효과적으로 구분하기 위해서,
    $\gamma$(trainable scale factor)에 대해서 L1 regularization을 부과함으로써
    channel-wise sparsity training을 수행함

  • $f(\gamma)=abs(\gamma)$ : L1-norm
  • $\alpha$ : penalty factor (두 loss 사이의 간격을 균형 맞추는 요소)

Channel pruning

  • $\hat{\gamma}$ : gloab threshold - feature channel이 제거될지 말지 결정
  • pruning ratio를 통제하기 위해서$\hat{\gamma}$ 는 모든 $abs(\gamma)$에 대해서 n-th percentile로 설정됨
  • $\pi$ : safety threshold
    • convolution 계층에서의 over-pruning을 예방하고 network연결의 완전성을 유지하기 위함
    • 특정 layer의 모든 $abs(\gamma)$의 k-th percentile로 층마다 설정
  • $\hat{\gamma}$ 의 최소와 $\pi$ 보다 작은 scaling factors를 가진 feature channels를 제거
  • maxpool layer과 upsample layer은 channel수와 연관이 없기 때문에 pruning 과정에서 버림
    (안 쓴다는 의미인듯)

fine-tuning

  • channel pruning 이후 잠재적 일시적 저하를 보상하기 위해서 pruned models에 수행되도록
    제안됨

Iteratively pruning

  • over-pruning을 방지하기 위해 incremental pruning

4. Experiments

4.1 Datasets

VisDrone2018-Det dataset consists of 7,019 static images captured by drone platforms in different
places at different height

4.2 Models

  • YOLOv3-SPP1 : 수정된 YOLOv3로 첫 번 째 detector header의 앞에 SPP module이 1개
    • YOLOv3보다 COCO 데이터셋에 대해서 detection accuracy가 좋음
  • YOLOv3-SPP3 : YOLOv3의 3개의 detector header 앞에 5th와 6th convolution 사이 3개의 SPP module을 통합(incorporating)하여 구현됨
  • SlimYOLOv3
    • channel pruning module의 global threshold $\hat{\gamma}$를 모든 $abs(\gamma)$의 50%, 90%, 95%의 pruning ration를 각각 적용한 3개의 모델을 구현
    • local safety threshold $\pi$는 90% 적용한 모델의 각 layer에서 경험적으로 적용
      (단일 layer에 unpruned 된 channel을 최소 10% 유지하기 위해)

4.3 Training

Sparsity training

  • 100 epochs의 학습 진행
  • penalty factor $\alpha$에 대해 0.01, 0.001, 0.0001 세 개의 다른 값에 대해 실험

5. Results and Discussion

SPP Module의 효과

  • 416x416, 608x608에 대해서 SPP3와 SPP1을 비교했을 때 detection performance가 성능 차이가 거의 안 났지만 더 큰 input인 832x832일 경우에 mAP와 F1-score에 대해서 차이가 outperforms 할 수 있는 것을 확인할 수 있음

SPP 모듈고해상도 이미지 안에서의 다른 크기의 receptive fields를 통해서 유용한 multiscale deep feature를 detectors가 추출하도록 도와준다는 것임

  • SPP module이 추가되면서 trainable parameter과 FLOPS는 증가되지만 무시할 수 있는 수치

Sparsity training의 효과

→ Scaling factor의 분포의 변화와 YOLOv3-SPP3의 sparsity training 동안의 loss 그래프

  • 학습 과정에서 상대적으로 작은 scaling factors의 수가 증가하는 반면
    scaling factors의 수는 감소함
  • sparsity 학습은 scaling factors 값을 효율적으로 줄일 수 있고 convolution layers의 feature channel을 부족하게 만듦
  • $\alpha=0.01$ 인 경우 scaling factors을 너무 급하게 감소시켜서 모델이 underfitting으로 돼버림
  • 실험에서는 $\alpha=0.001$ 로 진행

channel pruning의 효과

  • FLOPS와 parameter size를 줄임
Comments