Papers › Cross Contrasting Feature Perturbation for Domain Generalization

Cross Contrasting Feature Perturbation for Domain Generalization

24 Jul 2023ICCV 2023 1arXiv:2307.12502archive 2025-07-28

Chenming Li, Daoan Zhang, Wenjian Huang, JianGuo Zhang

Domain generalization (DG) aims to learn a robust model from source domains that generalize well on unseen target domains. Recent studies focus on generating novel domain samples or features to diversify distributions complementary to source domains. Yet, these approaches can hardly deal with the restriction that the samples synthesized from various domains can cause semantic distortion. In this paper, we propose an online one-stage Cross Contrasting Feature Perturbation (CCFP) framework to simulate domain shift by generating perturbed features in the latent space while regularizing the model prediction against domain shift. Different from the previous fixed synthesizing strategy, we design modules with learnable feature perturbations and semantic consistency constraints. In contrast to prior work, our method does not use any generative-based models or domain labels. We conduct extensive experiments on a standard DomainBed benchmark with a strict evaluation protocol for a fair comparison. Comprehensive experiments show that our method outperforms the previous state-of-the-art, and quantitative analyses illustrate that our approach can alleviate the domain shift problem in out-of-distribution (OOD) scenarios.

PaperPDFConference PDFCodeCode Syntology ranMethod as code

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 25 code samples harvested from 2 repositories linked to this paper: 17 ran (of which 6 constructed an object rather than computing a result; 9 with no instrument failure: 3 honoured, 0 violated, 6 with no contract checked; 8 where Syntology's instrument failed) · 8 unverified. Where Syntology's instrument failed: 5 where our contract draft was wrong; 3 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 25 samples from 2 repositories, 17 ran (9 with no instrument failure; 8 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 1 of the 17 samples that ran has no recorded date.

hackmebroo/ccfp officialmentioned in papermentioned on GitHubpytorchSyntology: 14 samples, 11 ran (8 instrument-failed) · 3 unverified report
hackmebroo/cross-contrasting-feature-perturbation-for-domain-generalization officialmentioned in papermentioned on GitHubpytorchSyntology: 11 samples, 6 ran (0 instrument-failed) · 5 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

25 samples harvested: 17 ran (of which 6 constructed an object rather than computing a result; 9 with no instrument failure: 3 honoured, 0 violated, 6 with no contract checked; 8 where Syntology's instrument failed) · 8 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

3ran · honoured contract
5ran · our draft was wrong
3ran; the contract check could not run
6ran
8unverified

Licence: 25 of the 25 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. For 5 samples that ran, the graph records a signature this page does not show: for a class the fixture built without calling, the harness called the object with inputs it made up itself, so the recorded signature is the harness's probe, not the fixture's arguments. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

hackmebroo/ccfp official repository 14 samples, 11 ran (8 instrument-failed) · 3 unverified
adaptive_instance_normalization in 37 papers
census: 5 implementations from 7 papers, 2 distinct outputs on one shared input this sample: bucket 1 of 1, arg 1: rank 4, kind float, dtype float32 · arg 2: rank 4, kind float, dtype float32
networks.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted no licence file found · pointer only · 7d65990d684d50e8 · report fixture: signature content_feat:Tensor/4/float, style_feat:Tensor/4/float, eps:float/0/float · returned Tensor · level recorded 2026-09-22
calc_mean_std in 64 papers networks.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted no licence file found · pointer only · 7dc5cc1a5cc56434 · report fixture: signature feat:Tensor/4/float, eps:float/0/float · returned tuple · level recorded 2026-09-22
conv3x3 in 1,376 papers resnet_mixstyle.py ran · our draft was wrong no licence file found · pointer only · fac5364e2f53c6db · report fixture: signature in_planes:int/0/int, out_planes:int/0/int, stride:int/0/int · returned Conv2d · level recorded, date not recorded
distance in 53 papers
census: 8 implementations from 8 papers, 6 distinct outputs across 3 buckets, one shared input per bucket
lib/misc.py ran · honoured contract no licence file found · pointer only · fbb8c05a0a7696ec · report fixture: signature h1:callable/0/?, h2:callable/0/? · returned Tensor · level recorded 2026-09-22
format_mean collect_results.py ran; the contract check could not run (RAISES) · metamorphic tier: deterministic fingerprinted no licence file found · pointer only · d6d6cc53be32629d · report fixture: signature data:list/1/float, latex:bool/0/bool · returned tuple · level recorded 2026-09-22
get_test_records in 23 papers model_selection.py ran · our draft was wrong no licence file found · pointer only · 53fac8d8d949e72b · report fixture: signature records:MockRecords/0/? · returned MockRecords · level recorded 2026-09-22
hashable in 21 papers lib/query.py ran · honoured contract fingerprinted no licence file found · pointer only · 71a3a61ceed99bf3 · report fixture: signature obj:int/0/int · returned int · level recorded 2026-09-24
l2_between_dicts in 12 papers lib/misc.py ran · honoured contract no licence file found · pointer only · 1fdaff04251a0d51 · report fixture: signature dict_1:dict/0/?, dict_2:dict/0/? · returned Tensor · level recorded 2026-09-24
make_selector_fn in 21 papers lib/query.py ran · our draft was wrong no licence file found · pointer only · 2f8af5779e1edcb6 · report fixture: signature selector:str/0/str · returned function · level recorded 2026-09-24
proj in 38 papers lib/misc.py ran · our draft was wrong no licence file found · pointer only · 17202e0de9779f70 · report fixture: signature delta:float/0/float, adv_h:callable/0/?, h:callable/0/? · returned SimpleClassifier · level recorded 2026-09-22
remove_batch_norm_from_resnet in 24 papers networks.py ran · our draft was wrong no licence file found · pointer only · 196cab71d7129d62 · report fixture: signature model:callable/0/? · returned MinimalResNet · level recorded 2026-09-24
get_algorithm_class in 42 papers algorithms.py unverified no licence file found · pointer only · b0bc80b1655a6802 · report
get_dataset_class in 36 papers datasets.py unverified no licence file found · pointer only · d0ea85d74c20dea9 · report
num_environments in 23 papers datasets.py unverified no licence file found · pointer only · 73f32252eedba6a4 · report
hackmebroo/cross-contrasting-feature-perturbation-for-domain-generalization official repository 11 samples, 6 ran (0 instrument-failed) · 5 unverified
Algorithm in 26 papers algorithms.py ran no licence file found · pointer only · d4ab1855fefe42b4 · report fixture: returned Algorithm · level recorded 2026-09-22
DistributionUncertainty algorithms.py ran fingerprinted no licence file found · pointer only · 81427628d9da40b5 · report fixture: returned DistributionUncertainty · level recorded 2026-09-22
LDP algorithms.py ran no licence file found · pointer only · d797b51129873a03 · report fixture: returned LDP · level recorded 2026-09-22
MNIST_CNN in 5 papers algorithms.py ran no licence file found · pointer only · f96170b86db20ebd · report fixture: returned MNIST_CNN · level recorded 2026-09-22
MNIST_CNN_tea algorithms.py ran fingerprinted no licence file found · pointer only · f9d8f82d3edc5026 · report fixture: returned MNIST_CNN_tea · level recorded 2026-09-22
PermuteAdaptiveInstanceNorm2d algorithms.py ran fingerprinted no licence file found · pointer only · 04b8476374907676 · report fixture: returned PermuteAdaptiveInstanceNorm2d · level recorded 2026-09-22
CCFP algorithms.py unverified no licence file found · pointer only · f1069937af8d8db4 · report
ERM in 13 papers algorithms.py unverified no licence file found · pointer only · 50d94f70eea6617f · report
Featurizer in 11 papers algorithms.py unverified no licence file found · pointer only · 9e043048978eb855 · report
ResNet in 139 papers algorithms.py unverified no licence file found · pointer only · 05738dcd81fa595f · report
ResNet_tea algorithms.py unverified no licence file found · pointer only · 675b4e8d991b4e8d · report

Method as code Syntology

What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it.

1 assembly on this paper: 1 harvested, 0 generated.

harvested Assembly for Cross Contrasting Feature Perturbation (CCFP) (graph method: Cross Contrasting Feature Perturbation (CCFP)). 16 bricks; individually on a fixture: 11 ran (of which 8 constructed an object rather than computing a result; 8 with no instrument failure: 0 honoured, 0 violated, 8 with no contract checked; 3 where Syntology's instrument failed) · 5 unverified. The assembly has not been run end-to-end.

  1. CCFP entry · level 0 · unverified · f1069937af8d8db4
  2. Classifier helper · level 1 · ran · our draft was wrong · ce7990d7ad5821ff
  3. ERM helper · level 0 · unverified · 50d94f70eea6617f
  4. Featurizer helper · level 0 · unverified · 9e043048978eb855
  5. Algorithm helper · level 1 · ran · d4ab1855fefe42b4
  6. MLP helper · level 1 · ran · bacc92fd6ae22e2c
  7. MNIST_CNN helper · level 1 · ran · f96170b86db20ebd
  8. MNIST_CNN_tea helper · level 1 · ran · f9d8f82d3edc5026
  9. ResNet helper · level 0 · unverified · 05738dcd81fa595f
  10. ResNet_tea helper · level 0 · unverified · 675b4e8d991b4e8d
  11. LDP helper · level 1 · ran · d797b51129873a03
  12. DistributionUncertainty helper · level 1 · ran · 81427628d9da40b5
  13. Identity helper · level 1 · ran · c090fe2ca8acedb3
  14. PermuteAdaptiveInstanceNorm2d helper · level 1 · ran · 04b8476374907676
  15. adaptive_instance_normalization helper · level 1 · ran; the contract check could not run (RAISES) · 7d65990d684d50e8
  16. calc_mean_std helper · level 1 · ran; the contract check could not run (RAISES) · 7dc5cc1a5cc56434

Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2307.12502") returns these assemblies with each brick's role and wiring (how to connect).

Tasks

Domain Generalization

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Focus

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections