Silk fabric defect detection method based on stage noise multi-feature discrimination network
By introducing a pseudo-anomaly generation strategy and a multi-feature discrimination module for stage noise multi-feature discrimination network, the problem of detecting silk fabric defects with complex texture details that is difficult to detect in the existing technology is solved, and a more efficient defect detection effect is achieved.
Patent Information
- Application Number
- CN202410851891.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2044-06-28
AI Technical Summary
Existing fabric defect detection methods based on deep convolutional neural networks are ineffective at detecting defects in silk fabrics with complex texture details and diverse appearances, and traditional methods have shortcomings in feature extraction and adaptability.
A defect detection method for silk fabrics based on a staged noise multi-feature discrimination network is proposed. By introducing a staged pseudo-anomaly generation strategy and a multi-feature discrimination module, pseudo-anomaly features are generated using a generative adversarial network, and detection accuracy is improved by using a dual discriminator.
It improves the accuracy and adaptability of detecting defects in silk fabrics, better identifies complex texture details, enhances the model's focus on texture details, and improves the accuracy and efficiency of detection.
Smart Images

Figure CN118864365B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of fabric defect detection technology, specifically relating to a method for detecting defects in silk fabrics based on a stage-noise multi-feature discrimination network, used for specific samples with complex texture details and diverse appearance challenges. It has many applications in real-world scenarios, such as defect detection in the textile industry. Background Technology
[0002] Fabric defect detection has always been a crucial part of defect inspection. Traditional methods rely on manual inspection, which is neither efficient nor cost-effective enough to meet the requirements of various industries. With the development of machine vision, machine vision-based defect detection has attracted much attention due to its potential for automation. Traditional fabric defect detection algorithms mainly include statistical methods, probability distribution model-based methods, and spectral analysis-based methods. However, traditional fabric defect detection algorithms suffer from insufficient feature extraction and poor adaptability. In recent years, with the rapid development of deep convolutional neural networks, fabric defect detection methods based on deep convolutional networks have achieved good results.
[0003] SPADE[1] adopts a deep feature pyramid structure and locates abnormal regions by comparing all feature layers in the feature pyramid. Zhao et al.[2] proposed a fabric defect detection method based on neural networks. This method first creates a fabric image dataset, trains the images by building a neural network, and then detects defects in the fabric images to be tested. Wu et al.[3] perform color space conversion on the RGB color images acquired by industrial cameras, converts them to YCrCb color space, and then converts them to grayscale images for detection, effectively reducing the interference caused by the external environment of the images acquired by the camera. Lu et al.[4] provide a fabric defect detection model based on parallel attention mechanism to improve the feature extraction capability for small targets. Sheng et al.[5] proposed a fabric defect detection method based on energy residual distribution to solve the problem that it is impossible to extract and calculate features based on all angles and scales, and it is impossible to perform effective fusion, which reduces the detection accuracy. Tian and Li[6] proposed a method based on autoencoder. Using repeated texture patterns, similar defect-free blocks are found for each defect block, and the corresponding latent variables are weighted and combined to correct the original latent variables.
[0004] However, most of these methods use traditional silk fabric defect detection methods, which make it difficult to identify subtle and complex silk fabric defect samples.
[0005] The current deep convolutional neural network anomaly detection method based on reconstruction is based on the assumption that abnormal image regions should not be correctly reconstructed, because the anomaly is not included in the training data. Finally, the reconstruction error is used to determine whether the image is abnormal. Wei et al. [7] used the joint loss function of mean square error and structural similarity to measure the similarity between the reconstructed image and the input image, and proposed a real-time fabric defect detection method based on variational autoencoder. [8] Generative models such as autoencoders and generative adversarial networks are used to encode and reconstruct normal data. GANomaly [9] constructed an adversarial network and trained an autoencoder to learn image reconstruction. However, the autoencoder can only perform simple nonlinear transformations on the data, and its generalization ability is poor. It is difficult to learn the full distribution of the target data, which usually leads to unclear reconstruction results.
[0006] Generative adversarial network (GAN)-based methods can make the distribution of generated data closer to the target data, and are favored by scholars in the field of anomaly detection. DCGAN
[10] introduces the inverter into the deep convolutional generative adversarial network to assist the inverter reconstruction. WGAN
[11] combines generative adversarial networks with transfer learning techniques and multi-model integration frameworks for anomaly detection of silk fabrics. However, most of these methods use the reconstruction error of the image as a reference to detect abnormal regions. In the process of synthesizing pseudo-anomaly images and reconstruction, a large number of precise details are lost, making it difficult to detect some defects. Summary of the Invention
[0007] The purpose of this invention is to provide a defect detection method for silk fabrics based on a stage-noise multi-feature discriminant network, and to propose a novel generative adversarial network model: a stage-noise-enhanced multi-feature discriminant network (PNMFD).
[0008] To achieve the above objectives, the technical solution of this invention is: a method for detecting defects in silk fabrics based on a stage noise multi-feature discrimination network, proposing a new generative adversarial network model: a stage noise-enhanced multi-feature discrimination network PNMFD. PNMFD shifts attention to the feature level, uses stage noise to generate pseudo-abnormal features, and the generated pseudo-abnormal features interact with the multi-feature discrimination module to enhance the model's attention to texture details.
[0009] In one embodiment of the present invention, PNMFD introduces a phased pseudo-anomaly generation strategy to mitigate the significant difference between generated samples and real samples. During training, different noises are synthesized step by step to simulate anomalous images at different stages and generate pseudo-anomaly features. Meanwhile, in the multi-feature discrimination module, a dual discriminator is proposed to increase the complexity of the discriminator task and improve the performance of the network by adding an additional discrimination branch.
[0010] In one embodiment of the present invention, during the generation of pseudo-abnormal features, the feature reconstructor is allowed to gradually learn richer anomalous representations, ensuring the richness of simulated anomalous features and improved reconstruction quality.
[0011] In one embodiment of the present invention, PNMFD includes a backbone network, a feature aggregation and adaptation module, a feature subsampling module, a feature reconstruction module, and a feature discrimination module.
[0012] In one embodiment of the present invention, the backbone network uses a network φ pre-trained on ImageNet to extract feature blocks. To reduce the impact of domain offset, a specific layer l from all layers L of network φ is used for feature block extraction, defined as φ. l (x i ), where l∈L; assume the input is an image with height H and width W. The extracted feature map is then represented as definition Let h ∈ {1,…,H}, w ∈ {1,…,W} represent the features at positions h ∈ {1,…,W}; for input features Merge the feature vectors of its neighborhood, and use p to represent the patch size of its neighborhood.
[0013] In one embodiment of the present invention, the feature aggregation and adaptive module uses an aggregation function f. agg right Feature aggregation within the domain yields local features t l,i While achieving (h,w), the original context information is also preserved. The overall process is defined as follows:
[0014]
[0015] In this context, an adaptive averaging layer is used as the aggregation function f. agg Due to local feature t l,i Since (h, w) come from different pre-trained network layers, the local features are first adjusted to the same size, and then they are connected according to the channel level. At this point, the size of all local features is adjusted to the largest size of the feature map (H0, W0), and the feature mapping is represented as:
[0016] m i =f concate (resize(t l,i ,(H0,W0)))
[0017] After that, use Local features are represented and used as the network input at (h,w); since pre-trained networks are more biased towards the data used to train them, feature adaptor A is employed. ψ Local feature m iProjecting (h,w) onto the target domain is defined as follows:
[0018] a i (h,w)=A ψ (m i (h,w))
[0019] Among them, a i (h,w) refers to the adaptive characteristics.
[0020] In one embodiment of the present invention, a single fully connected layer is used as feature adaptor A. ψ .
[0021] In one embodiment of the present invention, the feature sub-sampling module uses minimum and maximum value settings to reduce computational cost and complexity, thereby obtaining a sampled feature set:
[0022]
[0023] in, It is an adaptive feature a i The adaptive feature set a composed of (h,w) i A subset of set a, compute set a i From each point m to the subset The minimum and maximum distances between all other points n within the range, and finally a i,c It is the sampled feature set obtained after core subsampling.
[0024] In one embodiment of the present invention, the feature reconstruction module comprises two parts: generation of staged pseudo-anomaly features and feature reconstruction. The feature reconstruction module shifts its focus to the feature space and gradually introduces various feature-level noises at different training stages to synthesize high-quality pseudo-anomaly features. Simultaneously, it combines the principles of generative adversarial networks with the goal of network reconstruction, inputting the pseudo-anomaly features into the feature reconstructor R. θ In the middle, to reconstruct the sampling feature set a i,c The sampling feature a i, c(h,w);
[0025] In the stage of generating pseudo-anomaly features, for the sampled features The discriminator training is divided into three distinct stages η∈{η1,η2,η3}, each using three different noise vectors ∈{∈1,∈2,∈3}, which are then fused with the sampled features to form a pseudo-anomaly feature a. i,c - (h,w):
[0026] a i,c - (h,w)=a i,c +∈
[0027] Among them, Gaussian noise is ∈1, characteristic perturbation noise is ∈2, and the combination of the two noises is ∈3;
[0028] For feature reconstruction, combining the ideas of generative adversarial networks and reconstruction networks, a feature reconstructor R consisting of multiple fully connected layers is proposed. θ As a reconstruction network; specifically, the pseudo-anomaly feature a i,c - (h,w) serves as the input to the reconstructor, and the output is the reconstructed features. Sample feature a i,c (h,w) is set as the reconstruction target, i.e., the reconstruction feature. To be as close as possible to the sampling features Similarity; the reconstruction process is defined as:
[0029]
[0030] Since the goal of the feature reconstructor is to narrow the distance between the reconstructed features and the sampled features, thereby deceiving the discriminator, the MSE loss is used to constrain the feature reconstructor.
[0031]
[0032] Where n is the number of features, and the goal of training is to maximize the reconstruction loss L. r Minimize the value of , thereby reconstructing the feature. As close as possible to the sampled feature a i,c (h,w) is used to improve the performance of network reconstruction.
[0033] In one embodiment of the present invention, the feature identification module is equipped with a feature-level dual discriminator D. ω It needs to distinguish two different sets of features, the first set being the sampled feature a. i,c (h,w) and pseudo-anomaly feature a i,c - (h,w), the second group is the sampling feature a i,c (h,w) and reconstruction features The discrimination loss is optimized by using two sets of input features. The feature reconstructor and dual discriminator are combined as a generative adversarial network. The first set of features is also input into the discriminator. Since the pseudo-abnormal features are close to the real abnormal features, it further helps the discriminator to improve its ability to distinguish between normal and abnormal.
[0034] For each feature at position (h, w), the discriminator expects the output of the sampled feature to be positive, and expects the outputs of the pseudo-anomaly feature and the reconstructed feature to be negative; a two-layer multilayer perceptron is used as the dual discriminator D. ω Directly estimate the normality score of the features;
[0035] For dual discriminant D ω The loss function uses truncated L1 loss to describe the two sets of discrimination losses:
[0036] l i 1 =max(0, λ) + -D ω (a i,c (h,w)))+max(0,-λ) - +D ω (a i,c -(h,w)))
[0037]
[0038] Where, λ + and λ - This is a cutoff term to prevent overfitting, set to default values of 0.5 and -0.5; the total loss of the dual discriminator is defined as the cutoff loss l at each position (h,w). i 1 and l i 2 Mean:
[0039]
[0040] Here, H0 and W0 are the height and width of the local feature map at each location (h, w), respectively.
[0041] Compared to existing technologies, this invention offers the following advantages: Inspired by synthesis and reconstruction methods, this invention proposes a novel silk fabric defect detection network, PNMFD. PNMFD integrates a stage noise enhancement strategy to generate pseudo-anomaly features and a multi-feature discriminator module to improve discriminator performance. It utilizes the concept of generative adversarial networks for anomaly detection in the feature space. This invention designs a phase noise enhancement strategy, introducing phase noise into the feature space to generate pseudo-anomaly features highly similar to real anomaly features for feature reconstruction. Discriminator performance is improved by employing a dual discriminator setup with two different feature inputs. Furthermore, the subsampling module reduces feature redundancy, ensuring efficient inference speed. Attached Figure Description
[0042] Figure 1 This is a comparison diagram between the network model of this invention and the traditional generative adversarial network model.
[0043] Figure 2 This is a diagram of the network model architecture of the method of the present invention.
[0044] Figure 3 This is a schematic diagram of feature sampling.
[0045] Figure 4 This is a visualization of the PNMFD results. Detailed Implementation
[0046] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.
[0047] This invention provides a defect detection method for silk fabrics based on a stage-noise multi-feature discriminant network, and proposes a novel generative adversarial network model: Stage-Noise Enhanced Multi-Feature Discriminant Network (PNMFD). A comparison between PNMFD and traditional generative adversarial network frameworks is as follows: Figure 1 As shown. Unlike existing methods, PNMFD shifts its focus to the feature level, using stage noise to generate pseudo-anomaly features, which then interact with the discriminator module to enhance the model's attention to texture details.
[0048] Specifically, we introduce a staged pseudo-anomaly generation strategy to mitigate the significant differences between generated and real samples. During training, different noises are synthesized progressively to simulate anomaly images at different stages. This method allows the feature reconstructor to gradually learn richer anomaly representations, ensuring the richness of simulated anomalies and improved reconstruction quality. Simultaneously, in the multi-feature discrimination module, we propose a dual discriminator, adding an extra discrimination branch to increase the complexity of the discriminator task and improve network performance.
[0049] like Figure 2 As shown, the present invention provides a method for detecting defects in silk fabrics based on a stage noise multi-feature discrimination network, which consists of the following modules:
[0050] 1. Backbone Network
[0051] We use a network φ pre-trained on ImageNet for feature block extraction. To reduce the impact of domain offset, we use a specific layer l from all layers L of network φ for feature block extraction, defined as φ. l (x i ), where l∈L. Assume the input is an image with height H and width W. The feature map extracted from a specific network layer is represented as follows: definition Let h ∈ {1,…,H} and w ∈ {1,…,W} represent the features at positions h ∈ {1,…,W}. For the input features... We merge the feature vectors of its neighborhood, and use p to represent the patch size of its neighborhood.
[0052] 2. Feature aggregation and adaptation
[0053] Use aggregate function f agg right Feature aggregation within the domain yields local features t l,i While performing (h,w), the original context information can also be preserved. The process is defined as follows:
[0054]
[0055] We use an adaptive averaging layer as the aggregation function f agg Due to local feature t l,i Since (h, w) come from different pre-trained network layers, we first adjust the local features to the same size, and then simply connect them at the channel level. At this point, the size of all local features is adjusted to the largest size of the feature map (H0, W0), and the feature map is represented as:
[0056] m i =f concate (resize(t l,i ,(H0,W0)))
[0057] In the following steps, we will use This represents a local feature and serves as the network input at (h,w). Since pre-trained networks are typically more biased towards the data used to train them, we consider using a feature adaptor A. ψ Local features m i (h,w) are projected onto the target domain.
[12] This process is defined as:
[0058] a i (h,w)=A ψ (m i (h,w))
[0059] Among them, a i (h,w) serve as adaptation features in subsequent operations. In this paper, a single fully connected layer is used as A. ψ .
[0060] 3 Feature Subsampling
[0061] As the input data increases, the resulting adaptive feature a i As (h,w) becomes richer, it is often accompanied by redundant information unrelated to the essential features needed. This increases the time required to evaluate new test data and consumes more and more physical resources. To address this issue, we follow... [13-15] Using minimum and maximum values to set the core selection reduces computational cost and lowers computational complexity.
[0062]
[0063] in, It is the adaptive feature set a i A subset of set a, compute set a i From each point m to the subset Find the minimum and maximum distances between all other points n within the range. Finally, find the minimum and maximum distances between points a and n. i,c It is the sampled feature set obtained after core subsampling. i,c (h,w) represents the features in the feature set. The sampling process is as follows: Figure 3 As shown.
[0064] 4 Feature Reconstruction
[0065] Given the subtle nature of defects in fabric samples, current reconstruction-based methods cannot effectively simulate these subtle anomalies. Furthermore, low-quality simulated anomalies cannot effectively fool the discriminator, limiting its performance.
[10] Inspired by [previous research], we propose a feature reconstruction module consisting of two parts: generation of staged pseudo-anomaly features and feature reconstruction. We shift our focus to the feature space and progressively introduce various feature-level noises at different training stages to synthesize high-quality pseudo-anomaly features. Simultaneously, combining the principles of generative adversarial networks with the goal of the reconstruction network, we input the pseudo-anomaly features into the feature reconstructor R. θ In the middle, to reconstruct the sampling feature a i,c (h,w). Introducing pseudo-anomaly features at different stages enhances its ability to perceive anomalies.
[0066] In the stage of generating pseudo-anomaly features, for the sampled features We divide the discriminator training into three distinct stages η∈{η1,η2,η3}, using three different noise vectors ∈{∈1,∈2,∈3} respectively, which are then fused with the sampled features to form pseudo-anomaly features a. i,c -(h,w):
[0067] a i,c - (h,w)=a i,c +∈
[0068] Among them, Gaussian noise is ∈1, characteristic perturbation noise is ∈2, and the combination of the two noises is ∈3.
[0069] For feature reconstruction, we combine the ideas of generative adversarial networks and reconstruction networks, and propose a feature reconstructor R consisting of multiple fully connected layers. θ As a reconstruction network, in this experiment, we will use the pseudo-anomaly feature a i,c - (h,w) serves as the input to the reconstructor, and the output is the reconstructed features. Sample feature a i,c (h,w) is set as the reconstruction target, i.e., the reconstruction feature. To be as close as possible to the sampling feature a i,c (h,w) are similar. The reconstruction process is defined as:
[0070]
[0071] Since the goal of the reconstructor is to narrow the distance between the reconstructed features and the sampled features, thereby deceiving the discriminator, we use MSE loss to constrain the reconstructor:
[0072]
[0073] Where n is the number of features. During training, the goal is to maximize the reconstruction loss L. r Minimize the value of , thereby reconstructing the feature. As close as possible to the sampled feature a i,c (h,w) is used to improve the performance of network reconstruction.
[0074] 5. Feature Identification
[0075] Unlike the discriminator in typical generative adversarial networks, we set up a feature-level dual discriminator D in this stage. ω It needs to distinguish two different sets of features, the first set being the sampled feature a. i,c (h,w) and pseudo-anomaly feature a i,c - (h,w), the second group is the sampling feature a i,c (h,w) and reconstruction features We optimize the discriminant loss using two sets of input features. We combine a feature reconstructor and a dual discriminator as a generative adversarial network, as described in the previous section. The feature reconstructor tries to reconstruct pseudo-anomaly features into normal sampled features (i.e., reconstructed features) to deceive the discriminator, which needs to continuously improve its ability to distinguish between the two types of features. In addition, we also input the first set of features into the discriminator. Since the pseudo-anomaly features are close to the real anomaly features, they can further help the discriminator improve its ability to distinguish between normal and abnormal features.
[0076] For each feature at position (h, w), the discriminator expects the output of the sampled feature to be positive, and the outputs of the pseudo-anomaly feature and the reconstructed feature to be negative. This experiment uses a two-layer multilayer perceptron as the dual discriminator D. ω The normality score of the feature is directly estimated.
[0077] For dual discriminant D ω loss function,
[12] The results demonstrate that simple truncated L1 loss can enhance the differentiation between anomalous and real samples. Furthermore, truncated L1 loss emphasizes the absolute difference between generated and real samples, contributing to the stability of GAN network training, particularly maintaining a balance during the training of the generator and discriminator. Therefore, we employ truncated L1 loss to describe two sets of discrimination losses:
[0078] l i 1 =max(0, λ) + -D ω (a i,c (h,w)))+max(0,-λ) - +D ω (a i,c -(h,w)))
[0079]
[0080] Where, λ + and λ - This is a cutoff term to prevent overfitting. We set it to the default values of 0.5 and -0.5. The total loss of the dual discriminator is defined as the cutoff loss l at each location (h,w). i 1 and l i 2 Mean:
[0081]
[0082] Here, H0 and W0 are the height and width of the local feature map at each location (h, w), respectively.
[0083] 6 Training Objectives
[0084] The PNMFD proposed in this invention is an end-to-end network that can be optimized using a cooperative loss term. The entire training objective can be divided into a reconstruction loss L. r,(h,w) and discriminator loss L d,(h,w) sum:
[0085]
[0086] During the inference phase, we use the trained dual discriminator as the feature discriminator. Furthermore, the subsampling module and feature reconstruction module are discarded, and inference is performed using a single process. Figure 2 As shown. For each test image x in the test set. i ∈{X test y i ∈(0,1)}, will sequentially pass through a pre-trained network to perform feature extraction, feature aggregation, and feature adaptation operations to obtain a. i(h,w). Finally, the feature discriminator D... ω Calculate anomaly scores for features located at (h,w):
[0087] s i (h,w)=-D ω (a i (h,w))
[0088] For each anomaly mapping at (h, w), we define it as follows and use it for anomaly localization:
[0089] M i ={s i (h,w)|(h,w)∈(H0×W0)}
[0090] Then, the anomaly mapping value of the point located at (h,w) is interpolated onto the original image to obtain the anomaly localization. We consider the point with the maximum anomaly score in the obtained anomaly mapping as the most anomalous region in the image, and therefore the anomaly score of the entire image is defined as this maximum anomaly score value.
[0091]
[0092] Implementation Examples
[0093] To evaluate the effectiveness of our algorithm on real silk fabric data, we conducted experiments on the AITEX dataset (containing 747 high-resolution silk fabric images) and compared it with several recently published algorithms. We also explored the interaction between the various modules on this dataset. We compared DMAD...
[18] MMR
[19] RD
[21] RD++
[22] Efficien_ad
[20] Fastflow
[16] Csflow
[17] and Simplenet
[12] The algorithm of this invention uses the maximum anomaly score S(x) i The area under the receiver operator curve (I-AUROC) is used as a metric to measure image-level anomaly detection performance. Similarly, the anomaly map M... iPixel-level AUROC, abbreviated as P-AUROC, is used as a metric to evaluate pixel-level anomaly localization. In addition, we also measured the region overlap (PRO) score for each pixel-level anomaly localization. The PRO curve is calculated as the overlap between each connected region within the ground truth mask. The PRO score is the area under the PRO curve, which treats defects of different sizes equally and emphasizes the connectivity of the localization results. This is abbreviated as PRO-AUROC. See Table 1 for details.
[0094] Table 1 shows the performance of different modules of PNMFD on the AITEX dataset.
[0095]
[0096] 1. Parameter Selection
[0097] We explored the roles of each module in PNMFD on AITEX, and it can be seen that each module in the proposed model plays a corresponding role. However, it is noted that the I-AUROC of the model without using the feature subsampling module is 1.5% higher than that of the final model. This may be because the subsampling module may discard some image information, thereby reducing image-level accuracy. However, the subsampling module enables the model to pay more attention to local information and learn local features more finely, thus improving pixel-level AUROC.
[0098] 2 Qualitative comparison
[0099] To visually verify the defect detection performance of PNMFD. Figure 4 This section presents a visualization example of defect detection on the AITEX dataset. The first row of the image shows the sampled image, the second row shows the defect detection anomaly map, and the third row shows the ground truth. We have magnified and annotated the finer areas in the ground truth for a more intuitive understanding of the inspection results. It can be seen that PNMFD achieves good defect detection performance. This method can effectively locate anomalous regions even against the backdrop of extremely fine defects in silk fabrics.
[0100] 3. Quantitative comparison
[0101] Table 2 shows the evaluation results on the AITEX test set. As can be seen, PNMFD achieved the highest performance index. For image-level anomaly scoring, PNMFD outperforms the best flow-based method Csflow by 7.8%, the best reconstruction-based method DMAD by 11.3%, and the best knowledge distillation method Efficien_ad by 0.2%. It also outperforms Simplenet by 1.3%.
[0102] For pixel-by-pixel anomaly localization, PNMFD outperforms the optimal flow model-based method Csflow by 13%, the optimal reconstruction-based method MMR by 7.3%, the optimal knowledge distillation method RD++ by 17.5%, and Simplenet by 1.3%. All proposed methods demonstrate high anomaly localization accuracy. Furthermore, PNMFD's performance metrics are superior to other methods, proving its superior localization capability.
[0103] Table 2 Quantitative comparison of PNMFD on the AITEX dataset
[0104]
[0105] References:
[0106] [1]Cohen, Niv and Yedid Hoshen. "Sub-Image Anomaly Detection with DeepPyramid Correspondences." ArXiv, 2020.
[0107] [2] Zhao Yanan. Research on small target detection technology for fabric defects based on deep learning [D]. Guangdong University of Technology, 2024.
[0108] [3] Wu Tao, Cui Qing, Yin Qiang, et al. Fabric defect detection algorithm based on improved YOLOv7 [J]. Journal of Basic Science of Textile Colleges, 29-36, 2023.
[0109] [4] Lu Daying, Li Zhen, Wu Xi, et al. Fabric defect detection model based on parallel attention mechanism [P], 2024.
[0110] [5] Sheng Shouxiang, Wang Guodong, Gao Xiubin, et al. A fabric defect detection method based on energy residual distribution [P], System and Detection Terminal, 2024.
[0111] [6] Hu Tian and Fei Li. Autoencoder-based fabric defect detection with crosspatch similarity. 201916th International Conference on MachineVisionApplications, 1–6, 2019.
[0112] [7]Wei Wei,Dexiang Deng,Lin Zeng,and Chen Zhang.Real-timeimplementation of fabric defect detection based on variational automaticencoder with structure similarity.Journal ofReal-Time Image Processing,807–823,2020.
[0113] [8]Zhoufeng Liu,Chengli Gao,Chunlei Li,et al.Unsupervised fabricdefect detection based on dcgan with component-encoder.Pattern Recognition,557–568,2022.
[0114] [9]Samet Akcay,Amir Atapour-Abarghouei,and Toby P.Breckon.Ganomaly:Semi-supervised anomaly detection via adversarial training.ACCV,622–637,2019.
[0115]
[10] Dong Gong,Lingqiao Liu,Vuong Le,et al.Memorizing normality todetect anomaly:Memory-augmented deep autoencoder for unsupervised anomalydetection.IEEE / CVF International Conference on Computer Vision,1705–1714,2019
[0116]
[11] Xinyi Le,Junhui Mei,Haodong Zhang,et al.A learning-based approachfor surface defect detection using small image datasets.Neurocomputing,112–120,2020.
[0117]
[16] Jiawei Yu1,Ye Zheng,Xiang Wang,et al.Fastflow:Unsupervisedanomaly detection and localization via 2d normalizing flows.ArXiv,2021.
[0118]
[17] Marco Rudolph,Tom Wehrbein,Bodo Rosenhahn.Fully convolutionalcross-scale-flows for image-based defect detection.2022IEEE / CVF WinterConference on Applications of Computer Vision,1829–1838,2022.
[0119]
[18] Wenrui Liu,Hong Chang,Bingpeng Ma,et al.Diversity-measurableanomaly detection.2023IEEE / CVF Conference on Computer Vision and PatternRecognition,12147–12156,2023.
[0120]
[19] Zilong Zhang,Zhibin Zhao,Xingwu Zhang,et al.Industrial anomalydetection with domain shift:A real-world dataset and masked multi-scalereconstruction.Computers in Industry,103990,2023.
[0121]
[20] Kilian Batzner, Lars Heckler, and Rebecca K onig. Efficient_ad: Accurate visual anomaly detection at millisecond-level latencies. 2024 IEEE / CVFWinter Conference on Applications of Computer Vision, 127–137, 2024.
[0122]
[21] Hanqiu Deng and Xingyu Li. Anomaly detection via reversedistillation from one-class embedding. 2022 IEEE / CVF Conference on ComputerVision and Pattern Recognition, 9727–9736, 2022.
[0123]
[22] Tran Dinh Tien, Anh Tuan Nguyen, Nguyen Hoang Tran, et al. Revisiting reverse distillation for anomaly detection. 2023 IEEE / CVF Conference on Computer Vision and Pattern Recognition, 24511–24520, 2023.
[0124] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.
Claims
1. A silk fabric defect detection method based on a stage noise multi-feature discrimination network, characterized in that, A new generative adversarial network model is proposed: multi-feature discriminative network under phase noise enhancement (PNMFD). PNMFD focuses on the feature level, uses phase noise to generate pseudo-anomalous features, and the generated pseudo-anomalous features interact with the multi-feature discriminative module to enhance the model's attention to texture details. PNMFD includes a backbone network, a feature aggregation and adaptive module, a feature subsampling module, a feature reconstruction module, and a feature discriminative module. The feature reconstruction module includes two parts: generation of phase pseudo-anomaly features and feature reconstruction. The feature reconstruction module shifts the focus to the feature space and gradually introduces various feature-level noises at different training stages to synthesize high-quality pseudo-anomaly features. Meanwhile, the principle of the generative adversarial network is combined with the target of the reconstruction network, and the pseudo-anomaly features are input into the feature reconstructor R θ to reconstruct the sampling features a i,c in the sampling feature set a i,c (h,w), h and w respectively represent the corresponding positions in the input picture with a height of H and a width of W. In the generation stage of pseudo-anomaly features, for the sampling features The discriminator training is divided into three different stages η∈{η1,η2,η3}, using three different noise vectors ∈∈{∈1,∈2,∈3} to fuse with the sampling features into pseudo-anomaly features a i,c - (h,w): a i,c - (h,w) = a i,c + ∈ Among them, Gaussian noise is ∈1, feature disturbance noise is ∈2, and the combination of the two noises is ∈3. For feature reconstruction, combining the idea of generative adversarial network and reconstruction network, a feature reconstructor R composed of multiple fully connected layers is proposed θ As a reconstruction network; specifically, the pseudo abnormal feature a i,c - (h, w) as the input of the reconstructor, and the output is the reconstructed feature The sampling feature a i,c (h, w) is set as the reconstruction target, that is, the reconstructed feature As similar as possible to the sampling feature a i,c (h, w); the reconstruction process is defined as: Since the goal of the feature reconstructor is to reduce the distance between the reconstructed features and the sampled features, it has the effect of deceiving the discriminator, so the MSE loss is used to constrain the feature reconstructor: where n is the number of features, and the goal of the training is to minimize the reconstruction loss L r , so that the reconstructed features are as close as possible to the sampled features a i,c (h, w) to improve the performance of the reconstruction network.
2. The silk fabric defect detection method based on the stage noise multi-feature discrimination network according to claim 1, characterized in that, PNMFD introduces a phased pseudo-anomaly generation strategy to reduce the significant difference between the generated samples and the real samples. In the training process, different noises are gradually synthesized to simulate abnormal images at different stages, and pseudo-anomalous features are generated. At the same time, in the multi-feature discriminative module, a double discriminator is proposed, which adds an additional discriminative branch to increase the complexity of the discriminator task and improve the performance of the network.
3. The silk fabric defect detection method based on the stage noise multi-feature discrimination network according to claim 1 or 2, characterized in that, In the process of generating pseudo-anomalous features, the feature reconstructor is allowed to gradually learn more abundant abnormal representations, ensuring the richness of the simulated anomalies and improving the reconstruction quality.
4. The silk fabric defect detection method based on the stage noise multi-feature discrimination network according to claim 1, characterized in that, The backbone network uses a pre-trained network φ on ImageNet to extract feature patches. To reduce the influence of domain shift, the network φ is used to extract feature patches from a specified layer l in all layers L, defined as φ l (x i ), where l e L; suppose the input image has a height of H and a width of W The extracted feature map is represented as Definition to represent the features at positions h e {1,..., H}, w e {1,..., W}; for the input feature Merge the feature vectors of its neighborhood, represented by p, the patch size of its neighborhood.
5. The silk fabric defect detection method based on the stage noise multi-feature discrimination network according to claim 4, characterized in that, Feature aggregation and adaptation module, using aggregation function f agg To Feature aggregation in the domain results in local features t l,i (h,w) while preserving the original context information, the overall process is defined as: where the adaptive average layer is used as the aggregation function f agg ; since the local features t l,i (h, w) come from different pre-trained network layers, the local features are first adjusted to the same size and then connected on the channel level. At this time, the size of all local features is adjusted to the maximum size of the feature map H0, W0, and the feature mapping is represented as: m i = f concate (resize(t l,i ,(H0,W0))) Afterwards, the features are projected to the target domain using representing local features and used as input to the network at (h, w); since the pre-trained network is more biased towards the data it was trained on, a feature adapter A ψ the local features m i (h, w) are projected to the target domain, this process is defined as: a i (h,w) = A ψ (m i (h,w)) where a i (h, w) is the adaptive feature.
6. The silk fabric defect detection method based on the stage noise multi-feature discrimination network according to claim 5, characterized in that, Using a single layer of fully connected layers as feature adapter A ψ .
7. The silk fabric defect detection method based on the stage noise multi-feature discrimination network according to claim 5, characterized in that, The feature subsampling module uses the minimum maximum value setting core selection to reduce the computational cost and reduce the computational complexity to obtain the sampled feature set: wherein, is the adapted feature set a i (h,w) consisting of adapted feature set a i is a subset of a i the minimum and maximum distance of each point m in a to all the rest of points n in a i,c is the resulting core subsampled feature set. 8.The silk fabric defect detection method based on the stage noise multi-feature discrimination network according to claim 1, characterized in that, The feature discrimination module is configured as a feature-level dual discriminator D ω , which needs to discriminate two different sets of features, the first set is the sampled feature a i,c (h,w) and the pseudo-anomaly feature a i,c - (h,w), and the second set is the sampled feature a i,c (h,w) and the reconstructed feature The discrimination loss is optimized by the two sets of input features, the feature reconstructor and the dual discriminator are combined as a generative adversarial network, and the first set of features is also input into the discriminator, since the pseudo-anomaly feature is close to the real anomaly feature, which further helps the discriminator to improve the ability to distinguish between normal and abnormal. For each position (h, w) of the feature, the discriminator expects the output of the sampled feature to be positive, and the output of the pseudo-anomaly feature and the reconstructed feature to be negative; a two-layer multi-layer perceptron is adopted as the dual discriminator D ω , directly estimates the normality score of the feature; For the loss function of the dual discriminator D ω The truncated l1 loss is adopted to describe the two sets of discrimination loss: l i 1 = max(0, λ + -D ω (a i,c (h,w)) + max(0, -λ - + D ω (a i,c - (h,w))) where λ + and λ - are the truncation terms to prevent overfitting, set to the default values 0.5 and -0.5; the total loss of the dual discriminator is defined as the average of the truncated losses l i 1 and l i 2 at each location (h, w): Among them, H0 and W0 are the height and width of the local feature map at each position (h, w), respectively.
Citation Information
Patent Citations
Cloth flaw data enhancement method based on generative adversarial network
CN115205616A
Textile defect sample generation method based on generative adversarial network
CN115482431A