0

I know, an example of Unsupervised classification was given on GEE but it is not really unsupervised approach as it still needs training. I am looking for the way to perform unsupervised classification without giving training data and the algorithm groups the pixels with common characteristics (number of classes).

Here is the link for the example: developers.google.com/earth-engine/clustering. I want a very simple unsupervised classification which does not need training. In any RS software, you have an option to simply apply unsupervised classification on an image without defining the classes. It only needs a number of classes and the software does the classification based on common characteristics.

closed as unclear what you're asking by Kersten, Andre Silva, whyzar, aldo_tapia, Vince May 24 '18 at 18:00

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    Please provide a link to the previous example in GEE you are referencing. Also, what have you tried so far? Hard to help without knowing where you're stuck. – lambertj May 24 '18 at 14:36
  • Thanks for the response. Here is the link for the example: developers.google.com/earth-engine/clustering. I want a very simple unsupervised classification which does not need training. In any RS software, you have an option to simply apply unsupervised classification on an image without defining the classes. It only needs a number of classes and the software does the classification based on common characteristics. – Sarchil May 24 '18 at 15:41
  • 2
    Please, edit the question instead of adding/clarifying information in comments. – Andre Silva May 24 '18 at 16:33
2

The training data you have to provide is simply a region and an image - it is still a unsupervised classification.

A cluster algorithm will build a model based on the training region you provide and the number of classes you want and then apply this model to an image. In most GIS or remote sensing software the image you train the cluster model on is the same as the one you predict the classes on. Regardless if the software asks you for a training image - to build the model, this step will happen.

If you are working with software that uses a clusterer on a lot of images it usually requires you to define a training dataset before it applies the model to all of your images. An example for such a type of software would be Weka and their clustering algorithms.

Google Earth Engine implemented the Weka clustering algorithms in their platform so you can create the model on a representative subset of your data and then use that to predict on large (i.e. global) image collections.

If you do not need to apply your model to a large dataset you could simply predict on the same area as you trained the clusterer on - this would be equivalent to "any RS software" you mention that operate on a single image basis instead of the distributed computing approach of GEE.

A modified example to train and predict an unsupervised model on the same dataset:

// Load single Landsat 8 scene
var input = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_232067_20130726');

// use the bounding box of a Landsat-8 image
var region = input.geometry()

// Display the image
Map.centerObject(input)

// training region is the full image
var training = input.sample({
  region: region,
  scale: 30,
  numPixels: 5000
});

// train cluster on image
var clusterer = ee.Clusterer.wekaKMeans(15).train(training);

// cluster the complete image
var result = input.cluster(clusterer);

// Display the clusters with random colors.
Map.addLayer(result.randomVisualizer(), {}, 'clusters');
  • Thank you very much for your response. The statement is quite clear but I just want to apply unsupervised classification without training in GEE if possible. I want to apply on a country scale and I am not interested in defining the classes before the classification as it takes so many times. I Just want the unsupervised approach to classifying the image to several classes. For instance, in ENVI, you can apply this approach to an image or more, it requires only the number of clasees without training and defining the classes. Thanks – Sarchil May 25 '18 at 8:20
  • Please re-read my answer. You do not need to determine the classes, only an area (i.e. the country you are speaking of or an image) and the number of classes. You are not training the classes, you are training a unsupervised model. – Kersten May 25 '18 at 11:36
  • Excellent! That worked very well. Sorry I didn't read it carefully! – Sarchil May 25 '18 at 14:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.