Clustering is one of the most fundamental tools in data science, used for everything from segmenting customers to identifying school districts. But as machine learning is increasingly applied to critical social decisions, a major problem has emerged: standard clustering algorithms are often "unfair." They can inadvertently group people by sensitive attributes like race or gender, creating biased outcomes.
While researchers have developed "fair" versions of popular algorithms like $k$-means, a huge gap remained in density-based clustering. This is a problem because density-based methods are often superior for real-world data—they can find clusters of any shape, handle messy "noise" (outliers), and work well with geographic or categorical data.
A new paper from ICLR 2025 introduces FairDen, the first algorithm to successfully integrate group-level fairness into density-based clustering.
TL;DR
FairDen is the first fair density-based clustering algorithm that can find clusters of arbitrary shapes while ensuring they are balanced across sensitive attributes. Unlike previous methods, it natively handles noise, categorical data, and multiple sensitive attributes simultaneously.
What Problem Does This Paper Address?
Most "fair clustering" research focuses on centroid-based methods (like $k$-means). These try to find center points and group everything around them. However, these methods struggle with three things:
- Complex Shapes: They only find "round" clusters.
- Noise: They try to force every outlier into a cluster, which can skew results.
- Categorical Data: They usually require data to be numerical.
Density-based clustering (like the famous DBSCAN) solves these issues by looking for "chains" of connected points. But density-based clustering is notoriously hard to make "fair" because it doesn't have a simple mathematical objective function to optimize—it’s based on a discrete "yes/no" connectivity property. The authors of FairDen set out to bridge this gap.
Methods
The genius of FairDen lies in how it transforms a discrete problem into a continuous one that a computer can optimize:
- The DC-Distance: Instead of just saying two points are "connected" or "not," the authors use density-connectivity distance (dc-distance). This creates a continuous similarity matrix that captures the "density structure" of the data.
- Spectral Transformation: By treating this matrix like a graph, they can use spectral clustering techniques. This allows them to turn the clustering task into an optimization problem.
- The Fairness Constraint: They add a mathematical "balancing matrix" to the optimization. This forces the algorithm to pick clusters where the ratio of sensitive groups (e.g., 50% Group A, 50% Group B) matches the ratio of the entire dataset.
- Mixed-Type Handling: To handle categorical data (like "marital status"), they combine the dc-distance with a categorical similarity measure (Goodall1), allowing the algorithm to "see" both types of information at once.
Key Insights and Ideas
- Intersectional Fairness: Most fair algorithms only look at one attribute at a time (e.g., just gender). FairDen can handle "meta-groups," such as "Female + Asian," ensuring that fairness isn't lost when multiple sensitive categories overlap.
- Preserving Structure: Centroid-based fair methods often "break" the natural density of the data to achieve balance. FairDen is unique because it prioritizes the natural "flow" of the data while still meeting fairness goals.
- Noise as a Safety Valve: By identifying noise points and excluding them from the fairness calculation, FairDen avoids the "forced grouping" that makes other fair algorithms less accurate in the presence of outliers.
Key Results
The authors evaluated FairDen on several standard fairness benchmarks, including Adult (census data), Bank (marketing data), Communities and Crime, and Diabetes datasets.
- Superior Balance: In experiments on the Adult and Bank datasets, FairDen consistently achieved "balance" scores (where 1.0 is perfect) much higher than standard DBSCAN and often better than existing fair $k$-means competitors.
- Better Cluster Quality: Using a metric called DCSI (which measures how well-separated and connected clusters are), FairDen significantly outperformed other fair methods. While other methods produced "fair" clusters that were structurally messy, FairDen’s clusters remained clean and meaningful.
- Categorical Advantage: FairDen was the only algorithm tested that could natively handle categorical features without needing to pre-process them into numbers, which often loses information.
Limitations and Future Work
The authors acknowledge a few hurdles:
- Small Groups: If a sensitive subgroup is extremely small (e.g., fewer people than the number of clusters), it is mathematically impossible to distribute them perfectly across all clusters.
- Computational Cost: Like most spectral methods, the algorithm has a complexity of $O(n^3)$. While fine for thousands of points, it may need approximations (like Nyström methods) to work on millions of data points.
- Trade-offs: Sometimes, balancing for a combination of attributes (like race AND gender) might slightly decrease the balance for one of those attributes individually.
Paper Citation: Lena Krieger, Anna Beer, Pernille Matthews, Anneka Myrup Thiesson, & Ira Assent. "FairDen: Fair Density-Based Clustering." Published as a conference paper at ICLR 2025.
Summary updated