This repository contains an implementation of a Convolutional Autoencoder using the AlexNet architecture as the encoder. The autoencoder is a type of neural network used for unsupervised learning, particularly in the field of dimensionality reduction and image reconstruction.
The autoencoder is trained on the Imagenette dataset, which is a subset of 10 easily classified classes from the Imagenet dataset.
- Clone the repository
git clone https://github.com/abinthomasonline/alexnet-autoencoder.git
- Install the required packages
cd alexnet-autoencoder pip install -r requirements.txt
The demo uses the Imagenette dataset. The dataset can be downloaded from here.
Download the dataset and extract it to the data
directory.
wget https://s3.amazonaws.com/fast-ai-imageclas/imagenette2.tgz -P data/
tar -xzf data/imagenette2.tgz -C data/
python train.py
The checkpoints and metrics will be saved in the checkpoints
directory.
python plot.py
Plots of loss curve and reconstructed images will be saved in the plots
directory.
alexnet-autoencoder/
├── checkpoints/
│ ├── best.pt # Best checkpoint
│ ├── epoch_{i}.pt # Checkpoint at epoch i
│ ├── latest.pt # Checkpoint at latest epoch
│ └── metrics.json # Metrics
├── data/
│ └── imagenette2/ # Imagenette dataset
├── plots/
│ ├── loss.png # Loss curve
│ └── reconstructions.png # Reconstructed images
├── model.py # Model definition
├── plot.py # Plotting
├── README.md # This file
├── requirements.txt # Requirements file
└── train.py # Training
This project is licensed under the MIT License. Feel free to use, modify, and distribute the code as per the terms of the license.