Dictionary Learning for Two-Dimensional Kendall Shapes

Anna Song, Virginie Uhlmann, Julien Fageot, Michaël Unser · DOI

Abstract

We propose a novel sparse dictionary learning method for planar shapes in the sense of Kendall, namely configurations of landmarks in the plane considered up to similitudes. Our shape dictionary method provides a good trade-off between algorithmic simplicity and faithfulness with respect to the nonlinear geometric structure of Kendall's shape space. Remarkably, it boils down to a classical dictionary learning formulation modified using complex weights. Existing dictionary learning methods extended to nonlinear spaces either map the manifold to a reproducing kernel Hilbert space or to a tangent space. The first approach is unnecessarily heavy in the case of Kendall's shape space and causes the geometrical understanding of shapes to be lost, while the second one induces distortions and theoretical complexity. Our approach does not suffer from these drawbacks. Instead of embedding the shape space into a linear space, we rely on the hyperplane of centered configurations, including pre-shapes from which shapes are defined as rotation orbits. In this linear space, the dictionary atoms are scaled and rotated using complex weights before summation. Furthermore, our formulation is more general than Kendall's original one: it applies to discretely-defined configurations of landmarks as well as continuously-defined interpolating curves. We implemented our algorithm by adapting the method of optimal directions combined to a Cholesky-optimized order recursive matching pursuit. An interesting feature of our shape dictionary is that it produces visually realistic atoms, while guaranteeing reconstruction accuracy. Its efficiency can mostly be attributed to a clear formulation of the framework with complex numbers. We illustrate the strong potential of our approach for the characterization of datasets of shapes up to similitudes and the analysis of patterns in deforming 2D shapes.

Introduction

Shape analysis is a cornerstone of biomedical imaging and computer vision, used to classify objects or describe the dynamics of moving organisms. However, analyzing shapes is mathematically challenging because a "shape" is defined by what remains after removing its position, size, and orientation—properties known as similitudes. In the framework of Kendall’s shape space, shapes are treated as points on a non-linear Riemannian manifold.

Standard tools like Principal Component Analysis (PCA) or traditional Dictionary Learning (DL) assume a linear Euclidean space. To bridge this gap, researchers typically project data onto a flat "tangent space" (introducing distortions) or map it to a high-dimensional "kernel space" (which is computationally heavy and loses geometric interpretability). This paper introduces a method that is both mathematically simple and geometrically faithful by leveraging the properties of complex numbers.

Methodology: The Complex Pre-shape Framework

The core innovation of the 2D Kendall Shape Dictionary (2DKSD) method is the representation of 2D landmarks $(x, y)$ as complex numbers $z = x + iy$. In this representation, the operations of scaling and rotation become a single complex multiplication. This allows the algorithm to explore the rotation orbit of each atom linearly, transforming a non-linear manifold problem into a manageable linear formulation.

Geometric representation of the ambient space, centered configurations, and the pre-shape sphere projection.

Instead of working directly on the non-linear shape manifold, the authors operate in the "pre-shape" space—a linear hyperplane of centered configurations. As shown in the figure above, a general configuration $z$ is projected onto the centered configuration $z_0$ and then normalized to the pre-shape sphere $\mathcal{S}$.

Summary of the mathematical elements, notations, and real dimensions used in the 2DKSD framework.

The 2DKSD formulation treats dictionary learning as a minimization problem with complex weights. This allows each atom in the dictionary to be individually rotated and scaled to fit a target shape during reconstruction. The framework is generalized to handle both discrete landmarks and continuous interpolating curves (like B-splines) by defining a specific Hermitian inner product and a Gram matrix ($\Phi$) that accounts for the curve's geometry. The implementation utilizes the Method of Optimal Directions (MOD) for dictionary updates and a Cholesky-optimized Order Recursive Matching Pursuit (ORMP) for sparse coding.

Key Insights and Results

The 2DKSD approach offers several advantages over traditional "align-first" real-valued methods:

  • Implicit Alignment: Traditional shape DL requires pre-processing to rotate all shapes to a mean orientation. In 2DKSD, alignment happens automatically and optimally for every shape during sparse coding because the weights are complex.
  • Geometric Realism: Because atoms are learned in the pre-shape space, they retain the visual characteristics of actual shapes (e.g., "proto-leaves" or "proto-worms"), whereas real-valued methods often produce noisy or distorted atoms.
  • Superior Accuracy: Using complex numbers allows for a much lower Root Mean Square Error (RMSE). For instance, on a dataset of C. elegans nematode landmarks, 2DKSD achieved an RMSE of 2.36%, significantly outperforming the 4.19% error of the align-first baseline.

Conclusion

By representing planar coordinates as complex numbers, the authors have developed a sparse dictionary learning method that is inherently invariant to translation, scale, and rotation. The 2DKSD method provides visually realistic atoms and superior reconstruction accuracy while maintaining computational efficiency. While currently limited to 2D shapes due to the unique properties of complex multiplication, it represents a significant step forward in geometrically faithful shape analysis.

Summary updated

BibTeX
@article{song2020dictionary,
  author = {Anna Song and Virginie Uhlmann and Julien Fageot and Michaël Unser},
  title = {{Dictionary Learning for Two-Dimensional Kendall Shapes}},
  journal = {SIAM J. Imaging Sci.},
  year = {2020},
  doi = {10.1137/19m126044x},
}
Figure