TCJA-SNN: Temporal-Channel Joint Attention for Spiking Neural Networks

Rui-Jie Zhu, Qihang Zhao, Tianjing Zhang, Haoyu Deng, Yule Duan, Malu Zhang, Liang-Jian Deng

TL;DR

This paper introduces TCJA-SNN, a novel attention mechanism for Spiking Neural Networks (SNNs) that jointly considers temporal and channel information. By effectively modeling interdependencies between these dimensions, TCJA-SNN achieves state-of-the-art performance on various classification tasks and demonstrates promise in image generation, marking a significant step towards more capable and efficient SNNs.

What Problem Does This Paper Address?

Spiking Neural Networks (SNNs) hold great promise for energy-efficient computation due to their biological plausibility and event-driven nature. However, effectively capturing complex spatio-temporal relationships, especially in deep networks, has been a challenge. While attention mechanisms have proven successful in conventional Artificial Neural Networks (ANNs) for enhancing feature representation, their integration into SNNs has primarily focused on either temporal or channel dimensions independently. This separation limits the ability of SNNs to fully exploit the rich, interconnected nature of information across both time and feature channels, hindering their performance on complex tasks.

Methods

The core contribution is the Temporal-Channel Joint Attention (TCJA) mechanism. It operates in several steps:

  1. Squeeze Operation: The input spike stream is first compressed into an average matrix using a squeeze operation. This step aggregates spatial information to prepare for temporal and channel attention.
  2. Temporal-wise Local Attention (TLA): Efficient 1-D convolutions are used to capture local temporal dependencies between adjacent time steps. This allows the network to focus on relevant moments in the spike sequence.
  3. Channel-wise Local Attention (CLA): Similarly, 1-D convolutions are applied along the channel dimension to capture local dependencies between feature channels. This helps the network identify important features.
  4. Cross Convolutional Fusion (CCF): This novel layer fuses the information from TLA and CLA. It models the interdependencies between temporal and channel scopes, breaking their independence and enabling interaction. This is achieved through element-wise multiplication of the TLA and CLA outputs, followed by a sigmoid activation.

The TCJA module is designed as a plug-and-play component, easily integrated into existing SNN architectures without requiring significant modifications to the backpropagation process. The authors also explore different surrogate gradient functions for training SNNs, including ATan and triangle-like functions, to improve training stability and performance.

Datasets

The proposed TCJA-SNN was evaluated on a variety of datasets:

  • Neuromorphic Datasets:
    • CIFAR10-DVS
    • N-Caltech 101
    • DVS128 Gesture
  • Static Datasets:
    • Fashion-MNIST
    • CIFAR10
    • CIFAR100

The neuromorphic datasets are event-stream based, derived from dynamic vision sensors, while the static datasets are standard image classification benchmarks.

Key Insights and Ideas

  • Joint Temporal-Channel Attention is Crucial: The paper strongly argues that treating temporal and channel attention independently is suboptimal. Their TCJA mechanism demonstrates that jointly modeling these dimensions leads to superior feature representation and performance.
  • 1-D Convolutions for Efficiency: Using 1-D convolutions for local attention in both temporal and channel dimensions is an efficient way to capture local correlations without the computational overhead of 2D convolutions.
  • CCF Layer Bridges Dimensions: The Cross Convolutional Fusion (CCF) layer is the key innovation that enables the interaction between temporal and channel attention outputs, effectively creating a richer representation.
  • Plug-and-Play Simplicity: The TCJA module's design as a plug-and-play component makes it highly practical for researchers to integrate into existing SNN frameworks.
  • SNNs for Generation: The successful application of TCJA-SNN to image generation tasks, beyond classification, highlights its versatility and potential for more complex neuromorphic applications.

Key Results

  • Classification Performance: TCJA-SNN achieved state-of-the-art (SOTA) accuracy on all tested neuromorphic and static datasets, including CIFAR10-DVS (83.3%), N-Caltech101 (82.5%), DVS128 Gesture (99.0%), Fashion-MNIST (94.8%), CIFAR10 (95.9%), and CIFAR100 (78.3%).
  • Efficiency: The TCJA-SNN achieved higher accuracy with fewer simulation time steps compared to previous methods like TA-SNN.
  • Image Generation: The TCJA-SNN framework, when integrated into a spiking variational autoencoder (FSVAE), demonstrated competitive performance in image generation tasks, outperforming previous SNN-based generation models on metrics like Inception Score (IS) and FID.
  • Energy Efficiency: Compared to an ANN equivalent, TCJA-SNN consumed significantly less energy (5.26x lower) for classification tasks.

Limitations and Future Work

  • Parameter Count: While efficient, the insertion of TCJA did result in a "relatively sizable boost" in the number of parameters compared to baseline SNNs without attention.
  • Kernel Size Sensitivity: The paper notes that performance can degrade if the kernel size for the attention mechanisms is too large, suggesting that local correlations are more important than global ones for this specific attention design.
  • Future Work: The authors suggest that the TCJA mechanism can be easily integrated into neuromorphic chips, hinting at future hardware-aware optimizations and applications. They also implicitly suggest further exploration of different attention configurations and surrogate gradient functions.

Summary updated

BibTeX
@article{zhu2022tcja,
  author = {Rui-Jie Zhu and Qihang Zhao and Tianjing Zhang and Haoyu Deng and Yule Duan and Malu Zhang and Liang-Jian Deng},
  title = {{TCJA-SNN: Temporal-Channel Joint Attention for Spiking Neural Networks}},
  journal = {IEEE Transactions on Neural Networks and Learning Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=B65VkPfsj0},
}
Figure