Skip to content
fn

convnext_base_cls

→ConvNeXtForImageClassification88.6M
convnext_base_cls(pretrained: bool | str = False, weights: ConvNeXtBaseWeights | None = None, overrides: object = {})

ConvNeXt-Base image classifier (Liu et al., 2022).

Combines the convnext_base backbone (depths=(3, 3, 27, 3), dims=(128, 256, 512, 1024)) with a global average pool + LayerNorm + linear classification head. ~89M parameters.

Model Size

Parameters

pretrainedbool= False
If True, loads ImageNet-1k or ImageNet-22k pretrained weights when available. Defaults to False.
weights(ConvNeXtBaseWeights, optional, keyword - only)= None
Explicit weights enum member; takes precedence over pretrained.
**overridesobject= {}
Keyword overrides on top of the canonical ConvNeXt-B config.

Returns

ConvNeXtForImageClassification

Classifier whose logits has shape (B, num_classes).

Notes

ConvNeXt-B reaches 83.8% top-1 on ImageNet-1k (224x224). With ImageNet-22k pretraining it reaches 85.8% at 224x224 and 86.8% at 384x384 (Liu et al., 2022, Table 1 lower block; the per-resolution breakdown is Table 12 — Table 11 is "Detailed results for modernizing a ResNet-200").

Examples

>>> import lucid
>>> from lucid.models.vision.convnext import convnext_base_cls
>>> model = convnext_base_cls(num_classes=1000)
>>> x = lucid.randn(1, 3, 224, 224)
>>> model(x).logits.shape
(1, 1000)
Load ImageNet-pretrained weights:
>>> model = convnext_base_cls(pretrained=True)
>>> from lucid.models.weights import ConvNeXtBaseWeights
>>> model = convnext_base_cls(weights=ConvNeXtBaseWeights.IMAGENET1K_V1)

Used by 1