lyte-codes commited on
Commit
0355389
·
verified ·
1 Parent(s): 74b4417

Model card for 263703

Browse files
Files changed (1) hide show
  1. README.md +74 -88
README.md CHANGED
@@ -14,123 +14,109 @@ tags:
14
  Reads an analog clock and returns the time. Finds the dial with a
15
  COCO-pretrained detector, then reads the crop.
16
 
17
- > Best measured result on 200 held-out real photographs: **34.0 minutes**
18
- > mean error, **1.2** median, **49.0%** within one minute.
19
- > Guessing at random is off by 180 minutes. It is better than it was and it is
20
- > not a working clock reader.
 
21
 
22
- Version 263702, commit `efe5c96`. Reader backbone: `resnet50`.
23
 
24
- ## Results on real photographs
25
 
26
- 200 held-out photos, third-party labels, all read through the same pipeline:
27
- COCO detector finds the dial, the reader reads the crop.
28
-
29
- | reader | MAE | median | within 1 min | within 5 min | worse than 30 min |
30
  |---|---|---|---|---|---|
31
- | `resnet50` | 34.0 min | 1.2 | 49.0% | 73.0% | 22.0% |
32
- | `resnet18` | 48.5 min | 1.5 | 44.5% | 60.5% | 34.5% |
33
- | `mobilenet_v3_small` | 55.6 min | 2.5 | 34.5% | 59.0% | 36.5% |
34
- | random guessing | 180 min | | | | |
35
-
36
- ## What stage 1 is, and what it is not
37
-
38
- Stage 1 is `fasterrcnn_mobilenet_v3_large_fpn` with COCO weights, run on CPU. It
39
- is not trained here and not fine-tuned. Three ways of producing a crop, same
40
- reader, same 200 photographs:
41
-
42
- | crop | MAE | median | within 5 min |
43
- |---|---|---|---|
44
- | whole image, no locator | 120.6 min | 88.3 | 22.5% |
45
- | a dial locator trained on renders (2.2 MB) | 120.7 min | 67.9 | 25.0% |
46
- | COCO detector (78 MB) | 73.6 min | 18.4 | 45.5% |
47
-
48
- The locator trained on synthetic renders contributes nothing over having no
49
- locator at all. It was removed. Distilling the detector into it would not have
50
- helped: a student cannot beat its teacher, and the training would have run back
51
- through the renderer whose domain gap is the thing being escaped.
52
-
53
- Detection runs on CPU because sustained torchvision detection on an M2 trips the
54
- GPU watchdog. On CPU it is 0.135s per image and finds a clock in 93-96% of real
55
- photographs, having never seen a render.
56
-
57
- ## How the two hands become one time
58
-
59
- A clock's hands are geared: at time t the hour hand sits at t/720 of a turn and
60
- the minute hand at (t mod 60)/60 of a turn, so one number fixes both. The reader
61
- predicts a distribution for each hand, and the decoder searches the 720 minutes
62
- the clock could be showing for the one that best explains both. It cannot return
63
- a pair of angles that describes no time, and a confident minute hand can pull a
64
- vague hour hand onto the right hour.
65
-
66
- | decoder | MAE | median | within 5 min | worse than 30 min |
67
- |---|---|---|---|---|
68
- | each hand read on its own | 35.3 min | 1.4 | 69.0% | 25.5% |
69
- | search over times the clock could show | 34.0 min | 1.2 | 73.0% | 22.0% |
70
-
71
- Same weights, same crops, same photographs; only the decoding differs. The gain
72
- is in readings that were nearly right already, which is why MAE barely moves --
73
- MAE here is set by the readings that are wrong by hours, and those are wrong in
74
- the image, not in the decoding.
75
-
76
- Scoring the hands in each other's roles, to catch the ones read the wrong way
77
- round, does not work and is off by default. On these photographs the exchanged
78
- reading scored a median 0.06 better where the hands really were swapped and 0.11
79
- worse everywhere else -- the two populations sit on top of each other. A swap is
80
- not two good angles in the wrong slots; the model is confidently wrong about
81
- both hands at once and they agree on a wrong but perfectly geared time.
82
 
83
  ## When to trust a reading
84
 
85
  The reader ranks its own answers, and the ranking is worth more than the
86
- headline. Keeping only the half it is surest of:
 
87
 
88
  ```
89
  200 readings. Keeping only the ones each signal is most sure of:
90
 
91
  hand agreement
92
  keep n MAE median <=5min
93
- 100% 200 34.02 1.25 73.0%
94
- 75% 150 26.80 1.00 79.3%
95
- 50% 100 22.64 0.75 86.0%
96
- 25% 50 30.12 0.75 82.0%
97
- 10% 20 20.74 0.50 90.0%
98
- rank correlation with error +0.352 (useful)
99
 
100
  head sharpness
101
  keep n MAE median <=5min
102
- 100% 200 34.02 1.25 73.0%
103
- 75% 150 16.58 0.75 84.0%
104
- 50% 100 8.18 0.50 94.0%
105
- 25% 50 1.91 0.50 98.0%
106
- 10% 20 4.03 0.50 95.0%
107
- rank correlation with error -0.506 (useful)
108
 
109
  search margin
110
  keep n MAE median <=5min
111
- 100% 200 34.02 1.25 73.0%
112
- 75% 150 18.39 0.75 84.0%
113
- 50% 100 10.73 0.50 92.0%
114
- 25% 50 6.75 0.50 96.0%
115
- 10% 20 3.75 0.50 95.0%
116
- rank correlation with error -0.496 (useful)
117
 
118
  A caution on reading the low-coverage rows: at 25% of 200 photographs a row
119
  rests on 50 readings, so small differences between signals there are noise.
120
  ```
121
 
122
- The signal this project set out to use for that was the disagreement between the
123
- hands, which is free to compute. It works on renders and barely ranks anything
124
- on photographs. The two that do work came out of the decoder instead.
 
 
 
 
 
 
 
 
125
 
126
  ## Honest limits
127
 
128
- The labels on these 200 photographs are third party. 106 of them were checked by
129
- hand against the image; the rest were not. The photographs were collected for
130
- other purposes and skew toward clocks that are already the subject of the frame.
131
 
132
- There is no first-party test set. A number measured on somebody else's labels is
133
- worth less than one measured on your own, and that gap is not closed here.
 
 
134
 
135
  ## Licence
136
 
 
14
  Reads an analog clock and returns the time. Finds the dial with a
15
  COCO-pretrained detector, then reads the crop.
16
 
17
+ > **263703 reads 51.5% of 200 held-out real photographs to the minute**,
18
+ > against 49.0% for 263702. It is also wrong by more than half an hour
19
+ > more often -- 25.5% against 22.0% -- so this is a
20
+ > trade, not a clean win. Which one you want depends on whether a wrong answer
21
+ > costs you more than a missing one. Both are in this repository.
22
 
23
+ Version 263703, commit `1fce71d`. Reader backbone: `resnet50`.
24
 
25
+ ## The two versions, same 200 photographs, same pipeline
26
 
27
+ | | to the minute | median | within 5 min | MAE | worse than 30 min |
 
 
 
28
  |---|---|---|---|---|---|
29
+ | **263703** | **51.5%** | **1.00 min** | 69.0% | 40.4 min | 25.5% |
30
+ | 263702 | 49.0% | 1.25 min | **73.0%** | **34.0 min** | **22.0%** |
31
+ | guessing | ~0% | 180 min | 3% | 180 min | 97% |
32
+
33
+ The trade has a cause, and it is visible while training. Measured on real
34
+ photographs held out from training, epoch by epoch: readings correct to the
35
+ minute climb from 23.2% to 48.7% across all 22 epochs and never stop climbing,
36
+ while mean error bottoms out at epoch 8 and then gets worse. Training longer
37
+ makes the model sharper on the clocks it can read and less steady on the ones it
38
+ cannot. There is no epoch that is best at both, so the choice is a choice.
39
+
40
+ ## What changed
41
+
42
+ **The reader gained a third head.** The other two each describe one hand, so a
43
+ dial whose hands are hard to tell apart corrupts both at once -- on 263702, 27.5%
44
+ of readings got the minute right and the hour wrong. The third head is asked for
45
+ the time itself over the whole 12-hour ring, coarsely, with no notion of a hand:
46
+ it cannot express a role confusion because it never assigns roles, and it only
47
+ has to break the twelve-way tie. In a controlled comparison -- same data, same
48
+ recipe, only the head differing -- it moved exactly what it was aimed at, hours
49
+ missed with the minute correct falling from 12.0% to 8.5%.
50
+
51
+ **The checkpoint is chosen on photographs, not renders.** Renders stop
52
+ predicting real accuracy about a third of the way through training; picking the
53
+ epoch renders liked cost 3 to 7 minutes of real error. It is chosen on
54
+ photographs held out from training and never in this test set, and by the
55
+ to-the-minute rate, because MAE and the to-the-minute rate disagree about which
56
+ epoch is best and only one of them is what this model is for.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  ## When to trust a reading
59
 
60
  The reader ranks its own answers, and the ranking is worth more than the
61
+ headline. Declining the quarter it is least sure of takes it from
62
+ 69.0% within five minutes to 96%.
63
 
64
  ```
65
  200 readings. Keeping only the ones each signal is most sure of:
66
 
67
  hand agreement
68
  keep n MAE median <=5min
69
+ 100% 200 40.40 1.00 69.0%
70
+ 75% 150 26.06 1.00 80.0%
71
+ 50% 100 15.16 0.75 86.0%
72
+ 25% 50 10.31 0.50 90.0%
73
+ 10% 20 7.20 0.75 95.0%
74
+ rank correlation with error +0.388 (useful)
75
 
76
  head sharpness
77
  keep n MAE median <=5min
78
+ 100% 200 40.40 1.00 69.0%
79
+ 75% 150 24.20 0.75 80.7%
80
+ 50% 100 7.80 0.75 92.0%
81
+ 25% 50 1.84 0.75 98.0%
82
+ 10% 20 3.55 0.50 95.0%
83
+ rank correlation with error -0.504 (useful)
84
 
85
  search margin
86
  keep n MAE median <=5min
87
+ 100% 200 40.40 1.00 69.0%
88
+ 75% 150 21.12 0.75 82.0%
89
+ 50% 100 10.33 0.75 91.0%
90
+ 25% 50 5.75 0.50 96.0%
91
+ 10% 20 0.57 0.50 100.0%
92
+ rank correlation with error -0.529 (useful)
93
 
94
  A caution on reading the low-coverage rows: at 25% of 200 photographs a row
95
  rests on 50 readings, so small differences between signals there are noise.
96
  ```
97
 
98
+ The signal this project set out to use for that was disagreement between the
99
+ hands. On weaker readers it ranked almost nothing; it becomes useful here, which
100
+ took a good enough model rather than a better signal.
101
+
102
+ ## Stage 1
103
+
104
+ `fasterrcnn_mobilenet_v3_large_fpn` with COCO weights, on CPU, not fine-tuned.
105
+ It finds a clock in 93-96% of real photographs having never seen a render. A
106
+ dial locator trained on renders scored no better than not cropping at all and
107
+ was removed. On the 9 test photographs where stage 1 finds nothing, 1 is still
108
+ read within five minutes.
109
 
110
  ## Honest limits
111
 
112
+ The goal this was pointed at was reading the time to the minute 95% of the time.
113
+ It does not get there: 51.5% across all photographs, and about 90% even
114
+ when allowed to decline 85% of them.
115
 
116
+ The labels on these 200 photographs are third party. 106 were checked by hand
117
+ against the image; the rest were not. There is no first-party test set, and a
118
+ number measured on somebody else's labels is worth less than one measured on
119
+ your own.
120
 
121
  ## Licence
122