• No results found

Change graph

In document List of Figures (sider 65-69)

5.4 Change graph

Assuming that the affinities inAX and AY have been appropriately aligned, then these two matrices are ready to be compared. In the previous exam-ple, the main assumption is that sensors observing the same reality should produce similar graphs. Extending it further, this should hold for hetero-geneous images acquired at different times over an unchanged scene. From the opposite perspective, dissimilar affinity matrices mean that the spatial relationships within the images are different, suggesting that changes have occurred. This means that the change graph associated with the affinity values

Achangei,j =|AXi,j−AYi,j| ∈[0,1], i, j ∈ {1, . . . , n} (5.16) should capture strategic information about where and how strong the per-turbations in the affinities are, and consequently give an indication of change in the scene. This core hypothesis is the fundamental base for the method-ologies developed in Paper I and Paper II presented in chapters 7 and 8, as explained below.

5.4.1 Frobenius norm of A

change

The intuition behind this choice is quite simple: the more drastic, intense, and widespread a change is, the more different AX and AY are, and the larger the Frobenius norm of Achange is. Theoretically, for the patches X and Y of size h×w rearranged in sets of n=h·w vectors,

0≤ kAchangekF ≤√

n2−n, (5.17)

where the term n2 in the square root stems from the number of elements in Achangei,j ≤1∀i, j ∈ {1, . . . , n}and the subtraction ofn is due to the fact that the elements on the diagonal of Achange cannot be different from 0.

These bounds are in fact far from being useful in practice, because it is very unlikely that the AXi,j and AYi,j are exactly the same (lower bound) or com-plementary, being zero when the other is one and vice versa (upper bound).

Thus, there is no real reference to say whether a patch contains changes or not just by looking at kAchangekF on its own. Moreover, this does not indi-cate where the changes have occurred inside the patch, because it returns a single value for the whole covered area. In addition, the number of elements

Chapter 5. Self-supervision with affinity matrix comparison 50 Algorithm 1 Possibilities of change for each pixel

for all X ∈ Xh×w ⊂ IX and Y ∈ Yh×w ⊂ IY do Compute dX between all pixel pairs in X Compute dY between all pixel pairs in Y DetermineσX and σY

Compute AX and AY

Compute Achangei,j =|AXi,j −AYi,j| ∈[0,1], i, j ∈ {1, . . . , n} Compute f =kAchangekF

Addf toSiF ∀i∈ {1, . . . , n} end for

for all i= 1, . . . , N do Compute the mean overSiF

end for

in the affinity matrices is equal to n2, which becomes quickly unfeasible in terms of computations and memory consumption, so it is possible to apply this strategy only for h H and w W, being H and W the sizes of the whole images counting N =H·W pixels.

For these reasons, the most suitable solution to exploit the Frobenius norm of Achange is to compute it for small patches, and associate each pixel in the image grid to the average over the setSF of matrix norms evaluated for all the patches covering such pixel. Intuitively, a small average is associated with a small possibility of change, and vice versa for a large average. Algorithm 1 summarises the whole procedure, whose output is an image with sizeH×W and one value per pixel. In a nutshell, a sliding window starts from the upper left corner, and after the evaluation on that patch is done, it is shifted by one pixel and the procedure is iterated for the whole set of overlapping patches. This is the main drawback of this technique, since the loop over all these patches can be computationally heavy. Shifting the sliding window by a factor larger than one would speed up the algorithm, but with a much poorer result: intuitively, the final outcome would exhibit an unnatural tile pattern.

The Frobenius norm of Achange was exploited in Paper I of this thesis, but

51 5.4. Change graph was replaced with the improved algorithms described in the next sections for Paper II and Paper III.

5.4.2 Vertex degrees of the change graph

An alternative way to infer information from the change graph is to draw the attention to its vertices. The main idea is that if some pixels have been affected by changes, many of their affinities with the other pixels will have changed between AX and AY, apart from the exceptional cases in which two pixels experience the same change from one class to another. Instead, unchanged pixels have only their affinity with those changed pixels affected.

From the perspective of the change graph, this means that changed pixels have most of their edges associated with a large weight, whereas unchanged pixels have strong connections only towards changed ones. Ergo, the vertex degrees of the change graph can be considered a score that expresses the chance of a pixel being affected by a change. By introducing an adequate scaling factor n = h·w denoting the number of data points in the patches, the score

αi = 1 n−1

Xn j=1

Achangei,j ∈[0,1], i∈ {1, . . . , n} (5.18) can be interpreted as the probability of change for every pixel i inside the patches.

First of all, the main advantage of using this approach rather than the Frobe-nius norm is that these values have an absolute reference, they can be seen as probabilities bounded between 0 and 1. Moreover, each αi relates only to pixel i, instead of being one value assigned to all the involved pixels. In theory, this comparison could be applied directly to the whole imagesIX and IY, if it were not for the computation and memory constraints. In practice, it still must be applied patchwise, but on the other hand it is not necessary to consider the whole set of all the overlapping patches. The sliding win-dow can be moved with shift factor greater than one, selecting a significantly smaller subset of patches. This reduces greatly the computational load with-out affecting substantially the final result. The method is summarised in Algorithm 2, whereP is used to indicate the subset of selected patches. The output is again one value per each of the N =H·W pixels.

The toy example in Fig. 5.3 helps to explain the effectiveness of the approach.

Chapter 5. Self-supervision with affinity matrix comparison 52 Algorithm 2 Probability of change for each pixel

for all patches in the subset P do

Compute distances between all pixel pairs inX Compute distances between all pixel pairs inY DetermineσX and σY

Compute AX and AY

Compute Achangei,j =|AXi,j −AYi,j|, i, j ∈ {1, . . . , n} Compute αi = 1nPn

j=1Achangei,j , i∈ {1, . . . , n} Addαi to Siα∀i∈ {1, . . . , n}

end for

for all i= 1, . . . , N do Compute the mean overSiα

end for

(a)X (SAR) at t1

(b)Y (optical) att2

(c) AX

(d)AY

(e)Achange

(f)α

(g) CD map Figure 5.3: Toy example. a) Patch from the SAR image at time t1; b) Corresponding patch in the optical image at timet2; c-e) Affinity matrices and their absolute difference;

f)αobtained by applying Equation (5.18); g) CD map obtained by thresholdingα.

Figure 5.3a simulates a patchX of 8×8 pixels extracted from a SAR image captured at t1. It consists of four blocks representing four different classes.

The corresponding patchY extracted from an optical image att2 is depicted

53 5.5. Affinities as new high-dimensional representations

In document List of Figures (sider 65-69)