File size: 9,179 Bytes
fc08c11 abac692 fc08c11 abac692 fc08c11 29479bb fc08c11 29479bb fc08c11 29479bb fc08c11 abac692 fc08c11 29479bb fc08c11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | ---
license: apache-2.0
language:
- zh
- en
pipeline_tag: object-detection
tags:
- document-ai
- document-layout-analysis
- patent
- pdf
- hiro
- patsnap
datasets:
- in-house
metrics:
- precision
- recall
- f1
---
# Hiro-Layout:面向专利和技术 PDF 的文档版面分析模型
[English](README.md) | 简体中文
Hiro-Layout 是一个面向专利和技术 PDF 页面图像的文档版面分析模型,用于检测并分类页面区域,包括正文、标题、页眉、页脚、表格、公式、化学式、图片、图注、搜索报告、著录页、参考文献等专利场景常见版面元素。
## 亮点
- 面向专利文档:覆盖专利 PDF 中常见的正文、图片、表格、公式、著录页、搜索报告等元素。
- 覆盖技术文档:在 Patent PDF 和 NPD PDF 两类数据上评测。
- 细粒度类别体系:共 25 个版面类别,覆盖 figure、text、complex 三组元素。
## 模型概览
| 项目 | 内容 |
| --- | --- |
| 模型名称 | Hiro-Layout |
| 当前模型文件 | `layout_model/RT-DETR_25.onnx` |
| 任务 | 文档版面分析 / 页面区域检测 |
| 输入 | PDF 页面渲染图像 |
| 输出 | 带类别标签的版面区域 |
| 领域 | 专利 PDF、技术/NPD PDF |
| 开源协议 | Apache-2.0 |
## 类别体系
| 大类 | 类别全称 | 缩写 | 中文名 |
| --- | --- | --- | --- |
| figure | graph | graph | 图表 |
| figure | drawing | draw | 绘制图 |
| figure | structure diagram | struc | 结构图 |
| figure | photograph | photo | 照片 |
| figure | table | tab | 表格 |
| figure | math equation | eqn | 数学公式 |
| figure | chemical formula | chem | 化学式 |
| figure | noise | noise | 噪声 |
| text | text | text | 文本 |
| text | title | title | 标题 |
| text | section title | sec | 章节标题 |
| text | page header | head | 页眉 |
| text | page footer | foot | 页脚 |
| text | marginal note | mnote | 边注 |
| text | caption | cap | 说明 |
| text | figure number | figno | 编号 |
| text | line number | lineno | 行号 |
| text | column number | colno | 栏号 |
| text | sequence | seq | 序列表 |
| complex | figure complex | figcx | 图片组 |
| complex | chemical reaction | rxn | 反应式 |
| complex | bibliography | bib | 著录页 |
| complex | search report | srep | 搜索报告 |
| complex | Table of Contents | toc | 目录 |
| complex | reference | ref | 参考文献 |
## 评测结果
评测指标为 Precision、Recall 和 F1。
| 数据集 | 人工标签数 | Precision | Recall | F1 |
| --- | ---: | ---: | ---: | ---: |
| Patent PDF | 33,054 | 0.8144 | 0.7711 | 0.7922 |
| NPD PDF | 17,769 | 0.7090 | 0.6983 | 0.7036 |
### Patent PDF
| # | 大类 | 缩写 | 类别全称 | 中文名 | 人工标签数 | Precision | Recall | F1 |
|---:|---|---|---|---|---:|---:|---:|---:|
| 1 | figure | graph | graph | 图表 | 215 | 0.7611 | 0.8000 | 0.7800 |
| 2 | figure | draw | drawing | 绘制图 | 420 | 0.8649 | 0.3048 | 0.4507 |
| 3 | figure | struc | structure diagram | 结构图 | 626 | 0.6579 | 0.8355 | 0.7361 |
| 4 | figure | photo | photograph | 照片 | 147 | 0.8378 | 0.8435 | 0.8407 |
| 5 | figure | tab | table | 表格 | 198 | 0.7759 | 0.9091 | 0.8372 |
| 6 | figure | eqn | math equation | 数学公式 | 399 | 0.7762 | 0.6692 | 0.7187 |
| 7 | figure | chem | chemical formula | 化学式 | 1,099 | 0.8792 | 0.8944 | 0.8868 |
| 8 | figure | noise | noise | 噪声 | 1,241 | 0.7025 | 0.7687 | 0.7341 |
| 9 | text | text | text | 文本 | 17,668 | 0.8182 | 0.8062 | 0.8122 |
| 10 | text | title | title | 标题 | 601 | 0.9117 | 0.8070 | 0.8561 |
| 11 | text | sec | section title | 章节标题 | 1,394 | 0.7968 | 0.7088 | 0.7502 |
| 12 | text | head | page header | 页眉 | 3,074 | 0.8187 | 0.7788 | 0.7983 |
| 13 | text | foot | page footer | 页脚 | 1,012 | 0.7432 | 0.6433 | 0.6896 |
| 14 | text | mnote | marginal note | 边注 | 421 | 0.7794 | 0.5202 | 0.6239 |
| 15 | text | cap | caption | 说明 | 80 | 0.6842 | 0.4875 | 0.5693 |
| 16 | text | figno | figure number | 编号 | 1,389 | 0.8955 | 0.7466 | 0.8143 |
| 17 | text | lineno | line number | 行号 | 341 | 0.7759 | 0.6598 | 0.7132 |
| 18 | text | colno | column number | 栏号 | 449 | 0.6964 | 0.4699 | 0.5612 |
| 19 | text | seq | sequence | 序列表 | 136 | 0.4430 | 0.2574 | 0.3256 |
| 20 | complex | figcx | figure complex | 图片组 | 1,416 | 0.8657 | 0.7373 | 0.7963 |
| 21 | complex | rxn | chemical reaction | 反应式 | 150 | 0.8898 | 0.7000 | 0.7836 |
| 22 | complex | bib | bibliography | 著录页 | 470 | 0.9615 | 0.7979 | 0.8721 |
| 23 | complex | srep | search report | 搜索报告 | 106 | 0.9052 | 0.9906 | 0.9459 |
| 24 | complex | toc | Table of Contents | 目录 | 0 | 0.0000 | 0.0000 | 0.0000 |
| 25 | complex | ref | reference | 参考文献 | 2 | 0.0000 | 0.0000 | 0.0000 |
| ALL | | | | | 33,054 | 0.8144 | 0.7711 | 0.7922 |
### NPD PDF
| # | 大类 | 缩写 | 类别全称 | 中文名 | 人工标签数 | Precision | Recall | F1 |
|---:|---|---|---|---|---:|---:|---:|---:|
| 1 | figure | graph | graph | 图表 | 248 | 0.6838 | 0.6976 | 0.6906 |
| 2 | figure | draw | drawing | 绘制图 | 9 | 0.0000 | 0.0000 | 0.0000 |
| 3 | figure | struc | structure diagram | 结构图 | 341 | 0.7454 | 0.7126 | 0.7286 |
| 4 | figure | photo | photograph | 照片 | 82 | 0.6071 | 0.6220 | 0.6145 |
| 5 | figure | tab | table | 表格 | 209 | 0.7533 | 0.8182 | 0.7844 |
| 6 | figure | eqn | math equation | 数学公式 | 298 | 0.6789 | 0.5604 | 0.6140 |
| 7 | figure | chem | chemical formula | 化学式 | 388 | 0.7324 | 0.8325 | 0.7793 |
| 8 | figure | noise | noise | 噪声 | 695 | 0.4823 | 0.4302 | 0.4548 |
| 9 | text | text | text | 文本 | 9,119 | 0.6943 | 0.7625 | 0.7268 |
| 10 | text | title | title | 标题 | 304 | 0.7130 | 0.5395 | 0.6142 |
| 11 | text | sec | section title | 章节标题 | 1,539 | 0.7337 | 0.6160 | 0.6697 |
| 12 | text | head | page header | 页眉 | 1,246 | 0.7464 | 0.7111 | 0.7283 |
| 13 | text | foot | page footer | 页脚 | 1,339 | 0.7711 | 0.6468 | 0.7035 |
| 14 | text | mnote | marginal note | 边注 | 190 | 0.5714 | 0.2947 | 0.3889 |
| 15 | text | cap | caption | 说明 | 573 | 0.8711 | 0.5899 | 0.7034 |
| 16 | text | figno | figure number | 编号 | 149 | 0.6078 | 0.4161 | 0.4940 |
| 17 | text | lineno | line number | 行号 | 41 | 0.6667 | 0.9268 | 0.7755 |
| 18 | text | colno | column number | 栏号 | 0 | 0.0000 | 0.0000 | 0.0000 |
| 19 | text | seq | sequence | 序列表 | 18 | 0.7000 | 0.3889 | 0.5000 |
| 20 | complex | figcx | figure complex | 图片组 | 734 | 0.7657 | 0.7480 | 0.7567 |
| 21 | complex | rxn | chemical reaction | 反应式 | 36 | 0.8947 | 0.4722 | 0.6182 |
| 22 | complex | bib | bibliography | 著录页 | 0 | 0.0000 | 0.0000 | 0.0000 |
| 23 | complex | srep | search report | 搜索报告 | 3 | 0.4286 | 1.0000 | 0.6000 |
| 24 | complex | toc | Table of Contents | 目录 | 76 | 0.8475 | 0.6579 | 0.7407 |
| 25 | complex | ref | reference | 参考文献 | 132 | 0.8148 | 0.3333 | 0.4731 |
| ALL | | | | | 17,769 | 0.7090 | 0.6983 | 0.7036 |
## 使用方式
当前模型文件是 ONNX 导出:
```text
layout_model/RT-DETR_25.onnx
```
先从 Hugging Face Hub 下载仓库,再使用 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()])
```
25 类标签映射见 `labels.json`。
## 文件说明
| 文件 | 用途 |
| --- | --- |
| `README.md` | 英文 Hugging Face 模型卡 |
| `README_zh.md` | 中文模型卡 |
| `config.json` | Hugging Face Hub 工具和下载统计使用的模型元数据 |
| `EVALUATION.md` | 从 Excel 整理出的详细评测结果 |
| `labels.json` | 机器可读的 25 类标签映射 |
| `layout_model/RT-DETR_25.onnx` | ONNX 模型文件 |
| `requirements.txt` | ONNX 加载和图像预处理的最小依赖 |
| `LICENSE` | Apache-2.0 协议 |
| `DISCLAIMER.md` | 模型限制和负责任使用说明 |
| `NOTICE` | 版权和商标声明 |
| `OPEN_SOURCE_CHECKLIST.md` | 正式公开前检查清单 |
## 限制
- 低分辨率扫描件、大角度旋转页面、手写文档、非常规版式或未覆盖模板可能导致检测不准。
- 少样本类别的指标波动较大,不能仅凭单类指标判断泛化能力。
- 法律、合规、归档、对客展示等高风险场景应保留人工复核。
- 用户需确保对所处理和分享的文档拥有相应权利。
## 协议
本项目采用 Apache License 2.0 开源协议,详见 [LICENSE](LICENSE)。
## 版权声明
Copyright (c) 2026 Patsnap. All rights reserved except as expressly licensed under the applicable license terms.
Hiro-Layout、Hiro、Patsnap 以及相关名称、标识、产品名、服务名、设计和标语是 Patsnap 或其关联公司的商标或注册商标。除非另有明确说明,开源协议或模型协议不授予任何商标许可。
|