YOLO Multi-Angle Object Deduplication: A Cross-Session Approach for 20x22px Small Targets

Multi-angle photo object deduplication requires a hierarchical strategy: metadata filtering, enhanced feature comparison, and multimodal fallback.
The article addresses how to avoid the same object being repeatedly identified and described when users upload photos of the same scene from multiple angles, and proposes a hierarchical deduplication architecture. The core difficulty is that some crops are only 20x22 pixels, making traditional visual hashing and feature matching almost useless, and user sessions are isolated from each other. The solution screens level by level from low cost to high cost: first using YOLO detection metadata for fast filtering, then extracting embedding features from enhanced small images for comparison, and finally using a multimodal large model as a fallback for uncertain pairs. A list of processed objects is maintained within the session; successful matches reuse descriptions and skip downstream AI calls. The overall strategy tends to be loose, believing that the cost of incorrect merging is higher than repeated description, and extreme small targets should have an area threshold and go through an independent review process.
Problem Background: The Challenge of Object Deduplication Across Multi-Angle Photos
When users photograph the same scene from different angles (front, side, close-up) and upload the photos, how do you ensure that the same physical object is identified and described only once? This is a real engineering problem raised by a developer on Reddit. He uses YOLO to detect objects and crops lightweight .webp images, but faces several tricky difficulties:
- The same object appears repeatedly across 3 to 4 photos taken from different angles, requiring cross-image deduplication;
- Some object crops are extremely small, for example only 20x22 pixels, with extremely limited visual information;
- User sessions are isolated from each other, so the deduplication logic cannot rely on globally shared state;
- It is necessary to avoid repeatedly calling expensive downstream AI description services for objects that have already been processed.

Core Difficulty: Small Crops and Cross-Angle Matching
A 20x22-pixel crop means the object may occupy only a few dozen pixels, and traditional image hashing or feature matching methods are almost useless at this resolution. What makes it worse is that the appearance of the same object can differ greatly across angles—texture, lighting, and occlusion are completely different between front and side views.
The implicit consensus in the Reddit discussion is that relying solely on visual similarity for deduplication is unreliable, especially in small-target scenarios. Multimodal signals need to be introduced to assist judgment.
Limitations of Visual Features
For a 20x22px crop, the discriminative power that color histograms or perceptual hashing can provide is extremely low. Two different objects may be mistakenly judged as the same object because their background colors are similar, while different-angle crops of the same object may be judged as different due to lighting changes.
Perceptual hashing (such as pHash) is an algorithm that compresses an image into a short fingerprint, generating a 64-bit hash value by applying a DCT transform to the image and taking low-frequency coefficients. Its advantage is robustness to scaling and slight color changes, but the premise is that the image contains enough global structural information. For a 20x22-pixel crop, there are inherently very few DCT low-frequency components, and the hash value is almost determined by background noise and compression artifacts, with discriminative power approaching randomness. The same applies to color histograms: for the color distribution statistics of a few dozen pixels, the variance is extremely large. If two different objects have similar backgrounds, the histogram distance may be smaller than that between two angles of the same object. Therefore, in small-target scenarios, such traditional visual features are not only unreliable but may even introduce systematic misleading, and they should be explicitly excluded from the main criteria.
The Value of Spatial and Contextual Cues
Prior knowledge can greatly reduce matching difficulty. For example, the relative spatial position of the same object in different photos, its relationship with surrounding objects, and the user's shooting order can all serve as auxiliary features. If the user first shoots the front and then the side, the temporal sequence information itself can provide a candidate range for matching.
Practical Solution: A Hierarchical Deduplication Strategy
Combining the ideas in the discussion, a feasible architecture is hierarchical processing, screening level by level from low cost to high cost.
Layer 1: Fast Filtering Based on Detection Metadata
Use the bounding box information output by YOLO for preliminary clustering. For the same object at different angles, its bounding box aspect ratio and relative position distribution in the frame often follow patterns. Loose thresholds can first be used for candidate pairing to exclude obviously unrelated objects.
Layer 2: Feature Comparison After Small-Image Enhancement
First perform super-resolution enhancement on the 20x22px crop, then extract embedding features. The key point mentioned in the discussion is not to match directly on small images, but to compare after upscaling or context filling. Even if the enhanced image remains blurry, the distance distribution of embedding vectors can provide a more stable signal than raw pixels.
Super-resolution enhancement (such as Real-ESRGAN, SwinIR, etc.) uses deep learning models to upscale low-resolution images and reconstruct high-frequency details. It should be clear that enhancement cannot "create something from nothing" to recover real information; its value lies in mapping extremely small images into the input distribution range expected by pretrained embedding models (such as CLIP, DINOv2). Most visual embedding models are trained at 224x224 or larger resolutions, and directly feeding a 20x22px image will cause severe feature extraction mismatch. Upscaling first and then extracting embeddings essentially lets the feature extractor work at the scale it is familiar with. Even if the reconstructed details are "guesses" by the model, the relative distance distribution of embedding vectors is still more stable and comparable than in the raw pixel space.
Layer 3: Multimodal Large Model as a Fallback
For pairs that cannot be determined by the first two layers, call a vision-language model for the final judgment. The design point here is to submit candidate pairs in batches rather than calling one by one, in order to control costs. The model only needs to answer "whether these two crops might be the same object," without generating a full description.
Vision-language models (VLMs) such as GPT-4V, Claude, and Qwen-VL have both image understanding and natural language reasoning capabilities, making them suitable for handling ambiguous problems such as "whether these two images are the same object" that require semantic judgment. There are three engineering points for using them as the fallback layer in the deduplication pipeline: first, the prompt should be limited to binary or ternary classification (yes/no/uncertain), avoiding the uncertainty and high latency of open-ended generation; second, submitting candidate pairs in batches can leverage the API's concurrency to dilute the cost per call; third, the model's judgment results and confidence should be recorded for subsequent threshold tuning. The disadvantages of VLMs are high latency and high cost, so they should only be triggered when the low-cost layers cannot decide.
Deduplication State Management Under Session Isolation
User session isolation means the deduplication logic must be closed within a single session. A practical approach is to maintain a list of processed objects within the session, where each entry contains: YOLO detection metadata, the feature vector of the crop, and the description text generated by the downstream AI.
When a new photo is uploaded, newly detected objects are first matched against entries in the list. Objects that match successfully directly reuse the existing description, skipping the downstream AI call. If matching fails, they are added to the list as new objects and description generation is triggered.
This design naturally satisfies the session isolation requirement, because the state exists only in the current session's storage. The cost is that objects cannot be deduplicated across sessions, but for the specific scenario of "a user uploading multi-angle photos of the same scene," within-session deduplication already covers the core need.
Session isolation is a common security and state management principle in web applications, meaning each user session has an independent data space and sessions do not share mutable state. In the deduplication scenario, this means global caches or cross-user shared object libraries cannot be used to assist matching, and the list of all processed objects must be bound to the current session's storage (such as in-memory session or Redis keys with a session prefix). The benefit of this is simple logic, no concurrency conflicts, and clear privacy boundaries; the cost is that the list is lost after the user closes the session, and the same scene will be reprocessed the next time it is uploaded. For the core scenario of "a single multi-angle upload," the session lifecycle is usually sufficient to cover the complete flow.
The Trade-Off Between Cost and Accuracy
The core contradiction of the entire solution is: the stricter the deduplication, the more likely different objects are mistakenly merged; the looser the deduplication, the more likely expensive AI description services are called repeatedly.
The tendency in the discussion is to prefer being somewhat looser—handing uncertain pairs to the downstream model for judgment rather than forcibly merging them locally. The reason is that the cost of repeatedly describing an object is controllable, while the cost of incorrectly merging two different objects and causing information loss is higher.
For extreme small targets such as 20x22px, it is recommended to set an area threshold at the detection stage. Crops below the threshold should be marked as "low confidence" and go through a separate review process, rather than being mixed with regular objects for deduplication.
Summary
Multi-angle object deduplication is essentially a cross-image entity matching problem. Under the dual constraints of small targets and session isolation, no single technology can solve it perfectly. The hierarchical strategy—metadata filtering, enhanced feature comparison, and multimodal fallback—is a relatively pragmatic path in current engineering. The key design principle is: explicitly pass uncertainty to the next layer rather than pursuing a certain answer at every layer.
Related articles

VERS: Editing Activation Explanations to Halve Reasoning Model Tokens
VERS guides reasoning models by editing activation explanations, cutting 45.8% of tokens on GSM8K with only a 0.82 pp accuracy drop and transferring to larger models, but losing accuracy on competition problems.

Finding Errors Is Not Enough: Selective Model Escalation for Entity-Targeted Sentiment Analysis
This study explores selective model escalation for entity-targeted sentiment analysis, comparing data collection ordering, uncertainty-driven re-examination, and model routing—finding that minority-class priority only helps at very small data volumes, the oracle upper bound far exceeds actual gains, and escalation must be tailored to each dataset.

WAS-PO: Using Whitened Advantages to Solve the Correlation Trap in Multi-Reward Reinforcement Learning
WAS-PO paper proposes whitening advantages to correct correlation bias in multi-reward RL: when rewards are correlated, naive weighted summation effectively applies Σ^{1/2}w instead of w. Experiments show training reward improves steadily, but held-out accuracy does not improve in sync, and under two rewards it actually falls behind.