Detections Consensus¶
Class: DetectionsConsensusBlockV1
Source: inference.core.workflows.core_steps.fusion.detections_consensus.v1.DetectionsConsensusBlockV1
Combine detection predictions from multiple models using a majority vote consensus strategy, merging overlapping detections that receive sufficient votes from different models and aggregating their properties (confidence scores, bounding boxes, masks) into unified consensus detections with improved accuracy and reliability.
How This Block Works¶
This block fuses predictions from multiple detection models by requiring agreement (consensus) among models before accepting detections. The block:
- Takes detection predictions from multiple model sources (object detection, instance segmentation, or keypoint detection) as input
- Matches detections from different models that overlap spatially by calculating Intersection over Union (IoU) between bounding boxes
- Compares overlapping detections against an IoU threshold to determine if they represent the same object
- Counts "votes" for each detection by finding matching detections from other models (subject to class-awareness if enabled)
- Requires a minimum number of votes (
required_votes) before accepting a detection as part of the consensus output - Aggregates properties of matching detections using configurable modes:
- Confidence aggregation: Combines confidence scores using average, max, or min
- Coordinates aggregation: Merges bounding boxes using average (mean coordinates), max (largest box), or min (smallest box)
- Mask aggregation (for instance segmentation): Combines masks using union, intersection, max, or min
- Class selection: Chooses class name based on majority vote (average), highest confidence (max), or lowest confidence (min)
- Filters detections based on optional criteria (specific classes to consider, minimum confidence threshold)
- Determines object presence by checking if the required number of objects (per class or total) are present in consensus results
- Returns merged consensus detections, object presence indicators, and presence confidence scores
The block enables class-aware or class-agnostic matching: when class_aware is true, only detections with matching class names are considered for voting; when false, any overlapping detections (regardless of class) contribute votes. The consensus mechanism helps reduce false positives (detections seen by only one model) and improves reliability by requiring multiple models to agree on object presence. Aggregation modes allow flexibility in how overlapping detections are combined, balancing between conservative (intersection, min) and inclusive (union, max) strategies.
Common Use Cases¶
- Multi-Model Ensemble: Combine predictions from multiple specialized models (e.g., one optimized for people, another for vehicles) to improve overall detection accuracy, leveraging strengths of different models while filtering out detections that only one model sees
- Reducing False Positives: Require consensus from multiple models before accepting detections (e.g., require 2 out of 3 models to detect an object), reducing false positives by filtering out detections seen by only one model
- Improving Detection Reliability: Use majority voting to increase confidence in detections (e.g., merge overlapping detections from 3 models, keeping only those with 2+ votes), ensuring only high-confidence, multi-model-agreed detections are retained
- Object Presence Detection: Determine if specific objects are present based on consensus (e.g., check if at least 2 "person" detections exist across models, use aggregated confidence to determine presence), enabling robust object presence checking with configurable thresholds
- Class-Specific Consensus: Apply different consensus requirements per class (e.g., require 3 votes for "car" but only 2 for "person"), allowing stricter criteria for critical objects while being more lenient for common detections
- Specialized Model Fusion: Combine general-purpose and specialized models (e.g., general object detector + specialized license plate detector), creating a unified detection system that benefits from both broad coverage and specific expertise
Connecting to Other Blocks¶
The consensus predictions from this block can be connected to:
- Multiple detection model blocks (e.g., Object Detection Model, Instance Segmentation Model) to receive predictions from different models that are fused into consensus detections based on majority voting and spatial overlap matching
- Visualization blocks (e.g., Bounding Box Visualization, Polygon Visualization, Label Visualization) to display the merged consensus detections, showing unified results from multiple models with improved accuracy
- Counting and analytics blocks (e.g., Line Counter, Time in Zone, Velocity) to count or analyze consensus detections, providing more reliable metrics based on multi-model agreement
- Data storage blocks (e.g., Local File Sink, CSV Formatter, Roboflow Dataset Upload, Webhook Sink) to save or transmit consensus detection results, storing fused predictions that represent multi-model agreement
- Flow control blocks (e.g., Continue If) to conditionally trigger downstream processing based on
object_presentindicators orpresence_confidencescores, enabling workflows that respond to multi-model consensus on object presence - Filtering blocks (e.g., Detections Filter) to further refine consensus detections based on additional criteria, enabling multi-stage filtering after consensus fusion
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/detections_consensus@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
required_votes |
int |
Minimum number of votes (matching detections from different models) required to accept a detection in the consensus output. Detections that receive fewer votes than this threshold are filtered out. For example, if set to 2, at least 2 models must detect an overlapping object (above IoU threshold) for it to appear in the consensus results. Higher values create stricter consensus requirements, reducing false positives but potentially missing detections seen by fewer models.. | ✅ |
class_aware |
bool |
If true, only detections with matching class names from different models are considered as votes for the same object. If false, any overlapping detections (regardless of class) contribute votes. Class-aware mode is more conservative and ensures class consistency in consensus, while class-agnostic mode allows voting across different classes but may merge detections of different object types.. | ✅ |
iou_threshold |
float |
Intersection over Union (IoU) threshold for considering detections from different models as matching the same object. Detections with IoU above this threshold are considered overlapping and contribute votes to each other. Lower values (e.g., 0.2) are more lenient and match detections with less overlap, while higher values (e.g., 0.5) require stronger spatial overlap for matching. Typical values range from 0.2 to 0.5.. | ✅ |
confidence |
float |
Confidence threshold applied to merged consensus detections. Only detections with aggregated confidence scores above this threshold are included in the output. Set to 0.0 to disable confidence filtering. Higher values filter out low-confidence consensus detections, improving output quality at the cost of potentially removing valid but lower-confidence detections.. | ✅ |
classes_to_consider |
List[str] |
Optional list of class names to include in the consensus procedure. If provided, only detections of these classes are considered for voting and merging; all other classes are filtered out before consensus matching. Use this to focus consensus on specific object types while ignoring irrelevant detections. If None, all classes participate in consensus.. | ✅ |
required_objects |
Optional[Dict[str, int], int] |
Optional minimum number of objects required to determine object presence. Can be an integer (total objects across all classes) or a dictionary mapping class names to per-class minimum counts. Used in conjunction with object_present output to determine if sufficient objects of each class are detected. For example, 3 means at least 3 total objects must be present, while {'person': 2, 'car': 1} requires at least 2 persons and 1 car. If None, object presence is determined solely by whether any consensus detections exist.. | ✅ |
presence_confidence_aggregation |
AggregationMode |
Aggregation mode for calculating presence confidence scores. Determines how confidence values are combined when computing object presence confidence: 'average' (mean confidence), 'max' (highest confidence), or 'min' (lowest confidence). This mode applies to the presence_confidence output which indicates confidence that required objects are present.. | ❌ |
detections_merge_confidence_aggregation |
AggregationMode |
Aggregation mode for merging confidence scores of overlapping detections. 'average' computes mean confidence (majority vote approach), 'max' uses the highest confidence among matching detections, 'min' uses the lowest confidence. For class selection, 'average' represents majority vote (most common class), 'max' selects class from detection with highest confidence, 'min' selects class from detection with lowest confidence.. | ❌ |
detections_merge_coordinates_aggregation |
AggregationMode |
Aggregation mode for merging bounding box coordinates of overlapping detections. 'average' computes mean coordinates from all matching boxes (balanced approach), 'max' takes the largest box (most inclusive), 'min' takes the smallest box (most conservative). This mode only applies to bounding boxes; mask aggregation uses detections_merge_mask_aggregation instead.. | ❌ |
detections_merge_mask_aggregation |
MaskAggregationMode |
Aggregation mode for merging segmentation masks of overlapping detections. 'union' combines all masks into the largest possible area (most inclusive), 'intersection' takes only the overlapping region (most conservative), 'max' selects the largest mask, 'min' selects the smallest mask. This mode applies only to instance segmentation detections with masks; bounding box detections use detections_merge_coordinates_aggregation instead.. | ❌ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Detections Consensus in version v1.
- inputs:
Detections Stitch,Roboflow Dataset Upload,Detections Classes Replacement,LMM,Florence-2 Model,Anthropic Claude,Google Gemini,Llama 3.2 Vision,Motion Detection,VLM As Detector,Qwen3-VL,Size Measurement,SIFT Comparison,Line Counter,Roboflow Dataset Upload,Keypoint Detection Model,SIFT Comparison,SmolVLM2,Dynamic Zone,Distance Measurement,Email Notification,Clip Comparison,Buffer,SAM 3,Detections Stabilizer,Slack Notification,Object Detection Model,Path Deviation,EasyOCR,Florence-2 Model,SAM 3,Object Detection Model,Anthropic Claude,Detections Combine,OpenAI,Google Gemini,Keypoint Detection Model,Anthropic Claude,Pixel Color Count,VLM As Classifier,Time in Zone,Clip Comparison,Detections Merge,CogVLM,Byte Tracker,Twilio SMS Notification,VLM As Detector,PTZ Tracking (ONVIF).md),Instance Segmentation Model,OpenAI,Detections Transformation,OCR Model,Moondream2,Dynamic Crop,Model Monitoring Inference Aggregator,Detection Offset,Byte Tracker,OpenAI,Dimension Collapse,YOLO-World Model,Qwen2.5-VL,Time in Zone,Velocity,Email Notification,Instance Segmentation Model,Path Deviation,Camera Focus,Twilio SMS/MMS Notification,Roboflow Custom Metadata,Segment Anything 2 Model,Bounding Rectangle,Detections Filter,Perspective Correction,Image Contours,Detection Event Log,Local File Sink,Identify Changes,Byte Tracker,JSON Parser,Google Vision OCR,Time in Zone,SAM 3,Identify Outliers,Detections Consensus,Template Matching,Detections List Roll-Up,Google Gemini,Overlap Filter,Webhook Sink,VLM As Classifier,Seg Preview,OpenAI,Line Counter,Gaze Detection - outputs:
Detections Stitch,Roboflow Dataset Upload,Triangle Visualization,Detections Classes Replacement,Ellipse Visualization,Florence-2 Model,Blur Visualization,Halo Visualization,Motion Detection,Model Comparison Visualization,Keypoint Visualization,Pixelate Visualization,Size Measurement,Image Slicer,Line Counter,Stitch OCR Detections,Roboflow Dataset Upload,Line Counter Visualization,Label Visualization,Keypoint Detection Model,SIFT Comparison,Dynamic Zone,Distance Measurement,Email Notification,SAM 3,Detections Stabilizer,Slack Notification,Object Detection Model,Path Deviation,Corner Visualization,Florence-2 Model,SAM 3,Image Slicer,Object Detection Model,Detections Combine,Google Gemini,Bounding Box Visualization,Keypoint Detection Model,Background Color Visualization,Camera Calibration,Polygon Visualization,Time in Zone,Relative Static Crop,Detections Merge,Heatmap Visualization,Mask Visualization,Byte Tracker,Twilio SMS Notification,PTZ Tracking (ONVIF).md),Instance Segmentation Model,Detections Transformation,Stitch Images,Single-Label Classification Model,Stability AI Outpainting,Stitch OCR Detections,Dynamic Crop,Model Monitoring Inference Aggregator,Circle Visualization,Detection Offset,Byte Tracker,Trace Visualization,Color Visualization,YOLO-World Model,Icon Visualization,Dot Visualization,Time in Zone,Velocity,Email Notification,Instance Segmentation Model,Path Deviation,Camera Focus,Twilio SMS/MMS Notification,Roboflow Custom Metadata,Segment Anything 2 Model,Bounding Rectangle,Detections Filter,Text Display,Reference Path Visualization,Perspective Correction,Polygon Zone Visualization,Multi-Label Classification Model,Detection Event Log,Polygon Visualization,Identify Changes,Byte Tracker,Halo Visualization,Time in Zone,Stability AI Inpainting,Identify Outliers,Crop Visualization,Detections Consensus,Template Matching,Detections List Roll-Up,Overlap Filter,Webhook Sink,Classification Label Visualization,Multi-Label Classification Model,Line Counter,Single-Label Classification Model,Gaze Detection,Stability AI Image Generation
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Detections Consensus in version v1 has.
Bindings
-
input
predictions_batches(Union[object_detection_prediction,instance_segmentation_prediction,keypoint_detection_prediction]): List of references to detection predictions from multiple models. Each model's predictions must be made against the same input image. Predictions can be from object detection, instance segmentation, or keypoint detection models. The block matches overlapping detections across models and requires a minimum number of votes (required_votes) before accepting detections in the consensus output. Requires at least one prediction source. Supports batch processing..required_votes(integer): Minimum number of votes (matching detections from different models) required to accept a detection in the consensus output. Detections that receive fewer votes than this threshold are filtered out. For example, if set to 2, at least 2 models must detect an overlapping object (above IoU threshold) for it to appear in the consensus results. Higher values create stricter consensus requirements, reducing false positives but potentially missing detections seen by fewer models..class_aware(boolean): If true, only detections with matching class names from different models are considered as votes for the same object. If false, any overlapping detections (regardless of class) contribute votes. Class-aware mode is more conservative and ensures class consistency in consensus, while class-agnostic mode allows voting across different classes but may merge detections of different object types..iou_threshold(float_zero_to_one): Intersection over Union (IoU) threshold for considering detections from different models as matching the same object. Detections with IoU above this threshold are considered overlapping and contribute votes to each other. Lower values (e.g., 0.2) are more lenient and match detections with less overlap, while higher values (e.g., 0.5) require stronger spatial overlap for matching. Typical values range from 0.2 to 0.5..confidence(float_zero_to_one): Confidence threshold applied to merged consensus detections. Only detections with aggregated confidence scores above this threshold are included in the output. Set to 0.0 to disable confidence filtering. Higher values filter out low-confidence consensus detections, improving output quality at the cost of potentially removing valid but lower-confidence detections..classes_to_consider(list_of_values): Optional list of class names to include in the consensus procedure. If provided, only detections of these classes are considered for voting and merging; all other classes are filtered out before consensus matching. Use this to focus consensus on specific object types while ignoring irrelevant detections. If None, all classes participate in consensus..required_objects(Union[integer,dictionary]): Optional minimum number of objects required to determine object presence. Can be an integer (total objects across all classes) or a dictionary mapping class names to per-class minimum counts. Used in conjunction with object_present output to determine if sufficient objects of each class are detected. For example, 3 means at least 3 total objects must be present, while {'person': 2, 'car': 1} requires at least 2 persons and 1 car. If None, object presence is determined solely by whether any consensus detections exist..
-
output
predictions(Union[object_detection_prediction,instance_segmentation_prediction]): Prediction with detected bounding boxes in form of sv.Detections(...) object ifobject_detection_predictionor Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object ifinstance_segmentation_prediction.object_present(Union[boolean,dictionary]): Boolean flag ifbooleanor Dictionary ifdictionary.presence_confidence(Union[float_zero_to_one,dictionary]):floatvalue in range[0.0, 1.0]iffloat_zero_to_oneor Dictionary ifdictionary.
Example JSON definition of step Detections Consensus in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/detections_consensus@v1",
"predictions_batches": [
"$steps.a.predictions",
"$steps.b.predictions"
],
"required_votes": 2,
"class_aware": true,
"iou_threshold": 0.3,
"confidence": 0.1,
"classes_to_consider": [
"a",
"b"
],
"required_objects": 3,
"presence_confidence_aggregation": "max",
"detections_merge_confidence_aggregation": "min",
"detections_merge_coordinates_aggregation": "min",
"detections_merge_mask_aggregation": "union"
}