Skip to content

Latest commit

 

History

History
491 lines (375 loc) · 18.2 KB

classification_tab.rst

File metadata and controls

491 lines (375 loc) · 18.2 KB

Classification

This tab allows for the classification of the :ref:`band_set_tab` using the spectral signatures checked in :ref:`ROI_list`. Several classification options are set in this tab which affect the classification process also during the :ref:`classification_preview`.

This tool allows for the selection of one the following algorithms:

Also, it is possible to save and load a trained classifier.

Tip

Information about APIs of this tool in Remotior Sensus at this link .

Tool symbol and name Description
:guilabel:`Select input band set` input_number select the input :ref:`band_set_tab` to be classified
checkbox :guilabel:`Use input normalization` optional if checked, normalize the input based on the selected method
radiobutton :guilabel:`Z-score` if checked with checkbox :guilabel:`Use input normalized`, Z-score normalization of input is performed
radiobutton :guilabel:`Linear scaling` if checked with checkbox :guilabel:`Use input normalized`, Linear scaling normalization of input is performed
:guilabel:`Use training` radiobutton :guilabel:`Macroclass ID` if checked, the classification is performed using
:guilabel:`Use training` radiobutton :guilabel:`Class ID` the Macroclass ID (code MC ID of the signature) if checked, the classification is performed using the Class ID (code C ID of the signature)

This tool allows for the selection of the classification algorithm. The algorithm tab includes the available parameters.

Use the :ref:`max_likelihood_algorithm` algorithm.

Tool symbol and name Description
:guilabel:`Use single threshold` input_number optional if checked, it allows for the definition of a classification threshold (applied to all the spectral signatures); pixels are unclassified if probability is less than threshold value (max 100)
:guilabel:`Signature threshold` input_number optional if checked, thresholds :ref:`Signature_threshold_tab` are evaluated
threshold_tool open the :ref:`Signature_threshold_tab` for the definition of signature thresholds
checkbox :guilabel:`Save signature raster` optional if checked, in addition to the classification raster, for each spectral signature a raster is saved in the same output directory, which represents the distance between pixel and signature
checkbox :guilabel:`Calculate classification confidence raster` optional if checked, calculate classification confidence raster

Use the :ref:`minimum_distance_algorithm` algorithm.

Tool symbol and name Description
:guilabel:`Use single threshold` input_number optional if checked, it allows for the definition of a classification threshold (applied to all the spectral signatures); pixels are unclassified if distance is greater than threshold value
:guilabel:`Signature threshold` input_number optional if checked, thresholds :ref:`Signature_threshold_tab` are evaluated
threshold_tool open the :ref:`Signature_threshold_tab` for the definition of signature thresholds
checkbox :guilabel:`Save signature raster` optional if checked, in addition to the classification raster, for each spectral signature a raster is saved in the same output directory, which represents the distance between pixel and signature
checkbox :guilabel:`Calculate classification confidence raster` optional if checked, calculate classification confidence raster

Use the :ref:`multi_layer_perceptron_algorithm` algorithm.

Tool symbol and name Description
:guilabel:`Use framework` radiobutton :guilabel:`scikit-learn` if checked, use scikit-learn framework (read this)
:guilabel:`Use framework` radiobutton :guilabel:`PyTorch` if checked, use PyTorch framework (read about this)
:guilabel:`Hidden layer sizes` input_number list of values separated by comma, where each value defines the number of neurons in a hidden layer (e.g.: 200, 100 for two hidden layers of 200 and 100 neurons respectively)
:guilabel:`Max iter` input_number set the maximum number of iterations
:guilabel:`Activation` input_text set the activation function (default: relu)
:guilabel:`Alpha` input_number set the weight decay (also L2 regularization term) for Adam optimizer
:guilabel:`Training proportion` input_number set the proportion of data to be used as training and the remaining part as test
:guilabel:`Batch size` input_text set the number of samples per batch for optimizer; if auto, the batch is the minimum value between 200 and the number of samples
:guilabel:`Learning rate init` input_number set initial learning rate
checkbox :guilabel:`Cross validation` optional if checked, perform cross validation
checkbox :guilabel:`Find best estimator with steps` optional if checked, find the best estimator iteratively with a number of steps
checkbox :guilabel:`Calculate classification confidence raster` optional if checked, calculate classification confidence raster

:guilabel:`Cross validation` is a function provided by scikit-learn to avoid overfitting by splitting the training set into k smaller sets (read more . In particular, the function StratifiedKFold (with parameters n_splits=5, shuffle=True) is used to create 5 sets, each one containing approximately the same percentage of samples for each class as the complete set. This option can potentially increase significantly the computation time.

If :guilabel:`Find best estimator with steps` is checked, the algorithm tries to find the best estimator iteratively with the defined number of steps (the more the steps, the slower the process will be), by changing the algorithm parameters.

Use the :ref:`random_forest_definition` algorithm.

Tool symbol and name Description
:guilabel:`Number of trees` input_number set the number of trees
:guilabel:`Minimum number to split` input_number set the minimum number of samples required to split an internal node
:guilabel:`Max features` input_number optional for node splitting, if empty all features are considered; if sqrt the square root of all the features, if integer number the number of features; if float number a fraction of all the features
checkbox :guilabel:`One-Vs-Rest` optional if checked, perform One-Vs-Rest classification (read more)
checkbox :guilabel:`Cross validation` optional if checked, perform cross validation
checkbox :guilabel:`Balanced class weight` optional if checked, balanced weight is computed inversely proportional to class frequency
checkbox :guilabel:`Find best estimator with steps` optional if checked, find the best estimator iteratively with a number of steps
checkbox :guilabel:`Calculate classification confidence raster` optional if checked, calculate classification confidence raster

:guilabel:`Cross validation` is a function provided by scikit-learn to avoid overfitting by splitting the training set into k smaller sets (read more . In particular, the function StratifiedKFold (with parameters n_splits=5, shuffle=True) is used to create 5 sets, each one containing approximately the same percentage of samples for each class as the complete set. This option can potentially increase significantly the computation time.

If :guilabel:`Find best estimator with steps` is checked, the algorithm tries to find the best estimator iteratively with the defined number of steps (the more the steps, the slower the process will be), by changing the algorithm parameters.

If :guilabel:`One-Vs-Rest` is checked, the algorithm performs One-Vs-Rest classification which basically fits one classifier per class.

If :guilabel:`Balanced class weight` is checked, the algorithm gives all classes equal weight with a balanced weight that is computed inversely proportional to class frequency in the training data.

Use the :ref:`spectra_angle_mapping_algorithm` algorithm.

Tool symbol and name Description
:guilabel:`Use single threshold` input_number optional if checked, it allows for the definition of a classification threshold (applied to all the spectral signatures); pixels are unclassified if spectral angle distance is greater than threshold value (max 90)
:guilabel:`Signature threshold` input_number optional if checked, thresholds :ref:`Signature_threshold_tab` are evaluated
threshold_tool open the :ref:`Signature_threshold_tab` for the definition of signature thresholds
checkbox :guilabel:`Save signature raster` optional if checked, in addition to the classification raster, for each spectral signature a raster is saved in the same output directory, which represents the distance between pixel and signature
checkbox :guilabel:`Calculate classification confidence raster` optional if checked, calculate classification confidence raster

Use the :ref:`support_vector_machine_definition` algorithm.

Tool symbol and name Description
:guilabel:`Regularization parameter C` input_number set the regularization parameter C
:guilabel:`Kernel` input_text set the kernel (default: rbf)
:guilabel:`Gamma` input_text set the kernel coefficient gamma (default: scale)
checkbox :guilabel:`Cross validation` optional if checked, perform cross validation
checkbox :guilabel:`Balanced class weight` optional if checked, balanced weight is computed inversely proportional to class frequency
checkbox :guilabel:`Find best estimator with steps` optional if checked, find the best estimator iteratively with a number of steps
checkbox :guilabel:`Calculate classification confidence raster` optional if checked, calculate classification confidence raster

:guilabel:`Cross validation` is a function provided by scikit-learn to avoid overfitting by splitting the training set into k smaller sets (read more . In particular, the function StratifiedKFold (with parameters n_splits=5, shuffle=True) is used to create 5 sets, each one containing approximately the same percentage of samples for each class as the complete set. This option can potentially increase significantly the computation time.

If :guilabel:`Find best estimator with steps` is checked, the algorithm tries to find the best estimator iteratively with the defined number of steps (the more the steps, the slower the process will be), by changing the algorithm parameters.

If :guilabel:`Balanced class weight` is checked, the algorithm gives all classes equal weight with a balanced weight that is computed inversely proportional to class frequency in the training data.

It is possible to run the classification, or save and load a trained classifier.

Classification raster is a file .tif (a QGIS style file .qml is saved along with the classification); also other outputs can be optionally calculated. Outputs are loaded in QGIS after the calculation.

Tool symbol and name Description
:guilabel:`Load classifier` open_file open an already save classifier file (.rsmo)
:guilabel:`Save classifier` export save the classifier to file (.rsmo), in order to be loaded later
:guilabel:`RUN` run run this function