# A Novel Dataset for Fabric Defect Detection: Bridging Gaps in Anomaly Detection
## 2 Related Work
### Fabric Defect Detection
#### 2.2.1 Traditional Methods  
We briefly cover each traditional method, along with their respective submethods, in the following sections. Statistical approaches analyse the spatial distribution of grey pixel values in an image. These approaches comprise histogram statistics, auto-correlation functions, co-occurrence matrices, local binary patterns (LBP), and mathematical morphological features [27]. **Histogram statistics. ** A histogram displays statistical information on the grey-level pixel distribution in an image. Some commonly used histogram statistics are the range, mean, standard deviation, variance, and median. There are also histogram comparison statistics, such as L1/L2 norm, Mallows or EMD distance, Bhattacharyya distance, Matusita distance, divergence, Chi-square, and normalised correlation coefficient, which can be used as texture features [28]. Anomalous variations in these statistics can then be tracked and usually correspond to defects in the fabric. This type of approach is simple and not taxing computationally but has shown weak performance in detecting small defects [29; 30]. **Co-occurrence matrices. ** Spatial grey-level co-occurrence matrices (GLCMs) are statistical methods that measure the spatial relationships of grey-scale pixels into co-occurrence matrices. These functions calculate how often specific pairs of pixels, with certain values and spatial relationships, occur in an image, given a displacement vector, and extract texture features from these matrices [31]. This method has been used multiple times across a wide variety of tasks [32; 33] but shows lower performance than alternative methods and is computationally demanding [34]. **Auto-correlation functions**. Auto-correlation functions measure spatial frequency and depict maxima at multiple locations corresponding to the length (or width) of the repetitive primitive of an image [35]. This method is used primarily in textures with a repetitive nature, such as textiles, and are unsuited to erratic textures [36]. **Local binary patterns** An LBP is a shift-invariant complementary measure for local image contrast. It uses the grey level of a sliding window's central pixel as a threshold against surrounding pixels and outputs a weighted sum of thresholding neighbouring pixels. It has been applied in defect detection with different types of surfaces, such as ceramic [37], wood [38], and OLED panels [39]. It is insensitive to changes in illumination and image rotation and has a low computational cost but low performance [40]. **Mathematical morphological features. ** Mathematical morphology performs a geometric description and representation of a shape by extracting useful components from an image. This is accomplished through basic operations such as expansion, erosion, opening, and closing [41]. It is used across fields such as medicine [42] or civil engineering [43]. This method is sensitive to defect sizes and shapes and effective for segmentation tasks but is at its most effective when performed on patterned fabric and ineffective otherwise [44]. Spectral approaches employ spatial- and frequency-domain features, with spatial features being used to discover a defect's location, while frequency features help determine whether a defect is present. These approaches work by extracting texture primitives and then generalizing the obtained texture with spatial layout rules. These approaches are widely used but only effective when used on textures with a high degree of periodicity and are ineffective otherwise [45]. We cover the most common approaches of this type, namely: Fourier transform, wavelet transform, Gabor transform, and filtering methods. **Fourier transform**. The Fourier transform, derived from the Fourier series, involves converting signals from a spatial domain to a frequency domain [46]. As the spatial domain is often noise-sensitive, the frequency domain is a better alternative towards finding defects [47].