• No results found

Chapter 4

Class specific dual entropy matrices

We will in this chapter propose a novel choice of the property array. The general definition of this property array is based on the assumption of at least two dif-ferent texture primitive types and attempts to capture some specific contextual information present within the estimated primitives of a specific primitive type.

Using the definitions in section 3.2.1, this is a geometrical method, but it also has strong resemblance with the statistical methods in its way of computing the property array (for the specific primitive type).

We will begin with a definition of the proposed property array. Following this is a discussion of how to extract reasonable features from such an array. A description and discussion of the segmentation methods and then the contex-tual measurement used in this study, two choices the proposed property array depends heavily on, will conclude this chapter.

40 CHAPTER 4. CLASS SPECIFIC DUAL ENTROPY MATRICES the segmentation image B ∈ {0,1, . . . , L−1}m,nand the context value image C∈ {0,1, . . . , V −1}m,n. mand nis the height and width, respectively, of all three images.

Letq(g, l, v)be the discrete probability that the combination of grey levelg, class labell and context valuevoccurs in a specific(A, B, C)-tuple. The global Shannon entropy is then:

e:=−

G−1

X

g=0 L−1

X

l=0 V−1

X

v=0

q(g, l, v) logq(g, l, v),q(g, l, v)>0 (4.1) Using the definition of conditional probabilities and the law of total probability, the class marginal pmf can be written as:

q(g, v|l) := q(g, l, v) PG−1

g0=0

PV−1

v0=0q(g0, l, v0) (4.2) when the denominator is positive; if not, we will define q(g, v|l) as zero (this only happens if no pixels have class label l). From this, we see that the class specific global Shannon entropy is given as:

el:=−

G−1

X

g=0 V−1

X

v=0

q(g, v|l) logq(g, v|l),q(g, v|l)>0 (4.3) We can also derive the class specific grey level histogramq(g|l)and the class specific context histogram q(v|l) by using the law of total probability. The results can be written as:

q(g|l) :=

V−1

X

v=0

q(g, v|l) =

PV−1

v=0 q(g, l, v) PG−1

g0=0

PV−1

v=0 q(g0, l, v) (4.4) q(v|l) :=

G−1

X

g=0

q(g, v|l) =

PG−1

g=0 q(g, l, v) PG−1

g=0

PV−1

v0=0q(g, l, v0) (4.5) where we in both last transitions again assumed the positivity of the denom-inators (which are equal); it follows from the mentioned special case in the definition of the class marginal pmfq(g, v|l)that both these histograms,q(g|l) andq(v|l), are zero in this case (which only occurs if no pixels have class label l).

From the definitions of the class specific grey level histogram and the class specific context histogram, we obtain the class specific grey level entropyl and the class specific spatial entropyζl, respectively, as:

l:=−

G−1

X

g=0

q(g|l) logq(g|l),q(g|l)>0 (4.6)

ζl:=−

V−1

X

v=0

q(v|l) logq(v|l),q(v|l)>0 (4.7) Theclass specific dual entropy matrix (CSDEM)of the classl∈ {0,1, . . . , L−

1}and the imageAwith segmentation imageBand context value imageC, when

4.1. DEFINITION 41 using qG and qV quantification levels per integer entropy for the class specific grey level and spatial entropy, respectively, is defined as:

δ(r(qGl), r(qVζl)) (4.8) where δis the Dirac delta function and r: [0,∞)→N0 is any rounding func-tion. The CSDEM is thus a binary matrix with value one only in the pixel (r(qGl), r(qVζl)). The CSDEM could optionally be defined with the inclusion of a parameterGS which can be used to reduce the number of grey levels in the input imageAbefore the class specific grey level entropy is computed.

Given a set of class labels K ⊆ {0,1, . . . , L−1}, the class specific dual entropy matrices (CSDEMs) of K and the image A with segmentation image B and context value image C is defined as the set {M1, . . . , M|K|} where Ml,

∀l∈K, is defined as the CSDEM of the classland the same input imagesA,B andC. The quantification parametersqG andqV should also here be specified, and the definition of the CSDEMs could also optionally be defined to include a grey level quantification parameterGS.

Because all elements in a CSDEM are zero except a single element (which is one), any CSDEM of an image is extremely sparse in comparison with stan-dard property arrays (like the GLCM) of the same image. The interpretation that a CSDEM estimates the probability of occurrence of each (l, ζl)-pair in an assumed underlying true distribution ofl and ζl, which is the common in-terpretation when using the standard property arrays, is therefore bad for any CSDEM of an image.

When using a CSDEM as a property array, it will be computed for each scene in the learning dataset. In correspondence with the general description in section 3.2.2, we know that a scene is not equivalent with an image. The interpretation that a CSDEM of a scene estimates the probability of occurrence of each (l, ζl)-pair may thus be valid, but only if the property array of the scene is the average of the property array of many subordinate images and also that the number of subordinate images is high relative to the total number of elements in the CSDEM.

4.1.1 Implementation friendly algorithm description

We will here provide a implementation friendly description of the computation of CSDEMs.

Define t : (Rm,n,{0,1}m,n) → Rx as the function which extracts the ele-ments of the first input matrix that is labelled one in the binary second input matrix and e : Zn → [0,∞) as the entropy function which computes the en-tropy (e.g. the Shannon enen-tropy) of a set ofn pixels. Define the input image as A ∈ {0,1, . . . , G−1}m,n, where m is its height, n is its width and G the number of grey levels. The CSDEMs when using GS grey levels and qG and qV quantification levels per integer entropy for the class specific grey level and spatial entropy, respectively, can then be computed using the following steps:

1. IfGS < G, scaleAto GS grey levels.

2. Segment A into L classes using an arbitrary segmentation method. Let the segmented image be denoted as B ∈ {0,1, . . . , L−1}m,n where its elements uniquely define the class label resulting from the segmentation.

Note that Ccould also be the result of any pixel-based classification.

42 CHAPTER 4. CLASS SPECIFIC DUAL ENTROPY MATRICES 3. Define C ∈ {0,1, . . . , V −1}m,n as the context value image of B, i.e.

the image where each pixel is a measurement of the local contextual in-formation of its neighbourhood in B, and where V −1 is the maximum obtainable context value (possibly after applying specific quantification and/or translation). We could expand the definition of C to also or only use the input imageA.

4. For each class labell∈K, whereK⊆ {0,1, . . . , L−1}defines the classes that we wish to obtain property arrays for, the CSDEM is defined as:

δ(r(qGe(t(A, B==l))), r(qVe(t(C, B==l))))) (4.9) where δ is the Dirac delta function and the notation B == l gives the binary matrix of equal size asB where each element has value one if and only if the corresponding element inB has value l.

To obtain CSDEMs of fixed size within each class, which was mentioned as one of the reasonable criteria of the property arrays in section 3.2.2, we compute the total number of quantification levels of the class specific grey level and spatial entropy, respectivelyQG andQV, by applying equation (3.9):

QG = 1 +bqGlog2(min{Al, GS})c (4.10) QV = 1 +bqVlog2(min{Al, V})c (4.11) whereAl is the number of pixels with class labell in B.

If the range of the context values is unknown, it could in the most compre-hensive case be computed as the range of all context values for all scenes in the learning dataset. If some scenes in the validation dataset attains context values outside this range, these contributions could simply be ignored. In fact, if using the set of adaptive texture features described in section 3.2.3, ignoring these contributions does not change the resulting feature values because the estimated discrimination value at these elements in the weight array would be zero for this set of features.