Giter VIP home page Giter VIP logo

hls-cnn's Introduction

HLS-CNN

High Level Synthesis of a trained Convolutional Neural Network for handwritten digit recongnition.

Related work

This project uses many concepts coming from a previous work that can be found here. The main difference is that our implementation is written for Vitis HLS version 2020.2 (patched).

Slides

Project presentations for the "Embedded Systems" master course at University of Parma: FS presentation and GB presentation.

Code structure and workflow

If you are not iterested in fiddling with the network architecture and you just want to try to export an RTL description as IP, you can ignore the steps from 1 to 4 and jump directly to step 5 to generate the Vitis-HLS project (the use of Python code is not strictly necessary because a the Python-generated output is already present in Code/02-Data and Code/03-Headers folders).

Code/01-Python:

Contains Python source code to do:

  • Model definition, training and evaluation.
  • Exportation of (trained) network weights and architecture through C header files.
  • Generation of input and expected output for HLS testbench.

Code/02-Data:

  • Training images (generated using Python).

Code/03-Headers:

  • C header files containing network architecture and weights (generated using Python).

Code/04-C:

  • Replication of the trained network in C (using headers in Code/03-Headers).

Code/05-Vitis-HLS:

  • Translation from C to C++ and code refactoring to take advantage of Vitis HLS pragma and directives.

Future work

  • Find a way to share the input image between the different streams instead of duplicating it; this will reduce the memory requirements of the target board.
  • Improve network architecture to reduce hardware requirements without sacrificing performances and/or accuracy.

Warning

C/C++ code of this project is designed to generate an RTL description that meets ambitious performance requirements through pipelining and parallelism. To achieve this objective, we wrote specific and non-parametric code and, as a consequence, non-trvial changes to the network architecture (such as adding or removing layers) are not automatically propagated to the rest of the project.

hls-cnn's People

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.