
PyTorch Playing Card Classifier
Deep-learning image classifier identifying 53 playing-card classes via EfficientNet-B0 transfer learning, built from scratch with custom Dataset/DataLoader pipelines and CUDA-accelerated training.
Overview
A deep learning image classification project that identifies 53 playing card classes (standard deck plus Joker) using transfer learning with EfficientNet-B0. Built from scratch with custom Dataset/DataLoader implementations, CrossEntropyLoss, and Adam optimizer with CUDA GPU acceleration. The project emphasizes foundational deep learning concepts including data processing, model configuration, and training loop implementation.
Problem Statement & Approach
Training an image classifier from scratch needs large data and compute; the goal here was to build a solid 53-class card classifier while learning the full PyTorch training workflow end to end.
Approach: Use transfer learning — take a pre-trained EfficientNet-B0 backbone and adapt it to 53 card classes — while implementing the Dataset/DataLoader, loss, optimizer, and training loop by hand to internalize each moving part.
System Architecture
A custom Dataset/DataLoader feeds batched card images into an EfficientNet-B0 backbone (via timm) with a replaced classification head; training runs on CrossEntropyLoss and the Adam optimizer with CUDA GPU acceleration.
Key Features
- Classifies 53 playing-card classes (standard deck plus Joker)
- EfficientNet-B0 transfer learning via the timm library
- Custom Dataset/DataLoader implementations built from scratch
- CrossEntropyLoss with Adam optimizer and CUDA GPU acceleration
- End-to-end training loop covering data processing and model configuration
Technical Stack
Framework
Model
Data & Viz
Challenges & Solutions
Challenge: Limited per-class data made training a deep network from scratch impractical.
Solution: EfficientNet-B0 transfer learning reused pre-trained features, so only the classification head needed to adapt to the 53 card classes.
Improvements
- Data augmentation for robustness to lighting and angle
- Export to ONNX for lightweight deployment
- A demo UI for live webcam card recognition

