timm documentation

PP-HGNet

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

PP-HGNet

Category: CNN · Code: timm/models/hgnet.py · Architectures: 10 · Pretrained weights: 19 (19 with ImageNet-1k results)

PP-HGNet and PP-HGNetV2 (High Performance GPU Net) from PaddleClas, built from HG blocks that aggregate the outputs of a sequence of convolutions. The ssld weights are trained with PaddleClas SSLD distillation.

Papers

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('hgnet_small.paddle_in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)

Model API support

FeatureHighPerfGpuNet
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 (HighPerfGpuNet with hgnetv2_b0 at 224), other architectures of the same class are expected to behave the same. See the Model API page for details.

Architectures

ArchitectureParams (M)GMACsInput sizePretrained weights
hgnet_base71.5825.142241
hgnet_small24.368.532242
hgnet_tiny14.744.542242
hgnetv2_b06.000.332242
hgnetv2_b16.340.492242
hgnetv2_b211.221.152242
hgnetv2_b316.291.782242
hgnetv2_b419.802.752242
hgnetv2_b539.576.562242
hgnetv2_b675.2616.882242

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.

ssld tags

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
hgnet_base.ssld_in1k224 (test 288)85.4882881000apache-2.0timm
hgnet_small.ssld_in1k224 (test 288)84.3682881000apache-2.0timm
hgnet_tiny.ssld_in1k224 (test 288)82.5282881000apache-2.0timm
hgnetv2_b0.ssld_stage1_in22k_in1k224 (test 288)78.0382881000apache-2.0timm
hgnetv2_b0.ssld_stage2_ft_in1k224 (test 288)78.5902881000apache-2.0timm
hgnetv2_b1.ssld_stage1_in22k_in1k224 (test 288)79.0502881000apache-2.0timm
hgnetv2_b1.ssld_stage2_ft_in1k224 (test 288)79.9162881000apache-2.0timm
hgnetv2_b2.ssld_stage1_in22k_in1k224 (test 288)81.4562881000apache-2.0timm
hgnetv2_b2.ssld_stage2_ft_in1k224 (test 288)82.3622881000apache-2.0timm
hgnetv2_b3.ssld_stage1_in22k_in1k224 (test 288)83.1182881000apache-2.0timm
hgnetv2_b3.ssld_stage2_ft_in1k224 (test 288)83.5882881000apache-2.0timm
hgnetv2_b4.ssld_stage1_in22k_in1k224 (test 288)83.4502881000apache-2.0timm
hgnetv2_b4.ssld_stage2_ft_in1k224 (test 288)83.9522881000apache-2.0timm
hgnetv2_b5.ssld_stage1_in22k_in1k224 (test 288)84.9302881000apache-2.0timm
hgnetv2_b5.ssld_stage2_ft_in1k224 (test 288)85.1582881000apache-2.0timm
hgnetv2_b6.ssld_stage1_in22k_in1k224 (test 288)86.3002881000apache-2.0timm
hgnetv2_b6.ssld_stage2_ft_in1k224 (test 288)86.3802881000apache-2.0timm

paddle tags

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
hgnet_small.paddle_in1k224 (test 288)82.2222881000apache-2.0timm
hgnet_tiny.paddle_in1k224 (test 288)80.6442881000apache-2.0timm
Update on GitHub