Docling DocumentFigureClassifier v2.5 (fastforks)
docling's classifier for figures cut out of documents: EfficientNet-B0 fine-tuned on FinePDFs figures into 26 classes (charts, tables, logos, signatures, maps, QR codes, ...).
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://huggingface.co/docling-project/DocumentFigureClassifier-v2.5 at f859dfbff5c9.
Author weight repos: https://huggingface.co/docling-project/DocumentFigureClassifier-v2.5.
Task: classification. Tier: stable. Outputs: logits. Backends: portable, kernels.
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 |
|---|---|---|---|---|
docling-figure-classifier-v2.5@1 |
docling-figure-classifier-v2.5.safetensors | 6bf1e44d6bce |
MIT | 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-1k (ILSVRC 2012 classification), Figures of the FinePDFs documents (Hugging Face HuggingFaceFW/finepdfs), labelled by docling-project; the base network was ImageNet-1k pretrained.
Licence evidence: https://huggingface.co/docling-project/DocumentFigureClassifier-v2.5/blob/f859dfbff5c9916cd996942d4b0db7fa25808220/README.md
Input size
fixed 224x224: the input is resized (short side 224) and centre-cropped to it
Tested up to (portable, fp16, RTX 5060 Ti 16 GB): docling-figure-classifier-v2.5 224x224 (0.0 GiB peak allocated, 0.1 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 |
|---|---|---|---|---|---|---|---|---|---|---|
docling-figure-classifier-v2.5 |
224x224 | 6.98 | 7.73 | 4.92 | 2.90 | 2.4x | 1.7x | 47 / 66 | 46 / 70 | 46 / 70 |
Classification, real figure (depth-fm assets/figures/sota-comparison.jpg), 1543x679
| model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|
docling-figure-classifier-v2.5 |
6.30 | 7.17 | 4.99 | 2.91 | 2.2x | 1.7x | 67 / 78 | 67 / 94 | 67 / 94 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
docling-figure-classifier-v2.5 |
0.09 | 0.15 | 0.20โ | 0.01 | 0.01 | 0.00 |
torch.compile and TensorRT
| model | input | time: portable | compile | TensorRT (fp16 unless shown) | kernels | preparation: compile (cold first call) | ONNX + engine build | peak MiB (alloc / reserved): portable | compile | kernels | TensorRT (engine + torch) |
|---|---|---|---|---|---|---|---|---|---|---|---|
docling-figure-classifier-v2.5 |
224x224 | 4.92 ms | 5.47 ms | 0.537 ms | 2.90 ms | 10.7 s | 19.9 s | 46 / 70 | 78 / 94 | 46 / 70 | 79 / 92 |
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
Parity with the original code
Every variant is checked against reference outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.02 and p99 <= 0.25 (absolute error of the output logits).
Limitations
- The classes are rough: the card reports 0.91 accuracy but only 0.69 balanced accuracy on its held-out FinePDFs split (rare classes such as calendar, crossword puzzle or stamp have recall below 0.45).
- The image is stretched to 224 x 224 without keeping its aspect ratio, as the original pipeline does.
Usage
from fastforks import classification
model = classification.load("docling-figure-classifier-v2.5") # 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: docling-figure-classifier-v2.5.
Kernels backend
classification.load("docling-figure-classifier-v2.5", mode="kernels") runs our CUDA kernels (cudnn_hacc, fvm_conv, fvm_extra, fvm_mb, fvm_r3). It needs a prebuilt kernel for your GPU architecture (downloaded from https://huggingface.co/fastforks/kernels on first use) and a recent NVIDIA driver; if there is none it raises BackendUnavailableError with the reason and never falls back silently. mode="auto" picks kernels when it can run and logs the choice.
Model tree for fastforks/document-figure
Base model
google/efficientnet-b0