{"id":13644070,"url":"https://github.com/BICLab/Attention-SNN","last_synced_at":"2025-04-21T06:32:53.790Z","repository":{"id":179901447,"uuid":"664299029","full_name":"BICLab/Attention-SNN","owner":"BICLab","description":"Offical implementation of \"Attention Spiking Neural Networks\" (IEEE T-PAMI2023)","archived":false,"fork":false,"pushed_at":"2024-05-20T01:48:40.000Z","size":260,"stargazers_count":60,"open_issues_count":5,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-09T16:43:44.538Z","etag":null,"topics":["attention-mechanism","dynamic-neural-network","spiking-neural-networks"],"latest_commit_sha":null,"homepage":"https://ieeexplore.ieee.org/abstract/document/10032591","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BICLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-09T14:45:52.000Z","updated_at":"2024-11-01T08:02:28.000Z","dependencies_parsed_at":"2024-08-02T01:17:51.314Z","dependency_job_id":"94c31d46-9f28-4be0-90d9-4ff4fc512a42","html_url":"https://github.com/BICLab/Attention-SNN","commit_stats":null,"previous_names":["biclab/ma-snn"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BICLab%2FAttention-SNN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BICLab%2FAttention-SNN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BICLab%2FAttention-SNN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BICLab%2FAttention-SNN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BICLab","download_url":"https://codeload.github.com/BICLab/Attention-SNN/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250008282,"owners_count":21359958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attention-mechanism","dynamic-neural-network","spiking-neural-networks"],"created_at":"2024-08-02T01:01:57.126Z","updated_at":"2025-04-21T06:32:50.425Z","avatar_url":"https://github.com/BICLab.png","language":"Python","funding_links":[],"categories":["Object Detection Applications","Applications"],"sub_categories":[],"readme":"# [Attention Spiking Neural Networks](https://ieeexplore.ieee.org/document/10032591)\n\n# [Attention Spiking Neural Networks - Supplementary Materials](https://github.com/BICLab/Attention-SNN/issues/3)\n\n## **Requirements**\n\n1. Python 3.7.4\n2. PyTorch 1.7.1\n3. tqdm 4.56.0\n4. numpy 1.19.2\n\n\n\n## **Instructions**\n### 1. DVS128 Gesture\n\n1. Download [DVS128 Gesture](https://www.research.ibm.com/dvsgesture/) and put the downloaded dataset to /MA_SNN/DVSGestures/data, then run /MA_SNN/DVSGestures/data/DVS_Gesture.py.\n```\nMA_SNN\n├── /DVSGestures/\n│  ├── /data/\n│  │  ├── DVS_Gesture.py\n│  │  └── DvsGesture.tar.gz\n```\n2. Change the values of T and dt in /MA_SNN/DVSGestures/CNN/Config.py then run the tasks in /MA_SNN/DVSGestures.\n\neg:\n```\npython Att_SNN_CNN.py\n```\n3. View the results in /MA_SNN/DVSGestures/CNN/Result/.\n\n\n\n### 2. CIFAR10-DVS\n1. Download [CIFAR10-DVS](https://figshare.com/articles/dataset/CIFAR10-DVS_New/4724671/2) and processing dataset using official matlab program, then put the result to /MA_SNN/CIFAR10DVS/data.\n```\nMA_SNN\n├── /CIFAR10DVS/\n│  ├── /data/\n│  │  ├── /airplane/\n│  │  |  ├──0.mat\n│  │  |  ├──1.mat\n│  │  |  ├──...\n│  │  ├──automobile\n│  │  └──...\n```\n2. Change the values of T and dt in /MA_SNN/CIFAR10DVS/CNN/Config.py then run the tasks in /MA_SNN/CIFAR10DVS.\n\neg:\n```\npython Att_SNN.py\n```\n3. View the results in /MA_SNN/CIFAR10DVS/CNN/Result/.\n\n\n\n\n### 3. DVSGait Dataset\n1. Download [DVSGait Dataset] and put the downloaded dataset to /MA_SNN/DVSGait/data.\n\n2. Change the values of T and dt in /MA_SNN/DVSGait/CNN/Config.py then run the tasks in /MA_SNN/DVSGait.\n\neg:\n```\npython Att_SNN_CNN.py\n```\n3. View the results in /MA_SNN/DVSGait/CNN/Result/.\n\n### 4. ImageNet Dataset\n\nWe adopt the MS-SNN (https://github.com/Ariande1/MS-ResNet) as the residual spiking neural network backbone. \n\n1. Download [ImageNet Dataset] and set the downloaded dataset path in utils.py.\n2. then run the tasks in /Att_Res_SNN.\n\neg:\n\n```\npython -m torch.distributed.launch --master_port=[port] --nproc_per_node=[node_num] train_amp.py -net [model_type] -b [batchsize] -lr [learning_rate]\n```\n\n3. View the results in /checkpoint and /runs.\n\n### 5. Extra\n\n1. The implementation of Att-VGG-SNN in https://github.com/ridgerchu/SNN_Attention_VGG\n\n2. /module/Attention.py defines the  Attention layer and /module/LIF.py,LIF_Module.py defines LIF module.\n\n3. The CSA-MS-ResNet104 model is available at https://pan.baidu.com/s/1Uro7IVSerV23OKbG8Qn6pQ?pwd=54tl (Code: 54tl).\n\n   \n\n## **Citation**\n```\n@ARTICLE{10032591,\n  author={Yao, Man and Zhao, Guangshe and Zhang, Hengyu and Hu, Yifan and Deng, Lei and Tian, Yonghong and Xu, Bo and Li, Guoqi},\n  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, \n  title={Attention Spiking Neural Networks}, \n  year={2023},\n  volume={45},\n  number={8},\n  pages={9393-9410},\n  doi={10.1109/TPAMI.2023.3241201}}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBICLab%2FAttention-SNN","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBICLab%2FAttention-SNN","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBICLab%2FAttention-SNN/lists"}