Sorting invoices by layout
Before modern vision models: grouped a large set of raw invoices into 5 layout types without labels, then used a tuned extractor for each type to read fields and tables.
- Role
- ML Systems Engineer
- Built with
- Python, PyTorch, OpenCV, Scikit-Learn, FastAPI, Docker
Results
- 5 canonical layout clusters discovered
- Unsupervised structural routing
- Pre-VLM high-precision table parsing
In more detail
Built prior to modern VLM OCR: trained an unsupervised clustering pipeline over large-scale raw invoice datasets to discover 5 canonical structural layout clusters, routing documents into layout-conditioned computer vision extraction layers for high-precision key-value and table parsing.
Key decisions
Unsupervised Structural Layout Discovery (5 Canonical Clusters)
Extracted spatial bounding-box density histograms and visual structural descriptors with OpenCV/PyTorch, clustering heterogeneous vendor invoices into 5 canonical layout archetypes without manual template labeling.
Cluster-Conditioned Key-Value & Table Extraction
Routed incoming documents by cluster centroid into specialized morphological table-grid detectors and region-of-interest parsers for high-precision line-item extraction.