spectral icon indicating copy to clipboard operation
spectral copied to clipboard

Add kernel matched filter

Open zxdawn opened this issue 1 year ago • 4 comments

The kernel matched filter (KMF) is defined in Kwon & Nasrabadi (2007).

Briefly, Given kernel function and target/background matrix, the KMFresponse is given by:


\begin{align} 
        y(\hat{k}_r) = \frac{\hat{k}_t^T \hat{K}^{-2} \hat{k}_x}{\hat{k}_t^T \hat{K}^{-2} \hat{k}_t} \\

    where:

       \hat{k}_{t}^T=k_{t}^T-\frac{1}{N} \sum_{i=1}^N k\left(x_i, t\right) \overrightarrow{1} \\
       \hat{k}_{x}^T=k_{x}^T-\frac{1}{N} \sum_{i=1}^N k\left(x_i, x\right) \overrightarrow{1} \\

\end{align}

$\hat{K}$ is the centered kernel (Gram) matrix, K = K(X, X) = (K)ij the N × N kernel matrix whose entries are the dot products 〈φ(xi ),φ(x j )〉.

$\hat{k}$ is a kernel, such as linear kernel, polynomial kernel and Gaussian Radial Bases Function kernel (RBF).

The inverse $\hat{K}^{-2}$ may not be numerically stable if the background spectral samples are not independent. Therefore, the pseudo-inverse of K is used, which is based on eigenvalue decomposition, where eigenvectors with eigenvalues larger than eigval_min are used.

zxdawn avatar Sep 07 '23 11:09 zxdawn

I have tested the preliminary version of KMF using the lan sample data and found there seems something wrong .... The notebook is on the gist.

MF

image

KMF with poly kernel

Original data: image

Normalized data: image

KMF with rbf kernel

Original data: image

Normalized data: image

zxdawn avatar Sep 07 '23 11:09 zxdawn

In the gist notebook, did you intend for your normalization to use an average over rows (as opposed to the entire image)? That is what your function appears to be doing.

tboggs avatar Sep 10 '23 22:09 tboggs

Yes, because most push-broom sensors have a slightly nonuniform behavior at different cross-track positions. I see someone applied it here.

zxdawn avatar Sep 10 '23 22:09 zxdawn

I have also tested with some small real data and the result is also strange. Here's the gist.

zxdawn avatar Sep 14 '23 19:09 zxdawn