Skip to content

A resource-efficient VHDL-based framework for deploying CNNs and Feedforward Networks on FPGAs, featuring core modules, MNIST examples, and hardware-specific optimizations.

License

Notifications You must be signed in to change notification settings

one-ware/AI2VHDL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FPGA Neural Network Implementation Framework

This repository contains VHDL implementations and examples for deploying Convolutional Neural Networks (CNNs) and Feedforward Neural Networks on FPGAs. It is designed to facilitate resource-efficient, scalable AI solutions for image recognition tasks.


Overview of Repository

The repository is structured into the following directories:

1. VHDL

This directory contains universal VHDL modules for implementing neural networks. It includes:

  • Core Library: Modular VHDL files for building and deploying CNNs and Feedforward Networks.
  • Example Projects: Demonstrations of how to use the VHDL modules, including an MNIST-based digit recognition example.

2. Examples

Contains sample configurations and datasets for testing and deploying neural networks on FPGAs:

  • MNIST:
    • Predefined configurations and parameters.
    • A main file for forming and deploying a digit recognition network.
  • Other Examples: Feel free to add your own examples.

Highlights of the MNIST Project

Purpose

The MNIST example demonstrates a basic neural network for handwritten digit recognition, fully implemented on an FPGA. It serves as a foundational model for understanding and extending the VHDL framework.

Components

  1. Configuration File: Define network architecture and parameters.
  2. VHDL Implementation: The network logic implemented for FPGA deployment.
  3. Data File: Pre-trained weights and biases for implementation.

Key Features of the Framework

Universal VHDL Modules

  • Modular design to build and customize neural networks.
  • Optimized for sequential calculations to minimize resource usage.

FPGA-Specific Optimization

  • Designed for efficient data flow without complex skip connections (like Yolo).
  • Supports convolutional layers, max-pooling, and dense layers (at the moment).
  • Parameterizable layer configurations (e.g., filter size, stride).

Scalability

  • Adaptable for various FPGA sizes and applications.
  • Sequential computation allows resource-constrained implementations.

Training Recommendations

To achieve optimal network performance, consider the following:

  1. Data Augmentation: Use techniques such as rotation, flipping, and contrast adjustment to improve generalization.
  2. Preprocessing: Simplify input data where possible (e.g., grayscale conversion, resolution reduction).
  3. Label Simplification: For tasks like segmentation, minimize output complexity by predicting key points or simplified outputs.

FPGA Deployment Tips

When designing FPGA-specific networks:

  1. Avoid complex architectures with skip connections like in Yolo or V-Net.
  2. Prefer convolutions over dense layers for generalized feature extraction.
  3. Utilize straightforward parallel data flow for efficient implementation.
  4. Use layer configurations like 1x1, 3x3, or 1xN convolutions for optimal balance between accuracy and resource usage.

Getting Started

Requirements

  • FPGA with sufficient resources for the intended application.
  • Toolchain compatible with VHDL files (e.g. Quartus).


Contributing

We welcome contributions to improve this repository! Here are some areas where your help would be greatly appreciated:

  1. Bug Fixes: If you encounter any issues or errors, feel free to report them or submit a pull request with a fix.

  2. Additional Features: Help expand the framework by:

    • Adding support for more neural network layers or architectures.
    • Developing modules to optimize implementation for specific FPGA hardware.
    • Creating tools for real-time weight updates or efficient weight initialization.
  3. New Examples: Contribute examples that showcase additional use cases, such as:

    • Image recognition for other datasets or tasks.
    • Applications tailored to specific industries.
  4. Documentation: Enhance the documentation to make the framework easier to use and more accessible for newcomers.

If you’d like to contribute, fork the repository, make your changes, and submit a pull request. For larger contributions, please open an issue first to discuss your ideas.


Together, we can make this framework more versatile and powerful for FPGA-based neural network implementations!

About

A resource-efficient VHDL-based framework for deploying CNNs and Feedforward Networks on FPGAs, featuring core modules, MNIST examples, and hardware-specific optimizations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages