joeylim0328 / Clothing-Recognition-System

This is a simple clothing recognition system that classifies a clothing item into one of 10 classes by applying deep learning models.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clothing-Recognition-System

This is a simple clothing recognition system that classifies a clothing item into one of 10 classes by applying deep learning models. The 10 classes are belt, covered shoes, dress, high heels, pants, shirt, skirt, slippers, socks and spectacles. Two deep learning models are experimented, multilayer perceptron (MLP) and convolutional neural network (CNN).

Data Description

There is a total of 6059 images. The number of images of each class is presented in the table below.

Class Name Number of Images Image Sample
Belt 600 belt
Dress 600 dress
High_Heels 600 Heels
Pants 612 Pants
Shirt 643 Shirt
Shoes 600 Shoes
Skirt 600 Skirt
Slipper 600 Slipper
Socks 604 Socks
Spectacles 600 Spectacles

The train_test_split funciton is used to split the data into training set and testing set. After that, part of the training set i used as the validation set. For the Multilayer Perceptron model,

  • Training samples = 4907
  • Validation samples = 546
  • Testing samples = 606

For the CNN model,

  • Training samples = 5000
  • Validation samples = 453
  • Testing samples = 606

Before splitting the datasets, all images are resized to 84*84 pixels. Numbers (1 to 10) are used to represent each class. For example, 0 for belt and 1 for shirt. code_1

Methods

  1. Multilayer Perceptrons (MLP)
  • 4 hidden layers (300 nuerons, 300 neurons, 100 neurons, and 10 neurons respectively)
  • Activation function for first 3 hidden layers are 'relu', meanwhile the activation funciton for the last hidden layer is 'softmax'
  • Optimiser used is SGD

code_2 MLP architecture

  1. Convolutional Neural Network
  • This model has 3 convolutional layers and 3 pooling layers code_3 CNN architecture

Convolutional Layer 1
conv_layer1
The input image is 84 * 84 pixels. The filter kernel is 7 * 7 pixels. The 64 filter kernels will convolve with the input images with stride=1, and produce 64 78 * 78 pixels feature maps. The output size of 1 feature map can be calculated as below, Output size = [84 – 7]/1 + 1 = 78

Pooling Layer 1
pool_layer1
After the first convolutional layer, the feature maps are pooled with 2 * 2 max pool layer with stride=2, and produce 64 39 * 39 pixels feature maps. Output size = [78 – 2]/2 + 1 = 39

Convolutional Layer 2
conv_layer2
After the first pooling layer, the feature map is 39 * 39 pixels. The filter kernel is 7 * 7 pixels. The 128 filter kernels will convolve with the feature maps with stride=1, and produce 8192 33 * 33 pixels feature maps. Output size = [39 – 7]/1 +1 = 33

Pooling Layer 2
pool_layer2
After the second convolutional layer, the feature maps are pooled with 2 * 2 max pool layer with stride=2, and produce 8192 16 * 16 pixels feature maps. Output size = [33 – 2]/2 + 1 = 16

Convolutional Layer 3
conv_layer3
After the second pooling layer, the feature map is 16 * 16 pixels. The filter kernel is 7 * 7 pixels. The 128 filter kernels will convolve with the feature maps with stride=1, and produce 1048576 10 * 10 pixels feature maps. Output size = [16 – 7]/1 +1 = 10

Pooling Layer 3
pool_layer3
After the third convolutional layer, the feature maps are pooled with 2 * 2 max pool layer with stride=2, and produce 1048576 5 * 5 pixels feature maps. Output size = [10 - 2]/2 + 1 = 5

Result

MLP
MLP_result
CNN
CNN_result

Authors

Joey Lim, Y.F.,Tan, J.C.,Tan, Z.X.,Ng, B.S.,Leong

Others

This project is made for my TML 2221 Machine Learning subject. The original program of this assignment is modified and updated.

About

This is a simple clothing recognition system that classifies a clothing item into one of 10 classes by applying deep learning models.


Languages

Language:Jupyter Notebook 100.0%