pkannogr(1)
π NAME π
okay so bestie, welcome to the pkannogr manual page (that's section 1 of the man pages, iykyk) β and what this lil icon does is classify a vector dataset using an Artificial Neural Network. slay.
π SYNOPSIS π
pkannogr -t training [-i input] [-o output] [-cv value] [options]
[advanced options]
β¨ DESCRIPTION β¨
pkannogr implements an artificial neural network (ANN) to solve a supervised classification problem. the whole thing is built on the open source C++ library ( fann http://leenissen.dk/fann/wp/ ). yes bestie, we're standing on the shoulders of a C++ library and we look cute doing it π«Ά
both raster and vector files are supported as input. the output will contain the classification result, either in raster or vector format, corresponding to the format of the input. like, it just matches the vibe of whatever you fed it π
a training sample must be provided as an OGR vector dataset that contains the class labels and the features for each training point. and no, the point locations are not considered in the training step β the coordinates are just there, chilling, not part of the math.
you can use the same training sample for classifying different images, provided the number of bands of the images are identical. so yes, one training sample, many images, main character energy β¨
use the utility pkextract(1) to create a suitable training sample, based on a sample of points or polygons. and for raster output maps you can attach a color table using the option -ct. obsessed.
πΈ OPTIONS πΈ
-i filename,--input filenameβ the input image π-t filename,--training filenameβ the training vector file. a single vector file contains all training features (must be set as:B0,B1,B2,...) for all classes (class numbers identified by label option). use multiple training files for bootstrap aggregation (that's the alternative to the--bagand--bsizeoptions, where instead a random subset is taken from a single training file) π§-tln layer,--tln layerβ training layer name(s)-label attribute,--label attributeβ identifier for class label in training vector file. (default:label)-prior value,--prior valueβ prior probabilities for each class (e.g.,-prior 0.3 -prior 0.3 -prior 0.2)-cv value,--cv valueβ n-fold cross validation mode (default:0)-nn number,--nneuron numberβ number of neurons in hidden layers in neural network (multiple hidden layers are set by defining multiple number of neurons:-nn 15 -nn 1, default is one hidden layer with 5 neurons) π§-m filename,--mask filenameβ Only classify within specified mask (vector or raster). For raster mask, set nodata values with the option--msknodata.-msknodata value,--msknodata valueβ mask value(s) not to consider for classification. Values will be taken over in classification image. Default is0.-nodata value,--nodata valueβ nodata value to put where image is masked as nodata (default:0)-o filename,--output filenameβ output classification image β¨-ot type,--otype typeβ Data type for output image ({Byte / Int16 / UInt16 / UInt32 / Int32 / Float32 / Float64 / CInt16 / CInt32 / CFloat32 / CFloat64}). Empty string: inherit type from input image-of GDALformat,--oformat GDALformatβ Output image format (see alsogdal_translate(1)). Empty string: inherit from input image-f OGRformat,--f OGRformatβ Output ogr format for active training sample (default:SQLite)-ct filename,--ct filenameβ colour table in ASCII format having 5 columns:id R G B ALFA(0: transparent,255: solid) π¨-co NAME=VALUE,--co NAME=VALUEβ Creation option for output file. Multiple options can be specified.-c name,--class nameβ list of class names.-r value,--reclass valueβ list of class values (use same order as in--classoption).-v 0|1|2,--verbose 0|1|2β set to:0(results only),1(confusion matrix),2(debug) π
π¦ Advanced options π¦
-bal size,--balance sizeβ balance the input data to this number of samples for each class (default:0)-min number,--min numberβ if number of training pixels is less then min, do not take this class into account (0: consider all classes)-b band,--band bandβ band index (starting from0, either use--bandoption or use--startto--end)-sband band,--startband bandβ start band sequence number (default:0)-eband band,--endband bandβ end band sequence number-offset value,--offset valueβ offset value for each spectral band input features:refl[band]=(DN[band]-offset[band])/scale[band]-scale value,--scale valueβ scale value for each spectral band input features:refl=(DN[band]-offset[band])/scale[band]-a 1|2,--aggreg 1|2β how to combine aggregated classifiers, see also--rcoption (1: sum rule,2: max rule).--connection 0|1β connection rate (default:1.0for a fully connected network)-w weights,--weights weightsβ weights for neural network. Apply to fully connected network only, starting from first input neuron to last output neuron, including the bias neurons (last neuron in each but last layer) π-l rate,--learning rateβ learning rate (default:0.7)--maxit numberβ number of maximum iterations (epoch) (default:500)-comb rule,--comb ruleβ how to combine bootstrap aggregation classifiers (0: sum rule,1: product rule,2: max rule). Also used to aggregate classes with--rcoption. Default is sum rule (0)-bag value,--bag valueβ Number of bootstrap aggregations (default is no bagging:1)-bs value,--bsize valueβ Percentage of features used from available training features for each bootstrap aggregation (one size for all classes, or a different size for each class respectively. default:100)-cb filename,--classbag filenameβ output for each individual bootstrap aggregation (default is blank)--prob filenameβ probability image. Default is no probability image-na number,--na numberβ number of active training points (default:1)
and that's the whole page bestie!! this one came out of the pkannogr source, dated 01 January 2025, and it's filed under pkannogr(1) β go forth and classify, you absolute legend π β¨π
π¦ where this page comes from
- ubuntu questing: pktools 2.6.7.6+ds-6build4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms