Neural networks with image recognition by pairs