TL;DR
Training neural networks directly on tiny edge devices usually hits a wall: standard backpropagation requires heavy floating-point math and constant memory shuttling, which drains power and slows things down. FLASCHE sidesteps this completely by replacing multiplication and gradients with Content-Addressable Memory (CAM)—a hardware-friendly memory that learns by counting and ranking local binary patterns. The result is a bit-exact, multiplier-free learning and inference pipeline that hits 97.97% accuracy on MNIST in software and 99.33% on the Digits dataset on an FPGA, learning 1,500 images in just 6.9 ms.
What Problem Does This Paper Address?
Spiking Neural Networks (SNNs) are often pitched as the low-power future of edge AI because they process information via sparse, event-driven spikes. The catch? Spikes are discrete and non-differentiable, which breaks standard backpropagation. To get around this, modern SNNs use "surrogate gradients" to approximate derivatives—but that reintroduces high-precision multiply-accumulate (MAC) operations and heavy memory traffic, dragging SNN hardware right back to the power and latency levels of traditional Artificial Neural Networks (ANNs).
An earlier memory-centric approach called Spike Location Dependent Plasticity (SLDP) avoided MACs by using CAM to count where patterns appear in an image. However, SLDP had two major flaws:
- It used a shallow, single-stage filter, limiting its ability to learn complex features.
- Implementing large-scale CAMs directly on FPGAs using standard logic (LUTs and flip-flops) causes a "logic explosion" that quickly exceeds chip capacity.
FLASCHE solves both problems, bringing hierarchical feature extraction and scalable CAM emulation to real-time on-chip learning.
Methods
FLASCHE is a two-stage, feedforward pipeline built around Processing-in-Memory (PIM) principles—specifically Computational-CAM (CCAM), which pairs each CAM entry with a counter.
Instead of computing gradients, FLASCHE learns through pattern matching, counting, and sorting:
- Hierarchical Feature Extraction (Filtering Block): Rather than using static filters, FLASCHE dynamically learns binary convolution kernels directly from the data. In the first stage, it extracts $2 \times 2$ binary patterns, counts their frequencies in a CCAM, and selects the top-$k$ most frequent patterns as edge filters. In the second stage, it repeats this process with $3 \times 3$ filters on the pooled edge maps to capture higher-order curves. (Interestingly, the feature maps themselves retain 8-bit quantization levels, while the learned kernels and CAM patterns are 1-bit—a hybrid structure that keeps the CAM compact.)
- CAM-Based Scoring (Scoring Block): The resulting feature maps are divided into spatial coordinates, each assigned its own CCAM. During training, whenever a $3 \times 3$ binary pattern matches an entry at that location, its counter increments. Afterward, patterns are sorted by frequency and assigned rank-based scores. During inference, an input image's patterns are matched in parallel, and their scores are summed to pick the winning class.
- BRAM-Based CAM Emulation (FPGA): To avoid the LUT/FF logic explosion on an FPGA (which would require over 1.7 million comparators for 3,000 CAM modules), the authors transpose the CAM data across 32 parallel Block RAMs (BRAMs). Using the Zybo Z7-20's 72-bit BRAM width, they pack eight 9-bit CAM entries into a single word, searching 8 CAM modules per clock cycle.
Datasets
- MNIST: Used for software validation (60,000 training and 10,000 test images, $28 \times 28$ grayscale). The authors also tested downscaled and upscaled versions ($14 \times 14$ to $42 \times 42$) to study the effect of the curve-filtering stage.
- Digits: Used for hardware validation on the FPGA (1,500 training and 297 test images, $8 \times 8$ grayscale).
Key Insights and Ideas
- Learning as Address Reordering: Instead of nudging floating-point weights via calculus, FLASCHE redefines plasticity as frequency-based address ranking. Because there are no approximations or derivatives, the FPGA hardware execution is a bit-exact replica of the software simulation.
- Curve Filtering Hurts Low-Res Images: On $28 \times 28$ MNIST images, adding the second-stage $3 \times 3$ curve filter boosts accuracy from 97.11% to 97.97%. However, on downscaled images ($24 \times 24$ and below), curve filtering actually degrades accuracy because downsampling distorts corners and the extra stage amplifies quantization noise. For the $8 \times 8$ Digits dataset, a single edge-filtering stage is both more accurate and cheaper.
- Zero DSPs Required: By replacing MACs with binary comparisons and integer counting, FLASCHE uses 0% of the FPGA's DSP48 blocks.
Key Results
- Accuracy: 97.97% on MNIST (software simulation) and 99.33% on Digits (Zybo Z7-20 FPGA, matching simulation).
- Speed (at 50 MHz):
- On-chip Learning: 6.90 ms total for 1,500 Digits training images (~240 cycles/image, or 208,333 FPS).
- Inference: 7.5 µs/image (375 cycles theoretical, ~481 cycles practical), yielding a theoretical throughput of 133,333 FPS.
- Hardware & Power (Zybo Z7-20): The FLASCHE programmable logic (PL) consumes 171 mW (out of 1.862 W total on-chip power, dominated by the ARM processor), using 46,796 LUTs (87.96%), 36,896 FFs (34.68%), 100 BRAMs (71.43%), and 0 DSPs.
Limitations and Future Work
- BRAM Emulation Overhead: Emulating CAMs with standard FPGA BRAMs forces sequential scanning across 375 addresses and accounts for 0.082 W of the PL's power. Moving to an ASIC with native non-volatile CAM primitives (e.g., MRAM-, ReRAM-, or FeFET-CAM) would enable true single-cycle parallel search and much lower energy.
- Sequential Sorting: Post-training pattern sorting is currently sequential; higher-end FPGAs could parallelize this across multiple classes.
- Dataset Scale: Hardware verification was limited to the $8 \times 8$ Digits dataset due to mid-range FPGA resource limits.
Summary updated