Introduction
Clustering algorithms typically fall into two categories, each with distinct trade-offs. Model-based methods (like K-means or Expectation-Maximization) fit global parameters to data to find cluster centers. While great for describing clusters, they are notoriously sensitive to initialization and frequently get trapped in poor solutions, or "local minima." Conversely, affinity-based methods (like Spectral Clustering) rely on pairwise similarities between data points, avoiding some optimization traps but often failing to provide a clear "representative" prototype for the resulting clusters.
Affinity Propagation (AP) bridges this gap. It is a powerful clustering algorithm that identifies "exemplars"—actual data points that best represent their clusters—by passing messages between all pairs of data. By combining the strengths of generative mixture models and pairwise similarity methods, AP avoids the local minima traps of traditional methods and consistently finds higher-likelihood solutions.
How Affinity Propagation Works
The core innovation of AP is its deterministic message-passing approach. Unlike K-means, which starts with a random subset of cluster centers, AP treats all data points as potential exemplars simultaneously.
The algorithm communicates via two types of messages passed between data points:
- Responsibilities ($r_{ik}$): Sent from a data point $i$ to a candidate exemplar $k$. This message reflects how well-suited $k$ is to serve as the exemplar for $i$, taking into account the strength of other potential exemplars.
- Availabilities ($a_{ki}$): Sent from a candidate exemplar $k$ back to point $i$. This reflects how "available" $k$ is to be an exemplar, based on how many other points have effectively "voted" for it.
Mathematically, these updates are an instance of Belief Propagation (specifically the sum-product or max-product algorithm) operating on a factor graph. This grounds the heuristic-seeming message-passing scheme in rigorous probabilistic theory. Furthermore, AP does not require you to pre-specify the number of clusters ($K$). Instead, a "preference" parameter (the prior probability that a point should be an exemplar) is adjusted, allowing the natural number of clusters to emerge from the data.
Experimental Validation
The authors evaluated AP across three distinct domains:
- Synthetic Image Data: A grayscale image containing noisy, non-aligned letters ('N', 'I', 'P', 'S').
- Natural Image Segmentation: Grouping pixels based on texture and color patches.
- Genomics: Analyzing a massive dataset of 837,251 putative exons from the mouse genome using 12-dimensional expression profiles.
Key Results
By forcing cluster centers to be actual data points, the model remains grounded in reality. This is especially vital in fields like genomics, where a mathematically averaged "mean" expression profile might not correspond to any real biological entity.
Traditional K-medoids is greedy; it picks centers and hopes for the best. AP’s message-passing allows it to softly consider all possibilities at once, gradually converging on a global structure.
In image segmentation tasks, AP demonstrated superior optimization, achieving a solution in the 98th percentile compared to 1,000 random restarts of the K-medoids (Greedy EM) algorithm.
The biological accuracy was equally impressive. On the mouse genome task, AP was compared to standard hierarchical clustering. AP achieved a five-fold increase in the true detection rate of known exons while maintaining a very low false-discovery rate of just 0.4%. Despite the algorithm's theoretical $O(N^2)$ complexity, the authors successfully processed nearly a million data points by utilizing a sparse implementation that only evaluated nearby genomic probes.
Limitations and Future Directions
While highly effective, Affinity Propagation has a few limitations:
- Computational Scaling: The raw algorithm scales quadratically ($O(N^2)$). While sparse implementations work well for data with inherent constraints (like genomic sequences), applying AP to massive, dense datasets remains computationally challenging.
- Parameter Tuning: Although AP automatically discovers the number of clusters, this outcome is highly dependent on the chosen "preference" parameter, which often requires domain expertise or trial-and-error to tune correctly.
- Oscillations: Because it relies on loopy belief propagation, the algorithm can sometimes fail to converge and instead oscillate. While parallel or sequential updates help, practical implementations often require a "damping" factor to ensure numerical stability.
Summary updated