You are on page 1of 36

HCNA-AI Huawei Certification Course

HCNA-AI
Image Recognition Programming
Experiment Guide
Version: 1.0

Huawei Technologies Co., Ltd.

1
Copyright © Huawei Technologies Co., Ltd. 2018. All rights reserved.
No part of this document may be reproduced or transmitted in any form or by any means without prior written consent
of Huawei Technologies Co., Ltd.

Trademarks and Permissions

and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective holders.

Notice
The purchased products, services and features are stipulated by the contract made between Huawei and the customer.
All or part of the products, services and features described in this document may not be within the purchase scope or
the usage scope. Unless otherwise specified in the contract, all statements, information, and recommendations in this
document are provided "AS IS" without warranties, guarantees or representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the preparation of
this document to ensure accuracy of the contents, but all statements, information, and recommendations in this
document do not constitute a warranty of any kind, express or implied.

Huawei Technologies Co., Ltd.


Address: Huawei Industrial Base
Bantian, Longgang
Shenzhen 518129
People's Republic of China

Website: http://huawei.com

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. i


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide Introduction to Huawei Certification System

Introduction to Huawei Certification System

Based on cutting-edge technologies and professional training systems, Huawei certification


meets the diverse AI technology demands of various clients. Huawei is committed to
providing practical and professional technical certification for our clients.
HCNA-AI V1.0 certification is intended to popularize AI and help understand deep learning
and Huawei Cloud EI, and learn the basic capabilities of programming based on the
TensorFlow framework, as a motive to promote talent training in the AI industry.
Content of HCNA-AI V1.0 includes but is not limited to: AI overview, Python programming
and experiments, mathematics basics and experiments, TensorFlow introduction and
experiments, deep learning pre-knowledge, deep learning overview, Huawei cloud EI
overview, and application experiments for image recognition, voice recognition and man-
machine dialogue.
HCNA-AI certification will prove that you systematically understand and grasp Python
programming, essential mathematics knowledge in AI, basic programming methods of
machine learning and deep learning platform TensorFlow, pre-knowledge and overview of
deep learning, overview of Huawei cloud EI, basic programming for image recognition, voice
recognition, and man-machine dialogue. With this certification, you have required knowledge
and techniques for AI pre-sales basic support, AI after-sales technical support, AI products
sales, AI project management, and are qualified for positions such as natural language
processing (NLP) engineers, image processing engineers, voice processing engineers and
machine learning algorithm engineers.
Enterprises with HCNA-AI-certified engineers have the basic understanding of AI technology,
framework, and programming, and capable of leveraging AI, machine learning, and deep
learning technologies, as well as the open-source TensorFlow framework to design and
develop AI products and solutions like machine learning, image recognition, voice
recognition, and man-machine dialogue.
Huawei certification will help you open the industry window and the door to changes,
standing in the forefront of the AI world!

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. ii


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide About This Document

About This Document

Brief Introduction
This document is an HCNA-AI certification training course. It is intended for trainees who are
preparing for HCNA-AI tests or readers who want to know about AI basics. After
understanding this document, you will be able to perform basic AI image recognition
programming.

Contents
This document contains one experiment (TensorFlow image recognition) to help trainees or
readers get started and build the basic AI programming capability.
The experiment includes image data preparation, library and module installation, and finally
image recognition realization.

Background Knowledge Required


To better master the contents of this course, the audience should:
Have basic Python language programming capabilities;
Have a basic understanding of data structures;
Have a basic understanding of AI.

Experiment Environment Overview

Python Development Tool


This experiment environment is developed and compiled based on the Python 3.6.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. iii


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide Contents

Contents

Introduction to Huawei Certification System ........................................................................... ii


About This Document ................................................................................................................... iii
1 Image Recognition Experiment Overview ............................................................................... 1
1.1 Experimental Environment ........................................................................................................................................... 1
1.1.1 Experimental Environment ........................................................................................................................................ 1
1.1.2 Main Framework ....................................................................................................................................................... 1
1.1.3 Application Framework List ...................................................................................................................................... 2
1.2 Data Set Introduction .................................................................................................................................................... 2
1.2.1 Data Set...................................................................................................................................................................... 2
1.2.2 Data Set Obtaining ..................................................................................................................................................... 2
1.3 CNN .............................................................................................................................................................................. 2
1.3.1 Structure..................................................................................................................................................................... 2
1.3.2 Overview ................................................................................................................................................................... 3
1.4 Experiment.................................................................................................................................................................... 3
1.4.1 Content....................................................................................................................................................................... 3
1.4.2 Step ............................................................................................................................................................................ 3
1.5 Summary ....................................................................................................................................................................... 4

2 Data Preparation for Image Recognition .................................................................................. 5


2.1 Obtaining Data .............................................................................................................................................................. 5
2.1.1 Entering the Development Environment.................................................................................................................... 5
2.1.2 Downloading Data ..................................................................................................................................................... 8
2.2 Viewing Data ................................................................................................................................................................ 9
2.2.1 Account Function ....................................................................................................................................................... 9
2.3 Summary ..................................................................................................................................................................... 10

3 Implementation of Image Recognition Based on the TensorFlow .................................... 11


3.1 Installing the scikit-image Framework ....................................................................................................................... 11
3.2 Image Recognition Implementation ............................................................................................................................ 12
3.2.1 Experiment Roadmap .............................................................................................................................................. 12
3.2.2 Module Importing .................................................................................................................................................... 12
3.2.3 Data Reading and Standardization ........................................................................................................................... 13

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. iv


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide Contents

3.2.4 Data Pre-processing ................................................................................................................................................. 14


3.2.5 Placeholder Defining ............................................................................................................................................... 15
3.2.6 CNN Construction ................................................................................................................................................... 15
3.2.7 Loss Function, Optimizer, and Verification Indicator Defining ............................................................................... 17
3.2.8 Model Training and Verification .............................................................................................................................. 18
3.2.9 Model Saving and Session Closing.......................................................................................................................... 19
3.3 Sample Image Test ...................................................................................................................................................... 19
3.3.1 Invoking the Model for Testing ............................................................................................................................... 19
3.4 Summary ..................................................................................................................................................................... 21

4 Image Recognition Effect Display ........................................................................................... 22


4.1 Script Test ................................................................................................................................................................... 22
4.1.1 Test Roadmap .......................................................................................................................................................... 22
4.1.2 Test Process.............................................................................................................................................................. 22
4.2 Summary ..................................................................................................................................................................... 29

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. v


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 1 Image Recognition Experiment Overview

1 Image Recognition Experiment Overview

1.1 Experimental Environment


1.1.1 Experimental Environment
The development environment used in this experiment is based on the established deep
learning environment (version: CPU). For details about how to set up the environment, see the
HCNA-AI Lab Environment Setup Experiment Manual. Because the size of the image data set
samples used by this experiment is small, the GPU is not used for model training and
iteration. In addition, you need to install the corresponding framework before the experiment
starts.

1.1.2 Main Framework


This experiment is mainly used to identify flower images. The following frameworks are
used:
scikit-image: mainly used for image processing. The native NumPy array is used as the image
object;
TensorFlow: mainly used to develop deep learning algorithms and construct a convolutional
neural network (CNN);
numpy: used for matrix and numerical value processing;
glob: used to search for a file path complying with a specific rule. This framework is similar
to the file search function in the Windows operating system;
OS: provides a large number of functions to process files and directories;
time: processes and converts time.
The following figure shows the module.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 1


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 1 Image Recognition Experiment Overview

1.1.3 Application Framework List


Python
Numpy
Scikit-image
Tensorflow
os
glob
time
Vim
Git

1.2 Data Set Introduction


1.2.1 Data Set
This document uses an open-source data set that contains five types of flowers: daisy (633
images), dandelion (898 images), roses (641 images), sunflowers (699 images), and tulips
(799 images). The 3670 images with a size of about 230 MB are saved in five directories.

1.2.2 Data Set Obtaining


 The data can be obtained from Huawei Cloud Object Storage Service (OBS).
To help trainees learn the HCNA-AI course, the OBS is enabled on Huawei cloud for
trainees to obtain the data set.
Link: https://obs-77f8.obs.cn-north-1.myhwclouds.com/HCNA-AI/image.zip
 The data can be downloaded from the following website:
Link: http://download.tensorflow.org/example_images/flower_photos.tgz

1.3 CNN
1.3.1 Structure
The CNN, one of the mainstream deep learning and neural network algorithms, is mainly used
for image recognition. The following figure shows the CNN structure.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 2


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 1 Image Recognition Experiment Overview

1.3.2 Overview
The CNN is an in-depth Forward Feedback Artificial Neural Network (FFANN), which has
been successfully applied in the field of image recognition. The network structure mainly
includes the input layer, convolutional layer, pooling layer, full connection layer, and output
layer.
Generally, the basic structure of the CNN includes two layers. The first layer is the feature
extraction layer: The input of each neuron is connected to the local acceptance field of the
previous layer, and the features of the local acceptance field are extracted. Once a local
feature is extracted, the location relationship between it and other features is determined. The
second layer is the feature mapping layer. Each computing layer of the network consists of
multiple feature mappings. Each feature mapping is a plane and the weights of all neurons on
the plane are the same. The feature mapping structure uses the sigmoid function that has the
smallest influence function kernel as the activation function of the convolutional network, so
that the feature mapping has the rotation invariance.

1.4 Experiment
1.4.1 Content
This experiment focuses on image recognition. Based on TensorFlow depth learning
framework and CNN, it aims to identify flower types using an open-source data set.

1.4.2 Step
The main steps of the experiment are as follows:
1. Importing frameworks
2. Preparing paths
3. Processing images
4. Defining placeholders
5. Defining the network structure
6. Defining the loss function and optimizer.
7. Model training and prediction
8. Model prediction

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 3


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 1 Image Recognition Experiment Overview

1.5 Summary
This chapter mainly introduces the environment and data set of the image recognition
experiment, briefly explains the CNN, and addresses the preparations based on the
TensorFlow framework.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 4


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 2 Data Preparation for Image Recognition

2 Data Preparation for Image Recognition

2.1 Obtaining Data


2.1.1 Entering the Development Environment
Step 1 Visit HUAWEI CLOUD official website.
Link: http://www.huaweicloud.com/.

Click Console in the upper right corner.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 5


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 2 Data Preparation for Image Recognition

Click Elastic Cloud Server. The server console page is displayed.

Click Remote Login to enter the environment.


Step 2 Enter the development environment.
The initial page is as follows.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 6


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 2 Data Preparation for Image Recognition

Enter the user name and password to log in to the system.

----End

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 7


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 2 Data Preparation for Image Recognition

2.1.2 Downloading Data


Step 1 Create the file directory HCNA-AI.
Run ll and view the existing file folders in the directory.

Run mkdir HCNA-AI and ll to create a file folder. Check the result.

Step 2 Switch to the HCNA-AI file folder.


Run cd HCNA-AI to download the data set.

Step 3 Download the data set from the OBS.


Run wget https://obs-77f8.obs.cn-north-1.myhwclouds.com/HCNA-AI/image.zip to
download the data set.

----End

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 8


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 2 Data Preparation for Image Recognition

2.2 Viewing Data


2.2.1 Account Function
Step 1 View the downloaded package.
Run ll to check the package.

Step 2 Decompress the package.


Run unzip image.zip and view the existing file folders in the directory.

Run ll to check the decompressed files.

Step 3 View the data set.


Run cd flower_photos and ll to check the downloaded files.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 9


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 2 Data Preparation for Image Recognition

Run cd daisy and ll to view the data details.

The preceding jpg files are the sample pictures in the flower_photos data set.
----End

2.3 Summary
This chapter describes how to obtain the experiment data, download the experiment data, and
view related data sets to facilitate subsequent data operations.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 10


Image Recognition Programming

Experimental GuideImage Recognition Programming


3 Implementation of Image Recognition Based on the
Experimental Guide TensorFlow

3 Implementation of Image Recognition


Based on the TensorFlow

3.1 Installing the scikit-image Framework


The scikit-image framework is required to process image data. The scikit-image framework is
not installed in the original development environment. Therefore, install the scikit-image
framework before the experiment starts. To install the scikit-image framework, perform the
following steps:
Step 1 Go to the main directory.
Run cd and ll.

Step 2 Install the scikit-image framework.


Run pip3 install scikit-image.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 11


Image Recognition Programming

Experimental GuideImage Recognition Programming


3 Implementation of Image Recognition Based on the
Experimental Guide TensorFlow

Step 3 Check the installation result.


Run pip3 list.

----End

3.2 Image Recognition Implementation


3.2.1 Experiment Roadmap
1. This experiment classifies flower images by flower type. It is based on an open-source
data set flower_photos and an 11-layer deep CNN (including two convolutional layers,
two pooling layers, and two full connection layers). After data training is complete, one
image is extracted from each type of training data set for model verification.
2. This experiment complies with the standard development process. The involved steps
include data preparation, data preprocessing, variable and parameter defining, network
model construction, loss function and optimizer defining, model training and testing, and
model invoking.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 12


Image Recognition Programming

Experimental GuideImage Recognition Programming


3 Implementation of Image Recognition Based on the
Experimental Guide TensorFlow

3.2.2 Module Importing


Import modules.
skimage: package for processing image data.
io: module for image data reading (imread) and output (imshow);
transform: module for changing the image size (using the resize function);
glob: package for searching for a file path that meets a specified rule (this approach is similar
to the file search in the Windows operating system);
os: module for processing files and directories. The operations include obtaining the files in
the current directory, deleting a specified file, changing the directory, and viewing the file
size;
Tensorflow: the most popular in-depth learning framework in the industry. It is widely applied
in fields such as image, voice, text, and target detection. The Tensorflow is also the core of the
experiment. It is used to define placeholders and variables, and create a CNN models;
numpy: scientific computing package based on python. It is used to process numerical
calculation in this experiment.
time: module for processing time data. In this experiment, the time module is used to return
the current time stamp and calculate the time required for running each epoch script.

3.2.3 Data Reading and Standardization


Step 1 Prepare the path.
In the following command, path indicates the data storage path and model_path indicates the
path for saving the model.

Step 2 Prepare the standard image parameters.


In the following command, w, h, and c are the length, width, and depth of the image
respectively. The image is in RGB format.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 13


Image Recognition Programming

Experimental GuideImage Recognition Programming


3 Implementation of Image Recognition Based on the
Experimental Guide TensorFlow

Step 3 Perform data reading and standardization.


After the image data is processed, the images are in the 100x100x3 format. Map the images to
the tags and save the settings. Then, use the print() function to check the size of each image
and tag.

----End

3.2.4 Data Pre-processing


Step 1 Disrupt the original data sequence.
Use shuffle to interrupt the data set and prevent data distribution from affecting the model
results.

Step 2 Set the training set and verification set.


The creation ratio is 0.8, indicating that 80% of the data is used for model training and 20% is
used for model verification.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 14


Image Recognition Programming

Experimental GuideImage Recognition Programming


3 Implementation of Image Recognition Based on the
Experimental Guide TensorFlow

----End

3.2.5 Placeholder Defining


Create placeholders x and y to perform model calculation for the CNN model to transmit
tensor data.

3.2.6 CNN Construction


Step 1 Create a CNN and the first hidden layer.
Define the CNN model. The three variables are input_tensor (input tensor), train (for
distinguishing the training process with the verification process), and regularizer (regular
expression).
For the first volume layer layer1-conv1, conv1_weights, conv1_biases, conv1, and relu1 are
the weight, offset, convolutional layer computing, and activation function respectively.

Step 2 Create the second hidden layer.


The second hidden layer is the first pooling layer, which is layer2-pool1. This layer can
preferentially narrow the size of the matrix, thereby reducing the parameters in the last full
connection layer. The pooling layer can also accelerate calculation and prevent overfitting.

Step 3 Create the third hidden layer.


The third hidden layer is the second volume layer, which is layer1-conv2.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 15


Image Recognition Programming

Experimental GuideImage Recognition Programming


3 Implementation of Image Recognition Based on the
Experimental Guide TensorFlow

Step 4 Create the fourth hidden layer.


The fourth hidden layer is the second pooling layer, which is layer2-pool2.

Step 5 Create the fifth hidden layer.


Create the first full connection layer layer5-fc1 for the combination of the preceding features.

Step 6 Create the sixth hidden layer.


The sixth hidden layer is the second full connection layer layer5-fc2 for the combination of
the preceding features.

Step 7 View the overall network structure.


The entire model has six hidden layers: two convolutional layers, two pooling layers, and two
full connection layers.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 16


Image Recognition Programming

Experimental GuideImage Recognition Programming


3 Implementation of Image Recognition Based on the
Experimental Guide TensorFlow

Step 8 Define regular terms.


This document mainly uses L2 regular terms to prevent over-fitting and improve model
generalization capabilities.

Step 9 View the model.


Check the structure of the final model result to prepare for the subsequent model test.

----End

3.2.7 Loss Function, Optimizer, and Verification


Indicator Defining
Step 1 Define the loss function.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 17


Image Recognition Programming

Experimental GuideImage Recognition Programming


3 Implementation of Image Recognition Based on the
Experimental Guide TensorFlow

Calculate the sparse cross entropy between the prediction tag logits and original tag y_.

Step 2 Define the optimizer.


Use the adam optimizer.

Step 3 Define the optimization target.


Define the training operation and minimize the loss.

Step 4 Define the accuracy of verification indicators.


Define the accuracy function for model effect verification.

----End

3.2.8 Model Training and Verification


Step 1 Define the function for extracting data in batches.

Step 2 Prepare training parameters and perform model initialization.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 18


Image Recognition Programming

Experimental GuideImage Recognition Programming


3 Implementation of Image Recognition Based on the
Experimental Guide TensorFlow

Step 3 Define the model operation on the training set and verification set, and print the results.
Train a total of five epoches. Each epoch needs to run on the training set and verification set.
Print the corresponding loss value and accuracy of two data sets as well as the duration of
each epoch operation.

----End

3.2.9 Model Saving and Session Closing


Step 1 Save the model.
Use the save function of the saver to save the model after the sess operation. The path is
model_path.

Step 2 Close the session.


After sess running ends, close the session.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 19


Image Recognition Programming

Experimental GuideImage Recognition Programming


3 Implementation of Image Recognition Based on the
Experimental Guide TensorFlow

3.3 Sample Image Test


3.3.1 Invoking the Model for Testing
Step 1 Import modules.
Extract an image of the five types of images to test the model effect. The following is the path
and name of each image.

Step 2 Generate a type dictionary.


Generate a type dictionary for each flower type for type matching.

Step 3 Define the image standardization function.


Standardize the test images and convert the images into standard RGB images (100x100x3).

Step 4 Standard the test data.


Invoke the read_one_image function to standardize the test image.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 20


Image Recognition Programming

Experimental GuideImage Recognition Programming


3 Implementation of Image Recognition Based on the
Experimental Guide TensorFlow

Step 5 Reload the model.


Reload the existing model to test the images.

Step 6 Output model parameters.


Output the parameters in the current calculation diagram tensor.

Step 7 Invoke the model.


Invoke the model for testing. Print the prediction matrix, and the subscript of the maximum
value of each row of the prediction matrix.

Step 8 Print the test result.


Print the prediction results of five test data records.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 21


Image Recognition Programming

Experimental GuideImage Recognition Programming


3 Implementation of Image Recognition Based on the
Experimental Guide TensorFlow

----End

3.4 Summary
This chapter describes how to construct a CNN, define the model, set related parameters, and
test sample data based on the TensorFlow.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 22


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 4 Image Recognition Effect Display

4 Image Recognition Effect Display

4.1 Script Test


4.1.1 Test Roadmap
Perform the Python script test using the established experiment environment and VIM editor.

4.1.2 Test Process


Step 1 Access the HCNA-AI directory.
cd HCNA-AI

In the file directory, flower_photos is the data set and image.py is the image recognition
script.
Step 2 Open vim and create the Python script.
vim image_recog.py

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 23


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 4 Image Recognition Effect Display

Step 3 Edit the script.


Run i. Enter the edit mode and start editing.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 24


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 4 Image Recognition Effect Display

Step 4 Enter the following contents.


import tensorflow as tf
import numpy as np
……

Step 5 Save the script and exit.


Press ESC and run :wq!.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 25


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 4 Image Recognition Effect Display

Step 6 View the script content.


cat image_recog.py

cat image.py

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 26


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 4 Image Recognition Effect Display

Step 7 Perform the test.


python3 image_recog.py

Step 8 Perform the complete script test.


python3 image.py
The script is executed to read the image data.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 27


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 4 Image Recognition Effect Display

The output of each epoch training process is as follows.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 28


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 4 Image Recognition Effect Display

The model result output is as follows.

----End

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 29


Image Recognition Programming

Experimental GuideImage Recognition Programming

Experimental Guide 4 Image Recognition Effect Display

4.2 Summary
This chapter describes how to recognize images based on data sets and test the model effect.
As shown in the figure, the accuracy is high.

Issue 1.0 (2018-08-02) Copyright © Huawei Technologies Co., Ltd. 30

You might also like