Paper · 2021-07-01 · cs.CV
CBNet: A Composite Backbone Network Architecture for Object Detection
CBNet chains identical pretrained backbones, passing each stage's features to the next backbone through dense higher-level connections, with no new pretraining. Auxiliary heads on the earlier backbones add training signal; only the lead's features reach the detector head. Author-reported: 59.4 box AP and 51.6 mask AP on COCO test-dev, Swin-L with HTC, single scale.
Object detectionMulti-scale feature fusionDeep supervisionobject-detectionbackbone-networkcomposite-architectureauxiliary-supervisionpretrained-backbone-reuse
arXivPDFCodeMarkdown19 min read
AI-compiled by claude-haiku-5-5 on 2026-11-06, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
An object detector is only as good as the image features its backbone produces, and the usual way to get better features is a bigger network, which costs more to train and to run. This paper asks whether you can get more out of a backbone you already have, such as a ResNet or Swin model pretrained on ImageNet.
The answer it proposes is to run several copies of the same pretrained backbone side by side, in a chain. Each copy passes its intermediate features forward to the next copy, so the last copy sees a mix of what the earlier copies computed. Only the last copy's features go to the detector's head. The earlier copies also get their own detection branch during training, so they learn useful features too. Those extra heads are thrown away at test time.
The point is that the copies reuse weights you already have, so the paper does not need a new large pretraining run. The cost is that the chain still runs every copy at test time, so the network is not free to run.
TL;DR
- CBNet groups K identical pretrained backbones (K ≥ 2), linked by composite connections that pass each stage's output to the next backbone's stages §3.1.
- The main variant, CBNetV2, uses dense higher-level composition, auxiliary supervision on the assisting backbones, and a pruning option §3.5.
- It is author-reported to beat the same backbone alone by about 3.4 to 3.5 AP on Faster R-CNN, and it is claimed to beat wider and deeper backbones at similar cost §4.3.1.
- The paper reports 59.4 box AP and 51.6 mask AP on COCO test-dev (single scale) with Swin-L and HTC in 12 epochs §4.2.2.
- Relevant if you already have a pretrained backbone and want more accuracy without new ImageNet pretraining. Check the compute cost: the composite connections add FLOPs.
Problem
Detectors gain accuracy from stronger backbones, but designing a new backbone takes expertise and many trials, and pretraining a large one on ImageNet is expensive. Training a detector from scratch avoids pretraining but needs more compute and skill §1. The paper targets the case of reusing existing open-source pretrained backbones under the pretrain-then-fine-tune recipe, without additional pretraining of the composite §1.
Method
Architecture of CBNet
CBNet has K identical backbones, K ≥ 2. The case K = n is written CB-Backbone-Kn and the suffix is dropped for K = 2 §3.1. The last backbone B_K is the lead. The others B_1 … B_{K-1} are assisting §3.1 fig. 1.
Each backbone has L stages, usually L = 5. A standard network computes the stage output x^l = F^l(x^{l-1}) eq. 1. In CBNet, each stage of backbone k also receives a composed copy of the previous backbone's features eq. 2:
x_k^l = F_k^l\big(x_k^{l-1} + g^{l-1}(\boldsymbol{x_{k-1}})\big), \quad l \ge 2,\; k = 2, \ldots, K eq. 2
Here g^{l-1} is the composite connection. It takes all stage outputs of backbone k−1 and returns a tensor with the same size as x_k^{l-1} §3.1. The stage-1 outputs x_1^1 … x_K^1 are weight-shared §3.1. For detection, only the lead's stage outputs x_K^i (i = 2 … L) go to the neck and head. The assisting outputs go only to the next backbone §3.1. The assisting backbones can be any pretrained model, such as ResNet, ResNeXt, Res2Net or Swin, and each can be initialised from the same single pretrained checkpoint §3.1.
Composite strategies
The paper defines five ways to write g §3.2. U is up-sampling and D is down-sampling. w is defined as a 1×1 convolution plus batch normalisation only for SLC; the other strategies reuse the symbol without defining it §3.2.1.
- Same-level (SLC): g^l(x) = w(x^l), l ≥ 2 §3.2.1. Uses only the matching stage.
- Adjacent higher level (AHLC): g^l(x) = U(w(x^{l+1})), l ≥ 1 §3.2.2. This is the composition in the earlier CBNet paper §3.5.
- Adjacent lower level (ALLC): g^l(x) = D(w(x^{l-1})), l ≥ 2 §3.2.3.
- Dense higher level (DHLC): g^l(x) = Σ_{i=l+1}^{L} U(w_i(x^i)), l ≥ 1 §3.2.4 eq. 6. Sums every higher-level stage of the previous backbone.
- Fully connected (FCC): sums resized features from all stages of the previous backbone, using D when the source stage is deeper than the target and U when it is shallower §3.2.5 eq. 7.
The recommended choice is DHLC, which the paper picks for its computational simplicity §4.6.1. Its proposed form is:
g^l(x) = \sum_{i=l+1}^{L} U\big(w_i(x^i)\big), \quad l \ge 1 eq. 6
Index convention: eq. 6 writes g^l for the input of stage l+1, so the sum starts at l+1. In the released code the sum for the input of each stage includes that stage's own level (see Paper vs code).
Auxiliary supervision
Assisting backbones also get a detection branch during training. The paper applies the same neck and head weights to each backbone's output, so the two branches share parameters §3.3 fig. 4. The total training loss is:
\mathcal{L} = \mathcal{L}_{\mathrm{Lead}} + \sum_{i=1}^{K-1} \lambda_i \cdot \mathcal{L}_{\mathrm{Assist}}^{i} eq. 8
λ_i weights the i-th assisting backbone §3.3. At inference the auxiliary branch is dropped and only the lead's features are used, so the paper says it does not change inference speed §3.3. The assisting backbones still run, because the composite connections need their features (see Pitfalls).
Pruning
To cut cost, the paper prunes stages in backbones 2 … K instead of composing them in full §3.4. It names the configurations s_i, where i is the number of stages kept in backbones 2 … K: stages j with 6 − i ≤ j ≤ 5 are kept. Pruned stages are filled with the features of the same stage from the first backbone §3.4 fig. 5. The paper's default for CBNetV2 is s_3 §4.6.5. The paper argues pruning costs little accuracy because the pruned stage's weights are fixed during detector training. It says s_3 has about 10 % fewer FLOPs than s_4 with a 0.1 AP drop §4.6.3, but this comparison appears only in a figure fig. 6.
Detection network
CBNet attaches to any detector without changing its head. The lead backbone's outputs go into an FPN and the detection head §3.5. CBNetV1 uses AHLC only. CBNetV2 uses DHLC, auxiliary supervision and the s_3 pruning §3.5. CBNetV2 is the default CBNet in the experiments unless stated otherwise §3.5.
Pseudocode
The forward pass below uses DHLC with stage indices 1 to L; stage 1 is the stem. It follows eq. 2 and eq. 6 and omits pruning and auxiliary heads.
# CBNet forward pass with DHLC, no pruning [§3.1] [eq. 2] [eq. 6]
# stages[l]: output of stage l, l = 1..L (stage 1 is the stem)
# Input: image (B, 3, H, W); K identical backbones
# Output: lead-backbone stages 2..L for the neck
def cbnet_forward(image, backbones, projections):
# The first (assisting) backbone runs on the image [§3.1]
prev = run_stages(backbones[0], image)
for k in range(1, K):
# Stage 1 is weight-shared, so it is reused, not recomputed [§3.1]
cur = {1: prev[1]}
for l in range(2, L + 1):
# Add the composed higher-level features to the stage input [eq. 2]
feed = dense_feed(prev, projections[k], l) # (B, C_l, H_l, W_l)
cur[l] = backbones[k].stage(l, cur[l - 1] + feed)
prev = cur
# Only the lead's stages go to the neck and head [§3.5]
return [prev[l] for l in range(2, L + 1)]
def dense_feed(prev, projection, l):
# Sum over stages l..L of the previous backbone [§3.2.4] [eq. 6]
total = 0
for i in range(l, L + 1):
# Project to the channel count of the target stage [§3.2.4]
# w_i is a 1x1 conv (+ BN in the ResNet code) [code: cbnet.py#L156-L160]
reduced = projection[i](prev[i])
# Resize to the target stage's spatial size [§3.2.4]
total = total + upsample(reduced, size_of_stage(l - 1))
return totalHyperparameters
The paper gives the settings below. The released code is the MMDetection fork at the commit in the frontmatter. Stated-only values are marked as such.
| Name | Value | Where | Notes |
|---|---|---|---|
| Baseline detector | Faster R-CNN, ResNet50-FPN | §4.1.2 | ablations and simple comparisons |
| Optimiser | SGD | §4.1.2 | |
| Initial learning rate | 0.02 | §4.1.2 [code: configs/base/schedules/schedule_1x.py#L2] | |
| Momentum | 0.9 | §4.1.2 [code: configs/base/schedules/schedule_1x.py#L2] | |
| Weight decay | 1e-4 | §4.1.2 [code: configs/base/schedules/schedule_1x.py#L2] | |
| Schedule (ablations) | 12 epochs, LR ×0.1 at epochs 8 and 11 | §4.1.2 [code: configs/base/schedules/schedule_1x.py#L5-L11] | Code also has linear warm-up over 500 iterations from ratio 0.001; not stated in the paper |
| Batch size | 16 | §4.1.2 | |
| Augmentation (ablations) | random horizontal flip only | §4.1.2 | |
| Input size (ablations and simple comparisons) | 800×500, train and test | §4.1.2 §4.6 | Released 1x config uses 1333×800 [code: configs/base/datasets/coco_detection.py#L9] |
| Multi-scale training (SOTA) | short side 400–1400, long side ≤ 1600 | §4.1.2 cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_coco.py | |
| Test input (SOTA) | 1600×1400 | §4.1.2 cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_coco.py | |
| Post-processing | Soft-NMS, "threshold 0.001" | §4.1.2 cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_coco.py | Code sets score_thr = 0.001; see Pitfalls |
| Head changes (Cascade, Cascade Mask, HTC) | four conv layers per box head, GIoU loss instead of Smooth L1 | §4.2 | Number of FC layers not stated |
| Auxiliary weight, K = 2 | λ_1 = 0.5 | §4.6.2 tab. 14 two_stage.py | |
| Auxiliary weights, K = 3 | λ_1 = 0.5, λ_2 = 1.0 | §4.6.2 tab. 14 two_stage.py | |
| Pruning default | s_3 | §3.4 §4.6.5 faster_rcnn_cbv2d1_r50_fpn_1x_coco.py | Code's CNN default cb_del_stages=1 |
| Number of backbones | K = 2 default; K = 3 for ablation | §3.1 §4.6.2 | Released code builds exactly 2 (see Pitfalls) |
| Frozen stages, BN | not stated in paper | — | Code: frozen_stages=1, norm_eval=True [code: configs/base/models/faster_rcnn_r50_fpn.py#L9-L11] |
| Zero-initialised composite layers | not stated in paper | — | Code default cb_zero_init=True cbnet.py |
| Swin, optimiser | AdamW, LR 1e-4, weight decay 0.05, batch 16 | §4.3.2 mask_rcnn_swin_small_patch4_window7_mstrain_480-800_adamw_3x_coco.py | |
| Swin, schedule | 3x: 36 epochs, LR ×0.1 at epochs 27 and 33 | §4.2.2 §4.3.2 mask_rcnn_swin_small_patch4_window7_mstrain_480-800_adamw_3x_coco.py | |
| Swin, multi-scale | short side 480–800, long side ≤ 1333 | §4.3.2 | |
| ATSS R2-101-DCN | 20 epochs, LR ×0.1 at epochs 16 and 19 | §4.2.1 | No ATSS config in configs/cbnet |
| Cascade R2-101-DCN | 32 epochs: 20 regular, 12 with SWA | §4.2.1 | Released cascade config has 20 epochs; no SWA code found |
| HTC Swin-B / Swin-L | 20 epochs / 12 epochs | tab. 2 cbnet, HTC Swin-B 20-epoch config | |
| Inference timing | 1 V100 GPU | §4.1.2 | FPS |
Results
All numbers are author-reported. Each table is cited to the paper. Setups differ across tables, so compare within a table only.
Test-dev, SOTA detectors tab. 1
| Method | Group | box AP | AP50 | AP75 | AP_S | AP_M | AP_L | Params | Epochs |
|---|---|---|---|---|---|---|---|---|---|
| FSAF | anchor-free | 42.9 | 63.8 | 46.3 | 26.6 | 46.2 | 52.7 | 94 M | 24 |
| FCOS | anchor-free | 44.7 | 64.1 | 48.4 | 27.6 | 47.5 | 55.6 | 90 M | 24 |
| DETR-DC5 | anchor-free | 44.9 | 64.7 | 47.7 | 23.7 | 49.5 | 62.3 | 60 M | 500 |
| NAS-FCOS | anchor-free | 46.1 | – | – | – | – | – | 89 M | 24 |
| ATSS | anchor-free | 47.7 | 66.5 | 51.9 | 29.7 | 50.8 | 59.4 | 95 M | 24 |
| GFL | anchor-free | 48.2 | 67.4 | 52.6 | 29.2 | 51.7 | 60.2 | 53 M | 24 |
| Deformable DETR | anchor-free | 50.1 | 69.7 | 54.6 | 30.6 | 52.8 | 64.7 | – | 50 |
| PAA | anchor-free | 50.8 | 69.7 | 55.1 | 31.4 | 54.7 | 65.2 | 129 M | 24 |
| CB-Res2Net101-DCN (ATSS) | anchor-free | 52.7 | 71.1 | 57.7 | 35.7 | 56.6 | 62.7 | 107 M | 20 |
| Auto-FPN | anchor-based | 44.3 | – | – | – | – | – | 90 M | 24 |
| SM-NAS:E5 | anchor-based | 45.9 | 64.6 | 49.6 | 27.1 | 49.0 | 58.0 | – | 24 |
| NAS-FPN | anchor-based | 48.3 | – | – | – | – | – | – | 150 |
| SP-NAS | anchor-based | 49.1 | 67.1 | 53.5 | 31 | 52.6 | 63.7 | – | 50 |
| Joint-DetNAS | anchor-based | 50.7 | 69.6 | 55.4 | 31.3 | 53.8 | 64.0 | – | 16 |
| SpineNet-190 | anchor-based | 52.1 | 71.8 | 56.5 | 35.4 | 55 | 63.6 | 164 M | 250 |
| OPANAS | anchor-based | 52.2 | 71.3 | 57.3 | 33.3 | 55.6 | 65.4 | 83 M | 24 |
| EfficientDet-D7x | anchor-based | 55.1 | 74.3 | 59.9 | – | – | – | 77 M | 600 |
| YOLOv4-P7 | anchor-based | 55.5 | 73.4 | 60.8 | 38.4 | 59.4 | 67.7 | 288 M | 450 |
| CB-Res2Net101-DCN (Cascade R-CNN) | anchor-based | 55.6 | 73.7 | 60.8 | 37.4 | 59.0 | 67.6 | 146 M | 32 |
The text gives 52.8 for the anchor-free row; the table says 52.7 (see Pitfalls) §4.2.1.
Instance segmentation and detection with Swin tab. 2
| Pre-trained on | Method | mini-val box | mini-val mask | test-dev box | test-dev mask | Params | Epochs |
|---|---|---|---|---|---|---|---|
| ImageNet-1K | GCNet* | 51.8 | 44.7 | 52.3 | 45.4 | – | 36 |
| ImageNet-1K | Swin-B | 51.9 | 45.0 | – | – | 145 M | 36 |
| ImageNet-1K | ResNeSt-200* | 52.5 | – | 53.3 | 47.1 | – | 36 |
| ImageNet-1K | CopyPaste† | 55.9 | 47.2 | 56.0 | 47.4 | 185 M | 96 |
| ImageNet-1K | CB-Swin-S (Cascade Mask R-CNN) | 56.3 | 48.6 | 56.9 | 49.1 | 156 M | 36 |
| ImageNet-22K | Swin-L (HTC++) | 57.1 | 49.5 | 57.7 | 50.2 | 284 M | 72 |
| ImageNet-22K | Swin-L (HTC++)* | 58.0 | 50.4 | 58.7 | 51.1 | 284 M | 72 |
| ImageNet-22K | CB-Swin-B (HTC) | 58.4 | 50.7 | 58.7 | 51.1 | 235 M | 20 |
| ImageNet-22K | CB-Swin-B (HTC)* | 58.9 | 51.3 | 59.3 | 51.8 | 235 M | 20 |
| ImageNet-22K | CB-Swin-L (HTC) | 59.1 | 51.0 | 59.4 | 51.6 | 453 M | 12 |
| ImageNet-22K | CB-Swin-L (HTC)* | 59.6 | 51.8 | 60.1 | 52.3 | 453 M | 12 |
* multi-scale testing; † extra unlabeled data for pretraining tab. 2 §4.2.2.
Generality, same detector with other backbones tab. 3 tab. 4
Faster R-CNN, box AP. The input size is not stated for these tables; §4.1.2 sets 800×500 for ablations and simple comparisons §4.3.1.
| Backbone | Origin | CB | Δ AP |
|---|---|---|---|
| ResNet50 | 34.6 | 38.0 | +3.4 |
| ResNeXt50-32x4d | 36.3 | 39.8 | +3.5 |
| Res2Net50 | 37.7 | 41.2 | +3.5 |
| Backbone | box AP | Params | FLOPs | FPS |
|---|---|---|---|---|
| ResNet101 | 36.3 | 60.5 M | 121 G | 25.8 |
| CB-ResNet50 | 38.0 | 69.4 M | 121 G | 23.3 |
| ResNet152 | 37.8 | 76.2 M | 151 G | 21.3 |
| ResNeXt101-32x4d | 37.7 | 60.2 M | 122 G | 20.8 |
| CB-ResNeXt50-32x4d | 39.8 | 68.4 M | 123 G | 19.3 |
| ResNeXt101-64x4d | 38.7 | 99.3 M | 183 G | 15.8 |
| Res2Net101 | 40.1 | 61.2 M | 125 G | 20.7 |
| CB-Res2Net50 | 41.2 | 69.7 M | 125 G | 20.2 |
| Res2Net200 | 41.7 | 92.2 M | 185 G | 14.8 |
tab. 4 (text: CB-ResNet50 is about 1.7 above ResNet101 §4.3.1).
Swin Transformer tab. 5
Cascade Mask R-CNN §4.3.2. The table does not state the split. Gains are against the same backbone row.
| Backbone | box AP | mask AP | Params | FLOPs | FPS |
|---|---|---|---|---|---|
| Swin-T | 50.5 | 43.7 | 85.6 M | 742 G | 7.8 |
| Swin-S | 51.8 (+1.3) | 44.7 (+1.0) | 107.0 M | 832 G | 7.0 |
| Swin-B | 51.9 (+1.4) | 45.0 (+1.3) | 145.0 M | 975 G | 5.9 |
| CB-Swin-T | 53.6 (+3.1) | 46.2 (+2.5) | 113.8 M | 836 G | 6.5 |
Other backbones, mAP tab. 6
| Detector | Backbone | mAP | Params | FLOPs |
|---|---|---|---|---|
| YOLOv3 | MobileNetV2 | 22.2 | 3.74 M | 1.69 G |
| YOLOv3 | CB-MobileNetV2 | 25.4 | 5.20 M | 2.27 G |
| YOLOv3 | MobileNetV2 (1.4x) | 24.4 | 5.04 M | 2.21 G |
| Faster R-CNN | HRNetv2p_w32 | 40.2 | 47.3 M | 285 G |
| Faster R-CNN | CB-HRNetv2p_w32 | 42.6 | 76.8 M | 449 G |
| Faster R-CNN | HRNetv2p_w48 | 42.0 | 83.4 M | 460 G |
| RetinaNet | PVT-Small | 40.4 | 34.2 M | 214 G |
| RetinaNet | CB-PVT-Small | 43.4 | 58.9 M | 278 G |
| RetinaNet | PVT-Large | 42.6 | 71.1 M | 309 G |
| RetinaNet | PVTv2-B2 | 44.6 | 35.1 M | 218 G |
| RetinaNet | CB-PVTv2-B2 | 47.7 | 60.7 M | 287 G |
| RetinaNet | PVTv2-B5 | 46.1 | 91.7 M | 335 G |
Mainstream detectors, ResNet50 vs CB-ResNet50 tab. 7
| Detector | R50 box AP | CB-R50 box AP | Δ | R50 mask AP | CB-R50 mask AP | Δ |
|---|---|---|---|---|---|---|
| RetinaNet | 33.2 | 36.2 | +3.0 | – | – | – |
| ATSS | 36.9 | 39.9 | +3.0 | – | – | – |
| Faster R-CNN | 34.6 | 38.0 | +3.4 | – | – | – |
| Mask R-CNN | 35.2 | 39.0 | +3.8 | 31.8 | 34.7 | +2.9 |
| Cascade R-CNN | 38.2 | 41.2 | +3.0 | – | – | – |
YOLOX and Joint-DetNAS tab. 8
| Backbone | Method | mAP | Params | FLOPs |
|---|---|---|---|---|
| CSPNet-L | YOLOX | 49.4 | 54.2 M | 78 G |
| CSPNet-X | YOLOX | 50.9 | 99.1 M | 141 G |
| CB-CSPNet-L | YOLOX | 52.0 | 83.8 M | 118 G |
| Searched X101-FPN | Joint-DetNAS | 45.7 | – | 266 G |
DetectoRS comparison, Faster R-CNN 1× tab. 9
| Backbone | Method | mAP | Params | FLOPs |
|---|---|---|---|---|
| ResNet101 | CBNet | 42.7 | 107.4 M | 436 G |
| ResNet101 | DetectoRS | 42.8 | 104.0 M | 512 G |
| ResNeXt101-32x4d | CBNet | 44.2 | 106.7 M | 444 G |
| ResNeXt101-32x4d | DetectoRS | 44.0 | 103.5 M | 519 G |
| Res2Net101 | CBNet | 45.8 | 108.7 M | 452 G |
| Res2Net101 | DetectoRS | 45.7 | 105.4 M | 533 G |
| Swin-Tiny | CBNet | 46.7 | 74.1 M | 307 G |
| Swin-Tiny | DetectoRS | 45.9 | 73.4 M | 366 G |
Deformable convolution tab. 10
Faster R-CNN, box AP, without and with DCN §4.5.1.
| Backbone | w/o DCN | w/ DCN | Δ |
|---|---|---|---|
| ResNet50 | 34.6 | 37.4 | +2.8 |
| ResNet152 | 37.8 | 39.8 | +2.0 |
| CB-ResNet50 | 38.0 | 40.4 | +2.4 |
| ResNeXt50-32x4d | 36.3 | 38.6 | +2.3 |
| ResNeXt101-64x4d | 38.7 | 41.0 | +2.3 |
| CB-ResNeXt50-32x4 | 39.8 | 42.5 | +2.7 |
Model ensemble with PRAE tab. 11
Single-model best AP and PRAE ensemble AP, Faster R-CNN §4.5.2.
| Pair | Single | Ensemble | Δ |
|---|---|---|---|
| R50 & X50 | 36.3 | 37.3 | +1.0 |
| R101 & X101 | 38.7 | 39.7 | +1.0 |
| CB-R50 & CB-X50 | 39.8 | 40.8 | +1.0 |
| R50 & R2-50 | 37.7 | 38.8 | +1.1 |
| R101 & R2-101 | 40.1 | 40.9 | +0.8 |
| CB-R50 & CB-R2-50 | 41.2 | 42.2 | +1.0 |
| X50 & R2-50 | 37.7 | 39.4 | +1.7 |
| X101 & R2-101 | 40.1 | 41.9 | +1.8 |
| CB-X50 & CB-R2-50 | 41.2 | 42.9 | +1.7 |
Composite strategies, Faster R-CNN CB-ResNet50 tab. 12 §4.6.1
Ablation setup (800×500).
| Strategy | box AP | Params | FLOPs | FPS |
|---|---|---|---|---|
| none (single ResNet50) | 34.6 | 41.5 M | 90 G | 30.0 |
| SLC | 35.0 | 64.8 M | 123 G | 22.6 |
| AHLC | 36.0 | 67.6 M | 126 G | 22.4 |
| ALLC | 32.4 | 67.6 M | 133 G | 22.5 |
| DHLC | 37.3 | 69.7 M | 127 G | 21.4 |
| FCC | 37.4 | 72.0 M | 145 G | 19.9 |
AHLC vs DHLC on other backbones tab. 13 §4.6.1
| Backbone | Composite | box AP | Params | FLOPs |
|---|---|---|---|---|
| CB-ResNet101 | AHLC | 37.9 | 105.6 M | 186 G |
| CB-ResNet101 | DHLC | 38.7 | 107.6 M | 188 G |
| CB-ResNeXt101 | AHLC | 39.9 | 183.0 M | 312 G |
| CB-ResNeXt101 | DHLC | 41.0 | 185.1 M | 313 G |
Auxiliary loss weights tab. 14 §4.6.2
| Backbone | λ_1 | λ_2 | box AP |
|---|---|---|---|
| CB-ResNet50 (K = 2) | 0 | – | 37.3 |
| CB-ResNet50 (K = 2) | 0.125 | – | 37.6 |
| CB-ResNet50 (K = 2) | 0.25 | – | 37.8 |
| CB-ResNet50 (K = 2) | 0.5 | – | 38.1 |
| CB-ResNet50 (K = 2) | 1.0 | – | 37.9 |
| CB-ResNet50-K3 | 0 | 0 | 37.4 |
| CB-ResNet50-K3 | 0.25 | 0.25 | 37.9 |
| CB-ResNet50-K3 | 0.25 | 0.5 | 38.9 |
| CB-ResNet50-K3 | 0.5 | 0.5 | 38.6 |
| CB-ResNet50-K3 | 0.5 | 1.0 | 39.2 |
CBNetV1 vs CBNetV2, Faster R-CNN ResNet50 tab. 15 §4.6.5
| Configuration | DHLC | Aux | Prune | box AP | Params | FLOPs | FPS |
|---|---|---|---|---|---|---|---|
| ResNet50 (single backbone) | 34.6 | 41.5 M | 90 G | 30.0 | |||
| CBNetV1 | 36.0 | 67.6 M | 126 G | 22.4 | |||
| CBNetV1 (pruned) | ✓ | 35.6 | 66.2 M | 111 G | 26.6 | ||
| CBNetV1 + aux | ✓ | 36.9 | 67.6 M | 126 G | 22.4 | ||
| DHLC only | ✓ | 37.3 | 69.7 M | 127 G | 21.4 | ||
| DHLC + aux | ✓ | ✓ | 38.1 | 69.7 M | 127 G | 21.4 | |
| CBNetV2 | ✓ | ✓ | ✓ | 38.0 | 69.4 M | 121 G | 23.3 |
Identical vs mixed backbones tab. 16 §4.6.6
Detector and schedule are not stated in the table or the text. Other rows include backbones of the same family with mixed depth.
| Backbone | box AP | Params | FLOPs |
|---|---|---|---|
| ResNet50-C-ResNet101 | 37.8 | 88.7 M | 157 G |
| ResNet101-C-ResNet50 | 37.8 | 88.7 M | 157 G |
| CB-ResNet50 | 38.0 | 69.4 M | 121 G |
| Res2Net50-C-Res2Net101 | 41.1 | 89.5 M | 163 G |
| Res2Net101-C-Res2Net50 | 41.4 | 89.5 M | 163 G |
| CB-Res2Net50 | 41.2 | 69.7 M | 125 G |
| CB-Res2Net101 | 43.0 | 108.7 M | 188 G |
| ResNet50-C-Res2Net101 | 40.0 | 89.3 M | 162 G |
| Res2Net101-C-ResNet50 | 41.2 | 89.3 M | 162 G |
| ResNet101-C-Res2Net50 | 39.5 | 88.8 M | 162 G |
| Res2Net50-C-ResNet101 | 40.6 | 88.8 M | 162 G |
Other results in the text only: a 2.3 to 2.7 AP gain with DCN §4.5.1; an ensemble gain of 0.8 to 1.7 AP with PRAE §4.5.2; and the s_3 vs s_4 FLOPs saving §4.6.3 fig. 6.
Paper vs code
Code: mmdet/ fork of MMDetection at code_commit, licence Apache-2.0 LICENSE.
Backbones and composition are in mmdet/models/backbones/cbnet.py, the
loss weights in mmdet/models/detectors/two_stage.py, and the neck in
mmdet/models/necks/cbnet_fpn.py.
- Two backbones only. The paper allows K ≥ 2 §3.1. Both CNN and Swin wrappers hard-code
range(2), so K = 2 is the only value built cbnet.py cbnet.py. The K = 3 results tab. 14 cannot be reproduced with this code, and no K = 3 config exists inconfigs/cbnet. - Only DHLC. The paper defines five strategies §3.2. The code implements only the dense sum: each stage's input adds upsampled, projected stages from the previous backbone cbnet.py. SLC, AHLC, ALLC and FCC are not in the code, and CBNetV1 (AHLC) has no config. So the composite rows of tab. 12, tab. 13 and the V1 rows of tab. 15 are not reproducible from this repo.
- Which stages are summed. For the input of stage l, the code sums the previous backbone's outputs from stage l to stage L, including the same level cbnet.py cbnet.py. This matches eq. 6 once its index shift is applied. Implementers should not shift the index twice.
- Projection layer. The paper says w_i is a 1×1 conv and does not mention normalisation for DHLC §3.2.4. The CNN code uses a 1×1 conv followed by BatchNorm cbnet.py. The Swin code uses a 1×1 conv with no normalisation when the channel counts differ, and an identity when they match cbnet.py.
- Up-sampling. The paper calls U "up-sampling" without a method §3.2. The code uses nearest-neighbour interpolation cbnet.py cbnet.py.
- Zero initialisation. The composite layers start at zero: the last BatchNorm of each CNN projection is zero-initialised cbnet.py, and all Swin projections are zero-initialised cbnet.py. The paper does not state this.
- Pruning on CNN. With
cb_del_stages=1, the stem and stage 2 are deleted in backbones 2 … K cbnet.py faster_rcnn_cbv2d1_r50_fpn_1x_coco.py. In the paper's stage numbering this is s_3, which matches the default in §3.4. - Pruning on Swin. The Swin default,
cb_del_stages=1cbnet.py, deletes only the patch embedding in backbones 2 … K. The layer looprange(0, self.del_stages - 1)cbnet.py removes nothing at this value. In the paper's indexing this is s_4 (stage 1 pruned, stages 2 to 5 kept). The paper does not say which pruning it used for Swin. - Auxiliary loss weights. The code default is
[0.5] + [1]*(K-1)two_stage.py. Index 0 is the first (assisting) backbone, and the last is the lead. Each weight multiplies that backbone's RPN and RoI losses two_stage.py two_stage.py two_stage.py. This matches tab. 14 for K = 2 and K = 3. - Shared heads. The neck and heads are shared across backbones, as the paper says §3.3 two_stage.py cbnet_fpn.py. At inference only the lead's FPN output is used cbnet_fpn.py.
- BatchNorm. Projection BatchNorms are set to eval mode during training cbnet.py. The paper does not mention this.
- Frozen stages. The Faster R-CNN base config freezes stage 1 and sets BatchNorm to eval [code: configs/base/models/faster_rcnn_r50_fpn.py#L9-L11]. The paper does not state either setting.
- Ablation resolution. The paper uses 800×500 §4.1.2. The repo's base dataset config is 1333×800 [code: configs/base/datasets/coco_detection.py#L9], and no 800×500 ablation config is included.
- Missing configs. No ATSS config exists in
configs/cbnetfor tab. 1. The Cascade config is 20 epochs; the paper's 32-epoch SWA run is not in the repo, and the word "swa" does not appear inconfigsormmdet. - Soft-NMS. The paper says "threshold 0.001" §4.1.2. The code sets
score_thr=0.001withsoft_nmscascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_coco.py. The paper does not say whether it means a score or an IoU threshold. - Consistent items. The 1x schedule (SGD 0.02, decay at 8 and 11, 12 epochs) [code: configs/base/schedules/schedule_1x.py#L2-L11] and the Swin 3x schedule (decay at 27 and 33, 36 epochs) mask_rcnn_swin_small_patch4_window7_mstrain_480-800_adamw_3x_coco.py match the paper. The SOTA multi-scale range and 1600×1400 test size match too cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_coco.py cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_coco.py.
Pitfalls
- Cost is not zero. The assisting backbones run at inference, because the lead depends on their features. The paper's claim that auxiliary supervision adds no inference cost is true for the heads only §3.3. DHLC raises the ResNet50 model from 90 G to 127 G FLOPs and from 30.0 to 21.4 FPS in the authors' measurement tab. 12. Budget for roughly K times the backbone compute.
- Parameter count and speed comparisons. CB-ResNet50 is compared with deeper single backbones at similar FLOPs. The authors report FPS on one V100 §4.1.2 and say the comparison is at "comparable" cost §4.3.1. These are author-reported, measured with their hardware and code.
- Pruning explanation. The paper says pruned stages cost no accuracy because their weights are fixed during detector training §4.6.3. The code removes those layers outright for backbones 2 … K cbnet.py. The stated reason is not spelled out in the paper, so treat the claim as author-reported.
- Swin pruning is unclear. The Swin default removes only the patch embedding (see Paper vs code). Do not assume the CNN s_3 result applies to Swin.
- Weight sharing of stage 1. The paper calls stage-1 outputs weight-shared §3.1. The code reuses the first backbone's stem output and does not compute it again cbnet.py cbnet.py. The same applies to pruned stages.
- Numbers that disagree within the paper.
- Anchor-free result: the text says 52.8 AP §4.2.1; Table 1 says 52.7 tab. 1.
- DCN gains over the other rows: the text says +3.7 over ResNeXt50-32x4d-DCN and +1.3 over ResNeXt101-64x4d-DCN §4.5.1; Table 10 gives +3.9 and +1.5 tab. 10.
- Shorter schedules: the text says 16× and 12× shorter than EfficientDet and YOLOv4 §4.2.1; the table lists 600 and 450 epochs against 32, which is about 18.8× and 14.1× tab. 1.
- MobileNetV2 gain: the text says +3.1 §4.3.3; Table 6 gives 22.2 to 25.4, which is +3.2 tab. 6.
- Aux-supervision gain: the text says "2.1 over the baseline" for "rows 1 and 6" §4.6.5. Table 15 gives 34.6 to 38.1 (+3.5) for rows 1 and 6, and +2.1 only against CBNetV1 (row 2, 36.0).
- Identical backbones: CB-Res2Net50 is said to beat every mixed pair §4.6.6, but Res2Net101-C-ResNet50 is 41.2, the same as CB-Res2Net50 tab. 16.
- Pruning FLOPs and the backbone-count curve are given only in figures §4.6.3 §4.6.4 fig. 6; no table backs them.
- Choice of K. The K = 3 rows tab. 14 need a code change (see Paper vs code). The K = 4 and 5 results exist only as a figure §4.6.4 fig. 6.
- Composite search is expensive. The paper's grid search trained 512 detectors for 205 GPU days §4.6.1. The searched strategy matched DHLC at 37.3 AP with 0.6 M fewer parameters, so it did not beat it §4.6.1. Do not expect a search-based variant to win without that budget.
- Index conventions. eq. 6 and the stage numbering are easy to shift by one. Check against the code cited above before porting.
- Projection choice. Normalisation, zero-initialisation and the interpolation method are not stated in the paper, and each changes training. Use the code's defaults, or state the change.
- Head sharing. The aux and lead heads share all weights §3.3. Separate heads would be a different model from the one the paper reports.
- Missing details. Frozen stages, warm-up, batch-norm mode and the ATSS and SWA training recipes are not stated in the paper. The code uses MMDetection defaults for most of them.
- Endorsement. This page is a compilation. The authors do not endorse it.
Lineage
- Builds on: CBNet (AAAI 2020, cited as [LiuWWLZTL20] in the paper), the preliminary version. The paper says CBNetV2 changes the composition strategy, adds auxiliary supervision and the pruning option §3.5. Its arXiv id is not in the source.
- Evaluated with: Swin Transformer [/papers/2103.14030] (the backbone for the Swin results §4.3.2).
- Compared against: DetectoRS §4.4, Joint-DetNAS §4.4, and the PRAE ensemble §4.5.2.
- Superseded by: not known from this wiki.
Source and license
Adapted from “CBNet: A Composite Backbone Network Architecture for Object Detection” by Tingting Liang, Xiaojie Chu, Yudong Liu, Yongtao Wang, Zhi Tang, Wei Chu, Jingdong Chen, Haibin Ling (arXiv:2107.00420), used under CC0 1.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/VDIGPKU/CBNetV2 at commit 7ff88b70ea12 (Apache-2.0). Any quoted code is shown under that license.