## 2 Review
### Machine Learning-Based Techniques  
As mentioned in the previous section, there are various kinds of feature extracting algorithms, and it is not an easy task to decide on proper features for a given application. As ML-based methods can extract feature automatically from data, they have become an attractive alternative to traditional algorithms. Supervised learning and unsupervised learning are two main categories of ML techniques. In the former, many labelled samples are needed during training stage, in order to allow the system to extract features automatically, whereas, in the latter method, no labelled images are used for training. Our task of PCB defect detection naturally lies in the unsupervised learning category, because large number of defect samples are not usually available during the training stage. The idea to use deep learning for defect detection in PCBs appeared around 2000 [17]. Binary images were used, and the authors used a vector quantization neural network, which was trained using thousands of defective patterns, along with binary morphological image processing. Many studies have been conducted on the effectiveness of ML-based methods for defect detection. In [18], a neural network-based feature extraction method was used for textured images. In [19], a neural network was used for steel defect classification using supervised learning. A neural network-based inspection algorithm was applied on the DAGM dataset in [20], which outperformed existing defect detection techniques. In [21], a convolutional neural network (CNN)-based algorithm was implemented for railway track fastener defect detection, which could identify and locate defects simultaneously, and it outperformed traditional methods in speed, as well as accuracy. It could be observed that the above methods are based on supervised ML methods. Specifically, for PCBs, several works could be mentioned. Supervised learning for defect detection was used starting from [6]. Types and number of PCB defects may vary in different studies. For example, in [7], seven groups of PCB defects were used; in [22], fourteen types were considered; in [6], six classes were used for training the network, one normal class, along with five defects (short, copper, spur, mouse bite, and open). The number of images was increased by data augmentation techniques, as the number of defective samples was rather small. It is reported that the accuracy of almost 100% has been achieved. This study was, however, based on images that were artificially rendered; therefore, generalization of the results on real images would not be realistic. Some industry players, such as VIDI Systems AG (www.vidi-systems.com accessed on 28 November 2021), have provided automated visual inspection solutions. They have offered supervised learning-basedsolutions that presumably work well. They have also proposed an unsupervised solution (for electromotors) based on autoencoders [23], which employ DBN generative graphical model. The training was done on normal images (no defect samples). One-class classification (OCC) is an alternative technique to supervised learning in situations with insufficient number of each class samples available for training. In this approach, the whole set of samples is of two types: normal and defective (abnormal). For example, a set of labeled samples (300 defect images, along with 400 defect-free images) was used, in [24], for a deep CNN-supervised training to translate the normal samples into a hypersphere of a multi-dimensional feature space, in which the defect samples should be mapped outside this hypersphere. Another OCC technique can be found in [25], where only defect-free samples were used during training. An end-to-end procedure to detect and localize defects was proposed by the authors for fabric defect detection. This model was able to detect defects (both seen and not seen before) in textile fabrics. However, the numbers of fabric pattern images used for training was not disclosed.