Scikit-learn Digits

Two spiking digit classifiers, with and without inhibitory feedback.

Abstract

We compare two spiking networks on small handwritten digits. Both use conductance-based leaky integrate-and-fire neurons and choose a digit by counting spikes from ten output neurons. The PING model adds a fixed inhibitory feedback loop to the feed-forward COBA model. Both use the same training, validation and test partitions, one random seed and classification loss without spike penalties. With 200 ms presentations and 30 epochs, validation-selected COBA and PING checkpoints reached 80.6% and 71.7% held-out test accuracy, respectively. Adding feedback did not improve classification in this run; variation across training seeds was not tested.

Results

Recipe v9 ran locally on CPU with SNNLab 0.23.0 and autocast disabled. The dataset contained 1437 training, 180 validation and 180 held-out test images. Each model trained for 30 epochs; minimum validation cross-entropy selected one checkpoint for a single held-out test evaluation. The rasters replay one training image through those selected checkpoints.

COBA training curves

After 30 epochs, online training accuracy was 84.8% and validation accuracy was 87.2%. Best validation accuracy was 88.3%. Validation cross-entropy changed from 2.312 to 0.426. The checkpoint selected by minimum validation loss was epoch 15; its held-out test accuracy was 80.6% on 180 images. The black curve shows online pre-update minibatch metrics; the red curve uses fixed epoch-end weights. Epoch zero shows untrained validation only. Crosses mark the selected-checkpoint test measurements.

COBA cross-entropy and accuracy over training epochs, with training in black and validation in red.
Figure 1.

COBA classification loss (left) and accuracy (right). Black denotes training; red denotes validation. Crosses show the held-out test at the selected epoch. Accuracy is shown as a fraction.

PING training curves

After 30 epochs, online training accuracy was 75.5% and validation accuracy was 77.8%. Best validation accuracy was 82.2%. Validation cross-entropy changed from 2.309 to 0.679. The checkpoint selected by minimum validation loss was epoch 13; its held-out test accuracy was 71.7% on 180 images. The black curve shows online pre-update minibatch metrics; the red curve uses fixed epoch-end weights. Epoch zero shows untrained validation only. Crosses mark the selected-checkpoint test measurements.

PING cross-entropy and accuracy over training epochs, with training in black and validation in red.
Figure 2.

The same measurements for PING, with a fixed excitatory–inhibitory feedback loop. Crosses mark the held-out test measurements at the selected epoch.

COBA raster

Original sample 0 is digit 0; the validation-selected model (epoch 15) predicted 0. This image belongs to the train partition. It is a single-example diagnostic, not an independent test result.

Original digit image, shared Poisson input, COBA hidden-neuron raster and ten-neuron readout raster after training.
Figure 3.

From left: the original 8 × 8 image, its Poisson input spikes, all hidden excitatory spikes, and readout spikes indexed by digit. Each tick is one spike; time is in milliseconds. The output neuron with the largest count selects the digit; ties select the lowest digit index.

PING raster

Original sample 0 is digit 0; the validation-selected model (epoch 13) predicted 0. This image belongs to the train partition. It is a single-example diagnostic, not an independent test result.

The same digit image and input spikes, PING excitatory and inhibitory hidden-neuron rasters, and the spiking digit readout after training.
Figure 4.

The same image and exact input spikes as Figure 3, replayed through PING’s validation-selected weights from fresh membrane state. Hidden excitatory neurons are black; inhibitory neurons are red and placed above them. The readout uses black ticks.

Network diagrams

In both diagrams, XX denotes pixel input, E/IE/I the hidden populations and RR the spiking readout. Every projection is labelled WXYW_{XY}, with target XX first and source YY second. Arrowheads show excitation; bars show inhibition. Layouts come from the saved bundles; recording aliases and spike-count reductions are omitted.

Executed COBA circuit: pixel input to excitatory hidden population to spiking digit readout.
Figure 5.

COBA circuit generated from the executed SNNLab bundle. The input and readout projections are learned; all neurons are conductance-based leaky integrate-and-fire.

Executed PING circuit with an additional fixed excitatory–inhibitory feedback loop.
Figure 6.

PING adds excitatory input to inhibitory neurons and inhibitory feedback to the hidden excitatory population. Both feedback matrices remain fixed.

Parameters

ParameterCOBAPING
Network
Population size, E / I128 / —128 / 32
Membrane model, E / Icoba_lif / —coba_lif / coba_lif
Input channels6464
Neurons
Membrane capacitance, E / I1 / — nF1 / 0.5 nF
Leak conductance, E / I0.05 / — µS0.05 / 0.1 µS
Passive time constant (derived), E / I20 / — ms20 / 5 ms
Resting potential, E / I-65 / — mV-65 / -65 mV
Reset potential, E / I-65 / — mV-65 / -65 mV
Spike threshold, E / I-50 / — mV-50 / -50 mV
Refractory period, E / I1.2 / — ms1.2 / 0.6 ms
Synapses and weights
Input→E synapse / decay (ms)ampa / 2ampa / 2
Input→E delay (ms)0.00.0
Input→E matrix shape64 × 12864 × 128
Input→E initial per-connection mean / SD (µS)0.0140625 / 0.00140625; clamped nonnegative0.0140625 / 0.00140625; clamped nonnegative
Input→E weightslearnedlearned
E→Output synapse / decay (ms)ampa / 2ampa / 2
E→Output delay (ms)0.00.0
E→Output matrix shape128 × 10128 × 10
E→Output initial per-connection mean / SD (µS)0.0078125 / 0.00078125; clamped nonnegative0.0078125 / 0.00078125; clamped nonnegative
E→Output weightslearnedlearned
E→I synapse / decay (ms)Not applicableampa / 2
E→I delay (ms)Not applicable0.20
E→I matrix shapeNot applicable128 × 32
E→I initial per-connection mean / SD (µS)Not applicable0.0078125 / 0.00078125; clamped nonnegative
E→I weightsNot applicablefixed
I→E synapse / decay (ms)Not applicablegaba / 6
I→E delay (ms)Not applicable0.20
I→E matrix shapeNot applicable32 × 128
I→E initial per-connection mean / SD (µS)Not applicable0.0625 / 0.00625; clamped nonnegative
I→E weightsNot applicablefixed
Input and simulation
Network / training seed4242
Timestep (ms)0.200.20
Presentation (ms)200200
Input encodingPixel-scaled Poisson spikes, discretized as Bernoulli eventsPixel-scaled Poisson spikes, discretized as Bernoulli events
Pixel normalizationIntensity divided by 16Intensity divided by 16
Maximum pixel rate (Hz)2525
Diagnostic encoding seed0.00.0
Readout
Output neurons1010
Output membrane modelcoba_lifcoba_lif
Output capacitance (nF)1.01.0
Output leak (µS)0.0500.050
Output passive time constant (ms; derived)2020
Output rest / reset / threshold (mV)-65 / -65 / -50-65 / -65 / -50
Output refractory period (ms)1.21.2
Class scoreOutput spike count over the full presentationOutput spike count over the full presentation
Decision / tiesLargest spike count / lowest digit indexLargest spike count / lowest digit index
Training
Epochs3030
Batch size3232
Optimizeradamwadamw
Learning rate0.000400.00040
Weight decay0.00.0
Gradient clipping1.01.0
Surrogatefast_sigmoid; slope 1fast_sigmoid; slope 1
RegularizersNoneNone
Voltage-gradient damping, E / I1000 / —1000 / 1000
Output voltage gradient dampening1,0001,000
Analysis
Datasetsklearn.datasets.load_digitssklearn.datasets.load_digits
Training / validation / test examples1437 / 180 / 1801437 / 180 / 180
Loss / accuracyCross-entropy / fraction correctCross-entropy / fraction correct
Training curve measurementOnline pre-update minibatch metricsOnline pre-update minibatch metrics
Validation measurementFixed epoch-end weightsFixed epoch-end weights
Test / raster checkpointMinimum validation cross-entropyMinimum validation cross-entropy
Selected epoch1513
Test measurementOne fixed-weight evaluation on the held-out test partitionOne fixed-weight evaluation on the held-out test partition
Raster counting window (ms)0–2000–200
Diagnostic sampleOriginal index 0; digit 0; train partitionOriginal index 0; digit 0; train partition
Training seeds reported1.01.0
Table A1.

Model, training and analysis settings. Neural and training parameters come from native best-validation start snapshots and final-training end snapshots reached through the selected presentation; input and analysis settings describe that same run. E and I denote excitatory and inhibitory hidden neurons. Paired values follow E / I order; an em dash marks an absent population. The output has one neuron per digit. Initial weight means and standard deviations (SD) are per-connection parent-distribution values after fan-in scaling, with negative draws clamped to zero. Initializer statistics describe initial draws, not the final learned distribution. Passive time constants are derived as capacitance divided by leak conductance. Matrix shapes list source × target units. Test scores and diagnostic rasters use the validation-selected weights; model settings and matrix shapes above use those same selected-weight snapshots. Optimizer and training settings use the final-training snapshots.

Dataset

Upstream: —

Downstream: —

Current runset

RunDateDurationSizeEvidenceStorageRan onVerification
exp141-r014-present1s945.3 KBCurrentBothLocalLocal: byte-verified; R2: catalog-verified
exp141-r013-analyse<1s582.1 KBCurrentBothLocalLocal: byte-verified; R2: catalog-verified
exp141-r012-compute21m 9s907.4 KBCurrentBothLocalLocal: byte-verified; R2: catalog-verified