Skip to content

Latest commit

 

History

History
30 lines (16 loc) · 2.47 KB

README.md

File metadata and controls

30 lines (16 loc) · 2.47 KB

Image similarity

This directory provides examples and best practices for building image similarity systems. Our goal is to enable the users to bring their own datasets and train a high-accuracy model easily and quickly. To this end, we provide example notebooks with pre-set default parameters shown to work well on a variety of datasets, and extensive documentation of common pitfalls, best practices, etc.

The majority of state-of-the-art systems for image similarity use DNNs to compute a representation of an image (e.g. a vector of 512 floating point values), and define similarity between two images by measuring the L2 distance between the respective DNN representations.

A major difference between modern image similarity approaches is how the DNN is trained. A simple but quite powerful approach is to use a standard image classification loss - this is the approach taken in this repository, and explained in the classification folder. More accurate similarity measures are based on DNNs which are trained explicitly for image similarity, such as the FaceNet work which uses a Siamese network architecture. FaceNet-like approaches will be added to this repository at a later point.

Frequently asked questions

Answers to Frequently Asked Questions such as "How many images do I need to train a model?" or "How to annotate images?" can be found in the FAQ.md file. For image classification specified questions, see the FAQ.md in the classification folder.

Notebooks

We provide several notebooks to show how image similarity algorithms can be designed and evaluated.

Notebook name Description
00_webcam.ipynb Quick start notebook which demonstrates how to build an image retrieval system using a single image or webcam as input.
01_training_and_evaluation_introduction.ipynb Notebook which explains the basic concepts around model training and evaluation, based on using DNNs trained for image classification.
11_exploring_hyperparameters.ipynb Finds optimal model parameters using grid search.
12_fast_retrieval.ipynb Fast image retrieval using nearest neighbor search.

Coding guidelines

See the coding guidelines in the root folder.