0% found this document useful (0 votes)
53 views21 pages

Classification Classify Images of Clothing - ALI LAZIM

TensorFlow is an end-to-end open source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries and community resources that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML powered applications. Written in: Python, C++, CUDA Trains a neural network model to classify images of clothing, like sneakers and shirts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views21 pages

Classification Classify Images of Clothing - ALI LAZIM

TensorFlow is an end-to-end open source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries and community resources that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML powered applications. Written in: Python, C++, CUDA Trains a neural network model to classify images of clothing, like sneakers and shirts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Basra University

College of Education For Pure Science


Computer science Dept.
2020-2021

Classification: Classify images of clothing

Prepared By : Ali Al-Malki


Order By : Dr. Salah F. Saleh
Abstract

• TensorFlow is an end-to-end open source platform for machine learning. It has a


comprehensive, flexible ecosystem of tools, libraries and community resources that
lets researchers push the state-of-the-art in ML and developers easily build and
deploy ML powered applications.

• Written in: Python, C++, CUDA

Trains a neural network model to classify images of clothing, like sneakers and shirts.
Introduction
TensorFlow is a free and open-source software library for machine learning. It can
be used across a range of tasks but has a particular focus on training and inference
of deep neural networks

Tensorflow is a symbolic math library based on dataflow and differentiable


programming. It is used for both research and production at Google

TensorFlow was developed by the Google Brain team for internal Google use. It was
released under the Apache License 2.0 in 2015
tf.keras models are optimized to make predictions on a batch, or collection, of examples at
once.
NumPy is an essential component in the burgeoning Python visualization landscape, which
includes Matplotlib, Seaborn, Plotly, Altair, Bokeh, Holoviz, Vispy, Napari, and PyVista, to
name a few. NumPy's accelerated processing of large arrays allows researchers to visualize
datasets far larger than native Python could handle.

 Matplotlib is a comprehensive library for creating static, animated, and interactive


visualizations in Python. Matplotlib makes easy things easy and hard things possible. Create.
Develop publication quality plots with just a few lines of code. 
Work Overview

Build and train models in tensorflow.


Work Overview
Import the Fashion MNIST dataset
dataset which contains 70,000 grayscale images in 10 categories. The images show individual articles of clothing at low resolution
(28 by 28 pixels), as seen here:

Its from keras data set


Will be download automatically
Work Overview
The images are 28x28 NumPy arrays, with pixel values ranging from 0 to 255. The labels are an
array of integers, ranging from 0 to 9. These correspond to the class of clothing the image
represents:
Label Class
0 T-shirt/top
1 Trouser
2 Pullover
3 Dress
4 Coat
5 Sandal
6 Shirt
7 Sneaker
8 Bag
9 Ankle boot
Work Overview
Explore the data
Let's explore the format of the dataset before training the model. The following shows there are 60,000
images in the training set, with each image represented as 28 x 28 pixels:
Work Overview
Preprocess the data
The data must be preprocessed before training the network. If you inspect the first image in the training set, you
will see that the pixel values fall in the range of 0 to 255:
Work Overview
Scale these values to a range of 0 to 1 before feeding them to the neural network model. To do so, divide the
values by 255. It's important that the training set and the testing set be preprocessed in the same way:
Work Overview
To verify that the data is in the correct format and that you're ready to build and train the network, let's
display the first 25 images from the training set and display the class name below each image.
Work Overview
Build the model
Building the neural network requires configuring the layers of the model, then compiling the model.
Work Overview
Compile the model

Before the model is ready for training, it needs a few more settings. These are added during the model's 
compile step:

 Loss function —This measures how accurate the model is during training. You want to minimize this
function to "steer" the model in the right direction.

 Optimizer —This is how the model is updated based on the data it sees and its loss function.
Metrics —Used to monitor the training and testing steps. The following example uses accuracy, the fraction of
the images that are correctly classified
Work Overview
Train the model

For 10 epochs – each epoch the accuracy increased in total accuracy has been up 10 %
Work Overview
Evaluate accuracy
Work Overview
Make predictions
Work Overview
A prediction is an array of 10 numbers. They represent the model's "confidence" that the image corresponds to

each of the 10 different articles of clothing. You can see which label has the highest confidence value:
Work Overview
Verify predictions
Work Overview
Let's plot several images
with their predictions.
Note that the model can
be wrong even when
very confident.
Work Overview
With the model trained, you can use it to make predictions about some images.
Let's look at the 0th image, predictions, and prediction array. Correct prediction labels are blue and
incorrect prediction labels are red. The number gives the percentage (out of 100) for the predicted
label.
Work Overview
use the trained model

the model predicts a label as expected.


Thank You

You might also like