Stable generalization of convex functions