Spatial defect pattern recognition on semiconductor wafers