Source-linked AI summary

SNIPER: Efficient Multi-Scale Training

Bharat Singh, Mahyar Najibi, Larry S. Davis

arXiv:1805.09300v3cs.CV

TL;DR

Multi-scale detector 학습은 비용이 큰 image pyramid를 처리하므로, 고해상도 전체 이미지가 정말 필요한지 의문을 제기한다. SNIPER는 대신 instance와 proposal 주변에서 scale에 맞는 chip을 샘플링해, 비슷하거나 더 높은 정확도를 달성하면서 학습 속도를 3배 높인다.

  • 문제

    Multi-scale recognition 방법은 전체 image pyramid를 처리하므로, 더 작은 scale-appropriate region으로 고해상도 전체 이미지 처리를 대체할 수 있는지 검토하게 된다.

  • 방법

    SNIPER는 ground-truth instance와 region proposal을 사용해 여러 image-pyramid scale에서 positive 및 negative chip을 적응적으로 샘플링한다.

  • 결과

    batch normalization을 사용하면 3배 빠른 학습을 달성하며, SNIPER는 보고된 모든 metric에서 SNIP을 유의하게 능가한다.

  • 시사점 및 한계

    SNIPER는 단일 GPU에서 large-batch 학습을 가능하게 해 instance-level recognition 학습을 image-classification protocol에 더 가깝게 만든다.

  • 시사점 및 한계

    backbone, pretraining data, network structure, test-time augmentation이 서로 달라 다른 detector와의 비교는 어렵다.

Abstract

from arXiv · show

We present SNIPER, an algorithm for performing efficient multi-scale training in instance level visual recognition tasks. Instead of processing every pixel in an image pyramid, SNIPER processes context regions around ground-truth instances (referred to as chips) at the appropriate scale. For background sampling, these context-regions are generated using proposals extracted from a region proposal network trained with a short learning schedule. Hence, the number of chips generated per image during training adaptively changes based on the scene complexity. SNIPER only processes 30% more pixels compared to the commonly used single scale training at 800x1333 pixels on the COCO dataset. But, it also observes samples from extreme resolutions of the image pyramid, like 1400x2000 pixels. As SNIPER operates on resampled low resolution chips (512x512 pixels), it can have a batch size as large as 20 on a single GPU even with a ResNet-101 backbone. Therefore it can benefit from batch-normalization during training without the need for synchronizing batch-normalization statistics across GPUs. SNIPER brings training of instance level recognition tasks like object detection closer to the protocol for image classification and suggests that the commonly accepted guideline that it is important to train on high resolution images for instance level visual recognition tasks might not be correct. Our implementation based on Faster-RCNN with a ResNet-101 backbone obtains an mAP of 47.6% on the COCO dataset for bounding box detection and can process 5 images per second during inference with a single GPU. Code is available at https://github.com/MahyarNajibi/SNIPER/.

1 서론

Multi-scale instance recognition에서는 고해상도 image pyramid 전체를 처리하는 데 드는 비용 때문에 계산량, 문맥, negative mining 사이의 균형이 필요하다. SNIPER는 관련 객체 주변에서 적절한 해상도의 작은 chip을 적응적으로 샘플링해 이 절충 문제를 다룬다.

  • 동기: 사람의 시각은 이 문제를 잘 보여준다. 주의는 작은 시야에 제한되며, 서로 다른 scale의 객체를 동시에 처리하기 어렵다.Computer instance-recognition algorithm은 이러한 제약에도 불구하고 여러 scale에 걸친 시각 콘텐츠를 처리해야 한다.
  • 관련 연구: 선행 연구에 따르면 극단적인 해상도의 객체에서 오는 gradient를 무시하면 multi-scale training에 도움이 될 수 있다.세 scale image pyramid에서는 큰 해상도의 큰 객체와 작은 해상도의 작은 객체에서 오는 gradient를 무시해야 한다.
  • 동기: 서론에서는 모든 scale에서 전체 image를 처리해야 하는지 의문을 제기하고, 대신 객체 주변의 더 작은 관심 영역을 제안한다.또한 이미 고해상도인 image에서 큰 객체를 포함한 영역을 upsampling하는 것이 유용한 이점을 제공하는지도 묻는다.
  • 동기: SNIPER는 multi-scale training을 가속할 때 계산량, 문맥 정보, negative mining 사이에 존재하는 절충에서 출발한다.작은 chip은 계산량을 줄이지만 인식에 필요한 문맥과 background를 누락할 수 있다.
  • 기여: SNIPER는 효율적인 multi-scale instance recognition을 위해 chip을 적응적으로 샘플링하는 training algorithm으로 소개된다.이 접근법은 불필요한 image 처리를 줄이면서 필요한 문맥을 보존하도록 설계되었다.

2 배경

Object detection은 R-CNN의 proposal별 canonical resizing에서 image pyramid를 처리하는 방법으로 발전했지만, multi-scale training은 모든 proposal 또는 거의 모든 pixel을 resampling하면서 계산을 낭비할 수 있다. SNIPER는 대신 scale에 적합한 context chip을 샘플링하고 proposal-guided background chip을 사용해 관련 영역에 training을 집중한다.

  • 기존 detector: R-CNN [11]은 CNN classification 을 위해 object proposal을 canonical 224x224 image로 resize했지만, training 및 inference cost는 proposal 수에 따라 선형적으로 증가했다.초기 proposal은 unsupervised algorithm [34]으로 생성되었다.
  • 기존 detector: Fast-RCNN의 multi-scale training은 every proposal을 resample한 반면, R-CNN은 object를 포함할 가능성이 높은 region만 적절한 resolution으로 resize했다.이 차이는 모든 image pixel을 resample하기보다 region-focused processing을 수행하는 동기가 된다.
  • Multi-scale training: SNIP 은 여전히 image pyramid의 거의 모든 pixel을 사용해 training하면서 extreme-resolution object에서 발생한 gradient는 무시한 반면, SNIPER는 세 pyramid scale에서 512-pixel crop을 샘플링했다.SNIP은 480- 및 800-pixel resolution과 1400-pixel resolution에서 추출한 여러 1000-pixel crop을 사용했다.
  • SNIPER: SNIPER는 object 주변의 context chip을 adaptively select하고 object size에 따라 upsampling 또는 downsampling을 조정한다.이 figure는 각 scale에서 covered object와 invalid object를 구분한다.
  • SNIPER: Background region의 경우, SNIPER는 short schedule로 training한 lightweight RPN이 식별한 false-positive 가능성이 높은 영역에서 최대 두 개의 chip을 샘플링한다.이 proposal mechanism은 EdgeBoxes 와 같은 unsupervised proposal로 대체할 수도 있다.

3 SNIPER

SNIPER는 전체 image pyramid를 처리하는 대신 ground-truth instance와 false-positive 가능성이 높은 영역을 포괄하도록 선택한 multi-scale 512x512 chip에서 detection network를 학습한다. 이러한 adaptive sampling은 end-to-end Faster-RCNN 방식의 학습과 batch packing을 유지하면서 high-resolution 연산을 줄인다.

  • Positive chip mining: SNIPER는 resized image canvas에서 32-pixel 간격으로 multi-scale chip을 생성하고, 각 ground-truth box를 해당 box가 포함되는 area range를 가진 scale에 할당한 뒤 valid box를 greedy하게 포괄한다.모든 ground-truth box는 적절한 scale에서 포괄되며, 겹치는 scale range로 인해 하나의 instance가 여러 scale 또는 chip에 할당될 수 있다.
  • Negative chip mining: Negative chip은 positive chip으로 포괄되지 않은 RPN proposal에서 채굴하며, 최소 M개의 proposal을 포괄하는 영역을 선택하고 image 및 epoch마다 고정된 개수를 무작위로 sampling한다.초기 RPN은 negative chip 없이 짧게 학습되며, false positive 가능성이 높은 영역을 대략적으로 선택하도록 유도하는 역할만 한다.
  • Label assignment: SNIPER는 Faster-RCNN처럼 end to end로 학습하며, 각 chip 내부의 모든 ground-truth box에서 label과 regression target을 할당하고 scale의 valid area range 바깥에 있는 proposal은 무시한다.Crop된 ground-truth box는 chip 내부에 남아 있으며, proposal은 해당 chip에 존재하는 ground truth를 대상으로 학습된다.
  • Benefits of SNIPER: 800x1333 single-scale training보다 30% more pixels를 처리하지만, 학습에서는 세 개의 scale에 걸쳐 COCO image당 약 5개의 512x512 chip을 사용한다.Chip의 크기가 고정되어 있으므로 GPU utilization을 위한 data packing이 더 효율적이며, chip이 image보다 10x 이상 작기 때문에 high-resolution background를 대부분 피할 수 있다.
  • Benefits of SNIPER: OpenImagesV4에서 SNIPER는 scales (512/ms, 1)로부터 3.5 million개의 512x512 chip을 생성하며, adaptive downsampling을 통해 큰 object를 upsampling할 필요를 줄인다.더 작은 scale에서는 chip이 더 많은 background를 포괄하므로 negative sampling의 영향이 감소한다.

4 실험 세부 사항

SNIPER는 3개 스케일의 chip 기반 학습 설정과 Faster R-CNN detector를 사용해 COCO에서 평가된다. Negative chip mining은 detection mAP를 향상시키며, 고해상도 image-pyramid 스케일에서도 효율적인 학습과 추론을 유지한다.

  • 학습 설정: SNIPER는 512×512 chip, batch size 128, learning rate 0.015, 3개 스케일, 6개 epoch, image flipping을 사용해 COCO에서 학습된다.학습 스케일은 (512/ms, 1.667, 3)이고, 목표 area range는 각각 (0,802), (322,1502), (1202, inf)이다.
  • Chip 생성: SNIPER는 flipping 후 1.2 million chip을 생성하며, image당 평균 약 5개의 chip을 사용하고 scene complexity에 따라 1개에서 10개까지 조정한다.이 adaptive sampling은 full-resolution training에 비해 instance-level gradient의 불균형을 줄인다.
  • Proposal 생성: false positive를 무시하고 positive chip이 모든 ground-truth instance를 포함하므로, negative sampling이 없어도 RPN recall은 변하지 않는다.따라서 proposal generation에는 positive-only training으로 충분하지만, detection mAP에는 negative mining이 여전히 중요하다.
  • Negative Chip Mining: Negative chip mining은 localization threshold와 object size 전반에서 average precision을 43.4에서 46.1로 향상시킨다.비교 대상은 다른 모든 parameter를 동일하게 유지한 SNIPER without negative chips이며, negative mining은 false positive를 줄인다.
  • 효율성: End-to-end training은 8개의 V100 GPU에서 14시간이 걸리고, RPN pre-training은 2시간이 걸리며, inference는 V100 1개에서 초당 약 5 images에 도달한다.학습에는 3개의 image-pyramid 스케일이 사용된다: maximum size 512, 1.667, 3.
  • 결과: 단일 V100 GPU에서 초당 5개 이미지를 처리하면서 47.6% mAP를 달성한다.효율적인 batch inference를 사용한 결과로, 실용적인 고해상도 image-pyramid inference를 보여준다.

5 관련 연구

SNIPER는 batch normalization, large-batch training, scale-aware sampling, multi-scale context modeling에 관한 기존 연구 결과를 기반으로 한다. 또한 그 결과는 high-performance object-detector training에서 context가 기존에 강조된 것만큼 중요하지 않을 수 있음을 시사한다.

  • 관련 기법: SNIPER는 batch-normalization statistics [22]와 object detection에 효과적인 것으로 앞서 입증된 large batch sizes 의 이점을 활용한다.이러한 기법은 SNIPER의 향상된 성능에 중요한 기여 요인으로 확인된다.
  • 관련 기법: 기존 연구에서는 context [38] [1], scale [5] [20], sampling [21] [2] [3], 그리고 multi-scale information을 인코딩하는 architectures [23]를 연구했다.이 대목은 이러한 연구를 visual recognition 연구 전반에서 확립된 방향으로 제시한다.
  • 시사점: SNIPER의 결과는 high-performance object detectors를 학습하는 데 context가 그다지 중요하지 않을 수 있음을 시사한다.이 결론은 classification을 위한 context와 multi-scale feature encoding에 기존에 상당한 비중이 부여되어 왔다는 점과 대조된다.

6 결론 및 향후 연구

SNIPER는 저해상도 chip sampling을 통해 detector 성능 저하 없이 multi-scale training을 3× 가속하고, 단일 GPU에서 큰 batch를 사용할 수 있게 한다. 향후 연구에서는 더 빠른 multi-scale inference와 chip context가 detection을 저해하기 시작하는 조건을 규명하는 것을 목표로 한다.

  • 결론: detector 성능 저하 없이 multi-scale image pyramid에서 저해상도 chip을 sampling함으로써 3× 가속을 달성한다.효과적인 positive 및 negative chip sampling이 이러한 효율성 향상을 뒷받침한다.
  • 결론: 단일 GPU에서 큰 batch size를 사용할 수 있어 SNIPER는 기존의 high-resolution instance-recognition training보다 image-classification training protocol에 가까워진다.SNIPER는 re-sampled 저해상도 chip을 처리하므로 이러한 training configuration이 가능하다.
  • 향후 연구: 향후 연구에서는 background computation을 제거해 multi-scale inference를 가속하고, chip context가 detector 성능을 저해하기 시작하는 조건을 평가한다.저자들은 상당한 부분의 background를 고비용 computation 없이 제거할 수 있다고 지적한다.
Loading 1805.09300v3…