Request for Changes-68: New sampling strategies in classification framework

From OTBWiki
Jump to: navigation, search

Status

Summary

This RFC adds two new strategies for sample selection :

  • Set a global percentage of samples to use
  • Set a total number of samples to generate

These new strategies are added both in single image and multi-images mode.

Rationale

Need expressed in this otb-users thread:

https://groups.google.com/forum/#!topic/otb-users/yRG_XKThcAs

Implementation details

In mono-image mode the behavior is as follows:

  • percent strategy : Use p*N(c) samples among N(c) samples available for class c, where p is the target percentage
  • total strategy : Use t*R(c) samples, where R(c) is the proportion of class c and T is the target number of samples

In multi-image mode, the behavior is as follows:

  • percent strategy : For each image i and each class c:
    • if mode is proportional, then Ni( c ) = p * Ti( c ) where p is the global percentage of samples
    • if mode is equal , then Ni( c ) = p * sum_k(Tk(c)]/L where p is the global percentage of samples
    • if moide is custom , then Ni( c ) = p(i) * Ti(c) where p(i) is the percentage of samples for image i. c
  • total strategy : For each image i and each class c:
    • if mode is proportional, then Ni( c ) = total * (sum_k(Ti(k))/sum_kl(Tl(k))) * (Ti(c)/sum_k(Ti(k))) where total is the total number of samples specified.
    • if mode is equal , then Ni( c ) = (total / L) * (Ti(c)/sum_k(Ti(k))) where total is the total number of samples specified.
    • if mode is custom , then Ni( c ) = total(i) * (Ti(c)/sum_k(Ti(k))) where total(i) is the total number of samples specified for image i.

Classes and files

  • otb::SamplingRateCalculator has two new methods to set the global percentage or number of samples
  • otb::SamplingRateCalculatorList has two new methods to set the global percentage or number of samples

Applications

  • SampleSelection application has been udpated to propose the two new modes
  • MultiImageSamplingRates application has been udpated to propose the two new modes

Tests

Test for otb::SamplingRateCalculatorList class has been updated to test the two new modes.

Dashboard came green: http://dash.orfeo-toolbox.org/viewTest.php?onlypassed&buildid=246928

Documentation

  • Classes documentation has been updated
  • Applications documentation has been updated
  • Cookbook has been update BUT for some reason the layout of section "Working with several images" is broken for the new modes even if the RST code is exactly the same as for other section. I will not fix this, I leave it to someone that understand (and like) the twisted RST logic (and I start to regret having +1 the RST cookbook RFC).