Intel® AI / Colfax TASS Trainer

Adam Milton-Barker

Adam Milton-Barker

Bangor, Wales

6 0
  • 0 Collaborators

Build and train a convolutional neural network that can identify Darth Vader & Yoda on the Intel AI Devcloud (Colfax) ...learn more

Project status: Published/In Market

Internet of Things, Artificial Intelligence

Groups
DeepLearning, Artificial Intelligence Europe, Internet of Things

Intel Technologies
AI DevCloud / Xeon, Intel Opt ML/DL Framework

Code Samples [1]

Overview / Usage

Introduction
There have been many versions of the TASS computer vision projects over the years, one being a version built on a Raspberry Pi 3 using a program based on the Tensorflow Inception V3 transfer learning example.

The Colfax TASS Trainer replicates the transfer learning side of the original program and is trained on the Intel AI HPC Cluster (Colfax Cluster).

Access to Intel’s Ai DevCloud is free, just register on the Intel AI DevCloud website and you will get free access to the cloud within 48 hours.

https://software.intel.com/en-us/ai-academy/tools/devcloud

Methodology / Approach

Cloning The Repo
You will need to clone this repository to a location on your development terminal. Navigate to the directory you would like to download it to and issue the following commands.

$ git clone https://github.com/TechBubbleTechnologies/IoT-JumpWay-Intel-Examples.git
Once you have the repo, you will need to find the files in this folder located in this location

Install Requirements
Everything for this tutorial is already provided on Colfax.

Login To Colfax
Login to your Colfax Notebook area by following this link.

Upload Structure To Colfax
Once you have completed the steps above, it is time to login to Colfax and upload the structure described above. You need to upload all of the files shown in the screen shot below, with exception to the README.

Training & Testing Data

You can train and test this example without finding any additional training and testing data, but if you would like to add your own classes you will find the training data in the training/human directory.

The test data provided (Collected from Google) has two classes, 1 and 2, these folders represent Darth Vader and Yoda, in these directories (classes) are 30 images of each character, directory 1 represents Darth and directory 2 represents Yoda.

You can name these directories what you like, the name of the directory will be used in the predictions, so if the program detects Darth in an image it will return 1 as the highest prediction.

You can add as many as classes as you like, each class will slow the training down. Each class should have no less than 30 images, generally any more than 25 but less than 30 will crash the script with devision by 0 right at the end of the training process.

Start The Training
Now it is time to start the training, head on over to Colfax TASS Trainer notebook on Colfax. You do not need to execute any of the code blocks except for the first until you get to "Create training job", here you can begin to execute the blocks of code following the guide which will submit a job to train TASS on the Colfax Clusters.

Testing The Trained Model
Now time for the crunch, again, you do not need to find any additional training to test this program, but if you do want to you can add more images to the model/testing directory. The testing data provided for out of the box use of this tutorial include 2 images of Darth, 2 of Yoda, and 2 of a very handsome guy ;)

Head on over to Colfax TASS Trainer Inference notebook on Colfax. You do not need to execute any of the code blocks except for the first until you get to "Create testing job", here you can begin to execute the blocks of code following the guide which will submit a job to test TASS on the Colfax Clusters.

The output for me was as follows:

TESTING FACIAL REC

FILE: Darth1.jpg
1 (score = 0.99834)
2 (score = 0.00164)

PROVIDED IMAGE: Darth1.jpg
OBJECT DETECTED: 1
CONFIDENCE: 0.998343
...

FILE: Darth2.jpg
1 (score = 0.99692)
2 (score = 0.00311)

PROVIDED IMAGE: Darth2.jpg
OBJECT DETECTED: 1
CONFIDENCE: 0.996923
...

FILE: Yoda2.jpg
2 (score = 0.99710)
1 (score = 0.00293)

PROVIDED IMAGE: Yoda2.jpg
OBJECT DETECTED: 2
CONFIDENCE: 0.997104
...

FILE: Yoda1.jpg
2 (score = 0.99535)
1 (score = 0.00465)

FILE: VeryHansomeGuy.jpg
2 (score = 0.72019)
1 (score = 0.27821)

FILE: VeryHansomeGuy2.jpg
2 (score = 0.59470)
1 (score = 0.40845)

COMPLETED TESTING FACIAL RECOGNITION

This means that Darth was identified in each image, Yoda in 1 and the program successfully identified me as an unknown person.

Technologies Used

Python Versions

  • Python 3 (Intel, 2018 update 1)

Software requirements

  • Intel Optimized TensorFlow (1.3.1)

Hardware requirements

  • Access to the Intel AI HPC Cluster (Colfax Cluster)

Repository

https://github.com/iotJumpway/IoT-JumpWay-Intel-Examples/tree/master/Intel-Colfax/Tass-Trainer

Comments (0)