CSPNet
12 memberslucid.models.vision.cspnetCSPNet family — backbone + image classification (Wang et al., CVPRW 2020).
Wang, Chien-Yao, et al. "CSPNet: A New Backbone that can Enhance Learning Capability of CNN." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, 2020, pp. 390–391.
CSPNet ("Cross-Stage Partial Network") is a generic backbone transformation that can be wrapped around almost any dense-or-residual stage — ResNet, ResNeXt, DenseNet, Darknet — to cut its compute and memory while improving its accuracy.
The CSP transformation factors each stage as follows. The input feature map (after an expansion conv) is split along the channel dimension into two halves:
Only is fed through the heavy residual block to produce ; the other half bypasses the block entirely. At the end of the stage the two halves are concatenated and projected:
Because never enters the heavy block, the duplicated gradient is split into two truncated paths that share no intermediate activations — which both reduces redundant gradient information and halves the FLOPs of the heavy block. Applied to ResNet-50 / ResNeXt-50 / Darknet-53 backbones, CSP cuts compute by 10–20% while improving ImageNet top-1 by a fraction of a percent.
Lucid ships the three paper-cited base variants from Wang 2020:
cspresnet_50, cspresnext_50, cspdarknet_53.
The first two use CrossStage (CSP-wrapped residual bottleneck);
the last uses DarkStage (sequential Darknet block).
Classes
Functions
cspdarknet_53→ CSPNet27.6MCSPDarknet-53 backbone — Darknet-53 (YOLOv3 base) with CSP wrap.
cspdarknet_53_cls→ CSPNetForImageClassification27.6MCSPDarknet-53 image classifier — paper Table 1, 27.6M
params, ImageNet-1k acc@1 ~80.1% (timm ra_in1k recipe).
cspresnet_50→ CSPNet21.6MCSPResNet-50 backbone — ResNet-50 with CSP-wrapped stages.
cspresnet_50_cls→ CSPNetForImageClassification21.6MCSPResNet-50 image classifier — paper Table 1, 21.6M params,
ImageNet-1k acc@1 ~76.2% (timm ra_in1k recipe).
cspresnext_50→ CSPNet20.6MCSPResNeXt-50 backbone — ResNeXt-50 (32x4d) with CSP wrap.
cspresnext_50_cls→ CSPNetForImageClassification20.6MCSPResNeXt-50 image classifier — paper Table 1, 20.6M
params, ImageNet-1k acc@1 ~80.0% (timm ra_in1k recipe).