SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.11921 · CVPR · 2023

Context De-confounded Emotion Recognition

Dingkang Yang, Shunli Wang, Mingcheng Li, Lihua Zhang, Zhaoyu Chen, Peng Zhai, Zhiyan Dong, Yuzheng Wang, Xiao Zhao, Siao Liu, Shuai Huang

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2303.11921.json · badge: /api/ran/2303.11921.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
ydk122024/ccim marked official in Papers with Code
Papers with Code archive
3 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
CCIM Ran
ran on a synthesized input · constructed an object; no result was computed
ydk122024/ccim/CCIM.py
code served (permissive licence) · get_code("97925b5a06d3f45d")
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, through the batch API) and returned an instance of its own class, CCIM: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type 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
import torch.nn as nn
import math

torch.manual_seed(0)

# Define the parameters for CCIM
num_joint_feature = 4  # Size of joint features
num_gz = 3  # Size of confounder/gz features
strategy = 'dp_cause'  # Strategy for causal intervention
dataset = 'EMOTIC'  # Dataset type

# Create sample tensors for forward pass
batch_size = 2
joint_feature = torch.randn(batch_size, num_joint_feature)
confounder_dictionary = torch.randn(batch_size, num_gz)
prior = torch.ones(batch_size, num_gz) / num_gz  # Probabilities that sum to 1

ARGS = {
    'num_joint_feature': num_joint_feature,
    'num_gz': num_gz,
    'strategy': strategy,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CCIM — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CCIM output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
additive_intervention Ran
ran on a synthesized input
ydk122024/ccim/CCIM.py
code served (permissive licence) · get_code("2f79ff7e2381ff18")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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
import torch.nn as nn
import torch.nn.functional as F

class additive_intervention(nn.Module):

    def __init__(self, con_size, fuse_size):
        super(additive_intervention, self).__init__()
        self.con_size = con_size
        self.fuse_size = fuse_size
        self.Tan = nn.Tanh()
        self.query = nn.Linear(self.fuse_size, 256, bias=False)
        self.key = nn.Linear(self.con_size, 256, bias=False)
        self.w_t = nn.Linear(256, 1, bias=False)

    def forward(self, confounder_set, fuse_rep, probabilities):
        query = self.query(fuse_rep)
        key = self.key(confounder_set)
        query_expand = query.unsqueeze(1)
        fuse = query_expand + key
        fuse = self.Tan(fuse)
        attention = self.w_t(fuse)
        attention = F.softmax(attention, dim=1)
        fin = (attention * confounder_set * probabilities).sum(1)
        return fin


INIT_ARGS = {
    'con_size': 4,
    'fuse_size': 5,
}

ARGS = {
    'confounder_set': torch.randn(2, 3, 4),
    'fuse_rep': torch.randn(2, 5),
    'probabilities': torch.randn(2, 3, 1),
}

if __name__ == '__main__':
    model = additive_intervention(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
classifier Ran
ran on a synthesized input
ydk122024/ccim/CCIM.py
code served (permissive licence) · get_code("3dd048e9824c806b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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
import torch.nn as nn
import math

def gelu(x):
    return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3))))

class classifier(nn.Module):

    def __init__(self):
        super(classifier, self).__init__()
        self.fc1 = nn.Linear(128, 128 * 4)
        self.fc2 = nn.Linear(128 * 4, 128)
        self.drop = nn.Dropout(p=0.5)
        self.norm = nn.BatchNorm1d(128)

    def forward(self, out):
        residual = out
        out = self.norm(out)
        out = gelu(self.fc1(out))
        out = self.drop(out)
        out = self.fc2(out)
        out = self.drop(out)
        out = residual + out * 0.3
        return out

INIT_ARGS = {}

ARGS = {
    'out': torch.randn(2, 128)
}

if __name__ == '__main__':
    model = classifier(**INIT_ARGS)
    model.eval()
    result = model(**ARGS)
    print(f"Output shape: {result.shape}")
    print(f"Output: {result}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
gelu Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from iesl/softmax_cpr_recommend
pointer only · get_code("d9dcfb510a5e2690")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

dot_product_intervention Not yet run
unverified (harvested, no recorded run)
ydk122024/ccim/CCIM.py
code served (permissive licence) · get_code("e1e8244b962d9c28")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 4 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
gelu
brick of this paper's assembly: helper
51 other papers
38 dated earlier, 9 later, 4 same year, order not determinable · 8 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
and 48 more not named here

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

Context-Aware Emotion Recognition (CAER) is a crucial and challenging task that aims to perceive the emotional states of the target person with contextual information. Recent approaches invariably focus on designing sophisticated architectures or mechanisms to extract seemingly meaningful representations from subjects and contexts. However, a long-overlooked issue is that a context bias in existing datasets leads to a significantly unbalanced distribution of emotional states among different context scenarios. Concretely, the harmful bias is a confounder that misleads existing models to learn spurious correlations based on conventional likelihood estimation, significantly limiting the models' performance. To tackle the issue, this paper provides a causality-based perspective to disentangle the models from the impact of such bias, and formulate the causalities among variables in the CAER task via a tailored causal graph. Then, we propose a Contextual Causal Intervention Module (CCIM) based on the backdoor adjustment to de-confound the confounder and exploit the true causal effect for model training. CCIM is plug-in and model-agnostic, which improves diverse state-of-the-art approaches by considerable margins. Extensive experiments on three benchmark datasets demonstrate the effectiveness of our CCIM and the significance of causal insight.

For agents

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

get_harvested_code_for_paper("2303.11921")
get_code_for_paper("2303.11921")
have("2303.11921")

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

curl https://syntology.ai/api/ran/2303.11921.json

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

[![Syntology run record](https://syntology.ai/api/ran/2303.11921.svg)](https://syntology.ai/paper/2303.11921)

Connect an agent — have() is free.