In standard machine learning, we almost always assume that data lives in a flat, Euclidean space. We freely add vectors, multiply them by scalars, and calculate straight-line distances. However, many powerful real-world data representations do not obey these rules.
Consider a covariance matrix capturing the interactions between brain signals, or a diffusion tensor representing tissue fibers in medical imaging. These objects are Symmetric Positive Definite (SPD) matrices. If you perform standard linear arithmetic on them—such as subtracting one matrix from another during a gradient descent step—you can easily end up with a matrix that has negative eigenvalues. This is a mathematically and physically invalid state; a negative variance or a negative diffusion coefficient makes no sense.
To solve this, a growing body of research replaces flat-space assumptions with Riemannian geometry. Instead of treating data as points in a flat vector space, this paradigm treats them as points constrained to a curved mathematical surface, or a Riemannian manifold.
The Flaw of Flat-Space Assumptions
Why exactly does Euclidean math fail on curved surfaces? The core issue is that the shortest path between two points on a manifold is not a straight line through space, but a curved path along the surface called a geodesic.
As Ho et al. point out, Riemannian manifolds lack a global linear structure. Because points cannot be simply added or scaled while remaining on the manifold, traditional signal processing and dictionary learning techniques break down. Forcing manifold-valued data into Euclidean models leads to severe distortions. For instance, in neuroimaging, Kim et al. demonstrate that standard linear regression can produce non-positive definite matrices, yielding physically impossible results when modeling brain diffusion tensors.
Euclidean Space (Flat) Riemannian Manifold (Curved)
A ----------- B A _ _ _ B
\ / \ / (Geodesic path
\ / \ / along surface)
\ / \ /
Mean Mean (Karcher Mean)
Even when linear operations do not produce invalid states, they distort distances. When comparing two network states in brain imaging, Benisty et al. note that treating correlation matrices as flat data points leads to inaccurate measurements of similarity. This geometric mismatch limits performance in tasks ranging from pedestrian detection (Tuzel et al.) to brain-computer interfacing (Sabbagh et al.).
Geometry to the Rescue: Tangent Spaces and Geodesics
To build algorithms that respect the data's true geometry, researchers rely on two primary strategies: mapping data to a local flat space, or redefining calculus directly on the manifold.
1. Tangent Space Mapping
At any given point on a manifold, we can construct a flat, linear space that is tangent to the surface, much like a flat sheet of paper touching a globe at the equator. Using the Logarithmic map, we can project points from the curved manifold onto this flat tangent space. Once the data is "flattened," we can safely apply standard linear machine learning tools.
For example, Wu et al. used this technique to map EEG covariance matrices onto a Euclidean tangent space, allowing standard regression models to accurately estimate user reaction times without violating the signal's geometric constraints.
2. Intrinsic Riemannian Metrics
Instead of flattening the space, we can change how we measure distances directly on the curve. Metrics like the affine-invariant Riemannian metric or the Log-Euclidean metric calculate distances along geodesics. As Quang et al. and Cherian et al. demonstrate, using these intrinsic metrics ensures that distance measurements reflect the true underlying structure of SPD matrices, preserving discriminative information that flat metrics erase.
This geometric perspective also redefines how we calculate averages. The standard arithmetic mean fails on a manifold. Instead, we use the Karcher mean (or Riemannian barycenter), which is the point on the manifold that minimizes the sum of squared geodesic distances to all data points. As explored by Wang et al. and Eftekhari, computing the Karcher mean is essential for tracking data streams or averaging geometric objects without introducing statistical bias.
Building Manifold-Aware Neural Networks
While classical machine learning can adapt via tangent space mapping, deep learning presents a harder challenge. Standard neural network operations—such as fully connected layers ($Wx + b$) and ReLU activations—rely entirely on Euclidean calculus. As Jia et al. and Nguyen observe, applying these traditional transformations directly to manifold data destroys its structural properties, such as positive definiteness.
To solve this, researchers have designed specialized neural network layers that operate entirely within the geometry of the manifold.
Manifold-Preserving Layers
The seminal SPDNet architecture, introduced by Van Gool et al., replaces standard linear layers with bilinear transformations ($X_{new} = W^T X W$) that guarantee the output matrix remains symmetric and positive definite. They also introduced a non-linear activation function that applies a threshold to the eigenvalues of the matrix, mimicking a ReLU without leaving the manifold. Similarly, Zhang et al. developed deep networks capable of transforming data between different Riemannian manifolds while preserving spatio-temporal properties.
Riemannian Batch Normalization
In standard deep learning, batch normalization centers data by subtracting the arithmetic mean and dividing by the variance. On a curved surface, subtraction is meaningless. Brooks et al. redesigned this layer by calculating the Karcher mean of a batch and using parallel transport to shift the data points along the manifold's geodesics to a common center.
Manifold Normalization via Parallel Transport:
Points on Manifold Compute Karcher Mean Transport to Center
o o o o . .
o o ======> X (Mean) ======> . X .
o o o o . .
This parallel transport mechanism acts as a geometric alignment tool. For instance, Yair leveraged analytic expressions for parallel transport to align covariance data across different subjects in brain-computer interfaces, effectively performing domain adaptation by sliding data along the curved cone of SPD matrices.
Expanding to Generative and Robust Models
The shift from flat to curved geometry has expanded beyond classification and regression into generative modeling and robust statistics.
- Generative Modeling: Recent breakthroughs have extended probabilistic models to curved spaces. Li et al. introduced SPD-DDPM, adapting denoising diffusion probabilistic models to generate high-fidelity SPD matrices for brain activity and traffic flows. Following this, Cheng et al. developed the Riemannian Consistency Model, enabling fast, single-step generative modeling on curved surfaces like spheres and rotation groups.
- Robust Statistics: Real-world data is often corrupted by noise or outliers. Because straight-line errors do not make sense on a curve, Zhang et al. modeled gross errors as explicit geodesic offsets, creating robust multivariate regression models. For streaming data, Wang et al. combined Karcher means with robust M-estimators to detect sudden change-points in non-linear data streams without being swayed by anomalies.
By treating curvature as an intrinsic property of the data rather than an obstacle to be flattened, Riemannian machine learning provides a mathematically rigorous framework that preserves the physical constraints, distances, and structural invariants of complex real-world systems.