Yo! This project is still a Work In Progress. Instructions, board layouts and BOM might change!
License:
Attribution-ShareAlike (CC-BY-SA)
Created:
8 years ago
Updated:
8 years ago
Views:
5930
1 Collect
0 Comments
Share
249 Download (1.22 MB)
Make a donation to CORTEX Systems

NeuroChip is a prototyping board for hybrid digital/analog neuromorphic computing for the DIY robotics community and researchers in the fields of artificial intelligence and computational neuroscience.

NeuroChip can be used to test various learning algorithms and activation functions in hardware. Once a design has been verified, it can be miniaturized and scaled up using one of the following technologies: System in Package (SiP), VQFN, SOT, or WLCSP.

Features:

  • Compatible with Arduino IDE or AVR IDE of choice
  • One processor (AtTiny85) per synapse, with the option to easily add as many synapses as desired (excitatory or inhibitory) via synaptic expansion shields (via S/M (single or multiple board) select jumper and L/I/E/F header (Logic In, I-Activation, Excitatory In, Fire State Out).
  • AND gates and transistor for MAX inhibitory function (if using only a MAX function, inhibitory synapse Attiny's can be replaced by comparators in large scale design)
  • PWM (pulse-width modulation) communication between neurons
  • PWM synapse integration via diode logic OR gate and summing capacitor controlled by cell body and transistor
  • Customizeable activation functions and learning algorithms (optimized for local unsupervised and/or reinforcement learning) via coding and changing resistors and summing capacitor (sigmoid function is hardware)
  • Level-tuned (band pass) Exitatory Synapses: Synapse stores a level (not a weight), compares input to this level, and outputs similarity
  • Hebbian Learning: Synapse moves stored level in the direction of the input, but only when cell body fires
  • Simulated Annealing: Synapse decreases the amount of level movement with time
  • Adaptive Thresholding: Cell body decreases threshold if it frequently does not fire, increases threshold if it fires too often
  • All synapses sample inputs
  • Inhibitory synapses write digital output HIGH if neuron activation > inhibitory activation
  • Excitatory synapses write activation to summation (PWM) line
  • Cell body discharges capacitor on summing line, enables PWM charging transistor for n microseconds and reads capacitor charge
  • Cell body writes activation to PWM inhibitory output
  • AND gate triggers firing if HIGH
  • Excitatory synapses and cell body read firing state line
  • Excitatory synapses update weights only when neuron fires
  • Cell body adjusts threshold if firing rate != n.

Instructions:

To program each processor, remove the chip from the socket and connect it to a 5 volt Arduino or programming board (many instructions available online). To test the board, remove the "cell body" chip and connect the corresponding socket positions (with jumper wires) directly to an arduino that has been programmed with the code from the cell body chip (with some additional serial monitoring code). After confirming that the board is performing as expected, reinstall the cell body chip. External sensors, actuators and monitors can now be connected to the inputs and outputs of the board (note: these must either be at 5 volts and connected to a common ground or operated by relay).

Cell Body Pin Functions:

  • PB0: Reset Summing Capacitor (digital, OUTPUT LOW = reset, INPUT = disable)
  • PB1: Output (PWM, excitatory and lateral inhibitory)
  • PB2: Firing State (digital, HIGH = fired, LOW = not fired)
  • PB3: Read Summing Capacitor (analog input)
  • PB4: Charge Summing capacitor via synapses (digital)

Example Code (For excitatory synapse):

#include "avr/interrupt.h"
 
volatile int state = 0;
byte input;
byte weight = 2;                                                    
byte power;
int difference;
byte learningRate = 5;

void setup() {
  pinMode(4, INPUT_PULLUP);                           // input
  pinMode(2, INPUT_PULLUP);                           // post-synaptic feed-back
  pinMode(1, OUTPUT);                                 // output
    GIMSK = 0b00100000;
    PCMSK = 0b00000100;
    sei();                 

void loop() {
if (state == 1){
weight = weight + (difference / learningRate);         // if post-synaptic neuron fired, nudge weight towards last input
state = 0                                              // reset post-synaptic feed-back state
}
input = pulseIn(4, HIGH) / ();                         // read input and normalize to 255 (to determine number to divide by, divide max
difference = input - weight;                           // pulse width by 255
power = abs(difference);                               // replace this function with Gaussian for more powerful recognition
analogWrite(1, (255 - power));                        
}

ISR(PCINT0_vect)
{
    state = digitalRead(2);                           // get post-synaptic firing event (rising edge only)
if (state == 0) {
state = 1}                                            
}

**PCB is currently in fabrication. **