You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: Optimizes a Neural Network for the MNIST dataset on an FPGA using HLS4ML, focusing on area reduction via pruning and quantization, implemented in a Jupyter notebook on Ubuntu.
Institution: University of Thessaly (UTH), Volos, Greece.
Purpose: Bridges ML and FPGA design, achieving low-latency, low-power edge deployment with minimal accuracy loss.
Dataset
MNIST: 60,000 training and 10,000 test images of handwritten digits (28x28, 256 gray levels), split 90% training, 10% validation.
Methodology
Setup Dataset
Description: Load MNIST via TensorFlow Datasets, split into train/validation/test sets, and visualize training examples for inspection.
Model
Description: CNN with Input (28x28x1), 3x[Conv2D-ReLU-MaxPooling], 2x[Dense-ReLU], Dense-Softmax. Flattens input, extracts features via convolution, and classifies across 10 digits.
Training
Description: Train for 30 epochs, batch size 1024, using categorical crossentropy loss and Adam optimizer (lr=0.003) on MNIST training data.
Compilation
Description: Convert Keras model to HLS with HLS4ML, setting 16-bit fixed-point precision, latency strategy, reuse factor 1, and io_stream interface. Compile to C++ for FPGA synthesis.
Synthesis
Description: Build HLS model using Vivado 2019.1, skipping C simulation, running HLS and Vivado synthesis to produce an FPGA-ready bitstream.
Optimizations
Pruning
Description: Apply 50% sparsity to Conv2D/Dense layers (excluding output) over 10 epochs using TensorFlow Model Optimization. Gradually prune via PolynomialDecay for minimal accuracy impact.
Quantization
Description: Reduce precision to 6-bit using QKeras (QConv2DBatchnorm, QActivation) on weights/biases, enhancing efficiency for edge devices with QAT support.