The goal is to apply LeNet-5 on minist data and predict the handwritten digits. The preview of data follows:
Download the following :
- clone or download the repository and run le-net5.py
le-net5.py
LeNet-5 comprises of 7 layers, not counting the input layer as you can see in the graph above. MNIST images are 28x28 pixels which is smaller than what LeNet-5 expects 32x32 pixels. An easy solution to that is just to pad the images with zeros to bring the MNIST images size up to 32x32 pixels.
- Convolution #1. Input = 32x32x1. Output = 28x28x6 conv2d
- SubSampling #1. Input = 28x28x6. Output = 14x14x6. SubSampling is simply Average Pooling so we use avg_pool
- Convolution #2. Input = 14x14x6. Output = 10x10x16 conv2d
- SubSampling #2. Input = 10x10x16. Output = 5x5x16 avg_pool
- Fully Connected #1. Input = 5x5x16. Output = 120
- Fully Connected #2. Input = 120. Output = 84
- Output 10
- Train accuracy: 0.9979
- Test accuracy: 0.9876