Pass the classification but hold the salt and pepper!

ArcGIS has improved its suite of classification tools including advanced algorithms and the ability to segment an image. Segmentation looks at neighboring pixels and groups them together if they share the same spectral characteristics and it can also understand the shape of features and leverage that information to increase the accuracy of your final, classified image. The net result is to eliminate the salt and pepper effect that you sometimes see in classified maps and to produce a clean classified image.

The tool that you use to do this is the Segment Mean Shift tool. Let’s break this down.

You’ve got the Segment Mean Shift tool open and you have these two parameters that you need to set, Spectral Detail and Spatial Detail. Set them both to 20 and click run, then come back and I’ll tell you what you just did.

Segmentation is just an intermediate step. It’s tempting to want to create the perfectly segmented image, but the reality is you just want it to be good enough to get rid of the salt and pepper and have a clean looking final result.

The reason to set both parameters to 20 is that this will be the fastest processing time. If that’s good enough, then move on. The term “good enough” is an industry term that means “the absence of stuff that is wrong.” So, not everything has to be right, it just can’t be wrong. That’s the threshold you want. Remember, this is part of a larger workflow which involves creating training sites, classifying the image, seeing where you have errors, and then revising those training sites.

If the quality isn’t up to par and you see segments composed of multiple features (like a forest and a lawn) you want to run the tool again. This time, set the level of Spatial Detail to between 2 and 4. You’ll get sharper segments but the tool will take longer to process because it’s taking into account more information about the shape of features.

Here’s an image that shows where you want to be parameter-wise. The green box in the lower right is the good enough zone. This is the fastest processing time (high spatial and spectral detail). The blue box in the upper right is the high quality zone (high spectral and low spatial detail). You want to stay away from anything below the yellow line.

segment parameters

This entry was posted in Imagery, Local Government, National Government, Oceans & Maritime, State Government, Uncategorized and tagged , , , , . Bookmark the permalink.

Leave a Reply


  1. mervynlotter says:

    Thanks Kevin. This is great and it helps a bit. I am trying to get to grips with what effect the spatial value is having on my segmentation process. What does the spatial detail measure? Distance to similar segments or modes or the local maxima (I struggled through the literature!)? Or shape of segments or local maxima ?


  2. joemcglinchy says:

    I guess it would be beneficial to discuss the what the available range represents. Presumably, “20″ implies low spatial/spectral contribution to the image segments based on the discussion above (setting to 20 results in quicker turn-around of segmented image). Is it then safe to assume “1″ implies high spatial/spectral contribution? Is there a direct correlation between this value range of 1-20 and the mean distance of pixel vectors that contribute to a single image segment? is it also a factor of the minimum segment size?