A small convolutional autoencoder that learned what 18 common types of BIM elements look like (IFCNet renders). If it cannot rebuild an element well, the element is unusual and a person should check it. Its latent vector also finds the 5 most similar elements.
Built in the AI Methods I hackathon, Master in AI for Architecture & Business Innovation (MaAI), IAAC, November 2026. Code: https://github.com/iaac-maai/hackathon-team2-ifcnet
BIM Element Checker: a BIM coordinator uploads a render or screenshot of one element. The model returns a score and a verdict (typical or unusual object, check it) and the 5 most similar elements from a gallery.
IfcStair, IfcRailing.conv_64), latent size 64, 593,009 parameters. Linear output layer.image: float32 [batch, 1, 64, 64].x = 1 - x, object bright on a dark background).reconstruction [batch, 1, 64, 64], latent [batch, 64] (for similarity search) and score [batch] = reconstruction MSE divided by the object's pixel mass (mean pixel value + 0.001).score > threshold means "unusual object, check it". Threshold 0.0340 = 95th percentile of the score on normal validation images (see config.json).Same split and seed for all setups; 30 epochs, Adam (lr 1e-3), batch 128, MSE loss, best epoch by validation MSE. CPU.
| Model | Parameters | Val MSE | Test MSE | ROC AUC | Precision | Recall | P@5 |
|---|---|---|---|---|---|---|---|
| dense_16 | 4,334,864 | 0.00179 | 0.00180 | 0.821 | 0.399 | 0.396 | 0.496 |
| dense_64 | 4,347,200 | 0.00154 | 0.00154 | 0.810 | 0.391 | 0.420 | 0.506 |
| conv_16 | 199,745 | 0.00158 | 0.00158 | 0.884 | 0.449 | 0.515 | 0.507 |
| conv_64 (this model) | 593,009 | 0.00055 | 0.00056 | 0.891 | 0.467 | 0.627 | 0.534 |
P@5: share of the 5 nearest test neighbours (cosine similarity of the L2-normalised latent) with the same IFC class. Baselines: raw pixels 0.504, random 0.063.
gallery.npz holds the latent vectors of 20 normal elements per class (360 in total). A new element is encoded, L2-normalised and compared with the gallery by cosine similarity; the 5 closest are returned.
import json
import numpy as np
import onnxruntime as ort
from PIL import Image
from huggingface_hub import hf_hub_download
repo = "iaac-maai/hackathon-team2-ifcnet-ae"
model_path = hf_hub_download(repo, "model.onnx")
cfg = json.load(open(hf_hub_download(repo, "config.json")))
def preprocess(path, size=cfg["preprocessing"]["img_size"]):
im = Image.open(path).convert("L").resize((size, size))
x = 1 - np.asarray(im, np.float32) / 255 # object bright on dark
return x[None, None] # [1, 1, 64, 64]
sess = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
reconstruction, latent, score = sess.run(["reconstruction", "latent", "score"],
{"image": preprocess("my_element.png")})
verdict = "unusual object, check it" if score[0] > cfg["threshold"] else "typical"
print(f"score {score[0]:.4f} -> {verdict}")
# similarity: 5 nearest elements in the gallery
gallery = np.load(hf_hub_download(repo, "gallery.npz"), allow_pickle=True)
print(gallery.files) # see the keys: embeddings, labels, ...
Team 2 (Bars Babila, Samiha Abeda Nur, Emmanuel Marquez, Karthikeyan Saravanan), AI Methods I hackathon, IAAC MaAI 2026/27. Faculty: Salvador Cantuarias Brañes and Serjoscha Düring.
model.onnx 2 MBgallery.npz 212.8 kB