A Margin Technique for Dimension Reduction with Applications to Hyperspectral Imagery