Code Monkey home page Code Monkey logo

image-similarity-estimation-using-siamese-neural-networks's Introduction

MVTEC Image Similarity Estimation using Siamese Neural Networks

Table of Contents

About the Project

This project is aimed to implement an image similarity estimation model using deep learning that will be able to generalize the difference between two given images and output a similarity metric.

This similarity metric could be any distance measure. For the sake of simplicity and also since it has been effective in different research papers, we have chosen Euclidean distance as our distance metric as it is also bergman divergence.

We have used the dataset from MVTec AD which contains good and anomaly samples from 15 classes and trained the model using Siamese Neural Networks. We were able to do that by pairing images from same and different classes such that the model can learn the similarity metric.

We have trained the model for 100 epochs on a NVIDIA 3060Ti GPU which took around 3.5 hours. During the test time, we have compared images from same class and as well as images from other class and obtained their distance metric, which helped us analyze the performance of our model.

Installation

  1. Clone the repo using the following command:
git clone https://github.com/Pathi-rao/Project_for_Numerical_methods_for_algorithmic_systems_and_NeuralNetworks 
  1. Download the data from the provided link in data folder and extract it. Also, please make sure to update the file paths if necessary.

  2. Create a virtual environment with Python(For this step I will assume that you are able to create a virtual environment with virtualenv, but in any case you can check an example here.)

  • Activate the virtual environment and cd into the project directory
  1. Install requirements using pip:
pip install -r requirements.txt
  1. Run train.py to start training the model and use testing_image_pair.py to do inference on any two images

References

  • Paul Bergmann, Kilian Batzner, Michael Fauser, David Sattlegger, Carsten Steger: The MVTec Anomaly Detection Dataset: A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection; in: International Journal of Computer Vision, January 2021 pdf

  • Paul Bergmann, Michael Fauser, David Sattlegger, Carsten Steger: MVTec AD โ€“ A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection; in: IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019 pdf

  • Siamese Neural Networks for One Shot Image Recognition pdf

image-similarity-estimation-using-siamese-neural-networks's People

Contributors

pathi-rao avatar shihaozhangpro avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.