Skip to main content
QUICK REVIEW

[Paper Review] On Buggy Resizing Libraries and Surprising Subtleties in FID Calculation

Gaurav Parmar, Richard Zhang|arXiv (Cornell University)|Apr 22, 2021
Generative Adversarial Networks and Image SynthesisComputer Science52 references38 citations
TL;DR

This paper investigates how inconsistent implementations of image resizing in popular deep learning libraries significantly affect Fréchet Inception Distance (FID) scores, revealing that choices in resizing libraries, interpolation kernels, and image encoding lead to substantial score variations. The authors identify key pitfalls, provide precise recommendations, and release an optimized, reproducible FID implementation to ensure accurate and consistent evaluation of generative models.

ABSTRACT

We investigate the sensitivity of the Fr\'echet Inception Distance (FID) score to inconsistent and often incorrect implementations across different image processing libraries. FID score is widely used to evaluate generative models, but each FID implementation uses a different low-level image processing process. Image resizing functions in commonly-used deep learning libraries often introduce aliasing artifacts. We observe that numerous subtle choices need to be made for FID calculation and a lack of consistencies in these choices can lead to vastly different FID scores. In particular, we show that the following choices are significant: (1) selecting what image resizing library to use, (2) choosing what interpolation kernel to use, (3) what encoding to use when representing images. We additionally outline numerous common pitfalls that should be avoided and provide recommendations for computing the FID score accurately. We provide an easy-to-use optimized implementation of our proposed recommendations in the accompanying code.

Motivation & Objective

  • To investigate the sensitivity of FID scores to low-level image processing inconsistencies across deep learning libraries.
  • To identify how varying image resizing implementations—especially aliasing artifacts—impact FID score reliability.
  • To highlight the significance of choices such as resizing library, interpolation kernel, and image encoding in FID computation.
  • To expose common implementation pitfalls that lead to misleading or inconsistent FID scores in generative model evaluation.
  • To provide a standardized, accurate, and optimized FID implementation to ensure reproducibility and fairness in model comparison.

Proposed method

  • Systematically evaluate FID scores using multiple image resizing libraries (e.g., OpenCV, PIL, Torchvision) with identical model and dataset inputs.
  • Compare FID scores across different interpolation kernels (e.g., bilinear, bicubic, Lanczos) under controlled conditions.
  • Assess the impact of image encoding formats (e.g., RGB vs. RGBA, bit depth) on FID computation.
  • Measure FID score variations due to aliasing artifacts introduced during resizing, especially when using non-antialiased kernels.
  • Implement and validate a recommended FID pipeline that standardizes resizing, kernel, and encoding choices for consistent results.
  • Release a production-ready, optimized codebase that enforces the recommended practices for FID calculation.

Experimental results

Research questions

  • RQ1How do different image resizing libraries affect FID score values when evaluating the same generative model?
  • RQ2To what extent do interpolation kernel choices (e.g., bilinear vs. bicubic) influence FID scores?
  • RQ3How does image encoding format (e.g., RGB vs. RGBA, 8-bit vs. 16-bit) impact FID score consistency?
  • RQ4What role do aliasing artifacts from improper resizing play in distorting FID scores?
  • RQ5What standardized, reproducible FID computation pipeline can minimize implementation variance across research and practice?

Key findings

  • Different image resizing libraries produce significantly different FID scores for the same generative model, even with identical model and dataset inputs.
  • The choice of interpolation kernel—especially non-antialiased ones like bilinear—introduces aliasing artifacts that distort FID scores.
  • Image encoding formats, such as RGBA vs. RGB, and bit depth, notably affect FID values due to differences in pixel representation.
  • Inconsistent resizing implementations lead to FID score variations of up to 10 points or more across different libraries and configurations.
  • The proposed standardized pipeline, using antialiased resizing with consistent kernel and encoding, produces stable and reproducible FID scores across experiments.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.