VS.04 · Computer Vision · Graphs · Jul 2026
P&ID Intelligence
vs. The Drawing No Machine Could Read
Connected-component pre-filtering cut single-drawing OCR runtime from ~360s to 7s, feeding a NetworkX spatial proximity graph governed by 6 deterministic engineering rules (R001–R006).
- Stack
- Python · YOLOv8s · Tesseract OCR · OpenCV · NetworkX · LangGraph · FastAPI · Streamlit
- Throughput
- ~360s → 7s single-drawing OCR benchmark (~50× faster)
- Tolerance
- 6 deterministic rules (R001–R006) · R004 low-confidence flag · 4 ★ GitHub
- Known Limits
- Human-in-the-loop prototype; single-drawing timing benchmark without multi-vendor corpus evaluation; plant-pid.png is an illustrative repository drawing (original DNE label untouched).
Single-drawing OCR benchmark
~360s → 7s
Observed wall-clock OCR runtime drop (~50× faster) after isolating text-like blobs before Tesseract
n: 1 recorded project drawing benchmark (full-image Tesseract vs. connected-component-guided OCR)
Deterministic engineering checks (R001–R006)
6 rules
Tag completeness, uniqueness, loop integrity, confidence flagging (R004), orphan nodes, and valve connections
n: 6 deterministic rules over NetworkX spatial proximity graph + optional 3-node LangGraph review
GitHub open-source prototype
4 ★
Public GitHub repository signal; plant-pid.png is an illustrative methanol-to-DME process drawing from the repo
n: Public FastAPI + Streamlit repository with Excel MTO export

Point full-image OCR at a dense piping schematic and it chews on pipe walls and vessel hatching for six minutes. Isolating text-like connected components first dropped a recorded drawing benchmark from ~360s to 7s—then six deterministic graph rules flag every low-confidence or orphan tag before an Excel Material Take-Off is written.
Panel 01 · The Dread (What Silently Breaks)
Chemical Piping & Instrumentation Diagrams pack dense geometric linework next to tiny instrument tags, making naive full-image OCR slow (~6 minutes per sheet) and manual Material Take-Off transcription error-prone.
~360s → 7s
Recorded single-drawing OCR runtime reduction via connected-component pre-filtering, paired with YOLOv8s symbol detection, NetworkX spatial graphs, and 6 deterministic validation rules (4 ★ GitHub).
Scope: Single recorded implementation benchmark without repeated hardware timing logs; not a general throughput or multi-vendor accuracy guarantee.
Panel 02 · Engineering Contribution
Built an end-to-end prototype combining CLAHE preprocessing, YOLOv8s symbol detection, connected-component-guided Tesseract OCR (~360s → 7s in one recorded drawing benchmark), NetworkX spatial proximity mapping, 6 deterministic engineering validation rules (R001–R006), optional 3-node LangGraph/Groq Llama 3.3 70B review, and openpyxl Excel MTO export.
Panel 03 · System Architecture
- 01PDF-to-image ingestion with CLAHE contrast normalization and upscaling for dense technical linework.
- 02Parallel YOLOv8s symbol detection and OpenCV connected-component filtering isolate text-like regions before Tesseract OCR.
- 03Spatial proximity matching links parsed equipment/instrument tags (e.g., R-1001, E-1002, P-1001A/B) into a NetworkX relationship graph.
- 04Six deterministic validation rules (R001–R006) plus optional 3-node LangGraph review flag low-confidence edges and orphan nodes before openpyxl Excel export.

SINGLE-DRAWING OCR BENCHMARK · ~360s → 7s
Connected-component pre-filtering before Tesseract
Scope: one recorded project drawing benchmark (4 ★ GitHub prototype). Does not guarantee multi-vendor accuracy or autonomous industrial sign-off.
DETERMINISTIC NETWORKX VALIDATION RULES · R001–R006
6 rules · Optional 3-node LangGraph reviewSurfaces any YOLO detection or connected-component OCR token below threshold.
Explicitly marks uncertain rows for human-in-the-loop inspection.
Next Chapter · VS.05
CTR Predictor
vs. My Own Leak
