Skip to content

Simple application for digit recognition with CNN using four different datasets

License

Notifications You must be signed in to change notification settings

FurkanOM/cnn-digit-recognition

Repository files navigation

CNN Digit Recognition

Simple application for digit recognition with CNN using four different datasets.

  • ARDIS-IV - The Swedish Dataset of Historical Handwritten Digits link

  • MNIST Database of Handwritten Digits link

  • ORHD - Optical Recognition of Handwritten Digits Data Set link

  • SVHN - Street View House Numbers Cropped Digit Dataset link

Usage

Project models created in virtual environment using miniconda. You can also create required virtual environment with conda

Environment with tensorflow 2:

conda env create -f environment.yml

Environment with tensorflow 2 without GPU support:

conda env create -f environment-without-gpu.yml

You can use the version you want for training as follows. Valid versions => ["v1", "v2"], default version is "v2"

python trainer.py --version {version}

If you have GPU compatibility issues like in here. You can use gpu compatibility flag for handle this issue: -handle-gpu

python trainer.py --version v2 -handle-gpu

Experimental Results

Using v1 model

Trained with Dataset Test Accuracy on ARDIS Test Accuracy on MNIST Test Accuracy on ORHD Test Accuracy on SVHN
ARDIS 0.98 0.54 0.63 0.15
MNIST 0.64 0.99 0.72 0.28
ORHD 0.31 0.25 0.97 0.13
SVHN 0.25 0.59 0.45 0.90
Trained with 2 Dataset Test Accuracy on ARDIS Test Accuracy on MNIST Test Accuracy on ORHD Test Accuracy on SVHN
ARDIS+MNIST 0.97 0.99 0.73 0.19
ARDIS+ORHD 0.98 0.56 0.99 0.17
ARDIS+SVHN 0.95 0.76 0.52 0.90
MNIST+ORHD 0.69 0.99 0.98 0.28
MNIST+SVHN 0.60 0.99 0.64 0.90
ORHD+SVHN 0.31 0.60 0.97 0.89
Trained with 3 Dataset Test Accuracy on ARDIS Test Accuracy on MNIST Test Accuracy on ORHD Test Accuracy on SVHN
ARDIS+MNIST+ORHD 0.98 0.99 0.98 0.22
ARDIS+MNIST+SVHN 0.96 0.99 0.69 0.88
ARDIS+ORHD+SVHN 0.97 0.77 0.96 0.86
MNIST+ORHD+SVHN 0.63 0.99 0.98 0.90
Trained with 4 Dataset Test Accuracy on ARDIS Test Accuracy on MNIST Test Accuracy on ORHD Test Accuracy on SVHN
ARDIS+MNIST+ORHD+SVHN 0.97 0.99 0.98 0.90

Using v2 model

Used number of filters/kernels increased

Trained with Dataset Test Accuracy on ARDIS Test Accuracy on MNIST Test Accuracy on ORHD Test Accuracy on SVHN
ARDIS 0.99 0.76 0.77 0.18
MNIST 0.85 0.99 0.77 0.22
ORHD 0.39 0.31 0.98 0.11
SVHN 0.32 0.65 0.68 0.93
Trained with 2 Dataset Test Accuracy on ARDIS Test Accuracy on MNIST Test Accuracy on ORHD Test Accuracy on SVHN
ARDIS+MNIST 0.98 0.99 0.85 0.24
ARDIS+ORHD 0.99 0.79 0.99 0.23
ARDIS+SVHN 0.99 0.85 0.72 0.93
MNIST+ORHD 0.90 0.99 0.99 0.24
MNIST+SVHN 0.86 0.99 0.72 0.94
ORHD+SVHN 0.48 0.71 0.98 0.93
Trained with 3 Dataset Test Accuracy on ARDIS Test Accuracy on MNIST Test Accuracy on ORHD Test Accuracy on SVHN
ARDIS+MNIST+ORHD 0.98 0.99 0.99 0.24
ARDIS+MNIST+SVHN 0.98 0.99 0.67 0.93
ARDIS+ORHD+SVHN 0.98 0.82 0.99 0.90
MNIST+ORHD+SVHN 0.87 0.99 0.99 0.93
Trained with 4 Dataset Test Accuracy on ARDIS Test Accuracy on MNIST Test Accuracy on ORHD Test Accuracy on SVHN
ARDIS+MNIST+ORHD+SVHN 0.99 0.99 0.99 0.94