Giter VIP home page Giter VIP logo

event-ahu / sstformer Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 1.0 7.94 MB

[PokerEvent Benchmark Dataset & SNN-ANN Baseline] Official PyTorch implementation of "SSTFormer: Bridging Spiking Neural Network and Memory Support Transformer for Frame-Event based Recognition"

Python 99.55% Shell 0.45%
bio-inspired-computing event event-camera spiking-neural-networks transformer-networks video-classification bottleneck-mechanism rgb-event-fusion

sstformer's Introduction

A New Benchmark Dataset & A SNN-ANN Framework for RGB-Event based Pattern Recognition


SSTFormer

Official PyTorch implementation of SSTFormer: Bridging Spiking Neural Network and Memory Support Transformer for Frame-Event based Recognition, Xiao Wang, Zongzhen Wu, Yao Rong, Lin Zhu, Bo Jiang, Jin Tang, Yonghong Tian. [arXiv]

Abstract

Event camera-based pattern recognition is a newly arising research topic in recent years. Current researchers usually transform the event streams into images, graphs, or voxels, and adopt deep neural networks for event-based classification. Although good performance can be achieved on simple event recognition datasets, however, their results may be still limited due to the following two issues. Firstly, they adopt spatial sparse event streams for recognition only, which may fail to capture the color and detailed texture information well. Secondly, they adopt either Spiking Neural Networks (SNN) for energy-efficient recognition with suboptimal results, or Artificial Neural Networks (ANN) for energy-intensive, high-performance recognition. However, seldom of them consider achieving a balance between these two aspects. In this paper, we formally propose to recognize patterns by fusing RGB frames and event streams simultaneously and propose a new RGB frame-event recognition framework to address the aforementioned issues. The proposed method contains four main modules, i.e., memory support Transformer network for RGB frame encoding, spiking neural network for raw event stream encoding, multi-modal bottleneck fusion module for RGB- Event feature aggregation, and prediction head. Due to the scarce of RGB-Event based classification dataset, we also propose a large-scale PokerEvent dataset which contains 114 classes, and 27102 frame-event pairs recorded using a DVS346 event camera. Extensive experiments on two RGB-Event based classification datasets fully validated the effectiveness of our proposed framework. We hope this work will boost the development of pattern recognition by fusing RGB frames and event streams.

ANN-SNN Framework for RGB-Event based Recognition

Download PokerEvent Dataset

* BaiduYun (178GB): 链接:https://pan.baidu.com/s/1vQnHZUqQ1o58SajvtE-uHw?pwd=AHUE 提取码:AHUE 

* DropBox (178GB): https://www.dropbox.com/scl/fo/w658kwhfi3qa8naul3eeb/h?rlkey=zjn4b69wa1e3mhid8p6hh8v75&dl=0

Environment Setting

conda create -n event  python=3.8 -y
conda activate event
pip3 install openmim
mim install mmcv-full
mim install mmdet  # optional
mim install mmpose  # optional
git clone https://github.com/open-mmlab/mmaction2.git
cd mmaction2
pip3 install -e .

Some detailed settings about the path of the dataset

SSTFormer:

The path of Rgb data, in /SSTFormer/configs/recognition/SSTFormer/SSTFormer.py, fill in the path of RGB data and the path of dataset labels in the following figure.

Path of event data,in SSTFormer/SSTFormer/mmaction/datasets/transforms/loading.py

Please note that a portion of the RGB data path has been truncated here to ensure that the path you added is correct.

SpikingF_MST:

Path of event data,in SpikingF_MST/train.py

Path of Rgb data, in SpikingF_MST/train.py

Path of dataset labels, in SpikingF_MST/train.py

Train & Test

SSTFormer:
train_SSTFormer.sh
test_SSTFormer.sh


SpikingF-MST:
sh train_SpikingFMST.sh

Experimental Results and Visualization

Acknowledgement

Our code is implemented based on MMAction2, Spikingformer.

Reference

@misc{wang2023sstformer,
      title={SSTFormer: Bridging Spiking Neural Network and Memory Support Transformer for Frame-Event based Recognition}, 
      author={Xiao Wang and Zongzhen Wu and Yao Rong and Lin Zhu and Bo Jiang and Jin Tang and Yonghong Tian},
      year={2023},
      eprint={2308.04369},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

sstformer's People

Contributors

wangxiao5791509 avatar wuzongzhen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lrichie

sstformer's Issues

config

I have another idea that in the config file, .../Poker_rgbframes/ refer to the folder that contains the aedat4 format files after decompression? Also, when training the PokerEvent dataset, is it only using one GPU? Thank you for your reply!

训练时候的数据格式

您好!请问方便提供你们训练时候输入的数据格式吗?截图也可以。我感觉不是解压后raw的aedat4文件,请问您们是不是有进一步提取数据,因为我在跑代码的时候一直卡在这个错误。
1705287359589

Problems running train_SSTFormer.sh

Traceback (most recent call last):
File "tools/train.py", line 136, in
main()
File "tools/train.py", line 129, in main
runner = Runner.from_cfg(cfg)
File "……/anaconda3/envs/ECE/lib/python3.8/site-packages/mmengine/runner/runner.py", line 462, in from_cfg
runner = cls(
File "……/anaconda3/envs/ECE/lib/python3.8/site-packages/mmengine/runner/runner.py", line 429, in init
self.model = self.build_model(model)
File "……/anaconda3/envs/ECE/lib/python3.8/site-packages/mmengine/runner/runner.py", line 836, in build_model
model = MODELS.build(model)
File "……/anaconda3/envs/ECE/lib/python3.8/site-packages/mmengine/registry/registry.py", line 570, in build
return self.build_func(cfg, *args, **kwargs, registry=self)
File "……/anaconda3/envs/ECE/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 232, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "……/anaconda3/envs/ECE/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg
obj = obj_cls(**args) # type: ignore
File "……/mmaction2/mmaction/models/recognizers/base.py", line 116, in init
self.backbone = MODELS.build(backbone)
File "……/anaconda3/envs/ECE/lib/python3.8/site-packages/mmengine/registry/registry.py", line 570, in build
return self.build_func(cfg, *args, **kwargs, registry=self)
File "……/anaconda3/envs/ECE/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 232, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "……/anaconda3/envs/ECE/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 100, in build_from_cfg
raise KeyError(
KeyError: 'SSTFormer is not in the mmaction::model registry. Please check whether the value of SSTFormer is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#import-the-custom-module'

baseline

Hi. In the classification method mentioned in the paper, it is based on RGB. How did you add events when comparing and training? I saw this description in the paper:
This, we train these compared methods using concatenated RGB frames and event images.
But I don't quite understand how this statement is reflected in the code. Can you explain it in detail? Thank you!

HARDVS数据集

您好,我发现HARDVS数据集的下载链接里面没有rgb图像的数据,请问你们之前是怎么获取的?方便提供吗?感谢!

question about configs/recognition/SSTFormer/SSTFormer.py

Hello, I have downloaded your PokerEvent dataset, and try to run your code. But I found that configs/recognition/SSTFormer/SSTFormer py did not specify how the dataset parameters should be set.

# ##rgb_Puke100
dataset_type = 'RawframeDataset'
data_root = 
data_root_val = 
ann_file_train =
ann_file_val = 
ann_file_test =

Can you explain how the above parameters should be set?

SSTFormer

May I ask if SSTFormer refers to the SCNN-MST method mentioned in the paper? Does SpikingF-MST refer to the Spikingformer-MST method?

代码报错

你好,使用了data_processing之后,目前还有这个问题,请问这个路径的代码是不是写错了?

1705314378185

这部分代码是为了读取event事件的信息吗,是不是需要自行修改路径?
1705313137068

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.