Skip to content

Latest commit

 

History

History
183 lines (129 loc) · 4.23 KB

File metadata and controls

183 lines (129 loc) · 4.23 KB

Capestone

Hybrid Deep Learning system combining Autoencoder-based feature learning with classification on Fashion-MNIST, demonstrating improved accuracy over raw pixel models.

🧠 Hybrid Autoencoder + Classifier System

Deep Learning Capstone Project (Track C)


📌 Overview

This project builds a hybrid deep learning pipeline that combines:

  • Unsupervised learning (Autoencoder) for feature extraction
  • Supervised learning (Classifier) for prediction

The core idea is to show that latent features learned by an autoencoder improve classification accuracy compared to raw pixel inputs.


🎯 Objectives

  • Train a convolutional autoencoder to learn compact representations
  • Extract latent features from the encoder
  • Train a classifier using these features
  • Compare performance with a raw pixel baseline
  • Visualize results (loss, reconstruction, confusion matrix, latent space)

📂 Project Structure

Capstone-Project/
│
├── data/
├── models/
│   ├── autoencoder.pt
│   ├── classifier.pt
│
├── src/
│   ├── data.py
│   ├── preprocess.py
│   ├── autoencoder.py
│   ├── classifier.py
│   ├── raw_classifier.py
│   ├── train_autoencoder.py
│   ├── train_classifier.py
│   ├── evaluate.py
│   ├── visualize.py
│
├── notebooks/
├── outputs/
│   ├── loss_curve.png
│   ├── reconstruction.png
│   ├── confusion_matrix.png
│   ├── latent_space.png
│
├── config.py
├── main.py
├── requirements.txt
├── README.md
├── report.pdf

📦 Dataset

  • Fashion-MNIST (via torchvision.datasets)
  • 70,000 grayscale images (28×28)
  • 10 classes (clothing categories)

🔁 Workflow

  1. Load and preprocess dataset
  2. Train convolutional autoencoder
  3. Extract latent features (encoder output)
  4. Train classifier on latent features
  5. Train baseline classifier on raw pixels
  6. Evaluate and compare performance
  7. Generate visualizations

🧠 Models

🔹 Autoencoder

  • Conv2D → Conv2D → Latent (32) → Deconv → Deconv
  • Loss: MSE

🔹 Classifier

  • Fully connected network
  • Input: latent features
  • Loss: Cross-Entropy

🔹 Baseline

  • Classifier trained on raw pixels (for comparison)

📊 Results

Model Accuracy
Raw Pixel Classifier ~0.82
Autoencoder Features ~0.88

Conclusion: Learned features improve classification performance.


📈 Visualizations

  • Training loss curves
  • Reconstruction (original vs reconstructed)
  • Confusion matrix
  • Latent space (PCA)
  • Class distribution

All outputs are saved in the outputs/ folder. Screenshot 2026-05-01 175135 Screenshot 2026-05-01 175143 Screenshot 2026-05-01 175151 Screenshot 2026-05-01 175201 Screenshot 2026-05-01 175343


⚙️ Configuration

Hyperparameters are defined in config.py:

  • Batch Size
  • Learning Rate
  • Epochs
  • Latent Dimension

🚀 How to Run

1. Install dependencies

pip install -r requirements.txt

2. Run the pipeline

python main.py

📌 Key Insights

  • Autoencoder removes redundancy and learns meaningful features
  • Latent space shows clear class separation
  • Hybrid approach improves generalization

⚠️ Limitations

  • Limited training epochs
  • Simple architecture
  • Dataset is relatively small

🔮 Future Work

  • Variational Autoencoder (VAE)
  • Larger datasets (CIFAR-10/100, ImageNet)
  • Transfer learning
  • Deployment (Flask / Streamlit)