Finalized:Monday, December 5, 2016
Author(s):Oloso, A., K. S. Kuo, T. Clune, P. Brown, A. Poliakov and H. Yu
We have implemented a flexible User Defined Operator (UDO) for labeling connected components of a binary mask expressed as an array in SciDB, a parallel distributed database management system based on the array data model. This UDO is able to process very large multidimensional arrays by exploiting SciDB's memory management mechanism that efficiently manipulates arrays whose memory requirements far exceed available physical memory. The UDO takes as primary inputs a binary mask array and a binary stencil array that specifies the connectivity of a given cell to its neighbors. The UDO returns an array of the same shape as the input mask array with each foreground cell containing the label of the component it belongs to. By default, dimensions are treated as non-periodic, but the UDO also accepts optional input parameters to specify periodicity in any of the array dimensions. The UDO requires four stages to completely label connected components. In the first stage, labels are computed for each subarray or chunk of the mask array in parallel across SciDB instances using the weighted quick union (WQU) with half-path compression algorithm. In the second stage, labels around chunk boundaries from the first stage are stored in a temporary SciDB array that is then replicated across all SciDB instances. Equivalences are resolved by again applying the WQU algorithm to these boundary labels. In the third stage, relabeling is done for each chunk using the resolved equivalences. In the fourth stage, the resolved labels, which so far are “flattened” coordinates of the original binary mask array, are renamed with sequential integers for legibility. The UDO is demonstrated on a 3-D mask of 0(10n) elements, with 0(108) foreground cells and o(106) connected components. The operator completes in 19 minutes using 84 SciDB instances.
A. Oloso, K. S. Kuo, T. Clune, P. Brown, A. Poliakov and H. Yu, "Implementing connected component labeling as a user defined operator for SciDB," 2016 IEEE International Conference on Big Data (Big Data), Washington, DC, 2016, pp. 2948-2952. doi: 10.1109/BigData.2016.7840945This material is based upon work supported by the National Science Foundation under Grant No. 1541043. Opinions, findings, conclusions or recommendations expressed are those of the authors and do not reflect the views of the NSF.