Learning Invariant Feature Spaces