# CNN-Implementation-in-Verilog
**Repository Path**: ynxing/CNN-Implementation-in-Verilog
## Basic Information
- **Project Name**: CNN-Implementation-in-Verilog
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-02-19
- **Last Updated**: 2025-02-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# CNN Implementation in Verilog
> Implementation of Convolution Neural Network using Python & Verilog
성균관대학교 소프트웨어학과 & 전자전기공학부 강보영 졸업작품
## Environment Setting
### Python Installment
https://www.python.org/
### Anaconda Installment
https://www.anaconda.com/
### PyTorch Installment
https://pytorch.org/
파이토치는 앞서 설치한 아나콘다 버전/OS/플랫폼에 따라 다르므로 위 링크에서 확인 후 설치합니다.
```sh
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge
```
설치 후 아나콘다 프롬프트에서 버전 확인이 가능하다.
```sh
import torch
torch.__version__
```
### Modelsim Installment
https://eda.sw.siemens.com/en-US/modelsim-student-edition-unavailable/
해당 프로젝트는 21.2 버전 환경에서 개발되었다.
## MNIST DataSet Learning using PyTorch
채택한 CNN의 구조는 아래의 2-Layer이며, 파라미터는 아래와 같이 설정하였다.
+ Batch Size = 64
+ Training Epoch = 10
+ Learning Rate = 0.01
+ Optimizer = Stochastical Gradient Descent (Momentum = 0.5)
+ Activation Function = ReLU
학습 결과 96.29%의 적중률을 보였다.
## Verilog Design
### Block Diagram
### Simulation Waveform
+ Single MNIST dataset input
단일 MNIST 입력데이터에 대해 100MHz 동작 클럭에서 13335ps에서 인식에 성공하였다. 총 1335 클럭이 소요되었다.
+ Multiple random MNIST dataset input
연속적으로 1,000개의 MNIST 입력데이터를 랜덤하게 입력하였을 때, 1000번 중 920번이 적중하여 92%의 적중률을 갖는다.
