Skip to content

KevinChen880723/NNAcceleratorLib_HLS

Repository files navigation

NNAcceleratorLib_HLS

Introduction to the Project

The project implements a library of some common neural network layers: Convolution, ReLU, Max-Pooling, and Fully connected layers. The library can construct the neural network accelerator on the PYNQ-z2. Besides, to validate the correctness of the library, the project implements a hello world model MNIST by this library. The experiment result shows that using the library can achieve 665 FPS with the correct results!

Architecture

For the interface between PS and PL, I used AXI-Master interface. The system was developed by the concept of dataflow, which enables the kernel to run efficiently (Each layer does not need to wait until the previous module finished). In order to transfer the array data received from AXI-Master to the dataflow stream, I used ReadMem and WriteToMem blocks to transform.

Convolutional Layers

In order to make the convolutional layer run in a streaming way, I used the concept of "Line Buffer" to implement the one-channel convolution. In this way, the convolutional layer can process the data whenever it receives a new pixel. After building the one-channel convolution, I implement three-dimensional convolution by sequentially working on every channel.

Block Design

Inference Results

PYNQ-z2 spent 1.5ms to inference on an image and successfully got the correct prediction. Except for the one image testing, I also tested the project on the testing set, and the accuracy achieved 98.55667%!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published