A Python library for image similarity analysis using Image Encoders and Neural Networks
Project description
Welcome to pyvisim!
pyvisim is a Python library for computing image similarities using encoding methods such as Fisher Vectors, VLAD
and Siamese Networks.
This project was made by me in cooperation with the Lehrstuhl für Automatisierung und Informationssysteme at the Technical University of Munich.
Table of Contents
Why pyvisim?
pyvisim is designed to provide a simple and efficient way to compare images. The use-cases include:
-
Image Retrieval
Retrieve the top-k most similar images from a dataset.- Use encoding methods like VLAD or Fisher Vectors to quickly find the most relevant matches. Please visit this juptyer notebook for an example.
- Example use: Building a fast image search engine for photo management software.
-
Deep Learning Embeddings
- Generate VLAD or Fisher vectors from neural network embeddings, e.g., VGG16 or other models.
- Enhance your deep learning pipeline by leveraging traditional encoding methods on top of CNN features.
-
Image Clustering
- Cluster images based on their similarities to group them by category or content. An example and benchmarking can be found in this notebook.
- Useful for organizing unlabeled data or generating pseudo-labels for further training.
-
Pipeline for Combining Multiple Encoders
- Chain various encoders in a single pipeline. An example can be found in this notebook.
- Achieve more robust similarity metrics by blending different feature representations.
-
Siamese Network (Coming Soon!)
- Train a neural network to learn a similarity function directly from pairs/triples of images.
- Possible use cases include face recognition, signature verification, or any image-based identity matching.
Installation
Currently, the package still needs to be tested and validated before being uploaded to PyPI. To use the library, you can clone the repository and install the package locally:
git clone # TODO: Add the link to the repository
cd similarity_metrics_of_images
pip install .
All experiments in this project was made on the Oxford Flower Dataset [7], for which I have created a custom dataset class. To use this class, import it as follows:
from image_similarity.datasets import OxfordFlowerDataset
In order to replicate the experiments done in this project, follow the preprocessing steps in the datasets README.
Contributing
We love contributions of all kinds—whether it’s suggesting new features, fixing bugs, or writing docs! Here’s how you can get involved:
- Fork this repository.
- Create a new branch for your changes.
- Open a pull request with a clear description of your idea or fix.
We welcome all feedback and hope to build a supportive community around pyvisim!
Get in Touch
If you have any questions or just want to say hi, feel free to:
- Open an issue on GitHub.
- Write me an email at vunhathuy234@gmail.com.
- Connect on LinkedIn to follow my work and share your thoughts.
TODO
The features below are planned for future releases:
- Implement proper unit tests to validate the functionality of the package before uploading to PyPI.
- Implement the siamese network.
- Add tensor sketch approximation and mutual information analysis for Fisher Vector, according to this paper by Weixia Zhang, Jia Yan, Wenxuan Shi, Tianpeng Feng, and Dexiang Deng 1
- Add support for vision transformers for the
DeepConvFeatureclass.
You are welcome to implement any of these features or suggest new ones!
License
This project is licensed under the terms of the MIT license.
Acknowledgements
I would like to thank the Lehrstuhl für Automatisierung und Informationssysteme at the Technical University of Munich for their support, guidance and provision of computational resources for this project, without which this project would not have been possible. I would also like to thank my supervisor, , for his guidance, as well as Dr. for her valuable feedback and suggestions.
References
[1] Weixia Zhang, Jia Yan, Wenxuan Shi, Tianpeng Feng, and Dexiang Deng, "Refining Deep Convolutional Features for
Improving Fine-Grained Image Recognition," EURASIP Journal on Image and Video Processing, 2017.
[2] Relja Arandjelović and Andrew Zisserman, 'All About VLAD', Department of Engineering Science, University of Oxford.
[3] E. Spyromitros-Xioufis, S. Papadopoulos, I. Kompatsiaris, G. Tsoumakas, and I. Vlahavas, "An Empirical Study on the
Combination of SURF Features with VLAD Vectors for Image Search," Informatics and Telematics Institute, Center for Research and
Technology Hellas, Thessaloniki, Greece; Department of Informatics, Aristotle University of Thessaloniki, Greece.
[4] Relja Arandjelović and Andrew Zisserman, "Three things everyone should know to improve object retrieval," Department of
Engineering Science, University of Oxford.
[5] Hervé Jégou, Florent Perronnin, Matthijs Douze, Jorge Sánchez, Patrick Pérez, and Cordelia Schmid, "Aggregating Local
Image Descriptors into Compact Codes," IEEE.
[6] Liangliang Wang and Deepu Rajan, "An Image Similarity Descriptor for Classification Tasks," J. Vis. Commun.
Image R., vol. 71, pp. 102847, 2020.
[7] Oxford Flower Dataset.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyvisim-0.1.1.tar.gz.
File metadata
- Download URL: pyvisim-0.1.1.tar.gz
- Upload date:
- Size: 34.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
384dd962738a20dc9e4b248cb343a25ffa0f5d353ffcaefca0d8dbc845e2843f
|
|
| MD5 |
a95ce58d89b994db182c26f64faa3a42
|
|
| BLAKE2b-256 |
f54ad559a66f4e97e2057b4a4888f021dabeea6dd621a10f318d482afb16ed8c
|
File details
Details for the file pyvisim-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyvisim-0.1.1-py3-none-any.whl
- Upload date:
- Size: 37.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09cd7c637128472a3ab0dcc893b9d7dd1ef8bac46d1a730d6fff0217d143639b
|
|
| MD5 |
4c56265a4547032ee9ff76fce21fa564
|
|
| BLAKE2b-256 |
8862cc098a0312cc35140abe8f517028feefe94a62b817964d740af2883e50f2
|