NeuralFLoC: Neural Flow-Based Joint Registration and Clustering of Functional Data
Abstract
Clustering functional data in the presence of phase variation is challenging, as temporal misalignment can obscure intrinsic shape differences and degrade clustering performance. Most existing approaches treat registration and clustering as separate tasks or rely on restrictive parametric assumptions. We present NeuralFLoC, a fully unsupervised, end-to-end deep learning framework for joint functional registration and clustering based on Neural ODE-driven diffeomorphic flows and spectral clustering. The proposed model learns smooth, invertible warping functions and cluster-specific templates simultaneously, effectively disentangling phase and amplitude variation. We establish universal approximation guarantees and asymptotic consistency for the proposed framework. Experiments on functional benchmarks show state-of-the-art performance in both registration and clustering, with robustness to missing data, irregular sampling, and noise, while maintaining scalability. Code is available at https://github.com/LastQuater/NeuralFLoC.
Lay Summary
Many real-world datasets are best viewed as continuous curves or trajectories over time, such as heartbeat recordings, financial trends, or motion paths. However, analyzing these curves is challenging because similar actions often happen at different speeds. If two people perform the exact same hand gesture, one might move faster at the start and slower at the end, confusing standard machine learning algorithms into grouping them incorrectly based on timing rather than their actual shape. To solve this, we developed NeuralFLoC, an all-in-one deep learning framework that simultaneously corrects the timing of curves and groups them into their true categories. Instead of relying on rigid assumptions, NeuralFLoC uses continuous fluid-like mathematical flows to smoothly stretch or compress time without distorting its chronological order. It creates custom templates for each category to align the trajectories perfectly before sorting them. We mathematically prove that our framework remains stable and reliable as datasets grow. In experiments on benchmark tasks like handwriting and movement recognition, NeuralFLoC dramatically outperforms traditional methods, showing high resilience against random noise or missing data while scaling effortlessly to massive systems.