Home

Awesome

Cross-Iteration Batch Normalization

By Zhuliang Yao, Yue Cao, Shuxin Zheng, Gao Huang, Stephen Lin.

This repo is an official implementation of "Cross-Iteration Batch Normalization" on COCO object detection based on open-mmlab's mmdetection. This repository contains a PyTorch implementation of the CBN layer, as well as some training scripts to reproduce the COCO object detection and instance segmentation results reported in our paper.

Introduction

CBN is initially described in arxiv. A well-known issue of Batch Normalization is its significantly reduced effectiveness in the case of small mini-batch sizes. Here we present Cross-Iteration Batch Normalization (CBN), in which examples from multiple recent iterations are jointly utilized to enhance estimation quality. A challenge is that the network activations from different iterations are not comparable to each other due to changes in network weights. We thus compensate for the network weight changes via a proposed technique based on Taylor polynomials, so that the statistics can be accurately estimated. On object detection and image classification with small mini-batch sizes, CBN is found to outperform the original batch normalization and a direct calculation of statistics over previous iterations without the proposed compensation technique.

Citing CBN

@article{zhu2020CBN,
  title={Cross-Iteration Batch Normalization},
  author={Yao, Zhuliang and Cao, Yue and Zheng, Shuxin and Huang, Gao and Lin, Stephen},
  journal={arXiv preprint arXiv:2002.05712},
  year={2020}
}

Main Results

BackboneMethodNormAP<sup>b</sup>AP<sup>b</sup><sub>0.50</sub>AP<sup>b</sup><sub>0.75</sub>AP<sup>m</sup>AP<sup>m</sup><sub>0.50</sub>AP<sup>m</sup><sub>0.75</sub>Download
R-50-FPNFaster R-CNN-36.857.939.8---model
R-50-FPNFaster R-CNNSyncBN37.558.440.6---model
R-50-FPNFaster R-CNNGN37.759.241.2---model
R-50-FPNFaster R-CNNCBN37.658.540.9---model
R-50-FPNMask R-CNN-37.658.541.034.055.236.2model
R-50-FPNMask R-CNNSyncBN38.558.942.034.355.736.7model
R-50-FPNMask R-CNNGN38.559.441.835.056.437.3model
R-50-FPNMask R-CNNCBN38.458.942.234.755.937.0model

*All results are trained with 1x schedule. Normalization layers of backbone are fixed by default.

Installation

Please refer to INSTALL.md for installation and dataset preparation.

Demo

Test

Download the pretrained model

# Faster R-CNN
python tools/test.py {configs_file} {downloaded model} --gpus 4 --out {tmp.pkl} --eval bbox
# Mask R-CNN
python tools/test.py {configs_file} {downloaded model} --gpus 4 --out {tmp.pkl} --eval bbox segm

Train Mask R-CNN

One node with 4GPUs:

# SyncBN
./tools/dist_train.sh ./configs/cbn/mask_rcnn_r50_fpn_syncbn_1x.py 4
# GN
./tools/dist_train.sh ./configs/cbn/mask_rcnn_r50_fpn_gn_1x.py 4
# CBN
./tools/dist_train.sh ./configs/cbn/mask_rcnn_r50_fpn_cbn_buffer3_burnin8_1x.py 4

TODO

Thanks

This implementation is based on mmdetection. Ref to this link for more details about mmdetection.