This project develops a simple autoencoder using Flux.jl in Julia to compress and decompress images, aiming to learn compact representations and reconstruct the original images with minimal loss.
- Image Compression: Compresses images into a lower-dimensional latent space.
- Image Decompression: Reconstructs images from their compressed form.
- Batch Processing: Processes all images in the specified folder and saves the results to an output folder.
- Julia 1.0 or higher
- Flux.jl
- Images.jl
- Plots.jl (optional for visualization)
Download and install Julia from the official site.
git clone https://github.com/vdrvar/julia_image_autoencoder.git
cd julia_image_autoencoder
using Pkg
Pkg.add("Flux")
Pkg.add("Images")
Pkg.add("Plots") # Optional for visualization
-
Prepare Images:
- Place the images you want to process in the
images
folder. Supported formats are.png
and.jpg
.
- Place the images you want to process in the
-
Run the Autoencoder Script:
julia autoencoder_script.jl
The script will:
- Load images from the images folder.
- Train the autoencoder.
- Process each image and save the results in the outputs folder.
When the autoencoder is trained on multiple images, it learns to recognize and encode common features across these images. As a result, the reconstruction of any single image can be influenced by the learned features from other images in the training set, leading to a more generalized representation of image characteristics.
Below are five examples of the original images and their reconstructions by the autoencoder.
Original Image: Autoencoder Input & Reconstructed Image:
Original Image: Autoencoder Input & Reconstructed Image:
Original Image: Autoencoder Input & Reconstructed Image:
Original Image: Autoencoder Input & Reconstructed Image:
Original Image: Autoencoder Input & Reconstructed Image:
This project is licensed under the MIT License - see the LICENSE file for details.