Skip to content

4daJKong/Keras_LeNet-5_model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keras_LeNet-5_model

A simple CNN model based on Keras API

Introduction

I followed and implemented the LeNet-5 CNN architecture by Keras API, then trained the model by MNIST dataset. The test loss is 0.035 and the test accuracy is 0.989 after evaluating.(For more specific training and testing process, it is on 2DCNN_MNIST_digit.py) After that, I serach some digits verification code on the internet and decide to get further result on the performance of my model. Unfortunately, the performance is not good. I guess the main problem is the difference between MNIST and other digits in their art styles.

The architecture and parameters of LeNet-5 CNN

lenet-5_arch


Layer (type) Output Shape Param #
conv2d (Conv2D) (None, 28, 28, 6) 156
average_pooling2d (AveragePooling2D) (None, 14, 14, 6) 0
conv2d_1 (Conv2D) (None, 10, 10, 16) 2416
average_pooling2d_1 (Averag ePooling2D) (None, 5, 5, 16) 0
flatten (Flatten) (None, 400) 0
dense (Dense) (None, 120) 48120
dense_1 (Dense) (None, 84) 10164
dense_2 (Dense) (None, 10) 850

Total params: 61,706
Trainable params: 61,706
Non-trainable params: 0


MNIST handwritten digit dataset

MNIST

The prediction result of digit verification code by Lenet-5 model

predict_digit

Requirements:

Software Version
Python 3.9.9
Numpy 1.21.4
tensorflow 2.7.0
keras 2.7.0
matplotlib 3.5.0

Citation:

Y. Lecun, L. Bottou, Y. Bengio and P. Haffner, "Gradient-based learning applied to document recognition," in Proceedings of the IEEE, vol. 86, no. 11, pp. 2278-2324, Nov. 1998, doi: 10.1109/5.726791.

About

A simple CNN model based on Keras API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages