Fair Neighbor Embedding

Jaakko Peltonen, Wen Xu, Timo Nummenmaa, Jyrki NummenmaaICML 2023

Introduction

Dimensionality reduction (DR) tools like t-SNE and UMAP are essential for Exploratory Data Analysis (EDA). They help researchers visualize complex, high-dimensional datasets in intuitive 2D or 3D maps. However, these traditional methods often capture the most prominent variations in a dataset, which frequently correlate with sensitive attributes—such as race, gender, or age—due to historical biases or discriminatory data collection practices.

If a visualization shows distinct clusters based on a protected group, a human analyst might erroneously conclude that these are the most important, inherent structures in the data. This can inadvertently reinforce stereotypes or lead to biased decision-making. Simply removing sensitive features from the input data is insufficient, as other "proxy" variables often remain statistically dependent on them. To address this, researchers have introduced Fair-NeRV (Fair Neighbor Retrieval Visualizer), a new neighbor embedding framework designed to actively hide sensitive associations while preserving the remaining informative structure.

Methodology: Formulating Fairness as Retrieval

The Fair-NeRV framework, along with its variant Fair-t-NeRV, tackles the bias problem by rethinking DR through an information retrieval lens. The approach relies on three key components:

  1. Information Retrieval Framework: Unlike standard t-SNE, which focuses on matching probability distributions, NeRV treats DR as a retrieval task. It minimizes "misses" (points that are neighbors in high-dimensional space but far apart in the low-dimensional map) and "false neighbors" (points close in the map that were not originally neighbors).
  2. Novel Fairness Cost ($C_{Fairness}$): The authors introduce a cost function that penalizes the embedding if a point's sensitive attribute can be easily predicted based on its local neighbors. This pushes the local distribution of sensitive attributes toward an uninformative, mixed distribution that reflects the overall population.
  3. Modified Class-Aware Objective: Adapting the ClassNeRV objective, the authors flip its original logic. Instead of separating classes, they use it to ensure that different sensitive groups are thoroughly mixed in the final visualization.

The final objective balances neighborhood preservation with this new fairness cost, allowing analysts to tune the trade-off between structural accuracy and fairness.

Key Insights and Visual Evidence

A critical insight from the paper is that fairness in visualization is scale-dependent. A map might look "fair" globally (showing a diverse mix of groups overall) but remain highly biased locally (containing small, homogeneous clusters). The authors define fair inspection scales ($k_{fair}$) as the smallest neighborhood size where predicting a sensitive attribute is no better than random guessing.

Traditional DR is considered "unfair" because it readily reveals sensitive information. Fair DR, by contrast, should reveal whether data variation can be explained without depending on those protected attributes.

Dimensionality reduction results for Synthetic Data. The top row shows coloring by sensitive category (Fair-NeRV successfully mixes these), while the bottom row shows coloring by non-sensitive clusters (Fair-NeRV successfully preserves these).

As demonstrated in the synthetic data visualization above, traditional t-SNE (column a) clearly separates sensitive categories. Fair-NeRV (column c) and Fair-t-NeRV (column d) successfully mix these sensitive categories (top row) while still clearly delineating the underlying, non-sensitive clusters (bottom row).

Quantitative Results

The researchers evaluated their method across one synthetic and five real-world fairness benchmark datasets (Adult, Communities and Crimes, German Credit, Law School, and Pima). To measure success, they introduced a new metric, $f1_{Avg}$, which quantifies how well non-sensitive high-dimensional clusters are preserved specifically at scales proven to be "fair."

Quantitative performance comparison across six datasets. Fair-NeRV and Fair-t-NeRV consistently outperform baselines in preserving structure at fair scales, achieving fairness at much smaller neighborhood sizes (k).

In almost all tested datasets, Fair-NeRV and Fair-t-NeRV achieved significantly higher $f1_{Avg}$ scores than t-SNE and its conditional variant (ct-SNE). Furthermore, the proposed methods reached "fair" scales much faster. For instance, on the synthetic dataset, Fair-t-NeRV achieved fairness at a neighborhood size of just $k=13$, whereas standard t-SNE required a massive neighborhood of $k=388$ to mask the sensitive attributes.

Limitations and Future Directions

While Fair-NeRV presents a significant step forward for unbiased EDA, it has limitations. Currently, the framework is designed exclusively for categorical sensitive attributes (e.g., Male/Female) and cannot yet handle continuous attributes like exact age or income. Additionally, the basic algorithm has an $O(n^2)$ computational complexity. Although approximations like Barnes-Hut could reduce this to $O(n \log n)$, the current work focuses primarily on the conceptual framework. Finally, while intended for visualization, these fair embeddings hold promise as pre-processed, bias-free features for downstream machine learning models.

Summary updated

BibTeX
@inproceedings{peltonen2023fair,
  author = {Jaakko Peltonen and Wen Xu and Timo Nummenmaa and Jyrki Nummenmaa},
  title = {{Fair Neighbor Embedding}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=aQa2KpnrmH},
}
Figure