Neural networks for the optical recognition of defects in cloth