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.
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!
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 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:
ITK is missing a proper super pixel algorithm, this contribution adds one and helps to flush out our sparse segmentation group.
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.
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.
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!
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.
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.
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.
I understand the decision to go with minimum. I was just wondering whether TBB’s dynamic load balancing helps smooth out those unexpected interruptions.
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.
Thanks Bradley for implementation of scalable SLIC algo. From my research I found this algo is very suitable for the problem I am solving in Medical imaging space. After reading paper I was able to tweak the results with 2 parameters exposed to user, however is there provision to specify the number of threads to the algo or does it deduce the number of threads automatically from available hardware resources?
SLIC follows the standard ITK conventions of threading by using the itkMultiThreaderBase class. By default ITK will set the number of threads to the number of virtual cores on your system. The number of “work units” is configurable on the filter with the SetNumberOfWorkUnits method.
One more question in my next steps I want to analyze each segment (superpixel) from the image. Is there way I can get info on each superpixel and do my further processing by iterating over it?
Hi Bradley, I had one question while using SSLIC algo, are there any guidelines to keep in mind while providing superpixel grid size to the algorithm? I did trail and error and I get varying results based on superpixel grid size. I am not able to evaluate which size is optimal for use case I am solving. Thanks,
Jiten
The general guidelines is to adjust the size/number of super pixels so that the contours of your objects are preserved while the size of super pixels is maximized.