Modern computer vision teams routinely reach for spatial vision transformers or deep convolutional neural networks when building perceptual backbones. That approach works fine when you have high thermal capacity and multi-gigabyte memory budgets, but edge systems sitting on battery power or constrained memory buses face a harsh wall. If your primary goal is clean boundary extraction for robotic navigation or real-time inspection, throwing full multi-head spatial self-attention at every frame wastes memory bandwidth. Recent bio-inspired work like HaCI (Harmonic Contour Integration) offers an intriguing alternative. Instead of global matrix multiplications, HaCI extracts crisp boundary maps through localized cell-level moment calculations and non-linear surround inhibition. It brings a completely different mathematical frame to low-level vision.
Rethinking Vision Frontends at the Edge
Heavy deep learning models trade memory bandwidth for generality. When a vision transformer processes an image, every patch computes attention against every other patch, scaling quadratic memory overhead unless windowing tricks are applied. For downstream tasks like edge extraction, this global context is often overkill.
HaCI replaces global receptive fields with localized cellular interactions. Rather than learning thousands of abstract filters across dense layers, the algorithm executes a structured four-stage processing pipeline: L0, L1, seed, and renderer. Each stage performs a specific physical or mathematical transformation on the input signal.
RGB Input ──> [ L0: Contrast & Gain Control ] ──> [ L1: z₂ Complex Moments ] ──> [ Seed: Non-Linear Surround Inhibition ] ──> [ Renderer: Ridge Projection ] ──> Edge Map
By decoupling local feature extraction from global spatial attention, processing runs in a distributed, localized manner. Pixels interact with immediate spatial neighbors through explicit math rather than unconstrained matrix multiplications.
Mathematical Pipeline: From $z_2$ Moments to Flank Suppression
To understand why cellular architectures scale differently on edge hardware, we have to look inside the execution pipeline. Stage L0.py handles pixel-level contrast normalization and dynamic gain control before any spatial feature extraction begins. By normalizing local luminance variations early, the pipeline prevents oversaturated lighting from blowing out boundary thresholds downstream.
Stage L1.py then aggregates normalized pixel arrays into cell-level $z_2$ complex moments. From these second-order spatial moments, the algorithm extracts three core primitives per cell: energy ($E$), local contrast ($C$), and primary orientation ($\theta$).
This moment-based representation replaces massive dense convolutional kernels with localized mathematical summaries. Instead of running dozens of 3x3 or 7x7 filter banks per layer to detect edges across multiple orientations, $z_2$ moments compress the local spatial structure into compact scalar components. The cell structure acts as an explicit receptive field, calculating continuous orientation vectors directly from pixel gradients. That means you get sub-pixel directional estimates without stacking redundant directional filters in deep network channels. For hardware engineers counting SRAM bytes, this change drops parameter counts dramatically.
The core spatial magic happens in seed.py. Here, HaCI models non-linear interaction fields through Naka-Rushton equations ($\eta_z$ NR), pairing same-orientation surround association with dynamic flank suppression for edge thinning. Biological vision systems rely heavily on lateral inhibition. Neurons firing for a specific orientation suppress neighboring cells aligned parallel to them (flanks), while reinforcing aligned cells along their collinear path. In seed.py, this interaction field produces a thinned spatial cell density metric ($\rho$) ready for rendering.
Flank suppression directly solves the bloat problem common to raw edge maps. Standard convolutional networks often output thick, blurry boundary predictions that require heuristic post-processing or aggressive non-maximum suppression (NMS) passes to clean up. By embedding non-linear inhibition directly into the interaction field math, HaCI suppresses parallel clutter while preserving long continuous boundaries. However, tuning these interaction parameters requires precision. If flank suppression is dialed up too aggressively, fine texture details and low-contrast intersecting lines get wiped out. If set too low, the output reverts to a noisy blur.
The final stage in the pipeline, renderer.py, projects these cell-level density values back into continuous image space using a learned ridge projection. On Apple Silicon, the implementation uses custom Metal kernels (splat_metal.py) to execute splatting operations efficiently when dispatched with the --device mps flag.
When examining server-side AI infrastructure, management platforms like GPUWorks coordinate large heterogeneous clusters of vLLM or SGLang engines across public and private clouds, allocating dozens of gigabytes per worker node. On edge hardware, however, managing gigabytes of VRAM for simple spatial boundaries is unacceptable. HaCI operates on a fraction of that memory footprint.
Benchmarks: Evaluating Soft versus Thinned Boundary Maps
Let’s look at the benchmark figures. Evaluated on the 200-image BRIND test set after training on the 300-image BRIND train split, HaCI delivers solid boundary metrics using the standard Berkeley boundary benchmark at a maximum matching distance threshold (maxDist) of 0.0075, which equals roughly 4.3 pixels on 481×321 resolution images.
| Output Version | ODS F-Score | Threshold | Precision | Recall | OIS F-Score | Average Precision (AP) |
|---|---|---|---|---|---|---|
NMS-thinned map (s_eval) |
0.7160 | 0.74 | 0.6841 | 0.7509 | 0.7383 | 0.7598 |
Raw soft map (c_eval) |
0.7136 | 0.74 | 0.6891 | 0.7399 | 0.7347 | 0.6655 |
The non-maximum thinned output map (s_eval) achieves an Optimal Dataset Scale (ODS) F-score of 0.7160 at a decision threshold of 0.74. At this same threshold, precision reaches 0.6841 while recall sits at 0.7509. The thinned map achieves an Average Precision (AP) of 0.7598 and an Optimal Image Scale (OIS) score of 0.7383.
If you examine the raw soft output map (c_eval) prior to NMS thinning, the numbers reveal a clear structural shift. The soft map hits an ODS F-score of 0.7136 at the 0.74 threshold, with precision at 0.6891 and recall at 0.7399. But its Average Precision drops sharply to 0.6655, and its OIS score settles at 0.7347.
That gap in AP between raw soft maps and thinned maps illustrates why localized surround inhibition matters. Soft probability fields spread energy across adjacent pixel channels, hurting precision at varying cutoffs. Thinning compresses that energy back into sharp structural lines.
Memory Profiling and Hardware Realities
The primary selling point for edge infrastructure is deterministic memory scaling. On an Apple M4 chip running Metal performance shaders, execution times and memory allocations scale cleanly across input resolutions:
- 481×321 Resolution: 35 ms execution time, 123 MB host memory, 1.1 GB GPU memory allocation.
- 1280×720 Resolution: 201 ms execution time, 171 MB host memory, 1.1 GB GPU memory allocation.
- 1920×1080 Resolution: 457 ms execution time, 233 MB host memory, 2.2 GB GPU memory allocation.
Notice how memory consumption scales predictably with pixel area rather than exploding quadratically as seen in full-frame self-attention. A vision transformer operating at 1080p must allocate massive attention matrices or resort to complex windowing tricks like Swin or patch pruning. HaCI keeps memory allocation strictly linear to frame dimensions.
Still, this efficiency comes with distinct tradeoffs. Bio-inspired interaction fields excel at explicit low-level boundary formation, but they lack semantic understanding. A spatial attention transformer knows whether an edge belongs to a car door or a shadow on asphalt; HaCI simply reports contrast gradients and orientation continuity.
Building edge perception systems is always an exercise in matching mathematical abstractions to physical hardware constraints. Stacking heavy transformer layers for low-level feature extraction often reflects poor architectural choices on bandwidth-limited edge silicon. HaCI demonstrates that cell-level complex moments combined with non-linear flank suppression can deliver crisp boundary maps within modest memory budgets. The open question for vision platform engineers is how to cleanly hybridize these light cellular frontends with downstream semantic heads without reintroducing memory bottlenecks.