원시데이터 수집 시스템
선정목록으로

Estimating the Probability Density Function of New Fabrics for Fabric Anomaly Detection

간접 관련 패션 · (24) 패션(코오롱FnC) (17) 스펀본드 부직포(3) 자동차 인테리어 소재

기본 정보

저자
  1. Oliver Rippel — Institute of Imaging & Computer Vision, RWTH Aachen University, Aachen, Germany, --- Select a Country ---
  2. Maximilian J. Müller — Institute of Imaging & Computer Vision, RWTH Aachen University, Aachen, Germany, --- Select a Country ---
  3. Andreas Münkel — Institut für Textiltechnik, RWTH Aachen University, Aachen, Germany, --- Select a Country ---
  4. Thomas Gries — Institut für Textiltechnik, RWTH Aachen University, Aachen, Germany, --- Select a Country ---
  5. Dorit Merhof — Institute of Imaging & Computer Vision, RWTH Aachen University, Aachen, Germany, --- Select a Country ---
DOI
10.5220/0010163604630470
저널
–
발행년도
2021
발행기관
–
피인용수
4
라이선스
cc-by-nc-nd
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.5220/0010163604630470
토픽
Color Science and Applications
OpenAlex ID
W3126517905

평가 내용

관련도
간접 관련
사업분야
패션 · (24) 패션(코오롱FnC)
부 분야
(17) 스펀본드 부직포, (3) 자동차 인테리어 소재
R&D 측면
공정·제조
확신도
0.80
근거 용어
fabric anomaly detection, automated defect detection, machine vision, textile industry, quality control
판단 근거
본 논문은 섬유(Fabric) 제조 공정에서 발생하는 결함을 자동으로 검출하기 위한 딥러닝 기반의 이상 탐지(Anomaly Detection) 기술을 다루고 있습니다. 이는 코오롱인더스트리의 산업용 부직포(17), 자동차 인테리어 소재(3), 패션(24) 등 섬유 기반 제품의 품질 관리 공정에 직접적으로 응용 가능한 기술입니다.
R&D 활용 포인트
섬유 및 부직포 생산 라인에 머신 비전 기반의 자동 결함 검출 시스템을 도입하여, 인력 의존도를 낮추고 품질 관리의 일관성과 효율성을 높이는 데 활용할 수 있습니다.
평가 입력
섹션 본문 24,517자

초록

초록이 없습니다.

본문 25,073자

본문 펼치기
Image-based quality control aims at detecting anomalies (i.e. defects) in products. Supervised, data driven approaches have greatly improved Anomaly Detection (AD) performance, but suffer from a major drawback: they require large amounts of annotated training data, limiting their economic viability. In this work, we challenge and overcome this limitation for complex patterned fabrics. Investigating the structure of deep feature representations learned on a large-scale fabric dataset, we find that fabrics form clusters according to their fabric type, whereas anomalies form a cluster on their own. We leverage this clustering behavior to estimate the Probability Density Function (PDF) of new, previously unseen fabrics, in the deep feature representations directly. Using this approach, we outperform supervised and semi-supervised AD approaches trained on new fabrics, requiring only defect-free data for PDF-estimation. INTRODUCTION The textile industry is one of the biggest industries in the world, producing several million tons of fabric every year. With ever-increasing technological progress, fabric production has become a highly optimized process, leading to low error rates. INTRODUCTION Despite their rare occurrence, fabric anomalies still have a strong economic impact, making their detection an essential aspect of fabric production. However, Anomaly Detection (AD) in fabrics is still largely performed by human operators, and the outcome depends on training, skill level and fatigue of the personnel. Even at peak performance, human operators are only capable of detecting 60-80% of defects (Karayiannis et al., 1999;See, 2012), while accounting for at least 10% of total labor costs (Newman and Jain, 1995). Together, this calls for machine vision solutions that are capable of automated defect detection. INTRODUCTION With recent advances in Machine Learning, learning-based approaches have seen a strong increase in performance, becoming ever more relevant for automated defect detection. Based on the required degree of supervision, learning-based approaches can a https://orcid.org/0000-0002-4556-5094 b https://orcid.org/0000-0002-1672-2185 be categorized into supervised, semi-supervised and unsupervised algorithms. In the context of AD, these categories are defined as follows (Chandola et al., 2009;Ruff et al., 2020a): INTRODUCTION • supervised: providing a fully labeled dataset containing both anomalies as well as normal data. INTRODUCTION • semi-supervised: providing a dataset that contains normal data only. 1 INTRODUCTION • unsupervised: providing an unlabeled dataset, i.e. a dataset that consists mostly of normal data but may also contain anomalies. INTRODUCTION As fabric defects are rare events and expensive to sample, semi-supervised algorithms are most commonly employed in literature. These algorithms have been shown to work for fabrics of low complexity (i.e. unimodal appearance), but show limited performance in fabrics of high complexity (i.e. multimodal appearance) (Mei et al., 2018;Hu et al., 2019). Supervised approaches have also been successfully applied to fabric defect detection, adapting classification and object detection approaches such as ResNet and YOLO (Zhang et al., 2018;Gao et al., 2019). However, while progress has been made with respect to detection performance, none of the supervised approaches suit the need of the textile industry for low changeover times. The reason for this is that defects have to be collected and annotated to yield a sufficiently large image basis for every individual fabric, which is a tedious, time-consuming and expensive process. INTRODUCTION While algorithms have been proposed to tackle this limitation, research focusses on synthesizing new defective images based on prior knowledge about defect appearances. This knowledge may either be learned implicitly by Generative Adversarial Networks (GANs) (Liu et al., 2019;Rippel et al., 2020b), or explicitly inferred from experts (Han and Yu, 2020). INTRODUCTION In this work, we propose an alternative approach: we hypothesize that the deep feature representations learned by a supervised model on a large-scale fabric dataset are discriminative also to new fabric types unseen during training. We analyze the structure of learned deep feature representations using tdistributed Stochastic Neighbor Embedding (t-SNE), and find that fabrics form clusters according to their fabric type, with anomalies forming an additional cluster on their own. Based on this finding, we construct an AD model for new fabrics unseen during training by approximating their Probability Density Function (PDF) in the deep representations, achieving state-of-the-art performance. Related Work In previous work, it has been shown that it is possible to train supervised (Wu et al., 2020) and semisupervised (Han and Yu, 2020) fabric defect detection methods that can generalize well within a diverse fabric defect dataset. However, Liu et al. (Liu et al., 2019) show poor out-of-the-box performance for supervised fabric defect segmentation applied to new fabrics, and demonstrate that detection performance can be increased by using synthetic defects generated by GANs in addition to normal fabric images for model fine-tuning. Additionally, Rippel et al. (Rippel et al., 2020b) show that supervised defect detection models can also be trained from scratch on new fabrics, again employing defects generated by GANs in combination with normal fabric images as the training dataset. While defect synthesis by means of GANs is also popular for improving performance at general surface inspection tasks (Le et al., 2020), GANs are known to be notoriously difficult to train (Miyato et al., 2018), diminishing the practical applicability of developed approaches. Related Work Weninger et al. (Weninger et al., 2018) demonstrate that fabric defect detection is possible on fabrics unseen during training without relying on defects synthesized by GANs. However, their approach necessitates high-resolution images for float-point detection, increasing computational burden for an eventual machine vision solution. Furthermore, their work utilizes plain-weave fabrics with simple patterns only. Related Work While not directly applied to the AD task, Lee et al. (Lee et al., 2018) show that out-of-distribution (OOD) detection can be achieved by modeling the PDF of input images in learned deep feature representations. This is achieved by linking generative models using Gaussian Discriminant Analysis on deep features to discriminative models trained by the softmaxcrossentropy loss. The linkage between deep generative and discriminate models has been applied by Rippel et al. to the industrial AD use case (Rippel et al., 2020a). Related Work Together, this motivated us to construct a transferable fabric anomaly detector by modeling the PDF of new fabrics in deep feature representations learned by training on a large-scale fabric dataset, which is presented in more detail in the following. MODELING THE PDF FOR CROSS-FABRIC ANOMALY DETECTION We aim to construct a transferable anomaly detector for fabrics by modeling the PDF of new fabrics in deep feature representations. While features learned by Image-Net training have been successfully applied to the industrial AD task in a transfer learning setting (Andrews et al., 2016;Rippel et al., 2020a), the 4-channel dimensionality of our data (cf. Section 3) prevents a straight-forward use of Image-Net features. Therefore, we instead learn domain-specific features from scratch using subsets of our collected dataset by training a supervised, deep anomaly detector. We then extract the deep features before the final mapping to the anomaly score to model the PDF of new fabrics unseen during training, as deeper features have shown increased performance also in the transfer learning AD setting (Andrews et al., 2016;Rippel et al., 2020a). Rippel et al. (Rippel et al., 2020a) have shown that the individual dimensions of deep feature representations learned by discriminative models are highly correlated. Therefore, the model used to estimate the PDF of new fabrics should be multivariate. Modeling Unimodal PDFs For unimodal data, the PDF can be modeled by using a multivariate Gaussian (Bishop, 2006). A useful anomaly score here is the Mahalanobis distance (Mahalanobis, 1936), which uniquely determines the value of an observation's PDF under the Gaussian. Modeling Unimodal PDFs We estimate the mean of the multivariate Gaussian using Maximum Likelihood (ML) estimation, which corresponds to the empirical mean. For the covariance matrix, we apply shrinkage as proposed by Ledoit et al. (Ledoit et al., 2004). Regularization by means of shrinkage is necessary since the number of observations used for fitting is in the same order of magnitude as the dimensionality of the fitted Gaussian (refer Table 1). Modeling Multimodal PDFs For multimodal data, the PDF can be approximated by fitting a Gaussian Mixture Model (GMM), i.e. a linearly weighted sum of individual Gaussians Modeling Multimodal PDFs We approximate the parameters of a GMM by using the Expectation Maximization (EM) algorithm (Bishop, 2006). Modeling Multimodal PDFs Compared to the unimodal setting, modeling multimodal PDFs by means of GMMs introduces an additional hyperparameter, the number of Gaussian mixture components K. We estimate K by using the Bayesian Information Criterion (BIC) proposed by Schwarz et al. (Schwarz et al., 1978). While other metrics such as the Akaike information criterion (AIC) exist, we choose the BIC score for its strong regularization characteristics. Modeling Multimodal PDFs For the multimodal setting, a sensible anomaly score is the negative log-likelihood of x defined as NLL = −log(p(x)). Modeling Multimodal PDFs ( Modeling Multimodal PDFs We also propose min(M i (x)), i.e. the minimum Mahalanobis distance for all Gaussian Mixture components, as a possible anomaly score to account for large differences in φ. Learning Deep Feature Representations In order to learn the deep representations required by our approach, we train a ResNet18 (He et al., 2016) from scratch in a Leave-One-Out (LOO) manner for each fabric present in the dataset, where all fabrics except the one evaluated on are used for training (cf. Figure 2). We employ the sigmoid-crossentropy loss together with the Adam optimizer (Kingma and Ba, 2015), an initial learning rate of 0.001 and a batchsize of 16, training for 15k iterations in total. Learning Deep Feature Representations To improve robustness of our evaluation w.r.t. the initially available fabric dataset, we performing an additional 5-fold evaluation on each respective dataset used for feature learning stratified for anomaly prevalence, reporting averaged results for our approach. Modeling PDF on Held Out Fabric After having learned the deep feature representations, we apply our PDF modeling strategies to each held out fabric. We make use of two different datasplits to enable fair comparison with both supervised and semi-supervised reference methods that serve as a benchmark. First, we estimate the PDF of the held out fabric using the training set of a supervised split, where anomalous data is removed from the training set (see Figure 2). We refer to this setting as "clean", and can use it to compare against supervised baselines as our method assumes that only "normal" data is used for estimating the PDF. Second, we estimate the PDF of the held out fabric using the training set of a semi-supervised split, where anomalous data is only present in the test set (cf. Section 1 and Figure 2). Modeling PDF on Held Out Fabric In addition to these two splits, we also estimate the PDF of the held out fabric using the training set of a supervised split where anomalous data remains in the training set (see Figure 2). This setting corresponds to applying our strategy in an unsupervised manner, i.e. where unlabeled anomalies are present during PDF estimation. Modeling PDF on Held Out Fabric For each splitting variant, we first model the PDF of the new fabric using the training set and then apply the constructed AD model to the respective test set that is identical to the one used by our baselines. For the GMM setting, models were fit for K ∈ {2, ..., 19} mixture components, and the best model was selected based on lowest BIC on the training set. Modeling PDF on Held Out Fabric Note that model weights are fixed and the data of held out fabrics used only to parametrize the PDF models. Also, validation sets of held out fabrics are unused by our approach, giving an additional advantage to the reference methods and yielding strong baselines. Modeling PDF on Held Out Fabric To investigate the benefit of our proposed PDF modeling, we also apply the discriminative decision boundary learned on the deep feature representations during training of our deep feature extracting model (henceforth refered to as LOO model) to the held out fabrics. DATASET The fabric dataset used in this work comprises a total of 20 patterned fabrics. For each fabric, paired frontlight RGB and backlight luminance were acquired at 2000 DPI resolution, resulting in a 4 channel image. A defective as well as a defect-free sample image can be found in Figure 1. DATASET In total, the dataset contains 4270 samples across all fabrics, of which 320 are labeled as defective (see Table 1). EXPERIMENTS AND RESULTS In our work, we hypothesize that deep representations learned by a supervised model on a large-scale fabric dataset are discriminative also to new fabric types unseen during training, and propose to achieve this by modeling the PDF of new fabrics in learned representations directly. EXPERIMENTS AND RESULTS To test our hypothesis, we evaluate our approach on every single fabric of the dataset individually, aggregating single fabric performances to generate robust insights. Similarly, we also train state-of-the art supervised and semi-supervised AD algorithms on each fabric to serve as comparison. Evaluation Details. As AD poses a binary decision problem, we report the Area Under the Receiver Operator Characteristic (ROC) curves as well as the Area Under the Precision Recall (AUPR) curve to evaluate model performance. Note that the AUPR is better suited to report results for skewed/imbalanced datasets such as ours. Further, to improve robustness of evaluations, a 5-fold evaluation is performed for each held out fabric (refer Figur 2 for details). EXPERIMENTS AND RESULTS Supervised Reference Method. As a baseline for supervised AD methods, we train a ResNet18 from scratch on each individual held out fabric on the supervised splits as outlined in Figure 2. Training parameters are identical to those used for feature learning (refer Section 2.3). Model selection was performed based on AUPR achieved on the validation set. EXPERIMENTS AND RESULTS Semi-supervised Reference Method. For the semi-supervised baseline, we train a convolutional autoencoder from scratch on each individual held out fabric, using ResNet18 as encoder and an "inverted" ResNet18 as decoder (i.e. every operation of the encoder should be inverted by the decoder). For the upsampling operations we employ pixel shuffle as introduced by Shi et al. (Shi et al., 2016) to reduce checkerboard artifacts which would be present otherwise. The latent dimension of the bottleneck is set to 32 and yields proper reconstruction of normal images in all fabrics. We train the model using the structured-similarity measure and select the model based on the lowest reconstruction loss on the validation set, and training is performed using the Adam optimizer together with an initial learning rate of 0.0005 and a batch-size of 16 for a total of 45k iterations. As autoencoders yield residual images as output, an aggregation is necessary to yield an image-level anomaly score. While the threshold employed for ROC/PR calculation is set on the pixel level, we perform connected component analysis and label a test image as defective only if it contains a connected component at least as big as the smallest anomaly present in the test dataset. Note that by extracting the minimal anomaly size from the test set, knowledge is introduced to the autoencoder approach, increasing complexity of the procedure and giving it an additional advantage. Implementation Details. For all approaches, images are resized to a size of 896 × 896 pixels and training is performed in a patch-wise manner on 224 × 224 sized patches. We replace Batch Normalization with Instance Normalization (Ulyanov et al., 2016) for all models which was seen to improve performance in every method in preliminary experiments. For supervised methods (i.e. feature learning step of our method and the supervised reference method), patches are cropped around the defect if available (and randomly otherwise), and random oversampling was applied to ensure that 25% of training samples were defective. For semi-supervised methods, patches are cropped randomly. Inference is subsequently performed on whole images, spatially averaging patch-wise generated features and predictions respectively for the supervised methods. For the semi-supervised methods, patch-wise predictions are stitched to form a 896 × 896-sized reconstructed image as the basis for residual computation. Connected component analysis as described above is applied to the stitched residual image. EXPERIMENTS AND RESULTS Results. Table 2 shows that applying the LOO model to the held out fabrics without any modifications (i.e. applying the decision boundary learned on the large-scale fabric dataset) already performs comparably to the respective reference methods (cf. Table 2). Results also show that additional performance is gained by our proposed PDF modeling of new fabrics in the learned representations. Here, it can be seen that multimodal distributions modeled by GMMs outperform unimodal distributions. Specifically, an AUPR of 86.0 ± 12.9% (Mean ± STD) is achieved for GMM modeling and NLL anomaly score Highest values are boldfaced for Mean, whereas lowest values are boldfaced for STD. Leave-One-Out (LOO) denotes our proposed approach using either unimodal Gaussian (Gaussian) or multimodal Gaussian Mixture Model (GMM) in distance to nearest mixture component (GMM maha) or likelihood mode (GMM NLL). LOO alone denotes applying the initially learned decision boundary to the new fabric. Connected Component AutoEncoder (CCAE) refers to the semi-supervised benchmark, and Classifier to the supervised benchmark. For details regarding data splits we refer to Figure Table 2). This indicates that the PDF of individual fabrics in the learned representations is indeed multimodal, which is further supported by the clustering tendencies observed in latent space visualization (cf. Figure 3), where two distinct clusters can be observed for the fabric colored in red. Note that both unimodal and multimodal modeling of PDFs outperform the respective state of the art, achieving both higher average AUROC/AUPR values as well as lower standard deviations (cf. Table 2). EXPERIMENTS AND RESULTS While estimating the PDF by means of GMMs increases AD performance, the method also becomes more sensitive to unlabeled anomalies in the training data and fails in the unsupervised setting (cf. Table 2). Presence of unlabeled anomalies in the dataset used for PDF estimation also affects the unimodal Gaussian negatively, albeit not as strongly as the GMM variants. Regarding the choice of an appropriate anomaly score for multimodal PDFs, NLL outperforms minimum Mahalanobis distance consistently by a small margin (cf. Table 2). EXPERIMENTS AND RESULTS When investigating single fabric performance of the best performing configuration (i.e. GMM based PDF modeling and NLL as anomaly score on semi- supervised splits), it can be seen that within-fabric performance is very robust, whereas performance across fabrics may vary considerably (Figure 4). This variation is stronger for AUPR compared to AUROC. DISCUSSION We have proposed and validated the modeling of PDFs in deep feature representations generated by large-scale dataset training as a method for extending supervised fabric anomaly detectors to previously unseen fabrics, achieving state-of-the-art performance. During evaluation, it was observed that LOO perfor-mance on its own (i.e. applying the learned model without modification to new fabrics) was already comparable to prior state of the art. The reason for this may be found in the clustering behavior of anomalies observed in the latent space visualizations, where anomalies form a cluster of their own (cf. Figure 3). Notably, this clustering is learned without any additional loss enforcing it. The poor and extremely varying performance of the supervised reference method, a single fabric classifier, can be explained by the small dataset sizes available for the individual fabrics, causing model overfitting. While positive results are achieved for supervised classifiers in literature, used datasets contain between 1 and 2 order of magnitudes more fabric anomalies than the single fabric datasets used here (Gao et al., 2019). DISCUSSION Overall, our approach is a simple yet elegant alternative to the defect synthesis based approaches proposed in previous work (Le et al., 2020;Han and Yu, 2020;Rippel et al., 2020b) and requires no training of GANs, which suffer from instable training. Furthermore, compared to above approaches, no additional model fine-tuning/training is required. DISCUSSION However, our work also has limitations. While superior performance was achieved by multimodal modeling of PDFs via GMMs, this approach is very sensitive to anomalies and thus cannot be applied in an unsupervised manner. Instead, it requires a clean, anomaly-free dataset, i.e. a semi-supervised setting. While such a dataset can be easily generated in practice, it would still be interesting to assess performance of more complex, non-parametric PDF estimation algorithms (e.g. (Trentin, 2018)) in the unsupervised setting. We hypothesize the reason for the aforementioned sensitivity to unlabeled anomalies lies in the clustering behavior of anomalies observed in latent embeddings (cf. Figure 3). GMM components will be fit by the EM algorithm to these clusters, and anomalies thus assigned a higher likelihood under our model. As the unimodal Gaussian is more rigid in it's assumptions about normal data distribution, it is less strongly affected by the anomaly clustering, but also yields less performance due to it's inability to reflect the multimodal nature of fabric appearance. If anomalies were to follow a diffuse PDF instead, as is a longstanding assumption in AD (Ruff et al., 2020a), we expect the GMM approach to be more resistant in the unsupervised regime. Apart from our work, said assumption has also been recently challenged by Ruff et al. (Ruff et al., 2020b). DISCUSSION Furthermore, high AUPR values could not be achieved for all fabrics. We give two possible explanations for this: First, undetected anomalies may be present in the datasets, which have been shown to be detrimental to model performance. We will therefore extensively relabel our dataset to eliminate all label noise. An alternative explanation would be that the learned feature representations fail to properly represent some normal data modes for fabrics that are significantly different from the initial dataset, which is supported by low AUPR values co-occurring with high AUROC values (cf. fabric 6 in Figure 4). This is congruent with observations made by Liu et al. (Liu et al., 2019), where their anomaly segmentation model is capable of defect segmentation in new fabrics but yields too many False Positives prior to finetuning. Reduction of False Positive Rate could be achieved by including normal data of new fabrics for a model retraining or alternatively fine-tuning, possibly improving results without requiring anomalies. Note that this would increase the complexity of the approach. When viewing the difference in appearance of new fabrics as input domain shifts, performance on new fabrics may be further increased by applying methods targeted at increasing model robustness to input domain shifts (e.g. AugMix as proposed by Hendrycks et al. (Hendrycks et al., 2020)). CONCLUSION In this work, we proposed the modeling of PDFs in deep representations as a useful transfer learning approach to extend deep fabric AD models to new, previously unseen fabrics. The approach is simple yet elegant and requires only a small dataset of normal images for PDF estimation. Our comparison against semi-supervised and supervised methods demonstrates the efficiency of our approach. We will further extend our approach by incorporating methods that increase robustness to input domain shifts in the initial model training phase. Additionally, we will investigate methods to fine-tuning learned feature representations directly using normal data only to further reduce False Positive Rate.

섹션 본문 44문단 · 24,137자

(제목 없음)

1Image-based quality control aims at detecting anomalies (i.e. defects) in products. Supervised, data driven approaches have greatly improved Anomaly Detection (AD) performance, but suffer from a major drawback: they require large amounts of annotated training data, limiting their economic viability. In this work, we challenge and overcome this limitation for complex patterned fabrics. Investigating the structure of deep feature representations learned on a large-scale fabric dataset, we find that fabrics form clusters according to their fabric type, whereas anomalies form a cluster on their own. We leverage this clustering behavior to estimate the Probability Density Function (PDF) of new, previously unseen fabrics, in the deep feature representations directly. Using this approach, we outperform supervised and semi-supervised AD approaches trained on new fabrics, requiring only defect-free data for PDF-estimation.

INTRODUCTION

2The textile industry is one of the biggest industries in the world, producing several million tons of fabric every year. With ever-increasing technological progress, fabric production has become a highly optimized process, leading to low error rates.

3Despite their rare occurrence, fabric anomalies still have a strong economic impact, making their detection an essential aspect of fabric production. However, Anomaly Detection (AD) in fabrics is still largely performed by human operators, and the outcome depends on training, skill level and fatigue of the personnel. Even at peak performance, human operators are only capable of detecting 60-80% of defects (Karayiannis et al., 1999;See, 2012), while accounting for at least 10% of total labor costs (Newman and Jain, 1995). Together, this calls for machine vision solutions that are capable of automated defect detection.

4With recent advances in Machine Learning, learning-based approaches have seen a strong increase in performance, becoming ever more relevant for automated defect detection. Based on the required degree of supervision, learning-based approaches can a https://orcid.org/0000-0002-4556-5094 b https://orcid.org/0000-0002-1672-2185 be categorized into supervised, semi-supervised and unsupervised algorithms. In the context of AD, these categories are defined as follows (Chandola et al., 2009;Ruff et al., 2020a):

5• supervised: providing a fully labeled dataset containing both anomalies as well as normal data.

6• semi-supervised: providing a dataset that contains normal data only. 1

7• unsupervised: providing an unlabeled dataset, i.e. a dataset that consists mostly of normal data but may also contain anomalies.

8As fabric defects are rare events and expensive to sample, semi-supervised algorithms are most commonly employed in literature. These algorithms have been shown to work for fabrics of low complexity (i.e. unimodal appearance), but show limited performance in fabrics of high complexity (i.e. multimodal appearance) (Mei et al., 2018;Hu et al., 2019). Supervised approaches have also been successfully applied to fabric defect detection, adapting classification and object detection approaches such as ResNet and YOLO (Zhang et al., 2018;Gao et al., 2019). However, while progress has been made with respect to detection performance, none of the supervised approaches suit the need of the textile industry for low changeover times. The reason for this is that defects have to be collected and annotated to yield a sufficiently large image basis for every individual fabric, which is a tedious, time-consuming and expensive process.

9While algorithms have been proposed to tackle this limitation, research focusses on synthesizing new defective images based on prior knowledge about defect appearances. This knowledge may either be learned implicitly by Generative Adversarial Networks (GANs) (Liu et al., 2019;Rippel et al., 2020b), or explicitly inferred from experts (Han and Yu, 2020).

10In this work, we propose an alternative approach: we hypothesize that the deep feature representations learned by a supervised model on a large-scale fabric dataset are discriminative also to new fabric types unseen during training. We analyze the structure of learned deep feature representations using tdistributed Stochastic Neighbor Embedding (t-SNE), and find that fabrics form clusters according to their fabric type, with anomalies forming an additional cluster on their own. Based on this finding, we construct an AD model for new fabrics unseen during training by approximating their Probability Density Function (PDF) in the deep representations, achieving state-of-the-art performance.

Related Work

11In previous work, it has been shown that it is possible to train supervised (Wu et al., 2020) and semisupervised (Han and Yu, 2020) fabric defect detection methods that can generalize well within a diverse fabric defect dataset. However, Liu et al. (Liu et al., 2019) show poor out-of-the-box performance for supervised fabric defect segmentation applied to new fabrics, and demonstrate that detection performance can be increased by using synthetic defects generated by GANs in addition to normal fabric images for model fine-tuning. Additionally, Rippel et al. (Rippel et al., 2020b) show that supervised defect detection models can also be trained from scratch on new fabrics, again employing defects generated by GANs in combination with normal fabric images as the training dataset. While defect synthesis by means of GANs is also popular for improving performance at general surface inspection tasks (Le et al., 2020), GANs are known to be notoriously difficult to train (Miyato et al., 2018), diminishing the practical applicability of developed approaches.

12Weninger et al. (Weninger et al., 2018) demonstrate that fabric defect detection is possible on fabrics unseen during training without relying on defects synthesized by GANs. However, their approach necessitates high-resolution images for float-point detection, increasing computational burden for an eventual machine vision solution. Furthermore, their work utilizes plain-weave fabrics with simple patterns only.

13While not directly applied to the AD task, Lee et al. (Lee et al., 2018) show that out-of-distribution (OOD) detection can be achieved by modeling the PDF of input images in learned deep feature representations. This is achieved by linking generative models using Gaussian Discriminant Analysis on deep features to discriminative models trained by the softmaxcrossentropy loss. The linkage between deep generative and discriminate models has been applied by Rippel et al. to the industrial AD use case (Rippel et al., 2020a).

14Together, this motivated us to construct a transferable fabric anomaly detector by modeling the PDF of new fabrics in deep feature representations learned by training on a large-scale fabric dataset, which is presented in more detail in the following.

MODELING THE PDF FOR CROSS-FABRIC ANOMALY DETECTION

15We aim to construct a transferable anomaly detector for fabrics by modeling the PDF of new fabrics in deep feature representations. While features learned by Image-Net training have been successfully applied to the industrial AD task in a transfer learning setting (Andrews et al., 2016;Rippel et al., 2020a), the 4-channel dimensionality of our data (cf. Section 3) prevents a straight-forward use of Image-Net features. Therefore, we instead learn domain-specific features from scratch using subsets of our collected dataset by training a supervised, deep anomaly detector. We then extract the deep features before the final mapping to the anomaly score to model the PDF of new fabrics unseen during training, as deeper features have shown increased performance also in the transfer learning AD setting (Andrews et al., 2016;Rippel et al., 2020a). Rippel et al. (Rippel et al., 2020a) have shown that the individual dimensions of deep feature representations learned by discriminative models are highly correlated. Therefore, the model used to estimate the PDF of new fabrics should be multivariate.

Modeling Unimodal PDFs

16For unimodal data, the PDF can be modeled by using a multivariate Gaussian (Bishop, 2006). A useful anomaly score here is the Mahalanobis distance (Mahalanobis, 1936), which uniquely determines the value of an observation's PDF under the Gaussian.

17We estimate the mean of the multivariate Gaussian using Maximum Likelihood (ML) estimation, which corresponds to the empirical mean. For the covariance matrix, we apply shrinkage as proposed by Ledoit et al. (Ledoit et al., 2004). Regularization by means of shrinkage is necessary since the number of observations used for fitting is in the same order of magnitude as the dimensionality of the fitted Gaussian (refer Table 1).

Modeling Multimodal PDFs

18For multimodal data, the PDF can be approximated by fitting a Gaussian Mixture Model (GMM), i.e. a linearly weighted sum of individual Gaussians

19We approximate the parameters of a GMM by using the Expectation Maximization (EM) algorithm (Bishop, 2006).

20Compared to the unimodal setting, modeling multimodal PDFs by means of GMMs introduces an additional hyperparameter, the number of Gaussian mixture components K. We estimate K by using the Bayesian Information Criterion (BIC) proposed by Schwarz et al. (Schwarz et al., 1978). While other metrics such as the Akaike information criterion (AIC) exist, we choose the BIC score for its strong regularization characteristics.

21For the multimodal setting, a sensible anomaly score is the negative log-likelihood of x defined as NLL = −log(p(x)).

22(

23We also propose min(M i (x)), i.e. the minimum Mahalanobis distance for all Gaussian Mixture components, as a possible anomaly score to account for large differences in φ.

Learning Deep Feature Representations

24In order to learn the deep representations required by our approach, we train a ResNet18 (He et al., 2016) from scratch in a Leave-One-Out (LOO) manner for each fabric present in the dataset, where all fabrics except the one evaluated on are used for training (cf. Figure 2). We employ the sigmoid-crossentropy loss together with the Adam optimizer (Kingma and Ba, 2015), an initial learning rate of 0.001 and a batchsize of 16, training for 15k iterations in total.

25To improve robustness of our evaluation w.r.t. the initially available fabric dataset, we performing an additional 5-fold evaluation on each respective dataset used for feature learning stratified for anomaly prevalence, reporting averaged results for our approach.

Modeling PDF on Held Out Fabric

26After having learned the deep feature representations, we apply our PDF modeling strategies to each held out fabric. We make use of two different datasplits to enable fair comparison with both supervised and semi-supervised reference methods that serve as a benchmark. First, we estimate the PDF of the held out fabric using the training set of a supervised split, where anomalous data is removed from the training set (see Figure 2). We refer to this setting as "clean", and can use it to compare against supervised baselines as our method assumes that only "normal" data is used for estimating the PDF. Second, we estimate the PDF of the held out fabric using the training set of a semi-supervised split, where anomalous data is only present in the test set (cf. Section 1 and Figure 2).

27In addition to these two splits, we also estimate the PDF of the held out fabric using the training set of a supervised split where anomalous data remains in the training set (see Figure 2). This setting corresponds to applying our strategy in an unsupervised manner, i.e. where unlabeled anomalies are present during PDF estimation.

28For each splitting variant, we first model the PDF of the new fabric using the training set and then apply the constructed AD model to the respective test set that is identical to the one used by our baselines. For the GMM setting, models were fit for K ∈ {2, ..., 19} mixture components, and the best model was selected based on lowest BIC on the training set.

29Note that model weights are fixed and the data of held out fabrics used only to parametrize the PDF models. Also, validation sets of held out fabrics are unused by our approach, giving an additional advantage to the reference methods and yielding strong baselines.

30To investigate the benefit of our proposed PDF modeling, we also apply the discriminative decision boundary learned on the deep feature representations during training of our deep feature extracting model (henceforth refered to as LOO model) to the held out fabrics.

DATASET

31The fabric dataset used in this work comprises a total of 20 patterned fabrics. For each fabric, paired frontlight RGB and backlight luminance were acquired at 2000 DPI resolution, resulting in a 4 channel image. A defective as well as a defect-free sample image can be found in Figure 1.

32In total, the dataset contains 4270 samples across all fabrics, of which 320 are labeled as defective (see Table 1).

EXPERIMENTS AND RESULTS

33In our work, we hypothesize that deep representations learned by a supervised model on a large-scale fabric dataset are discriminative also to new fabric types unseen during training, and propose to achieve this by modeling the PDF of new fabrics in learned representations directly.

34To test our hypothesis, we evaluate our approach on every single fabric of the dataset individually, aggregating single fabric performances to generate robust insights. Similarly, we also train state-of-the art supervised and semi-supervised AD algorithms on each fabric to serve as comparison. Evaluation Details. As AD poses a binary decision problem, we report the Area Under the Receiver Operator Characteristic (ROC) curves as well as the Area Under the Precision Recall (AUPR) curve to evaluate model performance. Note that the AUPR is better suited to report results for skewed/imbalanced datasets such as ours. Further, to improve robustness of evaluations, a 5-fold evaluation is performed for each held out fabric (refer Figur 2 for details).

35Supervised Reference Method. As a baseline for supervised AD methods, we train a ResNet18 from scratch on each individual held out fabric on the supervised splits as outlined in Figure 2. Training parameters are identical to those used for feature learning (refer Section 2.3). Model selection was performed based on AUPR achieved on the validation set.

36Semi-supervised Reference Method. For the semi-supervised baseline, we train a convolutional autoencoder from scratch on each individual held out fabric, using ResNet18 as encoder and an "inverted" ResNet18 as decoder (i.e. every operation of the encoder should be inverted by the decoder). For the upsampling operations we employ pixel shuffle as introduced by Shi et al. (Shi et al., 2016) to reduce checkerboard artifacts which would be present otherwise. The latent dimension of the bottleneck is set to 32 and yields proper reconstruction of normal images in all fabrics. We train the model using the structured-similarity measure and select the model based on the lowest reconstruction loss on the validation set, and training is performed using the Adam optimizer together with an initial learning rate of 0.0005 and a batch-size of 16 for a total of 45k iterations. As autoencoders yield residual images as output, an aggregation is necessary to yield an image-level anomaly score. While the threshold employed for ROC/PR calculation is set on the pixel level, we perform connected component analysis and label a test image as defective only if it contains a connected component at least as big as the smallest anomaly present in the test dataset. Note that by extracting the minimal anomaly size from the test set, knowledge is introduced to the autoencoder approach, increasing complexity of the procedure and giving it an additional advantage. Implementation Details. For all approaches, images are resized to a size of 896 × 896 pixels and training is performed in a patch-wise manner on 224 × 224 sized patches. We replace Batch Normalization with Instance Normalization (Ulyanov et al., 2016) for all models which was seen to improve performance in every method in preliminary experiments. For supervised methods (i.e. feature learning step of our method and the supervised reference method), patches are cropped around the defect if available (and randomly otherwise), and random oversampling was applied to ensure that 25% of training samples were defective. For semi-supervised methods, patches are cropped randomly. Inference is subsequently performed on whole images, spatially averaging patch-wise generated features and predictions respectively for the supervised methods. For the semi-supervised methods, patch-wise predictions are stitched to form a 896 × 896-sized reconstructed image as the basis for residual computation. Connected component analysis as described above is applied to the stitched residual image.

37Results. Table 2 shows that applying the LOO model to the held out fabrics without any modifications (i.e. applying the decision boundary learned on the large-scale fabric dataset) already performs comparably to the respective reference methods (cf. Table 2). Results also show that additional performance is gained by our proposed PDF modeling of new fabrics in the learned representations. Here, it can be seen that multimodal distributions modeled by GMMs outperform unimodal distributions. Specifically, an AUPR of 86.0 ± 12.9% (Mean ± STD) is achieved for GMM modeling and NLL anomaly score Highest values are boldfaced for Mean, whereas lowest values are boldfaced for STD. Leave-One-Out (LOO) denotes our proposed approach using either unimodal Gaussian (Gaussian) or multimodal Gaussian Mixture Model (GMM) in distance to nearest mixture component (GMM maha) or likelihood mode (GMM NLL). LOO alone denotes applying the initially learned decision boundary to the new fabric. Connected Component AutoEncoder (CCAE) refers to the semi-supervised benchmark, and Classifier to the supervised benchmark. For details regarding data splits we refer to Figure Table 2). This indicates that the PDF of individual fabrics in the learned representations is indeed multimodal, which is further supported by the clustering tendencies observed in latent space visualization (cf. Figure 3), where two distinct clusters can be observed for the fabric colored in red. Note that both unimodal and multimodal modeling of PDFs outperform the respective state of the art, achieving both higher average AUROC/AUPR values as well as lower standard deviations (cf. Table 2).

38While estimating the PDF by means of GMMs increases AD performance, the method also becomes more sensitive to unlabeled anomalies in the training data and fails in the unsupervised setting (cf. Table 2). Presence of unlabeled anomalies in the dataset used for PDF estimation also affects the unimodal Gaussian negatively, albeit not as strongly as the GMM variants. Regarding the choice of an appropriate anomaly score for multimodal PDFs, NLL outperforms minimum Mahalanobis distance consistently by a small margin (cf. Table 2).

39When investigating single fabric performance of the best performing configuration (i.e. GMM based PDF modeling and NLL as anomaly score on semi- supervised splits), it can be seen that within-fabric performance is very robust, whereas performance across fabrics may vary considerably (Figure 4). This variation is stronger for AUPR compared to AUROC.

DISCUSSION

40We have proposed and validated the modeling of PDFs in deep feature representations generated by large-scale dataset training as a method for extending supervised fabric anomaly detectors to previously unseen fabrics, achieving state-of-the-art performance. During evaluation, it was observed that LOO perfor-mance on its own (i.e. applying the learned model without modification to new fabrics) was already comparable to prior state of the art. The reason for this may be found in the clustering behavior of anomalies observed in the latent space visualizations, where anomalies form a cluster of their own (cf. Figure 3). Notably, this clustering is learned without any additional loss enforcing it. The poor and extremely varying performance of the supervised reference method, a single fabric classifier, can be explained by the small dataset sizes available for the individual fabrics, causing model overfitting. While positive results are achieved for supervised classifiers in literature, used datasets contain between 1 and 2 order of magnitudes more fabric anomalies than the single fabric datasets used here (Gao et al., 2019).

41Overall, our approach is a simple yet elegant alternative to the defect synthesis based approaches proposed in previous work (Le et al., 2020;Han and Yu, 2020;Rippel et al., 2020b) and requires no training of GANs, which suffer from instable training. Furthermore, compared to above approaches, no additional model fine-tuning/training is required.

42However, our work also has limitations. While superior performance was achieved by multimodal modeling of PDFs via GMMs, this approach is very sensitive to anomalies and thus cannot be applied in an unsupervised manner. Instead, it requires a clean, anomaly-free dataset, i.e. a semi-supervised setting. While such a dataset can be easily generated in practice, it would still be interesting to assess performance of more complex, non-parametric PDF estimation algorithms (e.g. (Trentin, 2018)) in the unsupervised setting. We hypothesize the reason for the aforementioned sensitivity to unlabeled anomalies lies in the clustering behavior of anomalies observed in latent embeddings (cf. Figure 3). GMM components will be fit by the EM algorithm to these clusters, and anomalies thus assigned a higher likelihood under our model. As the unimodal Gaussian is more rigid in it's assumptions about normal data distribution, it is less strongly affected by the anomaly clustering, but also yields less performance due to it's inability to reflect the multimodal nature of fabric appearance. If anomalies were to follow a diffuse PDF instead, as is a longstanding assumption in AD (Ruff et al., 2020a), we expect the GMM approach to be more resistant in the unsupervised regime. Apart from our work, said assumption has also been recently challenged by Ruff et al. (Ruff et al., 2020b).

43Furthermore, high AUPR values could not be achieved for all fabrics. We give two possible explanations for this: First, undetected anomalies may be present in the datasets, which have been shown to be detrimental to model performance. We will therefore extensively relabel our dataset to eliminate all label noise. An alternative explanation would be that the learned feature representations fail to properly represent some normal data modes for fabrics that are significantly different from the initial dataset, which is supported by low AUPR values co-occurring with high AUROC values (cf. fabric 6 in Figure 4). This is congruent with observations made by Liu et al. (Liu et al., 2019), where their anomaly segmentation model is capable of defect segmentation in new fabrics but yields too many False Positives prior to finetuning. Reduction of False Positive Rate could be achieved by including normal data of new fabrics for a model retraining or alternatively fine-tuning, possibly improving results without requiring anomalies. Note that this would increase the complexity of the approach. When viewing the difference in appearance of new fabrics as input domain shifts, performance on new fabrics may be further increased by applying methods targeted at increasing model robustness to input domain shifts (e.g. AugMix as proposed by Hendrycks et al. (Hendrycks et al., 2020)).

CONCLUSION

44In this work, we proposed the modeling of PDFs in deep representations as a useful transfer learning approach to extend deep fabric AD models to new, previously unseen fabrics. The approach is simple yet elegant and requires only a small dataset of normal images for PDF estimation. Our comparison against semi-supervised and supervised methods demonstrates the efficiency of our approach. We will further extend our approach by incorporating methods that increase robustness to input domain shifts in the initial model training phase. Additionally, we will investigate methods to fine-tuning learned feature representations directly using normal data only to further reduce False Positive Rate.

참고문헌

참고문헌 정보가 없습니다.