SLIC Superpixel Segmentation Algorithm

(Bradley Lowekamp) #1

We have written an Insight Journal (IJ) article describing our implementation of the simple linear iterative clustering (SLIC) super pixel algorithm. Although the upload process to IJ does not appear to be working right now. I uploaded a copy to GitHub for your reading pleasure..

This article includes scalability analysis and threading performance. This is a hot topic in ITK these days with the exciting new TBB, and thread pool back ends. This implementation uses the older ITKv4 threading model for portability. However, with the clearly documented implementation, and the analysis framework provided in the repository, it is an opportunity to evaluate how the new threading model can be applied to a complex filter with multiple threading strategies.

I have also initiated a pull request for adding the filter to a new ITK module directly in ITK. This filter is a newer, and unique algorithm for ITK which I believe helps round out the selection of segmentation methods available in ITK. I hope that it will be welcomed addition to the ITKv5 release.


(Francois Budin) #2

That looks great! I had a problem for which I needed a superpixel implementation and I had to use a different library than ITK… Thanks for implementing this! Do you want to create a remote module? If you use the template module, that should also easily allow you to have the Python wrapping!

(Bradley Lowekamp) #3

Hi Francois,

The code and IJ paper are already in an ITK module. The module framework and CI is what allowed my Gerrit pull request to be initially green :slight_smile: We already have the SimpleITK JSON to wrap this filter so we are good for many language bindings.

I am specifically requesting that this contribution be merged directly into ITK proper, for the following reasons:

  1. ITK is missing a proper super pixel algorithm, this contribution adds one and helps to flush out our sparse segmentation group.
  2. The contribution is well tested, documented, and as the IJ paper demonstrates its very scalable. We have put our best effort into the code and believe it is high quality.
  3. With the current effort in improving threading, this class is a good opportunity to apply the new techniques and evaluate the results with the methods outlined in the IJ for scalability analysis.

Thanks for the consideration of my request.

(Francois Budin) #4

That is true that such an algorithm is missing from ITK. As @jhlegarreta commented on gerrit, the code has been well tested. I +2 the review on Gerrit. Thanks for your contribution! Great work!

(Bradley Lowekamp) #5

The SLIC filter has been merged into ITK and has also been updated with the modern ITKv5 threading model. I took this as an opportunity to do a performance comparison of the various threading options now available in ITK.

I have updated the paper with an additional section about updating the threading.

The interesting results are summarized in these graphs which show the timing results for a [2048x1216] 2D image across the number of threads with the different threading backs ends. The top figure shows the time, and the bottom figure shows the speed up of ITKv4 compared to the original implementation. Details are in the paper.

:fireworks::sparkler::fireworks:Have a happy and safe 4th of July to those celebrating. :fireworks::sparkler::fireworks:

(Dženan Zukić) #6

The paper reports minimum time out of 20 runs. Have you perhaps also calculated mean or median times?

It would be interesting to run this benchmark again once the refactoring is completed.

(Bradley Lowekamp) #7

The minimum methodology is based on the task to being profiled is interrupted by system tasks and processes. The minimum is bounded. The mean is corrupted by outliers and the median while robust includes the meadian time of the system load. Hence, minimum is best to use to remove that variability of system tasks.

(Dženan Zukić) #8

I understand the decision to go with minimum. I was just wondering whether TBB’s dynamic load balancing helps smooth out those unexpected interruptions.

(Bradley Lowekamp) #9

So you are invested in more the standard deviation or the robust median absolute deviation (MAD) then? I’ll be sure to save all the timing next time I run the benchmarks.

(Bradley Lowekamp) #10

The final Insight Journal publication in now available:


P.S. There appears to be some size limit on the PDF size for IJ article 11MB was too big, but 4.5MB was ok.