Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 1.67 KB

File metadata and controls

54 lines (41 loc) · 1.67 KB

Timestep-Compressed Attack on Spiking Neural Networks through Timestep-Level Backpropagation

Pytorch implementation for Timestep-Compressed Attack on Spiking Neural Networks through Timestep-Level Backpropagation based on RGA and HART.

Installation

The experiments were conducted in an environment based on Python 3.8.

pip install -r requirements.txt

If you have trouble installing some libraries, please refer to the RGA and HART

Prepare victim model

VGG-11 on CIFAR-10

cd train
python main_train.py -arch vgg11 -T 8 -data cifar10

ResNet-17 on CIFAR-10

cd train
python main_train.py -arch resnet17 -T 8 -data cifar10

A-MPR

Prepare membrane image (VGG-11, CIFAR-10)

mkdir A_MPR
python A_MPR.py --trainTS 2 --beta 8 --epsilon 8 -arch vgg11 -T 8 -data cifar10 --victim <target_model>

TCA Attack

TCA Attack (VGG-11, CIFAR-10, STBP) To facilitate faster reproduction of results, we provide batch execution support for the TCA attack. To accurately measure the execution time, the attack should be performed without batch execution.

python TCA_attack.py -arch vgg11 -T 8 -data cifar10 --victim <target_model> --trainTS 2 --epsilon 8 --BPmode bptt --Vmin 0.2 --Vmax 0.5 --w 2 --Th 1

Supported BackPropagation (BPmode) Options

bptt: STBP
bptr: RGA
avg: HART

Acknowledgments

Related project: RGA, HART Many thanks for their wonderful works.