Archival Index Card Detector v4
A YOLO26n model trained to detect index cards in digitized archival document scans. This is a development version for validation before promoting to the NationalLibraryOfScotland/archival-index-card-detector repo.
Changes from v3
- Expanded training data: 1015 annotations (up from 905), including 110 human-reviewed images from the late-range Al-Allan scans (images 1127+)
- Better late-range recall: v3 had ~24% recall on images 1127+ due to a scan configuration shift (different background appearance). v4 specifically targets this gap.
- Background diversity: Added 20 new negative examples (card backs, blank pages) from the late range
Performance
| Metric | v3 | v4 | Delta |
|---|---|---|---|
| mAP@50 | 99.3% | 99.5% | +0.2% |
| mAP@50-95 | 87.5% | 99.2% | +11.7% |
| Precision | 99.9% | 100% | +0.1% |
| Recall | 98.9% | 98.9% | same |
Best epoch: 59/100 (early stopping at 79, patience=20).
Training Details
- Base model: YOLO26n (ultralytics)
- Training images: 1015 (811 train, 204 val)
- Positive examples: 542 (with bounding boxes)
- Negative examples: 473 (card backs, blank pages, etc.)
- Epochs: 79 (early stop), best at 59
- Hardware: Apple M1 Pro (MPS)
- Framework: ultralytics
Usage
from ultralytics import YOLO
from huggingface_hub import hf_hub_download
model = YOLO(hf_hub_download(
repo_id="davanstrien/archival-index-card-detector-v4",
filename="model.pt"
))
results = model.predict("scan.jpg")
for result in results:
for box in result.boxes:
x1, y1, x2, y2 = box.xyxy[0].tolist()
confidence = box.conf[0].item()
print(f"Card at ({x1:.0f}, {y1:.0f}, {x2:.0f}, {y2:.0f}) conf={confidence:.2f}")
Status
Development/validation - pending comparison against v3 on late-range images before promotion to the NLS org repo.
- Downloads last month
- 26