Voting on the Sphere: Window Aggregation for Long Biosignals

Many clinical and audio classifiers never look at a whole recording at once. They cut a long gait trace, EEG session or song into short windows, classify each window separately, and let the windows vote on the final label. This "temporal majority voting" is popular because a few corrupted windows (a sensor glitch, a moment of silence) get outvoted. Its weak point is the voting rule itself. A hard vote throws away how confident each window was. Averaging probabilities keeps that information, but it lets a saturated, overconfident artifact window count as a full vote for whatever class it lands on.

This note proposes moving the vote into the geometry of the network. If the window classifier is trained with its weights projected onto a hypersphere (rescaled to fixed length after every update), then each window can be summarized as a unit vector whose direction alone carries the evidence. The subject-level decision becomes the average direction of those vectors. The length of that average, which shrinks when windows disagree, becomes a built-in measure of how much the recording agrees with itself. The question is whether training on the sphere produces window embeddings that can be aggregated directly in this way. If so, the result would be better abstention ("I'm not sure about this patient") and robustness to artifacts at no extra cost, while matching the accuracy of the best existing voting rules.

Core Claim

Window embeddings from a network trained with spherical weight projection can be pooled as a spherical mean. The resulting subject-level score should match hard and soft voting in accuracy and beat both at selective prediction, meaning deciding when to defer to a clinician. For a recording split into $M$ windows with unit-norm embeddings $z_1,\dots,z_M$, we compute

$$\bar z = \frac{1}{M}\sum_{m=1}^{M} z_m, \qquad \hat Y = \arg\max_c \; \mu_c^\top \frac{\bar z}{\|\bar z\|}, \qquad R = \|\bar z\| \in [0,1],$$

where $\mu_c$ is the unit-norm weight vector of class $c$ in a cosine classifier and $R$ is the resultant length. $R$ comes from directional statistics: it is the usual estimator of how concentrated a von Mises–Fisher distribution is, the sphere's analogue of a Gaussian. $R$ is near 1 when windows point the same way and near 0 when they scatter. Artifact windows that point in unrelated directions partly cancel instead of each adding a full vote.

The whole-network weight projection is part of the claim, not decoration. In an ordinary Euclidean network, the length of a feature vector carries information, often signal energy, which is exactly what motion artifacts inflate. Normalizing features after the fact therefore discards information. Training on the sphere is meant to push all class evidence into direction, so that normalizing costs nothing. A specific ablation tests this, and it could fail.

Prior Work and Positioning

Three papers supply the optimization method. Training Scale-Invariant Neural Networks on the Sphere Can Happen in Three Regimes studies projected SGD with weights renormalized after each step. It shows that a fixed effective learning rate produces convergent, chaotic or divergent phases, but only on static CIFAR images. Constrained Weight Optimization for Learning without Activation Normalization adds a fixed-norm constraint ($\|w\|^2=2$), zero-mean weights and noise injection. It replaces batch normalization and reports 15.12% CIFAR-100 error at batch size 4, where batch normalization degrades to roughly 18%. That matters here because clinical cohorts force small batches. nGPT normalizes every vector in a Transformer, including hidden states, and reports large convergence speedups for language modeling at a 60–80% per-step cost. We reuse the Ikami-style projection as the training core. We borrow nGPT's normalized hidden states only as an optional variant, because of its overhead.

Two papers motivate the problem without solving it. Weight Normalization decouples length from direction by reparameterizing the weights; Ikami et al. note this can explode gradients when weight variance is small. On the distance between two neural networks and the stability of learning explains why weight norms grow unchecked in rescaling-invariant layers. Decoupled Networks separates angular from norm components of features. It is the closest precedent for saying that direction carries class identity, but it does not aggregate across time.

On the voting side, Transformers for 1D Signals in Parkinson's Disease Detection from Gait votes over 100-step gait windows with 50% overlap. Music Artist Classification with Convolutional Recurrent Neural Networks votes over 3-second clips. Deep Neural Network Based Respiratory Pathology Classification Using Cough Sounds votes over coughs per child. All three use unconstrained Euclidean networks with a fixed, label-level voting rule, and none produces an agreement score.

The research file found no paper combining spherical weight training with temporal aggregation. The nearest "majority vote" papers sit in different settings: Sparse-SignSGD with Majority Vote has workers vote on gradient signs, and Majority Vote Compressed Sensing concerns signal recovery. The cough paper's drop to 60% accuracy in the four-class setting tempers expectations. Spherical geometry does not create separability that the features lack, so we do not claim it fixes Asthma-versus-LRTI confusion. That case is treated as a stress test.

Research Program

We build window classifiers in two architecture families: the decoupled 1D Transformer of Nguyen et al. for gait, and a CRNN in the style of Nasrullah et al. for audio. Each is trained three ways. The first is the standard Euclidean recipe with AdamW. The second is Ikami-style projected gradient descent on every linear and convolutional weight, with a cosine classifier head. The third is a head-only variant, where only the final features and class weights are normalized.

From each trained network we take unit-norm penultimate embeddings. For Euclidean networks these are normalized after training. We then compare aggregation rules on identical window predictions: hard vote, probability averaging, log-probability averaging, a trimmed mean of logits, and the spherical mean with $R$. Because all rules see the same windows, differences in accuracy isolate the aggregation step. Differences across training recipes isolate the geometry.

We also run a short analysis on how embedding norm in Euclidean networks correlates with window signal energy and with artifact presence. This is the mechanism the whole-network projection is supposed to remove.

Baselines

The naive reference point is the published pipeline unchanged: a Euclidean network with hard majority voting. On Physionet Gait in Parkinson's Disease this is the decoupled Transformer of Nguyen et al.. It reports 95.2% subject-level accuracy, 98.1% sensitivity and 86.8% specificity, against a 94.5% earlier 1D-CNN. On artist20 it is the CRNN of Nasrullah et al., with an average F1 of 0.937 under song splits and 0.674 under album splits. We re-run both in our own code with the same folds and report our reproduced numbers next to the published ones, so that any gain is measured against our reproduction and not against an older pipeline.

The strongest competitor is a well-tuned Euclidean network with LayerNorm (batch-independent, so it removes the small-batch argument for projection) and AdamW. Its windows are aggregated by whichever of hard vote, probability averaging or log-probability averaging does best on validation folds. Taking the best of these per dataset gives the competitor every advantage. Its natural abstention score is the vote fraction or the mean maximum probability. All methods receive the same hyperparameter search budget (equal trials over learning rate, effective learning rate or weight decay, and window length), the same epochs, and the same hardware.

Beating it means two things. First, the spherical model matches its subject-level accuracy within fold-to-fold noise. Second, it gives a strictly better risk–coverage curve, meaning a lower error rate among the patients it chooses to classify at each fraction kept. The second condition is the decisive one.

Two ablations isolate the ingredients. The first applies the spherical mean to normalized embeddings from the Euclidean and head-only networks; it tests whether training on the sphere matters or whether only the aggregation does. The second applies conventional voting to the spherical network; it tests whether only the training does.

Why not just…?

Why not just average probabilities and use the mean maximum probability as confidence? This is the most natural rival, and the experiments include it directly. Its known weakness is that softmax saturates, so artifact windows contribute full-strength votes and confidence is overstated. Spherical averaging lets windows that disagree cancel in embedding space before any class decision. Whether that helps is empirical. If probability averaging matches the spherical mean on risk–coverage across both datasets and under artifact injection, the proposal's central claim fails and we will report it that way.

Why not just use a cosine classifier head and skip whole-network projection? This is a real threat. Normalized heads are cheap and standard. The head-only arm exists for this reason. Our prediction is that head-only normalization still leaves an encoder whose feature norms track signal energy, so normalizing discards evidence and $R$ is less reliable. If head-only matches full projection, the honest conclusion is that the aggregation geometry, not the training constraint, carries the result. The recommendation would then simplify accordingly.

Why not just use LayerNorm or GroupNorm, which already avoid small-batch problems? These remove the batch-size motivation that Ikami et al. emphasize, which is why the strongest baseline uses LayerNorm. Our argument for projection is not batch statistics. It is that a fixed effective learning rate, as in Kodryan et al., and direction-only representations make embeddings aggregable. If LayerNorm networks with post-hoc normalized embeddings do as well, that is exactly what the first ablation will show.

Why not just learn attention pooling over the whole recording? Nguyen et al. report that their windowed Transformer already costs about four times a standard network's training time. Nasrullah et al. found shorter clips with voting outperformed longer context because of limited data. With 166 gait subjects, a learned pooling layer adds parameters fitted on very few subject-level labels. We include attention pooling over frozen window embeddings as a secondary baseline. Our expectation is that it matches accuracy but overfits its confidence.

Proposed Experiments

The primary benchmarks are Physionet Gait in Parkinson's Disease (306 walks, 166 subjects) and artist20 under both song and album splits. Both are public and both have published voting baselines cited above. The pediatric cough cohort, with 91.2% binary and 60% four-class voting accuracy reported, and the 19-subject aMCI EEG set from GF-DANN are hospital collections. We will use them only if access is granted. For the depression audio cohort there is no reported result found on Lacuna.

Metrics are subject- or song-level accuracy, sensitivity, specificity and macro-F1, computed by subject-disjoint cross-validation with per-fold variance. Selective prediction is measured as the area under the risk–coverage curve and as error at 80% coverage. Calibration is measured by expected calibration error after fitting a single temperature on validation folds.

The decisive check is controlled artifact injection. We corrupt a fraction $k/M$ of windows in each test recording with realistic artifacts: dropout to zero, large-amplitude spikes for gait, and silence or background noise for audio. We then plot decision flip rate and $R$ against $k/M$. The prediction is that spherical aggregation flips no more often than hard voting, that $R$ falls steadily as corruption rises, and that probability-based confidence stays high while accuracy drops. A second check tests the mechanism. We measure whether Euclidean embedding norms correlate with injected artifact energy, and whether that correlation disappears under whole-network projection.

If accuracy parity holds and the risk–coverage advantage appears only for the fully projected networks, the claim stands as stated. If the advantage appears equally for head-only or LayerNorm networks, the contribution reduces to an aggregation rule. Either outcome is informative for practitioners who currently pick a voting rule by habit.