HeadlinesBriefing favicon HeadlinesBriefing.com

Hybrid PyMuPDF + GPT-4 Vision Cuts PDF Extraction from 4 Weeks to 45 Minutes

Towards Data Science •
×

A hybrid document extraction system using PyMuPDF and GPT-4 Vision replaced £8,000 in manual engineering effort by processing 4,700+ engineering drawings in 45 minutes instead of four weeks. The project targeted REV values buried in title blocks across mixed text-based and image-based PDFs, where manual extraction would have required 160 person-hours at £50/hour.

Engineering drawings posed unique challenges: 70-80% were text-based but REV values appeared in multiple formats (hyphenated numbers, single/double letters), while 20-30% were image-based scans from legacy documents. The hybrid approach processed text-based files deterministically with PyMuPDF, reserving expensive GPT-4 Vision calls only for cases where rule-based extraction failed. This cut API costs from £47 to £10-15 while maintaining 96% accuracy.

The system's success hinged on architectural decisions rather than model choice. Later testing showed newer models like GPT-5+ offered no meaningful accuracy improvement over GPT-4.1 for this spatially-constrained task. The key insight: when extraction follows predictable patterns in well-defined document regions, preprocessing and prompt engineering matter more than raw model capability.