Training neural networks with structured noise improves classification and generalization