Enhancing Representation of Spiking Neural Networks via Similarity-Sensitive Contrastive Learning

Yuhan Zhang, Xiaode Liu, Yuanpei Chen, Weihang Peng, Yufei Guo, Xuhui Huang, Zhe Ma

Introduction

Spiking Neural Networks (SNNs) represent a promising frontier for energy-efficient artificial intelligence, leveraging discrete binary spikes to replace power-intensive multiplications with simple additions. Despite their potential, SNNs frequently encounter an "Accuracy Gap" when compared to traditional Artificial Neural Networks (ANNs). This performance degradation stems from the limited information capacity of binary spikes relative to the 32-bit floating-point activations used in ANNs. While Knowledge Distillation (KD) has been explored to bridge this gap, conventional methods often fail to capture the complex structural relationships across different data samples.

Similarity-Sensitive Contrastive Learning (SSCL)

To address these challenges, this work introduces Similarity-Sensitive Contrastive Learning (SSCL), a framework designed to maximize the mutual information between SNN and ANN representations.

Overview of the SSCL framework, illustrating the integration of CKA similarity weights and contrastive losses between SNN and ANN layers.

The SSCL framework comprises three core innovations:

  1. Mutual Information (MI) Maximization: Utilizing Noise-Contrastive Estimation (NCE), the model aligns SNN representations with those of a teacher ANN. This process "pulls" representations of the same image closer while "pushing" those of different images apart, effectively capturing the marginal distribution of the data.
  2. Centered Kernel Alignment (CKA): The authors employ CKA to quantitatively measure the representational similarity between corresponding layers of the SNN and ANN. This diagnostic tool identifies which layers suffer most from information loss.
  3. Similarity-Sensitive Weighting: Recognizing that SNN representations tend to diverge more from ANNs in deeper layers, the framework applies an inverse CKA weighting to the contrastive loss. Layers with lower similarity (low CKA scores) receive higher loss weights, forcing the network to prioritize learning better features in those specific regions.

The training process utilizes Spatial-Temporal Backpropagation (STBP) with surrogate gradients to navigate the non-differentiable nature of spiking neurons.

Experimental Evaluation

The proposed method was evaluated across diverse benchmarks, including static image datasets (CIFAR-10, CIFAR-100, ImageNet) and neuromorphic data (CIFAR10-DVS).

Performance comparison of the proposed method against state-of-the-art SNN training techniques on CIFAR-10, CIFAR-100, and CIFAR-DVS datasets.

Key Results

  • High Accuracy with Low Latency: On CIFAR-100, the method achieved 78.79% accuracy using a ResNet19 in just 2 timesteps. Notably, at a single timestep ($T=1$), the model reached 77.75% accuracy, significantly outperforming prior methods that required more timesteps for similar performance.
  • Scalability to Large Datasets: On ImageNet, a ResNet34 architecture achieved 66.78% top-1 accuracy within 4 timesteps, demonstrating the method's competitiveness for large-scale direct-training SNNs.
  • Neuromorphic Robustness: The framework achieved 80.00% accuracy on CIFAR10-DVS, proving its efficacy for native event-based data.

Conclusion

By incorporating similarity-sensitive contrastive signals, this work effectively "squeezes" more information into the limited binary spike format of SNNs. The approach not only mitigates the "Deep Divergence" problem where SNN quality degrades in deeper layers but also enables high-performance inference with extremely low latency. Future research may explore the generalization of this framework to heterogeneous architectures, such as using Transformer-based teachers for spiking students, and further optimizing the computational overhead of layer-wise CKA calculations during training.

Summary updated

BibTeX
@inproceedings{zhang2024enhancing,
  author = {Yuhan Zhang and Xiaode Liu and Yuanpei Chen and Weihang Peng and Yufei Guo and Xuhui Huang and Zhe Ma},
  title = {{Enhancing Representation of Spiking Neural Networks via Similarity-Sensitive Contrastive Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i15.29635},
}
Figure