Skip to content

Latest commit

 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LieDetect: Detection of representation orbits of compact Lie groups from point clouds

LieDetect is a Python framework for recovering continuous symmetries from finite point-cloud data. It combines computational geometry, representation theory, and numerical optimization, with applications to computer vision, equivariant neural networks, dynamical systems, and molecular conformations.

til

Installation

LieDetect uses Poetry to manage its Python environment and dependencies.

Clone the repository and install the project:

git clone https://github.com/HLovisiEnnes/LieDetect.git
cd LieDetect
poetry install

Run the test suite:

poetry run pytest

Launch Jupyter to explore the experiments:

poetry run jupyter notebook

The application notebooks are available in the notebooks/ directory.

Background

In this paper, we introduced an algorithm for estimating representations of compact Lie groups from finite samples of their orbits.

The input consists of a point cloud $X \subset \mathbb{R}^n$ together with a compact Lie group $G$. The current implementation supports the groups $\mathrm{SO}(2)$, $T^d$ for $d \geq 1$, $\mathrm{SO}(3)$, and $\mathrm{SU}(2)$. When successful, the algorithm returns a linear representation of $G$ on $\mathbb{R}^n$ and a corresponding orbit $\mathcal{O}$ that provides a close geometric approximation of the input data.

The main difficulty is that the representation is not known in advance. The method therefore begins by enumerating the possible representations of $G$ in $\mathbb{R}^n$, up to orbit equivalence. Each candidate is first analyzed at the level of the associated Lie algebra, which provides a finite-dimensional description of the infinitesimal group action. The remaining freedom in the embedding is then handled through an optimization problem over the orthogonal group $\mathrm{O}(n)$.

In practical terms, the algorithm searches for a coordinate system in which the observed point cloud is well approximated by an orbit of a linear group action. The resulting model gives both a compact description of the data and an explicit family of transformations that explains its geometric variation. The animation below illustrates the procedure for detecting a representation of $\mathrm{SO}(2)$ in $\mathbb{R}^{12}$. The initial candidate orbit is progressively aligned with the input point cloud by optimizing over orthogonal changes of coordinates.

Optimization of an SO(2) orbit in R12

Additional visualizations of the optimization process are available in this video playlist.

All figures and animations used in the paper can be reproduced from notebooks/illustrations.ipynb. The repository also contains several application-oriented notebooks, described below, covering image data, equivariant neural networks, dynamical systems, and molecular conformations.

For a broader introduction to the method, see the recorded talks in English or in Portuguese.

Tutorial

Basic experiments are found in notebooks/tutorial.ipynb, displaying the possibilities of $\texttt{LieDetect}$. A typical example is given below.

# Local imports.
from algebra import are_representations_equivalent
from orbits import sample_orbit_from_group, sample_orbit_from_algebra, print_hausdorff_distance
from liepca import get_lie_pca_operator
from optimization import find_closest_algebra

# Generate a dataset.
pts, groundtruth_rep = sample_orbit_from_group(
    group="torus",  # group considered, among "torus", "SU(2)" and "SO(3)"
    group_dim=1,  # dimension of the group (here, circle)
    ambient_dim=4,  # ambient dimension
    nb_points=500,  # number of sample points
    frequency_max=4,  # maximal weight
)

# Compute Lie-PCA.
lie_pca = get_lie_pca_operator(
    pts=pts,  # input point cloud
    nb_neighbors=10,  # number of neighbors for tangent space estimation
    orbit_dim=1,  # intrinsic dimension for tangent space estimation
)

# Project on Lie subalgebras.
optimal_rep, optimal_algebra = find_closest_algebra(
    group="torus",
    lie_pca=lie_pca,
    group_dim=1,
    frequency_max=4,
    method="abelian", # optimization method, among "full_lie_pca", "bottom_lie_pca" and "abelian"
)

# Sanity check: compare groundtruth and estimated representations.
are_representations_equivalent(
    group="torus", rep0=groundtruth_rep, rep1=optimal_rep, verbose=True
)

# Generate orbit.
orbit = sample_orbit_from_algebra(
    group="torus",
    rep_type=optimal_rep, # representation type (orbit-equivalence class) estimated above
    algebra=optimal_algebra,  # Lie algebra estimated above
    x=pts[0],  # initial point to generate the orbit, chosen arbitrarily
    nb_points=1000,  # number of points to sample
)

# Sanity check: Hausdorff distance between orbits.
print_hausdorff_distance(pts, orbit)

Image analysis and 3D data analysis

The notebooks/image_analysis.ipynb notebook demonstrates how LieDetect can be applied to image and 3D data.

Many transformations such as translations, rotations, and changes in viewpoint—vary continuously commonly appear in computer vision pipelines. When images or 3D objects are represented as vectors in a high-dimensional Euclidean space, the samples generated by these transformations may form orbits of the associated with Lie-group actions.

LieDetect analyzes finite samples from these transformation orbits and estimates the underlying continuous symmetry directly from the data. Rather than treating transformed observations as unrelated inputs, the method recovers the geometric structure connecting them.

The notebook illustrates some complete experimental workflow:

  • constructing datasets generated by continuous image transformations;
  • representing 2D images and 3D data as high-dimensional point clouds;
  • estimating the local geometry of the sampled transformation orbit;
  • recovering candidate infinitesimal symmetry generators;
  • validating the detected symmetry against known transformations.

This information can support downstream machine-learning and computer-vision applications, including:

  • symmetry-aware representation learning, by identifying transformations that should be preserved or factored out by a model;
  • data augmentation, by generating samples along meaningful transformation directions;
  • robust feature learning, by separating task-relevant structure from variations caused by pose or orientation;
  • equivariant architecture design, by providing empirical information about the symmetries present in a dataset;
  • 3D shape and point-cloud analysis, where rotations and other continuous transformations naturally arise.

The example below shows a sequence of images generated along a continuous rotational orbit. LieDetect treats these images as samples from a structured geometric object and aims to recover the transformation responsible for their variation.

til

Equivariant neural networks

Many computer-vision models are designed to be equivariant to transformations such as image rotations. In practice, however, exact equivariance with respect to the full continuous group is often replaced by equivariance to a finite set of transformations. This discretization makes the models easier to implement and train, but it also raises an important practical question: how well does equivariance to a finite transformation subgroup approximate equivariance to arbitrary continuous transformations?

The notebooks/steerable_cnn.ipynb notebook investigates this question experimentally using steerable convolutional neural networks. We consider models constrained to be equivariant under the finite subgroup $R_n$ of $\mathrm{SO}(2)$, consisting of $n$ uniformly spaced planar rotations, and evaluate their behavior on rotations that are not necessarily contained in the training symmetry group.

The experiments provide a controlled workflow for:

  • training steerable CNNs with different levels of rotational discretization;
  • applying both in-group and out-of-group rotations to the input data;
  • comparing the model outputs before and after transformation;
  • measuring the resulting equivariance error;
  • studying how the approximation improves as the number $n$ of discrete rotations increases.

This analysis helps quantify when a finite-group equivariant architecture is sufficient for a computer-vision task and when a finer approximation of the underlying continuous symmetry may be required. The same methodology can also be used to compare different equivariant architectures, identify numerical or implementation-related symmetry violations, and validate whether a model preserves the geometric structure it was designed to exploit.

output

Physics

The notebooks/physics.ipynb notebook applies LieDetect to two classical-mechanics systems: the three-body problem and the multidimensional harmonic oscillator.Both systems generate high-dimensional trajectory data whose underlying structure is not always immediately visible from the raw coordinates. LieDetect treats sampled trajectories as geometric datasets and searches for continuous transformations that explain their evolution. The resulting symmetry generators provide a compact and interpretable description of the observed dynamics.

For the multidimensional harmonic oscillator, the experiments provide a controlled benchmark because the expected rotational structure is known analytically. The three-body problem, however, provides a substantially more challenging test case. In particular, we observed that, when embedded in the ambient Euclidean space, some Broucke periodic orbits are closely approximated by linear orbits of an $\mathrm{SO}(2)$ representation. To the best of our knowledge, this observation has not previously appeared in the literature. This suggests that apparently complex nonlinear trajectories may admit compact linear descriptions when represented in a suitable coordinate space.

The image below compares the numerical integration of one of the Broucke orbits with its approximation using LieDetect.

til

Chemistry

In notebooks/cyclooctane.ipynb, we apply LieDetect to molecular-conformation data from cyclooctane.

A molecule can generally adopt multiple spatial configurations while preserving its chemical connectivity. The collection of these configurations forms a high-dimensional conformation space, whose geometry and topology encode the molecule's feasible modes of deformation. Previous work has shown that the conformation space of cyclooctane has an unexpectedly rich structure: depending on the alignment convention, its components can be described topologically in terms of a sphere together with either a Klein bottle or a torus.

In the notebook, individual cyclooctane conformers are represented by their atomic coordinates and embedded in a high-dimensional Euclidean space. LieDetect then analyzes finite samples from the resulting dataset and searches for a linear representation of $\mathrm{SO}(2)$ whose orbits describe part of the observed conformational variation.

This example is particularly interesting from the perspective of symmetry discovery. Under the alignment convention that produces a torus, we observe that this component is linearly embedded in the dataset. The Klein-bottle component, by contrast, does not admit a transitive action of $T^2$, although it does support a non-transitive $\mathrm{SO}(2)$ action.

About

Algorithm for detection of Lie group representation orbits from point clouds

Topics

Resources

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages