ResNet and ResNet_vd series

December 7, 2021 ยท View on GitHub


Catalogue

1. Overview

The ResNet series model was proposed in 2015 and won the championship in the ILSVRC2015 competition with a top5 error rate of 3.57%. The network innovatively proposed the residual structure, and built the ResNet network by stacking multiple residual structures. Experiments show that using residual blocks can improve the convergence speed and accuracy effectively.

Joyce Xu of Stanford university calls ResNet one of three architectures that "really redefine the way we think about neural networks." Due to the outstanding performance of ResNet, more and more scholars and engineers from academia and industry have improved its structure. The well-known ones include wide-resnet, resnet-vc, resnet-vd, Res2Net, etc. The number of parameters and FLOPs of resnet-vc and resnet-vd are almost the same as those of ResNet, so we hereby unified them into the ResNet series.

The models of the ResNet series released this time include 14 pre-trained models including ResNet50, ResNet50_vd, ResNet50_vd_ssld, and ResNet200_vd. At the training level, ResNet adopted the standard training process for training ImageNet, while the rest of the improved model adopted more training strategies, such as cosine decay for the decline of learning rate and the regular label smoothing method,mixup was added to the data preprocessing, and the total number of iterations increased from 120 epoches to 200 epoches.

Among them, ResNet50_vd_v2 and ResNet50_vd_ssld adopted knowledge distillation, which further improved the accuracy of the model while keeping the structure unchanged. Specifically, the teacher model of ResNet50_vd_v2 is ResNet152_vd (top1 accuracy 80.59%), the training set is imagenet-1k, the teacher model of ResNet50_vd_ssld is ResNeXt101_32x16d_wsl (top1 accuracy 84.2%), and the training set is the combination of 4 million data mined by imagenet-22k and ImageNet-1k . The specific methods of knowledge distillation are being continuously updated.

The FLOPs, parameters, and inference time on the T4 GPU of this series of models are shown in the figure below.

As can be seen from the above curves, the higher the number of layers, the higher the accuracy, but the corresponding number of parameters, calculation and latency will increase. ResNet50_vd_ssld further improves the accuracy of top-1 of the ImageNet-1k validation set by using stronger teachers and more data, reaching 82.39%, refreshing the accuracy of ResNet50 series models.

2. Accuracy, FLOPs and Parameters

ModelsTop1Top5Reference
top1
Reference
top5
FLOPs
(G)
Parameters
(M)
ResNet180.7100.8990.6960.8913.66011.690
ResNet18_vd0.7230.9084.14011.710
ResNet340.7460.9210.7320.9137.36021.800
ResNet34_vd0.7600.9307.39021.820
ResNet34_vd_ssld0.7970.9497.39021.820
ResNet500.7650.9300.7600.9308.19025.560
ResNet50_vc0.7840.9408.67025.580
ResNet50_vd0.7910.9440.7920.9468.67025.580
ResNet50_vd_v20.7980.9498.67025.580
ResNet1010.7760.9360.7760.93815.52044.550
ResNet101_vd0.8020.95016.10044.570
ResNet1520.7830.9400.7780.93823.05060.190
ResNet152_vd0.8060.95323.53060.210
ResNet200_vd0.8090.95330.53074.740
ResNet50_vd_ssld0.8240.9618.67025.580
ResNet50_vd_ssld_v20.8300.9648.67025.580
Fix_ResNet50_vd_ssld_v20.8400.97017.69625.580
ResNet101_vd_ssld0.8370.96716.10044.570
  • Note: ResNet50_vd_ssld_v2 is obtained by adding AutoAugment in training process on the basis of ResNet50_vd_ssld training strategy.Fix_ResNet50_vd_ssld_v2 stopped all parameter updates of ResNet50_vd_ssld_v2 except the FC layer,and fine-tuned on ImageNet1k dataset, the resolution is 320x320.

3. Inference speed based on V100 GPU

ModelsCrop SizeResize Short SizeFP32
Batch Size=1
(ms)
ResNet182242561.499
ResNet18_vd2242561.603
ResNet342242562.272
ResNet34_vd2242562.343
ResNet34_vd_ssld2242562.343
ResNet502242562.939
ResNet50_vc2242563.041
ResNet50_vd2242563.165
ResNet50_vd_v22242563.165
ResNet1012242565.314
ResNet101_vd2242565.252
ResNet1522242567.205
ResNet152_vd2242567.200
ResNet200_vd2242568.885
ResNet50_vd_ssld2242563.165
ResNet101_vd_ssld2242565.252

4. Inference speed based on T4 GPU

ModelsCrop SizeResize Short SizeFP16
Batch Size=1
(ms)
FP16
Batch Size=4
(ms)
FP16
Batch Size=8
(ms)
FP32
Batch Size=1
(ms)
FP32
Batch Size=4
(ms)
FP32
Batch Size=8
(ms)
ResNet182242561.35682.52253.619041.456063.563056.28798
ResNet18_vd2242561.395932.690633.882671.545573.853636.88121
ResNet342242562.230924.102055.549042.349575.8982110.73451
ResNet34_vd2242562.239924.222465.795342.434276.2225711.44906
ResNet34_vd2242562.239924.222465.795342.434276.2225711.44906
ResNet502242562.638244.638027.024443.477127.8442113.90633
ResNet50_vc2242562.670644.723727.172043.523468.1072514.45577
ResNet50_vd2242562.651644.841097.462253.531318.0905714.45965
ResNet50_vd_v22242562.651644.841097.462253.531318.0905714.45965
ResNet1012242565.040377.7367310.89366.0712513.4057324.3597
ResNet101_vd2242565.059727.8368511.342356.1170413.7622225.11071
ResNet1522242567.2866510.6200114.903178.5019819.1707335.78384
ResNet152_vd2242567.2912710.8613715.324448.5437619.5215736.64445
ResNet200_vd2242569.3602613.547419.072510.8061925.0173148.81399
ResNet50_vd_ssld2242562.651644.841097.462253.531318.0905714.45965
ResNet50_vd_ssld_v22242562.651644.841097.462253.531318.0905714.45965
Fix_ResNet50_vd_ssld_v23203203.428187.5153413.193705.0769614.6421827.01453
ResNet101_vd_ssld2242565.059727.8368511.342356.1170413.7622225.11071