ROI-Gated SAHI: Content-Adaptive Slicing-Based Inference for Efficient Object Detection
Authors: Rashid Riyadh, Abd Ullah Khan, Imad Gohar, Muzammil Behzad
Organizations: Faculty of Information Technology, City University, Malaysia · Department of Information Convergence Engineering, Kyung Hee University, South Korea · Department of Computer Science, National University of Sciences and Technology, Pakistan · School of Computing and Artificial Intelligence, Sunway University, Malaysia · King Fahd University of Petroleum and Minerals, Saudi Arabia · SDAIA-KFUPM Joint Research Center for Artificial Intelligence, Saudi Arabia
Slicing-Aided Hyper Inference (SAHI) improves small object detection in high-resolution images but often spends substantial compute on background tiles. We propose region-of-interest (ROI)-Gated SAHI, an inference-time framework that introduces a lightweight proposer to localize foreground regions and restrict sliced refinement to informative areas. We evaluate the framework in two settings. On the COCO128 full split dataset comprising 128 images, static ROI-gating is slower on average than Full SAHI, achieving a speed ratio of 0.88, and yields a lower [email protected] of 0.6602 compared with 0.7569 for Full SAHI. A simple adaptive routing policy with τ= 0.4 educes the mean latency, achieving a slight gain of 1.02× over Full SAHI. On a three-image sparse-to-dense case study, ROI-gating achieves speedups ranging from 0.96× to 6.90× with a mean speedup of 3.41×. These results show that ROI-gating is most beneficial in sparse scenes and requires policy-based routing for robust average behavior.
Figures & tables
Fig. 1 : ROI-Gated SAHI pipeline: (top) baseline full-image patching; (bottom) proposer, ROI merge, coverage check with fallback, and selective refinement. Red dashed box marks injected ROI-gating components.
Fig. 2 : Complete overview of the proposed ROI-Gated SAHI framework, illustrating the sequential flow from Stage A to Stage E. The pipeline begins with high-resolution image input, followed by Stage A (Proposer), where a lightweight model generates coarse ROI candidates. Stage B computes ROI coverage and determines the routing criterion. Based on the threshold condition, the pipeline adaptively switches between Stage C (ROI-Gated SAHI), which selectively processes foreground regions, and Stage D (Full-SAHI), which processes the entire image grid. Finally, Stage E performs global detection fusion by combining outputs from the proposer and refiner branches using NMS to produce the final detections.
Fig. 3 : Principle of ROI-Gated SAHI sliced inference. Left : Baseline SAHI processes the full image grid (blue). Right : ROI-Gated SAHI first identifies a candidate region (green dashed boundary) and then processes only ROI tiles. Both paths detect the same object (red rectangle) in this example, illustrating how selective tiling reduces computation cost in sparse scenes.
TABLE I : Quantitative evaluation on COCO128. Speed is reported as mean Full/ROI latency ( >1 favors ROI-Gated). ROI Faster Count reflects per-image gains (Adaptive: routing). R={0.30,0.75} , τ=0.40 . F1 and Mean IoU report agreement with Full SAHI.
Fig. 4 : Latency Comparison: average latency for Full SAHI, Static ROI-Gated SAHI, and Adaptive routing (threshold 0.40). This figure compares the average runtime of the three options on the full dataset. Static ROI-Gated is slower overall, while Adaptive routing is the fastest on average because it uses ROI only when ROI area is small.
Fig. 5 : COCO128 full split (128 images): adaptive threshold sweep showing mean adaptive latency and number of images routed to ROI. This figure shows how performance changes when we move the routing threshold. As threshold changes, the number of images sent to ROI changes, and latency follows a curve. The paper setting (0.40) gives near-best latency while keeping routing behavior stable.
Fig. 6 : Thresholding for τ : adaptive threshold sweep showing mean adaptive latency and number of images routed to ROI. This figure shows how performance changes when we move the routing threshold. As threshold changes, the number of images sent to ROI changes, and latency follows a curve. The paper setting (0.40) gives near-best latency while keeping routing behavior stable.
Fig. 7 : Speed Ratio: per-image speed ratio versus ROI coverage, with break-even and regime boundaries. Each point is one image. Points above 1.0 mean ROI is faster; below 1.0 mean Full SAHI is faster. The plot shows that ROI tends to help more when ROI coverage is low, and tends to lose advantage as ROI coverage increases.
Image
Resolution
Full
ROI
Speed
Speedup
ROI%
detection
detection
(ms)
( × )
image1
1200×800
102
72
341/355
0.96
69.9
image2
1536×1024
13
4
579/244
2.38
26.4
image3
1024×1536
2
1
527/76
6.90
2.7
TABLE II : Three-image case-study frame statistics and detection counts.
Metric
Value
Frames Tested
3
Mean Speedup
3.41 ×
Mean ROI Coverage
33.0%
Total Full SAHI Detections
117
Total ROI-Gated Detections
77
Detection Agreement (Mean F1)
0.544
TABLE III : Aggregate performance summary for the three-image case study.
Image
Full latency
ROI latency
Speed
ROI
(ms)
(ms)
( × )
(%)
img1.jpeg
342
355
0.96
69.9
img2.jpeg
579
244
2.38
26.4
img3.jpeg
526.52
76.25
6.90
2.7
TABLE IV : Per-image latency and ROI coverage.
Fig. 8 : Per-image latency comparison between Full SAHI and ROI-Gated SAHI.
Fig. 9 : (Speedup vs ROI Coverage) Per-image speedup across different ROI regimes.
Image
F1
Precision
Recall
Mean IoU
image1.jpeg
0.49
0.60
0.42
0.89
image2.png
0.47
1.00
0.31
0.87
image3.png
0.67
1.00
0.50
0.98
TABLE V : Agreement of ROI-gated SAHI vs. full-image SAHI (IoU matching).
Fig. 10 : Case 1. Dense-scene (69.9% ROI) qualitative comparison showing the Input Image, Proposer Detections, Merged ROI Regions, ROI-Gated SAHI result, and Full SAHI baseline. ROI-gated processing yields near-baseline latency due to limited tile-saving potential.
Fig. 11 : Case 2. The moderate-density (26.4% ROI), where selective slicing reduces computation while preserving detection localization quality.
Fig. 12 : Case 3. Sparse-scene case (2.7% ROI), where skipping background regions produces the largest efficiency gain.
Fig. 13 : Case 2. Dense-scene qualitative comparison showing the Input Image, Proposer Detections, Merged ROI Regions, ROI-Gated SAHI result, and Full SAHI baseline.
Fig. 14 : Case 1. Dense-scene qualitative comparison showing the input image, proposer detections, merged ROI regions, ROI-Gated SAHI result, and Full SAHI baseline.
Fig. 15 : Case 2. Moderate-scene qualitative comparison showing the Input Image, Proposer Detections, Merged ROI Regions, ROI-Gated SAHI result, and Full SAHI baseline.