Skip to content

Document AI · CAD-to-BIM · Instance segmentation

CAD-to-BIM AI: structural drawing understanding

Detecting and segmenting columns, beams, walls, openings and piles on structural plans, so that 2D drawings become structured element data for CAD-to-BIM modelling.

Context
AGECS (R&D, remote)
Period
Apr 2026 – present
My role
R&D engineer: dataset engineering, training, error analysis, post-processing
Grid of floor-plan tiles with predicted structural element masks in yellow, blue and cyan
8-class model predictions on validation tiles from public floor-plan datasets.
0.941
Column mAP50 (box & mask)
YOLOv8m-seg · P 0.944 · R 0.935
0.902
8-class val box mAP50
mask mAP50 0.893 · best epoch 13
21,009
Training tiles
2,516 val · 2,569 test
209,504
Wall instances unified
plus 1,734 beams, 6 sources

Chapter 01

The engineering challenge

Structural sheets are huge (up to 15,000 × 12,000 px). Elements are thin and repetitive, and they are easily confused with text, hatching and dimension lines.

Public labelled data is scattered across formats (COCO JSON, YOLO, SVG, custom schemas), and some of it has corrupt or inconsistent annotations.

Chapter 02

Input data

Public plan datasets

Structural and architectural plans in COCO, YOLO and SVG formats

Unified training set

21,009 / 2,516 / 2,569 tiles, 8 element classes

Annotated project sheets

QA'd in CVAT: labels bound to their elements

Architectural floor plan tiles with wall and column masks
Predictions on architectural plans (public datasets).

Chapter 03

The AI & engineering workflow

Stage 1 of 5

Unify data

COCO / YOLO / SVG → one schema, audited and hash-verified

What I did

  • Audited five structural and floor-plan data sources (~22k files). I wrote SVG→COCO and rect→COCO converters and MD5-verified every copy against source.
  • Built a building-level train/val/test split to prevent leakage, plus copy-paste augmentation for rare circular columns.
  • Trained a YOLOv8m-seg column model on 640 px tiles within a 4 GB GPU budget. I diagnosed EMA NaNs caused by VRAM overflow and moved from the L model to the M model.
  • Engineered inference: 30% tile overlap, 4-rotation test-time augmentation with verified inverse transforms, global NMS, and pixel-evidence checks that reject text blobs and linework.
  • Scaled to an 8-class structural-element model (~21k training tiles) and a CV-to-CAD mapping so detections carry drawing coordinates.
  • Annotated and QA'd real project sheets in CVAT. On one steel sheet I added 251 verified instances and 918 polygon vertices, binding each beam label to its beam.
Ultralytics YOLOv8-segPyTorchOpenCVCVATCOCO / YOLO formatsPython

CAD-to-BIM

Three plans in, one 3D model out.

The AI reads the foundation, level 1 and roof plans, detects each structural element, and the detections are built level by level on top of the plans.

Input → output

Drag to compare.

Model prediction
Ground truth
Ground truthModel prediction

Validation tiles from public floor-plan datasets: annotated elements vs the 8-class model's masks. Drag to compare.

Chapter 04

Technical result

  • The column detector exceeded its mAP50 > 0.80 target by a wide margin (0.941 box and mask, precision 0.944, recall 0.935).
  • The 8-class model reached 0.902 box / 0.893 mask mAP50 on validation, with high test reliability for openings and beams.
  • Error analysis showed column recall and piles are the gap. The fix is more labelled real sheets, which I am producing through a QA'd annotation stream.

8-class model: validation mAP50 by epoch

Box and mask curves track closely: masks are as reliable as boxes.

0.400.550.700.851.0015101520EpochbestBox mAP50Mask mAP50Epoch 1 · Box mAP50: 0.691 · Mask mAP50: 0.403Epoch 2 · Box mAP50: 0.781 · Mask mAP50: 0.697Epoch 3 · Box mAP50: 0.797 · Mask mAP50: 0.786Epoch 4 · Box mAP50: 0.822 · Mask mAP50: 0.822Epoch 5 · Box mAP50: 0.834 · Mask mAP50: 0.832Epoch 6 · Box mAP50: 0.855 · Mask mAP50: 0.853Epoch 7 · Box mAP50: 0.857 · Mask mAP50: 0.854Epoch 8 · Box mAP50: 0.874 · Mask mAP50: 0.861Epoch 9 · Box mAP50: 0.870 · Mask mAP50: 0.864Epoch 10 · Box mAP50: 0.862 · Mask mAP50: 0.856Epoch 11 · Box mAP50: 0.884 · Mask mAP50: 0.882Epoch 12 · Box mAP50: 0.872 · Mask mAP50: 0.862Epoch 13 · Box mAP50: 0.902 · Mask mAP50: 0.893Epoch 14 · Box mAP50: 0.889 · Mask mAP50: 0.884Epoch 15 · Box mAP50: 0.883 · Mask mAP50: 0.877Epoch 16 · Box mAP50: 0.886 · Mask mAP50: 0.881Epoch 17 · Box mAP50: 0.877 · Mask mAP50: 0.870Epoch 18 · Box mAP50: 0.873 · Mask mAP50: 0.868Epoch 19 · Box mAP50: 0.880 · Mask mAP50: 0.872Epoch 20 · Box mAP50: 0.879 · Mask mAP50: 0.868
  • Box mAP50
  • Mask mAP50
View data table
EpochBox mAP50Mask mAP50
10.6910.403
20.7810.697
30.7970.786
40.8220.822
50.8340.832
60.8550.853
70.8570.854
80.8740.861
90.8700.864
100.8620.856
110.8840.882
120.8720.862
130.9020.893
140.8890.884
150.8830.877
160.8860.881
170.8770.870
180.8730.868
190.8800.872
200.8790.868

Source: AGECS 8-class training log

Held-out test mask mAP50 by element

Where the model is reliable, and where more data is needed.

0.000.250.500.751.00Opening0.977Opening · Mask mAP50: 0.977Opening · Box mAP50: 0.977Beam0.943Beam · Mask mAP50: 0.943Beam · Box mAP50: 0.904Column0.625Column · Mask mAP50: 0.625Column · Box mAP50: 0.625Pile0.624Pile · Mask mAP50: 0.624Pile · Box mAP50: 0.611
  • Mask mAP50
  • Box mAP50

Column recall on the test split (0.51) is the weak point. Steel members and walls had no scorable test instances in this run.

View data table
CategoryMask mAP50Box mAP50
Opening0.9770.977
Beam0.9430.904
Column0.6250.625
Pile0.6240.611

Source: AGECS 8-class test metrics

Limitations, stated plainly

  • Client project sheets were used for training and annotation. They are not shown here. All tiles shown come from public floor-plan datasets.
Fig. 01Close tiles: columns and walls separated from dimension text.
Fig. 02Normalised confusion matrix (validation).

Chapter 05

Practical impact & relevance

  • Turns drawings into data, the step that 2D-to-3D, quantity take-off and BIM automation all depend on.
  • Shows production habits: leakage-safe splits, verified data provenance, reproducible notebooks and documented failure modes.
EvidenceWhere every figure on this page comes from

Each metric is taken from a primary record, not from a CV. Hover a metric to see its source. The underlying files are available for review at interview.

  • AGECS column-detection training log
  • AGECS column-detection pipeline record
  • AGECS dataset-engineering log
  • AGECS training outputs
  • AGECS annotation QA report

Shown at the level of aggregate metrics and public-dataset imagery. No client drawings are reproduced.

Next case study

Scan-to-BIM: point cloud to verified IFC