End-to-end training of a two-stage neural network for defect detection accepted to ICPR 2020. Published on June 1, 2020. Direct link to: https://arxiv.org/abs/2007.07676