Fine-tuned YOLOv8m for 8-class invoice document layout region detection (metadata, vendor/customer blocks, table, line items, summary, payment, column headers).
Model source
Source description
Fine-tuned YOLOv8m for 8-class invoice document layout region detection (metadata, vendor/customer blocks, table, line items, summary, payment, column headers).
Part of the Hub collection Invoice Layout Extraction.
Sources
1 sourceVerified Sep 2
Model artifacts
3 artifactsSource excerpts
2 excerpts| Property | Value |
|---|
| Architecture | YOLOv8m (25.9M params, 78.9 GFLOPs) |
| Base weights | ultralytics/yolov8m |
| Input size | 1024 px |
| Classes | 8 layout regions |
| Training epochs | 100 (best @ epoch 98) |
| Optimizer | AdamW |
| Dataset | AvoCahDoe/invoice-annotated-bbox |
| Demo Space | AvoCahDoe/invoice-layout-yolov8n-demo |
| Train / val / test | 372 / 14 / 7 pages |
| ID | Name |
|---|---|
| 0 | invoice_metadata |
| 1 | vendor_block |
| 2 | customer_block |
| 3 | table_block |
| 4 | line_item |
| 5 | summary_block |
| 6 | payment_block |
| 7 | Column |
| Metric | Value |
|---|---|
| mAP50 | 0.8388 |
| mAP50-95 | 0.5289 |
| Precision | 0.9077 |
| Recall | 0.8580 |
| Metric | Best | Final (epoch 100) |
|---|---|---|
| mAP50 | 0.8581 | 0.8578 |
| mAP50-95 | 0.5554 | 0.5544 |
| Precision | 0.8388 | 0.8253 |
| Recall | 0.7730 | 0.7651 |
Training time: ~66.6 min on RTX 4070 Laptop GPU.
| Parameter | Value |
|---|---|
| Batch | 6 |
| Image size | 1024 |
| Patience | 25 |
| LR (cosine) | 0.01 → 0.01 |
| Mosaic | 1.0 |
| Mixup | 0.15 |
| Copy-paste | 0.1 |
| Horizontal flip | 0.0 |
Training results
PR curve
| Raw | Normalized |
|---|---|
| Confusion matrix | Normalized confusion matrix |
| Ground truth | Model predictions |
|---|---|
| Val labels | Val predictions |
| Batch 0 | Batch 1 | Batch 2 |
|---|---|---|
| Train batch 0 | Train batch 1 | Train batch 2 |
Label distribution
from ultralytics import YOLO
from huggingface_hub import hf_hub_download
weights = hf_hub_download("AvoCahDoe/invoice-layout-yolov8m", "weights/best.pt")
model = YOLO(weights)
results = model.predict("invoice_page.png", imgsz=1024, conf=0.25)
results[0].show()
from ultralytics import YOLO
model = YOLO("hf://AvoCahDoe/invoice-layout-yolov8m/weights/best.pt")
results = model.predict("invoice_page.png")
python scripts/train_comparison.py --models yolov8m
weights/best.pt # Best checkpoint (use this)
weights/last.pt # Last epoch checkpoint
config/ # Training configuration
metrics/ # Per-epoch and summary metrics
assets/ # Plots and visualizations
All six architectures fine-tuned on the same invoice layout dataset.
| Rank | Model | test mAP50 | test mAP50-95 | Precision | Recall | Hub |
|---|---|---|---|---|---|---|
| 1 | yolov8n | 0.9600 | 0.7167 | 0.9502 | 0.9592 | YOLOv8n |
| 2 | yolov8s | 0.9006 | 0.6739 | 0.9419 | 0.8677 | YOLOv8s |
| 3 | yolov8x | 0.8757 | 0.6224 | 0.9144 | 0.8735 | YOLOv8x |
| 4 |
Apache 2.0
pt · 49.7 MB · SHA-256 43061dbfc67f…589c · Hugging Face
--- license: apache-2.0 language: - en - de tags: - object-detection - yolo - yolov8 - ultralytics - invoice - document-layout - document-understanding - ocr-prep - invoice-extraction library_name: ultralytics pipeline_tag: object-detection base_model: ultralytics/yolov8m datasets: - AvoCahDoe/invoice-annotated-bbox metrics: - map_50 - map - precision - recall model-index: - name: best results: - task: type: object-detection dataset: name: invoice-yolo-annotated type: invoice-layout metrics: - type: map_50 value: 0.8388 - type: map value: 0.5289 - type: precision value: 0.9077 - type: recall value: 0.8580 --- # Invoice Layout Detection — YOLOv8m Fine-tuned **YOLOv8m** for **8-class invoice document layout** region detection (metadata, vendor/customer blocks, table, line items, summary, payment, column headers). Part of the Hub collection **[Invoice Layout Extraction](https://huggingface.co/collections/AvoCahDoe/invoice-layout-extraction-6a39cd2a061a508c8049d825)**. | Property | Value | |----------|-------| | **Architecture** | YOLOv8m (25.9M params, 78.9 GFLOPs) | | **Base weights** | `ultralytics/yolov8m` | | **Input size** | 1024 px | | **Classes** | 8 layout regions | | **Training epochs** | 100 (best @ epoch 98) | | **Optimizer** | AdamW | | **Dataset** | [AvoCahDoe/invoice-annotated-bbox](https://huggingface.co/datasets/AvoCahDoe/invoice-annotated-bbox) | | **Demo Space** | [AvoCahDoe/invoice-layout-yolov8n-demo](https://huggingface.co/spaces/AvoCahDoe/invoice-layout-yolov8n-demo) | | **Train / val / test** | 372 / 14 / 7 pages | ## Classes | ID | Name | |----|------| | 0 | `invoice_metadata` | | 1 | `vendor_block` | | 2 | `customer_block` | | 3 | `table_block` | | 4 | `line_item` | | 5 | `summary_block` | | 6 | `payment_block` | | 7 | `Column` | ## Metrics ### Test split (held-out, 7 images) | Metric | Value | |--------|-------| | **mAP50** | 0.8388 | | **mAP50-95** | 0.5289 | | **Precision** | 0.9077 | | **Recall** | 0.8580 | ### Validation (best epoch 98) | Metric | Best | Final (epoch 100) | |--------|------|-----------------------------------------------| | mAP50 | 0.8581 | 0.8578 | | mAP50-95 | 0.5554 | 0.5544 | | Precision | 0.8388 | 0.8253 | | Recall | 0.7730 | 0.7651 | Training time: ~66.6 min on RTX 4070 Laptop GPU. ## Training configuration | Parameter | Value | |-----------|-------| | Batch |...
Source context: 5 downloads · 0 likes · Pipeline object-detection · Library ultralytics · Repo AvoCahDoe/invoice-layout-yolov8m
yolo11x |
| 0.8738 |
| 0.6127 |
| 0.9484 |
| 0.8530 |
| YOLO11x |
| 5 | yolo11m | 0.8418 | 0.4926 | 0.9033 | 0.8466 | YOLO11m |
| 6 | yolov8m ← this model | 0.8388 | 0.5289 | 0.9077 | 0.8580 | YOLOv8m |