NeuralHash gives different faces the same hash, a study finds

In short

What is a perceptual hash, and why does it collide?

A cryptographic hash (SHA-256, say) changes completely if one pixel changes. A perceptual hash does the opposite on purpose: pictures that look alike should produce the same or close values, so a re-saved, resized or lightly edited copy of a known image still matches. That is useful for finding copyright copies or known illegal images.

The price is that two pictures that look different to a person can also land on the same value. The paper calls those illegitimate collisions (false positives), and identical-looking pictures that get different values are false negatives. (Definitions in plain words are ours.)

For an ideal 96-bit hash, the paper notes that finding a collision by brute force needs about 2^48 calculations. The reported face collisions came after about 2^16, a far smaller number.

What did the KU Leuven team test?

The authors hashed images from two public datasets: PASS, which has no humans, and CelebA, a set of celebrity face photos with N = 202,599 images. They also made blurred versions of the faces (light, medium and high blur, and blur on the face only). They did not use the hash function's internals: they computed hashes and compared the results.

NeuralHash

The non-human PASS set had no such collisions. Across the five face sets (non-blurred and four blurred versions) the paper's Table 3 lists between 6 and 270 illegitimate collisions, with the first appearing after between 2^11.6 and 2^16.1 hashes. For the blurred sets, hash values shared by three or more different images were found, including two values each shared by five images in the highly blurred set.

False negatives. The authors identified at least 4,629 images in CelebA that should produce matches. Across the face sets, the minimum false-negative rate runs from 47.3% to 77.3%; for the set where only the face is blurred, it is 77.3%. The paper says this means the function "does not reliably detect perceptually identical images".

A new version of NeuralHash appears on macOS devices since early 2024, with no official explanation from Apple. The authors tested it too and report results very similar to the earlier model.

PhotoDNA

PhotoDNA compares two hashes by distance, so a match means the distance falls under a threshold. Microsoft has not published its threshold; earlier research suggested an L2 distance of 150 to 175. The earlier work, as the paper reports it, claimed these values prevent false positives while keeping detection above 99%.

The authors say the false-negative figures contradict the earlier claim of under 1%. In their words, a threshold of 150 "comes at the cost of missing nearly one quarter of perceptually identical images", while 175 raises false positives.

What happens at scale?

The tests used about 200,000 pictures. The authors extrapolate with a standard birthday-bound model (a model, not a measurement), treating each function as having fewer effective random bits than its nominal size.

The NeuralHash ranges are across the image types. The authors conclude that both functions give "high false positive and false negative rates" and cast "serious doubts" on their suitability for large-scale client-side scanning.

What is client-side scanning?

Client-side scanning checks content on the user's own device, against a list of known illegal material, before an end-to-end encrypted app encrypts it. The paper says governments are considering it for encrypted services. Apple proposed such a system based on NeuralHash in 2021 and withdrew it after criticism over privacy and security; the paper says NeuralHash nevertheless remains on all Apple devices, with its current purpose undisclosed.

What the study does not show

Terms in plain English

Where things stand

The paper says that at the time of submission Apple had reproduced all the results "without exception", acknowledged the issues and was investigating solutions. The authors had "constructive discussions" with Microsoft and confirm the PhotoDNA results hold for the version deployed at the time. We did not look for any later change by either company. The authors do not release new datasets or code; they say access for researchers is possible on request after ethical review.

Sources

Sources

Related stories

More from Vulnerability Research

All stories from Vulnerability Research