1. System Requirements

  1. Machine : x86

  2. OS: Ubuntu 15.04 or higher

  3. Docker


Prerequisites for Docker

https://phoenixnap.com/kb/how-to-install-docker-on-ubuntu-18-04

  • Ubuntu 18.04 64-bit operating system

  • A user account with sudo privileges

  • Command-line/terminal (CTRL-ALT-T or Applications menu > Accessories > Terminal)

sudo apt-get update //Update Software Repositories

//Uninstall Old Versions of Docker

sudo apt-get remove docker docker-engine docker.io


//Install Docker on Ubuntu 18.04

sudo apt install docker.io


//Start and Automate Docker

sudo systemctl start docker //Start and Automate Docker

sudo systemctl enable docker

sudo docker --version

Docker version 19.03.5, build 633a0ea838


2. DLtrain to train CNN model


Step 1

///// Create a Folder in your directory of choice

mkdir DLtst

cd DLtst


Step 2

///// Get “Images” Folder

///// Get network_prop.txt file ( CNN model file )

////// Get NewNetwork.dat file ( CNN model with coefficients after training )

///// above mentioned three items from following google drive location

https://drive.google.com/file/d/1boFblEpEMqoHGeV13rPDZPpW6GKVVLDL/view?usp=sharing

(above file is located in google drive and click on above link will send me request email.

After receive request email, i will send share acceptance )

Get FilesdordLtrain.zip file from above link


Step 3

unzip FilesdordLtrain.zip in this current working directory

After unzip in working folder following will be present

/DLtst/Images/images-ubyte

/DLtst/Images/labels-ubyte

/DLtst/network_prop.txt

/DLtst/NewNetwork.dat


Step 4

/////PULL image “jkhome/dltrain:1.0.0” from Docker Hub

/DLtst$ sudo docker pull jkhome/dltrain:1.0.0

Successful pull results in the following

1.0.0: Pulling from jkhome/dltrain

171857c49d0f: Already exists

419640447d26: Already exists

61e52f862619: Already exists

4ac9b033c679: Pull complete

bf21ea76f89b: Pull complete

fcf360b180ac: Pull complete

043a8708b6d2: Pull complete

138c09806188: Pull complete

5e15a5a3d6b4: Pull complete

0978d35d7bc5: Pull complete

2cd4d5cea17d: Pull complete

Digest: sha256:94d71c05c716e7d234e66cfa51f58120d47b209aaf31b64676eff04b3e975868

Status: Downloaded newer image for jkhome/dltrain:1.0.0

docker.io/jkhome/dltrain:1.0.0


Step 5

///// use following command to train CNN model given in network_prop.txt

/// Note ..user can change content in file network_prop.txt with their CUSTOM model

/DLtst$ sudo docker run --rm -it jkhome/dltrain:1.0.0 -m train -s NewNetwork.dat -c network_prop.txt -n 2000 -e 3


Following provides information about each variable in the above command.

  1. -m train or infer

  2. -s save model in given file

  3. -c Model configuration in txt file

  4. -e number of epochs

  5. -n number of images

  6. -d /Images


Successful execution of the above will result in the following

jj1

jj2

Loaded 2000 image data!

jj3

jj4

jj5

jj6

Constructed required matrices.

Loaded network successfully!

1% | Epoch left: 2

2% | Epoch left: 2

3% | Epoch left: 2

4% | Epoch left: 2

5% | Epoch left: 2

6% | Epoch left: 2

7% | Epoch left: 2

etc



3. DLtrain to perform Inference


Step 1

///// use following command to perform inference on given 14 images

/DLtst$ sudo docker run --rm -it jkhome/dltrain:1.0.0 -m infer -s NewNetwork.dat -c network_prop.txt -n 14


Successful execution of the above will result in the following

Loaded 14 image data!

jj3

jj4

jj5

jj6

Constructed required matrices.

Loaded network successfully!

Running inference on 14 images.Number: 5 | Guessed: 7 | Accuracy: -nan

Number: 0 | Guessed: 0 | Accuracy: 100

Number: 4 | Guessed: 4 | Accuracy: 100

Number: 1 | Guessed: 1 | Accuracy: 100

Number: 9 | Guessed: 4 | Accuracy: 75

Number: 2 | Guessed: 4 | Accuracy: 60

Number: 1 | Guessed: 1 | Accuracy: 66.6667

Number: 3 | Guessed: 3 | Accuracy: 71.4286

Number: 1 | Guessed: 1 | Accuracy: 75

Number: 4 | Guessed: 4 | Accuracy: 77.7778

Number: 3 | Guessed: 3 | Accuracy: 80

Number: 5 | Guessed: 1 | Accuracy: 72.7273

Number: 3 | Guessed: 0 | Accuracy: 66.6667

Number: 6 | Guessed: 6 | Accuracy: 69.2308