Semantic Relation Preserving Knowledge Distillation for Image-to-Image Translation

Zeqi Li, Ruowei Jiang, Parham Aarabi

Abstract

Generative Adversarial Networks (GANs) for Image-to-Image (I2I) translation are often too computationally heavy for deployment on edge devices. This paper presents a novel knowledge distillation (KD) approach that focuses on preserving pixel-wise semantic relationships rather than just matching raw pixel values. By enforcing a student model to mimic the internal semantic structure of a larger teacher model, the proposed method achieves up to 94% model size reduction while maintaining high visual fidelity and occasionally outperforming the teacher in semantic accuracy.

Introduction

I2I translation models like CycleGAN and Pix2Pix have enabled impressive transformations, such as converting horses to zebras or summer scenes to winter. However, their high parameter count and computational cost hinder real-time deployment on mobile platforms. Traditional Knowledge Distillation (KD) techniques, successful in classification, often struggle with GANs because they lack class probabilities. Vanilla KD, which matches output pixels, frequently results in blurry images or artifacts as it fails to capture the underlying structural logic of the scene.

Methodology: Semantic Relation Preserving KD

The core innovation is the Semantic Relation Preserving (SP) Loss. Unlike standard KD that looks at global image features, this method focuses on how different parts of an image relate to each other semantically.

Conceptual comparison between Semantic Relation Preserving KD and Traditional KD.

Semantic Relation Activation Matrix

A well-trained teacher model inherently understands scene semantics—for instance, identifying which pixels constitute a horse versus the background. The authors capture this by calculating a similarity matrix from feature maps. By taking the outer product of feature vectors at different spatial locations, they create a matrix representing the pairwise similarity of all pixels.

The Distillation Framework

The student model is trained to minimize the difference between its own pixel-relationship matrix and that of the teacher. This approach is architecture-agnostic; because the relationship matrix dimensions depend on spatial resolution ($H \times W$) rather than channel depth ($C$), a slim student can directly learn from a wide teacher without extra adapter layers.

Detailed architecture of the Semantic Preserving Distillation framework.

The total objective function combines adversarial loss, cycle consistency (or reconstruction) loss, vanilla pixel-wise KD, and the proposed SP loss.

Experimental Results

The method was validated across several benchmarks, including Horse $\leftrightarrow$ Zebra, Summer $\leftrightarrow$ Winter, and Cityscapes.

  • Compression Efficiency: A ResNet9 model was compressed from 44MB to 2.8MB (94% reduction) with a 93% reduction in FLOPs.
  • Visual Fidelity: On the Horse-to-Zebra task, the SP-distilled student achieved an FID of 86.31, significantly better than Vanilla KD (106.10) and nearly matching the teacher (84.01).
  • Semantic Accuracy: In the Cityscapes (Labels $\to$ Photos) task, the student model achieved a Mean Pixel Accuracy of 0.704, notably higher than the teacher's 0.592, suggesting that distillation can act as a regularizer that improves focus on key semantic details.

Conclusion

Semantic Relation Preserving KD offers a powerful way to compress generative models without sacrificing the structural integrity of the translated images. By shifting the focus from "what the pixels are" to "how the pixels relate," the student model learns the essential logic of the transformation. While highly effective, the authors note that the benefits are most pronounced on complex datasets where the teacher has a clear semantic advantage to share. Future work may extend this principle to video and text-to-image generation.

Summary updated

BibTeX
@inproceedings{li2020semantic,
  author = {Zeqi Li and Ruowei Jiang and Parham Aarabi},
  title = {{Semantic Relation Preserving Knowledge Distillation for Image-to-Image Translation}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58574-7\_39},
}
Figure