Spike-Count Classification in a Continuous Stream

Abstract

Input calibration in exp080Decoder Accuracy Improves with Input Rate motivated the rate range used to train a variable rate PING classifier in exp022Training Runs. We tested whether these networks could classify continuous digit streams while retaining hidden state. Longer, stronger inputs improved accuracy, and one network classified five successive digits correctly despite changing durations and rates. Weak inputs exposed silent and incorrect responses. Decisions required supplied digit boundaries.

Results

Continuous classification and accuracy

One frozen PING network correctly classified five successive digits with varying presentation durations and input rates (Fig. 1A–D). Hidden neuronal state continued between digits, while output state and counts reset at supplied boundaries. This example demonstrates capability, not reliability across arbitrary streams. We selected the first stream with five correct decisions from a predefined candidate sequence; the first candidate qualified.

At 25 Hz, increasing presentation duration from 25 to 200 ms raised mean accuracy from 72.3% to 88.5% (Fig. 1E–F). At 200 ms, increasing input rate from 0.5 to 25 Hz raised accuracy from 26% to 88.5%.

Five correctly classified digits with varying durations and input rates, alongside mean accuracy across presentation duration and input rate and the 200-ms rate–accuracy curve.
Figure 1: Seed-42 network presented with digits 1, 7, 9, 5 and 2. Each segment is labelled with its duration and maximum-pixel input rate. (A) Input thumbnails with true→predicted labels. (B) Spikes from the first 200 excitatory neurons; (C) spikes from the first 64 inhibitory neurons; (D) softmax-normalized output-count shares. Red traces identify the true classes. (E) Accuracy across presentation duration and maximum-pixel input rate; (F) the 200-ms rate–accuracy curve. Values are means across three independently trained networks, each evaluated on 200 digit presentations per condition. Error bars show SEM across networks.

Spike counts identify the digit

By the presentation’s end, the true class, digit 4, had accumulated the largest output-spike count (Fig. 2). Intermediate leaders did not determine the decision.

A correctly classified digit with excitatory and inhibitory rasters and ten softmax count-share trajectories.
Figure 2: First correct digit in the seed-42 network’s matched 200-ms, 5-Hz stream. (A) Spikes from the first 200 excitatory neurons; (B) spikes from the first 64 inhibitory neurons; (C) softmax-normalized output-count shares. Red identifies the true class. These shares are not calibrated probabilities. The predicted digit is the class with the largest share at the presentation’s end.

Spikes change the displayed shares

Output counts stepped upward at spikes and remained constant between them (Fig. 3). Softmax normalization changed the displayed class shares at these increments; abrupt share changes need not reflect abrupt changes in the underlying network state.

Output spikes, cumulative class counts and softmax count shares from 91.5 to 94.5 ms in the same digit presentation.
Figure 3: Post-hoc enlargement of 91.5–94.5 ms from the digit-4 presentation. (A) Output spikes; (B) cumulative class counts; (C) softmax-normalized count shares. Red identifies the true class.

Weak inputs expose failure modes

A stream with varying durations and input rates produced 3 correct decisions (Fig. 4). The 200-ms, 0.5-Hz presentation produced no output spikes, whereas the 100-ms, 2-Hz presentation was misclassified despite output activity.

Five digits with changing rates and durations: three correct predictions, a silent 0.5 Hz failure and a non-silent 2 Hz failure.
Figure 4: Seed-42 network under the duration–rate conditions labelled above each segment. (A) Input thumbnails; (B) excitatory spikes; (C) inhibitory spikes; (D) softmax-normalized output-count shares. Badges show true→predicted labels. Thumbnail opacity indicates relative input rate; population sampling matches Figure 1.

Methods

  1. Input range and classifiers. The filtered-input calibration in exp080Decoder Accuracy Improves with Input Rate motivated the input-rate range. We reused three frozen networks, trained with seeds 42–44, from exp022Training Runs. Each contained 1,024 excitatory neurons, 256 inhibitory neurons and ten output leaky integrate-and-fire neurons, with learned input-to-excitatory and excitatory-to-output projections.
  1. Training and checkpoint selection. Training used 6,300 optimization images and 700 validation images for 50 epochs. Maximum-pixel input rates were sampled from 0.5, 0.75, 1, 1.5, 2, 3, 5, 7.5, 10, 15 and 25 Hz. After each epoch, we evaluated the network on three independently spike-encoded versions of the validation images. Mean validation cross-entropy was

    𝐿CE=1𝐷𝑁𝑑=1𝐷𝑖=1𝑁log𝑝𝑖,𝑦𝑖(𝑑).
    (1)
    Here 𝑁=700 is the number of validation images, 𝐷=3 is the number of encoding draws, 𝑦𝑖 is the true class of image 𝑖, and 𝑝𝑖,𝑦𝑖(𝑑) is its true-class softmax share for draw 𝑑, defined in step 6. We selected the epoch with the lowest 𝐿CE. If epochs tied, we chose the one with higher validation accuracy.
  1. Evaluation streams. We sampled images from the official 10,000-image MNIST test partition. We tested all eleven training rates at 25, 50, 100 and 200 ms (Fig. 1E–F). Each duration–rate–network condition contained 40 five-digit streams, giving 200 decisions. Batches contained five streams with separate neuronal states.
  1. Input encoding. Pixels generated independent Bernoulli spikes at 0.1-ms resolution. Spike probability was proportional to pixel intensity and the condition’s maximum-pixel input rate. Digits followed without gaps; segment labels give their durations and input rates (Fig. 1A and Fig. 4A).
  1. State and decision boundaries. Hidden neuronal state persisted between digits within each stream. Output-neuron state and spike counts reset at every supplied digit boundary. The readout accumulated evidence over the full presentation (Fig. 1B–D and Fig. 4B–D).
  1. Spike-count classification. The cumulative score for class 𝑐 at timestep 𝑘 was

    𝑧𝑐[𝑘]=𝑗=𝑘0𝑘𝑠𝑐[𝑗],
    (2)

    where 𝑘0 is the first timestep of the presentation and 𝑠𝑐[𝑗] equals 1 when output neuron 𝑐 spikes at timestep 𝑗, and 0 otherwise. The displayed class share was

    𝑝𝑐[𝑘]=exp(𝑧𝑐[𝑘])𝑎=09exp(𝑧𝑎[𝑘]),
    (3)

    where 𝑎 indexes the ten digit classes. These softmax shares are not calibrated probabilities.

    At the final timestep 𝑘end, we predicted

    𝑦̂=argmax𝑐{0,,9}𝑧𝑐[𝑘end]=argmax𝑐{0,,9}𝑝𝑐[𝑘end],
    (4)

    where 𝑦̂ is the predicted digit: the class with the greatest final cumulative count, equivalently the largest final displayed share (Fig. 2C). Ties selected the lowest class index, including class 0 when all outputs were silent.

  1. Performance summaries. We calculated accuracy for each duration–rate–network condition and summarized retained measurements as means and SEM across three training replicates (Fig. 1E–F). Error bars describe variation across networks, not individual digit decisions.
  1. Capability example. We simulated seed-42 candidates with the predefined sequence of duration–rate pairs: (100 ms, 5 Hz), (200 ms, 7.5 Hz), (50 ms, 25 Hz), (100 ms, 15 Hz) and (200 ms, 10 Hz). We fixed candidate order and digit-sampling and encoding seeds before inference. Fig. 1 uses the first candidate achieving five correct decisions.
  1. Failure example. We reused a separately specified seed-42 stream with pairs (200 ms, 0.5 Hz), (50 ms, 25 Hz), (100 ms, 2 Hz), (25 ms, 10 Hz) and (200 ms, 5 Hz). This example was not selected through the capability search (Fig. 4).
  1. Readout close-up. We selected the first correct digit from a separate 200-ms, 5-Hz stream (Fig. 2) and enlarged its 91.5–94.5-ms interval post hoc (Fig. 3). Equations Equation 2 and Equation 3 define the displayed counts and shares.
  1. Scope of inference. We evaluated classification with known boundaries and continuing hidden state, without testing autonomous segmentation, a hidden-state-reset control, or gamma activity’s causal contribution to recognition.

Dataset