Difference of convex algorithms for bilevel programs with applications in hyperparameter selection