Optimizing Perturbations for Improved Training of Machine Learning Models