Autoencoder Image Denoising — MNIST
A simple fully-connected autoencoder trained to reconstruct clean MNIST digits from noisy versions of them.
Architecture
Input(784) → Dense(32, relu) [encoder/bottleneck]
→ Dense(784, sigmoid) [decoder]
Gaussian noise is added to the input images; the network is trained to output the clean version, using binary crossentropy loss between the reconstruction and the original image.
Approach
- Load MNIST, normalize pixel values to [0, 1]
- Add Gaussian noise (factor 0.5) to create noisy training inputs
- Train the autoencoder to map noisy → clean, compressing through a 32-unit bottleneck
- Evaluate by visually comparing original, noisy, and reconstructed images
Result
Despite the bottleneck compressing each 784-pixel image down to just 32 values, the network recovers a recognizable digit — showing the encoder is learning a meaningful compressed representation rather than just copying pixels through.
Tech stack
TensorFlow / Keras, NumPy, matplotlib
