This project is the implementation of a convolutional denoising autoencoder using TensorFlow and Keras to clean noisy images from the STL-10 dataset for the blog post "Autoencoders 101: Learning hidden patterns in your data". The autoencoder learns to reconstruct clean images from their noisy counterparts.

- Loads and preprocesses the STL-10 dataset (unlabeled split).
- Adds Gaussian noise to images for training.
- Builds a deep convolutional autoencoder with skip connections.
- Trains the model to denoise images.
- Visualizes original, noisy, and denoised images.
- Saves model weights and results for reuse.
denoise_autoencoder.py # Main script for training and visualization
requirements.txt # Python dependencies
data/ # Created at runtime; stores processed dataset
results/ # Created at runtime; stores output images
weights/ # Created at runtime; stores trained model weights
- The
data/
,results/
, andweights/
directories are automatically created when you run the main script. You do not need to create them manually. data/
contains the processed STL-10 dataset with noisy and clean images.results/
contains visualizations of original, noisy, and denoised images.weights/
contains the trained autoencoder model weights.
This project uses Poetry for dependency management and asdf for tool versioning.
- Clone the repository.
- (Optional, recommended) Install asdf and run:
This will automatically install the correct Python version as specified in
asdf install
.tool-versions
. - Install dependencies with Poetry:
poetry install
Run the main script to train the autoencoder and visualize results:
poetry run python denoise_autoencoder.py
- The script will download STL-10 data, add noise, train the model, and save results.
- A small sample of denoised images will be saved to
results/denoised_stl10_images.png
.
- Python 3.12.2+
- Poetry >2.1.1
See pyproject.toml
for a full package breakdown.
This project is for educational purposes.