CoolFace
Modelpublic

PatSnap/Hiro-Layout

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
8likes42downloads
Model Card

Hiro-Layout: Document Layout Analysis for Patent and Technical PDFs

English | 简体中文

![Hugging Face Spaces](https://huggingface.co/spaces/PatSnap/Hiro-SmartDoc)

Hiro-Layout is a document layout analysis model for patent and technical PDF pages. It detects and classifies page regions such as text, titles, headers, footers, tables, formulas, chemical structures, figures, captions, search reports, bibliographies, and other patent-specific layout elements.

Highlights

  • Patent-focused layout understanding: covers common patent PDF regions and patent-specific structures.
  • Technical document coverage: evaluated on both patent PDFs and NPD PDFs.
  • Fine-grained taxonomy: 25 layout categories across figure, text, and complex document elements.

Model Overview

ItemDetails
Model nameHiro-Layout
Current artifactlayout_model/RT-DETR_25.onnx
TaskDocument layout analysis / page region detection
InputRendered PDF page image
OutputLayout regions with class labels
DomainsPatent PDFs, technical/NPD PDFs
LicenseApache-2.0

Layout Taxonomy

GroupClassAbbr.Chinese
figuregraphgraph图表
figuredrawingdraw绘制图
figurestructure diagramstruc结构图
figurephotographphoto照片
figuretabletab表格
figuremath equationeqn数学公式
figurechemical formulachem化学式
figurenoisenoise噪声
texttexttext文本
texttitletitle标题
textsection titlesec章节标题
textpage headerhead页眉
textpage footerfoot页脚
textmarginal notemnote边注
textcaptioncap说明
textfigure numberfigno编号
textline numberlineno行号
textcolumn numbercolno栏号
textsequenceseq序列表
complexfigure complexfigcx图片组
complexchemical reactionrxn反应式
complexbibliographybib著录页
complexsearch reportsrep搜索报告
complexTable of Contentstoc目录
complexreferenceref参考文献

Benchmarks

Metrics are reported as Precision, Recall, and F1.

BenchmarkLabelsPrecisionRecallF1
Patent PDF33,0540.81440.77110.7922
NPD PDF17,7690.70900.69830.7036

Patent PDF

#GroupAbbr.ClassChineseLabelsPrecisionRecallF1
1figuregraphgraph图表2150.76110.80000.7800
2figuredrawdrawing绘制图4200.86490.30480.4507
3figurestrucstructure diagram结构图6260.65790.83550.7361
4figurephotophotograph照片1470.83780.84350.8407
5figuretabtable表格1980.77590.90910.8372
6figureeqnmath equation数学公式3990.77620.66920.7187
7figurechemchemical formula化学式1,0990.87920.89440.8868
8figurenoisenoise噪声1,2410.70250.76870.7341
9texttexttext文本17,6680.81820.80620.8122
10texttitletitle标题6010.91170.80700.8561
11textsecsection title章节标题1,3940.79680.70880.7502
12textheadpage header页眉3,0740.81870.77880.7983
13textfootpage footer页脚1,0120.74320.64330.6896
14textmnotemarginal note边注4210.77940.52020.6239
15textcapcaption说明800.68420.48750.5693
16textfignofigure number编号1,3890.89550.74660.8143
17textlinenoline number行号3410.77590.65980.7132
18textcolnocolumn number栏号4490.69640.46990.5612
19textseqsequence序列表1360.44300.25740.3256
20complexfigcxfigure complex图片组1,4160.86570.73730.7963
21complexrxnchemical reaction反应式1500.88980.70000.7836
22complexbibbibliography著录页4700.96150.79790.8721
23complexsrepsearch report搜索报告1060.90520.99060.9459
24complextocTable of Contents目录00.00000.00000.0000
25complexrefreference参考文献20.00000.00000.0000
ALL33,0540.81440.77110.7922

NPD PDF

#GroupAbbr.ClassChineseLabelsPrecisionRecallF1
1figuregraphgraph图表2480.68380.69760.6906
2figuredrawdrawing绘制图90.00000.00000.0000
3figurestrucstructure diagram结构图3410.74540.71260.7286
4figurephotophotograph照片820.60710.62200.6145
5figuretabtable表格2090.75330.81820.7844
6figureeqnmath equation数学公式2980.67890.56040.6140
7figurechemchemical formula化学式3880.73240.83250.7793
8figurenoisenoise噪声6950.48230.43020.4548
9texttexttext文本9,1190.69430.76250.7268
10texttitletitle标题3040.71300.53950.6142
11textsecsection title章节标题1,5390.73370.61600.6697
12textheadpage header页眉1,2460.74640.71110.7283
13textfootpage footer页脚1,3390.77110.64680.7035
14textmnotemarginal note边注1900.57140.29470.3889
15textcapcaption说明5730.87110.58990.7034
16textfignofigure number编号1490.60780.41610.4940
17textlinenoline number行号410.66670.92680.7755
18textcolnocolumn number栏号00.00000.00000.0000
19textseqsequence序列表180.70000.38890.5000
20complexfigcxfigure complex图片组7340.76570.74800.7567
21complexrxnchemical reaction反应式360.89470.47220.6182
22complexbibbibliography著录页00.00000.00000.0000
23complexsrepsearch report搜索报告30.42861.00000.6000
24complextocTable of Contents目录760.84750.65790.7407
25complexrefreference参考文献1320.81480.33330.4731
ALL17,7690.70900.69830.7036

Online Demo

Hiro-Layout is used by Hiro-Smart-Doc for full document layout analysis and OCR. You can try the hosted demo on Hugging Face Spaces:

PatSnap/Hiro-SmartDoc

Usage

The current model artifact is an ONNX export:

text
layout_model/RT-DETR_25.onnx

Download the repository from the Hugging Face Hub and load the ONNX model with ONNXRuntime:

python
from pathlib import Path

from huggingface_hub import snapshot_download
import onnxruntime as ort

repo_dir = snapshot_download("PatSnap/Hiro-Layout")
model_path = Path(repo_dir) / "layout_model" / "RT-DETR_25.onnx"

session = ort.InferenceSession(str(model_path))
print("inputs:", [i.name for i in session.get_inputs()])
print("outputs:", [o.name for o in session.get_outputs()])

Use labels.json for the 25-class label mapping.

Repository Files

FilePurpose
README.mdHugging Face model card in English
README_zh.mdChinese model card
config.jsonModel metadata used by Hugging Face Hub tooling and download statistics
EVALUATION.mdDetailed benchmark results derived from the workbook
labels.jsonMachine-readable 25-class label mapping
layout_model/RT-DETR_25.onnxONNX model artifact
requirements.txtMinimal dependencies for ONNX loading and image preprocessing
LICENSEApache-2.0 license
DISCLAIMER.mdModel limitations and responsible-use notes
NOTICECopyright and trademark notice
OPEN_SOURCE_CHECKLIST.mdRelease checklist before public upload

Limitations

  • Layout predictions may be inaccurate on low-resolution scans, heavily rotated pages, handwritten documents, unusual patent formats, or unseen page templates.
  • Small objects and sparse categories can have unstable metrics when the evaluation set has very few labels.
  • The model should not be used as the sole source of truth for legal, compliance, filing, archival, or customer-facing workflows without human review.
  • Users are responsible for ensuring they have the right to process and share any documents used with this model.

License

This project is released under the Apache License 2.0. See LICENSE.

Copyright Notice

Copyright (c) 2026 Patsnap. All rights reserved except as expressly licensed under the applicable license terms.

Hiro-Layout, Hiro, Patsnap, and any associated names, logos, product names, service names, designs, and slogans are trademarks or registered trademarks of Patsnap or its affiliates. No trademark license is granted under the open source license or any model license unless expressly stated.