A DeepLearning model developed using PyTorch for classifying images from the Fashion MNIST data set. This is my first time using PyTorch and intended to teach me some basic concepts of it.
I tuned the hyper-parameters for 20 trials with 5 epochs each and then trained the model for 25 epochs.
This resulted in an accuracy of 93.19% for unseen test data.
The following graph shows a sample of the test data along with the models predictions.
As you can see, the model is pretty confident for all predictions that it got correct, but also relatively confident for the one
prediction that it got wrong, which I assume is due to the similarity of Shirts and Pullovers.
Since I have not deployed the Docker image for this project to Docker Hub, you need to create the image yourself.
- Clone the repo:
git clone https://github.com/qhilipp/FashionClassifier
- cd into the repo:
cd FashionClassifier
- Create the docker image:
docker build -t fashion-classifier:latest .
- Run the image:
docker run --name fashion-classifier-container -v $(pwd):/app fashion-classifier:latest python3.13 main.py --load model
Make sure you have Python 3.13 installed and the 'python' command pointing to version 3.13.
- Clone the repo:
git clone https://github.com/qhilipp/FashionClassifier
- cd into the repo:
cd FashionClassifier
- Create a virtual environment
python -m venv env
or with Condaconda create -n fashion-classifier python=3.13
- Activate it
source evn/bin/activate
or with Condaconda activate
- Install the packages
pip install -r requirements.txt
- Run
python main.py --load model
Argument | Shortform | Type | Description | Default Value |
---|---|---|---|---|
--load |
-l |
str | The name of the file from which the model should be loaded. | None |
--save |
-s |
str | The name of the file to which the model should be saved. | None |
--device |
-d |
str | The device on which PyTorch should perform the tensor calculations (cpu or cuda , if available). |
'cpu' |
--epochs |
-e |
int | The number of epochs used to train the model. | 20 |
--trials |
-t |
int | The number of trials to find optimal hyperparameters. | 5 |
--trial_epochs |
-te |
int | The number of epochs per trial when finding optimal hyperparameters. | 2 |
--load_hyper_parameters |
-lh |
str | The name of a JSON file from which the model should load its hyperparameters. | None |
--save_hyper_parameters |
-sh |
str | The name of a JSON file to which the model should save its hyperparameters. | None |