Skip to main content
v3.0.0 — Stable Research Release

CricketBrain

Ultra-low-memory neuromorphic signal core for narrow-band, frequency-stable event triage. Hardwired core + optional STDP plasticity. Inspired by 200 million years of cricket evolution. Not a general-purpose AI classifier — targets the earlier layer in the measurement chain, before expensive analysers are dispatched.

0
Neurons
0
Bytes RAM
0
GPU Required
0
Tests Passing

Live Simulation

Watch the 5-neuron Münster circuit process signals in real-time. ON1 fires only when it detects sustained 4500 Hz via delay-line coincidence detection.

Input Silence
AN1 Amp 0.000
ON1 Out 0.000
Spikes 0
Timestep 0
Press Play to start. Use presets or the frequency slider to feed signals into the 5-neuron network. Watch how only 4500 Hz triggers resonance.

Neural Architecture

Five neurons connected by six delay synapses. Inhibitory paths (red) suppress noise, the excitatory path (green) drives the output.

3ms inh 2ms exc 5ms inh 1ms 1ms 1ms Sound Spike AN1 4500 Hz LN2 Inhibitory LN3 Excitatory LN5 Inhibitory ON1 Output

Mathematical Foundation

The hardwired core is built on four equations. Optional STDP plasticity enables online weight adaptation.

Gaussian Tuning

match = e-(Δf / f₀ / w)²

Frequency selectivity. w = 0.1 gives ±10% bandwidth. At 20% deviation, match < 0.02.

Amplitude Update

A(t+1) = min(A + m·0.3, 1.0)

When resonating: amplitude grows proportionally to match strength, capped at 1.0.

Phase Locking

φ(t+1) = φ + (φin - φ)·0.1

Exponential moving average locks the neuron's phase to the input signal.

Coincidence Detection

fire = (A > θ) ∧ (At-τ > θ·0.8)

Output fires only when BOTH current and delayed amplitude exceed threshold. Prevents false positives.

How It Compares

CricketBrain is not a general-purpose AI classifier — it's an ultra-low-memory neuromorphic signal core for narrow-band, frequency-stable event detection. Numbers against classical DSP, TinyML (TensorFlow Lite Micro, Edge Impulse) and full deep learning, all from vendor docs or peer-reviewed papers. Not the same task across rows — read this as an operating-envelope comparison (RAM, power, latency, training-data requirement), not a shared-accuracy comparison.

Property CricketBrain Classical DSP TinyML (TFLite Micro / Edge Impulse) Deep Learning (GPU / Jetson)
RAM~1 KB< 5 KB10–100 KB> 100 MB
Model / flash~20 KB< 10 KB22–500 KB10 MB – 100 GB
Latency0.175 µs/step1–10 ms54–225 ms1–3000 ms
Active power~15 mW (STM32F0)~50 mW (M4)50–100 mW (M4F/M7)5–200 W
Average power @ 1 Hz decisions< 1 µW compute~500 µW5–30 mW~500 mW – 200 W
Training dataZeroZero100–10 000 clips10 000 h – millions of samples
Runs on $2 STM32F0YesYesTightNo
Runs on < 1 mW solar buoyYesYesNoNo
Complex spectrogram / multi-class (> 10)NoNoYesYes
Deterministic / explainableYesYesPartialNo
Sourcesthis repoDSP textbookEdge Impulse docs · TFLite MicroHannun 2019 · Hakim 2023

Per-domain breakdowns: cardiac · bearings · marine · grid.

Version History

v0.1.0

Morse Code Recognition

Initial implementation. 5-neuron canonical circuit based on the Münster model.

  • 5-neuron circuit (AN1, LN2, LN3, LN5, ON1)
  • Basic Morse code encoding/decoding
  • Criterion benchmarks (0.175 µs/step)
  • 0 false positives during silence
v0.2.0

Multi-Frequency Tokens

Multi-frequency token vocabulary and parallel resonator banks.

  • 27-token alphabet (A-Z + space)
  • Resonator bank: one 5-neuron circuit per token
  • Live demo with encode-brain-decode roundtrip
  • Frequency discrimination example
v0.3.0

Sequence Prediction

Temporal pattern matching with confidence scoring and privacy mode.

  • N-gram pattern matching engine
  • Confidence: C = SNR/(1+SNR) · (1 - jitter/tolerance)
  • Privacy mode for HIPAA/GDPR compliance
  • Dual licensing (MIT OR Apache-2.0)
v3.0.0

Stable Research Release

Full workspace with cross-platform bindings, STDP plasticity, and research-grade benchmarks.

  • C/FFI, Python (PyO3), WASM bindings
  • STDP + homeostatic plasticity
  • no_std core with #![deny(unsafe_code)]
  • License: AGPL-3.0 + Commercial

Use Cases

Research prototypes built on CricketBrain. Each case includes benchmarks, source code, honest limitations and a validation-status badge. UC01 ships AAMI EC57:2012 inter-patient evaluation on the full MIT-BIH DS2 split (v0.6, 22 patients) with clinician rhythm-annotation ground truth: 78.4 % pooled accuracy, on par with a hand-coded band-gate rule. Other UCs remain synthetic-only.

v0.6 · clinician GT

Rate-Based Cardiac Rhythm Triage

Beat-rate regime flags only (bradycardic / normal / tachycardic / irregular). Triage, not diagnosis — not a substitute for clinical ECG.

  • 78.4 % accuracy on MIT-BIH AAMI DS2 with clinician rhythm-annotation ground truth (22 patients)
  • Irregular recall 0.78 (was 0.19 in v0.5 — 4× lift from a normalised RR-range rule)
  • On par with hand-coded band-gate rule (78.7 %); same circuit reused across UC02/03/04
  • ~0.13 µs/step, 928 bytes RAM, zero training, 48 tests
View Demo →
Synthetic Demo

Bearing Fault-Frequency Triage

4-channel ResonatorBank flags which BPFO / BPFI / BSF defect frequency is dominant. Triage, not metrology — not a substitute for SKF IMx. Real CWRU validation pending.

  • 93.0% synthetic accuracy, d' = 6.18 (SDT, log-linear)
  • 3,712 bytes RAM, 20 neurons
  • 100% on synthetic random-spike noise up to 50%, RPM compensation
  • Predictive-maintenance segment (~$15B, MarketsandMarkets 2024)
View Demo →
Synthetic Demo

Marine Acoustic Event Triage

Flags frequency-stable events — fin-whale pulses, blue-whale A-calls, ship cavitation, humpback tonals. Triage, not species ID — not a substitute for PAMGuard. Real MARS validation pending.

  • 90.0% synthetic accuracy, d' = 6.18 (SDT, log-linear)
  • 3,712 bytes RAM, 20 neurons
  • v0.2: multi-label (100% on whale+ship overlap) & boundary recovery
  • 25 tests, ship-transit & sea-state compensation
  • Marine PAM segment (~$4B, industry estimate)
View Demo →
Synthetic Demo

Power-Grid Harmonic-Pattern Triage

Flags which harmonic-frequency band is dominant on PMU streams (50 / 100 / 150 / 200 Hz + Outage). Triage, not metrology — not a substitute for Class-A PQ analysers or PMUs. Real EPFL validation pending.

  • 90.0% synthetic accuracy, d' = 6.18 (SDT, log-linear)
  • 3,712 bytes RAM, 20 neurons
  • 18 tests, factory-startup & brownout demos
  • Smart-grid segment (~$100B, BloombergNEF 2024)
View Demo →
Planned

Network Intrusion

DDoS and C2 beaconing detection at line rate.

  • 93 ns/packet, FPGA-deployable
  • Temporal pattern detection
  • $25B network security market
Planned

Precision Agriculture

Pest detection via acoustic monitoring on coin-cell sensors.

  • BioAcoustica Dataset (CC BY 4.0)
  • < 1 µW inference, years on battery
  • $8B precision ag market

View all 10 use cases →

Scientific Benchmarks

All results measured in real-time on this codebase using internationally recognised methodologies. Fully reproducible with deterministic seeding.

Classical Detector Comparison — SNR sweep, 120 trials/class, seed=1337

CricketBrain vs Matched Filter, Goertzel (FFT), and IIR Bandpass under identical noise conditions. Source: examples/baselines.rs

SNR (dB) CricketBrain TPR CricketBrain FPR Matched Filter TPR Goertzel TPR IIR Bandpass FPR
−101.0000.0000.0000.0000.992
−51.0000.0000.0000.0000.867
01.0000.0000.0000.0170.558
+51.0000.0000.0080.0250.325
+101.0000.0000.9920.9420.150
+201.0000.0001.0001.0000.125
+301.0000.0001.0001.0000.108

CricketBrain achieves TPR=1.0 / FPR=0.0 across all SNR levels. Matched Filter and Goertzel fail below +10 dB. IIR Bandpass has persistent false positives (FPR up to 99%).

Signal Detection Theory

d' = 7.44

Sensitivity index (Green & Swets, 1966). Target vs Silence: AUC = 1.000. Rating: EXCELLENT (near ceiling). 500+500 trials at 100 ms.

Gap Detection

MDG = 1 ms

Minimum detectable gap (Plomp, 1964; Fitzgibbons & Wightman, 1982). Human MDG at 4 kHz: 2–3 ms. Cricket biology: ~5 ms.

Temporal Precision

CV = 0.000

Coefficient of variation over 1000 trials (Gerstner & Kistler, 2002). Deterministic: zero jitter. With noise (0.02): CV = 0.097, matching biological range.

Frequency Discrimination

JND = 88 Hz

Just Noticeable Difference (Levitt, 1971 staircase). Weber fraction: 1.96% (narrow-band). Human at 4 kHz: ~9 Hz (0.2%). Bandwidth-tunable.

SynOPS Efficiency — Merolla (2014), Davies (2018)

Standard neuromorphic computing metric. CricketBrain runs on a general-purpose CPU — dedicated silicon (ASIC/FPGA) would yield dramatically higher SynOPS/W.

System SynOPS Power SynOPS/W Bytes/Neuron
CricketBrain (5N)6.43e7~15 W4.29e6186
CricketBrain (40kN)2.99e8~15 W1.99e7364
TrueNorth (IBM)4.60e100.07 W6.58e11~256
Loihi (Intel)3.00e100.10 W3.00e11~140
SpiNNaker6.00e91.0 W6.00e9~800
GPU A1003.12e14400 W7.80e11~4

First-Spike Latency

9 ms

Timesteps from signal onset to first ON1 spike at 4500 Hz. Wall-clock: 3.1 µs. Real-time factor: 2897x faster than real-time.

Throughput

10.7M

Steps per second (5-neuron canonical circuit). 0.175 µs per step on a single CPU thread. No GPU, no SIMD required.

Memory

928 B

Total RAM for 5-neuron circuit (186 bytes/neuron). Fits in L1 cache. 40k-neuron scale: 14.2 MB (364 bytes/neuron).

ISI Regularity

CLOCK

Inter-spike interval pattern on sustained 4500 Hz: ISI = 1.00 ms, CV = 0.000. Classification: CLOCK-LIKE (CV < 0.01).

Ablation Study — 200 trials/class, 7 SNR levels

Systematically disabling circuit components to measure individual contributions. Source: examples/ablation_study.rs

Configuration SNR 0 dB TPR SNR 0 dB FPR SNR +10 dB TPR SNR +20 dB TPR
Full circuit (baseline)1.0000.0001.0001.000
Without LN2 (inh, 3 ms)1.0000.0001.0001.000
Without LN3 (exc, 2 ms)0.4400.0000.0100.005
Without LN5 (inh, 5 ms)1.0000.0001.0001.000
Without coincidence gate1.0000.0001.0001.000
Without delay lines (d=1)1.0000.0001.0001.000

LN3 (excitatory path) is critical — removing it drops TPR to 44% at SNR 0 dB and near-zero at higher SNR. All other components show redundancy at these SNR levels but contribute at extreme conditions.

Reproduce All Benchmarks
cargo run --release --example bench_sdt        # Signal Detection Theory
cargo run --release --example bench_synops     # SynOPS Efficiency
cargo run --release --example bench_jnd        # Just Noticeable Difference
cargo run --release --example bench_gap        # Gap Detection
cargo run --release --example bench_latency    # Spike Latency & Precision
cargo run --release --example bench_patterns   # Pattern Separation
cargo run --release --example baselines        # vs Classical Detectors
cargo run --release --example ablation_study   # Component Analysis
cargo run --release --example bench_stress     # Adversarial Stress Test

Adversarial Stress Test — honest limits

Independent seeds, colored noise, in-band interferers, extended silence, and a simple-threshold baseline. Where does CricketBrain actually break? Source: benchmarks/stress_test_benchmark.rs

Test Conditions TPR FPR Verdict
10 independent RNG seeds5000+5000 trials, SNR 0 dB1.0000.000Confirmed
AWGN (Gaussian jitter)500 trials, SNR −10 to +20 dB1.0000.000Confirmed
Pink noise (1/f)500 trials, SNR 0 dB1.0000.0021 false positive
Extended silence (1000 steps)2000 trials0.000Zero false alarms
In-band 4400 Hz (−2.2%)500 noise-only trials0.790FAILS — 79% FPR
In-band 4300 Hz (−4.4%)500 noise-only trials0.586FAILS — 59% FPR
In-band 4050 Hz (−10%)500 noise-only trials0.0444.4% FPR (boundary)
Simple threshold detectorSNR −10 dB1.0001.000Trivially useless

Honest disclosure: CricketBrain's Gaussian tuning (w=0.1, ±10% bandwidth) makes it excellent at rejecting off-frequency noise but vulnerable to sustained in-band interferers within ±5% of the eigenfrequency. This is consistent with biological cricket hearing — the circuit is tuned for a specific calling song, not general-purpose signal classification. The simple threshold detector proves the problem is NOT trivial — frequency selectivity is genuine and necessary.

All benchmarks are deterministic (seeded RNG), fully reproducible, and generate identical results across Linux, macOS, and Windows. References: Green & Swets (1966), Levitt (1971), Plomp (1964), Merolla (2014), Davies (2018), Gerstner & Kistler (2002), Yassa & Stark (2011).

Quick Start

Terminal
# Clone and run
git clone https://github.com/BEKO2210/cricket-brain.git
cd cricket-brain
cargo run

# Full roundtrip demo
cargo run --example live_demo -- "HELLO WORLD"

# Sequence prediction
cargo run --example sequence_predict

# 40k neuron benchmark
cargo run --release --example scale_test

# Run all 122 tests
cargo test --workspace