Genetic Programming for Evolving Similarity Functions for Clustering: Representations and Analysis

Andrew Lensen, Bing Xue, Mengjie Zhang

Clustering is a fundamental task in data science, yet its success often hinges on a single, rigid assumption: the choice of similarity measure. Most traditional algorithms rely on fixed metrics like Euclidean distance, which implicitly assume that all features are equally relevant and that clusters are roughly spherical. In complex, high-dimensional datasets, these assumptions frequently fail.

Researchers from Victoria University of Wellington have proposed a novel solution: GPGC (Genetic Programming for Graph-based Clustering). Instead of forcing data into a pre-defined metric, GPGC evolves custom similarity functions tailored to the unique geometry of a specific dataset.

The GPGC Framework

The core of the GPGC approach is an evolutionary loop that treats similarity functions as symbolic expressions. The process begins by initializing a population of potential functions and iteratively refining them based on their ability to reveal meaningful cluster structures.

The GPGC evolutionary process flowchart, illustrating the loop from population initialization to fitness evaluation and final output.

As shown in the flowchart above, each individual in the population is evaluated by using its evolved function to cluster the data. The algorithm identifies the most similar neighbor for each point and constructs a graph where connected components represent clusters. The fitness of an individual is then determined by a multi-faceted metric balancing cluster compactness, separability, and connectedness.

Representation: The GP Tree

In GPGC, a similarity function is represented as a tree structure. Unlike standard Genetic Programming (GP) used for classification, these trees take two distinct data instances ($I_0$ and $I_1$) as input. The terminal nodes represent specific features of these instances (e.g., $I_0F_1$ for the first feature of the first instance), while internal nodes consist of arithmetic and conditional operators.

An example of a GP tree representing a similarity function. It combines features from two instances using operators like 'sub', 'max', and 'add'.

This representation allows the GP to perform implicit feature selection and feature construction simultaneously. By including operators like min, max, and if, the system can evolve non-linear, piecewise similarity functions that a standard distance metric could never replicate.

Key Insights and Performance

The study utilized a comprehensive suite of synthetic datasets, ranging from 10 to 1,000 dimensions, to test the limits of the evolved functions. Several key insights emerged from the analysis:

  • Automatic Dimensionality Reduction: In high-dimensional spaces, the evolved trees often ignored up to 98% of available features, focusing only on the subset relevant to the cluster structure.
  • Ensemble Power: The authors introduced a "multi-tree" approach where the final similarity score is an ensemble of multiple evolved trees. This method, combined with All-Index Crossover (AIC), significantly outperformed single-tree models by allowing different trees to specialize in different cluster geometries.
  • Stability and Interpretability: GPGC-AIC outperformed established benchmarks like $k$-means++, OPTICS, and other evolutionary methods (such as MOCK), particularly on elliptical and high-dimensional data. Furthermore, because the functions are symbolic, they remain interpretable, allowing researchers to inspect exactly how the AI is "measuring" the data.

Conclusion and Future Directions

While the computational cost of evolution is higher than a simple $k$-means pass, the accuracy and flexibility of GPGC make it a powerful tool for offline data analysis where the underlying structure is unknown. Future work aims to explore multi-objective optimization (e.g., using NSGA-II) to further refine the balance between different clustering quality metrics and to validate the approach on ambiguous real-world datasets.

Summary updated

BibTeX
@article{lensen2020genetic,
  author = {Andrew Lensen and Bing Xue and Mengjie Zhang},
  title = {{Genetic Programming for Evolving Similarity Functions for Clustering: Representations and Analysis}},
  journal = {Evol. Comput.},
  year = {2020},
  doi = {10.1162/evco\_a\_00264},
}
Figure