| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Examples :: Algorithm :: References :: Related |
| Back to top |
| Back to top |
chnsel(file, nchan, dbic, drule, dsig, tflag, opt, best)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILE * | str | Input file name | 1 - | |
| NCHAN * | List[int] | Number of best channels | 1 - 1 | |
| DBIC | List[int] | Input image channel(s) | 0 - 16 | |
| DRULE * | str | Decision rule | 3 - 3 | |
| DSIG * | List[int] | Input class signature segment | 2 - 256 | -256 - |
| TFLAG | str | Trace term | 0 - 3 | ON | OFF Default: OFF |
| OPT * | List[int] | Optimization level | 1 - 1 | |
| BEST | List[int] | Best image channels for classification | 0 - 15 |
| Back to top |
FILE
Specifies the name of the PCIDSK image file containing the channels and signature segments used to determine the optimum classification channel (best channel).
NCHAN
Specifies the number of best channels to select for future classification.
The value of this parameter must be smaller than the number of input channels used to create the signature segments in CSG.
DBIC
Optionally specifies the input image channel(s), selected from the set of channels used to create the signature segments, from which to select an optimum subset.
Duplicate channels are not allowed.
DRULE
Specifies the divergence algorithm to use when selecting the best channels.
DSIG
Specifies the input signature segment for which an optimum discriminatory channel subset will be selected.
Duplicate segments are not allowed.
All signatures must have been collected from the same set of input channels.
TFLAG
Specifies whether the trace term is included in the calculation.
For more information, see the "Details" section.
OPT
Specifies the level of optimization required.
Valid values are from 0 to (DBIC-NCHAN-1). If a value greater than (DBIC-NCHAN-1) is specified, OPT is set to (DBIC-NCHAN-1).
For more information, see the "Details" section.
BEST
BEST is an output parameter. Upon completion, CHNSEL writes a list of the optimum image channels to use for classification to this parameter. This value may be used as input for other functions.
| Back to top |
CHNSEL reads a defined set of image channels and selects the best image channel combination to use for classification, based on the divergence of the signature segments (created by CSG or another function) being discriminated. This reduces the number of channels required for classification.
Before running CHNSEL, run CSG to create signature segments based on a subset of image channels from the input file (FILE). CHNSEL selects the best set of channels from this subset, based on the divergence of the input class signatures (DSIG). This reduces the amount of time required to classify a data set that consists of a large number of multispectral channels, without reducing the accuracy of the classification results.
The criteria used to determine the optimum channels for discriminating between a set of classes are based on the divergence between the classes. Divergence is a measure of the dissimilarity between two signature classes, which is calculated from the class sample means and the class covariance matrices. It extends to all of the classes by applying a decision rule over all signature segment class pairs.
The first two decision rules always yield the same result for BEST channels; the second rule (average transformed divergence) is computationally more complex and is, therefore, more time-consuming. As a result, the second decision rule is redundant; using either the first (average interclass divergence) or third (minimum pairwise divergence) decision rules is recommended.
The accuracy and speed of CHNSEL for a specific data set is influenced primarily by the trace term (TFLAG) and optimization level (OPT) parameters.
The trace term (TFLAG) may be included (ON) or excluded (OFF) in the divergence equation. The trace term considers the inverse class covariance matrix relationship. Using this term in the divergence equation may increase the accuracy of the results, but it also increases the computational time required to achieve the results. In many cases, most of the discriminating divergence information is contained in the quadratic term; the trace term is unimportant and may be omitted. By default, the trace term is excluded from the equation.
The optimization level (OPT) parameter specifies the branch and bound algorithm optimization level. Valid values range from 0 to (DBIC-NCHAN-1). An optimization level of (DBIC-NCHAN-1) guarantees that the obtained channel subset is globally optimal. An optimization level between 0 and (DBIC-NCHAN-1) enumerates fewer nodes in the branch and bound algorithm and is, therefore, more efficient; however, there is no guarantee that the obtained subset is globally optimal. If OPT = 0, a backward selection scheme is applied to the data. The larger the value of this parameter, the more execution time is required to achieve results.
CHNSEL can analyze as many as 16 image channels using a maximum of 256 signature segments (128 for Windows). Use the DBIC (Input Layers) parameter to specify a subset of the selected image channels. Upon completion, CHNSEL updates the BEST (Best Layers) output parameter with a list of the optimum channels.
| Back to top |
Determine the three optimum channels for classifying the TM image on irvine.pix, using the eight signature segments from the input file. Use only the simplest optimizations.
from pci.chnsel import chnsel file = "irvine.pix" nchan = [3] dbic = [] drule = "IDV" dsig = list(range(17, 24 + 1)) tflag = "OFF" opt = [0] best = [] chnsel( file, nchan, dbic, drule, dsig, tflag, opt, best )
The following report is produced:
Initial Channels: 1, 2, 3, 4, 5
Initial Criteria Value : 0.177623E+03
Final Criteria Value : 0.149688E+03
The Number of New Nodes : 2
Level : 1, 2
Nodes Expanded : 1, 1
Nodes Rejected : 3, 1
Optimal Channels: 3, 4, 5
Initial Divergence Table:
17 18 19 20 21 22 23
+---------------------------------------------------------------
18| 70.401
19| 130.804 781.235
20| 66.543 162.869 49.106
21| 81.176 112.440 132.000 28.142
22| 181.905 500.171 30.352 86.053 181.644
23| 448.252 400.642 46.085 24.684 109.479 817.404
24| 41.086 103.017 145.273 14.009 23.270 68.654 136.756
Final Divergence Table:
17 18 19 20 21 22 23
+---------------------------------------------------------------
18| 24.817
19| 110.942 563.641
20| 58.071 139.385 26.972
21| 75.367 80.974 88.987 27.516
22| 171.969 442.687 20.108 84.741 179.095
23| 444.549 379.103 39.412 22.512 103.620 808.730
24| 12.327 29.969 74.142 5.807 11.567 56.127 108.134
Given a texture analysis that has been performed on a single channel of radar data to produce 12 texture-measure images and class signatures that have been produced for 12 cover types for the 12 texture-measure images, determine which combination of six channels from the 12 produce the optimum classification results for the 12 signatures. All 12 classes must be considered equally important, with the highest accuracy, in the divergence calculations.
For example, if channels 4, 5, 8, 9, 10, and 11 are the six optimal input channels for the classifier, signatures must be recreated by CSG specifying only these input channels. MLC can then run with the newly created signatures.
from pci.chnsel import chnsel file = "radarsat.pix" nchan = [6] # select six optimum channels dbic = [] # use all channels drule = "IDV" # use interclass divergence dsig = list(range(22, 33 + 1)) # 12 classes tflag = "ON" # trace term for accuracy is on opt = [5] # highest possible optimization chnsel( file, nchan, dbic, drule, dsig, tflag, opt, best )
| Back to top |
CHNSEL uses a branch and bound algorithm to select the optimum channel combination.
To determine the optimum channel set for class discrimination from a given set of channels, some criteria must be established based on divergence (dissimilarity between two classes). This is calculated from the class sample means and the class covariance matrices:
D(i,j) = 0.5 * T[M(i)-M(j)] * (InvS(i) + InvS(j)) * (M(i)-M(j))
+ 0.5 * Trace[ InvS(i)*S(j) + InvS(j)*S(i) - 2*I ]
The divergence is extended to all classes, NCLASS > 2, by applying a decision rule over all NCLASS*(NCLASS-1) pairs.
IDV: The average interclass divergence is the average of all pairs of the divergence for each pair. This measure considers all classes to be equally important.
IDV = (1/(NCLASS*(NCLASS-1))*SUM [D(i,j)]
TDV: The average transformed divergence is based on the exponential of the divergence (Mahalanobis distance) and reduces the dominance of classes that have the highest divergence.
TDV = (1/(NCLASS*(NCLASS-1)*SUM [2*(1-EXP(-D(i,j)/8)]
PDV: The minimum pairwise divergence is the smallest divergence for all pairs in a set. This criteria maximizes the classification accuracies for the worst case; that is, the resultant subset is optimal for the classification of the two classes with the most confusion between them.
PDV = Min (D(i,j)) with i<j.
The divergence criteria is all monotonic in M, the number of required optimum channels; that is, the criteria is never improved by removing a channel from a set of optimum channels. This monotonic characteristic allows a branch and bound selection algorithm to determine the optimum set of M channels.
The algorithm works as follows:
The algorithm starts with a complete set of N channels and systematically evaluates channel subsets of a size greater than or equal to the number of optimum channels (NCHAN). The lower bound, B, is the current optimum value of the criteria for an optimal channel subset (NCHAN). If any larger set is worse than B, all channel subsets of this set are eliminated. The algorithm performs all necessary bookkeeping to keep track of the enumeration, and ensures that all channel sets are either implicitly rejected by the branch and bound test or are explicitly evaluated. Finally, an optimum channel set is chosen.
The algorithm used by CHNSEL is based on the FEATUR program, which is part of LDIAS (LANDSAT Digital Image Analysis System), developed by CCRS (Canada Centre for Remote Sensing) in Ottawa, Canada.
| Back to top |
Narendra, P.M. and K. Fukunaga. "A Branch and Bound Algorithm for Feature Subset Selection", IEEE Transactions in Computers, c.26, no. 9 (1977): 914-922.
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.