This project demonstrates the loading, preprocessing, and visualization of the Fashion MNIST dataset using TensorFlow and Keras. The dataset consists of grayscale images of fashion items, each labeled with one of ten classes. The project prepares the dataset for training machine learning models to classify fashion items into their respective categories.
Dataset: Fashion MNIST
Images: 28x28 pixel grayscale images of fashion items (e.g., T-shirts, shoes, dresses).
Classes: 10 categories of clothing items:
- T-shirt/top
- Trouser
- Pullover
- Dress
- Coat
- Sandal
- Shirt
- Sneaker
- Bag
- Ankle boot
- Loading the Dataset:
- The Fashion MNIST dataset is loaded using the
keras.datasets.fashion_mnist
API. - Training set: 60,000 images.
- Test set: 10,000 images.
- The Fashion MNIST dataset is loaded using the
- Preprocessing the Data:
- Pixel values are normalized to the range [0, 1] by dividing by 255.
- Images are prepared for visualization and model input.
- Visualization:
- Display the first image from the training dataset.
- Show a 5x5 grid of the first 25 training images with their corresponding labels.
- Labels:
- Labels represent the type of clothing item in each image (e.g., 0: T-shirt/top, 1: Trouser, 2: Pullover, etc.).
- Loading the Dataset:
- The dataset is loaded using TensorFlow's built-in API.
- Preprocessing:
- Normalize pixel values to improve model training efficiency.
- Visualization:
- Display individual images and grids of images with labels for better understanding.
- First Image in the Dataset:
- The first image from the training set is displayed with a color bar, showing raw pixel data.
- Grid of 25 Training Images:
- A 5x5 grid of the first 25 training images is displayed, with each image labeled according to its class (e.g., T-shirt, trouser, dress).
- Python 3.8+
- Libraries:
numpy
,pandas
,tensorflow
,keras
- Hardware: GPU with cuDNN support (recommended)
This project is licensed under the MIT License. See the LICENSE file for details.