How it works
Same photo, seen before, without storing it
A perceptual hash lets a service recognise a near-identical image from a short fingerprint, which serves dedup, caching and moderation.
Guides on How it works: Every score is a memory of somebody's opinion, An axis earns its place by being separately observable, What an image becomes before it is scored
A tool recognises a repeat upload with a perceptual hash, a short fingerprint that stands in for the image. Unlike a cryptographic hash, which changes completely if one pixel changes, it stays almost the same when the image is resized, recompressed or lightly cropped, and changes when the picture is genuinely different.
The intuition behind pHash
A typical perceptual hash shrinks the image down to a small grid, say 32 by 32 pixels, converts it to greyscale, and runs a frequency transform - a discrete cosine transform is the common choice - to capture its coarse structure rather than its fine detail. It keeps the low-frequency coefficients, which describe the broad shape and tonal layout of the image, and discards the high-frequency ones, which is where noise and compression artefacts live. Thresholding those coefficients against their average produces a short bit string, often 64 bits, that behaves like a fingerprint of the image's overall structure. Two images that look alike to a person tend to produce hashes that differ in only a handful of bits, measured by counting how many bits differ between them. Two images that are visually different tend to produce hashes that differ in roughly half their bits, which is what similarity search relies on.
This is a coarser, deliberately lossy process compared to the encoder that produces a scoring vector - a perceptual hash is built to answer "is this the same picture," while an embedding is built to answer "what does this picture contain," and the two serve different jobs even though both start by shrinking the image and throwing detail away.
What it tolerates and what it does not
Resizing, mild JPEG recompression, small crops and brightness adjustments generally leave a perceptual hash close to unchanged, because they mostly affect the fine detail the hash already discarded. A flip, rotation, heavy crop, or a filter that reshapes the image's tonal structure can shift the hash by enough bits that a naive comparison no longer flags it as the same image, which is why some pipelines compute several hash variants per upload to catch more of these cases. Whether flipping specifically survives depends on whether the pipeline hashes a mirrored version too; a default pHash treats a mirror as a different image.
What it is used for
Deduplication is the obvious use: a service can check an incoming upload against hashes of everything it has already processed and skip re-running an expensive model on a file it has effectively seen before, which is a caching decision that saves compute rather than a judgement about the photo. Perceptual hashes also support content moderation, where a database of hashes for known problematic images lets a platform flag a near-match without anyone viewing the new file directly. Microsoft describes PhotoDNA, a related system for known abusive imagery, as creating a hash of an image that is compared against hashes of previously identified illegal images, and states that its hash is not reversible and cannot be used to recreate an image. A third use is abuse detection around the scoring product itself: catching someone re-uploading a lightly edited version of the same photo to try for a better result, which a hash comparison across a session or account can surface cheaply.
The privacy angle, briefly
Because the hash is much smaller than the image and cannot be inverted back into a picture, it feels like a privacy-friendly way to remember a file without keeping it. That framing is only partly right, and why a hash is not the same thing as anonymisation is worth reading before assuming a hashed record is a harmless one. The dedup question is separate from the size or measurement question entirely - a hash carries no information about proportion, only about which pixels sat where in a shrunk, greyscale copy of the file. Whether a given tool hashes uploads at all, and what it does with the hash afterward, sits in the same category of question as reading a tool's retention practices in general, and Rate Cock is one of the tools whose pipeline includes this kind of pre-scoring step rather than sending every upload straight to the model untouched. A commissioned human reviewer has no equivalent step - a person looking at a photo either recognises it or does not, with no fingerprint involved either way.