Skip to content
fn

convnext_xlarge_cls

→ConvNeXtForImageClassification350M
convnext_xlarge_cls(pretrained: bool | str = False, weights: ConvNeXtXLargeWeights | None = None, overrides: object = {})

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

Combines the convnext_xlarge backbone (depths=(3, 3, 27, 3), dims=(256, 512, 1024, 2048)) with a global average pool + LayerNorm + linear classification head. ~350M parameters — the largest ConvNeXt variant in the paper.

Model Size

Parameters

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

Returns

ConvNeXtForImageClassification

Classifier whose logits has shape (B, num_classes).

Notes

ConvNeXt-XL reaches 87.0% top-1 on ImageNet-1k at 224x224 — and 87.8% at 384x384 — after ImageNet-22k pretraining (Liu et al., 2022, Table 1 lower block; per-resolution detail in Table 12). 87.0 is the 224 number, which is what this family's weight entry preprocesses for.

Examples

>>> import lucid
>>> from lucid.models.vision.convnext import convnext_xlarge_cls
>>> model = convnext_xlarge_cls(num_classes=1000)
>>> x = lucid.randn(1, 3, 224, 224)
>>> model(x).logits.shape
(1, 1000)
Load ImageNet-22k-pretrained-then-1k-finetuned weights:
>>> model = convnext_xlarge_cls(pretrained=True)
>>> from lucid.models.weights import ConvNeXtXLargeWeights
>>> model = convnext_xlarge_cls(weights=ConvNeXtXLargeWeights.FB_IN22K_FT_IN1K)

Used by 1