Spiking neural networks gain robustness with controlled random input encoding

Controllable Stochastic Quantization Encoding for Adversarially Robust Spiking Neural Networks

Neural and Evolutionary Computing

Summary

Spiking neural networks are a type of AI inspired by the brain and good at recognizing images, but they can be easily tricked by small changes to those images. The researchers found that how the image data is fed into these networks can affect how easily they are fooled. They developed a way to add controllable randomness when converting images for the network to read, which makes the networks harder to trick. This new method works well on standard image datasets and can be combined with other defenses to improve security.

What this means in practice

  • For ai hardware developers: Implement input encoding methods that improve robustness of spiking neural networks against adversarial image manipulations for energy-efficient edge devices.
  • For robotics engineers: Design vision systems in robots using spiking neural networks with stochastic quantization encoding to reduce vulnerability to subtle visual attacks.

Authors

Yujia Liu, Peiyu Liu, Yajing Zheng, Tiejun Huang

Abstract

Spiking Neural Networks (SNNs) have attracted increasing attention due to their impressive temporal dynamics, energy efficiency, and brain-inspired mechanisms. Although SNNs have demonstrated promising performance in image classification tasks, recent studies have shown that they remain vulnerable to adversarial attacks, where imperceptible perturbations are added to input images to mislead model predictions. Existing defense methods mainly focus on training strategies, while the role of input encoding remains less explored. An observation is that the robustness advantage of Poisson encoding over direct encoding may benefit from its inherent randomness. Motivated by this, we propose a stochastic quantization encoding method that encodes the input image with controllable randomness adjusted by the quantization scale, thereby improving the adversarial robustness of SNNs. We further show that this method constitutes a general framework that reduces to both Poisson encoding and direct encoding under different choices of the quantization scale. Since it enhances robustness at the input encoding stage, it can be combined with existing training-based defenses for further gains. Experimental results on CIFAR-10 and CIFAR-100 demonstrate the effectiveness of the proposed stochastic quantization encoding method. To sum up, this work highlights the importance of input encoding for the adversarial robustness of SNNs, providing a new perspective for understanding and improving it.