StephanMeijer commited on
Commit
898a3bf
·
verified ·
1 Parent(s): 2863e29
Files changed (3) hide show
  1. README.md +151 -0
  2. config.json +118 -0
  3. model.onnx +3 -0
README.md ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: onnx
4
+ pipeline_tag: image-classification
5
+ tags:
6
+ - multi-label
7
+ - image-attributes
8
+ - onnx
9
+ - efficientnetv2
10
+ ---
11
+
12
+ # WhatDoWeSee-EfficientNetV2-B0
13
+
14
+ Tags **what is visible in an image** with any number of 20 attributes, such as
15
+ people, text, chart, diagram, table, map or aerial view. A small, fast EfficientNetV2-B0 model (24 MB ONNX, about 14 ms per image on one CPU thread)
16
+ for sorting and describing large image collections.
17
+
18
+ This is **v0.4.0** (2026-10-16): trained on 28,495 images labelled by three open vision-language models (Clef-omni, Gemma 4 26B, Qwen3-VL 32B), learning from how many of them agree.
19
+ Try it in your browser: [WhatDoWeSee Space](https://huggingface.co/spaces/StephanMeijer/WhatDoWeSee).
20
+
21
+ ## Attributes
22
+
23
+ An image gets every attribute that is clearly recognisable, also when blurry or in the background;
24
+ tiny or unrecognisable details don't count. Depicted things count (a drawn dog is Animals).
25
+
26
+ - **People** (`people`): one or more humans, or clearly human faces, hands or bodies
27
+ - **Animals** (`animals`): animals, birds, fish or insects
28
+ - **Plants** (`nature`): living green things: trees, plants, flowers, crops; not grass or a lawn as ground, not sea, sky or rocks (those are Landscape)
29
+ - **Landscape** (`landscape`): an outdoor view of land, sea, sky, mountains, rocks, rivers or a city as a whole
30
+ - **Buildings / structures** (`buildings`): buildings, interiors where the room or its architecture is clearly visible, and other built structures: bridges, towers, dams, monuments, ruins
31
+ - **Vehicles** (`vehicles`): cars, bikes, trains, ships, planes or other vehicles
32
+ - **Food** (`food`): food or drinks
33
+ - **Text** (`text`): running text, sentences, lists or a page that make up a substantial part of the image; labels, captions, titles and signs don't count
34
+ - **Handwriting** (`handwriting`): handwritten text, notes or signatures
35
+ - **Chart** (`chart`): a data plot: values on axes or as proportions (bar, line, pie, scatter, area chart or similar)
36
+ - **Diagram** (`diagram`): structure or relationships without measured values: a flowchart, schematic, process or relationship diagram; also labelled drawings that show how something is built (anatomy, parts, cross-sections)
37
+ - **Table** (`table`): text or numbers laid out in rows and columns, with or without grid lines; not the furniture
38
+ - **Map** (`map`): a geographic map, floor plan or route map
39
+ - **Logo / icon** (`logo-icon`): a logo, icon, emblem, badge or pictogram
40
+ - **Formula** (`formula`): mathematical, chemical or other notation
41
+ - **Screen / UI** (`screen`): an app, website or device interface
42
+ - **Artwork** (`artwork`): made as art: a painting, illustration, cartoon or sculpture, as the image itself or shown in it; not drawings made to explain (those are Diagram)
43
+ - **Instruments** (`instruments`): musical instruments: guitar, piano, violin, drums, wind instruments and the like
44
+ - **Furniture** (`furniture`): chairs, tables, beds, sofas, desks, cabinets, shelves and other furniture (a data table is Table)
45
+ - **Aerial** (`aerial`): the ground seen from high above: aerial or satellite photos, drone shots, bird's-eye views, also through a plane window, straight down or at an angle; clouds without ground don't count; a drawn map is Map
46
+
47
+ ## Usage
48
+
49
+ Download a fixed version (recommended), so a later release never changes your results:
50
+
51
+ ```python
52
+ from huggingface_hub import hf_hub_download
53
+
54
+ model_path = hf_hub_download("StephanMeijer/WhatDoWeSee-EfficientNetV2-B0", "model.onnx", revision="v0.4.0")
55
+ config_path = hf_hub_download("StephanMeijer/WhatDoWeSee-EfficientNetV2-B0", "config.json", revision="v0.4.0")
56
+ ```
57
+
58
+ Then:
59
+
60
+ ```python
61
+ import json
62
+ import numpy as np
63
+ import onnxruntime as ort
64
+ from PIL import Image
65
+
66
+ config = json.load(open(config_path))
67
+ session = ort.InferenceSession(model_path)
68
+ size = config["input"]["shape"][-1]
69
+ mean = np.array(config["input"]["mean"], dtype=np.float32)
70
+ std = np.array(config["input"]["std"], dtype=np.float32)
71
+
72
+ image = Image.open("photo.jpg").convert("RGB").resize((size, size), Image.BILINEAR)
73
+ x = ((np.asarray(image, dtype=np.float32) / 255 - mean) / std).transpose(2, 0, 1)[None]
74
+ probabilities = 1 / (1 + np.exp(-session.run(None, {"pixel_values": x})[0][0]))
75
+ present = [label for label, p in zip(config["labels"], probabilities)
76
+ if p >= config["thresholds"][label]]
77
+ ```
78
+
79
+ Preprocessing: RGB, resized to 224×224 (antialiased bilinear, no crop, aspect ratio not kept),
80
+ scaled to [0, 1], normalised with the ImageNet mean and standard deviation, NCHW float32. Each label has
81
+ its own threshold in `config.json`, tuned on a validation split.
82
+
83
+ ## Evaluation
84
+
85
+ On 3435 held-out teacher-labelled images: mean average precision **0.91**,
86
+ macro F1 **0.85** at the tuned thresholds.
87
+
88
+ | label | name | positives | AP | F1 |
89
+ |---|---|---:|---:|---:|
90
+ | `people` | People | 626 | 0.95 | 0.89 |
91
+ | `animals` | Animals | 268 | 0.87 | 0.82 |
92
+ | `nature` | Plants | 382 | 0.89 | 0.82 |
93
+ | `landscape` | Landscape | 438 | 0.93 | 0.84 |
94
+ | `buildings` | Buildings / structures | 422 | 0.91 | 0.84 |
95
+ | `vehicles` | Vehicles | 185 | 0.82 | 0.74 |
96
+ | `food` | Food | 106 | 0.76 | 0.72 |
97
+ | `text` | Text | 1035 | 0.95 | 0.90 |
98
+ | `handwriting` | Handwriting | 243 | 0.86 | 0.80 |
99
+ | `chart` | Chart | 260 | 0.98 | 0.95 |
100
+ | `diagram` | Diagram | 235 | 0.94 | 0.93 |
101
+ | `table` | Table | 275 | 0.97 | 0.91 |
102
+ | `map` | Map | 169 | 0.95 | 0.92 |
103
+ | `logo-icon` | Logo / icon | 551 | 0.84 | 0.77 |
104
+ | `formula` | Formula | 30 | 0.90 | 0.81 |
105
+ | `screen` | Screen / UI | 377 | 0.97 | 0.92 |
106
+ | `artwork` | Artwork | 474 | 0.94 | 0.88 |
107
+ | `instruments` | Instruments | 64 | 0.87 | 0.85 |
108
+ | `furniture` | Furniture | 183 | 0.81 | 0.73 |
109
+ | `aerial` | Aerial | 161 | 0.97 | 0.93 |
110
+
111
+ ### How it compares
112
+
113
+ Against its teachers on the 3,435 test images: mean AP 0.91, macro F1 0.85 at 0.5 (MobileNetV4
114
+ v0.4.0-rc.1 on the same images: 0.88 and 0.83). On the 5,158 validation images macro F1 at 0.5
115
+ is 0.857, about the same as v0.3.0's 0.858, but v0.3.0 trained on most of those images; on
116
+ the part it never saw, v0.3.0 reaches 0.74. About 14 ms per image on one CPU thread.
117
+ Against v0.3.0 on 60 independent hand-labelled images: slightly worse (mean AP 0.81 against
118
+ 0.87, macro F1 at 0.5 0.76 against 0.77 to 0.78). Better on Animals, Screen / UI, Map and
119
+ Artwork; weaker on People, Landscape, Handwriting and Logo / icon. Hand labels and teacher
120
+ labels differ in what they count, and per-label scores on the 60 rest on 1 to 24 images:
121
+ indicative only. A larger EfficientViT-B2 model scored higher (confirm macro F1 0.86) at four
122
+ times the CPU time; it was not released.
123
+
124
+ ## Training
125
+
126
+ - Backbone: `tf_efficientnetv2_b0.in1k` (ImageNet-pretrained, via timm), with a new
127
+ 20-way sigmoid head; 30 epochs, AdamW, binary cross-entropy per label.
128
+ - Data: The same teachers and images as WhatDoWeSee-MobileNetV4 v0.4.0-rc.1: Cloudflare Clef-omni, Gemma 4 26B-A4B and Qwen3-VL 32B, run on EuroHPC (Discoverer+), answered the attribute question for all 44,361 images of the full-v1 corpus. No hosted API and no hand labels are involved; the 681 hand-labelled images are left out entirely, and near-duplicates (pHash) stay in one split. New in v0.4.0: instead of a yes/no target, the model learns from the vote count (all three agree 0.95, two 0.35, one 0.10, none 0.02). Trained on 28,495 images, 30 epochs from ImageNet weights, best epoch picked on 1,441 held-out training images. The backbone (tf_efficientnetv2_b0, 224 px) won a champion-challenger selection over 35 backbones and several training variants, scored on 5,158 validation images where all three teachers agree; thresholds are tuned on those. Test: 3,435 teacher-labelled images it never trained, tuned or was selected on.
129
+ - The images come from public collections: photo datasets, document and form scans, charts,
130
+ diagrams, screenshots, maps, artwork and icons.
131
+
132
+ ## Limitations
133
+
134
+ - Small text-related details (a small table inside a document, a signature) are harder than
135
+ whole-image subjects.
136
+ - The training images come from many public collections, some under research-only or
137
+ non-commercial terms. Check whether that matters for your use.
138
+
139
+ ## Licence
140
+
141
+ The model weights and `config.json` are released under the Apache License 2.0, like the
142
+ EfficientNetV2-B0 backbone they start from. The licence covers the model, not the images it was trained on.
143
+
144
+ ## Versions
145
+
146
+ Each version on test images it never trained on (mean AP and macro F1). The test sets
147
+ differ between some versions, so compare versions through the notes of each version:
148
+
149
+ | version | date | test images | mean AP | macro F1 | |
150
+ |---|---|---:|---:|---:|---|
151
+ | **v0.4.0** | 2026-10-16 | 3435 | 0.91 | 0.85 | trained on 28,495 images labelled by three open vision-language models (Clef-omni, Gemma 4 26B, Qwen3-VL 32B), learning from how many of them agree |
config.json ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "v0.4.0",
3
+ "task": "multi-label image attributes",
4
+ "group": "content",
5
+ "labels": [
6
+ "people",
7
+ "animals",
8
+ "nature",
9
+ "landscape",
10
+ "buildings",
11
+ "vehicles",
12
+ "food",
13
+ "text",
14
+ "handwriting",
15
+ "chart",
16
+ "diagram",
17
+ "table",
18
+ "map",
19
+ "logo-icon",
20
+ "formula",
21
+ "screen",
22
+ "artwork",
23
+ "instruments",
24
+ "furniture",
25
+ "aerial"
26
+ ],
27
+ "names": [
28
+ "People",
29
+ "Animals",
30
+ "Plants",
31
+ "Landscape",
32
+ "Buildings / structures",
33
+ "Vehicles",
34
+ "Food",
35
+ "Text",
36
+ "Handwriting",
37
+ "Chart",
38
+ "Diagram",
39
+ "Table",
40
+ "Map",
41
+ "Logo / icon",
42
+ "Formula",
43
+ "Screen / UI",
44
+ "Artwork",
45
+ "Instruments",
46
+ "Furniture",
47
+ "Aerial"
48
+ ],
49
+ "definitions": {
50
+ "people": "one or more humans, or clearly human faces, hands or bodies",
51
+ "animals": "animals, birds, fish or insects",
52
+ "nature": "living green things: trees, plants, flowers, crops; not grass or a lawn as ground, not sea, sky or rocks (those are Landscape)",
53
+ "landscape": "an outdoor view of land, sea, sky, mountains, rocks, rivers or a city as a whole",
54
+ "buildings": "buildings, interiors where the room or its architecture is clearly visible, and other built structures: bridges, towers, dams, monuments, ruins",
55
+ "vehicles": "cars, bikes, trains, ships, planes or other vehicles",
56
+ "food": "food or drinks",
57
+ "text": "running text, sentences, lists or a page that make up a substantial part of the image; labels, captions, titles and signs don't count",
58
+ "handwriting": "handwritten text, notes or signatures",
59
+ "chart": "a data plot: values on axes or as proportions (bar, line, pie, scatter, area chart or similar)",
60
+ "diagram": "structure or relationships without measured values: a flowchart, schematic, process or relationship diagram; also labelled drawings that show how something is built (anatomy, parts, cross-sections)",
61
+ "table": "text or numbers laid out in rows and columns, with or without grid lines; not the furniture",
62
+ "map": "a geographic map, floor plan or route map",
63
+ "logo-icon": "a logo, icon, emblem, badge or pictogram",
64
+ "formula": "mathematical, chemical or other notation",
65
+ "screen": "an app, website or device interface",
66
+ "artwork": "made as art: a painting, illustration, cartoon or sculpture, as the image itself or shown in it; not drawings made to explain (those are Diagram)",
67
+ "instruments": "musical instruments: guitar, piano, violin, drums, wind instruments and the like",
68
+ "furniture": "chairs, tables, beds, sofas, desks, cabinets, shelves and other furniture (a data table is Table)",
69
+ "aerial": "the ground seen from high above: aerial or satellite photos, drone shots, bird's-eye views, also through a plane window, straight down or at an angle; clouds without ground don't count; a drawn map is Map"
70
+ },
71
+ "thresholds": {
72
+ "people": 0.3858,
73
+ "animals": 0.3895,
74
+ "nature": 0.5188,
75
+ "landscape": 0.5707,
76
+ "buildings": 0.4672,
77
+ "vehicles": 0.3705,
78
+ "food": 0.2924,
79
+ "text": 0.6282,
80
+ "handwriting": 0.4616,
81
+ "chart": 0.6102,
82
+ "diagram": 0.5,
83
+ "table": 0.5683,
84
+ "map": 0.4185,
85
+ "logo-icon": 0.5563,
86
+ "formula": 0.5,
87
+ "screen": 0.6147,
88
+ "artwork": 0.5216,
89
+ "instruments": 0.2603,
90
+ "furniture": 0.6538,
91
+ "aerial": 0.5653
92
+ },
93
+ "input": {
94
+ "name": "pixel_values",
95
+ "shape": [
96
+ "batch",
97
+ 3,
98
+ 224,
99
+ 224
100
+ ],
101
+ "mean": [
102
+ 0.485,
103
+ 0.456,
104
+ 0.406
105
+ ],
106
+ "std": [
107
+ 0.229,
108
+ 0.224,
109
+ 0.225
110
+ ],
111
+ "preprocessing": "RGB; resize to img_size x img_size (bilinear, antialiased, no crop, aspect not preserved); scale to [0,1]; (x - mean) / std; NCHW float32"
112
+ },
113
+ "output": {
114
+ "name": "logits",
115
+ "activation": "sigmoid per label; present when >= its threshold"
116
+ },
117
+ "backbone": "tf_efficientnetv2_b0.in1k"
118
+ }
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61d5ce2d6cd72cff357b7aba6d0b790d47c4453dcfebcce736c48375d1914bd5
3
+ size 24058507