I've tried to create a clone of Google's Reverse Image Search Engine.
The project aimed to build a content-based image retrieval system using a VGG-16 deep learning model and the CIFAR-10 dataset. The model was initialized with ImageNet weights and trained for multi-class classification. The performance of the model was evaluated and an accuracy of 89% was achieved on the validation set and 90% on the test set. The network front-end was then utilized for feature extraction and generated 60k image encodings. These encodings were used to compute similarity scores against the query image, resulting in the top 5 matches being retrieved. The project aimed to demonstrate the effectiveness of using deep learning models in content-based image retrieval.
├── LICENSE
├── Makefile <- Makefile with commands like `make data` or `make train`
├── README.md <- The top-level README for developers using this project
├── query-images <- Contains query images against which to find matches
├── readme-assets <- Contains images to be used in README.md
├── data
│ ├── processed <- The final, canonical data sets for modeling
│ └── raw <- The original, immutable data dump
│
├── models <- Trained and serialized models, model predictions, or model summaries
│
├── reports <- Generated analysis as HTML, PDF, LaTeX, etc.
│ └── figures <- Generated graphics and figures to be used in reporting
│
├── requirements.txt <- The requirements file for reproducing the analysis environment
│
└── src <- Source code for use in this project
├── __init__.py <- Makes src a Python module
│
├── data <- Scripts to download or generate data
│ └── make_dataset.py
│
├── models <- Scripts to train models and then use trained models to make
│ │ predictions
│ ├── train_model.py
│ ├── generate_encodings.py
│ └── predict_model.py
│
└── visualization <- Scripts to create exploratory and results oriented visualizations
└── visualize.py
Before you begin, ensure you have met the following requirements:
- You have a
Linux/Mac/Windows
machine. - You have installed a
python
distribution. For NVIDIA GPU support,conda
is preferred ascudatoolkit
andcudnn
packages hosted onconda-forge
channel can be installed easily. - You have installed
pip
. - You have installed
make
.
- Clone the repo
git clone https://github.com/himalayasharma/small-image-search-engine.git
- Create virtual environment.
make create_environment
- Activate virtual environment.
- Download and install all required packages.
make requirements
- Download and process CIFAR-10 dataset.
make data
- Train model on CIFAR-10 dataset.
make train
- Generate encodings for all images in the dataset.
make encodings
After the model is trained it can be used for inference.
- Put a query image in
query-images
directory. - Run the following command:
make predict
- Enter name of the image (with extension) and press enter.
Query images used here are not from the CIFAR-10 dataset.
Example 1:
Example 2:
Example 3:
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. If you have a suggestion that would make this better, please fork the repo and create a pull request. Don't forget to give the project a star! Thanks again!
- Fork this repository.
- Create a branch:
git checkout -b <branch_name>
. - Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch:
git push origin <project_name>/<location>
- Create the pull request.
Alternatively see the GitHub documentation on creating a pull request.
Distributed under the MIT License. See LICENSE.txt
for more information.