Junction 2026, Stoa Challenge, Make Blueprints Talk
Kaava, Ask a Construction Drawing a Question

- Role
- Built the system: routing engines, verification, evaluation, and the 3D and voice app
- Timeline
- Duration
- 48-hour hackathon, on site in Espoo, Finland
- Team
- Team: Ahmed Saad, Ashutosh Chatterjee (TUHH), Roman Petrov (ESADE), Tudor Lina (ESADE)
- Stack
- Python · FastAPI · IfcOpenShell · OpenCV · Gemini · React · Three.js
View the sourceWatch the hard cases, filmedRead how it works
Overview
Kaava answers questions about construction drawings and building models: how many doors, the floor area of the hall, the linear metres of baseboard. A vision model can read an answer off the picture, but then an engineer has to double-check every number. Kaava is built so they don't have to. The name is Finnish for both formula and plan: the model writes the formula, the code computes the number, on the plan.
It was built at Junction 2026 in Espoo for Stoa's challenge, Make Blueprints Talk, the second challenge our team took on that weekend alongside the Bahn Express desk. It has no placement to report. One rule holds everywhere in it: a number is computed by code from things you can see on the drawing, counted objects, measured geometry, printed figures. Where a language model is used at all, its reply format has no field for the answer.
Every answer ends in one of three states. Verified: no need to double-check, backed by a measured error rate on drawings that were held back. Check this: an answer with its evidence drawn on the sheet, where one of the checks is weak. Can't answer reliably: no number, with the reason.
The problem
A project engineer asks a drawing for quantities all day, and a wrong one becomes a wrong order. Frontier vision models are now good enough to answer most of these from the image, which is exactly the trouble: right most of the time, with nothing to tell you which time it isn't. An answer that still has to be checked by hand saves nobody anything. The drawings also come in very different shapes. An IFC model knows its own elements; a floor plan with a DXF has geometry; a scan is only pixels; a sheet from a drawing set is a schedule or a structural plan with printed figures and no geometry behind it. One method can't be exact for all of them, and a single confidence score can't mean the same thing across them.
What I built
- 01
Routed each question to the cheapest exact method
An IFC model is queried with IfcOpenShell. A floor plan with a DXF is answered from its room outlines and its door, window and fixture entities, cross-checked against the PDF's text. A scan with printed room labels is read by local OCR and counted. All three cost nothing per question, and only what is left goes to a vision model.
- 02
Gave the model tools that cannot hold an answer
On a sheet it can name printed figures and an expression, pick the rows that count, ask for a closer look, or point at a room to measure. The program re-reads each figure where it is printed, evaluates the expression with a calculator that knows only plus, minus, times and divide, cuts the sheet into tiles and counts the boxes, or measures the room in the pixels.
- 03
Worked every sheet question out twice
Two workings that differ give no number, and both are shown. A question in your own words is read twice, by two different models, Gemini and Gemma, and only two readings that agree are run.
- 04
Added examiners for what a formula misses
Length times width is right about the rectangle and can still be wrong about the slab. Two second readers look inside a computed area for what must come out, a trench, a pit, a shaft, and the program measures it on the drawing. On Stoa's slab sheet they find two trenches, and the 61.69 m² rectangle becomes about 59.3 m².
- 05
Made Verified a measured claim
An answer becomes Verified only when its independent checks agree and answers of that kind stayed under 1% wrong, at a 95% upper bound, on a calibration split of drawings the engines were not built on.
- 06
Took the scale from the best thing on the sheet
The graphic scale bar first, then a printed dimension, then the doors taken as standard doors 0.9 m wide. That last one is an estimate, shown as one with the range it leaves open, and never Verified.
- 07
Drew the evidence where a person can check it
Each counted item gets a ring and a number on the sheet, each measured room a tint and an area plate, and a painted 3D model stands on the plan with its doors opening as they are counted. Click any mark to leave it out and the answer follows. You can also ask aloud and hear the answer.
- 08
Found a flaw in the dataset and said so
On the development plans, 128 of 805 door outlines lie exactly on top of another: a door between two flats is listed once for each. The dataset's answer for one floor is 32 doors where the drawing shows 23. The app answers 23, marks the doubles, and never calls that answer Verified, since no score against the dataset can vouch for it.
- 09
Wrote down what isn't solved
Nothing on a scan is Verified, and scans are two thirds of the dataset's questions. IFC answers aren't Verified yet, because too few were held out to prove 1%. The tiled door count still moves between runs, so it is marked Check this. A blind trial rig is built and no trial has been run by people, so no result is claimed for it.
Architecture
A React and Three.js app talks to one FastAPI server that has the drawings on its disk. The router picks the most structured source for a drawing, IFC, then DXF, then a PDF's vector text, then pixels, and the cheapest engine that is exact for it. A vision model is called only where no exact engine covers the drawing, and only to point. Each engine's cross-checks give the answer a score, which is compared with a bar set on held-out drawings to decide its state. The evidence comes back as boxes, polygons and model elements for the app to draw on the sheet and in 3D. The public demo ran on a small Azure VM behind a Cloudflare Tunnel and is currently offline.
Tech stack
Exact engines (IFC and DXF)
IfcOpenShell enumerates elements per storey with the model's own quantities; ezdxf and Shapely read room outlines with their holes cut out, and door, window and fixture entities, with areas checked against the areas printed on the plan. On the development split they answer 33,452 of 63,592 questions at no cost.
Scan label reader
PP-OCR through RapidOCR, run locally, reads the room labels printed on a scan; the code counts them and checks the apartment's type line. Right 95.7% of the time on held-out plans and never Verified: its best level is 2.0% wrong, above the 1% bar.
Sheet reading
Every text on a sheet is read at full size first, from the PDF's own text layer with PyMuPDF or by local OCR tile by tile, and given to the model with the image. The model answers in one of five forms, none of which can hold the result.
The ruler
OpenCV finds the walls in the pixels. A room is the free space inside its walls, whatever its shape: an L-shaped room by its own outline, a corridor around a lift without the lift. What was taken out is drawn on the sheet and listed in the working.
Calibrated verification
A frozen split by drawing, with thresholds for Verified set on the calibration part. On held-out drawings Verified answers were wrong 8 times in 5,710 counts and 6 times in 2,612 areas.
Vision and language models
Gemini as the only model in the answer path, at low thinking by measurement: high thinking cost about €0.10 and three minutes a question in a pilot. Gemma is the independent second reader of free-form questions. Claude is the fallback when no Gemini key is set, and the model of the earlier measurements.
The app
React 19, Three.js and Vite. 3D meshes are built from IFC models, DXF plans and scans, whose walls are raised from the scan's own pixels. Answers can be read aloud through ElevenLabs, and a small scan can be shown enlarged through Cloudinary, for the reader and never for the engine.
Evaluation harness
The published figures all come from the run log in results/. 294 tests under pytest, and a CI regression that fails if the exact engines get less right or produce one wrong Verified answer.
Results
95.8% vs 62.5%
Right on the same 200 dataset questions: Kaava against the vision model alone. Re-weighted to the dataset's question mix, 95.9% against 77.3%. The scan prompt was tuned on that sample's scans, so scans were measured again on 100 fresh questions, 89.0% against 90.0% for the model marking items alone, which puts the re-weighted total near 92.6%.
0 of 16,982
Verified answers on the development split that turned out wrong. On held-out drawings the Verified error rate is below 0.28% for counts and 0.53% for areas, at 95% confidence.
€3.15 vs €7.99
Cost per 1,000 questions, Kaava against the vision model alone. The exact engines answer more than half of the development split for nothing.
27 of 27
On Stoa's four sample sheets, against an answer key we wrote ourselves because Stoa gave none. The model alone got 26; the one that separates them is the slab with two trenches. The tiled door count and the measured hall are not in that key.
99.9% and 97.6%
Counts and areas right on held-out Swiss floor plans, 6,346 of 6,354 and 2,962 of 3,034, counted the way the dataset counts.
16% of door outlines
Listed twice in the dataset's own files, which touches 9.5% of its Swiss count questions on the development split. Found, measured, and handled in the open instead of scored around.
Moments






What I took away
- 01
Take the answer field away. Telling a model not to state a number is a request. A reply format with no field for one is a guarantee, and every later rule was easier to keep because of it.
- 02
Verified has to be a measured claim or it is decoration. The label reader is right about 96 times in 100 and still never Verified, because its best level is 2.0% wrong on held-out plans and the bar is 1%.
- 03
Two readers agreeing isn't proof. The labels and Gemini gave the same count on 762 answers and 10 were wrong: 1.3%, better than either alone and still above the bar. So it stays Check this.
- 04
Super-resolution is for the reader, never for the engine. Reading small scans after enlargement gave fewer right answers and more wrong ones, 228 and 34 against 236 and 28. It draws plausible detail, and a plausible label is not evidence.
- 05
A benchmark can be wrong, and the product shouldn't inherit it. Scoring as the dataset counts and answering as the drawing shows are two different switches, and both runs are in the log.
- 06
Say what was not measured. The 27 of 27 is against our own key, and the blind trial exists as a rig that nobody has run. Writing that no result is claimed is cheap, and it keeps everything else believable.
View the sourceWatch the hard cases, filmedRead how it works