{"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/panda-unsupervised-learning-of-parts-and","title":"PandA: Unsupervised Learning of Parts and Appearances in the Feature Maps of GANs","arxiv_id":"2206.00048","date":"2022-05-31","proceeding":null,"authors":["James Oldfield","Christos Tzelepis","Yannis Panagakis","Mihalis A. Nicolaou","Ioannis Patras"],"abstract":"Recent advances in the understanding of Generative Adversarial Networks (GANs) have led to remarkable progress in visual editing and synthesis tasks, capitalizing on the rich semantics that are embedded in the latent spaces of pre-trained GANs. However, existing methods are often tailored to specific GAN architectures and are limited to either discovering global semantic directions that do not facilitate localized control, or require some form of supervision through manually provided regions or segmentation masks. In this light, we present an architecture-agnostic approach that jointly discovers factors representing spatial parts and their appearances in an entirely unsupervised fashion. These factors are obtained by applying a semi-nonnegative tensor factorization on the feature maps, which in turn enables context-aware local image editing with pixel-level control. In addition, we show that the discovered appearance factors correspond to saliency maps that localize concepts of interest, without using any labels. Experiments on a wide range of GAN architectures and datasets show that, in comparison to the state of the art, our method is far more efficient in terms of training time and, most importantly, provides much more accurate localized control. Our code is available at: https://github.com/james-oldfield/PandA.","url_abs":"https://arxiv.org/abs/2206.00048v2","url_pdf":"https://arxiv.org/pdf/2206.00048v2.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":"panda-unsupervised-learning-of-parts-and","repo_url":"https://github.com/james-oldfield/panda","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2206.00048","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2206.00048"}},"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":"deterministic:regex_extraction","url":"https://github.com/james-oldfield/PandA","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/james-oldfield/panda","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":1,"ran_draft_wrong":4,"unverified":9},"by_repo_kind":{"official":{"samples":14,"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":"260d293a46551cc2","entry":"construct_heatmap","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/stylegan3/avg_spectra.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/stylegan3/avg_spectra.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"260d293a46551cc2"}},{"code_sha256_prefix":"abed13633552f3d0","entry":"sn_embedding","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/biggan/model.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/biggan/model.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":"abed13633552f3d0"}},{"code_sha256_prefix":"b76bf7615e32c07d","entry":"snconv2d","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/biggan/model.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/biggan/model.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":"b76bf7615e32c07d"}},{"code_sha256_prefix":"de3577618251b913","entry":"snlinear","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/biggan/model.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/biggan/model.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":"de3577618251b913"}},{"code_sha256_prefix":"5eff22fa0a651276","entry":"url_to_filename","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/biggan/file_utils.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/biggan/file_utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5eff22fa0a651276"}},{"code_sha256_prefix":"ce9a06f7562fa6ed","entry":"build_tf_to_pytorch_map","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/biggan/convert_tf_to_pytorch.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/biggan/convert_tf_to_pytorch.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":"ce9a06f7562fa6ed"}},{"code_sha256_prefix":"1f71e3eff559cc72","entry":"cached_path","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/biggan/file_utils.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/biggan/file_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":"1f71e3eff559cc72"}},{"code_sha256_prefix":"a57f16b653411188","entry":"convert_to_images","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/biggan/utils.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/biggan/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":"a57f16b653411188"}},{"code_sha256_prefix":"a3d3c599a0b72c6e","entry":"extract_batch_norm_stats","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/biggan/convert_tf_to_pytorch.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/biggan/convert_tf_to_pytorch.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":"a3d3c599a0b72c6e"}},{"code_sha256_prefix":"c5ba2abfbf6a9dfa","entry":"filename_to_url","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/biggan/file_utils.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/biggan/file_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":"c5ba2abfbf6a9dfa"}},{"code_sha256_prefix":"afde54833fdbaac2","entry":"load_tf_weights_in_biggan","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/biggan/convert_tf_to_pytorch.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/biggan/convert_tf_to_pytorch.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":"afde54833fdbaac2"}},{"code_sha256_prefix":"de4a9b04038c13d9","entry":"mapRange","repo":"james-oldfield/PandA","repo_kind":"official","path":"utils.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/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":"de4a9b04038c13d9"}},{"code_sha256_prefix":"2baf0e56dad23fd6","entry":"one_hot_from_int","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/biggan/utils.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/biggan/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":"2baf0e56dad23fd6"}},{"code_sha256_prefix":"02045c1b6525805b","entry":"truncated_noise_sample","repo":"james-oldfield/PandA","repo_kind":"official","path":"networks/biggan/utils.py","file_url":"https://github.com/james-oldfield/PandA/blob/HEAD/networks/biggan/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":"02045c1b6525805b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}