{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/prime-a-few-primitives-can-boost-robustness","title":"PRIME: A few primitives can boost robustness to common corruptions","arxiv_id":"2112.13547","date":"2021-12-27","proceeding":null,"authors":["Apostolos Modas","Rahul Rade","Guillermo Ortiz-Jiménez","Seyed-Mohsen Moosavi-Dezfooli","Pascal Frossard"],"abstract":"Despite their impressive performance on image classification tasks, deep networks have a hard time generalizing to unforeseen corruptions of their data. To fix this vulnerability, prior works have built complex data augmentation strategies, combining multiple methods to enrich the training data. However, introducing intricate design choices or heuristics makes it hard to understand which elements of these methods are indeed crucial for improving robustness. In this work, we take a step back and follow a principled approach to achieve robustness to common corruptions. We propose PRIME, a general data augmentation scheme that relies on simple yet rich families of max-entropy image transformations. PRIME outperforms the prior art in terms of corruption robustness, while its simplicity and plug-and-play nature enable combination with other methods to further boost their robustness. We analyze PRIME to shed light on the importance of the mixing strategy on synthesizing corrupted images, and to reveal the robustness-accuracy trade-offs arising in the context of common corruptions. Finally, we show that the computational efficiency of our method allows it to be easily used in both on-line and off-line data augmentation schemes.","url_abs":"https://arxiv.org/abs/2112.13547v2","url_pdf":"https://arxiv.org/pdf/2112.13547v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"prime-a-few-primitives-can-boost-robustness","repo_url":"https://github.com/amodas/PRIME-augmentations","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"computational-efficiency","task_name":"Computational Efficiency"},{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"domain-generalization","task_name":"Domain Generalization"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/domain-generalization-on-imagenet-c","task":"Domain Generalization","dataset":"ImageNet-C","model":"PRIME + DeepAugment (ResNet-50)","rank_in_archive_order":29,"of":47,"metrics":{"Top 1 Accuracy":"59.9","mean Corruption Error (mCE)":"51.3"},"uses_additional_data":false},{"leaderboard":"/sota/domain-generalization-on-imagenet-c","task":"Domain Generalization","dataset":"ImageNet-C","model":"PRIME with JSD (ResNet-50)","rank_in_archive_order":32,"of":47,"metrics":{"Top 1 Accuracy":"56.4","mean Corruption Error (mCE)":"55.5"},"uses_additional_data":false},{"leaderboard":"/sota/domain-generalization-on-imagenet-c","task":"Domain Generalization","dataset":"ImageNet-C","model":"PRIME (ResNet-50)","rank_in_archive_order":34,"of":47,"metrics":{"Top 1 Accuracy":"55.0","mean Corruption Error (mCE)":"57.5"},"uses_additional_data":false},{"leaderboard":"/sota/domain-generalization-on-imagenet-r","task":"Domain Generalization","dataset":"ImageNet-R","model":"PRIME with JSD (ResNet-50)","rank_in_archive_order":30,"of":39,"metrics":{"Top-1 Error Rate":"53.7"},"uses_additional_data":false},{"leaderboard":"/sota/domain-generalization-on-imagenet-r","task":"Domain Generalization","dataset":"ImageNet-R","model":"PRIME (ResNet-50)","rank_in_archive_order":32,"of":39,"metrics":{"Top-1 Error Rate":"57.1"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2112.13547","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2112.13547"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/amodas/PRIME-augmentations","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_honours":3,"ran_violates":1,"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":8,"ran":5,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"340cb3797f4ed00a","entry":"float_parameter","repo":"amodas/PRIME-augmentations","repo_kind":"official","path":"utils/augmix.py","file_url":"https://github.com/amodas/PRIME-augmentations/blob/HEAD/utils/augmix.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"340cb3797f4ed00a"}},{"code_sha256_prefix":"8b20dcbdf9e59b56","entry":"int_parameter","repo":"amodas/PRIME-augmentations","repo_kind":"official","path":"utils/augmix.py","file_url":"https://github.com/amodas/PRIME-augmentations/blob/HEAD/utils/augmix.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8b20dcbdf9e59b56"}},{"code_sha256_prefix":"5cc8d4764ac07a35","entry":"sample_level","repo":"amodas/PRIME-augmentations","repo_kind":"official","path":"utils/augmix.py","file_url":"https://github.com/amodas/PRIME-augmentations/blob/HEAD/utils/augmix.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5cc8d4764ac07a35"}},{"code_sha256_prefix":"21e1843fa11d415e","entry":"scalar_field","repo":"amodas/PRIME-augmentations","repo_kind":"official","path":"utils/diffeomorphism.py","file_url":"https://github.com/amodas/PRIME-augmentations/blob/HEAD/utils/diffeomorphism.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"21e1843fa11d415e"}},{"code_sha256_prefix":"e57e011fe9cb8615","entry":"scalar_field_modes","repo":"amodas/PRIME-augmentations","repo_kind":"official","path":"utils/diffeomorphism.py","file_url":"https://github.com/amodas/PRIME-augmentations/blob/HEAD/utils/diffeomorphism.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e57e011fe9cb8615"}},{"code_sha256_prefix":"bf44bd1b11566a72","entry":"deform","repo":"amodas/PRIME-augmentations","repo_kind":"official","path":"utils/diffeomorphism.py","file_url":"https://github.com/amodas/PRIME-augmentations/blob/HEAD/utils/diffeomorphism.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bf44bd1b11566a72"}},{"code_sha256_prefix":"dd07d1fcc0435da2","entry":"get_model","repo":"amodas/PRIME-augmentations","repo_kind":"official","path":"models/utils.py","file_url":"https://github.com/amodas/PRIME-augmentations/blob/HEAD/models/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dd07d1fcc0435da2"}},{"code_sha256_prefix":"13248e8cb27ab862","entry":"register_model","repo":"amodas/PRIME-augmentations","repo_kind":"official","path":"models/utils.py","file_url":"https://github.com/amodas/PRIME-augmentations/blob/HEAD/models/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"13248e8cb27ab862"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}