BrainCog Cognitive Intelligence Engine

repository·main·Indexed 20 days ago

https://github.com/braincog-x/brain-cog

An open-source spiking neural network (SNN) based cognitive intelligence engine for brain-inspired AI, brain simulation, and embodied AI/robotics. It includes implementations for Drosophila-inspired decision-making, PL-SDQN, reward-modulated SNNs for swarm collision avoidance, and knowledge representation. The framework supports multiscale brain structure simulations (including Human PFC and Corticothalamic models) and hardware acceleration on Xilinx Zynq Ultrascale FPGAs via FireFly.

Tokens
22.1K
Snippets
94
Records
145
Agent score
70%

What's inside BrainCog

  1. Explore Software-Hardware Co-design projects in BrainCog

    main
    BrainCog supports research and implementation in Software-Hardware Co-design, specifically focusing on hardware acceleration for Spiking Neural Networks (SNNs) and systolic matrix engines. Key projects include the FireFly series of FPGA accelerators and SpinalDLA for DSP optimization on FPGAs.
  2. Supported neuromorphic datasets in BrainCog

    main

    BrainCog includes integrated support for several standard neuromorphic and event-based datasets, making them available for brain-inspired AI research and simulation. Supported datasets include:

    • DVSGesture: 11 hand gestures from 29 subjects under 3 illumination conditions (recorded using DVS128).
    • DVSCIFAR10: 10,000 event streams converted from the frame-based CIFAR10 dataset.
    • NCALTECH101: 100 object classes plus a background class, captured using an ATIS sensor on a motorized pan-tilt unit.
    • ES-ImageNet: 1,000 categories converted from 1,300,000 ImageNet frame-based images using Omnidirectional Discrete Gradient (ODG).
    • N-Omniglot: 1,623 categories of handwritten characters (20 samples per class) acquired via a DVS acquisition platform.
  3. Overview of DSD-SNN for Continual Learning

    main

    Dynamic Structure Development of Spiking Neural Networks (DSD-SNN) is designed for efficient and adaptive continual learning. It employs two primary mechanisms:

    1. Dynamic Structure Adjustment: The network grows new neurons and prunes redundant ones to increase memory capacity while reducing computational overhead.
    2. Knowledge Transfer: It overlaps shared structures to leverage knowledge acquired from previous tasks, allowing a single network to support multiple incremental tasks.

    The implementation is validated against multiple Task-Incremental Learning (TIL) and Class-Incremental Learning (CIL) benchmarks.

  4. Run the PL-SDQN model

    main

    The PL-SDQN (Potential Based Normalization for Spiking Deep Q Network) implementation is used to solve the spike feature information vanishing problem. To run the training process, execute the main.py script located in the sdqn directory.

    Prerequisite: You must install the tianshou framework before running this model.

    python ./sdqn/main.py
  5. Convert an ANN to an SNN using the ANN-SNN conversion method

    main

    To train a deep spiking neural network (SNN) using the ANN-SNN conversion method, you must first prepare a PyTorch-based Artificial Neural Network (ANN). This involves replacing ReLU and MaxPooling layers in your PyTorch model with compatible alternatives to ensure the model can be successfully converted into an SNN for complex tasks.

    Workflow:

    1. Train the ANN: Run the initial training script to obtain a well-trained ANN.
    2. Run SNN Inference: Use the converted script to perform inference using the spiking neural network.
    # 1. Train the well-trained ANN
    python CIFAR10_VGG16.py
    
    # 2. Run the SNN inference process
    python converted_CIFAR10.py