1. A non-transitory computer readable medium storing a computer program product having code executable by a processor to perform a method comprising: receiving a first image of a target component of a fabricated device, a second image of a first reference component of the fabricated device for the target component, and a third image of a second reference component of the fabricated device for the target component; generating a first difference image based on a first comparison of the first image and the second image, the first difference image indicating differences between the first image and the second image; generating a second difference image based on a second comparison of the first image and the third image, the second difference image indicating differences between the first image and the third image; generating a third difference image based on the first difference image and the second difference image, the third difference image indicating defect signals for the target component; identifying defect candidates from the third difference image; for each of the identified defect candidates at a location in the third difference image: determining a threshold based on a local area surrounding the location of the defect candidate, comparing a signal at the location of the defect candidate to the threshold to determine whether the defect candidate is a defect.