Tsokotukha - PTO
Tsokotukha is a small research model that reads construction drawings through a fly visual circuit. It does not look at a crop once. It moves across 25 overlapping views, passes each view through the 721-column fly eye and joins the responses into one wall probability map.
This repository contains the best saved pure-flyvis checkpoint from our experiments, q16_z3_flyvis_pre_s1.
How the model sees a drawing
The input is a 192 x 192 crop. Each of the 25 local views is 64 x 64. The same visual circuit processes every view, then a spatial readout returns the local evidence to its place on the drawing.
Human plan and fly-eye view
The animation shows one pass through the visual demo. The plan stays visible on the left while the fly-eye representation changes beside it.
Best saved result
| Metric | Value |
|---|---|
| Average precision | 0.954543 |
| ROC-AUC | 0.996236 |
| Best IoU | 0.843486 |
| Views per crop | 25 |
The evaluation used 64 synthetic ResPlan source plans with four fixed crops per source. This was a development and model-selection split, not a sealed final test. The result should be quoted with that limitation.
The checkpoint has 1,876 trainable parameters. The flyvis circuit contains 45,669 nodes, 1,513,231 edges and 721 retinal columns. The readout uses 57 non-input cell types.
Why this checkpoint
There are higher numbers elsewhere in the project, but they come from different setups. One uses partial labels. Another adds a CNN decoder. This is the strongest saved result that keeps the flyvis circuit and its spatial readout as the model.
The hatch-recognition experiment below is a separate branch. It uses frozen upstream flyvis model 001 and reaches 0.910 with an extended legend. It has no separately trained checkpoint. Its configuration is included as article_hatch_config.json so the two results stay separate.
A second experiment: hatch recognition
The project also asked whether a frozen fly visual model can describe drawing hatches. The first diagram shows what was compared. The second shows how a moving 64 x 64 patch becomes a 1,368-value descriptor. These are manuscript figures from the hatch branch, not results from the q16 wall checkpoint.
Install
Use Python 3.12. A clean virtual environment is recommended.
pip install -r requirements.txt
The flyvis dependency is pinned to the same commit used in the experiment.
Run
For the complete 25-view setup:
python inference.py drawing_crop.png --output prediction.npz --preview probability.png
For one 64 x 64 view:
python inference.py patch.png --single --output single_view.npz
The output file contains logits, probabilities and a binary mask. The included threshold came from the development split. Recalibrate it before using the model on another dataset.
To check the package:
python verify_package.py
What is in the download
model.safetensorscontains the checkpoint tensors.config.jsonrecords the eye, temporal sequence, readout and 25-view plan.metrics.jsoncontains the saved run metrics.inference.pyruns either one view or the full 25-view plan.provenance/contains the original run result and configuration.Tsokotukha-PTO-model-only.zipis the compact package.Tsokotukha-PTO-full.zipalso contains the generated connectome cache for offline use.
Limits
This is a research checkpoint trained and evaluated on synthetic wall-segmentation data. It is not a complete drawing reader and it is not a BIM system. Production drawings contain text, tables, symbols, changing scales and drawing styles that were not covered by this result.
No customer drawing, private dataset or real project file is included in this repository.
Project citation
@misc{kuklev2026tsokotukha,
title = {Tsokotukha - PTO},
author = {Kuklev, Dmitry},
year = {2026},
note = {Research checkpoint for active visual sampling on architectural drawings}
}