Skip to main content
QUICK REVIEW

[Paper Review] PDQ & TMK + PDQF -- A Test Drive of Facebook's Perceptual Hashing Algorithms

Janis Dalins, Campbell Wilson|arXiv (Cornell University)|Dec 16, 2019
Video Surveillance and Tracking MethodsComputer Science5 references5 citations
TL;DR

This paper evaluates Facebook's open-source perceptual hashing algorithms PDQ and TMK+PDQF for detecting modified images and videos in law enforcement contexts. It demonstrates their effectiveness in identifying perceptually similar but altered content—such as watermarked or format-converted media—using real-world AFP investigation data, and provides a containerized, API-accessible reference implementation to enable seamless integration into existing forensic workflows.

ABSTRACT

Efficient and reliable automated detection of modified image and multimedia files has long been a challenge for law enforcement, compounded by the harm caused by repeated exposure to psychologically harmful materials. In August 2019 Facebook open-sourced their PDQ and TMK + PDQF algorithms for image and video similarity measurement, respectively. In this report, we review the algorithms' performance on detecting commonly encountered transformations on real-world case data, sourced from contemporary investigations. We also provide a reference implementation to demonstrate the potential application and integration of such algorithms within existing law enforcement systems.

Motivation & Objective

  • To assess the robustness of Facebook’s PDQ and TMK+PDQF algorithms in detecting perceptually similar but modified images and videos encountered in real law enforcement investigations.
  • To address the challenge of repeated exposure of investigators to psychologically harmful materials due to ineffective detection of altered content using traditional cryptographic hashing.
  • To demonstrate the feasibility and practicality of integrating perceptual hashing into existing law enforcement digital forensic systems through a standards-based, containerized API implementation.
  • To reduce technical and deployment barriers for law enforcement agencies (LEAs) by providing a portable, accessible, and extensible reference implementation of the algorithms.
  • To promote broader adoption and community-driven development of perceptual hashing tools by open-sourcing a production-ready, interoperable service stack.

Proposed method

  • Applied PDQ and TMK+PDQF algorithms to real-world image and video samples from Australian Federal Police (AFP) investigations, including transformations like resizing, cropping, format conversion, and watermarking.
  • Used Hamming distance as the similarity metric between perceptual hashes, with a threshold of 30 or less indicating perceptual similarity.
  • Developed a containerized microservice using Docker to expose the PDQ and TMK+PDQF algorithms via a RESTful API, enabling integration with existing forensic tools.
  • Built a reference implementation using Python scripts to automate testing and hash generation, leveraging the open-source ThreatExchange repository codebase.
  • Deployed the service on heterogeneous systems using containerization to ensure portability across *nix and macOS environments, with plans to support Windows via .NET wrappers.
  • Utilized Faiss as a backend search engine for scalable similarity search, with a TMK-based image search service under development.

Experimental results

Research questions

  • RQ1How effective are PDQ and TMK+PDQF in detecting perceptually similar but altered images and videos under common transformation scenarios found in real investigations?
  • RQ2Can perceptual hashing algorithms like PDQ and TMK+PDQF significantly reduce repeated exposure of law enforcement personnel to known harmful content?
  • RQ3What is the practical feasibility of deploying perceptual hashing tools in existing law enforcement digital forensic workflows through standardized, containerized APIs?
  • RQ4How does the performance of the open-source implementation compare to proprietary alternatives like PhotoDNA in terms of accuracy, scalability, and integration ease?
  • RQ5What are the key technical and organizational barriers to adoption of perceptual hashing in law enforcement, and how can they be mitigated through open-source collaboration and tooling?

Key findings

  • PDQ successfully detected perceptually similar images across common transformations such as resizing, cropping, format conversion (e.g., JPG to PNG), and watermarking, with Hamming distances consistently below the 30 threshold for similarity.
  • The TMK+PDQF pipeline demonstrated robustness in identifying similar video frames despite changes in resolution, compression, and frame rate, confirming its utility for video-based investigations.
  • A containerized, API-based reference implementation was successfully built and deployed, enabling cross-platform portability and rapid integration into existing forensic systems.
  • The entire deployment stack—from git clone to running service—could be completed in under twenty minutes, highlighting the low barrier to entry for LEAs.
  • Performance gains are expected through tighter integration with host applications, such as in-memory processing instead of file I/O, which could dramatically improve speed.
  • The open-sourcing of these algorithms enables broader community contribution and evolution, offering a sustainable alternative to proprietary tools like PhotoDNA, especially for non-CEM use cases.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.