Method for enhancing the detection outcome of a computer implemented deep neural network on performing a segmentation task of identifying a region of interest in an input image, comprising the steps of, - performing two training tasks on said deep neural network based on a set of training images to obtain a trained deep neural network that is trained on the identification of said region of interest on two different representations of said region of interest, said representations being a digital image mask indicating the presence or probability of presence of an area of the segmentation target at a respective pixel location in the corresponding training image and digital image mask indicating the presence or the probability of presence of a contour of the segmentation target at a respective pixel location in the corresponding training image, - for each new image obtaining a detected confidence level region map, representing a pixel wise probability of the presence of a part of the region of interest in said image in the form of an image matrix, and a detected confidence level contour map, representing a pixelwise probability of the presence of a part of a contour in said image in the form of an image matrix, from said trained deep neural learning network, - from said detected confidence level contour map, iteratively determine a set of discrete contour elements (301,301') to describe said detected confidence level contour map as a contour by optimizing the sum of functions describing said discrete contour elements as a best fit to said detected confidence level contour map, - performing a validation of each of said discrete contour elements by evaluating a measure d of agreement of an improved proposal contour (210,210) with said detected confidence level region map of said region of interest said improved proposal contour (210,210') comprising said contour element, - returning a final contour result comprising said validated contour elements as a result for the identified region of interest, characterised in that the input image and each new image are medical images, said contour is a closed contour and the functions describing the discrete contour elements are continuous functions, wherein the discrete contour elements can be expressed in an analytical way. - performing two training tasks on said deep neural network based on a set of training images to obtain a trained deep neural network that is trained on the identification of said region of interest on two different representations of said region of interest, said representations being a digital image mask indicating the presence or probability of presence of an area of the segmentation target at a respective pixel location in the corresponding training image and digital image mask indicating the presence or the probability of presence of a contour of the segmentation target at a respective pixel location in the corresponding training image, - for each new image obtaining a detected confidence level region map, representing a pixel wise probability of the presence of a part of the region of interest in said image in the form of an image matrix, and a detected confidence level contour map, representing a pixelwise probability of the presence of a part of a contour in said image in the form of an image matrix, from said trained deep neural learning network, - from said detected confidence level contour map, iteratively determine a set of discrete contour elements (301,301') to describe said detected confidence level contour map as a contour by optimizing the sum of functions describing said discrete contour elements as a best fit to said detected confidence level contour map, - performing a validation of each of said discrete contour elements by evaluating a measure d of agreement of an improved proposal contour (210,210) with said detected confidence level region map of said region of interest said improved proposal contour (210,210') comprising said contour element, - returning a final contour result comprising said validated contour elements as a result for the identified region of interest, characterised in that the input image and each new image are medical images, said contour is a closed contour and the functions describing the discrete contour elements are continuous functions, wherein the discrete contour elements can be expressed in an analytical way.