Buildwellai commited on
Commit
68cfbbe
·
verified ·
1 Parent(s): dfcb1e9

upload diagram-type classifier (DINOv3 fine-tune + probe)

Browse files
Files changed (5) hide show
  1. README.md +51 -0
  2. class_probe.joblib +3 -0
  3. classifications_pool.json +0 -0
  4. ft_model.pt +3 -0
  5. report.txt +14 -0
README.md ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags: [image-classification, dinov3, construction, building-regulations, comfyui]
4
+ pipeline_tag: image-classification
5
+ ---
6
+
7
+ # BuildwellAI Diagram-Type Classifier
8
+
9
+ Classifies a UK building-regulations / construction figure into its **diagram type**, to route a ComfyUI
10
+ restyle workflow to the class-appropriate prompt/ControlNet.
11
+
12
+ ## Classes
13
+ - `COMPOUND`
14
+ - `CROSS_SECTION`
15
+ - `ISOMETRIC_UPDATE`
16
+ - `SCHEMATIC_FLOW`
17
+ - `SITE_PLAN`
18
+ - `TABLE_DATA`
19
+
20
+ ## How it was built
21
+ - **Labels**: distilled from a Qwen3.5-VL teacher over 2315 diagram crops (`classifications_pool.json`).
22
+ - **Encoder**: DINOv3 ViT-L/16 (frozen features for the probe; last blocks fine-tuned for `ft_model.pt`).
23
+ - **Finding**: encoder size was not the bottleneck (DINOv2-base == DINOv3-large at 234 samples); data
24
+ scale (234→2315) and fine-tuning to the line-drawing domain were.
25
+
26
+ ## Results (5-fold CV / held-out val)
27
+ ```
28
+ val_acc=0.790 val_bal=0.818
29
+
30
+ precision recall f1-score support
31
+
32
+ COMPOUND 0.727 0.762 0.744 84
33
+ CROSS_SECTION 0.855 0.707 0.774 133
34
+ ISOMETRIC_UPDATE 0.703 0.867 0.776 30
35
+ SCHEMATIC_FLOW 0.562 0.750 0.643 12
36
+ SITE_PLAN 0.667 0.870 0.755 23
37
+ TABLE_DATA 0.935 0.951 0.943 61
38
+
39
+ accuracy 0.790 343
40
+ macro avg 0.742 0.818 0.772 343
41
+ weighted avg 0.802 0.790 0.791 343
42
+
43
+ ```
44
+
45
+ ## Files
46
+ - `ft_model.pt` — fine-tuned DINOv3 + linear head (state_dict, classes, encoder id).
47
+ - `class_probe.joblib` — frozen-feature logistic-regression probe (lighter, sklearn).
48
+ - `report.txt` — per-class validation report.
49
+
50
+ ## Use in ComfyUI
51
+ Load DINOv3 + this head in a custom node that maps `IMAGE -> (class, confidence)` and drives Switch nodes.
class_probe.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0b9abb4974d2470cd37ee97b27550fbf03d4178e66126aa1929dff48af5a3f6
3
+ size 55332
classifications_pool.json ADDED
The diff for this file is too large to render. See raw diff
 
ft_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1decb4e7efaf6332f20b8d510267d0da2b2a64c0000855849030cd3772d9cd5b
3
+ size 1212699940
report.txt ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ val_acc=0.790 val_bal=0.818
2
+
3
+ precision recall f1-score support
4
+
5
+ COMPOUND 0.727 0.762 0.744 84
6
+ CROSS_SECTION 0.855 0.707 0.774 133
7
+ ISOMETRIC_UPDATE 0.703 0.867 0.776 30
8
+ SCHEMATIC_FLOW 0.562 0.750 0.643 12
9
+ SITE_PLAN 0.667 0.870 0.755 23
10
+ TABLE_DATA 0.935 0.951 0.943 61
11
+
12
+ accuracy 0.790 343
13
+ macro avg 0.742 0.818 0.772 343
14
+ weighted avg 0.802 0.790 0.791 343