opensi·si

timm/models/convnext.py ·

ConvNeXt

Category: CNN · Code: timm/models/convnext.py · Architectures: 31 · Pretrained weights: 101 (61 with ImageNet-1k results)

ConvNeXt is a pure convolutional network that adopts design choices from vision transformers, such as large depthwise kernels, inverted bottlenecks and LayerNorm. ConvNeXt-V2 adds Global Response Normalization (GRN) and is pretrained as a fully convolutional masked autoencoder (FCMAE).

Papers

  • A ConvNet for the 2020s
  • ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders
  • Reproducible scaling laws for contrastive language-image learning
  • DINOv3
  • Efficient Universal Perception Encoder

Usage

See the Quickstart for loading pretrained weights, image preprocessing and fine-tuning, and Feature Extraction for using the models as backbones.

>>> import timm
>>> model = timm.create_model('convnext_tiny.in12k_ft_in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)

Model API support

Feature ConvNeXt
features_only=True feature maps ✓ (strides 4, 8, 16, 32)
forward_intermediates() ✓
prune_intermediate_layers() ✓
Any input size, no changes needed ✓
set_input_size() –
dynamic_img_size=True –
set_grad_checkpointing() ✓
Layer-wise LR decay (group_matcher()) ✓
reset_classifier() ✓

✓ supported, ✓ (square) works for square sizes only, ✗ not supported, – not needed (the model already accepts any input size). Checked by running each feature on a randomly initialized model (ConvNeXt with convnext_zepto_rms at 224), other architectures of the same class are expected to behave the same. See the Model API page for details.

Architectures

Tabla (32 filas)
Architecture Params (M) GMACs Input size Pretrained weights
convnext_atto 3.70 0.55 224 1
convnext_atto_ols 3.70 0.58 224 1
convnext_atto_rms 3.69 0.55 224 0
convnext_base 88.59 15.38 224 16
convnext_femto 5.22 0.79 224 1
convnext_femto_ols 5.23 0.82 224 1
convnext_large 197.77 34.40 224 5
convnext_large_mlp 200.13 70.21 320 10
convnext_nano 15.59 2.46 224 6
convnext_nano_ols 15.65 2.65 224 1
convnext_pico 9.05 1.37 224 1
convnext_pico_ols 9.06 1.43 224 1
convnext_small 50.22 8.71 224 9
convnext_tiny 28.59 4.47 224 9
convnext_tiny_hnf 28.59 4.47 224 1
convnext_xlarge 350.20 60.98 224 3
convnext_xxlarge 846.47 198.09 256 4
convnext_zepto_rms 2.16 0.30 224 1
convnext_zepto_rms_ols 2.16 0.34 224 1
convnextv2_atto 3.71 0.55 224 2
convnextv2_base 88.72 15.38 224 4
convnextv2_femto 5.23 0.79 224 2
convnextv2_huge 660.29 337.96 384 4
convnextv2_large 197.96 34.40 224 4
convnextv2_nano 15.62 2.46 224 4
convnextv2_pico 9.07 1.37 224 2
convnextv2_small 50.32 8.71 224 0
convnextv2_tiny 28.64 4.47 224 4
test_convnext 0.27 0.03 160 1
test_convnext2 0.48 0.05 160 1
test_convnext3 0.47 0.05 160 1

GMACs and parameter counts are for the default input size and classifier of each architecture, from the benchmark results.

Pretrained weights

Top-1 is ImageNet-1k validation accuracy from results-imagenet.csv at the listed eval size, - if the weight has no ImageNet-1k result (e.g. pretraining or image-text weights). Classes is the size of the pretrained classifier, none for weights without one.

Weights are grouped by source: the paper or origin given in the pretrained config, else a Hub organization other than timm, else the first part of the pretrained tag (architecture.tag). Sources with a single weight are listed under other.

ConvNeXt V2

Pretrained configs reference ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders.

Tabla (27 filas)
Weight Input size Top-1 (%) Eval size Classes License Hub
convnextv2_atto.fcmae 224 - - none cc-by-nc-4.0 timm
convnextv2_atto.fcmae_ft_in1k 224 (test 288) 77.794 288 1000 cc-by-nc-4.0 timm
convnextv2_base.fcmae 224 - - none cc-by-nc-4.0 timm
convnextv2_base.fcmae_ft_in1k 224 (test 288) 85.490 288 1000 cc-by-nc-4.0 timm
convnextv2_base.fcmae_ft_in22k_in1k 224 (test 288) 86.994 288 1000 cc-by-nc-4.0 timm
convnextv2_base.fcmae_ft_in22k_in1k_384 384 87.638 384 1000 cc-by-nc-4.0 timm
convnextv2_femto.fcmae 224 - - none cc-by-nc-4.0 timm
convnextv2_femto.fcmae_ft_in1k 224 (test 288) 79.342 288 1000 cc-by-nc-4.0 timm
convnextv2_huge.fcmae 224 - - none cc-by-nc-4.0 timm
convnextv2_huge.fcmae_ft_in1k 224 (test 288) 86.618 288 1000 cc-by-nc-4.0 timm
convnextv2_huge.fcmae_ft_in22k_in1k_384 384 88.666 384 1000 cc-by-nc-4.0 timm
convnextv2_huge.fcmae_ft_in22k_in1k_512 512 88.860 512 1000 cc-by-nc-4.0 timm
convnextv2_large.fcmae 224 - - none cc-by-nc-4.0 timm
convnextv2_large.fcmae_ft_in1k 224 (test 288) 86.132 288 1000 cc-by-nc-4.0 timm
convnextv2_large.fcmae_ft_in22k_in1k 224 (test 288) 87.494 288 1000 cc-by-nc-4.0 timm
convnextv2_large.fcmae_ft_in22k_in1k_384 384 88.180 384 1000 cc-by-nc-4.0 timm
convnextv2_nano.fcmae 224 - - none cc-by-nc-4.0 timm
convnextv2_nano.fcmae_ft_in1k 224 (test 288) 82.490 288 1000 cc-by-nc-4.0 timm
convnextv2_nano.fcmae_ft_in22k_in1k 224 (test 288) 82.666 288 1000 cc-by-nc-4.0 timm
convnextv2_nano.fcmae_ft_in22k_in1k_384 384 83.366 384 1000 cc-by-nc-4.0 timm
convnextv2_pico.fcmae 224 - - none cc-by-nc-4.0 timm
convnextv2_pico.fcmae_ft_in1k 224 (test 288) 81.062 288 1000 cc-by-nc-4.0 timm
convnextv2_tiny.fcmae 224 - - none cc-by-nc-4.0 timm
convnextv2_tiny.fcmae_ft_in1k 224 (test 288) 83.478 288 1000 cc-by-nc-4.0 timm
convnextv2_tiny.fcmae_ft_in22k_in1k 224 (test 288) 84.428 288 1000 cc-by-nc-4.0 timm
convnextv2_tiny.fcmae_ft_in22k_in1k_384 384 85.098 384 1000 cc-by-nc-4.0 timm

clip tags

Tabla (25 filas)
Weight Input size Top-1 (%) Eval size Classes License Hub
convnext_base.clip_laion2b 256 - - 640 apache-2.0 timm
convnext_base.clip_laion2b_augreg 256 - - 640 apache-2.0 timm
convnext_base.clip_laion2b_augreg_ft_in12k 256 - - 11821 apache-2.0 timm
convnext_base.clip_laion2b_augreg_ft_in12k_in1k 256 86.378 256 1000 apache-2.0 timm
convnext_base.clip_laion2b_augreg_ft_in12k_in1k_384 384 87.144 384 1000 apache-2.0 timm
convnext_base.clip_laion2b_augreg_ft_in1k 256 86.184 256 1000 apache-2.0 timm
convnext_base.clip_laiona 256 - - 640 apache-2.0 timm
convnext_base.clip_laiona_320 320 - - 640 apache-2.0 timm
convnext_base.clip_laiona_augreg_320 320 - - 640 apache-2.0 timm
convnext_base.clip_laiona_augreg_ft_in1k_384 384 86.490 384 1000 apache-2.0 timm
convnext_large_mlp.clip_laion2b_augreg 256 - - 768 apache-2.0 timm
convnext_large_mlp.clip_laion2b_augreg_ft_in12k_384 384 - - 11821 apache-2.0 timm
convnext_large_mlp.clip_laion2b_augreg_ft_in1k 256 87.344 256 1000 apache-2.0 timm
convnext_large_mlp.clip_laion2b_augreg_ft_in1k_384 384 87.890 384 1000 apache-2.0 timm
convnext_large_mlp.clip_laion2b_ft_320 320 - - 768 apache-2.0 timm
convnext_large_mlp.clip_laion2b_ft_soup_320 320 - - 768 apache-2.0 timm
convnext_large_mlp.clip_laion2b_soup_ft_in12k_320 320 - - 11821 apache-2.0 timm
convnext_large_mlp.clip_laion2b_soup_ft_in12k_384 384 - - 11821 apache-2.0 timm
convnext_large_mlp.clip_laion2b_soup_ft_in12k_in1k_320 320 87.970 320 1000 apache-2.0 timm
convnext_large_mlp.clip_laion2b_soup_ft_in12k_in1k_384 384 88.334 384 1000 apache-2.0 timm
convnext_xxlarge.clip_laion2b_rewind 256 - - 1024 apache-2.0 timm
convnext_xxlarge.clip_laion2b_soup 256 - - 1024 apache-2.0 timm
convnext_xxlarge.clip_laion2b_soup_ft_in12k 256 - - 11821 apache-2.0 timm
convnext_xxlarge.clip_laion2b_soup_ft_in1k 256 88.622 256 1000 apache-2.0 timm

fb tags

Tabla (20 filas)
Weight Input size Top-1 (%) Eval size Classes License Hub
convnext_base.fb_in1k 224 (test 288) 84.466 288 1000 apache-2.0 timm
convnext_base.fb_in22k 224 - - 21841 apache-2.0 timm
convnext_base.fb_in22k_ft_in1k 224 (test 288) 86.302 288 1000 apache-2.0 timm
convnext_base.fb_in22k_ft_in1k_384 384 86.826 384 1000 apache-2.0 timm
convnext_large.fb_in1k 224 (test 288) 84.862 288 1000 apache-2.0 timm
convnext_large.fb_in22k 224 - - 21841 apache-2.0 timm
convnext_large.fb_in22k_ft_in1k 224 (test 288) 87.012 288 1000 apache-2.0 timm
convnext_large.fb_in22k_ft_in1k_384 384 87.456 384 1000 apache-2.0 timm
convnext_small.fb_in1k 224 (test 288) 83.704 288 1000 apache-2.0 timm
convnext_small.fb_in22k 224 - - 21841 apache-2.0 timm
convnext_small.fb_in22k_ft_in1k 224 (test 288) 85.276 288 1000 apache-2.0 timm
convnext_small.fb_in22k_ft_in1k_384 384 85.752 384 1000 apache-2.0 timm
convnext_tiny.fb_in1k 224 (test 288) 82.694 288 1000 apache-2.0 timm
convnext_tiny.fb_in22k 224 - - 21841 apache-2.0 timm
convnext_tiny.fb_in22k_ft_in1k 224 (test 288) 78.950 288 1000 apache-2.0 timm
convnext_tiny.fb_in22k_ft_in1k_384 384 84.098 384 1000 apache-2.0 timm
convnext_xlarge.fb_in22k 224 - - 21841 apache-2.0 timm
convnext_xlarge.fb_in22k_ft_in1k 224 (test 288) 87.378 288 1000 apache-2.0 timm
convnext_xlarge.fb_in22k_ft_in1k_384 384 87.764 384 1000 apache-2.0 timm

d1 tags

Weight Input size Top-1 (%) Eval size Classes License Hub
convnext_femto.d1_in1k 224 (test 288) 78.712 288 1000 apache-2.0 timm
convnext_femto_ols.d1_in1k 224 (test 288) 78.916 288 1000 apache-2.0 timm
convnext_pico.d1_in1k 224 (test 288) 80.426 288 1000 apache-2.0 timm
convnext_pico_ols.d1_in1k 224 (test 288) 80.458 288 1000 apache-2.0 timm

dinov3 tags

Weight Input size Top-1 (%) Eval size Classes License Hub
convnext_base.dinov3_lvd1689m 224 - - none dinov3-license timm
convnext_large.dinov3_lvd1689m 224 - - none dinov3-license timm
convnext_small.dinov3_lvd1689m 224 - - none dinov3-license timm
convnext_tiny.dinov3_lvd1689m 224 - - none dinov3-license timm

eupe tags

Weight Input size Top-1 (%) Eval size Classes License Hub
convnext_base.eupe_lvd1689m 256 - - none fair-noncommercial-research-license timm
convnext_small.eupe_lvd1689m 256 - - none fair-noncommercial-research-license timm
convnext_tiny.eupe_lvd1689m 256 - - none fair-noncommercial-research-license timm

d1h tags

Weight Input size Top-1 (%) Eval size Classes License Hub
convnext_nano.d1h_in1k 224 (test 288) 81.474 288 1000 apache-2.0 timm
convnext_nano_ols.d1h_in1k 224 (test 288) 81.612 288 1000 apache-2.0 timm

ra4 tags

Weight Input size Top-1 (%) Eval size Classes License Hub
convnext_zepto_rms.ra4_e3600_r224_in1k 224 72.820 224 1000 apache-2.0 timm
convnext_zepto_rms_ols.ra4_e3600_r224_in1k 224 73.234 224 1000 apache-2.0 timm

Other

Tabla (18 filas)
Weight Input size Top-1 (%) Eval size Classes License Hub
convnext_atto.d2_in1k 224 (test 288) 77.016 288 1000 apache-2.0 timm
convnext_atto_ols.a2_in1k 224 (test 288) 77.220 288 1000 apache-2.0 timm
convnext_nano.in12k 224 - - 11821 apache-2.0 timm
convnext_nano.in12k_ft_in1k 224 (test 288) 82.882 288 1000 apache-2.0 timm
convnext_nano.r384_ad_in12k 384 - - 11821 apache-2.0 timm
convnext_nano.r384_in12k 384 - - 11821 apache-2.0 timm
convnext_nano.r384_in12k_ft_in1k 384 83.334 384 1000 apache-2.0 timm
convnext_small.in12k 224 - - 11821 apache-2.0 timm
convnext_small.in12k_ft_in1k 224 (test 288) 85.324 288 1000 apache-2.0 timm
convnext_small.in12k_ft_in1k_384 384 86.186 384 1000 apache-2.0 timm
convnext_tiny.in12k 224 - - 11821 apache-2.0 timm
convnext_tiny.in12k_ft_in1k 224 (test 288) 84.448 288 1000 apache-2.0 timm
convnext_tiny.in12k_ft_in1k_384 384 85.154 384 1000 apache-2.0 timm
convnext_tiny_hnf.a2h_in1k 224 (test 288) 82.608 288 1000 apache-2.0 timm
test_convnext.r160_in1k 160 47.774 160 1000 apache-2.0 timm
test_convnext2.r160_in1k 160 53.520 160 1000 apache-2.0 timm
test_convnext3.r160_in1k 160 53.302 160 1000 apache-2.0 timm

Citation

@Article{liu2022convnet,
  author  = {Zhuang Liu and Hanzi Mao and Chao-Yuan Wu and Christoph Feichtenhofer and Trevor Darrell and Saining Xie},
  title   = {A ConvNet for the 2020s},
  journal = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year    = {2022},
}

@article{Woo2023ConvNeXtV2,
  title={ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders},
  author={Sanghyun Woo, Shoubhik Debnath, Ronghang Hu, Xinlei Chen, Zhuang Liu, In So Kweon and Saining Xie},
  year={2023},
  journal={arXiv preprint arXiv:2301.00808},
}

Source and license

Source: timm documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.