Papers › Context Encoders: Feature Learning by Inpainting

Context Encoders: Feature Learning by Inpainting

25 Apr 2016CVPR 2016 6arXiv:1604.07379archive 2025-07-28

Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, Alexei A. Efros

We present an unsupervised visual feature learning algorithm driven by context-based pixel prediction. By analogy with auto-encoders, we propose Context Encoders -- a convolutional neural network trained to generate the contents of an arbitrary image region conditioned on its surroundings. In order to succeed at this task, context encoders need to both understand the content of the entire image, as well as produce a plausible hypothesis for the missing part(s). When training context encoders, we have experimented with both a standard pixel-wise reconstruction loss, as well as a reconstruction plus an adversarial loss. The latter produces much sharper results because it can better handle multiple modes in the output. We found that a context encoder learns a representation that captures not just appearance but also the semantics of visual structures. We quantitatively demonstrate the effectiveness of our learned features for CNN pre-training on classification, detection, and segmentation tasks. Furthermore, context encoders can be used for semantic inpainting tasks, either stand-alone or as initialization for non-parametric methods.

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="1604.07379")

Code

Syntology Ran 5 of 10 code samples harvested from 6 repositories linked to this paper; 5 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 1 ran · fixture could not drive it; 3 ran with no contract checked.

By repository: community (archive-listed): 10 samples from 6 repositories, 5 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

pathak22/context-encoder officialtfNOASSERTION report
Nexkia/Context_Encoder mentioned on GitHub report
YeongHyeon/Context-Encoder mentioned on GitHubtf report
akshay-gupta123/Context-Encoder mentioned on GitHubtf report
basilevh/image-outpainting mentioned on GitHubpytorch report
chhankyao/3D_defect_detection mentioned on GitHubpytorch report
eriklindernoren/Keras-GAN mentioned on GitHubpytorch report
eriklindernoren/PyTorch-GAN mentioned on GitHubpytorch report
pdway53/GAN_Food_image_impair mentioned on GitHubpytorch report
shekkizh/TensorflowProjects mentioned on GitHubtfMIT 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

10 samples harvested; 5 ran; 0 honoured the contract we drafted; 5 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 · our draft was wrong
1ran · fixture could not drive it
3ran
5unverified

Licence: 3 of the 10 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 6 repositories linked to this paper, official or community; each sample names its own and says which. “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.

CEGenerator basilevh/image-outpainting/outpainting.py community (archive-listed) ran GPL-3.0 (copyleft) · pointer only · dc84652848da9f96 · report
Generator eriklindernoren/PyTorch-GAN/implementations/context_encoder/models.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 464c0d93345430d1 · report
_netG chhankyao/3D_defect_detection/context_encoder/model.py community (archive-listed) ran no licence file found · pointer only · b43de8f01dba9ebe · report
bias_variable shekkizh/TensorflowProjects/MNIST/Uncertainty_modelling.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 5d78e1f7a1afb766 · report
define_generator akshay-gupta123/Context-Encoder/model.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · 312e507a19709c06 · report
Context_Encoder YeongHyeon/Context-Encoder/source/neuralnet.py community (archive-listed) unverified MIT (permissive) · 333728b5782d5963 · report
conv2d_basic shekkizh/TensorflowProjects/MNIST/Uncertainty_modelling.py community (archive-listed) unverified MIT (permissive) · eca225d53673a1ea · report
weight_variable shekkizh/TensorflowProjects/MNIST/Uncertainty_modelling.py community (archive-listed) unverified MIT (permissive) · cb07eb141f5648be · report
weight_variable_xavier_initialized shekkizh/TensorflowProjects/TensorflowUtils.py community (archive-listed) unverified MIT (permissive) · 4fca58134a4f0785 · report
xavier_init shekkizh/TensorflowProjects/TensorflowUtils.py community (archive-listed) unverified MIT (permissive) · 5645c84de7678d1e · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Introduced by this paper: Inpainting

Inpainting

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