This project builds a denoising autoencoder using Keras to reconstruct pistachio images.
The model learns to remove noise from input images while preserving key visual structures.
Watch the analysis walkthrough here:
π https://drive.google.com/file/d/13tzPI8Nu54--qUF7t2QlANgjQZ82gDCa/view?usp=sharing
The dataset contains pistachio images with a consistent black background.
All images are in .jpg format with uniform size.
You can access the dataset here: https://drive.google.com/drive/folders/1KXWgrZw1nJY6u8xo9grzWbSVbxEFuaCt?usp=sharing
- Images split into train/test sets using
train_test_split. - Synthetic noise (e.g., Gaussian noise) is added to simulate noisy inputs.
- Normalization: pixel values scaled to [0, 1].
-
Model Architecture
- Autoencoder with convolutional encoder and decoder.
- Encoder: stacked Conv2D + MaxPooling layers.
- Decoder: Conv2DTranspose (upsampling) layers.
-
Training Setup
- Loss:
Mean Squared Error (MSE) - Optimizer:
Adam - Callback: EarlyStopping to prevent overfitting.
- Loss:
-
Evaluation
- Quantitative metrics: PSNR (Peak Signal-to-Noise Ratio), SSIM (Structural Similarity Index), MSE.
- Qualitative results: comparison of original β noisy β reconstructed images.
-
Hyperparameter Tuning
- Implemented with Keras Tuner for hidden size and learning rate search.
pistachio-autoencoder-keras/
ββ notebook/
β ββ pistachio-autoencoder.ipynb
ββ README.md
ββ requirements.txt
ββ LICENSE
ββ .gitignore
Install dependencies:
pip install -r requirements.txtjupyter notebook notebook/pistachio-autoencoder.ipynb