# NICE: Superpixel Segmentation Using Non-Iterative Clustering with Efficiency
## 3 Non-Iterative Clustering with Efficiency
### NICE Superpixel Segmentation Framework  
A primary insight of the proposed NICE is to improve the efficiency of priority queue in dynamic processes, which can be generalized in two aspects. Firstly, a large number of repetitions during the inspection process is avoided by EIR. It introduces inter-pixel correlation as a local smooth cue to determine the priority for pixels with same digital values. Since the feature distance \(Q(I_{i})\) for sorting is no longer updated by other frontier pixels, the ultimate label of a neighboring element \(I_{i}\) is actually identified. Therefore, the assignment is just a matter of order. In addition, the non-iterative clustering framework is modified by AIR. It adopts an LIFO stack to the head of the priority queue and processes pixels in batch, thus meaningless enqueueing and dequeuing are reduced.  
In practice, when \(\sigma\) is appropriate, early identified neighboring elements by EIR could promote AIR more outstanding. For example in Figure 6, if the relationship of 25 th and 24 th satisfies Equation (4) around 5 th, there would be continuous queueing during this period, without sorting 25 th twice. As a result, the combination of the above two strategies could significantly accelerate the non-iterative clustering framework. Moreover, the problem that digital value identical pixels are labeled differently by cluster updating and shape constraint is effectively alleviated, which achieves a desirable trade-off between runtime and accuracy. The integrated NICE superpixel segmentation framework is summarized in Algorithm 1.  
```
Input: the Lab image \(I\), the expected number \(K\), the default normalization factor \(\lambda=10\) Output: the label map of \(I\) /* Initialization */  initialize cluster centers and assign starting labels similar to conventional SNIC.  initialize a priority queue \(Q\) with increasing order, and a LIFO stack \(S\). /* Joint assignment and updating */ for each cluster center \(S_{k}\)do  create a vector node \([E(S_{k}),\,k,\,0]\).  push the node on \(Q\). endfor while\(Q\) is not empty do while\(S\) is not empty do  pop the top-most node \([E(I_{m}),\,k,\,Q(I_{m})]\) corresponding to \(I_{m}\) from \(S\). goto AIR endwhile  pop the top-most node \([E(I_{m}),\,k,\,Q(I_{m})]\) corresponding to \(I_{m}\) from \(Q\). AIR: if\(I_{m}\) is not labeled before then  assign the label of \(S_{k}\) to \(I_{m}\).  update the cluster \(S_{k}\) by Equation (3).  set the global minimal pushed distance \(Q_{min}=Q(I_{m})\). for all 4-neighboring unlabeled elements without EIR identification \(I_{s}\in\{I_{s}\}\) of \(I_{m}\)do  compute \(I_{s}^{\prime}\) with the minimal pushed distance in \(\{I_{s}\}\).  compute the EIR correlation by Equation (4). if\(Q(I_{s}^{\prime})<Q_{min}\)then  push the corresponding node \(\left[E\big{(}I_{s}^{\prime}\big{)},\,k,Q\big{(}I_{s}^{\prime}\big{)}\right]\) on \(S\).  set the global minimal pushed distance \(Q_{min}=Q(I_{s}^{\prime})\). else  push \(\left[E\big{(}I_{s}^{\prime}\big{)},\,k,Q\big{(}I_{s}^{\prime}\big{)}\right]\) on \(Q\). endif  push the corresponding node \(\left[E\big{(}I_{s}\big{)},\,k,Q\big{(}I_{s}\big{)}\right]\) on \(Q\). endfor endif endwhile return the label map of \(I\)
```  
**Algorithm 1** NICE superpixel segmentation framework