Papers
Topics
Authors
Recent
Search
2000 character limit reached

RS-Net: Context-Aware Relation Scoring

Updated 14 November 2025
  • RS-Net is a modular, context-aware scoring framework that evaluates object relations in videos by integrating spatial interactions and temporal context.
  • It employs Transformer-based encoders to capture intra-frame and inter-frame cues, thereby improving relation classification and mitigating long-tail effects.
  • RS-Net integrates seamlessly with existing DSGG backbones and demonstrates measurable gains in recall, precision, and mean recall on the Action Genome dataset.

Relation Scoring Network (RS-Net) is a modular context-aware scoring framework designed to improve Dynamic Scene Graph Generation (DSGG) in videos by learning to score the “meaningfulness” of object pairs based on both spatial interactions and temporally aggregated video context. Distinct from previous approaches, RS-Net directly models the distinction between meaningful and irrelevant pairs, integrating contextual scoring via spatial and temporal Transformer-based encoders. The design enables seamless integration into existing DSGG backbones with minimal architectural changes, yielding improvements in Recall, Precision, and mean Recall, especially in the presence of long-tailed relation distributions. RS-Net was introduced and evaluated on the Action Genome dataset, demonstrating both empirical efficacy and computational efficiency (Jo et al., 11 Nov 2025).

1. Dynamic Scene Graph Generation and Problem Setup

In DSGG, the goal is to produce, for a sequence of video frames {It}t=1T\{I_t\}_{t=1}^T, a corresponding sequence of scene graphs: Gt=(Vt,Et),t=1,,T,G_t = (V_t, E_t), \quad t = 1, \dots, T, where Vt={vti}i=1NtV_t = \{v^i_t\}_{i=1}^{N_t} is the set of detected objects (nodes) in frame tt, and $E_t = \{(i, j, r^k_t)\}_{k=1}^{K(t)}}$ is the set of K(t) subject–predicate–object (triplet) relations with labels rtkr^k_t.

Each object ii at time tt is assigned:

  • Visual feature vtiRdv\mathbf{v}^i_t \in \mathbb{R}^{d_v},
  • Bounding box bti\mathbf{b}^i_t,
  • Category distribution Gt=(Vt,Et),t=1,,T,G_t = (V_t, E_t), \quad t = 1, \dots, T,0.

For each ordered pair Gt=(Vt,Et),t=1,,T,G_t = (V_t, E_t), \quad t = 1, \dots, T,1, a relation representation Gt=(Vt,Et),t=1,,T,G_t = (V_t, E_t), \quad t = 1, \dots, T,2 is constructed, and each possible predicate class Gt=(Vt,Et),t=1,,T,G_t = (V_t, E_t), \quad t = 1, \dots, T,3 receives a predicate score Gt=(Vt,Et),t=1,,T,G_t = (V_t, E_t), \quad t = 1, \dots, T,4. Conventional approaches lack explicit discrimination between related and unrelated pairs, limiting their ability to suppress semantically vacuous predictions during inference. RS-Net addresses this by computing a contextual “relation score” for all pairs and integrating this score into downstream triplet predictions.

2. Spatial and Temporal Context Encoders

2.1 Spatial Context Encoder

The spatial encoder captures intra-frame contextual cues via Transformer-based self-attention over relation features.

  • Relation features for frame Gt=(Vt,Et),t=1,,T,G_t = (V_t, E_t), \quad t = 1, \dots, T,5:

Gt=(Vt,Et),t=1,,T,G_t = (V_t, E_t), \quad t = 1, \dots, T,6

where “bar” denotes learned linear projection and Gt=(Vt,Et),t=1,,T,G_t = (V_t, E_t), \quad t = 1, \dots, T,7 is the union-box RoI feature.

  • The feature sequence is prepended with a learnable [Spa] context token Gt=(Vt,Et),t=1,,T,G_t = (V_t, E_t), \quad t = 1, \dots, T,8:

Gt=(Vt,Et),t=1,,T,G_t = (V_t, E_t), \quad t = 1, \dots, T,9

processed by Vt={vti}i=1NtV_t = \{v^i_t\}_{i=1}^{N_t}0 Transformer layers:

Vt={vti}i=1NtV_t = \{v^i_t\}_{i=1}^{N_t}1

yielding an updated context token Vt={vti}i=1NtV_t = \{v^i_t\}_{i=1}^{N_t}2 and enriched per-pair relation features Vt={vti}i=1NtV_t = \{v^i_t\}_{i=1}^{N_t}3.

2.2 Temporal Context Encoder

To aggregate video-level context, the spatial context tokens are stacked across the sequence:

  • Temporal input sequence:

Vt={vti}i=1NtV_t = \{v^i_t\}_{i=1}^{N_t}4

where Vt={vti}i=1NtV_t = \{v^i_t\}_{i=1}^{N_t}5 is a learnable [Tmp] token.

  • After adding a learnable positional embedding Vt={vti}i=1NtV_t = \{v^i_t\}_{i=1}^{N_t}6, the sequence is processed via Vt={vti}i=1NtV_t = \{v^i_t\}_{i=1}^{N_t}7 Transformer layers:

Vt={vti}i=1NtV_t = \{v^i_t\}_{i=1}^{N_t}8

with the output Vt={vti}i=1NtV_t = \{v^i_t\}_{i=1}^{N_t}9 serving as a video-level context token.

3. Unified Triplet Scoring and Losses

3.1 Relation Scoring Decoder

For each enriched pair tt0, the decoder concatenates this feature with tt1 and applies a small MLP followed by softmax: tt2 where tt3 quantifies the “meaningfulness” and tt4 the “irrelevance” of relation tt5 at time tt6.

3.2 Triplet Score Fusion

For standard DSGG, the base confidence for triplet tt7 is given by: tt8 where tt9 and $E_t = \{(i, j, r^k_t)\}_{k=1}^{K(t)}}$0 are subject/object detection confidences, and $E_t = \{(i, j, r^k_t)\}_{k=1}^{K(t)}}$1 is the per-predicate score. RS-Net injects contextual awareness by fusing its score: $E_t = \{(i, j, r^k_t)\}_{k=1}^{K(t)}}$2 which serves to suppress spurious triplets and emphasize contextually relevant ones.

3.3 Loss Functions

The total training loss is a sum of three terms: $E_t = \{(i, j, r^k_t)\}_{k=1}^{K(t)}}$3

  • Object detection:

$E_t = \{(i, j, r^k_t)\}_{k=1}^{K(t)}}$4

  • Predicate classification (multi-label pairwise ranking):

$E_t = \{(i, j, r^k_t)\}_{k=1}^{K(t)}}$5

  • Relation scoring (focal loss):

$E_t = \{(i, j, r^k_t)\}_{k=1}^{K(t)}}$6

with $E_t = \{(i, j, r^k_t)\}_{k=1}^{K(t)}}$7 and focusing parameter $E_t = \{(i, j, r^k_t)\}_{k=1}^{K(t)}}$8 to balance class prevalence and focus.

4. Integration with Dynamic Scene Graph Generation Frameworks

RS-Net is architected for modularity:

  • At inference, any DSGG backbone supplies per-relation feature embeddings $E_t = \{(i, j, r^k_t)\}_{k=1}^{K(t)}}$9.
  • Video context (rtkr^k_t0) is concatenated: rtkr^k_t1 and fed to existing predicate classification heads.
  • In parallel, the RS-Net MLP provides scores rtkr^k_t2, whose meaningfulness probability is multiplied into the final triplet score.

This procedure requires no modification to the object detector or scene graph construction logic. It is compatible with various DSGG backbones, including STTran, STKET, and DSG-DETR, among others.

5. Experimental Evaluation

On the Action Genome benchmark, RS-Net demonstrates consistent gains in recall and precision, especially in mean Recall (mR), which is critical for long-tailed relation distributions.

Backbone R@10 (Baseline → RS-Net) P@10 (Baseline → RS-Net) rtkr^k_t3 mR@10 (STTran)
STTran 25.1 → 28.3 (+3.2) 17.9 → 20.7 (+2.8) +2.4
STKET 26.4 → 28.9 (+2.5) 18.9 → 21.2 (+2.3) -
DSG-DETR 30.3 → 30.5 (+0.2) 22.1 → 22.2 (+0.1) -

Additional results:

  • SGCLS: DSG-DETR R@10 = 49.9 → 50.5, P@10 = 56.6 → 57.0.
  • Ablation: Removal of the temporal encoder reduces SGDET R@10 from 28.3 to 28.0.
  • Learnable rtkr^k_t4 token outperforms mean-pooling (28.3 vs. 28.0 R@10).
  • Context-fusion produces small but consistent improvements.
  • Precision and FPS remain competitive: e.g., STTran increases from 0.74 to 0.75 FPS after RS-Net integration.

6. Computational Considerations

The addition of RS-Net raises parameter counts (e.g., STTran grows from 126.3M to 158.6M parameters, a +32M increase), with minimal or slightly improved frame-per-second throughput. Negative sampling in the RSN loss speeds convergence by reducing exposure to noisy negatives, and GPU parallel efficiency benefits from aligned tensor shapes.

7. Analysis, Limitations, and Extensions

RS-Net’s explicit learning of “meaningful vs. irrelevant” relations mitigates long-tail effects by down-weighting predominant but semantically empty co-occurrences. The approach is modular, back-end agnostic, and leverages both intra-frame and inter-frame cues. A limitation is the isolated treatment of relations, suggesting future incorporation of graph propagation. Potential extensions include dynamic temporal windows, incorporation of cross-video context, and unsupervised relation mining. A plausible implication is that RS-Net’s context-driven score may benefit other video-based relational or multi-object understanding tasks within and beyond DSGG frameworks.

Pseudocode Illustration

rtkr^k_t5

RS-Net’s core contribution is a unified, context-sensitive scoring mechanism for pairwise relations in DSGG, facilitating robust, efficient, and accurate video scene understanding in the presence of challenging data distributions.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Relation Scoring Network (RS-Net).