Learn practical skills, build real-world projects, and advance your career

Fashion Image Recognition Using Deep CNN

Importing libraries

import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = ""
# Keras MNIST dataset:
from keras.datasets import fashion_mnist
import numpy as np
from keras.utils import np_utils
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
import random
seed = 0
random.seed(seed)
np.random.seed(seed)
Using TensorFlow backend.

Dataset:

0: T-shirt/top, 1: Trouser, 2: Pullover, 3: Dress, 4: Coat, 5: Sandal, 6: Shirt, 7: Sneaker, 8: Bag, 9: Ankle boot

(X_train, y_train), (X_test, y_test) = fashion_mnist.load_data()
print(X_train.shape)
print(X_test.shape)
(60000, 28, 28) (10000, 28, 28)