SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.09513 · ECCV · 2022

On Multi-Domain Long-Tailed Recognition, Imbalanced Domain Generalization and Beyond

Yuzhe Yang, Hao Wang, Dina Katabi

arXiv · PDF · Open in the Atlas

Code that ran

2 of 4 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 1 has no contract verdict; 1 failure of our instrument; 2 no recorded run), measured 2026-11-22; 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/2203.09513.json · badge: /api/ran/2203.09513.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
YyzHarry/multi-domain-imbalance community
Papers with Code archive
2 ran · 2 no recorded run
FunctionStatusWhere it lives
Algorithm Ran
ran on a synthesized input · constructed an object; no result was computed
YyzHarry/multi-domain-imbalance/mdlt/learning/algorithms.py
code served (permissive licence) · get_code("bd0ab0e227b395a8")
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, Algorithm: 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

torch.manual_seed(0)

# Define a simple feature extractor model
class SimpleFeatureExtractor(nn.Module):
    def __init__(self, input_shape, hidden_dim=8):
        super(SimpleFeatureExtractor, self).__init__()
        self.fc1 = nn.Linear(input_shape, hidden_dim)
        self.fc2 = nn.Linear(hidden_dim, 4)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

# Define a simple classifier model
class SimpleClassifier(nn.Module):
    def __init__(self, feature_dim, num_classes):
        super(SimpleClassifier, self).__init__()
        self.fc = nn.Linear(feature_dim, num_classes)
    
    def forward(self, x):
        return self.fc(x)

# Define a minimal hparams dict
hparams = {
    'lr': 0.001,
    'batch_size': 2,
    'weight_decay': 0.0001,
    'lambda': 1.0,
}

# Define Algorithm arguments
input_shape = 5  # input feature dimension
num_classes = 3  # number of classification classes
num_domains = 2  # number of training domains
env_labels = None  # optional environment labels

ARGS = {
    'input_shape': input_shape,
    'num_classes': num_classes,
    'num_domains': num_domains,
    'hparams': hparams,
    'env_labels': env_labels,
}
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 Algorithm — 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 Algorithm 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
count_samples_per_class Ran
ran; our contract draft was wrong, not the code
YyzHarry/multi-domain-imbalance/mdlt/learning/algorithms.py
code served (permissive licence) · get_code("e5ca5985bfa097bc")
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 list, ndim 1, dtype family int; 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 numpy as np
from collections import Counter

torch_imported = False
try:
    import torch
    torch_imported = True
    torch.manual_seed(0)
except ImportError:
    pass

# Analyze the function:
# - targets: iterable of values that can be cast to int
# - num_classes: int specifying the number of classes
# The function iterates through targets, converts each to int, and counts occurrences
# Returns a list of counts for each class index from 0 to num_classes-1

# Create valid arguments
targets = [0, 1, 1, 2, 0, 1]  # List of class labels
num_classes = 3

ARGS = {
    "targets": targets,
    "num_classes": num_classes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — 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
BoDA Not yet run
unverified (harvested, no recorded run)
YyzHarry/multi-domain-imbalance/mdlt/learning/algorithms.py
code served (permissive licence) · get_code("8e04419067436af9")
How it ran

no invocation recorded.

ERM Not yet run
unverified (harvested, no recorded run)
YyzHarry/multi-domain-imbalance/mdlt/learning/algorithms.py
code served (permissive licence) · get_code("dca4155e189930af")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 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.

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-22.

Repositories linked to this paper

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

Abstract

Real-world data often exhibit imbalanced label distributions. Existing studies on data imbalance focus on single-domain settings, i.e., samples are from the same data distribution. However, natural data can originate from distinct domains, where a minority class in one domain could have abundant instances from other domains. We formalize the task of Multi-Domain Long-Tailed Recognition (MDLT), which learns from multi-domain imbalanced data, addresses label imbalance, domain shift, and divergent label distributions across domains, and generalizes to all domain-class pairs. We first develop the domain-class transferability graph, and show that such transferability governs the success of learning in MDLT. We then propose BoDA, a theoretically grounded learning strategy that tracks the upper bound of transferability statistics, and ensures balanced alignment and calibration across imbalanced domain-class distributions. We curate five MDLT benchmarks based on widely-used multi-domain datasets, and compare BoDA to twenty algorithms that span different learning strategies. Extensive and rigorous experiments verify the superior performance of BoDA. Further, as a byproduct, BoDA establishes new state-of-the-art on Domain Generalization benchmarks, highlighting the importance of addressing data imbalance across domains, which can be crucial for improving generalization to unseen domains. Code and data are available at: https://github.com/YyzHarry/multi-domain-imbalance.

For agents

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

get_harvested_code_for_paper("2203.09513")
get_code_for_paper("2203.09513")
have("2203.09513")

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

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

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

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

Connect an agent — have() is free.