Structural max-margin discriminant analysis for feature extraction