Source-linked AI summary
Ultrametric Fitting by Gradient Descent
Giovanni Chierchia, Benjamin Perret
TL;DR
Procedural hierarchical clustering methods can make the optimized objective difficult to understand. The paper introduces a gradient-descent framework that optimizes costs over continuous ultrametrics using a min-max operation. On synthetic and real data, its proposed cost functions perform as well as Ward method and semi-supervised SVM.
Problem
Procedural hierarchical clustering methods make it difficult to understand the objective being optimized, motivating ultrametric fitting with a well-defined cost function.
Source: §1 · p. 2Method
The framework optimizes cost functions over continuous ultrametrics and enforces ultrametricity implicitly through a min-max operation.
Source: §1 · p. 2Results
On synthetic and real datasets, the proposed cost functions perform as well as Ward method and semi-supervised SVM.
Source: §1 · p. 2Takeaways & Limitations
Experiments indicate that the framework provides good approximate solutions to well-studied ultrametric-fitting problems.
Source: §5 · p. 9Theoretical analysis is beyond scope, and exact closest-ultrametric minimization is NP-hard, so the framework computes an approximate solution.
Source: §2.2 · p. 4, §5 · p. 9
Abstract
from arXiv · showhide
We study the problem of fitting an ultrametric distance to a dissimilarity graph in the context of hierarchical cluster analysis. Standard hierarchical clustering methods are specified procedurally, rather than in terms of the cost function to be optimized. We aim to overcome this limitation by presenting a general optimization framework for ultrametric fitting. Our approach consists of modeling the latter as a constrained optimization problem over the continuous space of ultrametrics. So doing, we can leverage the simple, yet effective, idea of replacing the ultrametric constraint with a min-max operation injected directly into the cost function. The proposed reformulation leads to an unconstrained optimization problem that can be efficiently solved by gradient descent methods. The flexibility of our framework allows us to investigate several cost functions, following the classic paradigm of combining a data fidelity term with a regularization. While we provide no theoretical guarantee to find the global optimum, the numerical results obtained over a number of synthetic and real datasets demonstrate the good performance of our approach with respect to state-of-the-art agglomerative algorithms. This makes us believe that the proposed framework sheds new light on the way to design a new generation of hierarchical clustering methods. Our code is made publicly available at \url{https://github.com/PerretB/ultrametric-fitting}.
1 Introduction
The introduction presents gradient-descent optimization as a cost-based framework for ultrametric fitting, addressing the difficulty of understanding objectives behind procedural clustering methods.
- Prior approaches include greedy agglomerative and divisive heuristics, integer programming, continuous relaxations, and probabilistic formulations; closest-ultrametric fitting also has LP and ILP treatments.Source: §1 · pp. 1–2
- Procedural clustering methods can make their optimized objective difficult to understand, motivating formulations with well-defined cost functions.Source: §1 · p. 2
- The framework optimizes a cost over continuous ultrametrics, implicitly enforcing ultrametricity through a min-max operation.Source: §1 · p. 2
- Experiments on synthetic and real datasets find the proposed cost functions perform as well as Ward method and semi-supervised SVM.Source: §1 · p. 2
- The framework tests four objectives: closest-ultrametric fidelity, cluster-size regularization, semi-supervised triplet regularization, and a Dasgupta fidelity relaxation.Source: §1 · p. 2
- Its automatically differentiable algorithms scale to millions of vertices on sparse graphs.Source: §1 · p. 2
2 Ultrametric fitting
The paper represents ultrametrics on sparse graphs and uses a min-max operation to enforce ultrametricity within a gradient-descent optimization framework. It applies this framework to closest-ultrametric fitting, cluster-size and triplet regularization, and a differentiable relaxation of Dasgupta cost.
2 Ultrametric fitting
- A graph’s edge weights represent an ultrametric whose pairwise distances are recovered by the min-max distance, allowing compact representation on sparse graphs.The dendrogram associates each pair’s distance with the altitude of its lowest common ancestor.Source: §2 · pp. 2–3
2.1 Optimization framework
- Replacing the nonconvex ultrametricity constraint with a min-max operation yields an unconstrained cost that can be optimized by gradient descent.The authors describe this as the first use of the min-max operator in an optimization framework for ultrametric fitting.Source: §2.1 · p. 3
2.2 Closest ultrametric
- Exact minimization of the closest-ultrametric cost is NP-hard, so the proposed framework computes an approximate solution.The closest-ultrametric objective measures squared errors between the fitted ultrametric and graph edge weights.Source: §2.2 · pp. 3–4
2.3 Cluster-size regularization
- Adding cluster-size regularization prevents small clusters from branching very high in the dendrogram.The regularizer ranks nodes by the size of their smallest child and penalizes ultrametric distances according to node-dependent coefficients.Source: §2.3 · p. 4
2.4 Triplet regularization
- Triplet regularization uses known labels to reduce within-class ultrametric distances and increase distances between classes.A positive constant α sets the minimum prescribed distance between different classes.Source: §2.4 · p. 4
2.5 Dasgupta cost function
- For the Dasgupta cost, a differentiable soft-cardinal measure relaxes dendrogram node size and is optimized directly over ultrametric distances.The measure replaces the nondifferentiable Heaviside function with a continuous approximation such as a sigmoid; unlike, it is not optimized as a probability measure over a fixed tree.Source: §2.5 · p. 5
3 Algorithms
The algorithms exploit single-linkage trees and minimum-spanning-tree pass edges to compute ultrametrics and evaluate the framework’s cost terms efficiently. The section also describes efficient implementations for cluster-size and triplet regularization and the Dasgupta cost relaxation.
3 Algorithms
- The algorithms use single-linkage properties, a dual representation of the subdominant ultrametric, to compute the framework’s cost terms.Source: §3 · p. 5
3.1 Subdominant ultrametric
- The subdominant ultrametric is computed from pass-edge weights, with each edge’s pass edge identified through the single-linkage tree’s lowest common ancestor.For sparse graphs, the method uses single linkage and fast LCA preprocessing to achieve O(N log N) computation; its Jacobian has indicator columns for the corresponding pass edges.Source: §3.1 · p. 6, Figure 3 · p. 6, §3 · p. 6
3.2 Regularization terms
- Cluster-size regularization reuses single linkage and fast LCA for O(N log N) computation, while triplet regularization can be evaluated in O(|T| + N log N).Source: §3.2 · pp. 6–7
3.3 Dasgupta cost function
- The Dasgupta cost relaxation replaces the arbitrary reference vertex with a node’s associated pass edge, yielding O(N log N) empirical complexity for usually balanced dendrograms, but O(N^2) in the worst case.Its evaluation sums over a node’s ancestors; the worst-case number of ancestors is O(N), while balanced trees typically have O(log N).Source: §3.3 · p. 7
4 Experiments
On planar superpixel graphs, the proposed approach produces solutions close to CUCP’s near-optimal solutions in a fraction of its runtime. On real datasets, it is competitive with Ward clustering and its triplet-regularized method performs comparably to semi-supervised SVM.
- On superpixel adjacency graphs generated at increasing scales from a high-resolution image, the proposed gradient-descent approach produced solutions close to optimal while using only a fraction of CUCP’s runtime.Figure 5(a) reports final mean square error normalized against CUCP 40 by number of graph edges; Figure 5(b) compares runtime by edge count, with CUCP capped at 200 seconds per instance.Source: §4 · p. 8, Figure 5 · p. 8
- Closest and Closest+Size handle graphs with millions of edges, while the Dasgupta relaxation is limited to a few hundred thousand edges.Algorithm 1 usually converges in about one hundred iterations.Source: §4 · p. 8, Figure 5 · p. 8
- The proposed Dasgupta and Closest+Size methods are competitive with Ward; Dasgupta performs slightly worse than Closest+Size on Digit1 and Heart.Closest and closest-ultrametric results are omitted because their performance is consistently worst; the Dasgupta relaxation is sensitive to data scaling.Source: §4 · pp. 8–9, Figure 6 · p. 9
- Triplet-regularized clustering performs comparably to semi-supervised SVM and better than spectral clustering on the tested datasets.The comparison uses classification accuracy, with 10%–40% of samples labeled under a 10-fold scheme.Source: §4 · pp. 8–9, Figure 6 · p. 9
5 Conclusion
The paper presents a flexible framework for fitting ultrametrics to sparse edge-weighted graphs and reports good approximate solutions on simulated and real data. Theoretical analysis of the framework is left beyond the paper’s scope.
5 Conclusion
- The framework fits ultrametrics to sparse edge-weighted graphs and accommodates various cost functions through algorithms designed with automatic differentiation in mind.Experiments on simulated and real data produced good approximate solutions to well-studied problems.Source: §5 · p. 9
- Experiments on simulated and real data show that the approach provides good approximate solutions to well-studied problems.Source: §5 · p. 9
- Theoretical analysis of the optimization framework is beyond the paper’s scope; suggested future directions include statistical-physics modeling and end-to-end neural-network learning.Source: §5 · p. 9
A.1 Algorithms
The appendix describes algorithms for computing the cluster-size, triplet, and Dasgupta cost terms. They use tree properties and lowest-common-ancestor operations to evaluate the regularizations.
A.1 Algorithms
- Cluster-size regularization penalizes small clusters at large scales and can be restricted to the top-k dendrogram nodes; experiments use k = 10.The algorithm computes the smallest child size for each node and uses it when evaluating edge costs.Source: §A.1 · p. 10
- Triplet regularization penalizes triplets when the reference-positive distance is not sufficiently smaller than the reference-negative distance.The algorithm finds the clusters containing each pair using lowest-common-ancestor queries.Source: §A.1 · p. 11
- The Dasgupta cost implementation uses a soft-cardinal function, whose tree-node sizes are computed recursively from leaves to root.The described computation uses lowest-common-ancestor preprocessing and evaluates contributions along tree ancestors.Source: §A.1 · p. 11
A.2 Framework validation
The validation section reports a smooth, rapid convergence pattern for the closest-ultrametric objective across 52 test instances. The optimization uses AMSGrad with ADAM and a 0.01 step size.
A.2 Framework validation
- The optimization uses the AMSGrad variation of ADAM with step-size 0.01, and the implementation is single-threaded.Source: §A.2 · p. 11
- The mean-normalized convergence curve across 52 instances is smooth in practice and usually reaches convergence in a little over 100 iterations.Figure 8 plots the mean-normalized curve with standard deviation.Source: §A.2 · p. 11, Figure 8 · p. 12
- For each of 52 test instances, Jclosest values at each iteration were normalized from 0 for the lowest achieved cost to 1 for the highest reached cost.Source: §A.2 · p. 11
A.3 Illustrative examples
The illustrative examples compare hierarchical clusterings from four cost-function configurations. Each dataset is represented by a connected graph built from a 5-nearest-neighbor graph augmented with minimum-spanning-tree edges.
A.3 Illustrative examples
- Each example uses a 5-nearest-neighbor graph augmented with minimum-spanning-tree edges to ensure connectivity, then thresholds the resulting ultrametric at the prescribed cluster count.Source: §A.3 · p. 12
- The displayed columns compare Closest, Closest+Size, Closest+Triplet, and Dasgupta cost configurations.Closest+Size applies size regularization to the top 10 dendrogram nodes with λ = 0.1; Closest+Triplet uses λ = 1 and α = 3.Source: §A.3 · p. 12
- The example optimization uses the AMSGrad variation of ADAM with step-size 0.1.Source: §A.3 · p. 12
A.4 Average linkage approximates the closest ultrametric problem
The closest-ultrametric criterion connects to average linkage: for a fixed hierarchical clustering, optimal altitudes can be chosen, and average linkage uses the same criterion.
A.4 Average linkage approximates the closest ultrametric problem
- An ultrametric with finitely many values can be represented through functions defining a hierarchical partition.The number of values K is less than |V|.Source: §A.4 · pp. 12–13
- Figure 9 shows fitted ultrametrics and the cluster assignments obtained by thresholding them at two, three, or four clusters.Only the top 30 non-leaf nodes are shown in the dendrograms.Source: Figure 9 · p. 13
- For a fixed hierarchical clustering, the optimal altitudes are given by the criterion derived for Jclosest.Source: §A.4 · p. 13
- Average linkage uses exactly the closest-ultrametric criterion, so it provides an approximate solution to the closest ultrametric problem.Average linkage and Algorithm 1 with Jclosest also produce structurally similar ultrametrics in illustrative examples.Source: §A.4 · p. 13