Skip to content

Video understanding, tracking, generation, and world models · Video self-supervision · VID019 · Training method

Odd-One-Out Networks

Presents several video sequences and asks which one has an inconsistent temporal arrangement. The multi-choice pretext encourages comparison among sequences, rather than independently deciding whether a single clip…

Explained here Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

Documented in the Academy only. There's no Set up button.

Availability
Explained here
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Presents several video sequences and asks which one has an inconsistent temporal arrangement. The multi-choice pretext encourages comparison among sequences, rather than independently deciding whether a single clip looks valid.

Question / objective

Learn transferable video representations from automatically constructed targets or weak cross-modal supervision. This is a learning or inference objective, not a test of a statistical null hypothesis.

Method type and supervision

training-method · Video self-supervision. Self-supervised pretraining; cross-modal variants also use weak paired language supervision.

Architecture / computational structure

Shared encoding of candidate sequences followed by a relational odd-item classifier.

Assumptions

Inputs must satisfy the temporal, modality and annotation protocol described below. The corrupted item can be identifiable through low-level artifacts or motion magnitude. Repeated or symmetric actions may not have a unique temporal ordering.

Formula / computational definition

L=−log⁡pθ(j∗∣S1,…,SK)L=-\log p_\theta(j^*\mid S_1,\ldots,S_K), where j∗j^* indexes the deliberately corrupted sequence among KK candidates. Learned relational features support the odd-one-out prediction.

Parameters and notation

Learned/estimated quantities: Encoder and predictor/projection weights are learned; target-network EMA values are state updates, and masks/negative policies are design choices. Symbols specific to the objective are defined with the equation. Hyperparameters and design choices: Candidate count, corruption operation, frame encoding, temporal interval and aggregation architecture determine task difficulty.

Fitting, fine-tuning, and adaptation

After pretraining, replace the odd-item head with the target task head. Vary corruption rules during validation to detect pretext shortcuts rather than merely raise training accuracy. Use a separate adaptation validation split, monitor the target metric and retention of previously useful behavior, and save the exact preprocessing and training configuration.

How to use and calibrate

Fix the input protocol and target before fitting; choose design settings on held-out source videos, then freeze the evaluation procedure. Evaluate downstream action transfer, order-task calibration and sensitivity to corruption changes, with videos disjoint across pretraining and testing where required.

Example application

Pretrain on unlabeled instructional videos through sequence comparisons.

Interpretation / pitfalls

Watch out

An optimized training objective or a favorable example does not establish generalization. Evaluate downstream action transfer, order-task calibration and sensitivity to corruption changes, with videos disjoint across pretraining and testing where required. The example below isolates one mechanism and cannot substantiate a full-model benchmark claim.

Python and R code examples

Component: Score which candidate is temporally corrupted. Dependencies: NumPy in Python; base R in R; run the shared setup above. Python component: executed successfully. R component: unexecuted. No complete model training or pretrained inference was executed.

Full implementation route — Python: Generate a candidate set and train a shared encoder plus candidate-index classifier. R: Build permutation sets and multiclass loss in R; bridge the representation learner and retain candidate labels for reproducibility.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — Score which candidate is temporally corrupted.

Shared setup for this chapter
import numpy as np

def softmax(x):
    z = np.asarray(x, dtype=float)
    e = np.exp(z - z.max())
    return e / e.sum()
candidates = np.array([[0,1,2],[4,6,5],[8,9,10]])
logits = np.array([.1,1.5,.2]); odd_index = 1
print(candidates,"odd-choice loss",-np.log(softmax(logits)[odd_index]))
R

Component demo, not a trained model — Score which candidate is temporally corrupted.

Shared setup for this chapter
softmax <- function(x) {
  e <- exp(x - max(x))
  e / sum(e)
}
candidates <- rbind(c(0,1,2),c(4,6,5),c(8,9,10))
logits <- c(.1,1.5,.2); odd_index <- 2L
print(candidates); print(-log(softmax(logits)[odd_index]))

Sources

From the CodeSplash reference, entry VID019.