Giter Site home page Giter Site logo

lulinchen / cnn_open Goto Github PK

View Code? Open in Web Editor NEW
204.0 14.0 73.0 11.84 MB

A hardware implementation of CNN, written by Verilog and synthesized on FPGA

Verilog 11.31% Coq 81.72% VHDL 0.94% Jupyter Notebook 4.45% Makefile 0.09% Shell 0.50% Forth 0.05% Tcl 0.93%
cnn lenet rtl verilog fpga

cnn_open's Introduction

A CNN(Convolutional Neural Network) hardware implementation

This project is an attempt to implemnt a harware CNN structure.

The code is written by Verilog/SystemVerilog and Synthesized on Xilinx FPGA using Vivado.

The code is just experimental for function, not full optimized.

Architecture

Only 4 elementary modules implemented:

  • The conv, this module perform the convolution computing, the full connecting is also treated the same as convolution with the kernel size equal to input data size.
  • The max_pool
  • The relu
  • The iterator, jogging around the input data, and feed the computing units.

Demo

A LeNet is constructed using the 4 elementary modules, the weights and biases are hard coded in ROM.

The reference Tenserflow Lenet code is from CarND-LeNet-Lab .

Xilinx KCU105 Board, with HDMI input and output daughter boards is used.

Connect a PC to the HDMI input daughter through a HDMI cable.

A 32x32-size input is cropped from the PC screen output, then fed into the Lenet. The classified result is displayed on the HDMI output.

The following pic is cropped from the HDMI output of FPGA. The white rectangle is draw by FPGA. Move a Mnist digit picture into the rectangle, or draw a digit by hand using a Paint software. The printed digit under the rectangle is the the classified result.

Demo

Conclusion

  • Pure RTL hardware design is not a good choice for neural networks. Especially for large scale networks, the weights and intermediate results need to be stored in external memory. And the data iterator will be more complex. It's better to use a general or specific processor to do the control works, and let the hardware to perform computing.

Reference

CarND-LeNet-Lab .

Author

LulinChen
[email protected]

cnn_open's People

Contributors

lulinchen avatar

Stargazers

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

Watchers

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

cnn_open's Issues

How to start the porject?

Hi, I very happy I found a person project same as like me. Your project is very help for me as a reference..
BTW, how can i open your project for your source files by using vivado? I mean where is the directory. Thank for you help

prediction accuracy

Hi, may I ask that how much accuracy your project can achieve ? Any reply will be appreciated.

How to start your project and verify this result?

Hello, I am a beginner in Vivado and FPGA.
So I encountered some difficulties, I got an error when run lenet_ku.tcl, like
"Design fails in opt_design with a black-box error"

Whether after run tcl is

  1. File -> Import -> Export Hardware
  2. File -> Launch -> Launch SDK

And the question is what is your version of vivado ?

Thank you !!

syntax errors

Hello! There are many syntax errors in the cnn.v module, as shown in Figures 1, 2, and 3
fig1:
image

fig2:
image

fig3:
image
fig4:
image

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.