Efficient fair PCA for fair representation learning

Matthäus Kleindessner, Michele Donini, Chris Russell, Muhammad Bilal Zafar

Abstract

We revisit the problem of fair principal component analysis (PCA), where the goal is to learn the best low-rank linear approximation of the data that obfuscates demographic information. We propose a conceptually simple approach that allows for an analytic solution similar to standard PCA and can be kernelized. Our methods have the same complexity as standard PCA, or kernel PCA, and run much faster than existing methods for fair PCA based on semidefinite programming or manifold optimization, while achieving similar results.

Introduction

Principal Component Analysis (PCA) is a cornerstone of dimensionality reduction, widely used to compress data while preserving its most informative features. However, standard PCA is "fairness-blind": it captures directions of maximum variance, which often inadvertently encode sensitive demographic information such as race, gender, or age. Representations derived from biased PCA can lead downstream machine learning models to inherit and amplify these societal biases.

Existing "Fair PCA" methods attempt to address this by imposing fairness constraints during optimization. However, these approaches often rely on computationally expensive techniques like Semidefinite Programming (SDP) or manifold optimization, which struggle to scale to high-dimensional datasets. This research introduces a mathematically elegant approach that achieves fairness with the same computational complexity as standard PCA, offering an analytic solution that outperforms existing methods in speed by orders of magnitude.

Methodology: The Nullspace Approach

The proposed method simplifies the fairness requirement by relaxing the demand for complete statistical independence to a requirement of zero covariance between the representation and demographic attributes.

Analytic Solution via Linear Constraints

The authors demonstrate that requiring a projection to be uncorrelated with a demographic attribute $Z$ is equivalent to a linear constraint: the projection matrix must lie within the nullspace of the demographic data. This allows the problem to be solved using standard eigenvector computations. The algorithm first identifies the "fair" subspace and then performs standard PCA within this restricted domain, maintaining a complexity of $O(nd^2 + d^3)$.

Visualization of Fair PCA versus the Fair PCA-S extension, showing improved distribution alignment.

Extensions: Kernel PCA and Fair PCA-S

The framework supports several powerful extensions:

  • Kernel Fair PCA: A non-linear version designed to handle complex data structures.
  • Fair PCA-S: A higher-order variant that equalizes not just the means of different groups in the projected space, but also their covariances. As shown in Figure 1, this extension provides superior distribution alignment.
  • Adjustable Fairness: A scaling factor $\lambda$ allows practitioners to trade off between fairness and reconstruction accuracy by blending fair and standard representations.

Experimental Evaluation

The authors evaluated their approach using standard fairness benchmarks (Adult Income, German Credit, COMPAS) and the high-dimensional CelebA image dataset.

Efficiency and Scalability

A primary advantage of the proposed method is its efficiency. As illustrated in Figure 4, the runtime of competing methods like FPCA grows rapidly with data dimensionality. In contrast, the proposed Fair PCA remains highly scalable. For a 100-dimensional dataset, while FPCA required over 2,000 seconds, the proposed method finished in less than half a second.

Runtime comparison showing the efficiency of the proposed Fair PCA methods compared to existing baselines.

Fairness Performance and Image Obfuscation

On the Adult Income dataset, the method reduced Demographic Parity violations from 0.20 to 0.02 while preserving high utility. In experiments with the CelebA dataset, Fair PCA successfully removed specific attributes (e.g., eyeglasses) from reconstructed images, demonstrating its capability as a "linear guard" that prevents linear classifiers from recovering sensitive information.

Discussion and Conclusion

By shifting the focus from statistical independence to zero covariance, the authors have transformed a difficult optimization problem into a tractable linear algebra task. This approach provides a robust "linear guard" for fair representation learning. While the linear core may not eliminate all non-linear demographic information—a limitation addressed by the more computationally intensive Kernel variant—its speed and simplicity make it a highly practical tool for large-scale applications. Future research will explore more efficient approximations for Kernel Fair PCA to mitigate its $O(n^3)$ scaling bottleneck.

Summary updated

BibTeX
@inproceedings{kleindessner2023efficient,
  author = {Matthäus Kleindessner and Michele Donini and Chris Russell and Muhammad Bilal Zafar},
  title = {{Efficient fair PCA for fair representation learning}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2023},
  url = {https://openreview.net/forum?id=KSh9Wcj5VQ},
}
Figure