Table of Contents
Fetching ...

DBSCAN in domains with periodic boundary conditions

Xander M. de Wit, Alessandro Gabbana

TL;DR

This work tackles clustering in spaces with periodic boundary conditions, where standard DBSCAN under open boundaries is insufficient. It introduces a periodic-extension approach that duplicates data by distance $\epsilon$ in each periodic direction, runs the conventional DBSCAN on the augmented dataset, and then links and resolves clusters across periodic copies. The method preserves compatibility with optimized neighbor-search algorithms and maintains the asymptotic $O(N\log N)$ runtime, and is implemented as a Python package built on scikit-learn. Validation on synthetic 1D/2D/3D data and a real turbulent-flow dataset demonstrates correct cluster recovery under periodic boundaries and practical applicability for physics-inspired datasets.

Abstract

Many scientific problems involve data that is embedded in a space with periodic boundary conditions. This can for instance be related to an inherent cyclic or rotational symmetry in the data or a spatially extended periodicity. When analyzing such data, well-tailored methods are needed to obtain efficient approaches that obey the periodic boundary conditions of the problem. In this work, we present a method for applying a clustering algorithm to data embedded in a periodic domain based on the DBSCAN algorithm, a widely used unsupervised machine learning method that identifies clusters in data. The proposed method internally leverages the conventional DBSCAN algorithm for domains with open boundaries, such that it remains compatible with all optimized implementations for neighborhood searches in open domains. In this way, it retains the same optimized runtime complexity of $O(N\log N)$. We demonstrate the workings of the proposed method using synthetic data in one, two and three dimensions and also apply it to a real-world example involving the clustering of bubbles in a turbulent flow. The proposed approach is implemented in a ready-to-use Python package that we make publicly available.

DBSCAN in domains with periodic boundary conditions

TL;DR

This work tackles clustering in spaces with periodic boundary conditions, where standard DBSCAN under open boundaries is insufficient. It introduces a periodic-extension approach that duplicates data by distance in each periodic direction, runs the conventional DBSCAN on the augmented dataset, and then links and resolves clusters across periodic copies. The method preserves compatibility with optimized neighbor-search algorithms and maintains the asymptotic runtime, and is implemented as a Python package built on scikit-learn. Validation on synthetic 1D/2D/3D data and a real turbulent-flow dataset demonstrates correct cluster recovery under periodic boundaries and practical applicability for physics-inspired datasets.

Abstract

Many scientific problems involve data that is embedded in a space with periodic boundary conditions. This can for instance be related to an inherent cyclic or rotational symmetry in the data or a spatially extended periodicity. When analyzing such data, well-tailored methods are needed to obtain efficient approaches that obey the periodic boundary conditions of the problem. In this work, we present a method for applying a clustering algorithm to data embedded in a periodic domain based on the DBSCAN algorithm, a widely used unsupervised machine learning method that identifies clusters in data. The proposed method internally leverages the conventional DBSCAN algorithm for domains with open boundaries, such that it remains compatible with all optimized implementations for neighborhood searches in open domains. In this way, it retains the same optimized runtime complexity of . We demonstrate the workings of the proposed method using synthetic data in one, two and three dimensions and also apply it to a real-world example involving the clustering of bubbles in a turbulent flow. The proposed approach is implemented in a ready-to-use Python package that we make publicly available.

Paper Structure

This paper contains 6 sections, 5 figures.

Figures (5)

  • Figure 1: Example of the different steps of the algorithm for DBSCAN with periodic boundary conditions: (a) original input dataset, (b) periodic extension by $\epsilon$ (step 1), (c) DBSCAN of the extended dataset (step 2), (d) final clustering after linking and resolving equivalent clusters (steps 3 & 4). This is a 2D example with periodicity $L$ and neighborhood $\epsilon = 0.06 L$.
  • Figure 2: 1D example of DBSCAN clustering with periodic boundary conditions with periodicity $L$ and neighborhood $\epsilon=0.05 L$. The example shows the raw data (a) and the clustering (b), where different colors represent different clusters, while black points indicate noise points that do not belong to a cluster.
  • Figure 3: 2D example of DBSCAN clustering with doubly periodic boundary conditions (a,b) and with singly periodic boundary conditions (c,d) where in the latter the left and right boundaries are periodic while the top and bottom boundaries are open. The periodicity is $L$ and neighborhood is $\epsilon = 0.08 L$. Panels and colors are as in Fig \ref{['fig:demo-1D']}.
  • Figure 4: 3D example of DBSCAN clustering with triply periodic boundary conditions with periodicity $L$ and neighborhood $\epsilon=0.08 L$. Panels and colors are as in Fig \ref{['fig:demo-1D']}.
  • Figure 5: Example of DBSCAN clustering on a real dataset of light particles in turbulence in a 3D triply periodic domain with periodicity $L$ and neighborhood $\epsilon = 0.009 L$. Light particles tend to cluster in high-vorticity regions of the flow in filamentary structures. Colors shows the six largest clusters of particles as identified by the algorithm. Other clusters are colored in gray for readability.