Train SVM classifier from multiple image
Brief Description
Train a SVM classifier from multiple pairs of images and training vector data.
Tags
Learning
Long Description
This application performs SVM classifier training from multiple pairs of input images and training vector data.Samples are composed of pixel values in each band optionally centered and reduced using XML statistics file produce by the ComputeImagesStatistics application. The training vector data must contain polygons with a positive integer field representing the class label. Name of the field can be set using the "Class label field" parameter. Training and validation sample lists are built such that each class is equally represented in the two lists. One parameter allows controlling the ratio between the number of samples in training and validation sets. Two parameters allow to manage the size of the training and validation sets per class and per image. Several SVM classifier parameters cas be set. The kernel function which defined the feature space (for example if the kernel is a Gaussian radial basis function kernel the corresponding feature space of infinite dimensions). To allow some flexibility in separating the classes, SVM models have a cost parameter, C, that controls the trade off between allowing training errors and forcing rigid margins. It creates a soft margin that permits some misclassifications. Increasing the value of C increases the cost of misclassifying points and forces the creation of a more accurate model that may not generalize well. Classifier parameters can also be optimize.
Parameters
[group] Input and output data (-io): This group of parameters allows setting input and output data.
[param] Input Image List (-il): A list of input images.
[param] Vector Data List (-vd): A list of vector data sample used to train the estimator.
[param] DEM repository (-dem): Path to SRTM repository
[param] XML image statistics file (-imstat): Filename of an XML file containing mean and standard deviation of input images.
[param] Output SVM model (-out): Output SVM model
[group] Training and validation samples parameters (-sample): This group of parameters allows setting training and validation sample lists parameters.
[param] Maximum training sample size (-mt): Maximum size of the training sample (default = -1).
[param] Maximum validation sample size (-mv): Maximum size of the validation sample (default = -1)
[param] training and validation sample ratio (-vtr): Ratio between training and validation sample (0.0 = all training, 1.0 = all validation) default = 0.5.
[param] Name of the discrimination field (-vfn): Name of the field using to discriminate class in the vector data files.
[group] SVM classifier parameters (-svm): This group of parameters allows setting SVM classifier parameters.
[choice] SVM Kernel Type (-k): SVM Kernel Type.
[group] Linear:
[group] Gaussian radial basis function:
[group] Polynomial:
[group] Sigmoid:
[param] Control trade off between training errors and forcing rigid margins. (-c): SVM models have a cost parameter C.(1 by default).
[param] parameters optimization (-opt): SVM parameters optimization
Limitations
None
Authors
OTB-Team
See also
Example of use
Input Image List: QB_1_ortho.tif
Vector Data List: VectorData_QB1.shp
XML image statistics file: clImageStatisticsQB1.xml
Output SVM model: svmModelQB1_allOpt.svm
Maximum validation sample size: 100
training and validation sample ratio: 0.5
parameters optimization: true
otbcli_TrainSVMImagesClassifier -io.il QB_1_ortho.tif -io.vd VectorData_QB1.shp -io.imstat clImageStatisticsQB1.xml -io.out svmModelQB1_allOpt.svm -sample.mv 100 -sample.vtr 0.5 -svm.opt true