Hardwired Distributed Processing Units for Inference: Neural Decisions at the Sensor that Free the Host
Organizations: Independent Researcher
Abstract
We show that a hardwired distributed processing unit (HDPU) can take a neural decision at the sensor and so remove the inference from the host. Built for zebra-crossing detection on a low-cost Artix-7 FPGA, the unit decides on every camera frame in a fixed 2,269,477 clock cycles (34.04 ms depends upon Fpga clk ), inside the 37.49-ms frame period, and on the board it returns the same scores and decisions as its bit-exact software model on all 639 test images. The whole detection path, from camera pixels to decision, takes 1,814 LUTs, with no processor, no operating system and no full-resolution frame store. When the unit answers instead of reporting "not sure", 95.7% of its answers on street photographs are correct, and a hardware contrast stage lifts accuracy on camera-like dashcam frames from 47.7% to 78.2%. The host is spared all of the inference: 8.13 ms of a core in every frame period, where a full-precision ResNet-18 would need more than a frame period even on 16 threads. It also receives 16 bytes per frame instead of 614,400, 38,400 times less. The unit is an 80x60-pixel pipeline feeding a four-layer binarized CNN with 93,408 one-bit weights, verified bit-exactly from a Python model through RTL simulation to the board. Earlier HDPUs did pre-processing (edges, corners, steering); this one shows that the decision itself can move to the sensor.
Figures & tables
| Layer | Operation | Output | Clocks | Share |
|---|---|---|---|---|
| L0 | conv , 8-bit input | 1,382,400 | 60.9 % | |
| L1 | conv , XNOR | 691,200 | 30.5 % | |
| L2 | conv , XNOR | 161,280 | 7.1 % | |
| L3 | conv , XNOR | 34,560 | 1.5 % | |
| L4 | fully connected | score | 15 | 0.0 % |
| Total, with 22 control clocks | 2,269,477 | |||
| Level | Compared with the model | Result |
|---|---|---|
| Simulation | camera pins to the image | 3/3 frames |
| Simulation | engine: score, decision, every feature-map word | 639/639 images |
| Simulation | serial link, contrast, engine, decision (real OV7670 frame) | 20/20 checks |
| Board | self-test, golden vectors over the link | 8/8 checks |
| Board | T1, score and decision | 524/524 images |
| Board | T2, score and decision | 115/115 images |
| Result | Value | Source |
|---|---|---|
| Decision time, every frame, any image | 34.04 ms (2,269,477 clocks) | simulation |
| Frames skipped on the live camera | 0 | hardware |
| Score and decision equal to the model | 639 of 639 images | hardware |
| Accuracy, T1 / T2 | 79.39 / 79.13 % | hardware |
| Correct when answering, T1 / T2 | 90.2 / 95.7 % | hardware |
| Camera-like frames, T1: without with contrast stage | 47.7 % 78.2 % | model |
| Check | Result |
|---|---|
| Self-test | 8 of 8 checks pass |
| Camera frames committed | 27.5 frames/s, none rejected |
| Decisions on the live camera | 27/s, no frame skipped |
| T1, dashcam frames, through the FPGA | 524/524 equal to the model, 79.39 % |
| T2, street photos, through the FPGA | 115/115 equal to the model, 79.13 % |
| Quantity | Value | Source |
|---|---|---|
| Camera frame period | 37.49 ms | model |
| Decision time | 34.04 ms | simulation |
| Margin per frame | 3.44 ms | derived |
| Frame end to decision | about 34.2 ms | derived |
| Engine busy | 90.8 % of the frame | derived |
| Highest decision rate | 29.4/s (camera: 26.68/s) | derived |
| T1 (dashcam) | T2 (street) | |
|---|---|---|
| Images (with a crossing) | 524 (292) | 115 (67) |
| True / false detections | 197 / 13 | 56 / 13 |
| Missed / true rejections | 95 / 219 | 11 / 35 |
| Precision / recall (%) | 93.8 / 67.5 | 81.2 / 83.6 |
| F1 / accuracy (%) | 78.5 / 79.4 | 82.4 / 79.1 |
| Answered outside the band (%) | 50.8 | 40.0 |
| Share answered (%) | 30 | 40 | 50 | 60 | 80 | 100 |
|---|---|---|---|---|---|---|
| T1 (dashcam), correct (%) | 92.4 | 93.8 | 91.6 | 90.4 | 83.5 | 77.5 |
| T2 (street), correct (%) | 97.1 | 95.7 | 93.1 | 88.4 | 81.5 | 73.0 |
| Block | LUT | FF | BRAM36 | DSP |
| Inference engine (BCNN core) | 744 | 321 | 10 | 0 |
| Pre-processing (gray, means) | 211 | 257 | 0 | 0 |
| Auto-contrast, loader, decision | 615 | 593 | 0 | 1 |
| Frame banks, serial link | 244 | 132 | 7 | 0 |
| Camera, SDRAM, VGA picture path | 1,069 | 769 | 1.5 | 0 |
| Overlay, LCD, buzzer, clocks | 490 | 658 | 0.5 | 0 |
| Host task per frame | 1 thread | 16 threads | Share of frame, 1 thread |
|---|---|---|---|
| Binarized network | 8.13 ms | 10.47 ms | 21.7 % |
| ResNet-18, full precision | 56.39 ms | 42.49 ms | 150 % |
| Inference HDPU | no host time | 0 % | |
| Message to the host | Bytes | Smaller than a frame by |
|---|---|---|
| Raw RGB565 frame | 614,400 | 1 |
| Snapshot: the image the network saw, with its decision | 4,826 | 127 |
| Status reply | 42 | 14,629 |
| Decision (state, score, margin, average, counters) | 16 | 38,400 |
| System | Platform | What it needs around it | Rate | Reported result |
|---|---|---|---|---|
| ZebraRecognizer [ 8 ] | iPhone 5S | phone, operating system | about 25 fps | precision 1.0, recall 0.93 |
| LYTNet [ 9 ] | iPhone 7 | phone, operating system | 20 fps | 94 % † |
| CDNet [ 10 ] | Jetson Nano | GPU module, operating system | 33.1 fps | F1 above 94 % |
| FINN CNV [ 14 ] | ZC706 (Zynq-7045) | Zynq SoC board | 21,906 images/s | 80.1 % (CIFAR-10) |
| This work | XC7A35T and a camera | nothing else: no processor, no OS | 26.68 fps (every frame) | 79.1 % (T2); 95.7 % when answering |
FPGA-Based Neural Network Acceleration
Field-programmable gate array (FPGA)-based neural network acceleration maps models to reconfigurable hardware for fast, energy-efficient inference.
See all 95 papers