arXiv:2610.39937cs.CVOct 2026

Manuscript Offprint

arXiv:2610.39937

BiHashFormer: Hash-Driven Dual-Branch Transformer for Efficient Object Detection in HRW Shots

Jingchen Huang, Wenxi Li, Chenyang Lyu, Moran Liu, Haozhe Lin, Yuchen Guo

Jingchen Huang ∗^{*}

Department of Automation

Tsinghua University

Beijing, China

huang-jc23@

mails.tsinghua.edu.cn

Wenxi Li ∗^{*}

KLATASDS-MOE

School of Statistics

East China Normal University

Shanghai, China

wxli@sfs.ecnu.edu.cn

Chenyang Lyu ∗^{*}

AI Business

Alibaba International

Digital Commerce

Hangzhou, China

lyuchenyang.dcu@

gmail.com

Moran Liu

Beijing National Research

Center for Information

Science and Technology

Department of Automation

Tsinghua University

Beijing, China

Zhuoxi Lab, Hangzhou, China

liumoreran@gmail.com

Haozhe Lin

Beijing National Research

Center for Information

Science and Technology

Tsinghua University

Beijing, China

linhz@tsinghua.edu.cn

Yuchen Guo †^{\dagger}

Beijing National Research

Center for Information

Science and Technology

Tsinghua University

Beijing, China

yuchen.w.guo@

gmail.com

Abstract

Recent advances in gigapixel-level imaging have brought High-Resolution Wide shots to the forefront of research. However, these images present significant challenges: extreme sparsity of foreground, gigapixel-level resolutions and interleaving of foreground and background. This causes traditional detectors and attention mechanisms to be hindered by background, resulting in inefficiency and inaccuracy. To tackle this problem, we propose BiHashFormer, a dual sparsified branch transformer built on hashing. RoI Selector will predict the foreground proportion for top-k selecting target-containing windows. The compression branch processes windows selected and refines attention into HashAttention by discarding half of the key-value pairs, reducing cost and improving efficiency. The compensation branch uses HashMiner to perform low-cost hash searches in the remaining regions, recovering features of missed objects. Experiments confirm that the selection relationship in HashAttention is one-way and reveal the preference of different queries for keys. In experiments on the gigapixel benchmark PANDA, BiHashFormer reduces 37.5% backbone FLOPs while improving AP 50_{50} to 81.0%. Moreover, this parallel dual-branch structure allows the model to avoid inference delays caused by inter-branch dependencies, while achieving much greater stability than single-branch models, specially with low rates of RoI selection.

∗^{*}Equal contribution.

†^{\dagger}Corresponding author.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

1 Introduction

In computer vision, object detection has long been recognized as a central challenge, requiring algorithms to simultaneously determine the location and category of target instances within an image. The standard output of such systems usually consists of a bounding box together with a class label. Landmark approaches, exemplified by Fast R-CNN [13], have achieved notable success on large-scale benchmarks such as MS COCO [17]. More recently, advances in nondestructive imaging have shifted attention toward High-Resolution Wide (HRW) detection [3, 11]. This setting involves analyzing imagery with both extremely fine spatial detail and expansive coverage, posing unique computational and modeling challenges. Representative scenarios include gigapixel drone photography [25], satellite-based observation [8, 9, 29], and panoramic camera data [4].

The first problem in HRW detection is that the objects we care about only take up a very small part of the whole picture. In normal detection datasets, the foreground can cover more than half of the image. But in HRW scenes, the foreground is usually less than 15% [16], because the images come from large real-world views that naturally include wide areas of background such as sky, buildings, or trees. This means detectors have to search through a lot of background to find a few targets, and even strong models like DINO [33], Deformable DETR [35], and RMT [12] often make mistakes when the background is too dominant. This problem is illustrated by Figure 1.

The second challenge in HRW detection is the heavy demand on computation. Many application scenarios, such as UAV inspection (VisDrone [10]) or medical analysis (VL-Health [20]), require detectors to respond in real time. Yet as image resolution grows—from millions of pixels in COCO [17] to billions in PANDA [27]—the processing cost rises sharply. Conventional detectors scale poorly with input size, and inference speed can drop by nearly two orders of magnitude, making real-time deployment difficult.

Thirdly, the strong interleaving of foreground and background. HRW detection often requires larger windows (in Swin [21]) to capture sufficient context, especially in crowded scenes. Yet enlarging the window in conventional attention introduces excessive background tokens, diluting the focus on true targets. For example, a person on a lawn may be overshadowed because the cumulative attention to numerous lawn tokens exceeds that of the human body, causing facial tokens to misdirect attention and lowering detection accuracy. Furthermore, this makes

Figure

(a) Origin Images

(b) SparseFormer (fixed ratio = 0.5)

(c) BiHashFormer (Compr. & Compen.)

Figure 1: Comparison of RoI between different backbones. (b) SparseFormer selects a fixed ratio of regions for processing, regardless of input variability. (c) BiHashFormer combines lower selection ratio in the compression branch with dynamic compensation, making it more flexible and efficient. For the compensation branch, windows are drawn if any key in them is selected.

small objects or those surrounded by background more likely to be excluded during RoI selection, as shown in Figure 1.

Inspired by the widespread use of hashing in computer science, we propose BiHashFormer which combines dual-branch design with hashing, achieving both sparse attention and robust compensation for overlooked targets. Firstly, a variance-based scoring mechanism ranks windows, and a learned foreground predictor determines the image-dependent proportion of RoIs. For the selected RoIs, a sparse Attention mechanism called HashAttention is introduced. This approach compresses the key-value pairs for each query, leading to finer-grained computational reduction. At the same time, the quality of attention within RoIs will be improved. In the remaining regions, detection targets are localized within the Hamming feature space obtained through hash projection. Prototype encoding is employed for this localization and such compensation can be achieved with extremely low computational cost. On PANDA [27], BiHashFormer achieves a 37.5% reduction in FLOPs compared with SparseFormer [16], while significantly improving AP 50_{50}.

In summary, our key contributions are:

• We propose BiHashFormer, a dual-branch vision backbone based on transformer, which combines fine-grained sparse computation with global target compensation. It is able to effectively handle sparsely distributed objects intertwined with background in HRW images while reducing computational cost.

• We introduce HashAttention for the compression branch. By projecting features into a low-dimensional Hamming space, similarity computation is greatly reduced. The model compresses interactions between query and key-value pairs, achieving RoI-level sparse computation and refining attention results.

• We design HashMiner for the compensation branch. In the Hamming feature space, the model learns prototype codes for detection targets, enabling retrieval of objects from non-RoI regions with minimal overhead and providing compensation for small or difficult targets.

• We develop a label-free strategy with a special loss for prototype codes. Leveraging information from the compression branch, the model learns codes that capture broader and more accurate human-related semantics.