/MinibatchKmeans-vs-Kmeans

In this notebook, I compared two famous clustering algorithm, the minibatchkmeans and the regular kmeans on cellular image dataset.

Primary LanguageJupyter Notebook

MinibatchKmeans-vs-Kmeans

In this notebook, I compared two famous clustering algorithm, the minibatchkmeans and the regular kmeans on image dataset.

The data

First of all, we need to download the image data used in this comparison.

For the smal dataset: https://drive.google.com/drive/folders/1YHGUbFLp_5HiRISBzRo3GmnM4OQpAO0T?usp=sharing

For the big dataset: https://drive.google.com/drive/folders/1YHGUbFLp_5HiRISBzRo3GmnM4OQpAO0T?usp=sharing

The data is constitued of 4 types of white cells. Capture d’écran 2021-10-23 à 3 56 47 PM

The comparison

Because minibatch-kmeans aims to reduce memory constraint and decrease the cpu time, we'll compare both of the clustering algorithms on time execution. We'll also investigate the effect of minibatch-kmans parameters such as batch size and eventually the number of clusters. Capture d’écran 2021-10-23 à 3 59 25 PM

Because silhouette score weren't good, we wanted to visualize the data in a factorial plane using Linear Discriminative Analysis. Because we had the label of each class, we applied the discriminative algorithm to have less dimension to deal with, and to investigate the impact of the input space on both Kmeans and MiniBatchKmeans. Capture d’écran 2021-10-23 à 4 01 32 PM

Finally, we compare both algorithms based on the silhouette score and investigate the performance. Capture d’écran 2021-10-23 à 4 02 54 PM

We ended up with approximately the same results, and we can say with confidence, that minibatch-kmeans is appropriate for both small and big dataset, especially with images, where It performs > 50 times faster than Kmeans. Capture d’écran 2021-10-23 à 4 04 33 PM