Skip to main content
Log in

Modified balanced iterative reducing and clustering using hierarchies (m-BIRCH) for visual clustering

  • Theoretical Advances
  • Published:
Pattern Analysis and Applications Aims and scope Submit manuscript

Abstract

In modern visual clustering applications where datasets are large and updates with new data may be ongoing, methods of online clustering are extremely important. Online clustering algorithms incrementally cluster the data points, use a fraction of the dataset memory, and update the clustering decisions when new data comes in. In this paper we adapt a classic online clustering algorithm called balanced iterative reducing and clustering using hierarchies (BIRCH) to incrementally cluster large datasets of features commonly used in visual clustering, e.g., 840 K color SIFT descriptors, 1.09 million color patches, 60 K outlier corrupted grayscale patches, and 700 K grayscale SIFT descriptors. We use the algorithm to cluster datasets consisting of non-convex clusters, e.g., Hopkins 155 3D motion segmentation dataset. We call the adapted version modified-BIRCH (m-BIRCH). BIRCH was originally developed by the database management community, but has not been used in computer vision. Modifications made in m-BIRCH enable data-driven parameter selection and effectively handle varying density regions in the feature space. Data-driven parameter selection automatically controls the level of coarseness of the data summarization. Effective handling of varying density regions is necessary to well represent the different density regions in the data summarization. Our implementation of the algorithm provides a useful clustering tool and is made publicly available.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12

Similar content being viewed by others

Notes

  1. link will be available upon publication.

References

  1. Awwad B, Hasan S, Gan, JQ (2009) Sequential em for unsupervised adaptive gaussian mixture model based classifier. In: Machine learning and data mining in pattern recognition pp 96–106

  2. Barker J, Davis J (2014) Temporally-dependent dirichlet process mixtures for egocentric video segmentation. In: IEEE conference on computer vision and pattern recognition workshops pp 557–564

  3. Bishop CM (2006) Pattern recognition and machine learning, vol 4, No. 4. Springer, New York, Berlin

  4. Blei D, Jordan M (2006) Variational inference for dirichlet process mixtures. Bayesian Anal 1(1):121–144

    Article  MathSciNet  MATH  Google Scholar 

  5. Bosch A, Zisserman A, Muñoz X (2008) Scene classification using a hybrid generative/discriminative approach. IEEE Trans Pattern Anal Mach Intell 30(4):712–727

    Article  Google Scholar 

  6. Burbeck K, Nadjm-Tehrani S (2005) ADWICE-anomaly detection with real-time incremental clustering. In: Information security and cryptology–ICISC 2004. Springer Berlin Heidelberg, pp 407–424

  7. Callaghan LO, Erson NMAM, Guha S, Motwani R (2002) Streaming data algorithms for high quality clustering. In: 18th international conference on data engineering pp 685–695

  8. Cherian A, Morellas V, Papanikolopoulos N, Bedros S (2001) Dirichlet process mixture models on symmetric positive definite matrices for appearance clustering in video surveillance applications. In: IEEE conference on computer vision and pattern recognition pp 3417–3424

  9. Chum O, Phiblin J, Sivic J, Isard M, Zisserman A (2007) Total recall: automatic query expansion with a generative feature model for object retrieval. In: international conference on computer vision pp 1–8

  10. Gomes R, Welling M, Perona P (2008) Incremental learning of nonparametric bayesian mixture models. In: IEEE conference on computer vision and pattern recognition pp 1–8

  11. Hastie T, Tibshirani R, Friedman J, Hastie T, Friedman J, Tibshirani R (2009) The elements of statistical learning, vol 2 No. 1. Springer, New York, Berlin

  12. Jegou H, Douze M, Schmid C (2008) Hamming embedding and weak geometric consistency for large scale image search. In: European conference on computer vision pp 304–317

  13. Jégou H, Perronnin F, Douze M, Sánchez J, Pérez P, Schmid C (2012) Aggregating local image descriptors into compact codes. IEEE Trans Pattern Anal Mach Intell 34(9):1704–1716

    Article  Google Scholar 

  14. Jurie, F, Triggs B (2005) Creating efficient codebooks for visual recognition. In: International conference on computer vision pp 604–610

  15. Kang IS, wan Kim T, Li KJ (1997) A spatial data mining method by delaunay triangulation. In: 5th ACM international workshop on advances in geographic information systems pp 35–39

  16. Kurihara K, Welling M, Vlassis N (2006) Accelerated variational dirichlet process mixtures. Adv Neural Information Process Syst pp 761–768

  17. Lauer F, Schnorr C (2009) Spectral clustering of linear subspaces for motion segmentation. In: International conference on computer vision pp 678–685

  18. LeCun Y, Cortes C (1998) The mnist database of handwritten digits. http://yann.lecun.com/exdb/mnist

  19. Lee J, Kwak S, Han B, Choi S (2012) Online video segmentation by bayesian split-merge clustering. In: European conference on computer vision pp 856–869

  20. Liu G, Lin Z, Yan S, Sun J, Yu Y, Ma Y (2013) Robust recovery of subspace structures by low rank representation. IEEE Trans Pattern Anal Mach Intell 35(1):171–184

    Article  Google Scholar 

  21. Lowe D (2004) Distinctive image features from scale-invariant keypoints. Int J Comput Vis 60(2):91–110

    Article  Google Scholar 

  22. Lu C, Tang J, Lin M, Lin L, Yan S, Lin Z (2013) Correntropy induced l2 graph for robust subspace clustering. In: International conference on computer vision pp 1801–1808

  23. Lu CY, Min H, Zhao ZQ, Zhu L, Huang DS, Yan S (2012) Robust and efficient subspace segmentation via least squares regression. In: European conference on computer vision pp 347–360

  24. Mairal J, Bach F, Ponce J, Sapiro G (2005) Online detection of unusual events in videos via dynamic sparse coding. In: International conference on computer vision pp 604–610

  25. Mairal J, Bach F, Ponce J, Sapiro G (2005) Online dictionary learning for sparse coding. In: International conference on computer vision pp 604–610

  26. Mairal J, Bach F, Ponce J, Sapiro G (2009) Online dictionary learning for sparse coding. In: International conference on machine learning pp 689–696

  27. Mikolajczyk K, Schmid C (2004) Scale and affine invariant interest point detectors. Int J Comput Vis 60(2):91–110

    Article  Google Scholar 

  28. Moon TK (1996) The expectation-maximization algorithm. IEEE Signal Process Mag 13(6):47–60

    Article  Google Scholar 

  29. Ng AY, Jordan MI, Weiss Y (2011) On spectral clustering: analysis and an algorithm. In: Advances in neural information processing systems pp 849–856

  30. Nister D, Stewenius H (2006) Scalable recognition with a vocabulary tree. In: IEEE conference on computer vision and pattern recognition pp 2161–2168

  31. Oliva A, Torralba A (2001) Modeling the shape of the scene: a holistic representation of the spatial envelope. Int J Comput Vis 42(3):145–175

    Article  MATH  Google Scholar 

  32. Philbin J, Chum O, Isard M, Sivic J, Zisserman A (2007) Object retrieval with large vocabularies and fast spatial matchine. In: IEEE conference on computer vision and pattern recognition pp 1–8

  33. Philbin J, Chum O, Isard M, Sivic J, Zisserman A (2007) Object retrieval with large vocabularies and fast spatial matching. In: IEEE conference on computer vision and pattern recognition pp 1–8

  34. Tafaj E, Kasneci G, Rosenstiel W, Bogdan M (2012) Bayesian online clustering of eye movement data. In: Symposium on eye tracking research and applications pp 285–288

  35. Tron R, Vidal R (2007) A benchmark for the comparison of 3-d motion segmentation algorithms. In: IEEE conference on computer vision and pattern recognition pp 1–8

  36. Turcot P, Lowe D (2009) Better matching with fewer features: the selection of useful features in large database recognition problems. In: ICCV workshop on emergent issues in large amounts of visual data pp 2109–2116

  37. Wang C, Blei D, Li FF (2009) Simultaneous image classification and annotation. In: IEEE conference on computer vision and pattern recognition pp 1903–1910

  38. Wu J, Rehg JM (2011) Centrist: A visual descriptor for scene categorization. IEEE Trans Pattern Anal Mach Intell 33(8):1489–1501

    Article  Google Scholar 

  39. Yan J, Pollefeys M (2006) A general framework for motion segmentation: Independent, articulated, rigid, non-rigid, degenerate, and non-degenerate. In: European conference on computer vision pp 94–106

  40. Yu Y, Wang Q, Wang X, Wang H, He J (2013) Online clustering for trajectory data stream of moving objects. In: Computer science and information systems pp 1293–1317

  41. Zhang T, Ramakrishnan R, Leivny M (1996) Birch: an efficient data clustering method for very large databases. In: ACM SIGMOD international conference on management of data vol 25, pp 103–1OA14

  42. Zhang T, Ramakrishnan R, Leivny M (1997) Birch: a new data clustering algorithm and its applications. Data Min Knowl Discov 1(2):141–182

    Article  Google Scholar 

  43. Zhou B, Wang X, Tang X (2012) Understanding collective crowd behaviors: Learning a mixture model of dynamic pedestrian-agents. In: IEEE conference on computer vision and pattern recognition pp 2871–2878

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Siddharth Madan.

Appendices

Insertion

Suppose we want to insert a new clustering-feature, \({\mathbf {CF}}_{\text{in}}\), in the CF-tree. In any node, \({\text{node}}_{i}\), of the tree the sum of all the clustering-features, \({\mathbf {CF}}_{\text{node}_{i}}=\sum _{j}{\mathbf {CF}}_{j}\), represents the set \(\bigcup _{j}S_{j}\), where \(S_{j}\) is the set of points represented by the clustering-feature \({\mathbf {CF}}_{j}\). \({\mathbf {CF}}_{\text{node}_{i}}\) is stored in the parent node. We call \({\text{node}}_{i}\) the child of \({\mathbf {CF}}_{\text{node}_{i}}\). The parent node is linked to the child node of each clustering-feature stored in it.

In order to insert \({\mathbf {CF}}_{\text{in}}\) we find the closest leaf node by traversing the tree starting at the root node; at each level we proceed to the child node of the closest clustering-feature. We step through the leaf node to check if \({\mathbf {CF}}_{\text{in}}\) can be absorbed in any clustering-feature without violating the threshold condition. \({\mathbf {CF}}_{\text{in}}\) can be absorbed in a leaf clustering-feature only if the size of the resulting clustering-feature is less than threshold T. If \({\mathbf {CF}}_{\text{in}}\) cannot be absorbed, we check whether the leaf has less than \(B\) clustering-features. If the leaf node has less than \(B\) clustering-features, then \({\mathbf {CF}}_{\text{in}}\) can be accommodated and stored in the leaf node. In the event of a successful absorption or accommodation, \({\mathbf {CF}}_{\text{in}}\) is added to each clustering-feature which was determined to be the closest when the tree was traversed from the root to the leaf node.

Figure 13 illustrates the tree insertion process, when \({\mathbf {CF}}_{\text{in}}\) is successfully absorbed in a leaf clustering-feature. Figure 13a shows the CF-tree before \({\mathbf {CF}}_{\text{in}}\) is inserted. The dotted arrows show the path taken when the tree was traversed from root to the leaf node. Figure 13b shows CF-tree after \({\mathbf {CF}}_{\text{in}}\) is inserted.

Fig. 13
figure 13

a, b CF-tree before and after \({\mathbf {CF}}_{\text{in}}\) is inserted. \({\mathbf {CF}}_{\text{in}}\) gets absorbed by \({\mathbf {CF}}_{8}\). The gray rectangles denote sub-trees, which are not encountered while inserting \({\mathbf {CF}}_{\text{in}}\). The dotted arrows in (a) indicate the path taken during insertion of \({\mathbf {CF}}_{\text{in}}\) to reach the leaf node

Successful absorption of \({\mathbf {CF}}_{\text{in}}\) does not result in increase of memory used by the CF-tree. Successful accommodation of \({\mathbf {CF}}_{\text{in}}\) does result in an increase of memory used by the CF-tree. Node split occurs when \({\mathbf {CF}}_{\text{in}}\) can neither be absorbed nor accommodated in the leaf node. Node split results in the generation of two new nodes, \({\text{node}}A\) and \({\text{node}}B\). Clustering-features of the original leaf node and \({\mathbf {CF}}_{\text{in}}\) are distributed between the two new nodes. The furthest pair of clustering-features are found; one clustering-feature of the pair is stored in \({\text{node}}A\) and the other in \({\text{node}}B\). Remaining clustering-features are distributed depending on the distance between the clustering-feature and the current clustering-feature representation of \({\text{node}}A\) and \({\text{node}}B\). Figure 14 illustrates the distribution of clustering-features when a node split takes place.

Fig. 14
figure 14

a Original leaf node. b, c \({\text{node}}A\) and \({\text{node}}B\) generated after the split, with clustering-features distributed between them

Figure 14a shows the original tree node, and Fig. 14b, c show \({\text{node}}A\) and \({\text{node}}B\) generated after the split. The \(NULL\) in Fig. 14b and c indicates no clustering-feature is present. Suppose \({\mathbf {CF}}_{1}\) and \({\mathbf {CF}}_{2}\) are the furthest pair; thus \({\mathbf {CF}}_{1}\) is stored in \({\text{node}}A\) and \({\mathbf {CF}}_{2}\) is stored in \({\text{node}}B\). \({\mathbf {CF}}_{3}\) is closer to \({\mathbf {CF}}_{1}\) than to \({\mathbf {CF}}_{2}\); thus \({\mathbf {CF}}_{3}\) is stored in \({\text{node}}A\). \({\mathbf {CF}}_{\text{in}}\) is closer to \({\mathbf {CF}}_{2}\) than to \({\mathbf {CF}}_{1}+{\mathbf {CF}}_{3}\); thus \({\mathbf {CF}}_{1}\) is stored in \({\text{node}}B\). Once the clustering-features are distributed \({\text{node}}A\) replaces the original leaf node in the CF-tree, and the information along the path traversed to reach the leaf node is updated. Let \({\mathbf {CF}}_{\text{node}B}\) be the sum of all the clustering-features in \({\text{node}}B\). We attempt to accommodate \({\mathbf {CF}}_{\text{node}B}\) in the parent of the original leaf node. If \({\mathbf {CF}}_{\text{node}B}\) is successfully accommodated, then parent node is linked to \({\text{node}}B\), and information in the CF-tree is updated. If \({\mathbf {CF}}_{\text{node}B}\) cannot be accommodated in the parent node, then the parent node itself is split and the procedure is repeated. If the split propagates to the root and the root is split, then the tree height increases by one.

Rebuild

Suppose in the current tree, the leaf nodes are numbered from left to right starting with one, and the \(i{\text{th}}\) leaf node in the original tree is denoted as \({\text{node}}_{i}\). Clustering-features of \({\text{node}}_{1}\) are inserted in the new tree by creating a path from root to leaf node identical to the path in the current tree. The first clustering-feature of \({\text{node}}_{1}\) is stored in exactly the same location as in the original tree. Remaining clustering-features in \({\text{node}}_{1}\) are stored in the leaf node of the new tree containing the first clustering-feature of \({\text{node}}_{1}\); at this point the new tree has only one leaf node. We step through the leaf node to check if the clustering-feature can be absorbed in any of the clustering-features currently stored, without the size of the resulting clustering-feature becoming greater than \(T+ \Delta T\). If the absorption is unsuccessful, the clustering-feature is accommodated in the leaf node of the new tree.

Nodes in the current tree are deleted, when they are no longer required for the insertion of the remaining clustering-features. During the rebuild procedure at any point there are at most only \(h\) extra nodes compared to the total number of nodes in the current tree, where \(h\) is the height of the current tree.

Figure 15 illustrates the tree rebuild procedure.

Fig. 15
figure 15

a Current CF-tree at the beginning of the rebuild procedure. b Insertion of the first clustering-feature of \({\text{node}}_{1}\). c Insertion of remaining clustering-features of \({\text{node}}_{1}\). df Insertion of clustering-features of \({\text{node}}_{2}\)

Figure 15a shows the current CF-tree, at the beginning of the rebuild procedure. Figure 15b shows the insertion for the first clustering-feature of \({\text{node}}_{1}\) in the new tree and Fig. 15c shows the insertion of remaining clustering-features of \({\text{node}}_{1}\). Figure 15d–f show the insertion of the clustering-features of \({\text{node}}_{2}\). We find the closest leaf node to \({\mathbf {CF}}_{4}\) by traversing the tree shown in Fig. 15c. Figure 15d shows that \({\mathbf {CF}}_{4}\) could be absorbed by a clustering-feature in the closest leaf node. We find the closest leaf node to \({\mathbf {CF}}_{5}\) by traversing the tree shown in Fig. 15d. \({\mathbf {CF}}_{5}\) could not be absorbed in any clustering-feature stored in the closest leaf node. We accommodated \({\mathbf {CF}}_{5}\) in a new leaf node as shown in Fig. 15e; note that the path of the new leaf node is exactly same as the path of \({\text{node}}_{2}\) in the original tree. Figure 15f shows that the closest leaf node to \({\mathbf {CF}}_{6}\) in the new tree is the second leaf node. \({\mathbf {CF}}_{6}\) was successfully absorbed by a clustering-feature in the closest leaf node. Remaining clustering-features are inserted in a similar way.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Madan, S., Dana, K.J. Modified balanced iterative reducing and clustering using hierarchies (m-BIRCH) for visual clustering. Pattern Anal Applic 19, 1023–1040 (2016). https://doi.org/10.1007/s10044-015-0472-4

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10044-015-0472-4

Keywords

Navigation