---
title: Complementary Priority Masking
url: https://www.emergentmind.com/topics/complementary-priority-masking
type: topic
---

# Complementary Priority Masking

Searching arXiv for the cited papers and directly related work on complementary masking.
arXiv search query: "2303.17386 Complementary Random Masking for RGB-Thermal Semantic Segmentation"
Complementary Priority Masking (“CPM”; *Editor’s term*) denotes a class of masking strategies in which multiple masked views are constructed so that their visible regions, tokens, or substructures are complementary, while the masking budget is optionally directed toward harder, more informative, or more reliable content. In RGB–Thermal semantic segmentation, the clearest early formulation is Complementary Random Masking, which masks disjoint patch regions in RGB and thermal streams so that every spatial location remains visible in at least one modality, and couples this with self-distillation between clean and masked inputs [2303.17386]. Related formulations appear in rotation-invariant point-cloud masked autoencoding, weakly supervised dense video captioning, domain-adaptive segmentation, RGB–depth feature dropout, multiview circuit representation learning, and diffusion language model training [2509.14975], [2412.12791], [2507.12008], [2408.16478], [2509.20968], [2603.15803]. The term “priority” is not used uniformly across these works; in several cases it is an explicit mechanism, whereas in others it is an interpretive description of curriculum, salience, or alignment scheduling.

## 1. Definition and scope

The defining property of complementary masking is that masked views are not sampled independently. Instead, one view’s hidden regions are paired with another view’s visible regions, or a positive mask is paired with its exact complement, so that the pair jointly covers the full input. In the RGB–Thermal formulation, complementarity means that if one modality is masked in some regions, the other modality is unmasked in those exact regions, guaranteeing that each spatial location is visible to the network in at least one modality [2303.17386]. In weakly supervised dense video captioning, the positive temporal mask $M_i$ is paired with the negative mask $\check{M}_i = \mathbf{1} - M_i$, and the two masked videos are trained to yield complementary caption subsets that together form a complete video description [2412.12791]. In domain-adaptive segmentation, the dual form uses a binary mask $D$ and its complement $1-D$ to create two masked target views whose union equals the original image and whose intersection is empty [2507.12008].

A second axis is prioritization. In some formulations this is explicit. The proposed Complementary Priority Masking variant for RGB–Thermal segmentation defines a patch-level priority map and samples a complementary mask under a fixed ratio according to normalized priority probabilities [2303.17386]. In rotation-invariant point-cloud MAE, the “priority” component is realized by curriculum learning with dynamic weights that shift emphasis from geometric masking to semantic masking over training time [2509.14975]. In diffusion LLMs, information-dense hubs are assigned higher mask probabilities under a mass-conserving scheduler, and the complement forms a syntax-oriented view [2603.15803].

A compact cross-domain summary is as follows.

| Setting | Complementary mechanism | Priority mechanism |
|---|---|---|
| RGB–Thermal segmentation | Patch masks $M$ and $1-M$ across modalities | Optional priority map over patches |
| Point-cloud MAE | Geometric and semantic masking streams | Curriculum weight $\alpha(t)$ |
| Dense video captioning | Positive mask $M_i$ and negative mask $1-M_i$ | Soft salience through learned mask magnitude |
| UDA segmentation / RGB–depth UDA | Dual masked views or complementary dropout | Optional weighting or scheduled retention |
| Diffusion LLMs | Token mask $M$ and complement $1-M$ | Information-density-driven probabilities |

This suggests a unifying abstraction: complementarity supplies coverage and anti-shortcut pressure, whereas priority determines where that pressure is concentrated.

## 2. Complementarity as a masking invariant

In the RGB–Thermal case, complementarity is implemented at input-token level, aligned with Swin Transformer patchification. For tokenized inputs $X_{rgb}$ and $X_{thr}$, a random binary mask $M$ is sampled on one modality and its exact complement $\hat{M} = 1 - M$ is applied to the other modality. Masked tokens are replaced by learnable mask-token vectors, yielding
$$
\begin{aligned}
\hat{X}_{rgb} &= M*X_{rgb} + \hat{M}*L_{rgb}, \\
\hat{X}_{thr} &= \hat{M}*X_{thr} + M*L_{thr}.
\end{aligned}
$$
This ensures that at least one valid modality is available per patch [2303.17386]. The same work explicitly contrasts this with independent random masking, which can erase the same region in both modalities and degrades performance.

The same structural invariant appears in other domains, but with different carriers. In WSDVC, complementarity operates over time rather than space. The model predicts a normalized center $\mu_i$ and width $\sigma_i$ for each event and constructs a Gaussian mask
$$
M_i(t) = \exp\!\left(-\frac{(t/N_v - \mu_i)^2}{2(\sigma_i/\tau)^2}\right),
$$
with the negative mask fixed as $\check{M}_i = \mathbf{1} - M_i$ [2412.12791]. The complement is therefore hard-wired rather than learned independently.

In domain-adaptive segmentation, complementary masking is expressed directly as
$$
X_D = D \odot X, \qquad X_{1-D} = (1-D) \odot X,
$$
where the two masked views partition the image into disjoint parts that together cover the whole image [2507.12008]. MICDrop applies the same logic in feature space rather than image space: blockwise DropBlock masks image features with $M_I$ and depth features with $M_D = 1 - M_I$, so that exactly one modality is active at each spatial block [2408.16478].

Point-cloud MAE uses a more abstract notion of complementarity. The 3D Spatial Grid Masking stream and Progressive Semantic Masking stream target different, non-redundant priors—rotation-consistent geometry and semantic part coherence—and are mixed by a curriculum schedule rather than by strict pointwise complementation [2509.14975]. This suggests that in some later uses of the term, complementarity refers not only to set-theoretic disjointness but also to non-redundant inductive biases.

## 3. Priority mechanisms

Priority mechanisms differ sharply across domains. In the proposed Complementary Priority Masking extension of RGB–Thermal segmentation, each patch $i$ is assigned a priority score $P[i]$, which may be uncertainty-based, saliency/gradient-based, or derived from curriculum or scene priors. The scores are normalized to probabilities
$$
\pi[i] = \frac{P[i]}{\sum_j P[j]},
$$
after which a subset of patches is sampled without replacement and complemented across modalities exactly as in CRM [2303.17386]. The core property of complementary coverage is preserved while the masking budget is steered toward informative regions.

In the point-cloud setting, priority is temporal rather than spatial. The semantic priority weight is
$$
\alpha(t) = (t/T)^\gamma,
$$
and the combined masking propensity is
$$
P_i(t) = (1-\alpha(t))P_{geo}(i) + \alpha(t)P_{sem}(i,t),
$$
with reported values $C_{max}=40$, $C_{min}=10$, $G_x=G_y=G_z=4$, $m=0.75$, and $\gamma=2$ [2509.14975]. Early training emphasizes geometric structure; later training emphasizes semantic parts extracted from attention.

The diffusion-LLM formulation makes priority fully probabilistic and token-specific. Let $C=(c_1,\dots,c_N)$ be the binary indicator of information-dense hubs and $\rho = \frac{1}{N}\sum_i c_i$. Given a global mask ratio $\sigma_t$ and bias weight $w>1$, the mask probabilities satisfy
$$
P(m_i = 1 \mid c_i = 1) = \min(w \cdot p_{base}, 1), \qquad
P(m_i = 1 \mid c_i = 0) = p_{base},
$$
with mass conservation enforcing
$$
\frac{1}{N}\sum_i P(m_i = 1 \mid c_i) = \sigma_t.
$$
In the unsaturated regime,
$$
p_{base} = \frac{\sigma_t}{1 + \rho (w-1)}.
$$
The sampled mask $M$ produces a reasoning-priority view, and the complement $1-M$ produces a syntax-priority view [2603.15803].

Not all uses of “priority” are content-adaptive. MICDrop states explicitly that masks are not guided by semantic boundaries, depth discontinuities, or uncertainty maps; the priority signal is purely via the schedule of the masking ratio $m_r^t$, which controls whether depth or RGB is kept more often [2408.16478]. Likewise, the dense-video paper does not use the term “priority”; the learned mask magnitude $M_i(t)\in[0,1]$ functions as a soft per-frame importance score, but this is an interpretive extension rather than the paper’s own terminology [2412.12791].

## 4. Objectives, architectures, and training paradigms

Complementary masking is typically embedded in multi-view consistency objectives rather than used as a stand-alone perturbation. In RGB–Thermal segmentation, the total objective is
$$
L_{total} = L_{MWS} + L_{SDC} + L_{SDN},
$$
where $L_{MWS}$ supervises fused and clean single-modality predictions, $L_{SDC}$ enforces consistency between clean and complementary-masked RGB–T inputs, and $L_{SDN}$ aligns clean RGB–T predictions with partially masked single-modality predictions via $L_1$ on class logits [2303.17386]. The architecture is Mask2Former with Swin Transformer backbones, winner-take-all per-channel max fusion, MSDeformAttn pixel decoder, DETR-style transformer decoder, and $N=100$ object queries.

The domain-adaptive segmentation framework MaskTwins uses a student–teacher scheme with EMA teacher updates, supervised source loss, masked consistency to pseudo labels, and complementary prediction consistency:
$$
\mathcal{L}_{total} = \mathcal{L}_{sup}^S + \mathcal{L}_{cl}^T + \lambda_{cm}\mathcal{L}_{cm}^T.
$$
Masking is applied only to target images, and the dual masked views are integrated directly into the main training pipeline rather than treated as separate pretraining [2507.12008].

MICDrop likewise plugs into existing UDA frameworks without introducing new losses of its own. It modifies forward features by masking image encoder features while inversely masking depth encoder features, then fuses them by a depth-guided global cross-attention branch and a local gated self-attention branch, with residual fusion into RGB features [2408.16478]. The total segmentation objective follows the host framework, and the method adds an additional unmasked forward pass to reduce train–test distribution shift.

In weakly supervised dense video captioning, complementary masking underwrites implicit location–caption alignment. Training is two-stage: a global captioning stage with $\mathcal{L}_{full}$, followed by a localizing stage optimizing
$$
\mathcal{L} = \mathcal{L}_{pos} + \mathcal{L}_{neg} + \mathcal{L}_{div},
$$
where positive masked captioning predicts caption $C_i$ from $M_i$-masked video features, negative masked captioning predicts the remaining captions from the complement, and diversity regularization discourages different event masks from collapsing to the same temporal region [2412.12791].

In multiview circuit representation learning, masking becomes effective only after a shared function-aware latent space is established. MixGate therefore uses an alignment-first curriculum: Stage 1 optimizes $L_{spp}+L_{align}$, Stage 2 adds $L_{ttdp}$, and Stage 3 adds the masked reconstruction term $L_{mcm}$ [2509.20968]. This ordering is itself a priority rule: alignment is treated as the precondition for complementarity.

## 5. Empirical behavior across domains

The most direct robustness evidence comes from RGB–Thermal semantic segmentation. On MFNet day–night, CMX reports $59.7$ mIoU, whereas the Swin-B variant reports $61.4$ and Swin-S reports $61.2$; on PST900, GMNet reports $84.1$ and the Swin-B variant reports $88.0$ mIoU; on the KAIST Multispectral semantic benchmark, CMX reports $46.2$ and the Swin-B variant reports $55.2$ mIoU [2303.17386]. Modality-drop results on MFNet show that the reported method preserves performance much better than RTFNet and CMX under RGB-drop and THR-drop, which the paper attributes to reduced over-reliance on a single modality.

MICDrop reports consistent gains across several UDA baselines. On GTA$\rightarrow$Cityscapes, DAFormer improves from $68.3$ to $70.1$, MIC(DAFormer) from $70.6$ to $71.8$, HRDA from $73.8$ to $74.8$, and MIC(HRDA) from $75.9$ to $76.6$; on SYNTHIA$\rightarrow$Cityscapes, DAFormer improves from $61.3$ to $62.4$, HRDA from $65.8$ to $66.8$, and MIC(HRDA) from $67.3$ to $67.9$ [2408.16478]. Boundary IoU on GTA$\rightarrow$Cityscapes for MIC(HRDA) increases from $52.0$ to $53.6$, with reported category gains including signs $(+3.8)$, truck $(+4.9)$, bus $(+3.1)$, and poles $(+2.9)$.

MaskTwins reports $76.7$ mIoU on SYNTHIA$\rightarrow$Cityscapes over $13$ classes, improving $+2.7$ mIoU over MIC’s $74.0$, with especially large reported gains on sidewalk and road; it also reports new state-of-the-art results on mitochondria segmentation and an F1-score of $0.5913$ on synapse detection, including $+3.13\%$ on post-synapse [2507.12008]. In point-cloud pretraining, the dual-stream masking paper reports small but consistent gains on ModelNet40 and ScanObjectNN and larger gains of roughly $+1.7$ to $+2.2$ on OmniObject3D across several rotation settings [2509.14975].

The dense-video formulation reports on ActivityNet Captions that the CLIP-based model reaches SODA $6.08$, METEOR $8.48$, CIDEr $33.42$, ROUGE-L $14.77$, and BLEU-4 $2.26$, while the C3D-based variant reaches SODA $5.29$, METEOR $7.71$, and CIDEr $30.17$ [2412.12791]. Ablations show that removing positive masked captioning reduces CIDEr from $33.42$ to $20.22$, removing negative masked captioning gives $30.29$, replacing the Gaussian with a hard binary mask gives $16.96$, and removing diversity loss gives $30.93$.

The diffusion-LLM work reports HumanEval $65.24$, MBPP $54.00$, GSM8K $73.92$, MATH500 $43.60$, and average $59.19$ for the CPM setting with $w=2$, compared with baseline average $55.32$ and original average $58.10$ [2603.15803]. The paper attributes the gap to better allocation of optimization toward information-dense reasoning pivots while retaining complementary syntax supervision.

## 6. Limitations, misconceptions, and failure modes

A persistent misconception is that complementary masking is equivalent to generic dropout, Cutout, PatchDrop, or random erasing. The RGB–Thermal study explicitly argues that these methods do not enforce any cross-modality constraint and may erase the same spatial content across both modalities, whereas CRM guarantees complementarity and outperforms square masking and independently sampled masking [2303.17386]. MICDrop likewise reports that independent masking of RGB and depth features is unstable and yields no gain relative to complementary masking [2408.16478].

Another misconception is that complementarity alone suffices. The multiview circuit results show the opposite: masked modeling without prior alignment worsens both Signal Probability Prediction and Truth-Table Distance Prediction, whereas masking after Equivalence Alignment Loss yields the best results [2509.20968]. This makes alignment a substantive precondition rather than a cosmetic addition.

Sensitivity to mask granularity and ratio recurs across settings. In RGB–Thermal segmentation, patch size $32$ yields the best MFNet mIoU among tested patch sizes $\{8,16,32,64\}$, and very large contiguous masks can impede non-local learning [2303.17386]. In MaskTwins, the method is reported as robust for $b \in [32,256]$ and $r \in [0.2,0.5]$, but very small mask ratios can degrade performance [2507.12008]. The point-cloud study reports that mask ratio near $0.75$ works well, whereas very low $m$ may underconstrain reconstruction and very high $m$ can destabilize training [2509.14975].

Priority mechanisms can also fail when their signal is unreliable. The point-cloud paper notes that early attention can be noisy, hence the need for progressive thresholds and clustering schedules [2509.14975]. The dense-video paper reports sensitivity to event overlap and to the Gaussian steepness $\tau$ and diversity margin $\gamma$ [2412.12791]. The diffusion-LLM work reports that hard priority masking with $w \to \infty$ underperforms soft priority masking and can produce contextual collapse by creating “information black holes” in block diffusion [2603.15803]. In RGB–Thermal segmentation, if one modality is globally unreliable, such as severe thermal noise everywhere, complementary masking cannot compensate [2303.17386].

## 7. Broader context and antecedents

Complementary masking in modern representation learning also has non-neural antecedents in coding-theoretic masking. Linear complementary pairs $(\mathcal{C},\mathcal{D})$ and complementary information set codes support direct sum masking for side-channel and fault-injection resistance by decomposing the ambient space into complementary subspaces [2311.01008], [1205.5062]. These works do not use the term “Complementary Priority Masking,” but they articulate an older complementarity principle: every vector admits a unique decomposition into two complementary code components, and the security parameter is governed by $\min\{d(\mathcal{C}), d(\mathcal{D}^\perp)\}$ in the LCP setting [2311.01008].

This older literature is conceptually distinct from neural masked modeling, because the complement is algebraic rather than stochastic. Even so, a plausible implication is that current CPM-style methods inherit a long-standing intuition: complementarity is valuable when it guarantees coverage without redundancy and blocks degenerate reliance on a single subspace, modality, or coordinate set.

Across contemporary machine learning, the common lesson is narrower and more technical. Complementary masks are most effective when they are synchronized, structurally meaningful, and coupled to an auxiliary principle—self-distillation, curriculum, pseudo-label consistency, positive/negative captioning, functional alignment, or information-density weighting. Where that auxiliary principle is absent, complementarity tends to reduce to a perturbation. Where it is present, the masking operation becomes a mechanism for enforcing cross-view dependence, exposing non-local cues, and regularizing representation learning under missing, degraded, or weakly supervised inputs.

Source: https://www.emergentmind.com/topics/complementary-priority-masking