Pytorch implementation for Timestep-Compressed Attack on Spiking Neural Networks through Timestep-Level Backpropagation based on RGA and HART.
The experiments were conducted in an environment based on Python 3.8.
pip install -r requirements.txtIf you have trouble installing some libraries, please refer to the RGA and HART
VGG-11 on CIFAR-10
cd train
python main_train.py -arch vgg11 -T 8 -data cifar10ResNet-17 on CIFAR-10
cd train
python main_train.py -arch resnet17 -T 8 -data cifar10Prepare 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 (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 1Supported BackPropagation (BPmode) Options
bptt: STBP
bptr: RGA
avg: HARTRelated project: RGA, HART Many thanks for their wonderful works.