Skip to content

Robust image copy detection using deep autoencoder features and moment-based hashing with FAISS for fast large-scale retrieval.

Notifications You must be signed in to change notification settings

ol752274/Robust-Image-Copy-Detection

 
 

Repository files navigation

Robust Image Copy Detection Using Deep and Moment-Based Hashing with FAISS

Introduction

With the rapid growth of digital images on the Internet, sharing, editing, and re-distribution have become extremely easy due to advanced image editing tools. As a result, protecting the rights of original image creators has become increasingly important, motivating the need for reliable image copy detection techniques.


Overview

This project presents a robust image copy detection framework that balances robustness and discrimination in image hashing. The system combines deep global features and moment-based local features, followed by efficient large-scale retrieval using FAISS (Facebook AI Similarity Search).

The proposed method is evaluated on the UCID dataset and further validated on the large-scale COCO dataset, showing significant improvements over a baseline research approach.


Datasets Used

UCID Dataset

  • Used to evaluate the perceptual robustness of the proposed scheme.
  • Contains 1,338 original images.
  • Each original image is treated as a reference for generating manipulated copies.

COCO Dataset

  • Used for large-scale testing and scalability analysis.
  • Contains 40,000 images.

Data Preprocessing

Preprocessing is performed using preprocess_images.py.

  • Images are resized to 224 × 224 using bilinear interpolation.
  • Gaussian Low-Pass Filtering (GLF) is applied to smooth images, reduce noise, and remove high-frequency details.

Dataset Manipulation

Image manipulations are performed using manipulate.py to simulate real-world distortions.

Applied Transformations

  • Speckle Noise (SN): Variance range 0.001 – 0.01
  • Salt-and-Pepper Noise (SPN): Density range 0.001 – 0.01
  • Gamma Correction (GC)
  • Brightness Adjustment (BA)
  • Gaussian Low-Pass Filtering (GLF)
  • JPEG Compression (JC)
  • Watermark Embedding (WE)
  • Mirroring
  • Rotation

Each manipulated image is treated as a near-duplicate of its original image.


Key Properties of Image Hashing

An effective image hashing system must satisfy two key properties:

  • Robustness: Slightly modified versions of the same image should produce similar hashes.
  • Discrimination: Completely different images should produce very different hashes.

Balancing these two properties is the central challenge addressed in this work.


Baseline Method (Research Paper Implementation)

To study the robustness–discrimination trade-off, a baseline method from an existing research paper was implemented.

Feature Extraction

  • Global Features: VGG16-based deep features (40 features)
  • Local Features: Meixner Moments (16 features)
  • Total Hash Length: 56 features per image

Performance

  • Precision: 0.98
  • Recall: 0.10

Although the precision is high, the very low recall indicates poor robustness to image manipulations.


Proposed Method

To improve robustness while maintaining discrimination, a hybrid feature extraction approach is introduced.

Global Feature Extraction

  • Convolutional Autoencoder
  • Latent space dimension: 256 features

Local Feature Extraction (Block-wise)

Local features are extracted using multiple moment-based descriptors:

  • Meixner Polynomials

  • Krawtchouk Moments

  • Tchebichef Moments

  • Total local features: 2,940

Final Feature Vector

  • Global features: 256
  • Local features: 2,940
  • Total feature length: 3,196

Image Retrieval Using FAISS

Image retrieval is performed using FAISS (Facebook AI Similarity Search) for efficient near-duplicate detection.

Retrieval Process

  • Feature vectors are L2-normalized
  • Cosine similarity (inner product) is used
  • IVF-KMeans indexing is applied

FAISS Details

  • Database descriptors are clustered using k-means
  • Each descriptor is assigned to its nearest centroid
  • During retrieval, only the closest cluster(s) are searched
  • Similarity scores are sorted and filtered using a threshold (> 0.5)
  • Search time: < 1 second per query

Performance Evaluation

Metrics Used

  • Precision
  • Recall

UCID Dataset Results

  • Precision: 0.9420
  • Recall: 0.8553

COCO Dataset Results

  • Precision: 0.943
  • Recall: 0.9678

These results demonstrate strong robustness and scalability across both datasets.


Conclusion

The proposed image copy detection framework effectively balances robustness and discrimination by combining deep global features with moment-based local features. The use of FAISS with IVF-KMeans enables fast and scalable retrieval, making the system suitable for large-scale real-world applications.


About

Robust image copy detection using deep autoencoder features and moment-based hashing with FAISS for fast large-scale retrieval.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%