CalcOVAMap

Declaration: TRndForest.CalcOVAMap (CubeData: TMat4D; ThreshDetune, MinPurity, MinCFDist, MinNeighbCorr: double; NRepeatCorr: integer; var OVAMap: TInt2DArray; var MaxRFMap, PurityMap: TDouble2DArray);
The method CalcOVAMap calculates the one-versus-all map of the classification results of the random forest classifier (use the method ClassifyCubeData to classify the data before calculating the OVA map). The parameter CubeData contains the original data which has been classified. On return the variable parameters OVAMap, MaxRFMap and PurityMap contain the one-vs-all map, the maximum random forest response over all classes and the purity value1, respectively. These three arrays are automatically resized to the spatial size of the CubeData parameter.

The parameters ThreshDetune, MinPurity, MinCFDist control the calculation of the primary OVAMap. All pixels which exceed the classification threshold + ThreshDetune and which exhibit a purity greater than MinPurity and which show a difference of the highest and the second highest classification result greater than MinCFDist are assigned to the class with the highest response. All other pixels are assign to class 0 ("unknown").

In a subsequent postprocessing step all unknown pixels are compared to all their neighboring pixels which are not unknown. If the maximum correlation of the unknown to one of the known pixels exceeds MinNeighbCorr the unknown pixel is assigned to the class of the known pixel showing the maximum correlation. This process is repeated NRepeatCorr times.



1 The purity value is a value between 0.0 and 1.0 indicating the uniqueness of the detected class. In an ideal case one classifier should deliver a value of 1.0 (for the recognized class) while all other classifiers return a value of 0.0. Under real circumstances the returned classification results are not always exactly 0.0 or 1.0 but sometime a little bit off. The purity is now the product of the classification result (CFR) of the positively identified class and 1-CFR of all other classifiers (assuming that all other classifiers are specific for other classes). Please note that the purity value will be misleading if the ClassifiedImg parameter contains several classifiers specific for the same class.