23
CEE 615: Digital Image Processing 1 Prof. W. Philpot, Spring 2004, Pattern Recognition & Classification Pattern Recognition & Classification Classification • Supervised – parallelpiped – minimum distance – maximum likelihood (Bayes Rule) > non-parametric > parametric • Unsupervised – clustering Pattern Recognition Pattern recognition in remote sensing has been based on the intuitive notion that pixels belonging to the same class should have similar gray values in a given band. o Given two spectral bands, pixels from the same class plotted in a two-dimensional histogram should appear as a localized cluster. o If n images, each in a different spectral band, are available, pixels from the same class should form a localized cluster in n-space. What is a pattern? Focus on distinguishing between two clusters clusters separated by lines (1 line for each pair of clusters) focus on fully describing one cluster cluster specified with - mean vector - circle (constant radius)

Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing 1

Prof. W. Philpot, Spring 2004, Pattern Recognition & Classification

Pattern Recognition & Classification

Classification • Supervised – parallelpiped – minimum distance – maximum likelihood (Bayes Rule) > non-parametric > parametric • Unsupervised – clustering

Pattern Recognition • Pattern recognition in remote sensing has been based on the

intuitive notion that pixels belonging to the same class should have similar gray values in a given band.

o Given two spectral bands, pixels from the same class plotted in a two-dimensional histogram should appear as a localized cluster.

o If n images, each in a different spectral band, are available, pixels from the same class should form a localized cluster in n-space.

What is a pattern?

• Focus on distinguishing between two clusters

• clusters separated by lines (1 line for each pair of clusters)

• focus on fully describing one cluster

• cluster specified with - mean vector - circle (constant radius)

Page 2: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing 2

Prof. W. Philpot, Spring 2004, Pattern Recognition & Classification

• clusters described by simple distributions 1. mean vector & circle

(variable radius) 2. rectangle

• simple shapes may not describe the actual geometry of cluster. 1. rectangle 2. circle 3. ellipse

• Standard Max-Likelihood: cluster specified with - mean vector - ellipse

• More general: cluster adapted to sample distribution

• Pattern recognition in remote sensing has been based on the intuitive notion that pixels belonging to the same class should have similar gray values in a given band.

•Variations in a cluster will occur even if the pattern is very well defined.

•This variability may be due to quantization noise, atmospheric variability, illumination differences, or any number of other 'natural" and instrumental sources of variability.

•If several patterns (classes) appear as distinct clusters then the classes are discriminable.

Page 3: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-3

W. Philpot, Cornell University, January 01

Classification

• Classification is a procedure for sorting pixels and assigning them to specific categories.

• Characterize pixels using features - original band gray values - algebraic combinations of the original bands - texture measures

• The set of characterizations is called a feature vector e.g., x = (k1, k2, k3)

where: k1 = gray value in band 1 k2 = gray value in band 2 k3 = ratio of gray values in bands 4 and 3 Feature Vector A feature vector, x, locates a pixel in measurement or feature space.

Measurement space can be thought of as an n-dimensional scattergram whose axes represent the gray values in the original bands.

Definitions Feature vector (x): x = (k1, k2, k3, ..., kn)

The feature (or measurement) vector locates a pixel in feature (or measurement space.

Feature (Measurement) space: Measurement space can be thought of as an n-dimensional scattergram whose axes represent the gray values in the original bands. If some or all of the original bands are replaced with features it is called feature space.

Page 4: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-4

W. Philpot, Cornell University, January 01

Discriminant function, di(x)

A function of the measurement vector, x, which provides a measure of the probability that x belongs to the ith class. A distinct discriminant function is defined for each class, under consideration.

Decision Rule The rule which assigns pixels to a particular class based on a comparison of the discriminant function for each class.

Classification is a procedure for sorting pixel and assigning them to

specific categories. x = measurement vector di(x) = discriminant function

Page 5: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-5

W. Philpot, Cornell University, January 01

CLASSIFICATION There are two general types of classification techniques: supervised and unsupervised classification. A. Supervised Classification

A classification procedure is said to be supervised if the user either defines the decision rules for each class directly or provides training data for each class to guide the computer classification.

General procedure 1. Set up a classification scheme - Determine the categories into

which the pixels are to be assigned. The categories should be appropriate to the scale and resolution of the image data as well as to the application.

2. Choose training and test data - Select at least two subsets of data from the image to represent each of the desired categories. One subset will be used to "train" the classifier, the other will be used to evaluate (test) the results of the classification. Ideally, these subsets would be selected independently and should not overlap.

3. Determine the parameters (if any) required for the classifier - Use the training data to estimate the parameters required by the particular classification algorithm to be used. (Define the discriminant functions.)

4. Perform the classification - Evaluate the discriminant functions and assign pixels to classes by applying the decision rule for each pixel.

5. Evaluate the results - Use the test data to evaluate the accuracy of the classification.

Supervised classifiers differ primarily in the definition of the discriminant function.

Page 6: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-6

W. Philpot, Cornell University, January 01

For the ith class, if ki,min < k < ki,max then di(k) = 1 else di(k) = 0

for class 1: if k11 < k1 < k12 and k22 < k2 < k23 then d1(x) = 1 else d1(x) = 0

for class 2: if k13 < k1 < k14 and k24 < k2 < k25 then d2(x) = 1 else d2(x) = 0

for class 3: if k14 < k1 < k15 and k21 < k2 < k24 then d3(x) = 1 else d3(x) = 0

• The parallelpiped classifier models the data distribution as a rectangle

in measurement space. It is simple and fast (real time). • Problems arise with the parallelpiped classifier when classes do not fit

this model well. For example, consider the two-class case:

Even though the classes do not overlap, the rectangular boundaries defined by the classifier do overlap. Within the overlap region the classifier cannot distinguish between the two classes.

Page 7: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-7

W. Philpot, Cornell University, January 01

A more powerful and adaptable classification scheme is needed. Minimum Distance Classifier The minimum distance classifier defines classes in terms of the distance from a prototype vector – usually the mean vector for the class.

Advantage • somewhat better description of the data distribution.

Disadvantage •lots of computation (2*m*n where n = # bands and m= # pixels) •fails easily

Page 8: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-8

W. Philpot, Cornell University, January 01

2. Maximum-likelihood classification Maximum-likelihood classification is a general term which encompasses the most common supervised classifiers. All maximum-likelihood classifiers derive ultimately from Baye's Theorem:

( ) ( )( )

ii

p |p |

ω =x

xx

(7.1) Baye's Theorem

where: x = measurement vector ωi = the ith class

p(x) = the probability density function (normalized histogram) p(x|ωi) = the class-conditional probability density function (normalized class histogram) p(ωi) = the prior probability p(ωi|x) = the posterior probability

x A measurement vector is simply an ordered list of the value (grey value, digital number) of a pixel in each of the image channels. That is, x = (x1, x2, x3, ... , xn) where xi is the grey value of the pixel in the ith band.

p(x) The probability density function (normalized histogram) is the probability that a pixel selected at random from the image will have the measurement vector x. This can also be referred to as the "joint probability" that the pixel will have a value of x1 in band 1, x2 in band 2, etc. The probability density function is computed as the n-dimensional histogram of the image set, divided by the total number of pixels in the image.

p(x|ωi) The class-conditional probability density function (normalized class histogram) is the probability that a pixel chosen randomly from all members of class �i will have the measurement vector x. p(x|ωi) is usually estimated from training data, in which case p(x|ωi) is simply the number of times that a pixel with characteristics, x, occurs in the training data, divided by the total number of pixels in the training set.

p(ωi) The prior probability (or a priori probability) is the probability that class ωi will occur in the image. This is usually determined (if at all) from prior knowledge: preliminary field tests; maps; historical data; experience of the user. When there is insufficient information to make any reasonable estimate of, it is common practice to assume that all the probabilities are equal. Classifications based on this assumption tend to favor the most rarely occurring classes.

p(ωi|x) The posterior probability is the probability that a pixel belongs to class �i given that it has the characteristics, x.

Page 9: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-9

W. Philpot, Cornell University, January 01

Given Baye's Theorem, it is easy to define a rule by which pixels can be sorted among

various classes: a pixel will be assigned to the class with the highest posterior probability given that it has the characteristics of the measurement vector x. This is the Baye's optimum, or maximum likelihood decision rule:

( ) ( )

( )( ) ( )

( )ji i

i

p | pp | px iff

p pjω ωω ω

∈ ω ≥xx

x x for all j ≠ i

Maximum-Likelihood Decision Rule

In practice one defines a discriminant function, di(x) for each class such that:

( ) ( )

( )i i

i

p pd (x)

pω ω

=x

x (7.2)

Each pixel is selected one at a time from the image, the discriminant functions for every class are computed for that pixel, and the pixel is assigned to the discriminant function with the highest value, i.e.,

x ∈ ωi iff di(x) ³ dj(x) for all j ≠ i

The discriminant function is usually simplified as much as possible in order to minimize computation time. The first simplification is to drop the p(x) term. Since p(x) is the same for all classes and since only the relative values of di(x) are of concern, classification results will not be altered. In such cases,

d i (x) = p(x|ω i) p(ω i) (7.3)

When no estimates of p(ωi) are possible, the typical assumption is that p(ω) = 1/nc where nc is the number of classes. The expression for di(x) can be simplified even further to:

d i (x) = p(x|ω i) (7.4)

Non-parametric classifiers

If the class-conditional probability density function, p(x|ωi), is estimated by using the frequency of occurrence of the measurement vectors in the training data, the resulting classifier is non-parametric. An important advantage of the non-parametric classifiers is that any pattern, however irregular it may be, can be characterized exactly. This advantage is generally outweighed by two difficulties with the non-parametric approach:

1) Specification of an n-dimensional probability density function requires a massive amount of memory or very clever programming, and

2) It is difficult to obtain a large enough training sample to adequately characterize the probability distribution of a multi-band data set.

Page 10: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-10

W. Philpot, Cornell University, January 01

Example: Consider the 1-band, two-class problem for which training data are givin the table below. Both training sets have 34 sam

en ples.

The cross-hatched area represents gray values that are occupied by both classes.

gv n n*gv [n*(gv-µ)]2 n n*gv [n*(gv-µ)]2 0 1 0 16 0 0 0.00 1 2 2 36 0 0 0.00 2 4 8 64 0 0 0.00 3 6 18 36 0 0 0.00 4 8 32 0 0 0 0.00 5 6 30 36 0 0 0.00 6 4 24 64 1 6 23.84 7 2 14 36 2 14 60.29 8 1 8 16 1 8 8.31 9 0 0 0 3 27 31.89 10 0 0 0 6 60 28.03 11 0 0 0 8 88 0.89 12 0 0 0 6 72 44.97 13 0 0 0 5 65 112.11 14 0 0 0 0 0 0.00 15 0 0 0 2 30 67.82 sum 34 136 304 34 370 378.14 Class 1 Class 2 mean 4.00 mean 10.88 variance 9.21 variance 11.46

std. dev. 3.04 std. dev. 3.39

The class-conditional probability distribution for each class is approximated by the normalized histogram for that class: p(x|ω1) = h1(x)/N p(x|ω2) = h2(x)/N e.g. p(6|ω1) = 4/34 = 0.118 p(6|ω2) = 1/34 = 0.029 p(7|ω1) = 2/34 = 0.059 p(7|ω2) = 2/34 = 0.059 p(8|ω1) = 1/34 = 0.029 p(8|ω2) = 1/34 = 0.029

Page 11: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-11

W. Philpot, Cornell University, January 01

The discriminant function for class 1 is then given by: p(x|ω1) p(ω1). Any pixel for which p(x|ω1) p(ω1) > p(x|ω2) p(ω2) will be assigned to class 1 and vice versa. Any pixel with a gray value between 0 and 6 will be assigned to class 1; any pixel with a gray value of 9-14 or 16 will be assigned to class 2. A pixel with a gray value of 15 will be assigned to neither class, and pixels with gray values of 7 or 8 are equally likely to be assigned to either class. If p(ω1) > p(ω2) then pixels with gray values of 7 or 8 will be assigned to class 1. Letting p(ω1) =0.7 and p(ω2) =0.3, we have:

d1(8) = p(8|ω1) p(ω1) = (1/34) * 0.7 = 0.021

d2(8) = p(8|ω2) p(ω2) = (1/34) * 0.3 = 0.009

and

d1(7) = p(7|ω1) p(ω1) = (2/34) * 0.7 = 0.041

d2(7) = p(7|ω2) p(ω2) = (2/34) * 0.3 = 0.018

Problems: 1. sparse training data

2. uncertainty in areas of equal probability

The problem of sparse training data is the more serious of the two. If 10 pixels were marginally sufficient to define the gray value distribution in the one band example above, then one might expect to need 102=100 samples for a training set to define a two-band distribution, and 10n samples to define an n-band distribution. Thus, for a four-band data set, there should be at least 104 pixels for training in each class in order to minimally describe the multispectral data distribution. This is impractical at best and is generally impossible.

A further problem exists. There are 256n possible values for the class-conditional probability, p(x|ωi), for an n-band, byte data set. It is difficult to define an array for n greater than 2 on most computers.

Although algorithms do exist for implementing the non-parametric maximum-likelihood classifier, addressing both the problems of sparse data and minimizing the data storage requirements, these algorithms have not seen extensive use in remote sensing applications and will not be treated here. The approach taken in remote sensing is to make some assumption about the data distribution and parameterize p(x|ωi).

Parametric Classifiers One way to avoid the difficulties encountered with a non-parametric classification scheme is to parameterize the data, i.e., to assume that each probability function can be adequately approximated with a mathematically simple functional form. In effect, we try to model the data distribution in feature space in a way that can be easily parameterized. One can visualize the "model" in 2-dimensions as a rectangle, circle, or ellipse that surrounds the data and whose

Page 12: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-12

W. Philpot, Cornell University, January 01

center is located at the data mean. The training data are then used to find parameters that will optimize the fit of the assumed function to the data distribution. This will require far fewer samples for the training data set. The most common approach is to assume that the data are distributed normally (as in a normal distribution) in color space. Since the functional form of a normal distribution is well defined, the probabilities are completely specified when the means, variances, and covariances are specified. The single-band case In the 1-dimensional (one-band) case, the data distribution for the ith class is completely specified by a mean, mi, and a variance, σi

2 (or standard deviation, σi). Specifically, the class-conditional probability is given by:

( )( )

( )2i

i 1/ 2 2i

1p exp22

⎡ ⎤− μω = −⎢ ⎥

σπ ⎢ ⎥⎣ ⎦

xx (7.5)

and the discriminant function is given by:

( ) ( ) ( )

( )( ) ( )

i i i

2i

i1/ 2 2i

d = p p

1 exp p22

ω ω

⎡ ⎤− μ= −⎢ ⎥

σπ ⎢ ⎥⎣ ⎦

x x

(7.6)

One can avoid some repetitive computations by eliminating any computations that do not affect the results and by performing certain operations ahead of time and storing the results. To this end, it is common practice to use a log transformation and to redefine the discriminant function as:

( ) ( ) ( ) ( )2

ii 2

i

1d = ln 2 ln p2 2

− μ− π − + ωi⎡ ⎤⎣ ⎦σ

xx (7.7)

since this eliminates the need for an exponential function and does not change the relative values of the di(x). Since the purpose of the discriminant function is to give assign a relative weighting to each class, the first term in this expression will not be needed since it is independent of class and eliminating it will not alter the comparison of classes. Thus, the discriminant function may be defined as:

( ) ( ) ( )2

ii 2

i

d = ln p2− μ

i− + ω⎡ ⎤⎣ ⎦σx

x (7.8)

Consider the simple example of two classes of equal probability, ω1 and ω2, using the same training set data as in the non-parametric example. Histograms for the training sets of the two classes are shown in the figure below. Again, each training set has N samples (N=34). Instead of specifying probabilities for each gray value, the gray value distribution (histogram) of the

Page 13: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-13

W. Philpot, Cornell University, January 01

class will be assumed to match a normal distribution and the normal distribution can then be used to estimate the probability function.

0

2

4

6

8

10

0 2 4 6 8 10 12 14Gray value

# pi

xels

Class 1mean 3.76variance 9.21std. dev. 3.04

Class 2mean 10.88variance 11.46std. dev. 3.39

For pixels with a gray value of 7 the discriminant functions yield:

d1(7) = – (7 – 3.76)2 / (2*9.21) + ln p(ω1) = − 0.56 + ln p(ω1)

d2(7) = – (8 – 10.88)2 / (2*11.46) + ln p(ω2) = – 0.362 + ln p(ω2)

d1(8) = – (8 – 3.76)2 / (2*9.21) + ln p(ω1) = – 0.784 + ln p(ω1)

d2(8) = – (8 – 10.88)2 / (2*11.46) + ln p(ω2) = – 0.362 + ln p(ω2)

If we assume that the prior probabilities are equal, i.e., p(ω1) = p(ω2) = 0.5, then

d1(7) = − 0.56 + ln (0.5) = −1.261

d2(7) = – 0.362 + ln (0.5) = − 1.350

d1(8) =– 0.784 + ln (0.5) = − 1.477

d2(8) = – 0.362 + ln p(ω2) = − 1.055

Since d 1(7) > d2(7), i.e., it is less negative, pixels with a gray value of 7 or less will be assigned to ω1 and since d2(8) > d 1(8), pixels with gray values of 8 or more will be assigned to class ω2. Since the distributions are continuous, it is even possible to define a decision boundary at which d 1(x) = d2(x). In this case d 1(x) = d2(x) when x2 = 7.2. Note that it is now necessary to know only the mean and standard deviation of the class in order to compute the probabilities for any gray value. By assuming a particular form for the data distribution, computation has been substituted for memory capacity. It is also possible to use sparse training data to characterize the class, and probability ties are rare.

Page 14: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-14

W. Philpot, Cornell University, January 01

The n-band case.

In the n-band case, the expression for the discriminant function becomes:

( ) ( ) ( ) (t 1i i i i1/ 2

i

1 1d = exp ln p22

−⎡ ⎤− − − − + )iω⎡ ⎤⎣ ⎦⎢ ⎥⎣ ⎦πx x xμ ∑ μ

∑ (7.10)

As with the one-band case taking the natural log of (7.10) yields and equivalent expression for the discriminant function:

( ) ( ) ( ) ( ) (t 1i i i i i

1 1 1d = ln 2 ln ln p2 2 2

−− π − − − − + ω )i⎡ ⎤⎣ ⎦x x x∑ μ ∑ μ (7.11)

As before, since the first term is independent of class, it will not contribute to the class comparison and we may simplify the discriminant function to:

( ) ( ) ( ) (t 1i i i i i

1 1d = ln ln p2 2

−− − − − + ω )i⎡ ⎤⎣ ⎦x x x∑ μ ∑ μ (7.12)

The first and last terms in the above expression need only be computed once since neither varies with gray value. Both depend only on class. The middle term describes an n-dimensional ellipsoidal distribution centered on the mean vector, µi. The matrix product:

( ) ( )t 1i i i

−− −x xμ ∑ μ

is called the Mahalanobis Distance.

The discriminant function defined in Equation (7.12) is the most common form of the maximum-likelihood classifier. Unless otherwise stated, it is this form that is usually implied when one refers to maximum-likelihood classification.

Within the confines of the assumption of a normal distribution, Equation 7.12 is capable of describing a wide array of data distributions. The multinormal distribution models a data distribution as an n-dimensional ellipsoid in feature space. The size, orientation and ellipticity of the ellipsoid are completely variable.

The decision boundary between any two classes is a surface in the n-dimensional space defined by the set of points for which the discriminant functions of the two classes are equal, i.e., where:

d1(x) = d2(x)

In the illustration below, all points on a single ellipse have equal probabilities of belonging to the class whose mean is located at the center of the ellipse. Points at the intersection of two ellipses of equal probability are on the decision boundary. The decision boundary connects all the points of equal probability for the two classes.

Page 15: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-15

W. Philpot, Cornell University, January 01

The multinormal discriminant function is the most common form of the maximum-likelihood classifier. Unless otherwise stated, it is this form that is implied when one refers to maximum-likelihood classification.

• The multinormal distribution models a data distribution as an n-dimensional ellipsoid in feature space.

• The size, orientation and ellipticity of the ellipsoid are completely variable.

There are no simplifications to Equation 7.12 that can be made without significantly altering the nature of the model.

μ x1

x1-μ

x2 x2-μ

Σ

1 2d ( ) d ( )=x x Decision Boundary

ωi

ωωj

255

Ban

d 2

0 255Band 10

Page 16: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-16

W. Philpot, Cornell University, January 01

Simplification 1: Σi = ci Σ

If the classes can all be assumed to vary in a similar fashion being differentiated only by the mean vector and the magnitude of the variance then some computational efficiency can be gained.

The discriminant function can be simplifies to:

( ) ( ) ( ) ( ) (t 1ii i i i

1 cd = ln c ln p2 2

−− ∑ − − − + ω )i⎡ ⎤⎣ ⎦x x xμ ∑ μ (7.13)

The major simplification in this form of the discriminant function is that the Mahalanobis distance has been replaced by a simpler function.

11 12 13

21 22 23i i i

31 32 33

c c

σ σ σ⎛ ⎞⎜ ⎟σ σ σ⎜ ⎟∑ = ∑ =⎜ ⎟σ σ σ⎜ ⎟⎜ ⎟⎝ ⎠

Simplification 2: Σi = Σ In this variation, the covariance matrix is assumed to be identical (in size, ellipticity and orientation) for all classes. Only the location of the ellipse actually varies. In this case:

( ) ( ) [ti i i

11d ( ) ln p( )2

−= − − μ − μ + ωΣx x x ]i (7.13)

11 12 13

21 22 23i

31 32 33

σ σ σ⎛ ⎞⎜ ⎟σ σ σ⎜ ⎟∑ = ∑ =⎜ ⎟σ σ σ⎜ ⎟⎜ ⎟⎝ ⎠

0 255

255

Ban

d 2

0 Band 1

0 250

25

Band

Ban

d

Page 17: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition 17 W. Philpot, Cornell University, August, 99

Simplification 3: Σ i = σi2 I ; I = the identity matrix

In this case all classes are represented by spherical distributions of different sizes. Only the mean vector and the magnitude of the variance of each class varies. The discriminant function may be reduced to:

( ) ( ) ( )2i i i

1 1d = ln ln p2 2

− σ − − + ωi⎡ ⎤⎣ ⎦x x μ (7.14)

i i i

1 0 00 1 0

I0 0 1

⎛ ⎞⎜ ⎟⎜ ⎟∑ = σ = σ⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

In this case there are immediate benefits in computational simplicity. The matrix operations of the Mahalanobis distance have been replaced by a simple vector product.

Simplification 4: Σ i = σ2 I ; I = the identity matrix

In this case, all class dependence has been removed from the covariance matrix. The result is only a slightly simplified computational scheme, but a severely restricted model. Now, the class data are modeled by a sphere and the size of the sphere (variance) is fixed. Only the mean vector differentiates among classes. This is the minimum distance to mean classifier since a pixel will be assigned to a class if its measurement vector is closer to that class mean than to any other. The simplified discriminant function may be written:

( ) ( )2i i

1d = ln p2

− − + ωi⎡ ⎤⎣ ⎦σx x μ

i

1 0 00 1 0

I0 0 1

⎛ ⎞⎜ ⎟⎜∑ = σ = σ⎜⎜ ⎟⎜ ⎟⎝ ⎠

⎟⎟

255

Ban

d 2

0 255 0 Band 1

0 250

25

Band

Ban

d

Page 18: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-18

W. Philpot, Cornell University, January 01

Error Analysis

Reference Data (test data) 1 2 3 4 5 6 7 Total

0 x01 x02 x03 x)4 x05 x06 x07 Σx1j

1 x11 x12 x13 x14 x15 x16 x17 Σx1j

2 x21 x22 x23 x24 x25 x26 x27 Σx2j

3 x31 x32 x33 x34 x35 x36 x37 Σx3j

4 x41 x42 x43 x44 x45 x46 x47 Σx4j

5 x51 x52 x53 x54 x55 x56 x57 Σx5j

6 x61 x62 x63 x64 x65 x66 x67 Σx6j

C

lass

ified

Dat

a

7 x71 x72 x73 x74 x75 x76 x77 Σx7j

Total Σxi1 Σxi2 Σxi3 Σxi4 Σxi5 Σxi6 Σxi7 N

xij = # pixels assigned to class i which actually belong to class j N = total # pixels Nc = number of classes

Class 0 is for pixels that were not assigned to any defined class.

Reference (Test) Data

wat

er

urba

n

HD

res

LD

res

fore

st

gras

s

field

1

field

2

1 2 3 4 5 6 7 8 Totalunclass. 0 147 0 3 5 10 15 1 35 216water 1 652 0 0 0 0 0 0 0 652urban 2 1 231 61 11 1 2 0 0 307HDres 3 0 44 465 247 0 27 0 0 783LDres 4 0 0 8 587 205 15 16 0 831forest 5 0 0 0 21 703 4 0 51 779grass 6 0 0 4 3 1 345 0 1 354field1 7 0 7 59 259 0 88 111 0 524field2 8 0 0 0 3 8 45 2 357 415

Tota 800 282 600 1136 928 541 130 444 4861p0 = 3451

Cla

ssifi

ed d

ata

Page 19: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-19

W. Philpot, Cornell University, January 01

l

Normalized Contingency Matrix

Reference (Test) Data

Cla

ssifi

ed D

ata

1 2 3 4 5 6 7 Tota0 p10 p20 p30 p40 p50 p60 p70 c0

1 p11 p21 p31 p41 p51 p61 p71 c1

2 p12 p22 p32 p42 p52 p62 p72 c2

3 p13 p23 p33 p43 p53 p63 p73 c3

4 p14 p24 p34 p44 p54 p64 p74 c4

5 p15 p25 p35 p45 p55 p65 p75 c5

6 p16 p26 p36 p46 p56 p66 p76 c6

7 p17 p27 p37 p47 p57 p67 p77 c7

Total r1 r2 r3 r4 r5 r6 r7 N

l

x i j = # pixels from reference class i which were classified as class j N = total # pixels p i j = x i j / N Nc = number of classes

water urban HDres LDres forest grass field1 field21 2 3 4 5 6 7 8.000 Tota

unclass. 0 0.030 0.000 0.001 0.001 0.002 0.003 0.000 0.007 0.044water 1 0.134 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.134urban 2 0.000 0.048 0.013 0.002 0.000 0.000 0.000 0.000 0.063HDres 3 0.000 0.009 0.096 0.051 0.000 0.006 0.000 0.000 0.161LDres 4 0.000 0.000 0.002 0.121 0.042 0.003 0.003 0.000 0.171forest 5 0.000 0.000 0.000 0.004 0.145 0.001 0.000 0.010 0.16grass 6 0.000 0.000 0.001 0.001 0.000 0.071 0.000 0.000 0.073field1 7 0.000 0.001 0.012 0.053 0.000 0.018 0.023 0.000 0.108field2 8 0 0.000 0.000 0.001 0.002 0.009 0.000 0.073 0.085

Total 0.165 0.058 0.123 0.234 0.191 0.111 0.027 0.091 1.0

Cla

ssifi

ed D

ata

Page 20: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-20

W. Philpot, Cornell University, January 01

Parameters used in computing error metrics:

iji j

total # of pixels = x N = ∑∑

c c c cN N N N

c ik kj k k2k 1 i 1 j 1 k 1

1p x x r cN = = = =

⎡ ⎤= =⎢ ⎥

⎣ ⎦∑ ∑ ∑ ∑

number of classes = Nc

Pixels classified correctly by chance

Row sum: no unclassified pixelsc

c

N

i ij i1 i2 i3 iNj 1

r p p p p p=

= = + + + +∑

0

c

c

N

i ij 0 j 1 j 2 j N jj

c p p p p p=

= = + + + +∑

Column sum: summation includes unclassified pixels

Diagonal sum: 0pc

c c

N

ii 11 22 33 N Nj 0

p p p p p=

= = + + + +∑

Page 21: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-21

W. Philpot, Cornell University, January 01

Coefficients of agreement:

1. Overall Accuracy (OA) - The OA includes overall errors of omission without regard to class membership. It

disregards errors due to commission entirely and as such represents an overly optimistic estimate of classification accuracy. It might be better named an Overall Producer's accuracy.

Total # of test pixels correctly classifiedOATotal # of pixels in test sets

=

- Overall accuracy:

cNii

iii 0

i 1iji j

x1OA x p

x N =

= = =∑

∑∑∑

2. Producer's Accuracy (PA) - Neglects errors of commission but accounts for errors of omission.

i# of test pixels correctly classified in class i PA

# of pixels in test class i=

- Producer's accuracy:

a) for class j b) for combined classes

c

ii iii N

iij

j 0

x pPAcx

=

= =

c cN Nii

tot ii 1 i 1c c

1 1PA PAN N= =

= =i

pc∑ ∑

3. User's Accuracy (UA) - Neglects errors of omission but accounts for errors of commission.

i# of pixels correctly classified in class iUA

# of pixels classified as class i=

- User's accuracy: a) for class j b) for combined classes

c

ii iii N

iij

i 1

x pUArx

=

= =

c cN Njj

tot ii 1 i 1c c

p1 1UA UAN N= =

= =jr

∑ ∑

Page 22: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-22

W. Philpot, Cornell University, January 01

Reference (Test) DataC

lass

ified

dat

a

wat

er

urba

n

HD

res

LD

res

fore

st

gras

s

field

1

field

2

1 2 3 4 5 6 7 8 Totalunclass. 0 147 0 3 5 10 15 1 35 216water 1 652 0 0 0 0 0 0 0 652urban 2 1 231 61 11 1 2 0 0 307HDres 3 0 44 465 247 0 27 0 0 783LDres 4 0 0 8 587 205 15 16 0 831forest 5 0 0 0 21 703 4 0 51 779grass 6 0 0 4 3 1 345 0 1 354field1 7 0 7 59 259 0 88 111 0 524field2 8 0 0 0 3 8 45 2 357 415

Total 800 282 600 1136 928 541 130 444 4861p0 = 3451

Class accuracy estimates all0 1 2 3 4 5 6 7 8 classe

Overall - - - - - - - - - 0.71Producer's - 0.82 0.82 0.78 0.52 0.76 0.64 0.85 0.80 0.75

User's - 1.00 0.75 0.59 0.71 0.90 0.97 0.21 0.86 0.75Kappa - 0.79 0.81 0.73 0.42 0.71 0.61 0.84 0.79 0.66

s

Page 23: Pattern Recognition & Classificationceeserver.cee.cornell.edu/wdp2/cee6150/Monograph/... · Non-parametric classifiers. If the class-conditional probability density function, p(x

CEE 615: Digital Image Processing Topic 7: Pattern Recognition/Classification 7-23

W. Philpot, Cornell University, January 01

4. Method of Hellden (H) - Estimate of the "mean accuracy" -- the probability that a randomly chosen pixel of a

specific class (k) will be properly classified

- This index is developed heuristically and cannot be derived on either a probability or mathematical basis.

kk kkk

ik kj k ki j

2x 2pHx x r

= =c+ +∑ ∑

5. Method of Short (S) - Also called "mapping accuracy"

- S = 0 for no positive matches; S = 1 for perfect agreement.

- Not affected by sample size

kk kkk

ik kj kk k k kki j

x pHx x x r c p

= =+ − + −∑ ∑

6. Method of Cohen: coefficient of agreement, - the proportion of agreement after chance agreement is removed from consideration.

= 0 when obtained agreement equals chance agreement. K̂

= 1 for perfect agreement. K̂

K < 0 if obtained agreement is less than chance agreement.

0 c

c

p pK̂1 p

−=

po = proportion of correctly classified pixels

pc = proportion of pixels correctly classified by chance

For individual classes:

ii ij ji

i i j jk

2ij ji

i j j

N x x xK̂

N x x

⎡ ⎤− ⎢ ⎥

⎣ ⎦⎡ ⎤

− ⎢ ⎥⎣ ⎦

∑ ∑ ∑ ∑

∑ ∑ ∑kk k k

k k k

p r cc r c

−=