Technical Manual(TM)

Similar documents
System and Software Architecture Description (SSAD)

Operational Concept Description (OCD)

Tensorflow v0.10 installed from scratch on Ubuntu 16.04, CUDA 8.0RC+Patch, cudnn v5.1 with a 1080GTX

CS234 Azure Step-by-Step Setup

Containers. Pablo F. Ordóñez. October 18, 2018

Docker Swarm installation Guide

Android Studio Setup Procedure

Homework 01 : Deep learning Tutorial

TENSORRT 4.0 RELEASE CANDIDATE (RC)

Gunnery Documentation

Singularity: container formats

Preparing Your Google Cloud VM for W4705

GPU Cluster Usage Tutorial

Installing Eclipse (C++/Java)

To install Oracle Java 8, first we will add a repository to our package manager so our usual system update will download the Oracle JDK8 installer.

TENSORRT 3.0. DU _v3.0 February Installation Guide

Infoblox Kubernetes1.0.0 IPAM Plugin

Software Installation Manual

TensorFlow-HRT. User Manual

SAS Event Stream Processing for Edge Computing 4.3: Deployment Guide

LIBQWQNG Version ComScire QNG Device Linux Driver

Tizen TCT User Guide

Linux Essentials Objectives Topics:

LGTM Enterprise System Requirements. Release , August 2018

coxtactoe Documentation

Updating the Oracle server for V5.2.1 manually IBM

Manual Install Package Rpm Linux Command Line

ganetimgr Documentation

Install and Configure wxwidgets on Ubuntu

Project 1 Setup. Some relevant details are the output of: 1. uname -a 2. cat /etc/*release 3. whereis java 4. java -version 5.

CHAPTER III PLANNING

Zephyr Kernel Installation & Setup Manual

Installation of Apache OpenMeetings on Ubuntu LTS. This tutorial is made based on fresh installations of. ubuntu desktop-amd64.

Transition Plan (TP)

DBNsim. Giorgio Giuffrè. 0 Abstract How to run it on your machine How to contribute... 2

An introduction to Docker

Hello, and welcome to another episode of. Getting the Most Out of IBM U2. This is Kenny Brunel, and

WES 237A Project Part 1 Guide

INTRODUCTION. To avoid the PHP7 conflicts use this OS image: STEP 1 - Parts List:

Archivists Toolkit Internal Database

Configure Sensu and other Actions to Register Clients

KVM Virtualization With Enomalism 2 On An Ubuntu 8.10 Server

MariaDB ColumnStore C++ API Building Documentation

DEVELOPMENT GUIDE VAB-630. Android BSP v

Installation of Apache OpenMeetings on Ubuntu LTS. This tutorial is made based on a fresh installations of

Prototype Report. Team 02. Member Name Role . Rajat Verma Project Manager, Lifecycle Planner, Dev

Zenoss Resource Manager Upgrade Guide

VIRTUALBOX UBUNTU EBOOK

OSM Hackfest Installation and first use. Gerardo García (Telefónica)

Running Kmeans Spark on EC2 Documentation

CUDNN. DU _v07 December Installation Guide

manifold Documentation

Trunk Player Documentation

How To Start Mysql Using Linux Command Line Client In Ubuntu

CROWDCOIN MASTERNODE SETUP COLD WALLET ON WINDOWS WITH LINUX VPS

Using ROS with RedHawk Linux on the NVIDIA Jetson TX2

Downloading and installing Db2 Developer Community Edition on Ubuntu Linux Roger E. Sanders Yujing Ke Published on October 24, 2018

TENSORRT. RN _v01 January Release Notes

Upgrade Tool Guide. July

Using DC/OS for Continuous Delivery

Introduction to Linux

Manual of SPCI (structural and physico-chemical interpretation) open-source software version 0.1.5

TrinityCore Documentation

Platform Migrator Technical Report TR

Technical Manual. Software Quality Analysis as a Service (SQUAAD) Team No.1. Implementers: Aleksandr Chernousov Chris Harman Supicha Phadungslip

USING NGC WITH GOOGLE CLOUD PLATFORM

turbo-hipster Documentation

EnhancedEndpointTracker Documentation

Oracle WebCenter Portal Jump Start Kit (JSK) Readme for Linux 64-bit Operating Systems

Installing Open Project on Ubuntu AWS with Apache and Postgesql

Installation Instructions

CircuitPython with Jupyter Notebooks

TENSORFLOW. DU _v1.8.0 June User Guide

DGX-1 DOCKER USER GUIDE Josh Park Senior Solutions Architect Contents created by Jack Han Solutions Architect

Yocto Project internal tools

BriCS. University of Bristol Cloud Service Simulation Runner. User & Developer Guide. 1 October John Cartlidge & M.

Installation Instructions

Manual Shell Script Linux If Not Exist Directory Does

Democratizing Machine Learning on Kubernetes

datapusher Documentation

Ubuntu LTS Install Guide

Post Ubuntu Install Exercises

Transition Plan (TP)

CS 410/510: Web Security X1: Labs Setup WFP1, WFP2, and Kali VMs on Google Cloud

DEVELOPMENT GUIDE VAB-630. Linux BSP v

UI cases Documentation

Some Ubuntu Practice...

PREPARING TO USE CONTAINERS

CazCoin VPS Masternode Setup December 2018

KOHA UBUNTU In Compatible With. 1 P a g e

Ubuntu Practice and Configuration Post Installation Exercises interlab at AIT Bangkok, Thailand

How To Install Java On Linux Ubuntu >>>CLICK HERE<<<

The first command should show your short hostname, and the second should show your fully qualified domain name (FQDN).

A113X1 Development Kit

Tensorflow/SyntaxNet. Installation Guide

Orchestrating Big Data with Apache Airflow

Setting up VPS on Ovh public cloud and installing lamp server on Ubuntu instance

Introduction to Linux

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

SDN VPN user guide. Release draft (fd6f067) OPNFV

Transcription:

Technical Manual(TM) Image Processing Platform Team04 Name First Role Second Role Third Role Hao Wu Requirements Engineer Software Architect Implementer Junran Liu Operational Concept Engineer Software Architect Implementer, Trainer Meiyi Yang Project Manager Life Cycle Plan Implementer Vinny DeGenova IIV & V Quality Focal Point Implementer Xiangchen Zhao Life Cycle Plan Prototyper Implementer Xinhui Liu Feasibility Analyst Operational Concept Engineer Implementer, Tester Yifan Liu Prototyper Requirements Engineer Implementer 12/04/2016

Version History Date Author Version Changes made Rationale 12/04/16 Xiangchen 1.0 First Version Initial Draft for TRR ARB

Table of Contents VERSION HISTORY... II TABLE OF TABLES... IV TABLE OF FIGURES... V 1. Introduction...1 1.1 System Overview...1 1.2 System Requirements...1 2. Installation Procedures...2 2.1 TensorFlow installation...2 2.2 Django&Celery installation...3 2.3 MySQL installation...3 3. Algorithm Manual...4 3.1 Background...4 3.2 Retrain Model...4 3.3 Image recognition...5

Technical Manual (TM) Version 1.0 Table of Tables No table of figures entries found. TM_TRR_F16a_T16_V1.0.doc Version Date: 12/04/16

Technical Manual (TM) Version 1.0 Table of Figures No table of figures entries found. TM_TRR_F16a_T16_V1.0.doc Version Date: 12/04/16

1. Introduction 1.1 System Overview The purpose of our system is to detect some specific classes of images that users want in thousands of original images. We implement it with a back-end classification algorithm and a front-end website, which we called Image Processing Platform. Here, this manual is a system administrator s manual. In this manual, you can find how to deploy our Image Processing Platform on your own server and how to use and even optimize the image recognition algorithm. 1.2 System Requirements Ubuntu 14.04 / 14.10 / 15.04/ 16.04 Python 3.5 1.2.1 Hardware Requirements TensorFlow has two version: CPU version and GPU version(only NVIDIA Graphic card). The GPU version will have a shorter time for retraining the model. Our system is running in the GPU version TensorFlow environment. However, the CPU version is also compatible here. 1.2.2 Software Requirements Tensorflow r0.11 Mysql 5.7 Django 1.9.2 Celery 1.3 Cuda Toolkit 8.0 CuDNN v5

2. Installation Procedures To deploy the whole platform on your own server, you need first install three software: TensorFlow Framework, Django and Celery, MySQL. The following part will give you a complete manual on how to install these software, Or you can follow the introduction on their website. 2.1 TensorFlow installation ## 1. Install tensorflow export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow- 0.11.0-cp35-cp35m-linux_x86_64.whl sudo pip3 install --upgrade $TF_BINARY_URL ## 2. Install Bazel dependencies #### Install JDK 8 sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer #### echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" sudo tee /etc/apt/sources.list.d/bazel.list sudo apt install curl curl https://bazel.build/bazel-release.pub.gpg sudo apt-key add - #### sudo apt-get install pkg-config zip g++ zlib1g-dev unzip ## 3. Install Bazel Download file from: https://github.com/bazelbuild/bazel/releases chmod +x bazel-0.4.0-installer-linux-x86_64.sh./bazel-0.4.0-installer-linux-x86_64.sh --user ## 4.Test #### get the path python3 -c 'import os; import inspect; import tensorflow; print(os.path.dirname(inspect.getfile(tensorflow)))' #### test image recognition cd /usr/local/lib/python3.5/dist-packages/tensorflow cd models/image/imagenet python3 classify_image.py You can find detailed installation manual on the TensorFlow website: https://www.tensorflow.org/versions/r0.11/get_started/os_setup.html#requirements

2.2 Django&Celery installation ## 1. Install Django sudo pip3 install django==1.9.2 sudo pip3 install django-celery==3.1.17 pip3 install celery==3.1.24 ## pip install celery==3.1.24 sudo apt-get install rabbitmq-server sudo pip3 install pymysql==0.7.9 ## 2. Test django-admin --version celery --version ## 3. Configurate mysql database to use our project mysql -u root -p mysql>> CREATE DATABASE IPP; (configure "setting.py" -> database) ## 4. Run Django project python3 manage.py migrate ## run it first time if you don't have a database tables python3 manage.py runserver python3 manage.py celery worker --loglevel=info 2.3 MySQL installation sudo apt-get install mysql-server sudo apt install mysql-client sudo apt install libmysqlclient-dev sudo apt-get install python3-mysqldb sudo netstat -tap grep mysql vi /etc/mysql/mysql.conf.d/mysqld.cnf mysql -u root -p mysql> use mysql; mysql> select 'host' from user where user='root'; mysql> update user set host = '%' where user = 'root'; mysql> flush privileges; mysql> select 'host' from user where = 'root'; service mysql start

3. Algorithm Manual 3.1 Background There are two ways to use our algorithm to do the image recognition task. The first way is to run the algorithm script in the terminal and the second way is to use our front-end platform. For the second way, you can find details in the User Manual. Here, we introduce how to use the first way, directly run the algorithm script. For basic image recognition knowledge with TensorFlow, you can find it here: https://www.tensorflow.org/versions/r0.9/tutorials/image_recognition/index.html We take the pre-trained inception v3 image recognition model, retrain it on our own data. Till now, we have three functions: retrain the model (retrain.py), test the accuracy of the retrained model (retrain_test.py), classify the test image(classify_image.py) 3.2 Retrain Model TensorFlow has a pre-trained model called inception for image recognition. After you setup TensorFlow, you can retrain this model to work on your own dataset. Once you have the images, you can build the retrainer like this, from the root of your TensorFlow source directory: bazel build tensorflow/examples/image_retraining:retrain The retrainer can then be run like this (python3.5): python3 {YOU_PATH}/retrain.py --image_dir {DATASET_PATH} You can add distortion, modify some parameters like this (details in retrain.py): python3 {YOU_PATH}/retrain.py --image_dir {DATASET_PATH} --random_crop 5 -- how_many_training_steps=50000 3.2.1 Bottlenecks The script can take thirty minutes or more to complete, depending on the speed of your machine. The first phase analyzes all the images on disk and calculates the bottleneck values for each of them. 'Bottleneck' is an informal term we often use for the layer just before the final output layer that actually does the classification. This penultimate layer has been trained to output a set of values that's good enough for the classifier to use to distinguish between all the classes it's been asked to recognize. That means it has to be a meaningful and compact summary of the images, since it has to contain enough information for the classifier to make a good choice in a very small set of values. The reason our final layer retraining can work on new classes is that it turns out the kind of information needed to distinguish between all the 1,000 classes in ImageNet is often also useful to distinguish between new kinds of objects. Because every image is reused multiple times during training and calculating each bottleneck takes a significant amount of time, it speeds things up to cache these bottleneck values on disk so they don't have to be repeatedly

recalculated. By default they're stored in the /tmp/bottleneck directory, and if you rerun the script they'll be reused so you don't have to wait for this part again. 3.2.2 Training Once the bottlenecks are complete, the actual training of the top layer of the network begins. You'll see a series of step outputs, each one showing training accuracy, validation accuracy, and the cross entropy. The training accuracy shows what percent of the images used in the current training batch were labeled with the correct class. The validation accuracy is the precision on a randomly-selected group of images from a different set. The key difference is that the training accuracy is based on images that the network has been able to learn from so the network can overfit to the noise in the training data. A true measure of the performance of the network is to measure its performance on a data set not contained in the training data -- this is measured by the validation accuracy. If the train accuracy is high but the validation accuracy remains low, that means the network is overfitting and memorizing particular features in the training images that aren't helpful more generally. Cross entropy is a loss function which gives a glimpse into how well the learning process is progressing. The training's objective is to make the loss as small as possible, so you can tell if the learning is working by keeping an eye on whether the loss keeps trending downwards, ignoring the short-term noise. By default this script will run 4,000 training steps. Each step chooses ten images at random from the training set, finds their bottlenecks from the cache, and feeds them into the final layer to get predictions. Those predictions are then compared against the actual labels to update the final layer's weights through the back-propagation process. As the process continues you should see the reported accuracy improve, and after all the steps are done, a final test accuracy evaluation is run on a set of images kept separate from the training and validation pictures. This test evaluation is the best estimate of how the trained model will perform on the classification task. 3.2.3 Visualizing the Retraining with TensorBoard The script includes TensorBoard summaries that make it easier to understand, debug, and optimize the retraining. For example, you can visualize the graph and statistics, such as how the weights or accuracy varied during training. To launch TensorBoard, run this command during or after retraining: tensorboard --logdir /tmp/retrain_logs 3.3 Image recognition The retrain.py script will write out a version of the Inception v3 network with a final layer retrained to your categories to /tmp/output_graph.pb, and a text file containing the labels to /tmp/output_labels.txt. Since you've replaced the top layer, you will need to specify the new name in the script, for example with the flag -- output_layer=final_result After you retrain the model, you could use classify_image.py to classify the test image. Change the file name to fit your retrained model in classify_image.py: uid_lookup_path = os.path.join(flags.model_dir, 'output_labels.txt') with tf.gfile.fastgfile(os.path.join(flags.model_dir, 'output_graph.pb'), 'rb') as f: