YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
SaraNet Pico: The "Mirror-Neuron" Audio AI
SaraNet is a revolutionary, highly-optimized Neural Network running directly on a Raspberry Pi Pico (RP2040) designed specifically for 16-word Keyword Spotting (KWS).
What makes SaraNet unique is its Activation-Free Architecture known as the "Mirror-Neuron" Topology, entirely bypassing classical activation functions (like ReLU or GELU). Instead, non-linearity is achieved through strict signal routing and physical hardware-like gating.
π§ The Mirror-Neuron Architecture
Inspired by hardware electronics and signal routing, SaraNet operates on the following principles:
- The Dispatcher (Input Layer): Receives the input signal (Mel-Spectrogram), applies weights and biases, and fans out the signal.
- The Mirror Neurons (Hidden Layer): Instead of using a mathematical non-linear function, the hidden layer consists of "Mirror Pairs" (Positive and Negative neurons).
- Positive Neurons have a strict physical valve at their input:
clamp(min=0.0). They only allow positive signals to enter. - Negative Neurons have an inverse valve:
clamp(max=0.0). They only allow negative signals to enter. - Crucial Rule: Every neuron receives the exact same broadcasted signal from the dispatcher. The split happens at the gates of the neurons, not before. After the gate, each neuron applies its own unique learned weights and bias.
- Positive Neurons have a strict physical valve at their input:
- The Judge (Output Layer): Collects the fully-connected output of all Positive and Negative mirror neurons and decides the final classification.
This architecture has been mathematically proven to solve non-linear problems (like XOR) while avoiding classical complex activation functions, making it perfect for hyper-fast INT8 quantization on microcontrollers.
β‘ Dual-Core Audio Frontend & Optimization
The RP2040 lacks a hardware FPU (Floating-Point Unit), making standard Audio FFT operations extremely slow (taking ~3.8 seconds with soft-float emulation).
To achieve Real-Time Execution (< 1 second latency), we developed a custom C++ Audio Frontend:
- Ultra-Fast Integer DFT: We eliminated software floating-point math inside the innermost Discrete Fourier Transform loops (2.5 million iterations). Instead, we use a custom 64-bit integer (
int64_t) accumulation engine with scaled lookup tables, reducing execution time by 5x! - Dual-Core Processing: The RP2040 features two ARM Cortex-M0+ cores. We divided the 32 audio frames equally:
- Core 0 processes frames 0 to 15.
- Core 1 simultaneously processes frames 16 to 31.
π Performance & Hardware Resources
The system captures 1 second of raw 16-bit PCM audio (16 kHz) and runs the entire pipeline on the Pico.
- Audio Processing (DFT + Mel + Log2): ~411 ms
- Neural Network Inference: ~385 ms
- Total Latency: ~0.84 seconds
- RAM Usage: ~108 KB
- Flash Usage: ~208 KB
- CPU: Raspberry Pi Pico (RP2040) Overclocked to 266 MHz
Because the total execution time (0.84s) is less than the duration of the audio itself (1.0s), SaraNet runs officially in Real-Time, leaving enough CPU headroom to capture the next continuous second of audio without dropping frames!
π― Accuracy
Tested against real-world 16-bit PCM audio samples, SaraNet achieves ~89.9% accuracy. It successfully recognizes command words like "stop", "left", "off", and "marvin", while correctly rejecting Out-Of-Vocabulary (OOV) words (e.g. "learn", "bird", "house") by classifying them as UNKNOWN/NOISE.
π Contents
SaraNet_Pico/- The Arduino IDE sketch containing the Dual-Core C++ code, optimized Neural Net, and Audio Frontend.export_audio_frontend.py- Script used to extract and quantize the PyTorch Audio properties into C++ headers.pico_raw_audio_test.py- USB Serial test script that streams raw.wavfiles from your PC to the Pico to benchmark accuracy and speed.
Developed by Nasko & Sara (July 2026).