Skip to Content
ElectronicsElectronics
  • Article
  • Open Access

12 October 2026

19 Pages

Content Feature Contrastive Disentangling for Video Corpus Moment Retrieval †

,
,
and
1
School of Computer Science (National Pilot Software Engineering School), Beijing University of Posts and Telecommunications, Beijing 100876, China
2
Beijing Key Laboratory of Network System and Network Culture, Beijing University of Posts and Telecommunications, Beijing 100876, China
3
Department of Computer Science and Technology, Tsinghua University, Beijing 100089, China
*
Author to whom correspondence should be addressed.

Abstract

Video Corpus Moment Retrieval (VCMR) retrieves relevant untrimmed videos from a corpus and localizes target moments using natural language queries. While existing models achieve impressive accuracy, they suffer from a critical vulnerability: a disproportionate reliance on intrinsic dataset biases, particularly spurious dependencies on temporal locations. This over-reliance severely hinders their generalization capabilities. To address this, we propose a debiased inference framework rooted in a Structural Causal Model (SCM), implemented via a novel approach termed Content Disentangling with Contrastive Learning (CDCL). CDCL applies causal intervention by explicitly decoupling confounded video features into task-relevant content representations and bias-inducing confounders. Furthermore, we integrate a contrastive disentangling mechanism to fundamentally enhance the representational purity of the isolated content features. Experiments on the constructed TVR-OOD benchmark demonstrate consistent improvements for two representative late-fusion baselines. At VCMR Recall@10 with IoU = 0.5, CDCL improves XML from 10.60% to 12.32% and ReLoCLNet from 13.57% to 14.23%. These results demonstrate the effectiveness of combining content–location disentanglement with query-guided contrastive learning under the evaluated temporal distribution shift.

1. Introduction

Nowadays, as online video content increases sharply, there is an emergent demand for retrieving target moments from a large corpus of videos. Therefore, it has become a prominent trend for researchers to focus on the Video Corpus Moment Retrieval (VCMR) task. As a foundation for VCMR, Video Moment Retrieval (VMR) is a well-studied topic that aims to localize a specific moment within a single, pre-given video according to a textual query [1]. However, its prerequisite of a known target video limits its ability to handle realistic, multi-video scenarios. To bridge this gap, VCMR takes one more step to retrieve certain video moments from a large corpus of untrimmed, unsegmented videos given a natural language query [2], as shown in Figure 1.
Figure 1. In the VCMR task, multiple moments are retrieved from a large corpus of videos as candidates. Only the correct moment from the right video is considered to be a positive result.
Among the most widely studied methods, the core objective is to project video and query features into a common embedding space for cross-modal feature matching. Based on when features from different modalities interact, existing methods are primarily categorized into early fusion and late fusion strategies. Early fusion approaches [3,4] enforce deep cross-modal interactions at the initial stages to capture fine-grained correlations, but this requires joint encoding for every query-candidate pair, creating a severe computational bottleneck. In contrast, late-fusion strategies [5,6,7,8] process videos and texts independently, allowing corpus-side features to be pre-computed and reused across queries. This property makes late fusion well suited to corpus-scale retrieval, and we therefore adopt it as the base framework of this study.
Although existing studies present promising experimental results, we argue that these results do not truly reflect the models’ ability to perform multimodal semantic understanding. Recent studies on the VMR task have found that many state-of-the-art models suffer from studying implicit distribution biases in commonly used datasets [9,10,11]. Since VMR serves as a crucial subtask in the VCMR task, we believe that VCMR models also inevitably inherit various dataset biases. While Yoon et al. [8] attempted to eliminate the specific dependency on possible keywords in queries, another widespread and highly impactful bias—temporal location bias—has not yet been addressed. This bias arises from the annotation process of large-scale datasets: ground-truth clips are statistically far more likely to be located near the beginning or the end of the raw videos. This deeply rooted data bias creates a strong but unwanted tendency, misleading models to generate results preferentially from these fixed areas based on absolute locations, rather than relying on a genuine comprehension of cross-modal semantics.
To systematically tackle this problem, three crucial challenges must be conquered: (1) Establishing a fair evaluation environment to compare models’ adaptability to the dataset bias without interference from other factors; (2) Understanding precisely how the dataset bias affects the reasoning process and devising methods to mitigate its influence; (3) Developing a robust model architecture to explicitly eliminate the spurious dependency on temporal location bias present in existing methods.
To provide a fair evaluation of the models’ adaptability towards dataset bias, we conduct Out-Of-Distribution (OOD) testing [12] for existing VCMR models. While collecting entirely new datasets is a straightforward option, the financial and temporal costs are exceedingly high. Moreover, the presence of multiple confounding factors makes it difficult to isolate a model’s true generalizability, let alone evaluate its adaptability to specific biases of interest. In contrast, OOD testing centers on a sophisticated methodology for re-splitting existing datasets. By isolating the data distribution bias, it offers an equitable and finely-tuned assessment of model robustness.
To rigorously analyze how the temporal bias affects the inference process, we construct a Structural Causal Model (SCM) [13] to elucidate the causal relationships between variables in the widely recognized late fusion models. SCM is a theoretical methodology that abstracts a model’s reasoning process into causal paths, allowing for adjustments through causal intervention. Specifically, we formally model the reasoning path and reveal an implicit causal relationship associated with the absolute location confounder L, a critical factor that has been largely ignored by existing studies.
To practically address the spurious dependency caused by this dataset bias, we propose a computational framework to conduct backdoor adjustment on the causal paths with the do-operation [14]. Designed according to the established SCM, this framework implements specific operations to achieve causal intervention. Specifically, we explicitly decouple the raw, confounded video features into latent location representations and purified video content features, which are expected to contain no location information. By approximating the expectation of the location confounder ( E ℓ ), we infer with deconfounded representations instead of the originally entangled features.
Separating content features from location confounders is only the first step; accurate retrieval also depends on the discriminability of the resulting content representation. We therefore develop Content Disentangling with Contrastive Learning (CDCL), which applies query-guided contrastive supervision to the disentangled content features. The retrieval evaluations show that this refinement improves the reported VCMR and VMR metrics under the studied temporal distribution shift.
The main contributions of this paper can be summarized as follows:
  • We introduce a dataset re-splitting method to establish an OOD evaluation environment, objectively exposing the vulnerabilities of existing VCMR models to temporal location bias.
  • We construct an SCM to thoroughly analyze the causal mechanisms underlying the bias and provide a robust debiasing solution based on causal intervention and backdoor adjustment.
  • We propose a novel CDCL method that not only explicitly decouples location confounders but also integrates contrastive disentangling to highly purify the essential content features.
  • Extensive experiments demonstrate the effectiveness of CDCL in alleviating spurious dependencies on location bias, achieving advanced generalizability and accuracy among existing works.

3. Problem Formulation

3.1. Task Formulation

While the qualitative objectives of Video Corpus Moment Retrieval (VCMR) have been introduced, it is imperative to formalize the task mathematically to establish a rigorous foundation for our proposed framework. The core challenge of VCMR lies in its inherent multi-modal nature, requiring the effective fusion of visual information (e.g., characters, scenes, and actions) with synchronized textual information (e.g., subtitles or dialogues) to achieve comprehensive semantic understanding.
Formally, let V = { v i } i = 1 n denote an extensive video corpus consisting of n untrimmed videos, and let q j represent a given natural language query. Each video v i ∈ V can be represented as a sequence of l continuous clips, denoted as v i = [ c 1 i , c 2 i , … , c l i ] . Under this multi-modal setting, each clip c k i encapsulates paired information: the visual frame sequences at that specific timestamp and the synchronously aligned subtitle text. Given the query q j and the corpus V , the objective of the VCMR task is to accurately retrieve the optimal target moment v i [ t s t : t e d ] = [ c t s t i , … , c t e d i ] that best matches the semantic intent of q j , where t s t and t e d denote the start and end clip indices within the target video v i , respectively.

3.2. Out-of-Distribution Evaluation Paradigm

To rigorously evaluate a model’s performance on the formulated VCMR task, it is critical to re-examine the evaluation paradigm itself. Standard evaluation protocols inherently rely on the Independent and Identically Distributed (IID) assumption, presuming that both training and testing datasets are sampled from an identical, fixed joint probability distribution. Under this assumption, standard test metrics are considered valid proxies for a model’s generalizability. However, in real-world scenarios, this assumption is often overly idealistic. The dataset construction process inevitably introduces systematic biases—such as the temporal location of moments acting as a hidden confounder. Consequently, models often overfit the biased joint distribution rather than learning the essential, true conditional probability between the target moments and the multi-modal semantics.
To break the bottleneck of the IID assumption and provide a more stringent measurement of true generalization capabilities, we formalize an Out-of-Distribution (OOD) testing framework. Specifically, let the training data source be defined by the distribution P t r a i n ( X , Y ) , where the input X comprises the given videos and queries, and the label Y represents the target temporal moments. While standard IID test sets are sampled from this same P t r a i n , our OOD evaluation introduces a distinctly shifted test distribution P o o d ( X , Y ) , such that P o o d ≠ P t r a i n . This distribution shift is primarily driven by changes in the marginal distribution of specific attributes (i.e., temporal locations), while the underlying, semantics-based conditional relationships mandated by the task remain constant.
Within this framework, after a VCMR model f θ is trained on P t r a i n , its robustness can be quantified by comparing its performance across different distributions. We define the model’s IID performance as the expected evaluation score under the training distribution, denoted as S i i d , and its OOD performance as the expected score under the shifted distribution, denoted as S o o d . The objective of introducing this paradigm is to investigate the implicit performance gap (where S i i d > S o o d ) prevalent in existing models. Furthermore, this formalization establishes a systematic methodology for constructing high-quality OOD test benchmarks from existing datasets, thereby providing the community with a more reliable and rigorous standard for evaluating true multi-modal semantic comprehension.

4. Methodology

To tackle the challenges and implicit biases outlined above, we propose a novel framework named Content Disentangling with Contrastive Learning (CDCL). The holistic architecture of this study is structurally divided into three core components: (1) Implementation of OOD Testing for VCMR: We instantiate the theoretical OOD evaluation paradigm onto standard VCMR datasets, conducting rigorous generalizability assessments on existing state-of-the-art methods to expose their inherent generalization deficiencies; (2) SCM-based Debiased Inference Framework: We employ a Structural Causal Model (SCM) to fundamentally analyze the spurious reasoning paths caused by temporal location biases, and subsequently design an interventional strategy to eliminate these biased pathways; (3) Query-guided Content Contrastive Disentangling: We concretely implement the modified causal model architecture. By estimating the expectation of the confounder, this component achieves structural decoupling while simultaneously utilizing contrastive learning objectives to highly purify the quality of the disentangled video content features.

4.1. Implementation of Out-of-Distribution Testing on VCMR

To fulfill the objective of constructing an OOD testing benchmark for the VCMR task, this section details the concrete methodology for systematically isolating a subset that strictly conforms to the OOD definition from an existing dataset. The core of this methodology lies in precisely quantifying and leveraging the latent distribution biases inherent in the data.
We select the widely used TV Retrieval (TVR) dataset [5] as our primary research object. Because the distribution of temporal location is a common and critical attribute in video datasets [1], our initial step involves conducting a quantitative modeling of its temporal location bias. By merging the training, validation, and testing splits of the original TVR dataset into a single set, we employ Kernel Density Estimation (KDE) with Gaussian kernels to compute the joint probability density of the normalized start and end temporal locations for all ground-truth moments. Let z i = ( x i , y i ) ⊤ denote the normalized start and end locations of the i-th annotated moment. We apply the bivariate Gaussian kernel density estimator implemented by scipy.stats.gaussian_kde:
f ^ ( z ) = 1 2 π n | H | 1 / 2 ∑ i = 1 n exp − 1 2 ( z − z i ) ⊤ H − 1 ( z − z i ) ,
where n is the number of annotated moments and H = h 2 Σ ^ is the kernel covariance matrix. Here, Σ ^ is the sample covariance matrix of the normalized start–end pairs, and the default Scott factor is
h = n − 1 / ( d + 4 ) = n − 1 / 6 , d = 2 .
Thus, the covariance matrix accounts for the individual scales of the two coordinates and their statistical dependence. The estimator is evaluated at the observed start–end pairs to obtain the density scores used in the subsequent video-level ranking. No additional boundary correction is applied.
As intuitively validated by the KDE heatmap in Figure 2a, the distribution of ground-truth moments exhibits a severe long-tail trend with a significant concentration towards the beginning of the videos (the bottom-left region). Specifically, our quantitative analysis reveals that over 32% of ground-truth moments have the majority of their temporal length compressed within the first 20% of their respective videos. This massive accumulation forms an explicit “learning shortcut”. This density function f ^ ( x , y ) provides the crucial mathematical foundation for subsequently identifying and separating IID from OOD samples.
Figure 2. Bivariate Gaussian KDE visualizations of the normalized start–end locations in the merged TVR data and the resulting video-level splits. The darker colors in the figure represent a higher probability range for the samples.
However, implementing this OOD theory in the VCMR task introduces a unique structural challenge: datasets like TVR are organized at the video granularity to narrow the retrieval space. To ensure evaluation fairness and prevent data pollution caused by video content leakage, a strict constraint must be enforced: all queries attached to the same video must be grouped into the same split. Let Q v denote the set of all query–moment instances associated with video v. The split assignment is defined on v and inherited by every instance in Q v , producing pairwise video-disjoint training, validation, and test subsets. This grouping prevents identical visual and subtitle streams from occurring in both model fitting and evaluation, so the measured performance reflects temporal-location shift rather than source-content overlap. The temporal-frequency statistics are therefore aggregated with the video as the atomic splitting unit.
To overcome this, we approximate a video-level “frequency score” S v for each video v in the dataset using Equation (2):
S v = 1 N q ∑ i = 1 N q f ^ ( q i s t , q i e d )
where N q is the total number of queries attached to video v, and f ^ ( q i s t , q i e d ) is the KDE value of the ground-truth moment corresponding to the i-th query. A higher S v indicates that the video’s content heavily conforms to the mainstream biased patterns. Based on this metric, we rank the videos in ascending order of S v and assign the lowest-scoring 20 % of videos, together with all of their associated queries, to Test-OOD. The remaining videos are partitioned at the video level into the training set ( 70 % ), Test-IID ( 5 % ), and validation set ( 5 % ). Consequently, no video or associated query is shared by different subsets.
Figure 2b–d visualizes the temporal-location distributions of the resulting Train, Test-OOD, and Val sets. Because Test-OOD is formed from videos at the low-density end of the video-level ranking, its annotated moments exhibit a clear temporal distribution shift from those in Train and Val. The construction targets temporal patterns that are less frequently represented in the pooled annotations; it does not impose a uniform distribution, and local density modes may remain.
Table 1 summarizes the performance of XML and ReLoCLNet under the original TVR protocol and the reconstructed TVR-OOD protocol. The TVR entries are the published results on the original split, whereas the TVR-OOD entries are obtained by retraining the corresponding architectures on the reconstructed training partition and evaluating them on Test-OOD. For example, VCMR R@10 at IoU = 0.5 changes from 16.14 % to 10.60 % for XML and from 21.18 % to 13.57 % for ReLoCLNet. The lower results on Test-OOD indicate that low-frequency temporal-location patterns constitute a more challenging evaluation distribution for both architectures.
Table 1. Performance of XML and ReLoCLNet on TVR and TVR-OOD.

4.2. The Structural Causal Model for VCMR

To rigorously diagnose the reasoning mechanisms of existing late-fusion models and isolate the source of dataset biases, we formulate the VCMR task through the lens of a Structural Causal Model (SCM) [13]. By representing variable dependencies as a Directed Acyclic Graph (DAG), the SCM provides a formal theoretical framework to identify structural flaws and design an effective causal intervention strategy.
Figure 3a illustrates the causal graph abstraction for conventional late-fusion architectures. Solid directed edges denote explicit algorithmic computations, whereas dashed edges signify implicit, confounding correlations learned by the network. The structural assignments within this graph are defined as follows:
Figure 3. The structural causal models before and after causal intervention. Q V : query feature for generating VR scores. Q M : query feature for generating ML scores. L: the location confounder that implicitly leads to spurious dependencies. V: video feature. V R : video retrieval (VR) score. M L : moment localization (ML) score. Y: the selected candidates for the VCMR task together with their confidence scores.
In this causal abstraction, Q V , Q M , and V are observed network representations, L denotes the absolute temporal location associated with the valid video clips, and Y is the final ranked VCMR output. For branch r ∈ { V R , M L } , let Q r = Q V for r = V R and Q r = Q M for r = M L . We denote the joint branch input by T r = ( Q r , V ) and the corresponding task outcome by O r ∈ { V R , M L } . The variable L is the adjustment variable on the location-related backdoor path. In the network implementation, it is represented by the learned location feature ℓ, which is supervised by a fixed absolute positional encoding.
Q V → Q M . The base text query representation Q V is linearly projected into a distinct feature space Q M , which is exclusively optimized for moment-level boundary localization.
{ Q V , V } → VR . The Video Retrieval (VR) score is computed by maximizing the cross-modal similarity between the global query feature Q V and the unrefined, sequential video clip features V.
{ Q M , V } → ML . Similarly, the transformed query Q M is matched against the video features V. Subsequent convolutional operations are applied to these matching similarities to generate boundary confidence probabilities, collectively denoted as Moment Localization (ML) scores.
{ VR , ML } → Y . The ultimate prediction Y is derived by aggregating the global retrieval and local boundary scores. Formally, given the probabilities t i s t and t j e d for the start and end clips (constrained by 2 ≤ j − i ≤ 16 ), the video-level semantic similarity s v r , and a scaling hyperparameter α , the joint candidate confidence is formulated as:
s v c m r ( v , v i s t , v j e d | q ) = t i s t · t j e d · exp ( α s v r )
Candidates across the entire corpus are subsequently ranked based on s v c m r to yield the final retrieval output.
ML ← L → V and VR ← L → V . These dashed pathways highlight the critical causal vulnerability in existing architectures. Since the raw video feature V intrinsically encapsulates absolute temporal location semantics L, the network inadvertently exploits L as a statistical confounder. Instead of optimizing for genuine multi-modal semantic alignment, models are driven to capture spurious correlations, artificially elevating the confidence of moments solely based on their occurrence at typical temporal locations. This confounding effect dictates the backdoor path that severely degrades generalization on out-of-distribution data.
To adjust the location-related backdoor paths, we apply the backdoor criterion separately to the retrieval and localization branches. In the SCM of Figure 3, L precedes T r , is not a descendant of T r , and blocks the modeled backdoor path between the context representation and O r . Under these assumptions, the interventional distribution for branch r is identified as
P ( O r ∣ d o ( T r = t ) ) = ∑ ℓ ∈ L P ( O r ∣ T r = t , L = ℓ ) P ( L = ℓ ) , r ∈ { V R , M L } .
The empirical temporal-location prior is highly imbalanced in the training annotations. We therefore evaluate the conditional outcome under a location-balanced reference distribution π rather than propagating this empirical frequency into the adjusted representation:
P π ( O r ∣ d o ( T r = t ) ) = ∑ j = 1 N l P ( O r ∣ T r = t , L = ℓ j ) π ( ℓ j ) , π ( ℓ j ) = 1 N l .
With the query treated as an observed context, adjustment over the location confounder gives
P ( Y ∣ d o ( C = c ) , Q = q ) = ∑ ℓ P ( Y ∣ C = c , Q = q , L = ℓ ) P ( L = ℓ ∣ Q = q ) .
For a prescribed target distribution π ( L ) , the corresponding standardized causal response is
P π ( Y ∣ d o ( C = c ) , Q = q ) = ∑ ℓ P ( Y ∣ C = c , Q = q , L = ℓ ) π ( ℓ ) .
CDCL adopts the location-balanced target π ( ℓ j ) = 1 / N l over the N l valid temporal positions. This uniform distribution is not required by the backdoor criterion; it defines the target population over which the conditional causal responses are standardized. Let s j denote the content-conditioned compatibility score assigned to location state ℓ j . The finite-sample expectation is parameterized as
α j = π ( ℓ j ) exp ( s j ) ∑ k = 1 N l π ( ℓ k ) exp ( s k ) , ℓ ¯ = ∑ j = 1 N l α j ℓ j .
Because π ( ℓ j ) is uniform, the normalized weights reduce to the softmax attention coefficients. The attention block therefore provides a representation-level approximation of the location-standardized expectation without reintroducing the empirical temporal-frequency distribution as an additional prior.

4.3. Query-Guided Content Contrastive Disentangling

To materialize the backdoor adjustment and yield debiased predictions, we propose the Content Disentangling with Contrastive Learning (CDCL) framework. As illustrated in Figure 4, the core processing pipeline of CDCL transitions from the standard entangled encoding to a disentangling-intervention paradigm. Structurally, the proposed method consists of three interrelated components: the fundamental Disentangling Backbone, a novel Targeted Semantic Refinement mechanism utilizing contrastive learning, and the Confounder Expectation Modeling module for final causal intervention.
Figure 4. An overview of the video processing part of the proposed CDCL, which generates the content part and location part from video features and conducts inference with intervened causal paths.

4.3.1. Primitive Confounder Extracting

To The foundational objective of the Disentangling Backbone is to decompose the raw, confounded video feature v into a primitive semantic content representation c v and a location confounder representation ℓ v . This decoupling is achieved through two parallel Feed-Forward Neural Networks (FFNs), denoted as g c and g l , respectively (i.e., c v = g c ( v ) and ℓ v = g l ( v ) ). Both mappings are implemented as position-wise residual FFNs that preserve the hidden dimension d. For an input x ∈ R d , the mapping is defined as g ( x ) = LayerNorm W 2 ReLU ( W 1 x ) + W 3 x , where W 1 , W 2 , W 3 ∈ R d × d . The first two projections form the nonlinear transformation path, while W 3 provides a learnable residual projection. No dropout is applied within these FFNs. To enforce the efficacy and purity of this separation, we impose two types of regularization constraints during optimization: Reconstruction and Independence.
Reconstruction Constraint. We constrain ℓ v to closely approximate a static, non-learnable absolute positional embedding p (identical to the standard Transformer absolute positional encodings [25]) via an L 2 norm loss L r e c o n ℓ . Concurrently, to ensure that c v retains fidelity to the original visual semantics, we employ a Kullback–Leibler (KL) divergence loss L r e c o n c to penalize the distributional divergence between the content feature and the original entangled feature. The formulations are defined as follows:
L r e c o n ℓ = ∥ ℓ v − p ∥ 2
L r e c o n c = KL ( c v ^ | | v ^ ) = ∑ i c i v ^ log c i v ^ v i ^
where c v ^ and v ^ represent the features activated by the Softmax function along the temporal dimension.
Independence Constraint. To reduce information overlap between c v and ℓ v , we penalize their absolute cosine similarity, thereby encouraging the two representations to occupy approximately orthogonal subspaces:
L i n d e p = c v · ℓ v ∥ c v ∥ · ∥ ℓ v ∥
The disentanglement objective jointly enforces location identifiability, content sufficiency, and cross-branch independence. Specifically, L r e c o n ℓ anchors the location representation to temporal positions, L r e c o n c preserves task-relevant semantics in the content representation, and L i n d e p suppresses redundant information shared by the two branches.

4.3.2. Targeted Semantic Refinement via Contrastive Learning

While the primitive decoupling ensures the structural separation of location and content, the resulting content representation c v remains purely query-agnostic. It merely reconstructs the visual semantics without differentiating between the query-relevant target clips and the irrelevant background noise. To overcome this limitation and further purify the content feature, we introduce a Query-guided Targeted Contrastive mechanism (conceptually abstracted in Figure 5).
Figure 5. Query-guided targeted contrastive learning. Content features inside the annotated interval form the positive set P , while valid features outside the interval form the same-video background set N . The resulting training objective directly supervises the disentangled content branch.
Let c b i m ∈ R d denote the disentangled content feature of the i-th valid clip in sample b, where m ∈ { v , s } denotes the visual or subtitle modality, and let q b m ∈ R d denote the corresponding modularized query representation. Their matching score is
s b i m = ( c b i m ) T q b m .
Let a b i ∈ { 0 , 1 } be the valid-clip mask. The positive and background masks are
p b i = a b i I [ t s t ≤ i ≤ t e d ] , n b i = a b i ( 1 − p b i ) .
Thus, clips within the annotated interval are positive samples, while valid clips outside it provide same-video background supervision. No additional hard-negative mining or temporal buffer is applied. The targeted contrastive term is formulated using the Jensen–Shannon objective [26]. For each modality, query–content pairs within the annotated interval and those from the valid same-video background constitute the two sample sets evaluated by s b i m . Their contributions are averaged separately over the valid clips of each sample, accommodating variations in sequence length and in the number of available background clips. The corresponding positive and negative score functions are defined as
ϕ + ( s ) = log 2 − softplus ( − s ) , ϕ − ( s ) = softplus ( − s ) + s − log 2 .
The modality-specific targeted contrastive loss is
L targetCL m = 1 B ∑ b = 1 B ∑ i = 1 N l n b i ϕ − ( s b i m ) ∑ i = 1 N l n b i + ϵ − ∑ i = 1 N l p b i ϕ + ( s b i m ) ∑ i = 1 N l p b i + ϵ .
The two modality-specific terms are averaged as
L targetCL = 1 2 L targetCL v + L targetCL s .
This objective learns compatibility with the annotated occurrence rather than asserting that related semantic content cannot recur elsewhere in the video. In ReLoCLNet, the original FrameCL objective remains unchanged and operates on the intermediate features preceding the final context-encoder layer. By contrast, L targetCL supervises the content representations produced by the proposed content–location decomposition. It is used only during training and updates the content branch through back-propagation.
Let L base denote the unchanged objective of the selected VCMR backbone. For ReLoCLNet, it comprises the original FrameCL, VideoCL, start/end boundary, negative-context, and negative-query terms:
L base ReLo = λ FCL L FCL + λ VCL L VCL + λ st _ ed L st _ ed + λ neg _ ctx L neg _ ctx + λ neg _ q L neg _ q .
After integrating CDCL, the complete objective is
L total = L base + λ TCL L targetCL + λ recon L recon ℓ + λ ind L indep + λ reg L recon c .
The CDCL-specific coefficients are ( λ TCL , λ recon , λ ind , λ reg ) = ( 0.03 , 1 × 10 − 3 , 1 × 10 − 3 , 1 × 10 − 4 ) . These coefficients are selected using the validation set, while the baseline-specific loss settings remain unchanged.

4.3.3. Confounder Expectation Modeling for Debiased Inference

Having obtained the content representation c m and location representation ℓ m for modality m, CDCL constructs task-specific context features for the retrieval and boundary-prediction branches. Let c m , ℓ m ∈ R B × N l × d , where B is the batch size, N l is the number of valid clips in the current video, and d is the hidden dimension. For task stream r ∈ { v r , s t , e d } and attention head h ∈ { 1 , … , H } , the projected query, key, and value tensors are
Q r , h m = c m W r , h m , Q , K r , h m = ℓ m W r , h m , K , U r , h m = ℓ m W r , h m , V .
Here, Q r , h m , K r , h m , U r , h m ∈ R B × N l × d h , H = 4 , and d h = d / H . The masked attention coefficients and aggregated location representation are
A r , h m = Softmax j Q r , h m ( K r , h m ) T d h + M m , e r m = Concat h = 1 H A r , h m U r , h m W r m , O ,
where M m masks padded key positions. The softmax is applied once over the N l valid key positions. No empirical KDE-frequency weight or second normalization is applied: the attention coefficients model content-conditioned compatibility among the valid positions rather than reinstating the empirical temporal-location prior. The modality-specific projection g d m is implemented using the same d-to-d residual FFN architecture as the content and location mappings, with independent parameters for the visual and subtitle modalities and no dropout. The task-specific context representation is
z r m = c m + g d m ( ℓ m ) + e r m , r ∈ { v r , s t , e d } .
Here, v r , s t , and e d denote the video-retrieval, start-boundary, and end-boundary streams, respectively. The resulting representations are passed to the unchanged query-matching and prediction operations of the selected backbone.

5. Experiments

To systematically validate the effectiveness and generalizability of the proposed Content Disentangling with Contrastive Learning (CDCL) framework in the Video Corpus Moment Retrieval (VCMR) task, we design and conduct comprehensive evaluations. This section is structured as follows: First, we detail the benchmark datasets, evaluation metrics, and implementation specifics to ensure reproducibility. Second, we integrate CDCL into two mainstream late-fusion baselines and rigorously compare their performance on the out-of-distribution (OOD) test set to quantify the advantages of our debiasing strategy. Third, we conduct an ablation study to isolate the contribution of the targeted contrastive learning module. Finally, we provide a qualitative case study to intuitively demonstrate how CDCL rectifies erroneous reasoning and achieves precise moment localization.

5.1. Datasets and Evaluation Metrics

Benchmark Dataset. All experiments are conducted on the widely recognized and challenging benchmark for this domain: the TV Retrieval (TVR) dataset [5]. It comprises approximately 21.8 K videos extracted from six TV shows, with an average length of 76.2 s. These videos are paired with high-quality subtitles, providing a robust foundation for multi-modal understanding. The dataset provides over 100 K natural language queries (averaging 13.4 words), each intricately describing a specific visual event corresponding to a manually annotated ground-truth moment (averaging 9.1 s).
OOD Benchmark Construction. A core challenge for VCMR models is their generalizability when encountering data that violates the Independent and Identically Distributed (IID) assumption. To strictly evaluate the debiasing capability of our CDCL framework, we reorganize the TVR dataset into an OOD benchmark. Exactly following the theoretical KDE-based frequency scoring paradigm established in Section 4.1, we merge all available TVR data and re-split them into a training set ( 70 % ), a test-ood set ( 20 % ) exhibiting a drastically shifted temporal distribution, a test-iid set ( 5 % ), and a validation set ( 5 % ). The performance on this test-ood set serves as the primary indicator of a model’s true semantic comprehension capabilities.
Evaluation Metrics. Following standard protocols [5,6], we evaluate the models using metrics tailored for both VCMR and its subtask, Video Moment Retrieval (VMR). For VMR (where the target video is known), we report “Recall@1, IoU = μ ”. The Intersection over Union (IoU) measures the temporal overlap between the predicted moment M p and the ground-truth M g t , formulated as IoU = ( M p ∩ M g t ) / ( M p ∪ M g t ) . This metric denotes the percentage of queries where the top-1 predicted moment possesses an IoU ≥ μ (we report μ ∈ { 0.3 , 0.5 , 0.7 } ). For the full VCMR task, we report “Recall@k, IoU = μ ” (with k ∈ { 1 , 5 , 10 , 100 } ), which measures the percentage of queries that successfully retrieve the correct video and accurately localize the moment (IoU ≥ μ ) within the top-k candidates across the entire corpus.

5.2. Implementation Details

To ensure a fair comparison, we utilize the publicly available features provided by Lei et al. [5]. Visually, videos are segmented into 1.5 -s clips and encoded via pre-trained I3D (1024-d) and ResNet-152 (2048-d) networks to capture dynamic motion and static appearance, respectively. Textually, both queries and subtitles are encoded using a fine-tuned 12-layer RoBERTa-base model, yielding 768-d embeddings. The publicly available I3D, ResNet-152, and RoBERTa representations are used as fixed input features. The subsequent context encoders inherited from the selected baseline and the added CDCL layers are optimized during training.
Our framework is implemented in PyTorch v2.2.2 and executed on a single NVIDIA GeForce RTX 3090 GPU. The network is optimized using the AdamW optimizer with an initial learning rate of 1 × 10 − 4 and a weight decay of 1 × 10 − 2 . We apply a linear learning rate warm-up strategy for the first 10 % of iterations, followed by linear decay. The models are trained for 20 epochs with a batch size of 32. For checkpoint selection, each backbone is evaluated on the validation set after every epoch. The selected checkpoint is used to compute all final test metrics. Baseline-specific hyperparameters follow their original configurations.
Computational Complexity. Let N l denote the number of valid clips and d the hidden dimension. Each position-wise d-to-d FFN introduced by CDCL requires O ( N l d 2 ) operations, while the four-head location-expectation attention requires O ( N l 2 d ) operations. The number of additional trainable parameters is O ( d 2 ) . The resulting corpus representations are query-independent and can be pre-computed, and L targetCL is used only during training. Online retrieval therefore uses the scoring procedure of the selected late-fusion backbone.

5.3. Main Results on OOD Generalization

To quantitatively demonstrate the efficacy of our debiasing strategy, we integrate the CDCL as a plug-and-play module into two highly influential and representative late-fusion architectures: XML [5] and ReLoCLNet [6]. Table 2 presents a comprehensive performance comparison on the test-ood set.
Table 2. Performance Comparison of SOTA Baselines with and without the proposed CDCL on the TVR-OOD Dataset.
As shown in Table 2, CDCL obtains higher scores for every reported metric on both evaluated backbones under the TVR-OOD protocol. For XML, VCMR R@10 at IoU = 0.5 increases from 10.60 % to 12.32 % , while VMR R@1 at IoU = 0.5 increases from 24.90 % to 28.41 % . ReLoCLNet also obtains higher scores across the reported metrics, including an increase in VCMR R@10 at IoU = 0.5 from 13.57 % to 14.23 % . The observed improvements across retrieval and localization metrics support the combination of content–location disentanglement and query-guided contrastive refinement under the evaluated temporal distribution shift.

5.4. Ablation Study on Contrastive Disentangling

To dissect the contribution of individual components within our framework—particularly the effectiveness of the Targeted Contrastive Learning (TCL) mechanism—we conduct a detailed ablation study on the test-ood set. For this analysis, we utilize the XML architecture as our foundational baseline. As reported in Table 3, we systematically evaluate the performance variations when specific modules are incrementally integrated.
Table 3. Ablation Study on the Test-OOD dataset using XML as the baseline. “Disentangling” denotes the causal decoupling module, and “TCL” denotes the Targeted Contrastive Learning.
Table 3 shows the contributions of the two CDCL components on the XML backbone. Adding the disentangling module increases VMR R@1 at IoU = 0.5 from 24.90 % to 27.67 % and VCMR R@10 at IoU = 0.5 from 10.60 % to 11.75 % , with increases also observed for the other reported metrics. These results are consistent with the intended role of separating content and temporal-location representations.
Adding TCL to the disentangling variant produces further improvements across the reported metrics. In particular, VCMR R@1 at IoU = 0.7 increases from 1.68 % to 1.97 % , and VCMR R@10 at IoU = 0.5 increases from 11.75 % to 12.32 % . Because TCL supervises the decomposed content features using the query and annotated interval, these results support its role as a complementary content-refinement objective. Overall, the ablation results show that both components contribute to the performance of the complete CDCL model under the evaluated protocol.

5.5. Qualitative Analysis

Beyond quantitative metrics, we provide a qualitative case study to intuitively visualize how CDCL rectifies erroneous reasoning. Figure 6 illustrates a challenging scenario where the query is: “Ross enters the apartment of a woman who is holding flowers and closes the door behind him.” The actual event occurs in the middle-to-latter segment of the video 13.21 s ∼ 17.17 s ).
Figure 6. Qualitative comparison for one query. The vanilla baseline predicts a moment at the beginning of the video, whereas the CDCL prediction overlaps the annotated target interval more closely.
The vanilla baseline predicts a moment beginning at 0 s, whereas the annotated event occurs at 13.21 – 17.17 s. The disentangling-only variant moves the prediction to 15–18 s, and the complete CDCL model predicts 13.5 –18 s. In this example, the progression from the baseline to the two CDCL variants is consistent with reduced reliance on the beginning-of-video location pattern and closer use of the query-relevant content.

6. Limitations

This study evaluates temporal-location robustness within the TVR corpus. The results obtained under the original TVR and reconstructed TVR-OOD protocols provide a contextual comparison rather than a matched same-checkpoint IID–OOD comparison, because the corresponding architectures are trained on different data partitions. The experiments therefore characterize performance under the reconstructed Test-OOD protocol but do not establish transfer across independently collected corpus-level VCMR datasets. Evaluation on external benchmarks supporting both corpus retrieval and temporal localization would provide complementary evidence of cross-corpus generalization.
TVR-OOD operationalizes temporal-location shift by ranking videos according to KDE-based temporal-frequency scores and constructing video-disjoint splits. The benchmark therefore targets a specific shift in the distribution of moment locations. Alternative density estimators, split criteria, or naturally occurring temporal shifts may expose different bias patterns and provide complementary robustness settings.
CDCL is instantiated on XML and ReLoCLNet, two representative late-fusion VCMR architectures, and the reported conclusions are confined to this architectural setting. Extending the content–location intervention to early-fusion or end-to-end video–language models requires architecture-specific treatment: decomposition may be performed before cross-modal interaction, whereas post-fusion intervention requires the location confounder to be reformulated over query-conditioned joint representations. The effectiveness of such formulations remains to be investigated.

7. Conclusions

This study provides a comprehensive investigation into the systemic vulnerabilities of video corpus moment retrieval models, specifically regarding the degradation of generalization performance under distribution shifts. We have demonstrated that the impressive accuracy reported by existing methodologies often stems from an over-reliance on spurious temporal location dependencies rather than a genuine comprehension of multimodal semantics. By exploiting these dataset-specific shortcuts, models fail to maintain robust performance when the underlying temporal distributions vary.
To address this challenge, we introduced a computational framework for content feature contrastive disentangling, which leverages structural causal modeling to execute formal interventions via backdoor adjustment. This approach facilitates the explicit decoupling of confounded video features into bias-agnostic content representations and isolated temporal location confounders. A critical contribution of this work is the integration of a targeted contrastive learning mechanism, which ensures that the disentangled content features retain high discriminative capacity. By supervising the decoupling process with a query-guided contrastive objective, the framework effectively reinforces temporal localization precision without reintroducing the original positional biases.
Extensive evaluations on the proposed out-of-distribution benchmark demonstrate that the integration of this framework into representative late-fusion architectures yields consistent performance gains. The results substantiate our core thesis that the synergy between causal intervention and targeted feature refinement is essential for achieving an optimal balance between generalization robustness and retrieval accuracy. Beyond providing a robust solution for temporal debiasing, this work establishes a rigorous evaluation paradigm that encourages the community to prioritize semantic-driven reasoning over bias-driven prediction.
This article is a revised and expanded version of a paper entitled “Resolving Spurious Temporal Location Dependency for Video Corpus Moment Retrieval” [27], which was presented at IEEE International Conference on Systems, Man, and Cybernetics 2024, Kuching, 6–10 October 2024.

Author Contributions

Conceptualization, Y.Z., L.Z., X.X. and W.W.; Methodology, Y.Z.; Software, Y.Z.; Validation, Y.Z., L.Z., X.X. and W.W.; Formal analysis, Y.Z.; Investigation, Y.Z.; Writing—original draft, Y.Z.; Writing—review & editing, L.Z., X.X. and W.W.; Visualization, Y.Z.; Supervision, L.Z., X.X. and W.W. All authors have read and agreed to the published version of the manuscript.

Funding

The APC was funded by Beijing University of Posts and Telecommunications.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Hendricks, L.A.; Wang, O.; Shechtman, E.; Sivic, J.; Darrell, T.; Russell, B. Localizing Moments in Video with Natural Language. In Proceedings of the 2017 IEEE International Conference on Computer Vision (ICCV), Venice, Italy, 22–29 October 2017; IEEE: Piscataway, NJ, USA, 2017; pp. 5804–5813. [Google Scholar]
  2. Escorcia, V.; Soldan, M.; Sivic, J.; Ghanem, B.; Russell, B.C. Temporal Localization of Moments in Video Collections with Natural Language. arXiv 2019, arXiv:1907.12763. [Google Scholar]
  3. Zhang, B.; Hu, H.; Lee, J.; Zhao, M.; Chammas, S.; Jain, V.; Ie, E.; Sha, F. A Hierarchical Multi-Modal Encoder for Moment Localization in Video Corpus. arXiv 2020, arXiv:2011.09046. [Google Scholar]
  4. Chen, T.; Wang, W.; Jiang, Z.; Li, R.; Wang, B. Cross-Modality Knowledge Calibration Network for Video Corpus Moment Retrieval. IEEE Trans. Multim. 2024, 26, 3799–3813. [Google Scholar] [CrossRef] [Scilit]
  5. Lei, J.; Yu, L.; Berg, T.L.; Bansal, M. TVR: A Large-Scale Dataset for Video-Subtitle Moment Retrieval. In Computer Vision—ECCV 2020—16th European Conference, Glasgow, UK, 23–28 August 2020, Proceedings, Part XXI; Springer: Berlin/Heidelberg, Germany, 2020; pp. 447–463. [Google Scholar]
  6. Zhang, H.; Sun, A.; Jing, W.; Nan, G.; Zhen, L.; Zhou, J.T.; Goh, R.S.M. Video Corpus Moment Retrieval with Contrastive Learning. In SIGIR ’21: The 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, Virtual Event, Canada, 11–15 July 2021; ACM: New York, NY, USA, 2021; pp. 685–695. [Google Scholar]
  7. Yoon, S.; Hong, J.W.; Yoon, E.; Kim, D.; Kim, J.; Yoon, H.S.; Yoo, C.D. Selective Query-Guided Debiasing for Video Corpus Moment Retrieval. In Computer Vision—ECCV 2022—17th European Conference, Tel Aviv, Israel, 23–27 October 2022, Proceedings, Part XXXVI; Springer: Berlin/Heidelberg, Germany, 2022; pp. 185–200. [Google Scholar]
  8. Yoon, S.; Hong, J.W.; Eom, S.; Yoon, H.S.; Yoon, E.; Kim, D.; Kim, J.; Kim, C.; Yoo, C.D. Counterfactual Two-Stage Debiasing for Video Corpus Moment Retrieval. In IEEE International Conference on Acoustics, Speech and Signal Processing ICASSP 2023, Rhodes Island, Greece, 4–10 June 2023; IEEE: Piscataway, NJ, USA, 2023; pp. 1–5. [Google Scholar]
  9. Nan, G.; Qiao, R.; Xiao, Y.; Liu, J.; Leng, S.; Zhang, H.; Lu, W. Interventional Video Grounding with Dual Contrastive Learning. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, Virtual, 19–25 June 2021; Computer Vision Foundation: New York, NY, USA; IEEE: Piscataway, NJ, USA, 2021; pp. 2765–2775. [Google Scholar]
  10. Yang, X.; Feng, F.; Ji, W.; Wang, M.; Chua, T.-S. Deconfounded Video Moment Retrieval with Causal Intervention. In SIGIR ’21: The 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, Virtual Event, Canada, 11–15 July 2021; ACM: New York, NY, USA, 2021; pp. 1–10. [Google Scholar]
  11. Yuan, Y.; Lan, X.; Wang, X.; Chen, L.; Wang, Z.; Zhu, W. A Closer Look at Temporal Sentence Grounding in Videos: Dataset and Metric. In Proceedings of the 2nd International Workshop on Human-Centric Multimedia Analysis; Association for Computing Machinery: New York, NY, USA, 2021; pp. 13–21. [Google Scholar]
  12. Teney, D.; Abbasnejad, E.; Kafle, K.; Shrestha, R.; Kanan, C.; van den Hengel, A. On the Value of Out-of-Distribution Testing: An Example of Goodhart’s Law. In Proceedings of the Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, Virtual, 6–12 December 2020. [Google Scholar]
  13. Pearl, J.; Glymour, M.; Jewell, N.P. Causal Inference in Statistics: A Primer; Internet Resource; John Wiley & Sons: Hoboken, NJ, USA, 2016. [Google Scholar]
  14. Pearl, J.; Mackenzie, D. The Book of Why: The New Science of Cause and Effect; Basic Books: New York, NY, USA, 2018. [Google Scholar]
  15. Hou, Z.; Ngo, C.W.; Chan, W.K. CONQUER: Contextual Query-aware Ranking for Video Corpus Moment Retrieval. In The 29th ACM International Conference on Multimedia (MM), Virtual Event, China; ACM: New York, NY, USA, 2021; pp. 3900–3908. [Google Scholar]
  16. Yoon, S.; Kim, D.; Hong, J.W.; Kim, J.; Kim, K.; Yoo, C.D. Weakly-Supervised Moment Retrieval Network for Video Corpus Moment Retrieval. In 2021 IEEE International Conference on Image Processing (ICIP); IEEE: Piscataway, NJ, USA, 2021; pp. 534–538. [Google Scholar]
  17. Kim, D.; Yoon, S.; Hong, J.W.; Yoo, C.D. Semantic Association Network for Video Corpus Moment Retrieval. In 2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP); IEEE: Piscataway, NJ, USA, 2022; pp. 1720–1724. [Google Scholar]
  18. Jung, M.; Choi, S.; Kim, J.; Kim, J.H.; Zhang, B.T. Modal-specific Pseudo Query Generation for Video Corpus Moment Retrieval. In 2022 Conference on Empirical Methods in Natural Language Processing (EMNLP), Abu Dhabi, United Arab Emirates; Association for Computational Linguistics: Stroudsburg, PA, USA, 2022; pp. 7769–7781. [Google Scholar]
  19. Hou, D.; Pang, L.; Shen, H.; Cheng, X. Improving Video Corpus Moment Retrieval with Partial Relevance Enhancement. In 2024 International Conference on Multimedia Retrieval (ICMR), Phuket, Thailand; ACM: New York, NY, USA, 2024; pp. 394–403. [Google Scholar]
  20. Zhang, X.; Zhao, P.; Ji, J.; Lu, X.; Yin, Y. Video Corpus Moment Retrieval via Deformable Multigranularity Feature Fusion and Adversarial Training. IEEE Trans. Circuits Syst. Video Technol. 2024, 34, 6686–6698. [Google Scholar] [CrossRef] [Scilit]
  21. Pan, Y.; Zhang, Y.; Zhao, X. FAWL: Weakly-Supervised Video Corpus Moment Retrieval with Frame-Wise Auxiliary Alignment and Weighted Contrastive Learning. In 2025 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Hyderabad, India; IEEE: Piscataway, NJ, USA, 2025; pp. 1–5. [Google Scholar]
  22. Wang, X.; Wu, Z.; Chen, H.; Lan, X.; Zhu, W. Mixup-Augmented Temporally Debiased Video Grounding with Content-Location Disentanglement. In The 31st ACM International Conference on Multimedia (MM), Ottawa, ON, Canada; ACM: New York, NY, USA, 2023; pp. 4450–4459. [Google Scholar]
  23. Lan, X.; Yuan, Y.; Chen, H.; Wang, X.; Jie, Z.; Ma, L.; Wang, Z.; Zhu, W. Curriculum Multi-Negative Augmentation for Debiased Video Grounding. In 2023 Thirty-Seventh AAAI Conference on Artificial Intelligence (AAAI), Washington, DC, USA; AAAI Press: Washington, DC, USA, 2023; pp. 1213–1221. [Google Scholar]
  24. Qi, Z.; Yuan, Y.; Ruan, X.; Wang, S.; Zhang, W.; Huang, Q. Bias-Conflict Sample Synthesis and Adversarial Removal Debias Strategy for Temporal Sentence Grounding in Video. In 2024 Thirty-Eighth AAAI Conference on Artificial Intelligence (AAAI), Vancouver, Canada; AAAI Press: Washington, DC, USA, 2024; pp. 4533–4541. [Google Scholar]
  25. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention is All you Need. In Proceedings of the Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, Long Beach, CA, USA, 4–9 December 2017; pp. 5998–6008. [Google Scholar]
  26. Hjelm, R.D.; Fedorov, A.; Lavoie-Marchildon, S.; Grewal, K.; Bachman, P.; Trischler, A.; Bengio, Y. Learning deep representations by mutual information estimation and maximization. arXiv 2018, arXiv:1808.06670. [Google Scholar]
  27. Zhang, Y.; Zhang, L.; Zhang, Z.; Wang, Z.; Xie, X.; Wang, W. Resolving spurious temporal location dependency for video corpus moment retrieval. In Proceedings of the 2024 IEEE International Conference on Systems, Man, and Cybernetics (SMC), Kuching, Malaysia, 6–10 October 2024; IEEE: Piscataway, NJ, USA, 2024; pp. 5282–5287. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.