Abstract
Traditional nearest-neighbor (NN) retrieval methods rely on static geometric distances in feature space, making them susceptible to noise and semantic misalignment. We present Targeted Manifold Manipulation-Nearest Neighbour (TMM-NN), a novel retrieval framework that identifies neighbors by their responsiveness to query-specific manifold perturbations. By repurposing backdoor mechanisms, TMM-NN achieves superior robustness to environmental noise and better aligns with human semantic judgment.
Introduction
Nearest-neighbor retrieval is fundamental to computer vision, yet it remains constrained by two primary issues: the arbitrary selection of distance metrics (e.g., Euclidean vs. Cosine) and extreme sensitivity to input noise. Standard metrics often fail when a query image undergoes transformations such as changes in brightness or Gaussian noise, causing it to drift away from its semantic neighbors in the high-dimensional feature manifold. The authors argue that semantic similarity is better defined by how samples behave within the model's learned internal representation rather than static geometric distance.
Methodology: Retrieval as Manifold Manipulation
TMM-NN shifts the paradigm from calculating static distances to measuring dynamic responsiveness. The process involves three key stages:
- Trigger Design: A lightweight, query-specific trigger patch is optimized. This patch is designed to be "orthogonal" to the model's existing manifold, ensuring it does not interfere with standard predictions for unrelated data.
- Targeted Fine-tuning: The pre-trained model is briefly fine-tuned to create a temporary "backdoor." The model is trained to classify the query image, when combined with the trigger, into a new "dummy" class while maintaining its original performance on the rest of the dataset.
- Retrieval via Confidence: The trigger is applied to all candidate images in the dataset. Candidates that are semantically similar to the query are more likely to be activated by the backdoor and classified into the dummy class. Retrieval is performed by ranking candidates based on their softmax scores for this class.
Robustness and Semantic Alignment
Unlike traditional methods that look at a single frozen layer, TMM-NN utilizes the full depth of the neural network's logic. Theoretical analysis using Lipschitz margins demonstrates that this trigger-based approach provides a significantly larger robustness radius than $L_2$ or Cosine metrics. This allows the system to maintain high retrieval accuracy even under severe image degradation.
Key Results
The effectiveness of TMM-NN was validated across MNIST, SVHN, GTSRB, and CIFAR-10 datasets using various architectures including ResNet and Vision Transformers.
Performance Under Noise
In self-retrieval tasks under heavy Gaussian noise or brightness fluctuations, TMM-NN consistently maintained accuracies above 80%, whereas traditional $L_2$ and Cosine metrics often dropped to near zero.
Human-Centric Evaluation
To assess semantic alignment, the authors employed Large Vision Language Models (LVLMs) like GPT-4o and Gemini-1.5 as judges. These models preferred TMM-NN's retrieved neighbors over baseline results in 76% to 97% of cases, noting that TMM-NN better captured subtle stylistic features like stroke thickness and orientation in handwritten digits.
Conclusion and Future Work
TMM-NN demonstrates that similarity is better defined by how samples respond to specific manifold nudges rather than by simple geometric proximity. While the method is computationally more intensive due to query-time optimization, its robustness and semantic precision offer a significant advancement for reliable retrieval systems. Future research will focus on reducing computational overhead and extending the manifold manipulation framework to other modalities such as text and audio.
Summary updated