{"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/context-encoders-feature-learning-by","title":"Context Encoders: Feature Learning by Inpainting","arxiv_id":"1604.07379","date":"2016-04-25","proceeding":"CVPR 2016 6","authors":["Deepak Pathak","Philipp Krahenbuhl","Jeff Donahue","Trevor Darrell","Alexei A. Efros"],"abstract":"We present an unsupervised visual feature learning algorithm driven by\ncontext-based pixel prediction. By analogy with auto-encoders, we propose\nContext Encoders -- a convolutional neural network trained to generate the\ncontents of an arbitrary image region conditioned on its surroundings. In order\nto succeed at this task, context encoders need to both understand the content\nof the entire image, as well as produce a plausible hypothesis for the missing\npart(s). When training context encoders, we have experimented with both a\nstandard pixel-wise reconstruction loss, as well as a reconstruction plus an\nadversarial loss. The latter produces much sharper results because it can\nbetter handle multiple modes in the output. We found that a context encoder\nlearns a representation that captures not just appearance but also the\nsemantics of visual structures. We quantitatively demonstrate the effectiveness\nof our learned features for CNN pre-training on classification, detection, and\nsegmentation tasks. Furthermore, context encoders can be used for semantic\ninpainting tasks, either stand-alone or as initialization for non-parametric\nmethods.","url_abs":"http://arxiv.org/abs/1604.07379v2","url_pdf":"http://arxiv.org/pdf/1604.07379v2.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":"context-encoders-feature-learning-by","repo_url":"https://github.com/pathak22/context-encoder","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"tf","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"context-encoders-feature-learning-by","repo_url":"https://github.com/Nexkia/Context_Encoder","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"context-encoders-feature-learning-by","repo_url":"https://github.com/Nirvan101/Image-Restoration-deep-learning","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"context-encoders-feature-learning-by","repo_url":"https://github.com/YeongHyeon/Context-Encoder","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"context-encoders-feature-learning-by","repo_url":"https://github.com/akshay-gupta123/Context-Encoder","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"context-encoders-feature-learning-by","repo_url":"https://github.com/basilevh/image-outpainting","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"context-encoders-feature-learning-by","repo_url":"https://github.com/chhankyao/3D_defect_detection","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"context-encoders-feature-learning-by","repo_url":"https://github.com/eriklindernoren/Keras-GAN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"context-encoders-feature-learning-by","repo_url":"https://github.com/eriklindernoren/PyTorch-GAN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"context-encoders-feature-learning-by","repo_url":"https://github.com/pdway53/GAN_Food_image_impair","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"context-encoders-feature-learning-by","repo_url":"https://github.com/shekkizh/TensorflowProjects","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[{"method_slug":"pixel-prediction","method_name":"Inpainting"}],"datasets_introduced":[],"methods_introduced":[{"slug":"pixel-prediction","name":"Inpainting","full_name":"Inpainting"}],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1604.07379","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1604.07379"}},"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/YeongHyeon/Context-Encoder","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pdway53/GAN_Food_image_impair","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/akshay-gupta123/Context-Encoder","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Nirvan101/Image-Restoration-deep-learning","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/chhankyao/3D_defect_detection","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/eriklindernoren/Keras-GAN","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/eriklindernoren/PyTorch-GAN","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/shekkizh/TensorflowProjects","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/basilevh/image-outpainting","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pathak22/context-encoder","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Nexkia/Context_Encoder","reach":{"status":"ok"}}],"summary":{"ran":3,"ran_draft_wrong":1,"ran_fixture":1,"unverified":5},"by_repo_kind":{"listed":{"samples":10,"ran":5,"repositories":6}},"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":3,"samples":[{"code_sha256_prefix":"dc84652848da9f96","entry":"CEGenerator","repo":"basilevh/image-outpainting","repo_kind":"listed","path":"outpainting.py","file_url":"https://github.com/basilevh/image-outpainting/blob/HEAD/outpainting.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"dc84652848da9f96"}},{"code_sha256_prefix":"464c0d93345430d1","entry":"Generator","repo":"eriklindernoren/PyTorch-GAN","repo_kind":"listed","path":"implementations/context_encoder/models.py","file_url":"https://github.com/eriklindernoren/PyTorch-GAN/blob/HEAD/implementations/context_encoder/models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"464c0d93345430d1"}},{"code_sha256_prefix":"b43de8f01dba9ebe","entry":"_netG","repo":"chhankyao/3D_defect_detection","repo_kind":"listed","path":"context_encoder/model.py","file_url":"https://github.com/chhankyao/3D_defect_detection/blob/HEAD/context_encoder/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b43de8f01dba9ebe"}},{"code_sha256_prefix":"5d78e1f7a1afb766","entry":"bias_variable","repo":"shekkizh/TensorflowProjects","repo_kind":"listed","path":"MNIST/Uncertainty_modelling.py","file_url":"https://github.com/shekkizh/TensorflowProjects/blob/HEAD/MNIST/Uncertainty_modelling.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5d78e1f7a1afb766"}},{"code_sha256_prefix":"312e507a19709c06","entry":"define_generator","repo":"akshay-gupta123/Context-Encoder","repo_kind":"listed","path":"model.py","file_url":"https://github.com/akshay-gupta123/Context-Encoder/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"312e507a19709c06"}},{"code_sha256_prefix":"333728b5782d5963","entry":"Context_Encoder","repo":"YeongHyeon/Context-Encoder","repo_kind":"listed","path":"source/neuralnet.py","file_url":"https://github.com/YeongHyeon/Context-Encoder/blob/HEAD/source/neuralnet.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"333728b5782d5963"}},{"code_sha256_prefix":"eca225d53673a1ea","entry":"conv2d_basic","repo":"shekkizh/TensorflowProjects","repo_kind":"listed","path":"MNIST/Uncertainty_modelling.py","file_url":"https://github.com/shekkizh/TensorflowProjects/blob/HEAD/MNIST/Uncertainty_modelling.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"eca225d53673a1ea"}},{"code_sha256_prefix":"cb07eb141f5648be","entry":"weight_variable","repo":"shekkizh/TensorflowProjects","repo_kind":"listed","path":"MNIST/Uncertainty_modelling.py","file_url":"https://github.com/shekkizh/TensorflowProjects/blob/HEAD/MNIST/Uncertainty_modelling.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cb07eb141f5648be"}},{"code_sha256_prefix":"4fca58134a4f0785","entry":"weight_variable_xavier_initialized","repo":"shekkizh/TensorflowProjects","repo_kind":"listed","path":"TensorflowUtils.py","file_url":"https://github.com/shekkizh/TensorflowProjects/blob/HEAD/TensorflowUtils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4fca58134a4f0785"}},{"code_sha256_prefix":"5645c84de7678d1e","entry":"xavier_init","repo":"shekkizh/TensorflowProjects","repo_kind":"listed","path":"TensorflowUtils.py","file_url":"https://github.com/shekkizh/TensorflowProjects/blob/HEAD/TensorflowUtils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5645c84de7678d1e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}