Co-design consists of optimizing the parameters of the lens and the processing together to obtain a gain in performance for the entire optical/processing chain, which requires new optimization tools, as traditional optical design ones can no longer be used easily. In the state of the art, joint optical/processing optimization methods based on statistical scene and blur models and analytical performance models have been proposed, and recently, new approaches based on the joint optimization of a neural network and optical components with a large database have been developed. However, to the best of our knowledge, no comparison of co-design results using either a model-based or a data-based approach for the same task have been conducted, which is the scope of this paper. We consider here the optimization of phase masks to extend the camera depth of field. We compare the optimization results using a performance model based on restoration error using either a generalized Wiener filter, or a neural network. We investigate the optimization trend depending on the neural network complexity, the starting point of the optimization and the possible interaction between the two approaches.