Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kernel matched filter #156

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

zxdawn
Copy link

@zxdawn zxdawn commented Sep 7, 2023

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
Copy link
Author

zxdawn commented Sep 7, 2023

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

@tboggs
Copy link
Member

tboggs commented Sep 10, 2023

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.

@zxdawn
Copy link
Author

zxdawn commented Sep 10, 2023

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

@zxdawn
Copy link
Author

zxdawn commented Sep 14, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants