A Simple Baseline for Object Detection based on CenterNet with ResNet backbone.
CenterNet is a very simple yet efficient object detector. Based on this supreme work, I rebuild it with PyTorch.
CenterNet is an encoder-decoder network, but I won't consider Hourglass-101 in this project as it is heavy and time consuming.
I will try DLA-34 in the future, but let us focus ResNet for now.
You can download all my models from my BaiDuYunDisk:
Link: https://pan.baidu.com/s/1yaAhIT6NErzv_QaDHqfYrg
Password: zr8m
I will upload them to Google Drive.
For backbone, I use ResNet including ResNet-18, ResNet-50 and ResNet-101. I also make use of DarkNet-53 and CSPDarkNet-53 reproduced by myself with PyTorch.
For neck, I use the DilateEncoder proposed by YOLOF. DCN or DCNv2 don't be considered as they are not easy to deploy.
For decoder, I just use nearest interpolate following a convolutional layer rather than deconvolutional layer to avoid the effect of checkerboard.
For detection head, there are totally 4 branches including class branch, offset(tx and ty) branch, size(tw and th)
branch and iou-aware branch. During training stage, how to get the labels of offset and size is different from
CenterNet. For more details, see my codes in tools.py
file.
The whole structure of my CenterNet-plus is shown in the following picture:
I dont deploy any DCN in my CenterNet-plus.
For example, you can use the following line of command to train my CenterNet-plus with ResNet-18 backbone.
python train.py -d coco --cuda --ema -bk r18
Experimental results on COCO:
backbone | data | size | AP | AP50 | AP75 | AP_S | AP_M | AP_L | |
CenterNet-plus | ResNet-18 | COCO val | 512x512 | 29.9 | 49.1 | 31.8 | 14.4 | 31.0 | 43.1 |
CenterNet-plus | ResNet-50 | COCO val | 512x512 | 36.0 | 56.2 | 38.9 | 18.7 | 38.9 | 51.1 |
CenterNet-plus | ResNet-101 | COCO val | 512x512 | 37.5 | 57.7 | 41.0 | 19.5 | 41.4 | 53.0 |
CenterNet | ResNet-18 | COCO val | 512x512 | 28.1 | 44.9 | 29.6 | - | - | - |
CenterNet | ResNet-101 | COCO val | 512x512 | 34.6 | 53.0 | 36.9 | - | - | - |
CenterNet | DLA-34 | COCO val | 512x512 | 37.4 | 55.1 | 40.8 | - | - | - |
CenterNet | Hourglass-104 | COCO val | 512x512 | 40.3 | 59.1 | 44.0 | - | - | - |
With ResNet backbone, my CenterNet-plus works better.
- multi scale training
- mosaic augmentation
When I use multi-scale training trick, my CenterNet-plus with ResNet18 got 25 AP lower than 29.9 AP.
When I use mosaic augmentation, my CenterNet-plus with ResNet18 got only 25 AP.
- Replace txtytwth by GIoU to learning regression.
- Add more positive samples to accelerated training.
- Large image size: 640.
- Try DLA-34 backbone.
- DDP training mode.