Abstract: Given a collection of bags where each bag is a set of images, our goal is to select one image from each bag such that the selected images are from the same object class. We model the selection as an energy minimization problem with unary and pairwise potential functions. Inspired by recent few-shot learning algorithms, we propose an approach to learn the potential functions directly from the data. Furthermore, we propose a fast greedy inference algorithm for energy minimization. We evaluate our approach on few-shot common object recognition as well as object co-localization tasks. Our experiments show that learning the pairwise and unary terms greatly improves the performance of the model over several well-known methods for these tasks. The proposed greedy optimization algorithm achieves performance comparable to state-of-the-art structured inference algorithms while being ~10 times faster. The code is publicly available on https://github.com/haamoon/finding_common_object.
Problem Definition
The central challenge addressed in this work is finding a common object across multiple collections of images, a problem central to tasks like few-shot common object recognition and object co-localization.
In this setup, we are provided with several "positive bags" of images or object proposals. It is known that at least one image in each positive bag contains a specific target object, but the identity of that image is unknown. Additionally, a "negative bag" containing images that definitely do not feature the target object is provided. The objective is to select exactly one image from each positive bag such that all selections contain the same target object class. Traditional Multiple Instance Learning (MIL) often struggles with novel classes or requires extensive training data. This paper proposes learning similarity metrics (potential functions) directly from data to improve generalization and introduces a faster inference method.
Proposed Methodology
The selection process is formulated as an energy minimization problem on a graph where nodes represent positive bags. The authors introduce two key innovations:
1. Learning Potential Functions
Instead of relying on fixed distance metrics, the approach adapts the Relation Network architecture to learn graph potential functions directly from data:
- Pairwise Potentials: These evaluate the likelihood that two images from different positive bags contain the same object.
- Unary Potentials: These assess the similarity of an image to the negative bag. To handle the variety of distractors in a negative bag, a temperature-scaled exponential-weighted average function is used, ensuring a high energy penalty if an image matches any distractor in the negative bag.
2. Greedy Inference Algorithm
Finding the optimal selection is NP-hard. While standard approximate solvers like Loopy Belief Propagation or TRWS exist, they are computationally intensive. The authors propose a hierarchical, divide-and-conquer tree algorithm. It pairs bags, computes joint selections, and prunes the list to the top-$k$ lowest energy combinations at each step, moving up to the root of the tree.
Experimental Evaluation
The method was evaluated on two primary tasks across three datasets: miniImageNet for few-shot recognition, and COCO 2017 and ImageNet for object co-localization.
Key Insights
- Learned Potentials Beat Fixed Metrics: Learning a relation metric significantly outperforms fixed metrics like cosine similarity. The network learns a comparison strategy that transfers well to unseen classes.
- Negative Bags as Distractor Filters: Using a negative bag for unary potentials provides a substantial performance boost by filtering out common distractors (e.g., a person appearing in images where the target is a specific indoor object).
- Computational Efficiency: The greedy inference algorithm prunes bad proposals early. On average, it only needs to compute approximately 15% of all possible pairwise potentials.
Results
- Few-Shot Recognition: On miniImageNet (16 positive bags, 20 negative images), the method achieved a 79.93% success rate, significantly higher than the ATNMIL baseline (67.26%).
- Co-Localization: On COCO, it achieved a 65.34% CorLoc score, surpassing MI-SVM (60.74%).
- Speed: The greedy algorithm matched the accuracy of state-of-the-art solvers (TRWS, AStar) while being roughly 10 times faster in total runtime.
Discussion and Conclusion
The proposed framework demonstrates that learning potential functions for structured inference can significantly enhance performance in few-shot scenarios. While the greedy algorithm requires tuning a pruning parameter $k$, results are robust across a range of values. Qualitative analysis shows occasional confusion between visually similar but semantically distinct objects (e.g., cups vs. potted plants). Future work may extend this efficient inference structure to other weakly supervised tasks such as video object tracking or co-segmentation.
Summary updated