Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNIC with adaptivelz normalized distance #6

Open
bobleegogogo opened this issue Aug 28, 2020 · 2 comments
Open

SNIC with adaptivelz normalized distance #6

bobleegogogo opened this issue Aug 28, 2020 · 2 comments

Comments

@bobleegogogo
Copy link

Hi Moritz,

pysnic is a great piece of python package based on SNIC, many thanks for your efforts.

We are working with remote sensing images superpixel method and we have tried SLIC, SLIC-CO (zero parameters version of SLIC), and SNIC. While I wonder is there also possibility of build SNIC-CO to further reduce the parameters of the algorithms? or does this idea fit well with the original design of SNIC algorithms?

How do you think about this? Any suggestions on how one may extend the current pysnic to zero parameters version?

Best,

Hao

@MoritzWillig
Copy link
Owner

MoritzWillig commented Aug 28, 2020

Hi Hao,
thanks for your question! I also have thought of zero parameter versions for SNIC before. Overall there are two primary components we need to take care of: The distance metric and the seed initialization/refinement.

Setting aside the seed placement for now, the metrics between SLIC and SNIC are quite similar (the normalization factors for distance and color are squared in the SLIC formula). If you wish to, you can just plug in the adapting formulas. See the examples and following code for the current implementation:

def create_augmented_snic_distance(image_size, number_of_superpixels, compactness):

For color normalization ASLIC uses the maximum color deviation of a superpixel from the previous iteration. One problem we face here, is that SLIC still requires an initial superpixelation to find the maximum color deviation for each cluster. As SNIC is non-iterative we need another approach to estimate the color deviation. Sampling pixels close to the initial seed and updating it throughout the run could give a sufficient results. I'm also not quite sure if taking the maximum color distance is a good heuristic for normalizing the values, since outliers, that are due to noise, will have a large impact. Normalizing with the standard deviation, or fitting some distribution should be more stable.

We also got a hyper-parameter to trade off color and image distance. As this trade-off is dependent on the given application, I'm not quite sure if we can do better than performing a parameter search. (In that context we could also try learning the distance metric directly using a neural net or similar ...)

From the examples I have worked with, I got the impression, that creating a better seed initialization may be more beneficial for the overall result, than fine-tuning the hyper-parameter.

I hope that you find some of the comments useful. If you have any further ideas or question please let me know!
Best,
Moritz

@bobleegogogo
Copy link
Author

Hi Moritz,

Definitely, I find your comments very helpful. In general, I agree with you that hyper-parameter tuning could be less beneficial for improving superpixel performance than having a better seed initialization.

Indeed, the nature of SNIC for being non-iterative could play a big role when finding the maximum color deviation for each cluster, or I am also not sure is this estimation really necessary or beneficial. Give the fact that remote sensing images can be more complex and sophisticated then daily photos, a uniform compactness factor could also be more intuitive if we cannot find a better way to find the local maximum. I guess I will forget the idea of zero parameter SNIC for now.

In that context we could also try learning the distance metric directly using a neural net or similar ...)

This is indeed an interesting idea, deep learning or machine learning using NN from the image to get an end-to-end superpixel segmentation sounds really cool, although not sure about the state-of-the-art research, I guess this should be unsupervised or self-supervised DL/ML approach.

Best Regards,

Hao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants