ScratchDet: Exploring to Train Single-Shot Object Detectors from Scratch

Rui Zhu, Shifeng Zhang, Xiaobo Wang, Longyin Wen, Hailin Shi, Liefeng Bo, Tao Mei

Abstract

ScratchDet breaks the dependency of object detectors on ImageNet pretraining by integrating BatchNorm throughout the network and redesigning the backbone architecture. By smoothing the optimization landscape and preserving high-resolution features, it allows detectors to be trained from scratch to achieve state-of-the-art accuracy, even outperforming many models that rely on pretrained weights.

Introduction

In computer vision, the standard operating procedure involves taking a "backbone" network (like ResNet or VGG) pretrained on the ImageNet classification dataset and fine-tuning it for object detection. While effective, this approach introduces objective bias—classification favors translation invariance, while detection requires variance—and architecture rigidity. Previous attempts to train from scratch, such as DSOD, were often limited to specific architectures and struggled to match the performance of pretrained models.

Methodology: Optimization and Architecture

ScratchDet introduces two primary innovations to make training from scratch robust and high-performing: BatchNorm integration and the Root-ResNet backbone.

BatchNorm Integration and Optimization Stability

The authors discovered that the primary hurdle for training from scratch is a jagged optimization landscape. By adding Batch Normalization (BN) to every convolution layer in both the backbone and the detection heads, they smoothed this landscape. This allows for significantly higher learning rates (up to 10x), helping the model escape poor local minima and converge faster.

Optimization stability analysis: Loss, L2 Norm, and Fluctuation of Gradient across training steps.

Root-ResNet Backbone Design

Standard ResNets use a "heavy" first layer (7x7 convolution with stride 2) followed by max-pooling, which aggressively downsamples the image and destroys fine-grained information needed for small objects. ScratchDet replaces this with a "Root Block"—three stacked 3x3 convolutions with smaller strides—preserving more spatial detail from the original image. This architectural shift ensures that early-stage resolution, the "lifeblood" of accurate detection, is maintained.

Architectural overview of ScratchDet showing BN on detection heads and the stride configurations for ResNet and VGGNet backbones.

Key Insights and Results

The research highlights that adding BN to the detection subnetwork is crucial for stable gradients. Systematic analysis revealed that early-stage resolution is vital; removing the initial downsampling operation in ResNet-18 (changing stride 2 to stride 1) provided a massive boost in mAP.

ScratchDet was evaluated on PASCAL VOC and MS COCO benchmarks with impressive results:

  • PASCAL VOC 2007: Achieved 80.4% mAP, outperforming pretrained SSD300 (77.2%) and previous "from scratch" models.
  • MS COCO: Reached 39.1% AP, surpassing prominent pretrained models like Faster R-CNN and Deformable R-FCN.
  • Small Object Detection: ScratchDet's performance on small objects ($AP_S$) was significantly higher than its peers, validating the Root-ResNet design.

Conclusion

While ScratchDet eliminates the need for ImageNet pretraining, it increases training time for the detection task itself (e.g., 84.6 hours vs. 29.7 hours for fine-tuning on MS COCO). However, it provides a path toward architecture flexibility and domain-specific optimization. Future work may explore deeper backbones or apply these principles to other detection frameworks beyond SSD.

Summary updated

Abstract

Current state-of-the-art object objectors are fine-tuned from the off-the-shelf networks pretrained on large-scale classification dataset ImageNet, which incurs some additional problems: 1) The classification and detection have different degrees of sensitivity to translation, resulting in the learning objective bias; 2) The architecture is limited by the classification network, leading to the inconvenience of modification. To cope with these problems, training detectors from scratch is a feasible solution. However, the detectors trained from scratch generally perform worse than the pretrained ones, even suffer from the convergence issue in training. In this paper, we explore to train object detectors from scratch robustly. By analysing the previous work on optimization landscape, we find that one of the overlooked points in current trained-from-scratch detector is the BatchNorm. Resorting to the stable and predictable gradient brought by BatchNorm, detectors can be trained from scratch stably while keeping the favourable performance independent to the network architecture. Taking this advantage, we are able to explore various types of networks for object detection, without suffering from the poor convergence. By extensive experiments and analyses on downsampling factor, we propose the Root-ResNet backbone network, which makes full use of the information from original images. Our ScratchDet achieves the state-of-the-art accuracy on PASCAL VOC 2007, 2012 and MS COCO among all the train-from-scratch detectors and even performs better than several one-stage pretrained methods. Codes will be made publicly available at https://github.com/KimSoybean/ScratchDet.
BibTeX
@inproceedings{zhu2019scratchdet,
  author = {Rui Zhu and Shifeng Zhang and Xiaobo Wang and Longyin Wen and Hailin Shi and Liefeng Bo and Tao Mei},
  title = {{ScratchDet: Exploring to Train Single-Shot Object Detectors from Scratch}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.00237},
}
Figure