Coder Social home page Coder Social logo

convolution_network_on_fpga's Introduction

convolution_network_on_FPGA

The repository is part of my graduation project, but focusing on convolution network inference acceleration on FPGA.

Description

The project was built with ISE 14.7 software and vertix-7 FPGA. It performs a 7-layer network forward computation with certain accelerating strategies. First, train a SAR target classification network on MSTAR dataset with MatConvNet and use early-stop. Then, transform the weights and inputs to FPGA using COE files generated by Matlab. Next, design native verilog-written models to fulfil the forward computation. The system uses 16-bit fix-point data to maintain precision. The result proves that it costs less than 1ms per image, outperforming other computing platforms.

Acceleration

For trade-off between FPGA resource and speed, the first conv. layer uses shift-register structures for acceleration, considering that the size of inputs and weights in the first conv. layer are larger. The other conv. layers only uses pipe-line structures. Note that there are 18 files named with m_conv_1, indicating 18 shift-registers in the first conv. layer.

For the limit of bandwidth, the second conv. layer uses channel-grouping parallelization scheme. I used v7-415t and v7-485t FPGA for comparisons, which use different group numbers (4 vs 1) according to their different amounts of resource. You may notice the scheme in the file CNN_top.v, with the signal 'ram_ready' which controls the channel grouping and merging.

convolution_network_on_fpga's People

Contributors

hunterlew 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

convolution_network_on_fpga's Issues

使用的芯片是啥

你好:
对fpga感兴趣,正在调研
请问你用的fpga板子大概多少钱,是什么芯片
它跑forward的速度能更具体的描述吗,比如多大的图片,和gtx1080比较性能上是多少倍的关系
方便的话能加个微信啥的吗?
非常感谢!

池化层

楼主,你好,请问你的max_output中,为什么判断完cnt==11后,还要执行cnt<=11,这样cnt不就一直保持11,不再变化了吗,可以详细解释一下嘛

bias_mult乘法器

比如这里bias_mult3 u2(.clk(clk_in),.ce(~rst_n),.p(bias),.a(ind_cnt2));只有输入a 呀。请问是乘了一个固定的数吗?这个固定的数在那几个bias_mult模块里面各是多少呀!

烧录板子

楼主,你好,请问怎么烧录到板子里?不需要约束文件吗?

Help regarding compiling the source files

Hello Sir
When i am trying to compile the source files present in the "v7-415t_0.5ms" directory, I am getting the following error:
ERROR:HDLCompiler:1654 - "C:/Users/TEJAS/Documents/convolution_network_on_FPGA-master/v7-485t_0.3ms/m_layer_input_0.v" Line 65: Instantiating <u1> from unknown module <im_in> ERROR:HDLCompiler:1654 - "C:/Users/TEJAS/Documents/convolution_network_on_FPGA-master/v7-485t_0.3ms/m_conv_1_1.v" Line 302: Instantiating <m1> from unknown module <mult_16> ERROR:HDLCompiler:1654 - "C:/Users/TEJAS/Documents/convolution_network_on_FPGA-master/v7-485t_0.3ms/m_layer_input_1.v" Line 170: Instantiating <u1> from unknown module <clk_div> ERROR:HDLCompiler:1654 - "C:/Users/TEJAS/Documents/convolution_network_on_FPGA-master/v7-485t_0.3ms/m_layer_input_2.v" Line 198: Instantiating <u2> from unknown module <bias_mult3> ERROR:HDLCompiler:1654 - "C:/Users/TEJAS/Documents/convolution_network_on_FPGA-master/v7-485t_0.3ms/k2_out.v" Line 70: Instantiating <u1> from unknown module <k_ind_mult> ERROR:HDLCompiler:1654 - "C:/Users/TEJAS/Documents/convolution_network_on_FPGA-master/v7-485t_0.3ms/m_layer_input_3.v" Line 183: Instantiating <u2> from unknown module <bias_mult4> ERROR:HDLCompiler:1654 - "C:/Users/TEJAS/Documents/convolution_network_on_FPGA-master/v7-485t_0.3ms/m_layer_input_4.v" Line 146: Instantiating <u1> from unknown module <m_max_4_ram> ERROR:HDLCompiler:1654 - "C:/Users/TEJAS/Documents/convolution_network_on_FPGA-master/v7-485t_0.3ms/k3_out.v" Line 73: Instantiating <u1> from unknown module <k_ind_mult2> ERROR:HDLCompiler:1654 - "C:/Users/TEJAS/Documents/convolution_network_on_FPGA-master/v7-485t_0.3ms/m_layer_input_5.v" Line 97: Instantiating <u1> from unknown module <m_conv_5_ram> ERROR:HDLCompiler:1654 - "C:/Users/TEJAS/Documents/convolution_network_on_FPGA-master/v7-485t_0.3ms/m_fc.v" Line 96: Instantiating <u1> from unknown module <k_ind_mult3>
Can you please tell me if these modules are missing from the source or they are IPs.If they are IPs , please tell me the mames of those.
Thanks

模块说明

能给下k_ind_mult u1(.clk(clk_in),.ce(~rst_n),.p(addr_k_tmp),.a(k_ind));的模块说明吗?这个没看懂,乘法器有这样的?

反向传播代码

您好,想请问下有网络训练的反向传播过程的Matlab代码吗?

方便私下交流一下吗?

您好,您的分享很棒。在Vivado上面跑通了。有些关于优化代码以及算法的问题,想请教您,不知方便不?
微信:chenyirora。期待!!!

求问两个例化是什么意思

m_layer_input_1.v中,例化的bias_mult2,和ind_conv_in代表什么意思?
m_layer_input_1.v 进行的是什么处理,看了好久,没太看明白,加偏置? 为什么注释里还有“索引做乘法” 这边做乘法是什么意思呢,希望大佬能给讲一下这个程序的思路,缺失两个例化,实在是不懂
谢谢啦

例化模块

你好,计算索引的几个例化模块再文件夹里找不到

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.