Select to view content in your preferred language

Training sample assignment of raster pixels to class

152
1
Tuesday
JanniceBanks
New Contributor

When training samples are developed for raster classification (using irregular polygons to manually perform a supervised classification), how is class membership assigned to the raster pixels for training? I think it's one of the following ways:

  1. pixel membership to a class is assigned when any pixel of a raster intersects in any way with the training sample, OR
  2. pixel membership to a class is assigned if the training sample intersects the input raster pixel centoid

The reason for my asking is that I’ve used python to developed a Withheld Data Test for my Random Forest/random trees classifier, which I’ve had to do manually.

The Withheld Data Test involves:

  • Create fishnet 1px x 1px
  • Intersect tool to select fishnet by attribute where it intersects with TS
  • Export selected pixels
  • Randomly assign pixels within the training samples fishnet a number 0.0 – 1.0, randomly split them 70%/30% and assign membership to two TS classes - Test30 and Training70. Note that these two classes maintain the class values of the original training samples.
  • Erase the location of Test30 pixels from the training samples, resulting in irregular polygons that look like Training70 fishnet.
  • The way I’m choosing the conditions of membership of the 30% of pixels that I’m excluding from my TS should be the same as how the training samples classify raster pixels into a class. 

I hope that this makes sense! It would be great to get clarification so that I can tune my model properly. Also, this matters as the training samples I need to develop are quite small (i.e. IDing shadow for trees can be like 5x5 pixels, and for an entire site I’m often only training about 5000 pixels). It makes a big difference to my model (the 30% of test pixels can actually become 25 – 35% of the TS pixels if it's done inconsistently with how Esri does things). Thankfully, I'm getting 98% kappa value already, so the small sample sizing is working well.

Any help is greatly appreciated. \m/

0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

Cell assignment depends on the geometry being converted.  Discussions are in the following links

How Polygon To Raster works | ArcGIS Pro documentation

How Point to Raster works | ArcGIS Pro documentation

raster sampling by rasters would have to consider cell alignment and the snap raster

Cell Alignment | ArcGIS Pro documentation

Snap Raster | ArcGIS Pro documentation

so I would be concerned if the rasters are misaligned

 


... sort of retired...
0 Kudos