How can I separate training and test sets in a hyperspectral image and apply Conditional Random Field (CRF) for pixel classification?
If I choose pixels randomly, some of the neighboring pixels of a training pixel are test pixels, and if I ignore them there is not enough pixels to estimate the parameters of the pairwise potential.
Although some papers don't care whether the neighboring pixels are from the test set while training, I don't think it is scientifically correct. I want to separate training and test sets such that there is no test pixel in the window around a training pixel while training, and the same rule holds for the test phase.
Another strategy can be selecting patches, but classes are imbalanced in these images, so I cannot find enough patches that are fully separated.
If I were using Markov Random Field (MRF), I would be able to apply pairwise potentials as a post-processing smoothing operation, after the classification using spectral vectors are done since in MRF we model the joint probability as the multiplication of normalized unary and pairwise potentials. However, in CRF there is only one partition function that normalizes the multiplication of unary and pairwise potentials, so I have to estimate pairwise parameters during training.