BrainCog is an open source spiking neural network based brain-inspired cognitive intelligence engine for Brain-inspired Artificial Intelligence and brain simulation. More information on BrainCog can be found on its homepage http://www.brain-cog.network/
The current version of BrainCog contains at least 18 functional spiking neural network algorithms (including but not limited to perception and learning, decision making, knowledge representation and reasoning, motor control, social cognition, etc.) built based on BrainCog infrastructures, and BrainCog also provide brain simulations to drosophila, rodent, monkey, and human brains at multiple scales based on spiking neural networks at multiple scales. More detail in http://www.brain-cog.network/docs/
BrainCog is a community based effort for spiking neural network based artificial intelligence, and we welcome any forms of contributions, from contributing to the development of core components, to contributing for applications.
If you use BrainCog in your research, the following paper can be cited as the source for BrainCog.
Yi Zeng, Dongcheng Zhao, Feifei Zhao, Guobin Shen, Yiting Dong, Enmeng Lu, Qian Zhang, Yinqian Sun, Qian Liang, Yuxuan Zhao, Zhuoya Zhao, Hongjian Fang, Yuwei Wang, Yang Li, Xin Liu, Chengcheng Du, Qingqun Kong, Zizhe Ruan, Weida Bi. BrainCog: A Spiking Neural Network based Brain-inspired Cognitive Intelligence Engine for Brain-inspired AI and Brain Simulation. arXiv:2207.08533, 2022. https://arxiv.org/abs/2207.08533
BrainCog provides essential and fundamental components to model biological and artificial intelligence.
BrainCog currently provides cognitive functions components that can be classified into five categories:
- Perception and Learning
- Decision Making
- Motor Control
- Knowledge Representation and Reasoning
- Social Cognition
BrainCog currently include two parts for brain simulation:
- Brain Cognitive Function Simulation
- Multi-scale Brain Structure Simulation
The anatomical and imaging data is used to support our simulation from various aspects.
- [BrainCog Talk] Beginning BrainCog Lecture 17. A Brain-inspired Theory of Mind Model Based on BrainCog for Reducing Other Agents’ Safety Risks [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 16. Brain-inspired Bodily Self-perception Model Based on BrainCog [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 15. SNN-based Music Memory and Generation Based on BrainCog [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 14. The Implement of Multisensory Concept Learning Framework Based on SNNs with Braincog [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 13. Symbolic Representation and Reasoning SNN Based on Braincog [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 12. Unsupervised STDP-based Spiking Neural Networks Based on BrainCog [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 11. Backpropagation with Spatiotemporal Adjustment for Training Deep Spiking Neural Networks through BrainCog [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 10. Multi-brain Areas Coordinated Brain-inspired Decision-Making Spiking Neural Network Based on Braincog [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 9. Spiking Neural Networks with Global Feedback Connections Based on BrainCog [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 8. Converting Artificial Neural Network to Spiking Neural Network through BrainCog [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 7. Implementing Quantum Superposition Inspired Spatio-temporal Spike Encoding through BrainCog [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 6. Implementing spiking deep Q network through Braincog [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 5. Advanced BrainCog System Functions [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 4. Creating Cognitive SNNs for Brain Areas [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 3. Creating SNNs Easily and Quickly [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 2. Computational Modeling of Spiking Neurons [English Version, Chinese Version]
- [BrainCog Talk] Beginning BrainCog Lecture 1. Installing and Deploying BrainCog platform [English Version, Chinese Version]
- How to Install BrainCog [English Version, Chinese Version]
- Overall Introduction of BrainCog [English Version, Chinese Version]
- Spiking Neuron Modeling with BrainCog [English Version, Chinese Version]
- Building Efficient Spiking Neural Networks with BrainCog [English Version, Chinese Version]
- Building Cognitive Networks with BrainCog [English Version, Chinese Version]
- Implementing Deep Reinforcement Learning SNNs with BrainCog [English Version, Chinese Version]
- Quantum Superposition State Inspired Encoding With BrainCog [English Version, Chinese Version]
- Converting ANNs to SNNs with BrainCog [English Version, Chinese Version]
- SNNs with Global Feedback Connections Based on BrainCog [English Version, Chinese Version]
- Multi-brain Areas Coordinated Brain-inspired Decision-Making SNNs Based on Braincog [English Version, Chinese Version]
- Backpropagation with Spatiotemporal Adjustment for Training SNNs Based on BrainCog [English Version, Chinese Version]
- Unsupervised STDP Based SNNs with Multiple Adaptive Mechanisms Based on BrainCog [English Version, Chinese Version]
- Symbolic Representation and Reasoning SNNs Based on BrainCog [English Version, Chinese Version]
- Multisensory Integration Based on BrainCog [English Version, Chinese Version]
- SNN-based Music Memory and Generation Based on BrainCog [English Version, Chinese Version]
- Brain-inspired Bodily Self-perception Model Based on BrainCog [English Version, Chinese Version]
- A Brain-inspired Theory of Mind Model Based on BrainCog for Reducing Other Agents’ Safety Risks [English Version, Chinese Version]
In addition to the static datasets, BrainCog supports the commonly used neuromorphic datasets, such as DVSGesture, DVSCIFAR10, NCALTECH101, ES-ImageNet. Also, the neuromorphic dataset N-Omniglot for few-shot learning is also integrated into BrainCog.
This dataset contains 11 hand gestures from 29 subjects under 3 illumination conditions recorded using a DVS128.
This dataset converts 10,000 frame-based images in the CIFAR10 dataset into 10,000 event streams using a dynamic vision sensor.
The NCaltech101 dataset is captured by mounting the ATIS sensor on a motorized pan-tilt unit and having the sensor move while it views Caltech101 examples on an LCD monitor. The "Faces" class has been removed from N-Caltech101, leaving 100 object classes plus a background class
The dataset is converted with Omnidirectional Discrete Gradient (ODG) from 1,300,000 frame-based images in the ImageNet dataset into event-stream samples, which has 1000 categories.
This dataset contains 1,623 categories of handwritten characters, with only 20 samples per class. The dataset is acquired with the DVS acquisition platform to shoot videos (generated from the original Omniglot dataset) played on the monitor, and use the Robotic Process Automation (RPA) software to collect the data automatically.
You can easily use them in the braincog/datasets folder, taking DVSCIFAR10 as an example
loader_train, loader_eval,_,_ = get_dvsc10_data(batch_size=128,step=10)
- python == 3.8
- CUDA toolkit == 11.
- numpy >= 1.21.2
- scipy >= 1.8.0
- h5py >= 3.6.0
- torch >= 1.10
- torchvision >= 0.12.0
- torchaudio >= 0.11.0
- timm >= 0.5.4
- matplotlib >= 3.5.1
- einops >= 0.4.1
- thop >= 0.0.31
- pyyaml >= 6.0
- loris >= 0.5.3
- pandas >= 1.4.2
- tonic
- pandas >= 1.4.2
- xlrd == 1.2.0
-
You can install braincog by running:
pip install braincog
-
Also, install from github by running:
pip install git+https://github.com/braincog-X/Brain-Cog.git
-
If you are a developer, it is recommanded to download or clone braincog from github.
git clone https://github.com/braincog-X/Brain-Cog.git
-
Enter the folder of braincog
cd Brain-Cog
-
Install braincog locally
pip install -e .
- Examples for Image Classification
cd ./examples/Perception_and_Learning/img_cls/bp
python main.py --model cifar_convnet --dataset cifar10 --node-type LIFNode --step 8 --device 0
- Examples for Event Classification
cd ./examples/Perception_and_Learning/img_cls/bp
python main.py --model dvs_convnet --node-type LIFNode --dataset dvsc10 --step 10 --batch-size 128 --act-fun QGateGrad --device 0
Other BrainCog features and tutorials can be found at http://www.brain-cog.network/docs/
Please add our BrainCog Assitant via wechat and we will invite you to our wechat developer group.