ResNet-50 feature-extracting backbone (no classification head).
Builds a ResNet with the paper-cited ResNet-50 topology:
_Bottleneck blocks stacked [3, 4, 6, 3] over four
stages, yielding approximately 25.6M parameters. Reaches 76.13%
ImageNet-1k top-1 in He et al., 2015 (Table 4). By far the most
common ResNet variant in production — used as the default backbone
for Faster R-CNN, Mask R-CNN, DeepLab, and many other downstream
tasks.
Model Size
Parameters
pretrainedbool= False**overridesobject= {}ResNetConfig to
customise individual fields (in_channels, num_classes,
zero_init_residual, …) without writing a config by hand.Returns
ResNetBackbone with the ResNet-50 configuration applied (or with
overrides merged on top of it).
Notes
See He et al., "Deep Residual Learning for Image Recognition", CVPR 2016 (arXiv:1512.03385), Table 1. The bottleneck block
compresses the channel count via the leading 1×1 convolution and
re-expands it via the trailing 1×1, reducing FLOPs at depth. The
final-stage output is 2048 channels (hidden_sizes[3] * expansion).
Examples
>>> import lucid
>>> from lucid.models.vision.resnet import resnet_50
>>> model = resnet_50()
>>> x = lucid.randn(2, 3, 224, 224)
>>> out = model(x)
>>> out.last_hidden_state.shape # (B, 2048, H/32, W/32)
(2, 2048, 7, 7)