Simple Deep Learning Prototype for Clothing Image Classification
Built with PyTorch, FashionMNIST, and CNN fundamentals
This project demonstrates how a Convolutional Neural Network (CNN) can be used to classify clothing images.
It is built as a prototype for automated garment categorization, inspired by real-world e-commerce use cases such as product tagging and inventory organization.
Manually categorizing clothing images is time-consuming and inconsistent.
This project shows how deep learning can automate this process by classifying images into predefined categories, forming a foundation for:
- Product categorization
- Improved search filtering
- Inventory organization
This project uses the FashionMNIST dataset.
| Feature | Value |
|---|---|
| Image Type | Grayscale |
| Image Size | 28 × 28 |
| Classes | 10 |
| Examples | Shirt, Shoe, Bag, Dress |
The project utilizes a custom MultiClassImageClassifier designed for efficient image processing:
-
Convolutional Layer: 1 input channel to 16 output channels with a
$3 \times 3$ kernel. - Activation: ReLU for non-linearity.
-
Pooling: MaxPool2d (
$2 \times 2$ ) for spatial dimension reduction. - Classifier: Fully connected linear layer mapped to the specific number of garment classes.
[Image of Convolutional Neural Network architecture]
- Conv2D: Extracts visual features like edges and textures
- ReLU: Adds non-linearity to learn complex patterns
- MaxPooling: Reduces image size while keeping important features
- Fully Connected Layer: Produces final class predictions
- Custom CNN built with PyTorch
- Efficient data loading using DataLoader
- Evaluation using TorchMetrics
- Per-class performance analysis
- Load FashionMNIST dataset
- Convert images into tensors
- Train CNN using CrossEntropyLoss
- Optimize using Adam optimizer
- Evaluate using accuracy, precision, and recall
The model is evaluated using:
- Accuracy: Overall correctness
- Precision (per class): How many predicted items are correct
- Recall (per class): How many actual items are correctly identified
git clone https://github.com/YOUR_USERNAME/fashion-forward.git
cd fashion-forward