HGNetV2 (fastforks)

HGNetV2 (PaddlePaddle, PP-HGNetV2): a convolutional classifier of aggregation blocks with light 5x5 convolutions, SSLD-distilled and fine-tuned on ImageNet-1k.

This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: https://github.com/kleinicke/fastforks. Kernels for the kernels backend: https://huggingface.co/fastforks/kernels. Original code: https://github.com/huggingface/pytorch-image-models at 0df212b369a5.

Author weight repos: https://huggingface.co/timm/hgnetv2_b0.ssld_stage2_ft_in1k, https://huggingface.co/timm/hgnetv2_b1.ssld_stage2_ft_in1k, https://huggingface.co/timm/hgnetv2_b2.ssld_stage2_ft_in1k, https://huggingface.co/timm/hgnetv2_b3.ssld_stage2_ft_in1k, https://huggingface.co/timm/hgnetv2_b4.ssld_stage2_ft_in1k, https://huggingface.co/timm/hgnetv2_b5.ssld_stage2_ft_in1k, https://huggingface.co/timm/hgnetv2_b6.ssld_stage2_ft_in1k.

Task: classification. Tier: experimental. Outputs: logits. Backends: portable.

Input: one RGB image. Output: ImageNet-1k class logits.

Variants

Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in card.toml.

variant weights (author link) SHA-256 weights licence commercial use
hgnetv2_b0.ssld_stage2_ft_in1k@1 hgnetv2_b0.ssld_stage2_ft_in1k.safetensors a84094d2a9ed Apache-2.0 yes
hgnetv2_b1.ssld_stage2_ft_in1k@1 hgnetv2_b1.ssld_stage2_ft_in1k.safetensors 4a9d49b24bca Apache-2.0 yes
hgnetv2_b2.ssld_stage2_ft_in1k@1 hgnetv2_b2.ssld_stage2_ft_in1k.safetensors 184700043cfb Apache-2.0 yes
hgnetv2_b3.ssld_stage2_ft_in1k@1 hgnetv2_b3.ssld_stage2_ft_in1k.safetensors f9769b32ab1f Apache-2.0 yes
hgnetv2_b4.ssld_stage2_ft_in1k@1 hgnetv2_b4.ssld_stage2_ft_in1k.safetensors 8d05f750c530 Apache-2.0 yes
hgnetv2_b5.ssld_stage2_ft_in1k@1 hgnetv2_b5.ssld_stage2_ft_in1k.safetensors 839782a6a43c Apache-2.0 yes
hgnetv2_b6.ssld_stage2_ft_in1k@1 hgnetv2_b6.ssld_stage2_ft_in1k.safetensors 4febffb69be0 Apache-2.0 yes

Licence

Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0.

Training data: ImageNet-21k / ImageNet-22k (full ImageNet, fall 2011 release), ImageNet-1k (ILSVRC 2012 classification).

Licence evidence: https://huggingface.co/timm/hgnetv2_b0.ssld_stage2_ft_in1k/blob/9e0a904b210d65e4fcd6582f8ca6e0921fac2650/README.md

Input size

fixed 224x224: the input is resized (short side 232) and centre-cropped to it Tested up to (portable, fp16, RTX 5060 Ti 16 GB): hgnetv2_b0.ssld_stage2_ft_in1k 224x224 (0.0 GiB peak allocated, 0.1 reserved); hgnetv2_b1.ssld_stage2_ft_in1k 224x224 (0.0 GiB peak allocated, 0.1 reserved); hgnetv2_b2.ssld_stage2_ft_in1k 224x224 (0.1 GiB peak allocated, 0.1 reserved); hgnetv2_b3.ssld_stage2_ft_in1k 224x224 (0.1 GiB peak allocated, 0.1 reserved); hgnetv2_b4.ssld_stage2_ft_in1k 224x224 (0.1 GiB peak allocated, 0.1 reserved); hgnetv2_b5.ssld_stage2_ft_in1k 224x224 (0.1 GiB peak allocated, 0.1 reserved); hgnetv2_b6.ssld_stage2_ft_in1k 224x224 (0.2 GiB peak allocated, 0.2 reserved)

Speed and memory

Classification, synthetic

model input time (ms): original fp32 original portable kernels kernels speed-up: vs original vs portable peak memory (MiB, allocated / reserved): original portable kernels
hgnetv2_b0.ssld_stage2_ft_in1k 224x224 4.45 5.89 3.46 – – – 68 / 72 48 / 70 –
hgnetv2_b1.ssld_stage2_ft_in1k 224x224 4.57 6.17 3.47 – – – 70 / 92 50 / 68 –
hgnetv2_b2.ssld_stage2_ft_in1k 224x224 6.25 7.98 4.55 – – – 98 / 118 59 / 94 –
hgnetv2_b3.ssld_stage2_ft_in1k 224x224 7.16 9.30 5.22 – – – 127 / 140 76 / 114 –
hgnetv2_b4.ssld_stage2_ft_in1k 224x224 7.06 8.41 4.53 – – – 147 / 166 82 / 116 –
hgnetv2_b5.ssld_stage2_ft_in1k 224x224 11.4 13.8 7.04 – – – 260 / 280 114 / 150 –
hgnetv2_b6.ssld_stage2_ft_in1k 224x224 16.5 17.9 9.44 – – – 465 / 490 198 / 224 –

Startup and first call

model load (s): original portable kernels first call (s): original portable kernels
hgnetv2_b0.ssld_stage2_ft_in1k 0.19 1.67 – 1.36 0.73 –
hgnetv2_b1.ssld_stage2_ft_in1k 0.31 1.87 – 0.31 0.40 –
hgnetv2_b2.ssld_stage2_ft_in1k 0.23 1.79 – 0.59 0.39 –
hgnetv2_b3.ssld_stage2_ft_in1k 0.27 1.81 – 0.17 0.40 –
hgnetv2_b4.ssld_stage2_ft_in1k 0.32 1.74 – 0.30 0.39 –
hgnetv2_b5.ssld_stage2_ft_in1k 0.49 1.95 – 0.30 0.40 –
hgnetv2_b6.ssld_stage2_ft_in1k 0.86 2.21 – 0.45 0.46 –

torch.compile and TensorRT

model input time: portable compile TensorRT fp16 kernels preparation: compile (cold first call) ONNX + engine build peak MiB (alloc / reserved): portable compile kernels TensorRT (engine + torch)
hgnetv2_b0.ssld_stage2_ft_in1k 224x224 3.46 ms 1.78 ms 0.334 ms – 6.74 s 21.2 s 48 / 70 78 / 110 – 77 / 100
hgnetv2_b1.ssld_stage2_ft_in1k 224x224 3.47 ms 1.84 ms 0.307 ms – 7.07 s 20.1 s 50 / 68 80 / 108 – 81 / 104
hgnetv2_b2.ssld_stage2_ft_in1k 224x224 4.55 ms 2.33 ms 0.383 ms – 7.65 s 23.4 s 59 / 94 89 / 134 – 91 / 128
hgnetv2_b3.ssld_stage2_ft_in1k 224x224 5.22 ms 2.55 ms 0.436 ms – 7.99 s 24.6 s 76 / 114 99 / 152 – 100 / 150
hgnetv2_b4.ssld_stage2_ft_in1k 224x224 4.53 ms 2.66 ms 0.463 ms – 7.84 s 19.8 s 82 / 116 107 / 134 – 139 / 182
hgnetv2_b5.ssld_stage2_ft_in1k 224x224 7.04 ms 4.13 ms 0.758 ms – 9.97 s 23.8 s 114 / 150 146 / 190 – 209 / 250
hgnetv2_b6.ssld_stage2_ft_in1k 224x224 9.44 ms 5.44 ms 1.42 ms – 11.2 s 26.9 s 198 / 224 217 / 264 – 347 / 394

Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).

Hardware, protocol and caveats: benchmarks (RTX 5060 Ti 16 GB, sm_120). Original = the original code named above at the precision of portable (fp16, or (fp32) where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's.

Accuracy

On public datasets

fastforks: the model's own resize / crop on the GPU; original: the library's pretrained loader and its PIL eval transform. Original = the original code named under Details, same checkpoint and protocol.

variant dataset original fp32 original fp16 portable note
hgnetv2_b0.ssld_stage2_ft_in1k ImageNet-1k val, 5000 random images, top-1 / top-5 % 78.50 / 93.98 78.40 / 93.96 78.50 / 94.04
hgnetv2_b1.ssld_stage2_ft_in1k ImageNet-1k val, 5000 random images, top-1 / top-5 % 80.08 / 94.40 80.00 / 94.46 80.12 / 94.38
hgnetv2_b2.ssld_stage2_ft_in1k ImageNet-1k val, 5000 random images, top-1 / top-5 % 82.50 / 95.92 82.48 / 95.92 82.50 / 95.92
hgnetv2_b3.ssld_stage2_ft_in1k ImageNet-1k val, 5000 random images, top-1 / top-5 % 83.68 / 96.08 83.68 / 96.08 83.66 / 96.02
hgnetv2_b4.ssld_stage2_ft_in1k ImageNet-1k val, 5000 random images, top-1 / top-5 % 83.96 / 96.66 83.98 / 96.66 84.00 / 96.64
hgnetv2_b5.ssld_stage2_ft_in1k ImageNet-1k val, 5000 random images, top-1 / top-5 % 85.50 / 97.14 85.52 / 97.14 85.52 / 97.18
hgnetv2_b6.ssld_stage2_ft_in1k ImageNet-1k val, 5000 random images, top-1 / top-5 % 86.60 / 97.94 86.60 / 97.94 86.74 / 98.00

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 7ba7307f, 2026-11-11.

Parity with the original code

Every variant is checked against reference outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 1.8e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.008 and p99 <= 0.033 (absolute error of the output logits).

Usage

from fastforks import classification

model = classification.load("hgnetv2_b0.ssld_stage2_ft_in1k")  # mode="auto": the preferred backend from recorded measurements
result = model("photo.jpg")
result.top(5)  # top-5 classes
result.backend  # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')

Install with pip install fastforks (see https://github.com/kleinicke/fastforks). Other variants: hgnetv2_b0.ssld_stage2_ft_in1k, hgnetv2_b1.ssld_stage2_ft_in1k, hgnetv2_b2.ssld_stage2_ft_in1k, hgnetv2_b3.ssld_stage2_ft_in1k, hgnetv2_b4.ssld_stage2_ft_in1k, hgnetv2_b5.ssld_stage2_ft_in1k, hgnetv2_b6.ssld_stage2_ft_in1k.

Kernels backend

No kernels backend: not built yet: the portable CNN path is validated; HGNetV2 aggregation blocks need a dedicated kernels runner.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including fastforks/hgnetv2