Fast Algorithm for Affinity Propagation

Yasuhiro Fujiwara, Go Irie, Tomoe KitaharaIJCAI 2011

Abstract

Affinity Propagation (AP) is a powerful clustering algorithm that often outperforms k-means, particularly when the number of clusters is unknown or similarity measures are non-symmetric. However, its $O(N^2)$ complexity per iteration makes it prohibitively slow for large datasets. This paper introduces a fast AP algorithm that leverages mathematical bounds to prune unnecessary message exchanges. Experimental results demonstrate over a 30x speedup while guaranteeing the exact same clustering results as the original version, overcoming the accuracy trade-offs seen in previous heuristic-based approaches.

Introduction: The Scalability Challenge of Affinity Propagation

Affinity Propagation is widely used because it does not require a pre-specified number of clusters and accommodates non-symmetric similarity measures. Despite these advantages, its computational cost is a major drawback: it requires every data point to exchange "responsibility" and "availability" messages with every other data point in every iteration.

For a dataset of $N$ points, this results in $O(N^2)$ operations per iteration. For instance, a dataset of 100,000 points requires 10 billion operations per step. Previous attempts to accelerate this process, such as the FSAP algorithm, relied on K-Nearest Neighbors (KNN) heuristics. While faster, these methods sacrifice accuracy, often failing to converge to the mathematically "correct" clusters defined by the original AP logic.

Methodology: Pruning via Mathematical Bounds

The core contribution of this work is a method to construct a sparse graph of messages. Instead of updating all $N^2$ potential connections, the algorithm identifies which connections are essential for determining the final cluster exemplars.

  1. Bounding Messages: The authors derived rigorous mathematical bounds ($\underline{a}, \overline{r}, \overline{a}$) for responsibility and availability messages based on initial pairwise similarities.
  2. Pruning Strategy: Using these bounds, the authors proved that many message exchanges have no impact on the final choice of exemplars. If a connection's potential value is mathematically guaranteed to be lower than other candidates, it is pruned from the iterative process.
  3. Post-hoc Computation: For the minimal set of pruned messages required to finalize the calculations after convergence, the authors provide a method to derive their exact values from the unpruned messages.
  4. Algorithm Workflow: The process involves calculating bounds, linking only the pairs that meet the pruning criteria to create a sparse graph, running standard AP updates on this graph, and finally determining clusters.

Experimental Evaluation

The algorithm was evaluated on three diverse real-world datasets:

  • Geo: 10,000 geo-tagged Flickr photos from New York City, using negative Euclidean distance for similarity.
  • Dictionary: 13,356 terms from the FOLDOC computing dictionary, using "random walk with restart" for semantic relatedness.
  • Traffic: 10,000 sequences of loop sensor measurements from Los Angeles freeways.

Key Results and Discussion

The proposed algorithm consistently outperformed both the original AP and heuristic alternatives in terms of speed and accuracy.

Efficiency and Speedup

The algorithm achieved a consistent 30x speedup across all tested datasets. In the "Geo" dataset, the method reduced the number of processed edges from 100 million to approximately 10 million—a 90% reduction in message traffic.

Wall clock time comparison across different datasets. The proposed method is significantly faster than the original AP and FSAP variants.

Guaranteed Exactness

Unlike FSAP, which shows fluctuating precision and recall, the proposed algorithm maintains a perfect 1.0 precision and recall. This confirms that the pruning logic is mathematically sound and does not alter the final clustering outcome.

Precision comparison as a function of data points. The proposed algorithm maintains perfect precision (1.0), while heuristic FSAP methods degrade.

Qualitative Superiority

A landmark detection case study in NYC highlighted the practical benefits of exactness. While the proposed method correctly identified distinct landmarks (e.g., Empire State Building, Times Square), the heuristic-based FSAP often redundantly selected the same landmark multiple times due to its lack of global convergence guarantees.

Conclusion and Future Work

This research demonstrates that "fast" does not have to mean "approximate." By exploiting the inherent sparsity in real-world data through rigorous mathematical bounds, Affinity Propagation can be scaled significantly without losing its integrity.

Current limitations include an initial $O(N^2)$ overhead for calculating bounds and high memory requirements for storing similarity matrices. Future work may involve combining this pruning logic with advanced indexing structures, such as metric trees, to further reduce the initial similarity calculation costs and extend the algorithm's reach to datasets with millions of points.

Summary updated

BibTeX
@inproceedings{fujiwara2011fast,
  author = {Yasuhiro Fujiwara and Go Irie and Tomoe Kitahara},
  title = {{Fast Algorithm for Affinity Propagation}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2011},
  url = {https://openreview.net/forum?id=S1bbxXfdWS},
}
Figure