/image-retrieval-system

A content-based image retrieval (CBIR) system.

Primary LanguagePython

Simple Image Retrieval System

Overview

This project builds a simple Image Search Engine using the Keras framework with ResNet-50 as the backbone network (pre-train model). This system is a computer system used for browsing, searching and retrieving images from a large database of digital images.

Method practice

Convolutional Neural Network (ResNet50 backbone) + Cosine Similarity.

System flowcharts

System flowcharts!

Structure of directory

├── feature_extractor.py
├── offline.py
├── __pycache__
│   └── feature_extractor.cpython-37.pyc
├── README.md
├── server.py
├── static
│   ├── feature_database
│   │   ├── concat_all_feature.npz
│   │   ├── lion.npz
│   │   ├── pig.npz
│   │   ├── ...
│   ├── image_database
│   │   ├── lion
│   │   │   ├── 0209bbf635.jpg
│   │   │   ├── 05d42c9bd8.jpg
│   │   │   ├── ...
│   │   ├── pig
│   │   │   ├── 00ddea87ad.jpg
│   │   │   ├── 02b26f142c.jpg
│   │   │   ├── ...
│   │   ├── ...
│   └── image_uploaded
└── templates
    └── index.html

Hardware configuration

- Memory: 8,0 GiB
- Processor: Intel® Core™ i5-8365U CPU @ 1.60GHz × 8
- OS: Ubuntu 22.04.1 LTS (64-bit)

Dataset

Animal Image Dataset (90 different categories, 60 images per categories): 5400 Animal Images

Setup

  • Python 3.7 is used in this repository.
  • Clone the repository:
$ git clone https://github.com/danghieuan/image-retrieval-system.git

Feature Extractor (Employing ResNet-50 as the backbone network)

$ cd image-retrieval-system
$ python offline.py

offline!

Demo on Flask API

$ python server.py

demo!

Todo

  • Research Product Quantization algorithm for larger-scale indexing.

Reference