Delineation of curvilinear structures is an important problem in ComputerVision with multiple practical applications. With the advent of Deep Learning,many current approaches on automatic delineation have focused on finding morepowerful deep architectures, but have continued using the habitual pixel-wiselosses such as binary cross-entropy. In this paper we claim that pixel-wiselosses alone are unsuitable for this problem because of their inability toreflect the topological impact of mistakes in the final prediction. We proposea new loss term that is aware of the higher-order topological features oflinear structures. We also introduce a refinement pipeline that iterativelyapplies the same model over the previous delineation to refine the predictionsat each step while keeping the number of parameters and the complexity of themodel constant. When combined with the standard pixel-wise loss, both our new loss term andour iterative refinement boost the quality of the predicted delineations, insome cases almost doubling the accuracy as compared to the same classifiertrained with the binary cross-entropy alone. We show that our approachoutperforms state-of-the-art methods on a wide range of data, from microscopyto aerial images.