This project is a PyTorch-based image classifier for the Fashion MNIST dataset using a RegNetY architecture from the timm library. It leverages Albumentations for image preprocessing and visualizes training and validation loss.
π¦ Dataset used: Fashion MNIST PNG Dataset on Kaggle
π§ Model:regnety_006fromtimm
After training, the script will save the following plot to assets/loss_plot.png:
-
Clone the repository
git clone https://github.com/anto18671/vision-classifier.git cd vision-classifier -
Create a virtual environment (optional but recommended)
python -m venv venv source venv/bin/activate # or venv\Scripts\activate on Windows
-
Install dependencies
pip install -r requirements.txt
Download and unzip this dataset into the data/ folder, so that it looks like:
vision-classifier/
β
βββ data/
β βββ train/
β β βββ 0/
β β βββ 1/
β β βββ ...
β βββ val/
β βββ 0/
β βββ 1/
β βββ ...
Simply run:
python train.pyThis will:
- Train the model for 24 epochs
- Save the training/validation loss plot to
assets/loss_plot.png
Minimal requirements.txt:
torch
torchvision
timm
albumentations
opencv-python
matplotlib
tqdm
You can create this file with:
pip freeze > requirements.txtMIT License β see LICENSE
