Instructions to use avbiswas/yolo11n-doclaynet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use avbiswas/yolo11n-doclaynet with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("avbiswas/yolo11n-doclaynet", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
YOLO11n DocLayNet: document layout detection
A 2.6M-parameter YOLO11n that finds layout regions on document pages: Caption, Footnote, Formula, List-item, Page-footer, Page-header, Picture, Section-header, Table, Text and Title.
On a 2,500-page DocLayNet test subset it scores 0.760 mAP50-95, slightly above the public YOLO11s DocLayNet model (0.744), which has about 3.5× more parameters.
License
This model is a fine-tune of Ultralytics YOLO11 (COCO-pretrained yolo11n.pt), trained with the Ultralytics library, both of which are licensed AGPL-3.0. The weights are therefore distributed under AGPL-3.0: if you use them in software you distribute, or in a service offered over a network, that software must be released under AGPL-3.0 as well. For a commercial license, see Ultralytics licensing.
Training data: DocLayNet (CDLA-Permissive-1.0) by IBM Research.
Usage
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
model = YOLO(hf_hub_download("avbiswas/yolo11n-doclaynet", "yolo11n-doclaynet.pt"))
results = model.predict("page.png", imgsz=1024, conf=0.25)
for box in results[0].boxes:
print(model.names[int(box.cls)], float(box.conf), box.xyxy.tolist())
Render PDF pages at about 144 DPI (for example with PyMuPDF) and run at imgsz=1024.
Results
DocLayNet v1.2 test subset, 2,500 pages (shards 0, 2 and 4 of the test split), all six document categories. mAP50-95 at 1024 px, evaluated with Ultralytics' validator:
| Class | This model (YOLO11n) | hantian/yolo-doclaynet YOLO11s |
|---|---|---|
| All | 0.760 | 0.744 |
| mAP50 (all) | 0.903 | 0.906 |
| Caption | 0.785 | 0.793 |
| Footnote | 0.642 | 0.620 |
| Formula | 0.746 | 0.714 |
| List-item | 0.819 | 0.816 |
| Page-footer | 0.699 | 0.569 |
| Page-header | 0.761 | 0.698 |
| Picture | 0.758 | 0.787 |
| Section-header | 0.708 | 0.711 |
| Table | 0.789 | 0.819 |
| Text | 0.851 | 0.852 |
| Title | 0.802 | 0.803 |
Both models were evaluated with the same script on the same pages, from DocLayNet's official test split, which neither model saw in training.
ONNX exports measured on the same test pages: fp32 0.7545, fp16 0.7534, int8 0.7476 mAP50-95 (the gap to 0.760 comes from fixed square padding in the ONNX evaluation, not from the export).
Training
- Starting point: COCO-pretrained
yolo11n.pt. - Data: all of DocLayNet v1.2 train (69,375 pages, all six categories including patents). Pages containing a rare class (Title, Footnote, Formula) were repeated 3×, giving 88,463 entries per epoch.
- Settings: 1024 px, batch 64, cosine LR, 22 epochs on one A100 (about 3 h), best validation epoch kept.
- Document-specific augmentation: no flips or rotation, light colour jitter, mosaic on, scale ±25%.
Limitations
- Trained on DocLayNet's domains: financial reports, manuals, scientific articles, laws and regulations, patents and government tenders. Slides, forms, receipts and handwriting are out of distribution.
- Pictures and tables are its weakest classes compared with the larger model.
- It only finds regions. Reading order and text extraction are separate steps.
- Downloads last month
- 68