Inspiration
Structural plans and shop drawings for reinforcement are critical to construction safety and accuracy, but manually checking them against each other is an incredibly tedious, time-consuming, and error-prone process. A single missed discrepancy can lead to massive delays, increased costs, or compromised structural integrity. We wanted to build a tool that automates this heavy lifting without sacrificing the strict confidentiality required for these types of documents. Thus, Learn2Compare was born.
What it does
Learn2Compare (L2C) is a fully offline, local-first platform that automatically cross-checks reinforcement shop drawings against structural plans.
- Seamless Ingestion: You simply feed it PDFs of the structural plans and the shop drawings.
- Smart Parsing: It parses the documents, extracting text and positions (running OCR automatically for flattened PDFs).
- AI-Powered Matching: A local open-source machine learning model groups notes and matches the plan elements against shop elements to identify discrepancies.
- Comprehensive Output: The platform outputs a detailed JSON metadata database and a PDF findings report, all while providing live progress in our beautiful web app.
Because everything runs locally, confidential drawings never leave your machine.
How we built it
We split the architecture into an ingest/extraction lane and a matching/reporting lane to work in parallel effectively:
- Backend: We built a robust pipeline using Python (FastAPI/Uvicorn). It handles deterministic rule extraction, OCR fallback processing (running parallel page reads and sequential OCR), and the local ML model execution.
- Frontend: The user interface is crafted with React (Vite) and Tailwind CSS v4. It features live progress tracking, giving users partial findings and metadata as the files load, capped off with a comprehensive final report.
- Machine Learning: We utilized a local open-source model to bridge the gap between human-readable plans and structured metadata, classifying "close calls" securely on-device.
Challenges we ran into
- Unstructured and Messy PDFs: Many shop drawings lack a proper text layer. We had to implement a seamless fallback to OCR that didn't destroy processing time.
- Streaming Partial Results: Building the architecture to stream partial metadata and PDF findings to the UI while the backend was still crunching heavy ML models was a major hurdle.
- Privacy vs. Power: Balancing the accuracy of modern AI with the strict requirement of keeping all data offline meant we couldn't rely on powerful closed-source cloud APIs. We had to optimize open-source local models to perform heavy-duty matching tasks efficiently on consumer hardware.
Accomplishments that we're proud of
- 100% Data Privacy: Developing a powerful tool that requires zero cloud communication. Confidential architectural data remains strictly on the user's machine.
- Live UI Feedback: Creating a polished React frontend that doesn't just show a spinning loader, but actually visualizes elements as they are parsed and matched in real-time.
- The "Lean Pipeline": Successfully integrating OCR, rule-based extraction, and an ML model into a cohesive, fast local pipeline.
What we learned
- Working with complex, specialized construction documents requires a lot of domain-specific heuristics before relying on ML.
- Optimizing local models to run efficiently across different operating systems (macOS, Windows, Linux) is a delicate balancing act of memory management and parallel processing.
- The importance of a well-defined "contract" (our JSON schema) between the extraction layer and the machine learning matching layer. It made parallel development across the team incredibly smooth.
What's next for Learn2Compare
- Broader CAD Format Support: Expanding beyond just PDFs to ingest raw
.dwgor.dxffiles directly. - Expanded Model Fine-Tuning: Training the local model on a larger dataset of mismatched shop drawings to improve anomaly detection recall.
- BIM Integration: Directly exporting the matched data into BIM (Building Information Modeling) software like Revit for an end-to-end architectural workflow.
Built With
- fastapi
- framer-motion
- javascript
- json
- lucide-react
- machine-learning
- natural-language-processing
- ocr
- offline
- onnx
- openpyxl
- pdfjs
- pymupdf
- python
- react
- reportlab
- scikit-learn
- scipy
- tailwind-css
- typescript
- uvicorn
- vite
- websockets
Log in or sign up for Devpost to join the conversation.