Abstract
Anomaly detection (AD) is a critical component of modern AI systems, yet standard models often suffer from "majority bias," where minority groups are unfairly flagged as outliers due to their underrepresentation. This paper introduces FAIRAD, a novel framework designed to achieve algorithmic equity in AD. By combining a re-balanced autoencoder with a fairness-aware contrastive learning module, FAIRAD achieves state-of-the-art detection accuracy while drastically reducing the performance gap between majority and protected groups.
Introduction
Anomaly detection is widely used to identify rare events like credit card fraud or network intrusions. However, real-world data is often imbalanced, with one group (the unprotected group) being significantly more abundant than another (the protected group). Standard AD models, such as autoencoders, typically minimize overall reconstruction error. Because the majority group dominates the loss function, the model learns its patterns effectively while neglecting the minority group. This leads to representation disparity, where normal behavior from a minority group member is flagged as an anomaly simply because it deviates from the majority pattern. Such biases can have severe real-world consequences, such as disproportionately flagging low-income communities in child welfare risk models.
Methodology
The FAIRAD framework addresses representation disparity through two synergistic modules:
1. Fairness-aware Contrastive Learning ($L_{FAC}$)
While standard contrastive learning aims for a uniform distribution of data points in the latent space, FAIRAD explicitly maximizes similarity between protected and unprotected groups. The loss function is decomposed into:
- $L_{fair}$: Encourages the model to map normal instances from both groups to overlapping regions in the latent space.
- $L_{unif}$: Ensures that representations within each group remain diverse, preventing the model from collapsing all data into a single point.
2. Re-balancing Autoencoder ($L_{REC}$)
FAIRAD replaces the standard reconstruction loss with a weighted version: $(1 - \epsilon)L_{Unprotected} + \epsilon L_{Protected}$. Crucially, the weight $\epsilon$ is not a fixed hyperparameter but is mathematically derived (Lemma 3.1) to ensure the model prioritizes learning "normal" patterns for both groups equally, regardless of their relative sizes.
The authors also provide a rigorous theoretical analysis using Rademacher complexity to prove that minimizing this joint loss function places an upper bound on the fairness gap.
Key Insights: Uniformity vs. Fairness
A central finding of this research is that simply achieving "uniformity" in latent representations—a common goal in self-supervised learning—does not guarantee fairness.
As illustrated in the latent space visualizations, without explicit group alignment (Figure 6b), the minority group can still be pushed into a distinct region of the latent space, making it susceptible to misclassification. FAIRAD (Figure 6c) achieves proper uniformity while ensuring group alignment, thereby harmonizing performance and equity.
Experimental Results
FAIRAD was evaluated against several baselines (e.g., FairOD, FairSVDD, MCM) across diverse datasets including MNIST-USPS, MNIST-Invert, COMPAS, and CelebA.
Superior Accuracy and Bias Reduction
On the MNIST-USPS dataset, FAIRAD achieved a Recall@1200 of 67.16%, significantly outperforming baselines like FairOD (12.20%) and FairSVDD (15.46%). Simultaneously, the "Recall Difference"—the performance gap between groups—was reduced to just 3.73%, compared to gaps as high as 62.64% in fairness-agnostic methods.
Efficiency and Robustness
Despite the additional contrastive learning module, FAIRAD remains computationally efficient, ranking among the top four fastest methods. Furthermore, its performance remains stable even under extreme imbalance ratios (e.g., 4:1), where other models' fairness metrics typically deteriorate.
Conclusion and Future Work
FAIRAD demonstrates that it is possible to improve overall anomaly detection performance by properly modeling minority groups rather than sacrificing accuracy for fairness. Future work will explore extending the framework to handle multiple overlapping sensitive attributes and incorporating "individual fairness" constraints to ensure similar individuals are treated consistently.
Summary updated