Space Breakdown Method (SBM) is a clustering algorithm that can be used to cluster low-dimensional neural data with efficiency, due to its linear complexity scaling with the data size. SBM has been published by IEEE in September 2019:
- https://ieeexplore.ieee.org/document/8959795
- DOI: 10.1109/ICCP48234.2019.8959795
- Conference: 2019 IEEE 15th International Conference on Intelligent Computer Communication and Processing (ICCP)
pip install space-breakdown-method
Usage example:
import matplotlib.pyplot as plt
from sklearn import datasets
from load_data import load_atoms_synthetic_data
from sbm import SBM
from sbm import ISBM
from sbm import TFBM
from sbm import scatter_plot as sp
data, y = datasets.make_blobs(n_samples=1000, n_features=2, cluster_std=[1.0, 2.5, 0.5], random_state=170)
pn = 15
sbm = SBM(data, pn, threshold=5)
sbm.fit()
sp.plot('GT' + str(len(data)), data, y, marker='o')
sp.plot_grid('SBM(PN=10) on Sim4', data, pn, sbm.labels, marker='o', adaptivePN=False)
plt.show()
pn = 15
isbm = ISBM(data, pn, threshold=5, adaptive=True)
isbm.fit()
sp.plot('GT' + str(len(data)), data, y, marker='o')
sp.plot_grid('ISBM(PN=25) on Sim4', data, pn, isbm.labels, marker='o', adaptivePN=True)
plt.show()
data, spectrumData = load_atoms_synthetic_data()
tfbm = TFBM(data.T, threshold="auto", merge=True, aspect_ratio=1, merge_factor=15)
tfbm.fit(verbose=True, timer=True)
tfbm.plot_result("TFBM", data, tfbm.merged_labels_data.T, tfbm.packet_infos)
Overlapping clusters and different density clusters are recurrent phenomena of neuronal datasets, because of how neurons fire. We propose a clustering method that is able to identify clusters of arbitrary shapes, having different densities, and potentially overlapped. The Space Breakdown Method (SBM) divides the space into chunks of equal sizes. Based on the number of points inside the chunk, cluster centers are found and expanded. Even if we consider the particularities of neuronal data in designing the algorithm – not all data points need to be clustered, and the data space has a relatively low dimensionality – it can be applied successfully to other domains involving overlapping and different density clusters as well. The experiments performed on benchmark synthetic data show that the proposed approach has similar or better results than two well-known clustering algorithms.
SBM results in comparison with K-Means and DBSCAN:
- on a real dataset
- on a simulated dataset (from the Department of Engineering, University of Leicester UK)
The code folder structure:
- main.py : main file to run the code from
- requirements.txt : python libraries that are needed in order to run the code
- images: images that will be used for this readme
- algorithms : folder that contains the actual SBM and ISBM code
- dataset parsing: scripts for parsing different datasets
- common/validation/visualization: utilitary functions
The 'requirements.txt' file indicates the dependencies required for running the code. The data used in this study can be downloaded from: https://1drv.ms/u/s!AgNd2yQs3Ad0gSjeHumstkCYNcAk?e=QfGIJO. The simulated data has been created by the Department of Engineering, University of Leicester UK.
The paths to the data folder on your local workstation need to be set from the 'constants.py' file (DATA_FOLDER_PATH, SIM_DATA_FOLDER_PATH, REAL_DATA_FOLDER_PATH).
The Improved Space Breakdown Method (ISBM) has been published in Frontiers in Computational Neuroscience: https://www.frontiersin.org/articles/10.3389/fncom.2023.1019637/full
The algorithm has been improved since its publishing by modifying the underlying data structure from an ndarray to a graph. The following image show the improvement of a simple example from 25 cells in the ndarray to only 22 nodes in the graph.
Another improvement, added later to the algorithm is an adaptive Partitioning Number, influenced by the variance of each feature. This shall improve the complexity of the algorithm a bit and will allow the use of the algorithm on datasets of higher dimensions.
The Time-Frequency Breakdown Method (TFBM) has been published in Frontiers in Human Neuroscience: https://www.frontiersin.org/articles/10.3389/fnhum.2023.1112415/full
TFBM is a method, based on SBM, developed for the detection of brain oscillations in time-frequency representations (such as spectrograms obtained from the Fourier Transform).
We would appreciate it, if you cite the paper when you use this work for the original SBM algorithm:
- For Plain Text:
E. Ardelean, A. Stanciu, M. Dinsoreanu, R. Potolea, C. Lemnaru and V. V. Moca, "Space Breakdown Method A new approach for density-based clustering," 2019 IEEE 15th International Conference on Intelligent Computer Communication and Processing (ICCP), 2019, pp. 419-425, doi: 10.1109/ICCP48234.2019.8959795.
- BibTex:
@INPROCEEDINGS{8959795,
author={Ardelean, Eugen-Richard and Stanciu, Alexander and Dinsoreanu, Mihaela and Potolea, Rodica and Lemnaru, Camelia and Moca, Vasile Vlad},
booktitle={2019 IEEE 15th International Conference on Intelligent Computer Communication and Processing (ICCP)},
title={Space Breakdown Method A new approach for density-based clustering},
year={2019},
volume={},
number={},
pages={419-425},
doi={10.1109/ICCP48234.2019.8959795}}
We would appreciate it, if you cite the paper when you use this work for the ISBM (improved SBM) algorithm:
- For Plain Text:
E.-R. Ardelean, A.-M. Ichim, M. Dînşoreanu, and R. C. Mureşan, “Improved space breakdown method – A robust clustering technique for spike sorting,” Frontiers in Computational Neuroscience, vol. 17, 2023, doi: 10.3389/fncom.2023.1019637.
- BibTex:
@ARTICLE{10.3389/fncom.2023.1019637,
AUTHOR={Ardelean, Eugen-Richard and Ichim, Ana-Maria and Dînşoreanu, Mihaela and Mureşan, Raul Cristian},
TITLE={Improved space breakdown method – A robust clustering technique for spike sorting},
JOURNAL={Frontiers in Computational Neuroscience},
VOLUME={17},
YEAR={2023},
URL={https://www.frontiersin.org/articles/10.3389/fncom.2023.1019637},
DOI={10.3389/fncom.2023.1019637}
}
We would appreciate it, if you cite the paper when you use this work for the TFBM algorithm:
- For Plain Text:
E.-R. Ardelean, H. Bârzan, A.-M. Ichim, R. C. Mureşan, and V. V. Moca, “Sharp detection of oscillation packets in rich time-frequency representations of neural signals,” Frontiers in Human Neuroscience, vol. 17, 2023, doi: 10.3389/fnhum.2023.1112415.
- BibTex:
@ARTICLE{10.3389/fnhum.2023.1112415,
AUTHOR={Ardelean, Eugen-Richard and Bârzan, Harald and Ichim, Ana-Maria and Mureşan, Raul Cristian and Moca, Vasile Vlad},
TITLE={Sharp detection of oscillation packets in rich time-frequency representations of neural signals},
JOURNAL={Frontiers in Human Neuroscience},
VOLUME={17},
YEAR={2023},
URL={https://www.frontiersin.org/articles/10.3389/fnhum.2023.1112415},
DOI={10.3389/fnhum.2023.1112415}
}
If you have any questions about SBM, feel free to contact me. (Email: ardeleaneugenrichard@gmail.com)