Papers › Model Patching: Closing the Subgroup Performance Gap with Data Augmentation

Model Patching: Closing the Subgroup Performance Gap with Data Augmentation

15 Aug 2020ICLR 2021 1arXiv:2008.06775archive 2025-07-28

Karan Goel, Albert Gu, Yixuan Li, Christopher Ré

Classifiers in machine learning are often brittle when deployed. Particularly concerning are models with inconsistent performance on specific subgroups of a class, e.g., exhibiting disparities in skin cancer classification in the presence or absence of a spurious bandage. To mitigate these performance differences, we introduce model patching, a two-stage framework for improving robustness that encourages the model to be invariant to subgroup differences, and focus on class information shared by subgroups. Model patching first models subgroup features within a class and learns semantic transformations between them, and then trains a classifier with data augmentations that deliberately manipulate subgroup features. We instantiate model patching with CAMEL, which (1) uses a CycleGAN to learn the intra-class, inter-subgroup augmentations, and (2) balances subgroup performance using a theoretically-motivated subgroup consistency regularizer, accompanied by a new robust objective. We demonstrate CAMEL's effectiveness on 3 benchmark datasets, with reductions in robust error of up to 33% relative to the best baseline. Lastly, CAMEL successfully patches a model that fails due to spurious features on a real-world skin cancer dataset.

PaperPDFConference PDFCodeCode Syntology ran

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

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2008.06775")

Code

Syntology Ran 1 of 24 code samples harvested from 1 repository linked to this paper; 23 have no recorded run. Of those that ran: 1 ran · fixture could not drive it.

By repository: official repository: 24 samples from 1 repository, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

HazyResearch/model-patching officialmentioned in papermentioned on GitHubtfApache-2.0 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

24 samples harvested; 1 ran; 0 honoured the contract we drafted; 23 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · fixture could not drive it
23unverified

Licence: 0 of the 24 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 HazyResearch/model-patching. “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. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (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 from a repository marked official are listed first. 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 four 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; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). 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.

resnet_layer HazyResearch/model-patching/augmentation/models/resnet.py official repository ran · fixture could not drive it Apache-2.0 (permissive) · c4bb2cc4f4fe1b02 · report
apply_modifier_to_dataset HazyResearch/model-patching/augmentation/datasets/utils.py official repository unverified Apache-2.0 (permissive) · 98c19e8ea2a7308a · report
build_gan_loss_fn HazyResearch/model-patching/augmentation/methods/cyclegan/utils.py official repository unverified Apache-2.0 (permissive) · ec4bd27e017d99d6 · report
compose_augmentations HazyResearch/model-patching/augmentation/augment/utils.py official repository unverified Apache-2.0 (permissive) · 2a61e37e02826736 · report
consistency_penalty HazyResearch/model-patching/augmentation/methods/robust/utils.py official repository unverified Apache-2.0 (permissive) · 030f94ea5ad5bd25 · report
create_augmentation_pipeline HazyResearch/model-patching/augmentation/augment/utils.py official repository unverified Apache-2.0 (permissive) · fbb0bdc2392bddaf · report
create_augmentation_pipelines HazyResearch/model-patching/augmentation/augment/utils.py official repository unverified Apache-2.0 (permissive) · 333a830b360f3ea9 · report
create_cutout_mask HazyResearch/model-patching/augmentation/autoaugment/augmentation_transforms.py official repository unverified Apache-2.0 (permissive) · 20601a513934db43 · report
create_loss_fn HazyResearch/model-patching/augmentation/utilities/losses.py official repository unverified Apache-2.0 (permissive) · e63a91f1aab1dcda · report
create_static_augmentation_pipeline HazyResearch/model-patching/augmentation/augment/static.py official repository unverified Apache-2.0 (permissive) · b2de24ddcad94133 · report
dataflow_len HazyResearch/model-patching/augmentation/dataflows/utils.py official repository unverified Apache-2.0 (permissive) · fd8ccd0936eb0e95 · report
dataset_len HazyResearch/model-patching/augmentation/datasets/utils.py official repository unverified Apache-2.0 (permissive) · e0fde3fe1791c1c0 · report
decay_weights HazyResearch/model-patching/augmentation/utilities/losses.py official repository unverified Apache-2.0 (permissive) · fbc6e36eb3a7dc37 · report
get_dataset_from_list_files_dataset HazyResearch/model-patching/augmentation/datasets/utils.py official repository unverified Apache-2.0 (permissive) · 7331bb97aea96bf8 · report
gradient_penalty HazyResearch/model-patching/augmentation/methods/cyclegan/utils.py official repository unverified Apache-2.0 (permissive) · 1eb22022906e8429 · report
random_flip HazyResearch/model-patching/augmentation/autoaugment/augmentation_transforms.py official repository unverified Apache-2.0 (permissive) · 6e1198a9c8c47438 · report
resnet_v1 HazyResearch/model-patching/augmentation/models/resnet.py official repository unverified Apache-2.0 (permissive) · 9e1df2116f5f12de · report
resnet_v2 HazyResearch/model-patching/augmentation/models/resnet.py official repository unverified Apache-2.0 (permissive) · 10983517a862cfee · report
rewrite_config_for_resumption HazyResearch/model-patching/augmentation/methods/robust/utils.py official repository unverified Apache-2.0 (permissive) · 04e4f19c8f00a35f · report
simple_cnn_model HazyResearch/model-patching/augmentation/models/models.py official repository unverified Apache-2.0 (permissive) · 7730ae831bb01b7e · report
simple_model HazyResearch/model-patching/augmentation/models/models.py official repository unverified Apache-2.0 (permissive) · 34007c8abd15fb91 · report
split_batch_size HazyResearch/model-patching/augmentation/augment/static.py official repository unverified Apache-2.0 (permissive) · 26f24fe261bd5178 · report
wgan_loss HazyResearch/model-patching/augmentation/methods/cyclegan/utils.py official repository unverified Apache-2.0 (permissive) · 6314c87eb9f70b97 · report
zero_pad_and_crop HazyResearch/model-patching/augmentation/autoaugment/augmentation_transforms.py official repository unverified Apache-2.0 (permissive) · c5c143c5b39b3c1a · report

Tasks

Cancer ClassificationData AugmentationSkin Cancer Classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Batch NormalizationConvolutionCycle Consistency LossGAN Least Squares LossInstance NormalizationPatchGANReLUResidual BlockResidual ConnectionSigmoid ActivationTanh Activation

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