Wednesday, May 19, 2010

FPGA-based Artificial Neural Network

This is my Digital System Design course project, collaborated with James.

Abstract
Artificial Neural Networks (ANN) are non-linear statistical data modeling tools, often used to model complex relationships between inputs and outputs or to find patterns in data. In this project, a generic hardware based ANN is designed and implemented in VHDL. This three-layer ANN is implemented entirely with 32-bit single precision floating point arithmetic to guarantee flexibility and accuracy for its wide range of applications. The ANN supports reconfigurable numbers of perceptron per layer as well as supervised learning through back propagation. Mean squared error is used to measure the quality of learning as part of the Built-in Self-Test (BIST). An rudimentary example application is implemented to demonstrate the capability of the ANN on an Altera DE2 FPGA board. The example application is a fully functional pattern recognizer, built by utilizing the ANN. This classifier is trained to identify letters on a 4x4 binary grid populated by a user through 16 toggle switches. The most probable class suggested by the ANN is displayed on a LCD screen.

Demonstration

Altera DE2 Board


Input Recognized as Pattern A


Neural Network Training


Input Recognized as Most Likely Pattern A


Input Recognized as Pattern Z

Source
VHDL source code is available here:
https://github.com/ziyan/altera-de2-ann

Project final report is available here:
https://github.com/ziyan/altera-de2-ann/raw/master/doc/finalreport.pdf

21 comments:

  1. sir, can u help me in coding for FPGA based NN implementation using VHDL?

    ReplyDelete
  2. I CAN'T COMPILE YOUR PROGRAM SUCCESSFUL
    I SEE THIS ERRORE IS COMMAND LINE:
    LCD_DATA <= "000" & cg(i)(39 - j * 5 downto 35 - j * 5);
    I USE QUARTUS 9.0 VERSION FULL
    YOU CAN HELP ME PLEASE!
    YOU CAN EXPLAINS FOR ME

    ReplyDelete
  3. I SET FILE NAME: DE2 IS TOP-LEVEL

    ReplyDelete
  4. Sir,
    I am working on a project of NURAL NETWORK so can u provide me VHDL code for neural network...
    thanks

    ReplyDelete
  5. @amit The source is linked in the post.

    ReplyDelete
  6. sir,

    i am designing a IDS using BpNN

    i have got quartus web edition 5.1 and cyclone III kit.

    how to make use of your code and can you please help me sir.

    ReplyDelete
  7. Sir,
    I'm familier with verilog, I don't know VHDL. I have to do a project in ANN. It will be very useful if you give the verilog code of the above project if you have it.

    ReplyDelete
  8. @dharshika Sorry, this was a school project. It is provided AS-IS. And it seems so long ago now too. :)

    ReplyDelete
  9. I need to implement neural network in FPGA using VHDL code. hoe to do it can u pls suggest me

    Thanks,
    Arunaa

    ReplyDelete
  10. I also need to know how to give inputs to the kit and see output in LCD

    Thanks,
    Arunaa

    ReplyDelete
  11. I tried compiling the program but I have an error which says "Library unit lpm is not available in library work". Please help me out on this.Thanks in advance.

    ReplyDelete
    Replies
    1. what you have done after this error? actually I am also facing similar error. thanks in advance.

      Delete
  12. I greatly appreciate your work and help. I am trying to compile the above project but I get an error "library missing Lpc file". It wud be of gr8 help if you could suggest me how to proceed further. Thanks in advance

    ReplyDelete
  13. Sir,Can you please help me with the complete VHDL code fo this same neural network to be used in XILINX spatran 3e FPGA kit

    ReplyDelete
  14. sir i need a code simulation artificial neural network using XoR function

    ReplyDelete
  15. sir i need a code for simulation artificial neural network using XoR function.... plz help me out

    ReplyDelete
  16. Ziyan,

    thank you for posting the source code! I've been looking for this all over the net.

    Do you know of any other FPGA source code for ANNs on the web? I am learning FPGA implementations of ANNs and would like some alternatives to start form. I'd appreciate if you could share some links.

    Cheers!

    ReplyDelete
  17. I cannot find the source code when I look at: http://svn.ziyan.info/svn/dsd/trunk/src/
    Are the VHDL files still available for download?
    Cheers,
    Matt

    ReplyDelete
    Replies
    1. Yes. They are at https://github.com/ziyan/altera-de2-ann now.

      Delete
  18. I dont find lpm library, can you post it? because when I do synthesis, I got an error is " Library lpm cannot be found." and "Library unit lpm is not available in library work." from where we can get these libraries?

    ReplyDelete