Best-Buddies Similarity (BBS) Overview
- BBS is a mutual nearest-neighbor similarity measure that identifies Best-Buddies Pairs to capture the structural agreement between point sets.
- It employs both hard and differentiable formulations to compute similarity scores that are robust to outliers, occlusions, and partial overlaps.
- BBS has been successfully applied in template matching, visual tracking, and 3D point cloud registration, showing superior accuracy over traditional methods.
Best-Buddies Similarity (BBS) is a parameter-free, mutual nearest-neighbor-based similarity measure between two point sets. BBS captures the structural agreement between sets by enumerating the pairs of points—termed Best-Buddies Pairs (BBPs)—where each point is simultaneously the nearest neighbor of the other with respect to a chosen metric. Originating in robust template matching, BBS has been systematically developed and extended for diverse applications such as image matching, visual tracking, and rigid 3D point cloud registration, including differentiable approximations for use within deep learning frameworks (Oron et al., 2016, Oron et al., 2016, Drory et al., 2020, Hezroni et al., 2021).
1. Formal Definition and Algorithmic Computation
Let and be two point sets in , typically defined via feature extraction from image regions, deep neural embeddings, or raw 3D coordinates. The pairwise distance matrix is constructed with for a given metric . The nearest neighbor of in is . A pair forms a Best-Buddies Pair if and only if
The hard (indicator) version introduces if the above holds, $0$ otherwise. The BBS score is then
yielding a similarity value in quantifying the proportion of high-fidelity mutual correspondences (Oron et al., 2016, Oron et al., 2016).
For differentiable optimization, the non-differentiable is replaced by the soft-argmin: and analogously row-wise. The soft best-buddies matrix is then , where is a tunable temperature (Drory et al., 2020, Hezroni et al., 2021).
The computational complexity for hard BBS is per evaluation, but random sampling (below) can ensure constant-time evaluation for large or unequal-sized sets (Oron et al., 2016).
2. Robustness Properties and Theoretical Analysis
BBS is fundamentally robust to outliers, occlusion, partial overlap, distractors, and complex deformations. Only pairs that are mutually the closest participate; spurious, one-sided correspondences do not increase the score. For missing data or occluded regions, points with no true partner will generally have large mutual distances, resulting in negligible BBP contributions. Notably, non-overlapping or outlier structures almost never contribute BBPs, thus not misleading the similarity measure (Oron et al., 2016, Drory et al., 2020, Hezroni et al., 2021).
Theoretical analysis reveals that, for large samples, the expected BBS between point sets drawn i.i.d. from densities and converges to a function closely related to the distance: with
Thus, maximizing BBS is asymptotically equivalent to minimizing statistical discrepancy, but without requiring histogram binning (Oron et al., 2016).
3. Variants, Approximations, and Extensions
Handling Unequal Set Sizes
Original BBS exhibits upward bias when sets are of disparate cardinalities; as , every eventually finds a "buddy," biasing BBS upwards. This is resolved via random sampling: uniformly sample points without replacement from both and and compute BBS on these subsets. This approach removes size bias, ensures scale invariance, and guarantees computational complexity (Oron et al., 2016).
Differentiable (Soft) Variants
For learning-based scenarios, smooth (soft) BBS is constructed, enabling integration into gradient-based optimization and deep learning frameworks. The soft formulation, combining row- and column-wise soft-argmin, provides a continuous analog to BBP assignment and is essential in DeepBBS and other registration losses (Drory et al., 2020, Hezroni et al., 2021).
Loss Functions for Registration
Four BBS-inspired losses have been proposed for 3D rigid registration:
- : negative soft mutual-NN count.
- : soft buddy-weighted point-to-point distances.
- : soft buddy-weighted point-to-plane distances (using normals).
- : hard best-buddy filtering of point-to-plane distances.
The combination of BBP filtering and geometric distance minimization yields registration algorithms robust to noise, occlusion, sparsity, and distractors (Drory et al., 2020, Hezroni et al., 2021).
4. Practical Applications
BBS has been applied successfully in:
Template Matching
BBS outperforms classical measures (SSD, NCC, histogram, BDS) for template matching under unconstrained conditions, exhibiting high mean Average Precision (mAP) in the presence of background clutter, occlusions, and nonrigid deformations. BBPs localize on inliers, producing well-localized matching peaks (Oron et al., 2016).
Visual Tracking
Best-Buddies Tracking (BBT) employs (sampled) BBS within a particle filter framework for model-free online tracking. The tracker utilizes random-sampled BBS to handle scale changes and integrates bag-of-templates for appearance variation. Ensembles of trackers with different process noises yield robust performance under challenging conditions (Oron et al., 2016).
3D Point Cloud Registration
BBS and its soft variant, embedded in differentiable loss functions, drive rigid registration algorithms for 3D scans and LiDAR data—demonstrated in KITTI/Apollo-Southbay—offering robustness to sparsity, outliers, occlusion, and even distractor objects. DeepBBS incorporates SoftBBS in an end-to-end deep network, training feature embeddings specifically to optimize mutual-nearest neighbor matching for highly accurate pose recovery even for unseen object categories (Drory et al., 2020, Hezroni et al., 2021).
5. Empirical Results and Limitations
BBS-based methods consistently demonstrate the following empirical properties:
- Superior overlap accuracy and mAP in template matching benchmarks, with significant gains (5–30%) over traditional scores.
- In tracking, scale invariance and appearance adaptation via sampling and bag-of-points strategies.
- In registration, state-of-the-art alignment errors in both synthetic and challenging real-world datasets, exceeding symmetry-ICP and modern learning baselines, particularly under low point counts, partial overlap, or strong distractors (Oron et al., 2016, Oron et al., 2016, Drory et al., 2020, Hezroni et al., 2021).
- Robustness to unseen categories, with DeepBBS++ achieving two orders of magnitude reduction in rotation MAE versus prior art on held-out classes (Hezroni et al., 2021).
Limitations include failure in settings where few or no true BBPs are available, such as when template size is too small relative to the background, or under extremely strong distractors mimicking the target (Oron et al., 2016).
6. Implementation Considerations and Recommendations
Efficient computation is critical in practical settings. For image-based tasks, caching strategies exploit the incremental nature of the sliding window to reduce complexity substantially; patch-based subsampling further accelerates evaluation. In tracking and detection, random sampling ensures computational tractability and removes scale bias.
Best-practice recommendations include:
- Always normalizing by the minimum set size, or via random sampling for unequal sets.
- Using rich joint features (e.g., color+location, deep CNN embeddings) to define the metric , as BBS is parameter-free aside from feature choice.
- In detection or tracking, considering top- BBS modes and applying nonmaxima suppression to mitigate distractor peaks.
- In learning contexts, incorporating soft BBS losses for end-to-end trainability (Oron et al., 2016, Oron et al., 2016, Drory et al., 2020, Hezroni et al., 2021).
BBS is applicable beyond vision: wherever mutual nearest-neighbor relationships robustly delineate genuine correspondences, the BBS principle generalizes, offering a theoretically justified, outlier-tolerant, and parameter-minimal matching protocol.