Skip to content

Abmstpha/image-compression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Convolutional AutoEncoder for CIFAR Dataset

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 Structure

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

Key Features

  • 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

Quick Start

  1. Install dependencies:

    pip install -r requirements.txt
  2. Train the model:

    cd src
    python train.py
  3. Or explore the original notebook:

    jupyter notebook notebooks/Compression.ipynb

Model Architectures

Basic Autoencoder (v1)

  • Simple encoder-decoder structure
  • 2 convolutional layers in encoder
  • 2 transposed convolutional layers in decoder

Advanced Autoencoder (v2)

  • 6 convolutional blocks with batch normalization
  • Progressive downsampling: 32x32 → 1x1
  • Dense latent representation
  • Symmetric upsampling decoder

Performance Evaluation

  • Loss Function: Binary crossentropy
  • Optimizer: Adam
  • Metrics: PSNR (Peak Signal-to-Noise Ratio)
  • Callbacks: Early stopping, model checkpointing

About

DeepLearning projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors