Improved generalization of neural classifiers with enforced internal representation