Skip to content
fn

convnext_small_cls

→ConvNeXtForImageClassification50.2M
convnext_small_cls(pretrained: bool | str = False, weights: ConvNeXtSmallWeights | None = None, overrides: object = {})

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

Combines the convnext_small backbone (depths=(3, 3, 27, 3), dims=(96, 192, 384, 768)) with a global average pool + LayerNorm + linear classification head. ~50M parameters.

Model Size

Parameters

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

Returns

ConvNeXtForImageClassification

Classifier whose logits has shape (B, num_classes).

Notes

ConvNeXt-S reaches 83.1% top-1 on ImageNet-1k (Liu et al., 2022, Table 1).

Examples

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

Used by 1