SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · Ding_Motion-Aware_Contrastive_Video_Representation_Learning_via_Foreground-Background_Merging_CVPR_2022_paper · CVPR · 2022

Motion-aware Contrastive Video Representation Learning via Foreground-background Merging

Rui Qian, Haohang Xu, Hongkai Xiong, Jue Wang, Tianyu Yang, Shuangrui Ding, Maomao Li, Qingyi Chen

Open in the Atlas

Code that ran

3 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 5 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/Ding_Motion-Aware_Contrastive_Video_Representation_Learning_via_Foreground-Background_Merging_CVPR_2022_paper.json · badge: /api/ran/Ding_Motion-Aware_Contrastive_Video_Representation_Learning_via_Foreground-Background_Merging_CVPR_2022_paper.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
Mark12Ding/FAME canonical (classifier label)
classifier basis: census
3 ran · 5 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Mark12Ding/FAME/utils/train_utils.py
code served (permissive licence) · get_code("b0f936d4d6ae3b8c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create output tensor: batch_size=2, num_classes=4
# This represents logits from a model
output = torch.randn(2, 4)

# Create target tensor: batch_size=2
# These are class indices (0-3 for 4 classes)
target = torch.tensor([1, 3])

# topk parameter: tuple of k values to compute accuracy for
topk = (1, 2)

ARGS = {
    "output": output,
    "target": target,
    "topk": topk,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_padding_shape Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Mark12Ding/FAME/backbone/i3d.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from seominseok0429/inception-I3D-NON-LOCAL, is pointer only (licence: NONE) · get_code("45cc344e60f640a1")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from seominseok0429/inception-I3D-NON-LOCAL, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

simplify_padding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Mark12Ding/FAME/backbone/i3d.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from seominseok0429/inception-I3D-NON-LOCAL, is pointer only (licence: NONE) · get_code("81ec17604dc709cc")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from seominseok0429/inception-I3D-NON-LOCAL, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Augment_GPU_ft Not yet run
unverified (harvested, no recorded run)
Mark12Ding/FAME/moco/loader.py
code served (permissive licence) · get_code("7604b23b59310efe")
How it ran

no invocation recorded.

Augment_GPU_pre Not yet run
unverified (harvested, no recorded run)
Mark12Ding/FAME/moco/loader.py
code served (permissive licence) · get_code("684a6971fa9d17eb")
How it ran

no invocation recorded.

concat_all_gather Not yet run
unverified (harvested, no recorded run)
Mark12Ding/FAME/moco/builder.py
code served (permissive licence) · get_code("73cecca9f3575f09")
How it ran

no invocation recorded.

r2plus1d_18 Not yet run
unverified (harvested, no recorded run)
Mark12Ding/FAME/backbone/r2plus1d.py
code served (permissive licence) · get_code("e7bf2e3a3ad021c5")
How it ran

no invocation recorded.

test Not yet run
unverified (harvested, no recorded run)
Mark12Ding/FAME/main_retrieve.py
code served (permissive licence) · get_code("2679d2440b5bd036")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 4 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
concat_all_gather 138 other papers
34 dated earlier, 72 later, 32 same year, order not determinable · 33 only as an assembly brick
1710.09412 (2017-10)
mixup: BEYOND EMPIRICAL RISK MINIMIZATION
1905.04899 (2019-05)
CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 135 more not named here
accuracy 116 other papers
34 dated earlier, 51 later, 31 same year, order not determinable · 8 only as an assembly brick
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1610.05820 (2016-10)
Membership Inference Attacks Against Machine Learning Models
1905.03696 (2019-05)
HAWQ: Hessian AWare Quantization of Neural Networks with Mixed-Precision
and 113 more not named here
get_padding_shape 9 other papers
3 dated earlier, 5 later, 1 same year, order not determinable
1705.07750 (2017-05)
Quo Vadis, Action Recognition? A New Model and the Kinetics Dataset
1711.07971 (2017-11)
Non-local Neural Networks
1912.06430 (2019-12)
End-to-End Learning of Visual Representations from Uncurated Instructional Videos
and 6 more not named here
simplify_padding 7 other papers
2 dated earlier, 4 later, 1 same year, order not determinable
1705.07750 (2017-05)
Quo Vadis, Action Recognition? A New Model and the Kinetics Dataset
1711.07971 (2017-11)
Non-local Neural Networks
2204.03646 (2022-04)
FineDiving: A Fine-grained Dataset for Procedure-aware Action Quality Assessment
and 4 more not named here
r2plus1d_18 3 other papers
2 dated earlier, 1 same year, order not determinable
1711.11248 (2017-11)
A Closer Look at Spatiotemporal Convolutions for Action Recognition
2103.10211 (2021-03)
Space-Time Crop & Attend: Improving Cross-modal Video Representation Learning
136670659 (2022 (year only))
MovieCuts: A New Dataset and Benchmark for Cut Type Recognition

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

In light of the success of contrastive learning in the image domain, current self-supervised video representation learning methods usually employ contrastive loss to facilitate video representation learning. When naively pulling two augmented views of a video closer, the model however tends to learn the common static background as a shortcut but fails to capture the motion information, a phenomenon dubbed as background bias. Such bias makes the model suffer from weak generalization ability, leading to worse performance on downstream tasks such as action recognition. To alleviate such bias, we propose Foreground-background Merging (FAME) to deliberately compose the moving foreground region of the selected video onto the static background of others. Specifically, without any off-the-shelf detector, we extract the moving foreground out of background regions via the frame difference and color statistics, and shuffle the background regions among the videos. By leveraging the semantic consistency between the original clips and the fused ones, the model focuses more on the motion patterns and is debiased from the background shortcut. Extensive experiments demonstrate that FAME can effectively resist background cheating and thus achieve the state-of-the-art performance on downstream tasks across UCF101, HMDB51, and Div-ing48 datasets. The code and configurations are released at https://github.com/Mark12Ding/FAME.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("Ding_Motion-Aware_Contrastive_Video_Representation_Learning_via_Foreground-Background_Merging_CVPR_2022_paper")
get_code_for_paper("Ding_Motion-Aware_Contrastive_Video_Representation_Learning_via_Foreground-Background_Merging_CVPR_2022_paper")
have("Ding_Motion-Aware_Contrastive_Video_Representation_Learning_via_Foreground-Background_Merging_CVPR_2022_paper")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/Ding_Motion-Aware_Contrastive_Video_Representation_Learning_via_Foreground-Background_Merging_CVPR_2022_paper.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/Ding_Motion-Aware_Contrastive_Video_Representation_Learning_via_Foreground-Background_Merging_CVPR_2022_paper.svg)](https://syntology.ai/paper/Ding_Motion-Aware_Contrastive_Video_Representation_Learning_via_Foreground-Background_Merging_CVPR_2022_paper)

Connect an agent — have() is free.