Skip to content

junaidaliop/pytorch-fashionMNIST-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PyTorch Tutorial: Fashion MNIST with Convolutional Neural Networks (CNNs)

Welcome to a comprehensive tutorial on the Fashion MNIST dataset using PyTorch. Fashion MNIST is a dataset of 60,000 28x28 grayscale images of 10 fashion categories, along with a test set of 10,000 images.

Overview

The Fashion MNIST dataset is a collection of grayscale images of 10 fashion categories, each of size 28x28 pixels. It's used as a drop-in replacement for the classic MNIST dataset. It serves as a more challenging classification problem than the regular MNIST digit dataset due to the similarities in clothing items.

Fashion MNIST Sample

Each image in the dataset corresponds to a label from 0-9, representing the ten categories:

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

Table of Contents:

  1. PyTorch Tutorial: Fashion MNIST with Convolutional Neural Networks (CNNs)
  2. Prerequisites
  3. Setup and Installation
  4. Understanding the Fashion MNIST Dataset
  5. Data Loading and Preprocessing
  6. Understanding PyTorch Utilities
  7. Convolutional Neural Networks (CNNs)
  8. Training and Evaluation
  9. Understanding Optimizers and Loss Functions
  10. Training Loop (Explained)
  11. Evaluation
  12. Advanced Topics: Regularization with Dropout
  13. Understanding the Role of F.log_softmax
  14. Training
  15. Logging and Observing the Loss During Training
  16. Reusing the Evaluation Code and The Importance of Testing on a Validation Set
  17. Advanced Topics: Data Augmentation
  18. Conclusion
  19. References and Acknowledgments
  20. Exercises for Practice
  21. Additional Resources
  22. Feedback
  23. Exercise Solutions

Prerequisites

Before diving into the tutorial, ensure you have the following prerequisites installed and set up:

  1. Python: This tutorial requires Python 3.x. Python is the primary language we'll be using.
  2. PyTorch & torchvision: PyTorch is an open-source machine learning library, and torchvision offers datasets and models for computer vision.
  3. Jupyter Notebook: The interactive environment where this tutorial is presented.
  4. NumPy: A library for numerical operations in Python.
  5. scikit-learn: Machine learning library in Python. We'll use it for performance metrics.
  6. Seaborn & Matplotlib: Visualization libraries in Python.
  7. CUDA (Optional): If you have a compatible NVIDIA GPU, you can install CUDA for GPU acceleration with PyTorch.

About this Tutorial

This tutorial was meticulously crafted by Muhammad Junaid Ali Asif Raja for a seminar/workshop held on 27th October 2023. The main aim is to provide a comprehensive understanding of implementing CNNs using PyTorch, targeting both beginners and intermediate learners.

Getting Started

Follow these steps to get started with the tutorial:

1. Clone the Repository:

git clone https://github.com/junaidaliop/pytorch-fashionMNIST-tutorial.git
cd pytorch-fashionMNIST-tutorial

2. Set Up the Conda Environment:

Use the provided PyTorchTutorial.xml file to set up the Conda environment with all required dependencies:

conda env create -f PyTorchTutorial.xml

Activate the environment:

conda activate PyTorchTutorial

3. Launch the Jupyter Notebook:

jupyter notebook

Navigate to the pytorch_fashion_mnist_tutorial.ipynb file in the Jupyter Notebook interface, and you're ready to dive into the tutorial!

Acknowledgements

Special thanks to Dr. Naveed Ishtiaq Chaudhary for presenting me with the opportunity.

About

PyTorch tutorial on Fashion MNIST using CNNs, crafted by Muhammad Junaid Ali Asif Raja. Covers data processing, model building, training, and evaluation. Designed for a seminar/workshop on PyTorch CNNs..

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages