Inferensys

Glossary

Weighted Boxes Fusion (WBF)

An ensembling method that merges bounding boxes from multiple models by averaging their coordinates and confidence scores, rather than simply selecting one, to improve overall localization accuracy.
ML engineer running AI model benchmarks, performance charts on multiple screens, late night home office setup.
ENSEMBLE METHOD

What is Weighted Boxes Fusion (WBF)?

Weighted Boxes Fusion (WBF) is an ensembling algorithm that merges bounding box predictions from multiple object detection models by averaging their coordinates and confidence scores, rather than discarding redundant detections, to produce a more accurate final localization.

Weighted Boxes Fusion (WBF) constructs a consensus bounding box from overlapping predictions generated by different models in an ensemble. Unlike Non-Maximum Suppression (NMS), which eliminates lower-confidence boxes, WBF retains all proposed regions and fuses them. The fused box coordinates are calculated as a weighted average of the original boxes, where the weights are typically derived from each model's confidence score, ensuring that more certain predictions exert greater influence on the final localization.

This technique is particularly valuable in medical imaging tasks like lesion localization, where a single model may produce slightly offset bounding boxes for the same pathology. By averaging these spatial hypotheses, WBF reduces the variance of the ensemble and often yields a higher Intersection over Union (IoU) with the ground truth annotation than any individual model. The method directly addresses the instability of hard-NMS selection, improving the robustness and accuracy of computer-aided detection (CADe) systems.

ENSEMBLING VS. SUPPRESSION

WBF vs. Non-Maximum Suppression (NMS)

A feature-level comparison of Weighted Boxes Fusion and Non-Maximum Suppression for merging bounding box predictions in object detection pipelines.

FeatureWeighted Boxes Fusion (WBF)Non-Maximum Suppression (NMS)Soft-NMS

Core mechanism

Averages coordinates and confidence scores from multiple models

Selects the highest-confidence box and discards overlapping ones

Decays confidence scores of overlapping boxes instead of discarding

Input source

Predictions from multiple different models (ensemble)

Predictions from a single model

Predictions from a single model

Handles redundant boxes

Preserves all model contributions

Output box count

1 fused box per object

1 box per object

1 box per object

Confidence score handling

Weighted average of all contributing boxes

Keeps only the maximum score

Reduces scores based on IoU overlap

Risk of missing true positives

Low

High

Medium

Typical mAP improvement over NMS

0.3-0.5%

0.1-0.2%

ENSEMBLING METHODOLOGY

Key Characteristics of WBF

Weighted Boxes Fusion (WBF) is a post-processing algorithm that merges bounding boxes from multiple object detection models by averaging their coordinates and confidence scores, rather than simply selecting one prediction. This approach leverages the collective spatial intelligence of an ensemble to produce more accurate and robust localizations.

01

Coordinate Averaging, Not Elimination

Unlike Non-Maximum Suppression (NMS), which discards overlapping boxes, WBF constructs a fused box by averaging the coordinates of all proposed boxes from every model in the ensemble.

  • The fused box's coordinates are a weighted sum based on each model's confidence score.
  • This retains information from multiple models, even if one model's box is slightly offset.
  • Example: If Model A predicts a lesion at (10,10,50,50) with 0.9 confidence and Model B predicts (12,8,48,52) with 0.8 confidence, WBF merges them into a single, averaged box rather than choosing one.
02

Confidence Score Recalculation

WBF generates a new, fused confidence score for the averaged bounding box based on the collective agreement of the ensemble.

  • The final confidence is calculated as the average of the individual model confidences, weighted by the number of models that predicted the box.
  • This penalizes detections made by only a single model and rewards consensus.
  • Formula: C = (Σ confidence_i * w_i) / N where N is the total number of models and w_i is a per-model weight factor.
03

IoU Threshold for Box Matching

WBF uses an Intersection over Union (IoU) threshold to determine which boxes from different models refer to the same object before fusing them.

  • Boxes with an IoU above the threshold are matched into a cluster and fused together.
  • Boxes below the threshold are treated as separate detections.
  • This parameter directly controls the algorithm's sensitivity to distinguishing adjacent objects, such as two closely located nodules.
04

Superior to NMS for Ensemble Fusion

WBF consistently outperforms standard NMS and Soft-NMS when fusing predictions from an ensemble of diverse detection architectures.

  • NMS selects a single best box, discarding potentially valuable localization information from other models.
  • WBF is particularly effective when models have different strengths (e.g., one model is better at scale, another at localization).
  • Benchmark: In medical imaging challenges, WBF has been shown to improve mAP (mean Average Precision) by 1-3% over traditional NMS-based ensembling.
05

Model Weighting Strategy

WBF allows for the assignment of different weights to each model in the ensemble, reflecting their individual reliability.

  • A more accurate model can be given a higher weight, causing its coordinates to dominate the fused box.
  • Weights can be derived from validation set performance or domain-specific heuristics.
  • Example: A Faster R-CNN model trained specifically on small lesions might be weighted higher than a general YOLO model when fusing predictions for micro-calcification detection.
06

Application in Diagnostic Imaging

WBF is a critical tool for clinical AI pipelines where minimizing false negatives and maximizing localization precision is paramount.

  • It is used to ensemble models trained on different data folds, augmentations, or architectures for robust lesion localization.
  • By averaging predictions, WBF reduces the variance of the ensemble, leading to more stable and trustworthy bounding boxes for radiologist review.
  • It integrates seamlessly with Test Time Augmentation (TTA) workflows, fusing predictions from multiple augmented versions of the same image.
WEIGHTED BOXES FUSION

Frequently Asked Questions

Explore the technical details of Weighted Boxes Fusion (WBF), an advanced ensembling method that merges bounding box predictions from multiple object detection models to improve localization accuracy and diagnostic reliability in radiological imaging.

Weighted Boxes Fusion (WBF) is an ensembling algorithm that merges bounding box predictions from multiple object detection models by averaging their coordinates and confidence scores, rather than simply selecting one box or eliminating others. Unlike Non-Maximum Suppression (NMS), which discards overlapping boxes, WBF uses all proposed boxes to construct a fused, consensus box. The algorithm works by iteratively clustering boxes based on their Intersection over Union (IoU) overlap, then computing a weighted average of the coordinates and confidence scores for each cluster. The weights are typically derived from each model's individual confidence score, allowing higher-confidence predictions to exert greater influence on the final fused box. This approach is particularly valuable in medical imaging, where subtle lesions may be detected by one model but missed by another, and averaging their predictions can reduce both false positives and localization variance.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.