Fair Clustering via Alignment

Kunwoong Kim, Jihu Lee, Sangchul Park, Yongdai Kim

Abstract

Fair clustering (FC) aims to partition data such that the representation of protected groups in each cluster matches their overall population proportions. Traditional methods often struggle with a steep fairness-utility trade-off or numerical instability. We present Fair Clustering via Alignment (FCA), an in-processing algorithm that reformulates the fair clustering objective as a combination of optimal transport and standard clustering. By aligning data from different groups into a shared space, FCA achieves near-perfect fairness with high clustering utility and robust scalability.

Introduction

In unsupervised learning, the goal of clustering is to group similar data points together. However, standard algorithms like $K$-means often produce clusters that are biased with respect to sensitive attributes such as race, gender, or age. Fair clustering addresses this by imposing constraints to ensure balanced group representation.

The primary challenge in this field is the "fairness-utility trade-off." Existing approaches generally fall into three categories:

  1. Pre-processing (Fairlets): These methods transform data before clustering. Because the transformation and clustering are decoupled, they often suffer from high clustering costs.
  2. Post-processing: These adjust cluster assignments after centers are determined. Their effectiveness is inherently limited by the quality of the initial, potentially biased, centers.
  3. In-processing: These attempt to optimize fairness and clustering simultaneously. While promising, they often rely on complex constraints or penalty terms that lead to numerical instability, such as gradient explosions or failure to converge on high-dimensional data.

The FCA Framework

Fair Clustering via Alignment (FCA) introduces a novel perspective by treating fairness as an implicit alignment problem rather than a rigid constraint.

Mathematical Decomposition

The core innovation of FCA is the mathematical proof that the fair $K$-means objective can be decomposed into two distinct components:

  1. Transport Cost: The cost associated with matching or "aligning" instances from different protected groups.
  2. Clustering Cost: The standard $K$-means cost calculated within an "aligned space"—defined as the weighted average or midpoint of the matched points.

The FCA Algorithm

FCA operates through an iterative two-phase process:

  • Phase 1: Alignment. The algorithm solves a modified Kantorovich problem (a classic Optimal Transport task) to find the optimal coupling between groups. This coupling minimizes the combined transport and clustering costs.
  • Phase 2: Centroid Update. Cluster centers are updated based on the data points projected into the aligned space.

To accommodate varying requirements for fairness, the authors also developed FCA-Control (FCA-C). This variant introduces a hyperparameter ($\epsilon$) that allows practitioners to tune the degree of alignment, balancing strict fairness against clustering utility.

Scalability via Partitioning

Optimal transport problems typically have a complexity of $O(n^3)$, which is prohibitive for large datasets. FCA overcomes this by using a partitioning technique. The data is split into smaller, manageable batches (e.g., 1024 samples) to estimate the global coupling. This approach allows the algorithm to scale linearly with the number of data points.

Experimental Evaluation

The authors evaluated FCA against several baselines, including SFC, FCBC, FRAC, and Variational Fair Clustering (VFC), across tabular and image-based datasets including ADULT, BANK, CENSUS, RMNIST, and OFFICE-31.

Performance and Utility

On tabular benchmarks such as ADULT (gender) and BANK (marital status), FCA consistently achieved lower clustering costs than other fair baselines while maintaining superior fairness scores. Notably, FCA reached near-perfect fairness (Balance $\approx$ 1.0) across all tested scenarios.

Numerical Stability and High-Dimensional Data

A significant advantage of FCA is its numerical stability. In tests on the CENSUS dataset (66 dimensions), the competing VFC method failed due to numerical overflows. In contrast, FCA handled the high-dimensional space without issue, achieving a balance score of 0.959.

Large-Scale Application

FCA demonstrated impressive scalability by successfully clustering a synthetic dataset of $10^6$ samples. The partitioning trick proved effective, showing that global alignment can be approximated through local batch processing without significant loss in performance.

Discussion and Insights

The success of FCA stems from its "alignment" philosophy. By transforming the data into a shared space where group differences are minimized, the fairness constraint is satisfied implicitly. This avoids the numerical pitfalls of penalty-based methods. The "aligned space" provides an intuitive middle ground; for example, if two groups have different natural centers, FCA finds the optimal compromise that satisfies fairness while minimizing the distance to the original data.

Limitations and Future Work

While FCA represents a significant step forward, it is currently optimized for centroid-based objectives like $K$-means and $K$-median. Future research could extend this alignment framework to other unsupervised models, such as Gaussian Mixture Models (GMMs) or dimensionality reduction techniques. Additionally, while the alignment process encourages similar treatment of similar individuals, the current formulation focuses primarily on group-level fairness rather than explicit individual fairness constraints.

Conclusion

Fair Clustering via Alignment (FCA) provides a theoretically grounded and practically robust solution to the fair clustering problem. By leveraging optimal transport to align protected groups, it bypasses the stability issues of previous in-processing methods and offers a superior trade-off between fairness and clustering utility.

Summary updated

BibTeX
@inproceedings{kim2025fair,
  author = {Kunwoong Kim and Jihu Lee and Sangchul Park and Yongdai Kim},
  title = {{Fair Clustering via Alignment}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=jImlK83NmV},
}
Figure