All Projects → mit-han-lab → bnn-icestick

mit-han-lab / bnn-icestick

Licence: MIT license
Binary Neural Network on IceStick FPGA.

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to bnn-icestick

tapasco
The Task Parallel System Composer (TaPaSCo)
Stars: ✭ 66 (+46.67%)
Mutual labels:  fpga, hardware-acceleration
community
ROS 2 Hardware Acceleration Working Group community governance model & list of projects
Stars: ✭ 34 (-24.44%)
Mutual labels:  fpga, hardware-acceleration
KRS
The Kria Robotics Stack (KRS) is a ROS 2 superset for industry, an integrated set of robot libraries and utilities to accelerate the development, maintenance and commercialization of industrial-grade robotic solutions while using adaptive computing.
Stars: ✭ 26 (-42.22%)
Mutual labels:  fpga, hardware-acceleration
Voice-ML
MobileNet trained with VoxCeleb dataset and used for voice verification
Stars: ✭ 15 (-66.67%)
Mutual labels:  hardware-acceleration
polyphony
Polyphony is Python based High-Level Synthesis compiler.
Stars: ✭ 90 (+100%)
Mutual labels:  fpga
zc pcie dma
DMA attacks over PCI Express based on Xilinx Zynq-7000 series SoC
Stars: ✭ 37 (-17.78%)
Mutual labels:  fpga
p4fpga
P4-14/16 Bluespec Compiler
Stars: ✭ 70 (+55.56%)
Mutual labels:  fpga
soap
🎯 soap - Structural Optimisation of Arithmetic Programs
Stars: ✭ 21 (-53.33%)
Mutual labels:  fpga
yahdl
A programming language for FPGAs.
Stars: ✭ 20 (-55.56%)
Mutual labels:  fpga
yafpgatetris
Yet Another Tetris on FPGA Implementation
Stars: ✭ 29 (-35.56%)
Mutual labels:  fpga
optiga-trust-m
OPTIGA™ Trust M Software Framework
Stars: ✭ 86 (+91.11%)
Mutual labels:  hardware-acceleration
fpga torture
🔥 Technology-agnostic FPGA stress-test: maximum logic utilization and high dynamic power consumption.
Stars: ✭ 23 (-48.89%)
Mutual labels:  fpga
Coyote
Framework providing operating system abstractions and a range of shared networking (RDMA, TCP/IP) and memory services to common modern heterogeneous platforms.
Stars: ✭ 80 (+77.78%)
Mutual labels:  fpga
tiny-tpu
Small-scale Tensor Processing Unit built on an FPGA
Stars: ✭ 61 (+35.56%)
Mutual labels:  fpga
hBPF
hBPF = eBPF in hardware
Stars: ✭ 335 (+644.44%)
Mutual labels:  fpga
vscode-terosHDL
VHDL and Verilog/SV IDE: state machine viewer, linter, documentation, snippets... and more!
Stars: ✭ 325 (+622.22%)
Mutual labels:  fpga
xeda
Cross EDA Abstraction and Automation
Stars: ✭ 25 (-44.44%)
Mutual labels:  fpga
FPGA ThreeLevelStorage
【原创,已被编入官方教材】Three-level storage subsystem(SD+DDR2 SDRAM+Cache), based on Nexys4 FPGA board. 同济大学计算机系统结构课程设计,FPGA三级存储子系统。
Stars: ✭ 86 (+91.11%)
Mutual labels:  fpga
xup compute acceleration
Hands-on experience using the Vitis unified software platform with Xilinx FPGA hardware
Stars: ✭ 41 (-8.89%)
Mutual labels:  fpga
mos6502-kansas-lava
Kansas Lava implementation of MOS 6502 microprocessor
Stars: ✭ 14 (-68.89%)
Mutual labels:  fpga

Binary Neural Network on IceStick FPGA

Introduction

This project is from Magma Hackathon by Yujun Lin, Kaidi Cao and Song Han

This design implements a one-layer binary neural network for handwritten digits recognition (0-9). Both the weights and activations are binary which is very computation-efficient. We also provided the Tensorflow code to train binary neural networks under nn_train. However, if you are only interested in the hardware part, you can use our pre-trained model under nn_train/BNN.pkl

You may start with tutorial_digits_recognition_on_icestick.ipynb which will guide you through the entire flow.

The architecture is output stationary. The image is resized to 16x16, and operand width in execution stage of pipeline is 16 bit. The pipeline contains five stages:

binary matrix vector multiplication

  • IF: calculate IDX and CYCLE as shown in figure
  • RR: read weight matrix and image block from ROM and LUTs
  • EXE: using NXOR and Popcount to perform binary matrix multiplication and accumulate results
  • CP: compare result to previous maximum result and save the index (prediction number) for maximum result
  • FI: wait to show result until all calculation completes

There are five lights (D0, D1, D2, D3, D4) on the IceStick FPGA. The D5 LED is green which indicates the finish of calculation. Others are red and used for indicates binary representation of predited number.

Directories and Files

nn_train contains tutorials of training a binary neural network for digits recognition and format of saving weight matrix and images used for FPGA.

nn_train/BNN.pkl contains the weight matrix and images we seleted. Only digit 4 is incorrectly recognized as 9 and other numbers can be perfectly recognized.

test_modules shows the simulation of our pipeline.

tutorial_digits_recognition_on_icestick is the tutorial to convert our code to verilog and download to icestick FPGA for experiments.

LICENSE

The MIT License

Copyright (c) 2017 Yujun Lin, Kaidi Cao, Song Han

Contact: [email protected], [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].