A module in a neural network which is configured to carry out a method of enhancing object detection in a digital image of known underlying structure using pre-processed images with underlying structure and with any objects detected and bounding boxes inserted over the objects, the method comprising:
- extracting or generating images with the underlying structure but without objects detected as negative images;
- extracting images with the underlying structure and with an object detected as positive images;
- inputting pairs of negative and positive images through a feature extraction section in a neural network to extract feature vectors of the images;
- contrasting feature vectors of each pair of positive and negative images and thereby provide a contrast vector and gating the result to form an attention vector;
- and
- processing the attention vector and the feature vector of the positive image to produce an output.