Skip to content

Image classification using Keras and implement forward pass using Python(only numpy) and C++ for FPGA

Notifications You must be signed in to change notification settings

atifkarim/Traffic-Signal-Classification-using-Keras-and-CPP

Repository files navigation

Image-classification

Image classification using KERAS and conversion of trained model for forward pass using Python(without using any deep learning library) and C++ to reduce the classification time

Motivation
The objective of the task is to classify image using CNN and then implement the testing part/forward pass on FPGA using VHDL. As FPGA works with VHDL and don't support API of the CNN framework so I have tried to implement the Forward Pass using only Numpy library in Python and then convert it into C++. Priliminay, the work stands only for Grayscale Image. Padding hasn't used here. I have also choosen a minimum layer model(1 convolution layer and Dense layer). As dataset GTSRB image is used which anyone can download from here.

Any contribution is highly appreciated.

Requirements:
A requirements.txt file is added
In Ubuntu 16.04 I have tested it.

Introduction of source code
1/ Keras training and testing file is where for which a configuration is also introduced.
2/ After getting the traioned model from number 1 step this file will assist to fetch the information from the model file and store them in a text file which will be used later for doing the classification of image. This file consist no deep learning library.
3/ Now the C++ part.

Update: 11 January, 2019

Python code for training and testing(using keras API & scratch Numpy) is working flawlessly.

Check for training -- train_image_keras.py Check for testing -- classify_image.py

Update 12 January, 2019

Work for converting "classify_image.py" to cpp has started. FIle name --- image_classification_with_cpp.cpp

Update 15 January, 2019

Work to make a complete C++ project for the classification. Name -- keras_to_cpp_forward_pass/classify_image_with_cpp

Update 16 January, 2019

Preprocess image with OpenCV for CPP and Python

Update 27 January, 2019

Calculated time for each step of classification

About

Image classification using Keras and implement forward pass using Python(only numpy) and C++ for FPGA

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published