This repository contains a YOLO detector fine-tuned to detect and segment columns in 19th-century American newspaper pages.
Extracting individual columns is a critical pre-processing step for historical OCR pipelines. Slicing long columns into smaller, overlapping horizontal strips resolves the text-hallucination/repetition issues that modern Vision-Language Models (like Gemma 2B/27B) encounter on full-page layouts.
Model Training & Performance
The model was trained on annotated historical newspaper pages. You can view the training metrics, curves, and validation performance directly below:
1. Training Metrics (results.png)
Shows training/validation loss decay and precision/recall improvements over epochs:
Training Curves
2. Confusion Matrix
Displays normalized classification performance:
Confusion Matrix
3. Model Predictions vs. Ground Truth
Compare the validation batch labels (ground truth annotations) with the actual predictions generated by the trained model:
Ground Truth Labels (val_batch0_labels.jpg)
Model Predictions (val_batch0_pred.jpg)
Ground Truth
Model Predictions
How to Run This Model
You can easily download and run this model in Python using the ultralytics package.
Installation
pip install ultralytics huggingface_hub
Python Inference Code
python
1from huggingface_hub import hf_hub_download
2from ultralytics import YOLO
34# 1. Download the weights from Hugging Face5model_path = hf_hub_download(repo_id="ambrosfitz/19c-newspaper-column-yolo", filename="best.pt")67# 2. Load the model8model = YOLO(model_path)910# 3. Perform detection on a newspaper page image11results = model("path_to_newspaper_page.jpg")1213# 4. Display or save the segmented columns14results[0].show()15# results[0].save(filename="output.jpg")