# Circuit-Level Detection The cofiber threshold detection head expressed as synthesizable digital logic. All weights are analytically derived (zero gradient-based training) and stored as INT8 ROM. ## Person Detector (Proof of Concept) Single-class (person) detector as a combinational circuit. - **Parameters**: 4,614 (4.6 KB INT8 ROM) - **Architecture**: 6 parallel dot products (1 cls + 4 reg + 1 ctr), each 768-dim - **Weights**: closed-form least-squares on 20K COCO training images - **Construction time**: 122 seconds, zero training steps ### Gate Count (Yosys synthesis) Synthesized with Yosys (generic target, no FPGA mapping): | Component | Dims | Gates (16-dim measured) | Gates (768-dim extrapolated) | |-----------|------|------------------------|------------------------------| | 1 MAC unit | 768→1 | 1,358 | ~65K | | Person detector (6 MACs) | 768→{1,4,1} | — | ~391K | | Full 80-class detector (85 MACs) | 768→{80,4,1} | — | ~7.1M | ### Files - `person_detector.sv` — SystemVerilog module, Icarus Verilog compatible - `tb_person.sv` — testbench - `cofiber_detector.sv` — full 80-class detector (SystemVerilog, parameterized) - `person_small_synth.v` — 16-dim reduced version for synthesis analysis - `rom/person_cls_w.hex` — classification weights (768 INT8) - `rom/person_reg_w.hex` — regression weights (4×768 INT8) - `rom/person_ctr_w.hex` — centerness weights (768 INT8) - `person_analytical.pth` — PyTorch checkpoint of the analytical solution ### Simulation ```bash iverilog -g2012 -o tb_person.vvp person_detector.sv tb_person.sv vvp tb_person.vvp ``` ### Synthesis ```bash yosys -p "read_verilog person_small_synth.v; synth -top person_detector_small; stat" ``` ## Cofiber Decomposition The spatial decomposition (avg_pool → subtract → repeat) is a fixed filter bank with zero learned parameters. In hardware, it is: - Average pooling: 2×2 adder tree + arithmetic right shift - Cofiber extraction: subtractor (input − upsampled pool) - Fully combinational, no state The decomposition module (`cofiber_detector.sv`) implements all three scales for a 40×40 input grid.