Speed-limit networks speedlimits-20261114-2144
Three small networks that find speed signs on the narrow road camera of a comma device, read them and say whether they apply to the car, for sunnypilot's Speed Limit Assist (sunnypilot.speedlimits).
Experimental. A help, never a guarantee: the driver always stays responsible for the speed.
| Network | What it does | File | Version |
|---|---|---|---|
| Cutter | SignNet, the network the comma runs: plain 3 x 3 convolutions trained from scratch on the top 288 rows of the frame scaled to 896 px; a heat map of sign centres and their sizes, the best 5 boxes a frame | cutter.onnx |
cutter:2026-11-14_2121-cutter/signnet |
| Classifier | MobileNetV3-Small on each box: what it is (a speed limit and its number, end of limit, variable display, other signs, not a sign) | classifier.onnx |
classifier:2026-11-14_2121-classifier/classifier |
| Applicability | MobileNetV3-Small with the box position, the car speed and the scene: whom a speed sign applies to (our road, another road, or it abstains) | decider.onnx |
decider:2026-11-11_2206-decider/experiment-b/full |
How to run them
- Cutter: the frame scaled to 896 px wide (x 896/1344) and its top 288 rows (the band), RGB values 0..1, 1 x 3 x 288 x 896. Take the 3 x 3 local maxima of the heat map (channel 0 of out) of score >= 0.3, best first, at most 5; each is a box centred at ((x + offset_x) x 8, (y + offset_y) x 8) of size (exp(log_width), exp(log_height)) in band pixels, times frame width / 896 in frame pixels.
- Classifier: each box cut from the frame (rounded outwards, at least 2 px), resized to 160 x 160, ImageNet normalisation; all the boxes of a frame in one batch. Drop the boxes called not_a_sign.
- Decider: the speed-sign boxes of the frame (families cancellation, maximum_speed, variable_display, zone, road_marking) with their inputs as decider.onnx.contract.json says, in one call. own_road: the sign applies to the car; other_road: it does not; unresolved: the decider abstains.
Each *.contract.json gives the exact inputs, outputs and classes of its network.
What the classifier says
logits has one score for each of its 62 classes; the highest is the answer, and its name is at the same place in output.classes of classifier.onnx.contract.json. A name is a family, then what the sign says: maximum_speed:50 is a limit of 50. unknown is a sign of that family whose number cannot be read yet, usually a far one.
| Family | What it is | What it can say |
|---|---|---|
cancellation |
the end of a speed limit | |
maximum_speed |
a speed limit, with the number written on the sign (km/h, or mph where the country uses them) | 10, 15, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, unknown |
maximum_speed_hours |
a speed limit with a plate of hours under it, and the hours when they are read (30:22-6) |
30, 30:22-6 |
maximum_speed_wet |
a speed limit with a plate for wet roads under it | 80, 100 |
not_a_sign |
no sign in the box | |
other_sign |
another traffic sign or a traffic light, with its kind; alone, one of no kind in the list | ahead_only, children, danger_other, direction_left, direction_right, direction_several, direction_straight, give_way, keep_left, keep_right, main_road, motorway_direction, motorway_end, motorway_start, no_entry, no_overtaking, no_vehicles, other, pedestrian_crossing, priority_to_right, roadworks, roundabout, stop, town_entry, town_exit, traffic_light_amber, traffic_light_green, traffic_light_off, traffic_light_red, traffic_queue |
road_marking |
a speed limit painted on the road | 30 |
unreadable |
a sign too far or too blurred to read | |
variable_display |
a speed limit on a variable display | 50, 60, 80, 100, 110, 120, unknown |
zone |
the sign of a zone with a speed limit | 30, unknown |
Measured
On test drives kept apart by place (never trained on):
- Cutter: finds 491 of 753 (65%) signs as the car reads them: its best 5 boxes of each frame at score 0.3 or more, 0.34 false boxes per frame.
- Cutter and classifier: 156 of 211 (74%) speed signs found and read right; 0.08 false boxes left per frame (measured with another cutter).
- Applicability: "another road" precision 0.50 and recall 0.19 on 16 such boxes; ownership macro-F1 0.41.
Trained on
10,757 reviewed sign boxes on 10,948 frames of 46 drives in Switzerland, Germany, France and the USA, recorded by comma devices and checked by a person or by an AI reviewer. No image is published. Dataset sha256 0fb5f8d707ec1a9f45917d8fb20df1688ebbacab71f2d42a3c762c2c1e4a8ab0.
Before these drives the cutter and classifier learnt from the Mapillary Traffic Sign Dataset: street photos from all over the world, ยฉ Mapillary, CC BY-NC-SA 4.0. None of its pictures is published here.
Licence
CC BY-NC-SA 4.0: free to use, change and share for non-commercial purposes, with attribution and under the same licence. It is the licence of the Mapillary Traffic Sign Dataset, which the cutter and classifier learnt from, so the weights carry it. The code that runs them is MIT (sunnypilot.speedlimits). The classifier and the decider start from torchvision's ImageNet weights; SignNet is trained from scratch.