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:
SAM 3,Size Measurement,Roboflow Asset Library Attributes,MoonshotAI Kimi,Path Deviation,Twilio SMS Notification,Path Deviation,SmolVLM2,Keypoint Detection Model,S3 Sink,Overlap Filter,Email Notification,PTZ Tracking (ONVIF),SIFT Comparison,Event Writer,Identify Changes,SAM2 Video Tracker,Slack Notification,VLM As Classifier,Image Stack,Clip Comparison,Google Gemma,Bounding Rectangle,Object Detection Model,Qwen 3.6 API,Byte Tracker,SAM 3,Llama 3.2 Vision,Email Notification,SAM 3 Interactive,OCR Model,Velocity,Qwen3-VL,Mask Area Measurement,Google Gemini,JSON Parser,Track Class Lock,Anthropic Claude,Google Gemma API,OpenAI,Identify Outliers,Time in Zone,EasyOCR,OpenAI,YOLO-World Model,Llama 3.2 Vision,Detection Event Log,ByteTrack Tracker,Moondream2,Clip Comparison,Detections List Roll-Up,Camera Focus,Florence-2 Model,Google Gemini,OpenAI,Qwen3.5,OpenRouter,Detections Stabilizer,PLC ModbusTCP,Pixel Color Count,Buffer,MQTT Writer,SIFT Comparison,SAM 3,Model Monitoring Inference Aggregator,Webhook Sink,Google Vision OCR,Image Contours,Byte Tracker,Instance Segmentation Model,Motion Detection,Time in Zone,Local File Sink,Google Gemini,MoonshotAI Kimi,LMM,Segment Anything 2 Model,Dimension Collapse,Time in Zone,Mask Edge Snap,Line Counter,CogVLM,Qwen3.5-VL,Per-Class Confidence Filter,Instance Segmentation Model,Keypoint Detection Model,Template Matching,Gaze Detection,Anthropic Claude,OPC UA Writer Sink,Instance Segmentation Model,Dynamic Zone,Detections Combine,Seg Preview,Roboflow Dataset Upload,Qwen 3.5 API,Dynamic Crop,Detections Transformation,BoT-SORT Tracker,OC-SORT Tracker,OpenAI,Byte Tracker,Detections Stitch,Detection Offset,Distance Measurement,SORT Tracker,Perspective Correction,Qwen-VL,Twilio SMS/MMS Notification,Roboflow Vision Events,Microsoft SQL Server Sink,Florence-2 Model,VLM As Classifier,PLC EthernetIP,Anthropic Claude,Instance Segmentation Model,Roboflow Dataset Upload,VLM As Detector,Detections Consensus,Roboflow Custom Metadata,Object Detection Model,Detections Filter,Detections Merge,Detections Classes Replacement,VLM As Detector,Keypoint Detection Model,Qwen2.5-VL,SAM3 Video Tracker,Line Counter,Object Detection Model - outputs:
Roboflow Asset Library Attributes,Path Deviation,Keypoint Detection Model,Overlap Filter,PTZ Tracking (ONVIF),Reference Path Visualization,Event Writer,Slack Notification,SAM2 Video Tracker,Halo Visualization,Image Stack,Bounding Rectangle,Object Detection Model,Dot Visualization,Label Visualization,Background Color Visualization,Email Notification,SAM 3 Interactive,Velocity,Pixelate Visualization,Track Class Lock,Trace Visualization,Detection Event Log,ByteTrack Tracker,Camera Focus,MQTT Writer,Webhook Sink,SIFT Comparison,Motion Detection,Google Gemini,Polygon Visualization,Classification Label Visualization,Multi-Label Classification Model,Instance Segmentation Model,Keypoint Detection Model,Keypoint Visualization,Template Matching,Instance Segmentation Model,Icon Visualization,Dynamic Crop,Stability AI Inpainting,BoT-SORT Tracker,Detections Transformation,Bounding Box Visualization,Multi-Label Classification Model,Crop Visualization,Polygon Zone Visualization,Stability AI Outpainting,Byte Tracker,Mask Visualization,Halo Visualization,Detections Stitch,Distance Measurement,Detection Offset,SORT Tracker,PLC EthernetIP,Text Display,Overlap Analysis,Roboflow Dataset Upload,Detections Consensus,Object Detection Model,Detections Filter,Ellipse Visualization,Detections Merge,Keypoint Detection Model,Time in Zone,SAM 3,Size Measurement,Circle Visualization,Semantic Segmentation Model,Path Deviation,Twilio SMS Notification,Email Notification,Identify Changes,Byte Tracker,Single-Label Classification Model,Image Slicer,Mask Area Measurement,Heatmap Visualization,Stitch Images,Identify Outliers,Time in Zone,Single-Label Classification Model,YOLO-World Model,Blur Visualization,Stitch OCR Detections,Detections List Roll-Up,Florence-2 Model,Corner Visualization,Detections Stabilizer,Model Comparison Visualization,SAM 3,Model Monitoring Inference Aggregator,Byte Tracker,Instance Segmentation Model,Single-Label Classification Model,Polygon Visualization,Segment Anything 2 Model,Time in Zone,Mask Edge Snap,Line Counter,Line Counter Visualization,Stability AI Image Generation,Relative Static Crop,Per-Class Confidence Filter,Stitch OCR Detections,Gaze Detection,OPC UA Writer Sink,Color Visualization,Dynamic Zone,Detections Combine,Triangle Visualization,Roboflow Dataset Upload,Multi-Label Classification Model,OC-SORT Tracker,Image Slicer,Florence-2 Model,Perspective Correction,Roboflow Vision Events,Twilio SMS/MMS Notification,Microsoft SQL Server Sink,Instance Segmentation Model,Roboflow Custom Metadata,Camera Calibration,Detections Classes Replacement,Line Counter,Object Detection Model
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,keypoint_detection_prediction,instance_segmentation_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"
}