SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.00912 · 2022

Federated Domain Generalization for Image Recognition via Cross-Client Style Transfer

arXiv · PDF · Open in the Atlas

Code that ran

3 of 12 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 2 have no contract verdict; 1 failure of our instrument; 9 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/2210.00912.json · badge: /api/ran/2210.00912.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
JeremyCJM/CCST canonical (classifier label)
classifier basis not recorded on the link
3 ran · 9 no recorded run
FunctionStatusWhere it lives
test_transform Ran
ran; our contract draft was wrong, not the code
JeremyCJM/CCST/style_transfer/AdaIN/CCST_OverallStyleTransfer.py
pointer only (licence: CC0-1.0); the stored copy get_code serves, from filippobotti/mambast, is pointer only (licence: NONE) · get_code("44b1906941c2c3ed")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (CC0-1.0), but get_code serves the stored copy, first harvested from filippobotti/mambast, 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.

validate Ran
ran on a synthesized input
JeremyCJM/CCST/reconstruct_img/imagenet_reconstruct.py
code served (permissive licence) · get_code("7114e27587038e77")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type, ndim and shape 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 numpy as np
from unittest.mock import MagicMock

torch.manual_seed(0)

# Create a minimal VGG-like model that returns a 4D tensor
class MinimalVGG(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 64, kernel_size=3, padding=1)
    
    def forward(self, x):
        return self.conv(x)

# Create a minimal model that takes style stats and outputs an image
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(128, 3 * 16 * 16)
    
    def forward(self, x):
        # x is squeezed style_stat (128,) for batch_size=2 with 64 channels
        # Reshape to image-like output (2, 3, 16, 16)
        batch_size = x.shape[0] if len(x.shape) > 1 else 1
        out = self.fc(x.view(batch_size, -1))
        return out.view(batch_size, 3, 16, 16)

# Create a minimal dataloader (list of batches)
def create_val_loader():
    val_loader = []
    for _ in range(2):
        images = torch.randn(2, 3, 16, 16)
        labels = torch.zeros(2)
        val_loader.append((images, labels))
    return val_loader

# Create a minimal criterion
criterion = nn.MSELoss()

# Create a minimal writer (TensorBoard SummaryWriter mock)
writer = MagicMock()
writer.add_scalar = MagicMock()
writer.add_image = MagicMock()

# Create args object
class Args:
    def __init__(self):
        self.gpu = None
        self.print_freq = 1
        self.save_freq = 1

args = Args()

# Build the argument dictionary
ARGS = {
    'val_loader': create_val_loader(),
    'model': MinimalModel(),
    'vgg': MinimalVGG(),
    'criterion': criterion,
    'epoch': 1,
    'args': args,
    'writer': writer,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
validate Ran
ran on a synthesized input
JeremyCJM/CCST/reconstruct_img/imagenet_reconstruct_lpips.py
code served (permissive licence) · get_code("a5faead5c0894c58")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type, ndim and shape 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
from torch.utils.tensorboard import SummaryWriter
import tempfile

torch.manual_seed(0)

# Build a minimal VGG model that returns a 4D tensor for calc_mean_std
class MinimalVGG(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 64, kernel_size=3, padding=1)
    
    def forward(self, x):
        # Return shape (N, C, H, W) where N=batch, C=channels
        return self.conv(x)

# Build a minimal model that takes style stats and outputs images
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(128, 3 * 8 * 8)
    
    def forward(self, x):
        # x is style_stats with shape (N, C*2) after squeeze
        batch_size = x.shape[0]
        out = self.fc(x)
        return out.view(batch_size, 3, 8, 8)

# Minimal MSE loss
class MSELoss(nn.Module):
    def forward(self, pred, target):
        return torch.mean((pred - target) ** 2)

# Minimal LPIPS loss
class LPIPSLoss(nn.Module):
    def forward(self, pred, target, normalize=False):
        if normalize:
            pred = pred / (torch.norm(pred, dim=1, keepdim=True) + 1e-5)
            target = target / (torch.norm(target, dim=1, keepdim=True) + 1e-5)
        return torch.abs(pred - target)

# Create data loader: list of (images, labels) tuples
# images shape: (batch_size=2, channels=3, height=8, width=8)
val_loader = [
    (torch.randn(2, 3, 8, 8), torch.zeros(2)),
    (torch.randn(2, 3, 8, 8), torch.zeros(2)),
]

# Create models
model = MinimalModel()
vgg = MinimalVGG()

# Create loss functions as tuple
mse_loss = MSELoss()
lpips_loss = LPIPSLoss()
criterion = (mse_loss, lpips_loss)

# Create a minimal args object
class Args:
    def __init__(self):
        self.gpu = None
        self.loss_metric = 'psnr'
        self.print_freq = 1
        self.save_freq = 1

args = Args()

# Create a TensorBoard writer
with tempfile.TemporaryDirectory() as tmpdir:
    writer = SummaryWriter(log_dir=tmpdir)
    
    epoch = 0
    
    ARGS = {
        'val_loader': val_loader,
        'model': model,
        'vgg': vgg,
        'criterion': criterion,
        'epoch': epoch,
        'args': args,
        'writer': writer,
    }
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
calc_mean_std Not yet run
unverified (harvested, no recorded run)
JeremyCJM/CCST/reconstruct_img/imagenet_reconstruct.py
code served (permissive licence) · get_code("2d434599536522ee")
How it ran

no invocation recorded.

calc_sum Not yet run
unverified (harvested, no recorded run)
JeremyCJM/CCST/style_transfer/AdaIN/CCST_SingleStyleTransfer.py
code served (permissive licence) · get_code("c72f36159b491762")
How it ran

no invocation recorded.

cast_to_image Not yet run
unverified (harvested, no recorded run)
JeremyCJM/CCST/reconstruct_img/imagenet_reconstruct.py
code served (permissive licence) · get_code("b1dd5c49ef99e5a4")
How it ran

no invocation recorded.

classifier Not yet run
unverified (harvested, no recorded run)
JeremyCJM/CCST/utils/rsc_utils_densenet.py
code served (permissive licence) · get_code("f6256149c0715845")
How it ran

no invocation recorded.

featurizer Not yet run
unverified (harvested, no recorded run)
JeremyCJM/CCST/utils/rsc_utils_densenet.py
code served (permissive licence) · get_code("95bbc26484035020")
How it ran

no invocation recorded.

max_test Not yet run
unverified (harvested, no recorded run)
JeremyCJM/CCST/read_log.py
code served (permissive licence) · get_code("9d5f72743fd7ee70")
How it ran

no invocation recorded.

train_fedprox Not yet run
unverified (harvested, no recorded run)
JeremyCJM/CCST/federated/fed_run.py
pointer only (licence: CC0-1.0); the stored copy get_code serves, from med-air/FedBN, is pointer only (licence: NONE) · get_code("3c6e4c6321f0a002")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (CC0-1.0), but get_code serves the stored copy, first harvested from med-air/FedBN, 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. No invocation recorded.

train_meta Not yet run
unverified (harvested, no recorded run)
JeremyCJM/CCST/federated/fed_run.py
code served (permissive licence) · get_code("660e83a7dc5113e8")
How it ran

no invocation recorded.

update Not yet run
unverified (harvested, no recorded run)
JeremyCJM/CCST/utils/rsc_utils_densenet.py
code served (permissive licence) · get_code("69f7b99ec0fda254")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 10 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
test_transform 2 other papers
1 dated earlier, 1 later
2006.07991 (2020-06)
Emergent Properties of Foveated Perceptual Systems
2409.10385 (2024-09)
Mamba-ST: State Space Model for Efficient Style Transfer
train_fedprox 1 other paper
1 dated earlier
2102.07623 (2021-02)
FedBN: Federated Learning on Non-IID Features via Local Batch Normalization

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

Domain generalization (DG) has been a hot topic in image recognition, with a goal to train a general model that can perform well on unseen domains. Recently, federated learning (FL), an emerging machine learning paradigm to train a global model from multiple decentralized clients without compromising data privacy, brings new challenges, also new possibilities, to DG. In the FL scenario, many existing state-of-the-art (SOTA) DG methods become ineffective, because they require the centralization of data from different domains during training. In this paper, we propose a novel domain generalization method for image recognition under federated learning through cross-client style transfer (CCST) without exchanging data samples. Our CCST method can lead to more uniform distributions of source clients, and thus make each local model learn to fit the image styles of all the clients to avoid the different model biases. Two types of style (single image style and overall domain style) with corresponding mechanisms are proposed to be chosen according to different scenarios. Our style representation is exceptionally lightweight and can hardly be used for the reconstruction of the dataset. The level of diversity is also flexible to be controlled with a hyper-parameter. Our method outperforms recent SOTA DG methods on two DG benchmarks (PACS, OfficeHome) and a large-scale medical image dataset (Camelyon17) in the FL setting. Last but not least, our method is orthogonal to many classic DG methods, achieving additive performance by combined utilization.

For agents

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

get_harvested_code_for_paper("2210.00912")
get_code_for_paper("2210.00912")
have("2210.00912")

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

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

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

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

Connect an agent — have() is free.