Skip to content

A Julia application using Flux.jl to construct an autoencoder for image compression, processing multiple images to enhance feature recognition and reconstruction quality.

Notifications You must be signed in to change notification settings

vdrvar/julia_image_autoencoder

Repository files navigation

Julia Image Autoencoder

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.

Features

  • 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.

Prerequisites

  • Julia 1.0 or higher
  • Flux.jl
  • Images.jl
  • Plots.jl (optional for visualization)

Setup Instructions

Install Julia

Download and install Julia from the official site.

Clone the Repository

git clone https://github.com/vdrvar/julia_image_autoencoder.git
cd julia_image_autoencoder

Install Required Julia Packages

using Pkg
Pkg.add("Flux")
Pkg.add("Images")
Pkg.add("Plots") # Optional for visualization

Usage

  1. Prepare Images:

    • Place the images you want to process in the images folder. Supported formats are .png and .jpg.
  2. 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.

Examples

Below are five examples of the original images and their reconstructions by the autoencoder.

Example 1

Original Image: pic1 Autoencoder Input & Reconstructed Image:

output_pic1 jpg

Example 2

Original Image: pic2 Autoencoder Input & Reconstructed Image:

output_pic2 jpg

Example 3

Original Image: pic3 Autoencoder Input & Reconstructed Image:

output_pic3 jpg

Example 4

Original Image: pic4 Autoencoder Input & Reconstructed Image:

output_pic4 jpg

Example 5

Original Image: pic5 Autoencoder Input & Reconstructed Image:

output_pic5 jpg

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A Julia application using Flux.jl to construct an autoencoder for image compression, processing multiple images to enhance feature recognition and reconstruction quality.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages