This project implements a Convolutional AutoEncoder model for image compression using the CIFAR-10 dataset. The autoencoder is a type of unsupervised neural network that learns to compress (encode) images into a latent representation and then reconstructs (decodes) the images to their original form.
project/
├── src/
│ ├── data_loader.py # Data loading functions for CIFAR-10/100
│ ├── models.py # Autoencoder model architectures
│ ├── utils.py # Utility functions (visualization, PSNR calculation)
│ └── train.py # Training script
├── notebooks/
│ └── Compression.ipynb # Original Jupyter notebook
├── data/ # Dataset storage (auto-downloaded)
├── models/ # Trained models save here
├── logs/ # Training logs save here
├── requirements.txt # Python dependencies
└── README.md
- Image Compression: Reduces image dimensionality while preserving key features
- Multiple Architectures: Basic and advanced autoencoder models
- CIFAR-10/100 Support: Works with both CIFAR datasets
- Performance Metrics: PSNR calculation for reconstruction quality
- Visualization Tools: Compare original vs reconstructed images
-
Install dependencies:
pip install -r requirements.txt
-
Train the model:
cd src python train.py -
Or explore the original notebook:
jupyter notebook notebooks/Compression.ipynb
- Simple encoder-decoder structure
- 2 convolutional layers in encoder
- 2 transposed convolutional layers in decoder
- 6 convolutional blocks with batch normalization
- Progressive downsampling: 32x32 → 1x1
- Dense latent representation
- Symmetric upsampling decoder
- Loss Function: Binary crossentropy
- Optimizer: Adam
- Metrics: PSNR (Peak Signal-to-Noise Ratio)
- Callbacks: Early stopping, model checkpointing