Skip to main content

An image classification model for Fashion MNIST using PyTorch Lightning.

Project description

Description

This project implements an image classification model based on the Fashion MNIST dataset, using PyTorch Lightning to structure the code in a modular and scalable way. The dataset is loaded directly from torchvision.datasets. The goal is to train a simple convolutional network that classifies images into 10 different clothing categories.

Project Structure

fashion-mnist-classifier/
├── models/               # Directorio para modelos y checkpoints guardados
├── reports/              # Informes de evaluación y figuras generadas
├── src/
│   └── my_project/       # Código fuente del proyecto
│       ├── __init__.py
│       ├── config.py     # Configuraciones y parámetros
│       ├── dataset.py    # Dataset y DataModule
│       ├── model.py      # Modelo de PyTorch Lightning
│       ├── plots.py      # Funciones de visualización
│       └── train.py      # Script principal de entrenamiento
├── .gitignore
├── LICENSE               # Licencia del proyecto
├── pyproject.toml        # Metadatos y dependencias del proyecto
└── README.md             # Este archivo

Installation

To install dependencies and prepare the environment with uv, run the following commands in the terminal:

  1. Download and install dependencies: curl -sSf https://uv.io/install.sh | sh
  2. Initialize the environment: uv init
  3. Sync dependencies and environment: uv sync

Training and Evaluation

To run the training and evaluation script, first install the package in editable mode:

uv pip install -e .

Then, run the following command in the terminal:

fashion-mnist-classifier

Building and Publishing to PyPI

To build and publish the package to PyPI, follow these steps:

  1. Install build tools:
    uv pip install build twine
    
  2. Build the package:
    python -m build
    
  3. Publish to PyPI:
    twine upload dist/*
    
    You will be prompted for your PyPI username and password.

Technical Details

-Dataset: torchvision.datasets.FashionMNIST with custom transformations. -Model: Simple CNN with one convolutional layer, pooling, and fully connected layers. -Training: Implemented with PyTorch Lightning to facilitate handling epochs, performance, and metrics. -Configuration: Parameters such as batch size, paths, epochs defined in config.py. -Optimization: Adam with CrossEntropyLoss.

Reports & Visualizations

The project includes detailed reports and visualizations:

  • Confusion matrix
  • Per-class accuracy
  • Calibration curve
  • Misclassified image grids
  • Pixel distribution analysis

All outputs are stored in the reports/ folder.

Contact

-delrey.132148@e.unavarra.es -goicoechea.128710@e.unavarra.es -haddad.179806@e.unavarra.es

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fashion_mnist_classifier-0.1.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fashion_mnist_classifier-0.1.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file fashion_mnist_classifier-0.1.0.tar.gz.

File metadata

  • Download URL: fashion_mnist_classifier-0.1.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for fashion_mnist_classifier-0.1.0.tar.gz
Algorithm Hash digest
SHA256 832c93226b128595c9b1d23824106f47bf06665429de2e7f30108cb2fbd3b4b4
MD5 a854c29dd82096728a63dd307ce6c6a2
BLAKE2b-256 c48549ee82b8fd4558bb05f7d17f1af3cdfbeca7a57fe913cc80e251c6d5619a

See more details on using hashes here.

File details

Details for the file fashion_mnist_classifier-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fashion_mnist_classifier-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3911930b77878dadbcc670a2af59cec4705f293794d2cb87583933a711ced3b
MD5 eb6bb4c13f5b6561699ff2f651ecde9e
BLAKE2b-256 65143acc4b6412c6be3c6ace2fd0fadc630b3edff7efd763634f2b1923bb9366

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page