TrainImageClassifier confusion matrix

I have doubts about the confusion matrix generated in TrainImageClassier. I know that it uses the area of ​​the smallest sample as a parameter for all classes, but I don’t know if the total value is numbers of pixels or value in area anyway?

I appreciate anyone who can help.



the application generates two point vector datasets from the input polygon vector dataset, one for training and one for validation. The points contained in these datasets correspond to the pixel of the input image that overlap the input polygons. In your case the validation dataset contains 2038 pixels of the input image per class.

You can run the application with the cleanup parameter set to false and take a look at the “{out}_samplesValid_1.shp” file, where {out} is the name of the output model filename. This file contains the samples used for the validation, maybe it could help you to understand how this applicaton works.


1 Like

Understand. I used a polygon shp for training with 263 samples with eight classes and a validation shape also for polygons with 100 samples with eight classes. I saw that it takes the area of ​​the smallest polygon between the two shapes that is 2038 and applies this total to all classes. So these 2038 are pixel numbers for each class? Would you have any articles to indicate with these references?

Thank you very much for responding.


So these 2038 are pixel numbers for each class

Yes !

I don’t know if there is a paper detailing the classification process using OTB. There is this page in the documentation.

I hope that helps,

Yes, it helped a lot.

Thank you very much.

Big hug.