SSI-GAN: Semi-supervised Spike Classification
- The paper introduces SSI-GAN, a semi-supervised framework that combines a transformer-based generator with a Swin-inspired shifted-window discriminator to classify neuronal spike trains.
- It details a streamlined preprocessing pipeline on high-frequency MEA data and leverages innovative windowing strategies to capture temporal-spatial dependencies.
- Empirical results demonstrate superior performance over CNN-GRU benchmarks, achieving near-perfect accuracy while reducing labeling efforts by up to 99%.
The Semi-supervised Swin-Inspired GAN (SSI-GAN) is a generative adversarial network architecture designed to classify neuronal spike trains in the context of arboviral infection detection. Addressing the critical challenge of limited labeled data in large-scale electrophysiology, SSI-GAN integrates a transformer-based generator and a Swin-inspired shifted-window discriminator for robust, semi-supervised classification. It markedly reduces manual labeling requirements while achieving high performance in distinguishing Zika, dengue, and control patterns in Aedes aegypti neuronal recordings (Sharifrazi et al., 1 Jan 2026).
1. Input Representation and Preprocessing Pipeline
SSI-GAN operates directly on neuronal spike data acquired via 60-electrode microelectrode arrays (MEA) sampled at 30 kHz. The raw signals undergo minimal preprocessing steps: a high-pass Butterworth filter (700 Hz cutoff) removes low-frequency local field potential (LFP) noise, while thresholding at ±10 μV zeroes out values in (−10,10) μV, effectively denoising the signal and focusing on salient spike events. The continuous recordings are segmented into non-overlapping windows of T = 100 samples, yielding inputs , where C=60 denotes electrodes. In the semi-supervised regimen, only 3% of windows are labeled, with the remainder remaining unlabeled, reflecting realistic annotation constraints.
2. Transformer-based Generator Architecture
The SSI-GAN generator synthesizes plausible spike windows from Gaussian noise with dimensionality . The architecture comprises two stacked Transformer blocks, each with embedding dimension . Within each block:
- Multi-head self-attention is utilized with heads ().
- Sinusoidal positional encoding is applied such that for position pos and channel i:
- Feed-forward network (FFN) in each block has hidden dimension and employs GeLU or ReLU activations.
- Layer Normalization, dropout (rate , optimized via Bayesian Optuna), and residual pathways enhance stability and regularization.
This configuration enables to generate high-frequency, realistic spike patterns consistent with observed neuronal signal properties.
3. Swin-Inspired Shifted-Window Discriminator
The discriminator applies a windowing strategy inspired by Swin transformer mechanisms. For input , the time axis is partitioned into non-overlapping windows of length M=10. Even-numbered layers use these native partitions, while odd-numbered layers implement a “shifted-window” approach by rolling by before repartitioning. This alternating schema fosters both localized intra-window attention and cross-boundary contextual integration by facilitating cross-window communications without full multi-head attention.
Within each window, the discriminator layers proceed as follows:
- Window-based Multi-head Self-Attention (W-MSA):
- Feed-forward network plus residual:
- No hierarchical patch merging takes place; resolution is fully retained.
- Cross-window attention in shifted layers enables elements from overlapping windows to attend over shared indices, embedding broader dependencies.
Global average pooling (GAP) aggregates feature embeddings into , which feeds two output heads:
- Classification head: 3-way softmax distinguishes Zika, dengue, and control categories, .
- Adversarial head: Sigmoid outputs real/fake discrimination probability, .
4. Semi-supervised Learning Protocol
SSI-GAN’s workflow leverages both labeled and unlabeled spike windows for model optimization:
- Data split: 80% of windows for training, 20% for test; within training, 3% are labeled and the rest unlabeled, with 1% held back as validation for early stopping.
- Loss functions:
- Adversarial loss for D and G:
- Classification loss on labeled data:
- Composite objectives:
This bifurcated loss structure enables SSI-GAN to extract discriminative spike features from the scarce labels while adversarially regularizing via synthetic spike generation.
5. Hyperparameter Optimization and Validation Strategy
SSI-GAN applies Bayesian Optuna for rigorous hyperparameter search over the generator and discriminator settings. Parameters explored include , number of attention heads , head size , , number of blocks (1–4), dropout (0.1–0.5), learning rate (–), and batch size over 20 trials. The objective maximizes classification accuracy on the 1% validation split. Optimal hyperparameters identified: , heads=4, head size=128, , blocks=2, dropout=0.29, learning rate=9e-4, batch size=128.
Monte Carlo cross-validation is performed on five randomly partitioned data splits per run, reporting mean and standard deviation of accuracy, precision, recall, and F1-score, mitigating sensitivity to sample selection and ensuring statistical robustness.
6. Empirical Performance and Comparative Analysis
SSI-GAN’s evaluation on 15,728,580 spike windows across five post-infection days (0, 1, 2, 3, and 7 dpi) and three classes (control, DENV, ZIKV) demonstrates near-perfect classification with minimal supervision. Performance metrics at 3% labeled data are:
| Time-point (dpi) | SSI-GAN Accuracy (%) | Best Baseline CNN-GRU (%) |
|---|---|---|
| 0 | 99.45 | 91.6 |
| 1 | 99.61 | 91.1 |
| 2 | 97.09 | 83.2 |
| 3 | 99.82 | — |
| 7 | 99.93 | — |
SSI-GAN consistently outperforms the strongest supervised baseline (CNN-GRU) by more than 8% at all reported time-points, while using only 1–3% labels—a 97–99% reduction in annotation effort. Accuracy standard deviation over five Monte Carlo runs remains below 0.5% at all days post-infection; paired t-tests indicate statistical significance () versus baselines.
7. Impact and Implications in Neurovirology Spike Classification
SSI-GAN advances semi-supervised learning capabilities for large-scale neurovirology, offering state-of-the-art accuracy in classifying mosquito neuronal infection status with severely limited labels. By dispensing with exhaustive spike annotation and leveraging a shifted-window, transformer-based architecture, it makes mass deployment in field studies feasible, supporting viral neurotropism surveillance. The architecture’s novel combination of windowed and shifted-window attention mechanisms in the discriminator is empirically superior for high-frequency, sparse spike classification and may suggest broader applicability in electrophysiological pattern recognition. These findings set new data-efficient performance benchmarks in spike-based infection classification and demonstrate robust generalization across temporal stages of infection (Sharifrazi et al., 1 Jan 2026).