Cellular Automata (CA) are simple, easily parallelizable models that have been used extensively for various computational tasks. Such models are especially useful for image processing, as mapping automaton cells to image pixels is straightforward and intuitive. This paper proposes a novel optimization framework for CA rules based on evolutionary algorithms and used in edge detection. This approach addresses the problem of optimizing an individual CA rule for one image and extends it to the optimization of a generic CA rule for a set of similar images. In order to maximize the transferability of the optimized rule, the algorithm is trained on sets of images using a curriculum learning approach. A study of the supervised fitness function as well as batch optimization experiments show that the algorithm is robust and competitive with the state-of-the-art methods.