Self-Supervised Feature Learning by Learning to Spot Artifacts

Simon Jenni, Paolo Favaro

Self-Supervised Feature Learning by Learning to Spot Artifacts

Introduction

Supervised deep learning models typically rely on massive human-labeled datasets like ImageNet. However, obtaining such labels is expensive and scales poorly. Self-supervised learning (SSL) offers an alternative by creating "pretext tasks" where labels are derived directly from unlabeled data. Common tasks include predicting image rotation or inpainting missing patches. A persistent issue with these tasks is that models often "cheat" by learning low-level statistical shortcuts (e.g., edge discontinuities) rather than high-level semantic structures. This paper proposes a novel pretext task: training a discriminator to identify subtle, global artifacts in images generated through a controlled "Damage & Repair" process.

The Damage & Repair Framework

The authors introduce an adversarial training strategy designed to force the network to learn global object representations. The architecture consists of a high-capacity autoencoder and a specialized "repair" mechanism.

The Damage & Repair architecture. The top path generates 'real' reconstructions, while the bottom path introduces feature-level damage that is partially fixed by repair blocks (Ri) before being evaluated by a discriminator (C).

The process follows these steps:

  1. Base Autoencoder: A pre-trained autoencoder reconstructs images to establish a "real" baseline with consistent visual characteristics.
  2. Damage: Entries in the bottleneck feature representation $\phi(x)$ are randomly zeroed out ("dropped"). This tampering occurs in the latent space, not at the pixel level.
  3. Repair: A set of residual blocks ($R_1$ to $R_5$) is integrated into the decoder. This "repair network" attempts to restore the missing feature information. Crucially, its capacity is intentionally limited, allowing it to fix local textures but preventing it from perfectly recovering complex global structures.
  4. Discriminator Training: A discriminator (C) is trained to distinguish between the "real" autoencoded images and the "corrupt" repaired images. To increase the difficulty, the discriminator must also predict a mask indicating the spatial locations of the original damage.

Synthetic Artifact Generation

By editing features in the bottleneck, the resulting artifacts are often "locally plausible but globally incorrect." For instance, a repaired animal might have realistic fur texture but an anatomically impossible limb placement. This forces the discriminator to look beyond local pixels and understand the overall composition of objects.

Visualizing the damage and repair process. (a) Original image with mask, (b) damaged version, and (c-e) various stages of reconstruction and repair showing the emergence of subtle artifacts.

Key Insights

  • Feature-Level Tampering: Moving the "damage" from pixels to features prevents the model from relying on simple boundary artifacts.
  • Consistency in "Real" Data: Using the same decoder for both real and corrupt images ensures the discriminator cannot simply learn the "fingerprint" of the generator.
  • Mask Prediction: Forcing the discriminator to localize damage acts as a regularizer, ensuring it inspects the entire image for inconsistencies rather than relying on a single global cue.
  • Distributed Repair: Spreading repair layers throughout the decoder allows the network to address artifacts across multiple scales of abstraction.

Experimental Results

The proposed method demonstrated significant improvements over contemporary SSL benchmarks using an AlexNet-based architecture:

  • STL-10 Classification: Reached 80.1% accuracy, significantly outperforming Jigsaw puzzles (74.3%) and Context Encoders.
  • Pascal VOC Detection: Achieved 52.5% mAP, proving that the learned features transfer effectively to complex downstream tasks.
  • Feature Hierarchy: Evaluation on the Places dataset showed that intermediate layers (conv2 through conv5) consistently outperformed other SSL methods, indicating a robust learning of visual hierarchies.

Conclusion

This "artifact spotting" approach provides a powerful signal for self-supervised learning by creating a "digital forensic" challenge. While the current implementation has architectural constraints related to receptive fields and requires a two-stage training process, it demonstrates that learning to detect global structural inconsistencies is a highly effective way to build semantic representations without human labels.

Summary updated

BibTeX
@inproceedings{jenni2018self,
  author = {Simon Jenni and Paolo Favaro},
  title = {{Self-Supervised Feature Learning by Learning to Spot Artifacts}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  doi = {10.1109/cvpr.2018.00289},
}
Figure