XXH3 Hashing Powers Duplicate File Detection

When identifying duplicate files, Cisdem Duplicate Finder compares the file content, without considering file names. File content comparison is enabled by the XXH3 hash algorithm. The app also filters files by size in advance to help improve hashing efficiency.

Each file gets an XXH3 hash value based on its content. Files whose hash values match are detected as duplicates, no matter what they are named.

Use XXH3 to Find Duplicates Accurately

In duplicate file detection, what matters is whether two files share exactly the same file content. That's why Cisdem Duplicate Finder compares files based on file content. But how?

The app uses a hash algorithm called XXH3 to first generate a hash value for each file based on its file content. Files with identical content, regardless of file names, produce the same hash value. Then, the app compares hash values to find duplicate files.

A file with a unique size cannot be a duplicate, so it is skipped before hashing. The remaining files are hashed fully when small, or from the head, middle and tail when large.

Use File Size Filtering to Help Improve Speed

XXH3 is much faster than older hash algorithms such as MD5 and SHA-256. To further improve efficiency, the app filters files by size before the hashing process.

Filter out files with a unique size: It looks at each file's size. For example, a folder contains a single 8.4 MB file, a single 20.4 MB file, and a single 2.5 GB file. They can't possibly be duplicates with any other files in the folder. Among the remaining files, those with the same file size may be duplicates and enter the hashing process.

Hashing strategy based on file size: For smaller files, the app generates and compares hash values based on full file content. For larger files, generating full hash values would take longer and slow down the scan. So it hashes representative sections from the head, middle, and tail of each file instead.

Real-World Test Results

The test used a 7.25 GB folder containing 5,035 files across 72 subfolders, including photos, videos, music, documents, and other file types.

ToolScan timeDuplicate files foundStorage freed up
Cisdem Duplicate Finder using XXH3 hashing2 seconds2,5763.5 GB
Traditional duplicate file finder using MD525 seconds2,5653.47 GB

DINOv2 Small AI Model Powers Similar Photo Detection

Cisdem Duplicate Finder uses an on-device AI model called DINOv2 Small to intelligently detect similar photos, such as burst shots, resized or edited versions, versions taken from different angles, and more. This AI model runs entirely on users' computers through ONNX Runtime, without uploading users' photos to any cloud or server.

Note: This applies to Cisdem Duplicate Finder for Windows only and is coming to Mac soon. The Mac version currently uses traditional similar photo detection using Histogram, Features, and pHash methods.

The DINOv2 Small model reads a photo's visual content and turns it into a 384-dimensional vector, so photos with similar content end up with similar vectors.

Use DINOv2 Small to Understand and Represent Photos' Visual Content

DINOv2 Small is a deep learning vision model developed by Meta AI and has been trained on 142 million images.

Understand Visual Content: While traditional methods mainly check basic features like pixels, shapes, and colors, DINOv2 Small also looks at advanced features and understands the visual content in a photo. Therefore, even if similar photos have different details, such as angles or lighting, this model can still detect their visual similarity.

Generate Vectors: The model understands photos and then generates a 384-dimensional vector (e.g., 0.0266, ..., -0.0282) for each photo, which represents what a photo shows. Similar photos tend to have similar 384-dimensional vectors.

Similar photo examples that the model recognizes
Different Sizes or Formats

The model checks the visual content rather than file sizes or types. It recognizes that it's still the same subject, whether the photo is small or large, saved as JPEG or RAW.

Edited Versions

It focuses on the core subject itself and avoids being confused by cropping or rotating the photo, adjusting the colors, or adding watermarks.

Burst Shots

It understands that these photos were taken in quick succession and detects that the same subject moves slightly, while the background remains unchanged.

Different Angles or Poses

It can identify visual similarity between the same building from different angles or in different lighting, or between the same person in the same set with different poses or expressions.

HNSW organizes the vectors so that only potentially similar photos are finely compared, leaving completely different photos out of the comparison.

Use Faiss HNSW to Quickly Compare 384-Dimensional Vectors

Once every photo has a 384-dimensional vector to represent its visual content, it comes to comparing those vectors to find similar ones. Since comparing every vector against every other one would require a large number of comparisons, Cisdem Duplicate Finder does this in a more efficient manner.

It uses an algorithm called HNSW to help avoid unnecessary comparisons and focus on potentially similar photos. How? HNSW organizes vectors into a multi-layer navigation network, allowing the process to start from a general level and then move towards vectors that are closer to the target one, avoiding the need to compare every vector one by one.

The process is powered by Faiss, a framework developed by Meta for efficient similarity search. It provides the foundation for the search, while HNSW is the algorithm used to perform it. Together, they make similar image detection faster.

Real-World Test Results

The test used a photo collection containing 4,290 photos to compare the performance of AI-powered and traditional similar photo detection.

Similar image detection methodScan timeSimilar photo groups found
AI-powered6 s104
Traditional24 s53

3 AI Models Deliver Photo Quality Scoring

When users are cleaning up similar photos, spotting them is the first step. They need to decide which one to keep. Cisdem Duplicate Finder helps with this task using three on-device AI models running through ONNX Runtime, each looking at a photo from a different aspect: how well it was taken, how good it looks, and how people appear in it. Every evaluated photo gets a quality score from 0 to 10, helping users decide which one to keep.

Note: AI scoring is available on Windows only and coming to Mac soon.

The NIMA Technical model looks at blur, exposure and noise to judge how technically sound a photo is.

Use NIMA Technical to Check Technical Quality

NIMA Technical, an on-device AI model running locally on users' computers, looks at a photo's technical quality.

It assesses issues such as blur, overly dark or bright photos, visible noise in low light, and other visual issues that may make a photo look undesirable. However, sometimes, a photo with a blurred background can still be a good photo instead of a bad one. That's why using the NIMA Technical alone is not enough.

The NIMA Aesthetic model judges how attractive a photo is by looking at composition, colors, lighting and subject position.

Use NIMA Aesthetic to Check Aesthetic Quality

The NIMA Aesthetic model looks at whether a photo is attractive. It considers composition, colors, lighting, and subject position, then predicts how humans would rate it.

For example, two similar photos have similar sharpness and exposure, and one of them has a more balanced composition. The NIMA Aesthetic model can help distinguish between them.

MediaPipe Face Landmarker finds the faces in a photo and maps their key landmarks, so Cisdem Duplicate Finder can compare photos of people by expression and pose.

Use MediaPipe Face Landmarker to Evaluate Photos with People

For a photo with people in it, technical and aesthetic quality are only part of the visual quality. A technically good shot can still make a poor picture, because someone blinks or looks away. Those are the differences that help decide which shot you keep.

The MediaPipe Face Landmarker model looks at the face in the photo, considering details such as whether the eyes are open, where the person is looking, whether they are smiling or frowning, and how the head is turned.

This model runs locally, just like the others. It's used only to score the photo. It doesn't identify who the person is, and no facial data leaves users' computers.

Combine Various Evaluations for a Final Score

These three models work together to give each photo a final score, helping users to keep the best shot. For example, among burst shots of the same birthday celebration, the one that's sharp and where nobody blinks may get the highest score and be kept.

How Scoring Works

Not every photo needs all three models. Photos without people are scored based on technical and aesthetic quality, with the technical score playing a more important role. For photos with people, face quality matters the most, with the NIMA scores taking care of the rest.

What Scoring Is for

Cisdem Duplicate Finder provides automatic selection rules. The Select by Score rule works based on these scores. If applied, in each group of similar photos, the app selects all but the highest rated one for deletion.

NIMA Technical, NIMA Aesthetic, and MediaPipe Face Landmarker models combine to calculate a final score for Smart Selection.

Boost Efficiency with GPU Acceleration and Caching

AI processing can take a while when detecting similar photos or scoring a large number of photos. To improve efficiency, the app uses GPU acceleration and caching to speed up both initial scans and rescans. This helps reduce the processing time when working with large photo collections and avoid unnecessary repeated processing.

ONNX Runtime uses DirectML to run AI processing on the GPU when a compatible GPU is available. Without one, the app falls back to the CPU instead.

Accelerate AI Processing with GPU

When a compatible GPU is available on your computer, ONNX Runtime uses DirectML to accelerate AI processing on the GPU. This allows the app to get the job done more efficiently, which can help process large photo collections faster. Without a compatible GPU, the app uses the CPU instead.

Processing results from a scan are cached. When the same photo collection is scanned again, the app reuses the cached results instead of processing everything from scratch.

Speed Up Rescans with Caching

The processing results are cached between scans to avoid repeating work that has already been done. When you scan the same photo collection again, the app can reuse the results that were already processed instead of starting the processing entirely again. This makes rescans faster.