Chapter 6 focuses on building segmentation, or building footprint extraction, using the hypothesis that building footprints are often composed of simple polygons made up of straight lines and corners. A CNN is trained, not to directly generate the segmentation map, but the energy function terms for an Active Contour Model (ACM). The experiments show that the CNN learns where in the image the polygon has to be pushed and where corners should be allowed or prevented, resulting in a substantial improvement over stateof-the-art models. This thesis confirms that the use of domain-specific prior knowledge, in this case to Earth Observation (EO), in data driven methods can result in smaller and better performing models. In particular in the context of DL, where the complexity and "black-box" nature of the models often limit the interpretability required for the injection of prior knowledge and hamper the trustworthiness of the final results, the conclusions of this thesis point at the design of models that explicitly allow for the injection of priors as a very promising field.