/ Модель

Характеристики

Лицензия
CC BY-NC 4.0
Библиотека
onnx
Опубликована
16 ноя 2026

hackathon-team6-cubicasa-ae

Эмбеддинги изображенийИзображение → embedding3 профессии

Свёрточный автоэнкодер кодирует планы этажей в компактные векторы для поиска архитектурных планировок со схожей формой и пропорциями.

0скачиваний за 30 дней3лайкавеса обновлены19 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Это свёрточный автоэнкодер для поиска похожих планировок, созданный командой Team 6 на хакатоне AI Methods I в IAAC MaAI 2026/27. Он кодирует изображение плана размером 128 × 128 пикселей в вектор из 128 чисел; близость кодов используется для поиска планов со схожей формой и пропорциями. В версии 3 энкодер также предсказывает карту помещений с 10 классами комнат и отдельным каналом стен. Модель распространяется в формате ONNX, лицензия — CC BY-NC 4.0.

Модель предназначена для поиска архитектурных прецедентов: например, архитектор может загрузить план и найти ближайшие варианты в коллекции из 5 000 реальных домов. Версия 3 улучшила совпадение по числу спален и ванных и уменьшила расхождение по количеству комнат относительно версии 2. Основные данные обучения — планы финских домов из CubiCasa5K.

При разрешении 128 × 128 пикселей тонкие стены, двери и подписи теряются, поэтому модель лучше сопоставляет общую форму, чем программу помещений. Результаты зависят от качества и стиля исходного чертежа; модель не инвариантна к повороту, а кухня и ванная распознаются хуже гостиных и спален. Использование весов и данных ограничено условиями CC BY-NC 4.0.

Сценарии применения

  • поиск похожих планировок в коллекции архитектурных прецедентов
  • подбор домов со схожим контуром и пропорциями помещений
  • поиск ближайших планов по загруженному чертежу
  • сравнение планов по числу спален и ванных комнат
  • получение карты помещений и стен из плана этажа

Ограничения

При размере 128 × 128 пикселей тонкие стены, двери и текст размываются, поэтому модель в первую очередь сравнивает общую форму, а не назначение помещений. Она чувствительна к стилю и качеству чертежа, не инвариантна к повороту и обучена преимущественно на планах финских домов.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Floor-plan autoencoder for similarity search (Team 6)

A convolutional autoencoder that squeezes a floor-plan image (128 x 128 px) into a code of 128 numbers, so that plans with a similar layout get codes close to each other. We use it for precedent search: an architect uploads a plan and gets the five most similar plans out of 5,000 real homes. It was made in the AI Methods I hackathon (IAAC MaAI 2026/27).

Similarity search

Four test plans (left) and their five closest plans out of the 5,000. The matches have the same footprint and proportions: the narrow plan finds narrow plans, the plan made of three buildings finds plans with two or three volumes. The mistakes are in the figure too: three matches of the first query are pale scans, and the first match of the second query is a small square plan full of text.

Version 3: compare the rooms (used by the server)

Version 3 comes from Chloe's notebook internal_layout_v3.ipynb. It reads the annotations of CubiCasa5K (model.svg) and draws every plan as a room map with 10 room types. The model keeps the encoder of setup C, reading the cleaned drawing, but its decoder has to draw the room map and the walls instead of the lines. So the code holds the layout, and it still works on an uploaded drawing, which has no annotations.

Rooms predicted by v3

For the 373 test plans with annotations we judged the 5 nearest training plans with the annotations:

v2v3structural search on the annotationsrandom
Same number of bedrooms28%34%78%21%
Same number of bathrooms36%39%81%29%
Rooms off by4.73.71.45.7

v3 beats v2 on every measure, by a little. The predicted plan area overlaps the true one by 68%, and the living room and bedrooms are found much better than bathrooms and kitchens, whose fixtures and names mostly disappear at 128 px.

An atlas of layouts

Version 3 files: floorplan_ae_v3.onnx with two outputs, code (N x 128) and rooms (N x 12 x 128 x 128: channels 0 to 10 are the room classes, channel 11 the walls); floorplan_ae_v3.pt; floorplan_ae_v3_config.json with the room classes and colours; collection_codes_v3.npy; atlas_v3_xy.npy; and collection_rooms_128.npz, the true room maps of the 5,000 plans. The input is the cleaned drawing, see clean_plan in the server's app.py.

Version 2: compare the layout, not the drawing style

Version 1 grouped plans by how they're drawn (bold, faint, grey fills) as much as by their layout: a faint scan mostly found faint scans. In version 2 every plan is first cleaned down to its lines: a 5 x 5 px opening finds the wide parts (grey fills, grey paper, dark borders), the plan minus these parts leaves the lines, and each plan's lines are scaled by its own strong lines and cut into black and white. Then setup C is trained again on the cleaned plans, with the same settings.

v1 (as drawn)v2 (cleaned)
Retrieval top-1 (test)69%86%
Faintest quarter of the plans28%77%
Boldest quarter of the plans98%81%

How much of the drawing style is in the codes

To measure the style we used the rendering features from Chloe's notebook (how much is drawn, contrast, edge strength, sharpness) plus the grey fills. For each one we compare a plan with its 5 nearest plans and with 5 random plans: 100% means the search ignores it. With v2 every style feature moves towards 100%, while the proportions stay low, so the neighbours still have the same shape. The boldest plans lose, because walls thicker than about 5 px partly disappear in the cleaning.

The atlas with v2

On the v2 atlas bold, grey and faint drawings are mixed, and the map is ordered by shape: tall, narrow plans at the top, wide ones at the bottom, small drawings on the right.

Version 2 files: floorplan_ae_v2.onnx (same two outputs as v1), floorplan_ae_v2.pt, floorplan_ae_v2_config.json, collection_codes_v2.npy and atlas_v2_xy.npy (each plan's place on the atlas, 0-1). To use v2, clean the plan after the preprocessing below with clean_plan from the server's app.py.

What's in this repository

FileWhat it is
floorplan_ae.onnxthe model, 4.5 MB. Two outputs: code (N x 128, used for the search) and reconstruction (N x 1 x 128 x 128, the plan rebuilt from the code)
floorplan_ae.ptthe same weights for PyTorch
floorplan_ae_config.jsonthe image size, the preprocessing steps and the code size
collection_codes.npythe codes of all 5,000 CubiCasa5K plans
collection_ids.jsonthe plan each code belongs to
collection_plans_128.npzthe 5,000 plans themselves after preprocessing (128 x 128, walls bright), with their ids and split, in the same order as the codes. The model server uses them to show the matches
floorplan_ae_v2.onnx, floorplan_ae_v2.pt, floorplan_ae_v2_config.json, collection_codes_v2.npy, atlas_v2_xy.npyversion 2, trained on cleaned plans
floorplan_ae_v3.onnx, floorplan_ae_v3.pt, floorplan_ae_v3_config.json, collection_codes_v3.npy, atlas_v3_xy.npy, collection_rooms_128.npzversion 3, drawing to rooms. The model server uses it
examples/four test plans to try

Dataset

NameCubiCasa5K
Size5,000 floor-plan images, mostly of Finnish homes; official split 4,200 / 400 / 400
Dataset licenceCC BY-NC 4.0. CubiCasa5K licence
CiteKalervo, A. et al. (2019), CubiCasa5K: A Dataset and an Improved Multi-Task Model for Floorplan Image Analysis, SCIA

Architecture and preprocessing

  • Encoder: 4 convolutions with stride 2 (1, 16, 32, 64 and 64 channels; 128, 64, 32, 16 and 8 px) with ReLU, then a linear layer down to the 128 numbers of the code.
  • Decoder: the same in reverse, with transposed convolutions and a sigmoid at the end.
  • Parameters: 1,173,185.
  • Preprocessing, which must be exactly the same when you use it: greyscale, invert (walls bright, background dark), pad to a square with black, resize to 128 x 128 (Lanczos), pixels between 0 and 1. Input shape N x 1 x 128 x 128, float32.

Training and the setups we compared

Official split, seed 42, 20 epochs, batches of 64, Adam with learning rate 0.001, on a laptop CPU. We trained with binary cross-entropy, because with MSE the models got stuck drawing a blank page (only 6.5% of the pixels are lines), and we score with MSE. For scale: a blank page gets a test MSE of 0.0300 and the average training plan 0.0243.

SetupParametersTest MSERetrieval top-1 (test)
A: dense, code 648,438,3360.016221%
B: conv, code 32386,6570.015347%
C: conv, code 128 (this model)1,173,1850.013169%

Retrieval top-1: every test plan is shifted by 3 pixels and gets a bit of noise, and we count how often its closest code among the 400 test plans is the original.

Baselines

The same test with two simpler ways of comparing plans. The raw pixels find the original only 4% of the time, because a shift of 3 pixels moves every line onto other pixels, and PCA with 128 numbers 25%. With the same 128 numbers the autoencoder gets 69%, so the neural network is worth it here.

Training curves

The training loss (BCE) and the validation error (MSE) of the three setups. All of them were still improving at epoch 20, and C ends with the lowest validation error.

Reconstructions

Input plans and how A, B and C rebuild them. A gives a grid-like blur, B keeps only the outline, and C keeps the outline and the main inner walls. None of them keeps doors, furniture or text.

What the codes learned

An atlas of the 5,000 plans

All 5,000 plans placed on a map by their codes (UMAP), drawn as themselves: every cell of the grid shows the plan closest to its centre. Narrow plans are on the left and wide ones on the right, bold drawings at the top and small, very wide plans at the bottom. The model found this order by itself, only by learning to redraw the plans. It groups plans by shape and by how they're drawn, not by how the rooms are used.

Limitations of version 1: where it fails

Where the search fails

The test plans in four quarters by how much is drawn on them. On the boldest quarter 98% of the shifted copies find their original, on the faintest only 28%: a faint scan gives the encoder little to hold on to.

  • At 128 px thin walls, doors and text blur, so it compares the overall shape and how much is drawn, not the room programme.
  • The way a plan is drawn influences the matches: faint scans are found much less often, and they often find other faint scans.
  • Retrieval is 69%: in about 3 out of 10 cases a slightly shifted copy doesn't find its own original first.
  • It isn't rotation-invariant, and it was trained on mostly Finnish homes.
  • The training dataset is CC BY-NC 4.0. CubiCasa5K licence.

How to use

import json
import numpy as np
import onnxruntime as ort
from PIL import Image, ImageOps
from huggingface_hub import hf_hub_download

repo = "iaac-maai/hackathon-team6-cubicasa-ae"
session = ort.InferenceSession(hf_hub_download(repo, "floorplan_ae.onnx"))
collection = np.load(hf_hub_download(repo, "collection_codes.npy"))
ids = json.load(open(hf_hub_download(repo, "collection_ids.json")))


def preprocess(path, size=128):
    #the same steps as in training: greyscale, invert, pad to a square, 128 px, 0-1
    plan = ImageOps.invert(ImageOps.grayscale(Image.open(path)))
    side = max(plan.size)
    square = Image.new("L", (side, side), 0)
    square.paste(plan, ((side - plan.width) // 2, (side - plan.height) // 2))
    small = square.resize((size, size), Image.Resampling.LANCZOS)
    return (np.asarray(small, dtype=np.float32) / 255)[None, None]   # shape (1, 1, 128, 128)


plan_path = hf_hub_download(repo, "examples/plan_high_quality_architectural_1191.png")
code, reconstruction = session.run(None, {"image": preprocess(plan_path)})
distances = np.linalg.norm(collection - code, axis=1)
for i in np.argsort(distances)[:5]:
    print(ids[i], round(float(distances[i]), 1))

The first result is the plan itself, because it's in the collection too. This snippet uses version 1; for versions 2 and 3 see above.

Links

Chloe's version 4, trained on drawings aligned with their annotations, is not on the Hub: it writes a separate local bundle. See the aligned model workflow for its inputs, model selection and verification.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · onnx

Нельзя запустить

Модель выложена только в формате ONNX, рантайм загружает PyTorch-веса.

Ревизия весов
6e14232

0 моделей