---
title: Self-Distilled RPN for Fine-Grained Visual Tasks
url: https://www.emergentmind.com/topics/self-distilled-region-proposal-network-sd-rpn
type: topic
---

# Self-Distilled RPN for Fine-Grained Visual Tasks

Searching arXiv for the specified SD-RPN papers to ground the article in the latest literature.
Self-Distilled Region Proposal Network (SD-RPN) is an annotation-free RoI localization module for multimodal large language models (MLLMs) that distills the model’s own intermediate attention into a lightweight Region Proposal Network, enabling high-resolution fine-grained perception without requiring costly supervision or full model fine-tuning. It was introduced in the context of fine-grained MLLM perception in “Catching the Details: Self-Distilled RoI Predictors for Fine-Grained MLLM Perception” and was subsequently incorporated as a core refinement branch in Q-Zoom, a query-aware adaptive perception framework for efficient MLLMs [2509.16944] [2604.06912].

## 1. Problem formulation and design objective

SD-RPN addresses a central bottleneck in MLLM perception: fine-grained tasks such as reading small text, document understanding, and dense scene perception require high-resolution visual information, yet processing entire high-resolution images is computationally prohibitive. In the formulation used by LLaVA-like systems, the model processes low-resolution visual tokens and then decodes auto-regressively; a natural compromise is therefore to identify a small Region-of-Interest (RoI), crop and up-sample it, and feed that crop back into the model [2509.16944].

The immediate motivation for SD-RPN is the trade-off exhibited by prior RoI strategies. Training-based approaches depend on large-scale annotated datasets, while training-free methods that use internal attention are computationally inefficient and less accurate, requiring either multi-pass prefill stages or reliance on the slow auto-regressive decoding process. The SD-RPN formulation is explicitly designed to resolve this trade-off by transforming noisy middle-layer attention into pseudo-labels and then training a lightweight predictor that localizes RoIs in one forward pass. In Q-Zoom, the same idea is further embedded within a two-stage inference policy in which a lightweight Dynamic Gating Network first predicts whether high-resolution refinement is needed and activates SD-RPN only for queries that demand fine-grained perception [2604.06912].

This architecture suggests a broader conceptual shift from direct use of raw cross-attention to self-distilled localization. Rather than treating attention maps as final grounding outputs, SD-RPN treats them as imperfect teacher signals that can be denoised, sparsified, and distilled into a deployable module.

## 2. Self-distilled pseudo-label generation

The teacher signal in SD-RPN is derived from response-to-image cross-attention in the MLLM’s middle layers. In the original formulation, visual token features from layer \(l\) are denoted \(H_v\in\mathbb{R}^{(HW)\times d}\), and the cross-attention scores are \(\mathbf A\in\mathbb{R}^{N_t\times(HW)}\), softmaxed over visual tokens for each of the \(N_t\) response tokens. Averaging over heads and response tokens yields a per-pixel RoI map \(\mathbf M_{\mathrm{RoI}}\in\mathbb R^{H\times W}\). In Q-Zoom, the same teacher-stage logic is expressed as a middle-layer grounding map \(M_{\mathrm{RoI}}^l\in\mathbb R^{H\times W}\), obtained by averaging attention weights \(A^l\in\mathbb R^{N_t\times HW}\) over text tokens [2509.16944] [2604.06912].

A key problem is that raw attention is noisy. The papers identify attention “sinks” and incomplete activation as recurrent failure modes. SD-RPN therefore begins with sink-token removal. Visual token \(j\) is suppressed when its feature norm exceeds a threshold \(\tau_{\rm norm}\), giving
\[
(\mathbf M'_{\mathrm{RoI}})_j
=
\begin{cases}
0, & \Vert (H_v)_j\Vert_2 > \tau_{\rm norm},\\
(\mathbf M_{\mathrm{RoI}})_j, & \text{otherwise.}
\end{cases}
\]

After denoising, SD-RPN uses selective label assignment rather than dense supervision. Let \(a_j=(\mathbf M'_{\mathrm{RoI}})_j\) and \(a_{\max}=\max_j a_j\). The foreground set is
\[
\mathcal S_{fg}=\{j\mid a_j\ge\tau_{fg}\,a_{\max}\},
\]
and the minimal enclosing bounding box around \(\mathcal S_{fg}\) is \(\mathcal B_{fg}\). The background set is
\[
\mathcal S_{bg}=\{\,j\not\in\mathcal B_{fg}\text{ and }a_j\le\tau_{bg}\,a_{\max}\}.
\]
The pseudo-label map is then tri-state:
\[
\bar M_j=
\begin{cases}
1, & j\in\mathcal S_{fg},\\
0, & j\in\mathcal S_{bg},\\
-1, & \text{otherwise.}
\end{cases}
\]

The use of \(-1\) to mark ignored tokens is central. It formalizes ambiguity resolution by excluding uncertain positions from supervision instead of forcing them into foreground or background. Q-Zoom reports that the best results are obtained at \(\tau_{fg}=0.20\) and \(\tau_{bg}=0.05\), and that tying them to the same value degrades performance by \(\sim 1\)–\(2\) points, indicating that asymmetric foreground/background criteria are materially important for the quality of the distilled labels [2604.06912].

## 3. Network architecture and training objective

SD-RPN is deliberately lightweight. In the original instantiation, the first \(B\) layers of the pretrained MLLM are frozen, and \(R\) trainable Transformer blocks are stacked on top, initialized from layers \(B+1\) to \(B+R\) of the MLLM. For LLaVA-1.5-7B, the reported example uses \(B=15\) frozen layers and \(R=3\) trainable RPN blocks; in Q-Zoom, all main experiments likewise use \(R=3\), and ablations on Qwen2.5-7B show that performance peaks at \(R=3\) and dips at larger depths [2509.16944] [2604.06912].

The predictor operates directly on intermediate hidden states. From the RPN’s last hidden layer, SD-RPN collects all visual tokens \(H_v\in\mathbb R^{(HW)\times d}\) and a set of RoI query vectors \(H_{\mathrm{RoI}}\in\mathbb R^{n\times d}\), where each query is the hidden state of the last token of a user-question turn. In Q-Zoom’s single-query setting, this is expressed as the hidden state of the final user query token, \(H_{\mathrm{rpn}}^u\), together with the visual token states \(H_{\mathrm{rpn}}^v\) [2509.16944] [2604.06912].

Dense RoI prediction is produced by reusing Transformer attention projections. After normalization and linear projections,
\[
Q_{\mathrm{RoI}} = LP_q\bigl(\mathrm{LN}(H_{\mathrm{RoI}})\bigr),\qquad
K_v = LP_k\bigl(\mathrm{LN}(H_v)\bigr),
\]
and the dense score map is
\[
\widehat{\mathbf M}_{\mathrm{RoI}} = Q_{\mathrm{RoI}}K_v^\top \in\mathbb R^{n\times(HW)}.
\]
Q-Zoom emphasizes that, instead of adding a new conv head or anchors, SD-RPN repurposes the \(R\)-th block’s self-attention matrices \(LP_q,LP_k\); in practice, multi-head scores are computed per head and then averaged [2604.06912].

No explicit box-regression head is used. SD-RPN outputs a per-token RoI likelihood or dense spatial heatmap. In the original training setup, the student branch predicts \(\widehat{\mathbf M}_{\mathrm{RoI}}\) and is optimized against the pseudo-label map with a masked binary cross-entropy over non-ignored tokens:
\[
\mathcal L_{\rm BCE}
=
-\sum_{j:\bar M_j\neq -1}
\Bigl[
\bar M_j\log\sigma(\widehat M_j)
+
(1-\bar M_j)\log\bigl(1-\sigma(\widehat M_j)\bigr)
\Bigr].
\]
Back-propagation is restricted to the \(R\) RPN layers, while the first \(B\) layers remain frozen. In Q-Zoom this same objective is written as \(\mathcal L_{\rm RPN}\) and described as selective binary cross-entropy, again restricted to tokens with \(\bar M_{\mathrm{RoI},j}\neq -1\) [2509.16944] [2604.06912].

This design suggests that SD-RPN is less a standalone detector than a specialized distillation head for internal MLLM grounding. Its efficiency derives from weight reuse, frozen early computation, and sparse supervision rather than from external localization annotations.

## 4. Inference workflow and system-level integration

In the original pipeline, SD-RPN is inserted between coarse visual encoding and final answer generation. The operational sequence is: extract response-to-image cross-attention maps from the MLLM’s middle layers during a single auto-regressive pass; denoise and sparsify this raw attention to form a pseudo-label map of foreground, background, and ignored tokens; train a small RPN on top of frozen early layers of the MLLM to predict this pseudo-label map in one forward pass; and, at inference, run the RPN to get a dense RoI heatmap, threshold and extract a crop, up-sample that crop, re-insert its tokens, and finally decode the answer [2509.16944].

Q-Zoom makes the inference path more explicit as a conditional two-stage procedure. A lightweight Dynamic Gating Network first examines the coarse, low-resolution visual features plus the user query and predicts a binary “Need-Refine” flag. If the prediction is “No-Refine,” the model bypasses high-resolution processing entirely and generates an answer directly from the frozen backbone’s coarse features. If the prediction is “Need-Refine,” SD-RPN produces a dense spatial heatmap from the same intermediate hidden states; after sigmoid, Gaussian smoothing \(\mathcal G\), and thresholding by \(\tau_{\rm roi}\), the minimal axis-aligned bbox is extracted, cropped from the original high-resolution image, re-encoded, and inserted between \(H_v^B\) and \(H_{\mathrm{user}}^B\) at layer \(B\) [2604.06912].

Q-Zoom additionally introduces partial-prefill KV-cache reuse. Because coarse tokens \([H_{\mathrm{sys}}^0,H_v^0]\) up to layer \(B\) are identical between the first and second pass, their KV caches are stored. Only \(H_{v,\mathrm{RoI}}^0+H_{\mathrm{user}}^0\) are re-forwarded through layers \(1\ldots B\), after which \([H_{\mathrm{sys}}^B,H_v^B,H_{v,\mathrm{RoI}}^B,H_{\mathrm{user}}^B]\) are concatenated and processed through layers \(B+1\ldots L\) [2604.06912].

A further systems issue is coordinate consistency after crop reinsertion. Q-Zoom identifies that local tokens lose their original global coordinate context and addresses this using continuous spatio-temporal alignment with Multimodal Rotary Positional Embeddings (MRoPE). RoI tokens are assigned a temporal offset \(\delta=\min(H,W)\) and interpolated spatial coordinates within the original box \(b=[x_1,y_1,x_2,y_2]\), so that the local crop lies on a distinct temporal plane while retaining the correct spatial coordinates. The same framework then applies targeted Post-Supervised Fine-Tuning on approximately \(7\)K mined hard samples, freezing the vision encoder and projector and fine-tuning only the LLM with a standard next-token objective [2604.06912].

## 5. Data efficiency, training settings, and empirical behavior

The original paper emphasizes data efficiency. It reports that, despite being trained on only a few, for example \(10\)K, question-answer pairs, SD-RPN demonstrates exceptional data efficiency and generalization, achieving over a \(10\%\) absolute accuracy improvement on unseen benchmarks including TextVQA, DocVQA, and V-Star. Training details for the LLaVA-1.5-7B example are AdamW, learning rate \(5\mathrm{e}{-5}\), batch size \(128\), \(1\) epoch, and a cosine schedule with \(3\%\) warm-up [2509.16944].

Q-Zoom provides a larger-scale account of pseudo-label generation and training. For the Qwen series, SD-RPN pseudo-labels use a total of approximately \(185\)K samples: \(72\)K GQA, \(80\)K OCR-VQA, and \(33\)K VCoT-DocVQA. LLaVA variants omit the \(33\)K Document samples for \(152\)K total. The optimizer is AdamW with weight decay \(=0\), \(\beta_1=0.9\), \(\beta_2=0.98\), gradient clipping \(=1.0\), cosine decay with linear \(3\%\) warm-up, peak learning rate \(1\mathrm{e}{-4}\) for SD-RPN and Gate, batch size \(128\), and training epochs \(=1\) for each module [2604.06912].

A notable ablation concerns pseudo-label data size. On Qwen2.5-7B, even \(10\)K distilled samples yield strong gains, with \(77.7\%\) average on OCR+V*, while the full \(185\)K yields \(78.9\%\). A comparison “GT-box” baseline trained on \(68\)K human boxes scores \(78.0\%\). This indicates that self-distilled pseudo-labels can be competitive with human box supervision at the reported scale [2604.06912].

Q-Zoom also reports that, when varying the backbone split \(B\) with \(R=3\), performance peaks at \(B=18\), described as the layer in which MLLM internal grounding is strongest. This finding reinforces the original SD-RPN premise that middle-layer attention provides the most useful supervisory signal, not merely a convenient one [2604.06912].

## 6. Performance profile, comparisons, and limitations

The original evaluation integrates SD-RPN into LLaVA-1.5 at both \(7\)B and \(13\)B scales and into DeepSeek-VL at \(1.3\)B and \(7\)B. Benchmarks include DocVQA, ChartQA, OCRBench, InfoVQA, TextVQA, V-Star Bench, POPE, and HR-Bench at \(4\)K and \(8\)K. Quantitatively, on Document/OCR, SD-RPN + LLaVA-1.5-7B raises average from \(27.5\%\) to \(34.3\%\) (\(+6.8\) points), and on V-Star Bench from \(50.3\%\) to \(67.5\%\) (\(+17.2\) points). The paper also states consistent \(7\)–\(10\) point absolute improvements across models and tasks, and Figure 9 shows cases where baseline LLaVA misses small text or objects while SD-RPN correctly crops and reads them [2509.16944].

Efficiency is a central part of the method’s profile. SD-RPN requires only a single forward pass through layers \(1{:}B+R\) of the MLLM to predict the RoI map, with no autoregressive decoding and no multi-pass prefills. In practice, RoI prediction is \(1.5\times\) faster than ViCrop’s cropping stage, and overall throughput relative to the full-image baseline is approximately \(0.62\times\) for LLaVA-1.5-7B, reported as significantly better than other two-stage methods [2509.16944].

Q-Zoom reframes this trade-off through conditional activation. On Qwen2.5-VL-7B, the baseline with \(576\)-token max achieves \(81.8\%\) average on Document/OCR tasks at \(1.0\times\) throughput. Adding SD-RPN alone increases the average to \(85.5\%\) (\(+3.7\) points) but drops throughput to \(0.59\times\); adding SD-RPN + Post-SFT gives \(86.1\%\) (\(+4.3\)) at \(0.63\times\); and the full Q-Zoom system, SD-RPN + SFT + Gate, gives \(85.6\%\) (\(+3.8\)) at \(0.81\times\). The paper attributes the throughput recovery to routing easy queries past the RoI branch [2604.06912].

Q-Zoom also reports a direct comparison with training-free RoI strategies on LLaVA-1.5-7B: raw cross-attention thresholding reaches \(31.8\%\) average at \(0.39\times\), GroundingDINO with one box reaches \(29.6\%\) at \(0.37\times\), GroundingDINO with two boxes reaches \(30.0\%\) at \(0.32\times\), and SD-RPN reaches \(34.6\%\) at \(0.62\times\), the best of these reported configurations [2604.06912].

The stated limitations are equally important. SD-RPN relies on the MLLM’s intrinsic attention; if the middle-layer attention is extremely poor for certain queries, pseudo-labels degrade. It has no explicit box-regression head, producing a heatmap rather than precise box coordinates. The two-stage crop-and-decode design still adds latency. The papers identify several possible extensions: a small regression head or IoU loss, adaptive token allocation such as early-exit on unambiguous regions, extensions to video or multi-frame inputs via self-distilling spatio-temporal masks, and joint learning of task and localization signals or the use of stronger teacher LLMs for pseudo-labels [2509.16944].

Taken together, these results position SD-RPN as a self-distilled RoI mechanism that converts noisy internal grounding into a fast, trainable predictor. A plausible implication is that its main significance lies not only in its reported gains on fine-grained VQA and document understanding benchmarks, but also in its demonstration that intermediate attention can serve as scalable supervision for localization modules in MLLMs when it is explicitly denoised and filtered.

Source: https://www.emergentmind.com/topics/self-distilled-region-proposal-network-sd-rpn