A Deep Learning project that implements Content-Based Image Retrieval (CBIR) functionality using a Convolutional Autoencoder on the CIFAR-10 dataset. The system learns compressed feature representations (embeddings) of images to clean noisy inputs and retrieve visually similar images efficiently.
- Autoencoder Architecture: A convolutional neural network that compresses images into a lower-dimensional latent space.
- Image Denoising: Capable of removing noise from images as part of the reconstruction process.
- Similarity Search: Retrieves the most similar images from the training set for a given query image using Euclidean distance in the latent space.
- Performance Metrics: Evaluates retrieval performance using Mean Average Precision (mAP).
CBIR/
βββ src/ # Source code modules
β βββ data_loader.py # CIFAR-10 loading and preprocessing
β βββ model.py # Autoencoder architecture definition
β βββ train.py # Training procedure
β βββ evaluate.py # Evaluation metrics and scoring
β βββ visualization.py# Image plotting and saving
βββ models/ # Directory for saved models
βββ data/ # Data files (not tracked by git)
βββ output_images/ # Generated results (denoised/retrieved images)
βββ main.py # CLI Entry point
βββ requirements.txt # Python dependencies
- Clone the repository (if applicable) or download the source.
- Install dependencies:
pip install -r requirements.txt
The project is controlled via the main.py script.
Train the autoencoder from scratch.
python main.py train --epochs 20 --batch_size 128This will save the model to models/autoencoder.h5.
Calculate the Mean Average Precision score.
python main.py evaluate --n_test_samples 1000Perform a search for a specific test image.
python main.py demo --index 1 --n_samples 10Results will be saved in output_images/.
Visualize the denoising capability of the autoencoder.
python main.py denoiseThe model learns to map 32x32 RGB images to a robust feature space.
- Denoising: The model can effectively remove Gaussian noise from inputs.
- Retrieval: Queries return semantically similar images based on visual features (color, shape, texture) rather than just raw pixel matching.
This project is open-source and available for educational purposes.