In this paper, we investigate the defect detection by making use of pre-made reference image data and classify the defects by using the artificial neural network. The approach is composed of three main parts. The first step consists of a proper generation of two reference image data by using a low level morphological technique. The second step proceeds by performing three times logical bit operations between two ready-made reference images and just captured image to be tested. This results in defects image only. In the third step, by extracting four features from each detected defect, followed by assigning them into the input nodes of an already trained artificial neural network we can obtain a defect class corresponding to the features. All of the image data are formed in a bit level for the reduction of data size as well as time saving. Experimental results show that proposed algorithms are found to be effective for flexible defect detection, robust classification, and high speed process by adopting a simple logic operation.