A method for constructing a texture surface defect detection model and its application
The texture surface defect detection model through deep learning uses feature separation and global semantic relationship modules to solve the problem of low texture surface defect detection accuracy in the existing technology, achieve efficient detection without real samples, and improve detection Robustness and accuracy.
Patent Information
- Application Number
- CN202210507405.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-10
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-05-10
AI Technical Summary
It is difficult for existing texture surface defect detection algorithms to ensure accurate reconstruction of texture background and maximum suppression of defect foreground at the same time, resulting in low detection accuracy. Especially in the absence of real defect samples, detection robustness is poor.
The texture surface defect detection model using deep learning maximizes the difference between the texture feature map and the defect feature map and minimizes the distance between the texture feature map and the cluster center and the similarity between classes through the feature extraction module, feature separation extraction module and segmentation module. degree, combined with the global semantic relationship module to capture the context information of the entire image, generate false defect samples to replace real samples, and improve detection accuracy.
It effectively improves the accuracy and robustness of texture surface defect detection, can accurately segment various texture surface defects without real defect samples, and reduces time and labor costs.
Smart Images

Figure CN114972216B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing, and more specifically, relates to a method for constructing a texture surface defect detection model and its application. Background Art
[0002] In the field of industrial manufacturing, the quality of raw materials varies. Due to factors such as the stability of manufacturing equipment and the complexity of manufacturing processes, various texture defects often occur on the surface of products, such as new display devices OLED, textiles, wood products and ceramic products. Texture surface defects usually appear as local areas with local texture structure damage, or local areas with irregular brightness changes. These texture defects seriously affect consumers' visual experience and product performance. It is extremely important to realize automatic detection of texture surface defects in various processes of industrial product manufacturing to ensure product quality and improve production processes.
[0003] In the manufacturing process of industrial products, texture surface defects have the following characteristics: the texture and defects are complex and diverse, the defect scale varies greatly, and the grayscale of the defect area is often almost the same as the texture background, resulting in low contrast and unclear contour boundaries; in addition, the qualified rate of products on a mature industrial production line is often high, and the number of defective products is relatively small, which makes it difficult to collect a large number of defect samples in a short time. Even if a large number of training samples are collected over a long period of time, it is necessary to manually produce pixel-level sample labels for the samples. As a result, the time cost and labor cost are huge, which brings great difficulties to visual inspection. Therefore, texture surface defect detection algorithm is still a very challenging task in industrial product quality control.
[0004] At present, many algorithms have been proposed to solve the problem of texture surface defect detection. The mainstream research results are based on texture background reconstruction, and defects are detected by the residual between the reconstructed image and the original image. These methods are difficult to simultaneously ensure the accurate reconstruction of the texture background and the maximum suppression of the defect foreground, resulting in poor performance and difficulty in adapting to various types of texture defects. Therefore, it is necessary to propose a texture surface defect detection algorithm based on deep learning that does not use real defect samples, which can be applied to various types of textures and has good robustness to different types of texture surface defects. Summary of the invention
[0005] In response to the above defects or improvement needs of the prior art, the present invention provides a method for constructing a texture surface defect detection model and its application, which aims to utilize the powerful data modeling capabilities of deep learning to perform surface defect detection of industrial products, thereby solving the problem of low detection accuracy caused by the wide variety, large scale variations, low contrast, varied shapes and lack of real defect samples in texture surface defect detection algorithms, and can greatly improve the detection accuracy.
[0006] To achieve the above objectives, in a first aspect, the present invention provides a method for constructing a texture surface defect detection model, comprising:
[0007] Build a texture surface defect detection model; the texture surface defect detection model includes a feature extraction module, a feature separation extraction module and a segmentation module connected in sequence; wherein:
[0008] The feature extraction module is used to extract features from the input texture image to obtain a feature map; the feature separation and extraction module is used to separate the texture semantic information and the defect semantic information in the feature map to extract a texture feature map and a defect feature map; the segmentation module is used to segment the texture feature map and the defect feature map to obtain a texture segmentation result and a defect segmentation result;
[0009] The texture surface defect detection model is trained using a training sample set with the goals of maximizing the difference between the texture feature map and the defect feature map at corresponding pixel positions, minimizing the distance between the texture feature map and the defect feature map and the cluster center, minimizing the inter-class similarity between the texture feature map and the defect feature map, and minimizing the difference between the predicted value and the true value of the texture segmentation result and the defect segmentation result.
[0010] Furthermore, the texture surface defect detection model also includes a global semantic relationship module located between the feature separation and extraction module and the segmentation module, and the global semantic relationship module is used to obtain global context information and add the global context information to the texture feature map and defect feature map extracted by the feature separation and extraction module to enhance the expression ability of texture features and defect features.
[0011] Furthermore, the global semantic relationship module is based on the QKV self-attention mechanism, and uses a small matrix C to replace the large matrix Q in the QKV self-attention mechanism; wherein the small matrix C is composed of cluster center features learned based on feature clustering in the feature separation and extraction module.
[0012] Furthermore, the training samples in the training sample set are obtained by:
[0013] The inverse color image of the Mask image is multiplied with the texture image of the defect-free product to obtain the normal texture area, and then the Mask image is multiplied with the noise image generated by two-dimensional Gaussian sampling to obtain the defect area, and the two are added to synthesize the false defect texture sample image;
[0014] The Mask image is a binary image with a pixel value of 0 or 1. The area with a pixel value of 1 represents a defect area, and the area with a pixel value of 0 represents a normal texture area.
[0015] Further, the feature extraction module includes a first convolution module and a second convolution module;
[0016] The first convolution module includes a first convolution layer and a first residual module, and the first residual module includes two convolution layers that add head and tail features in a skip connection manner;
[0017] The second convolution module includes two residual modules, the structures of the two residual modules are the same as those of the first residual module, and the number of convolution kernels is twice that of the convolution layer in the first residual module.
[0018] Furthermore, the feature separation and extraction module includes two branch networks with the same structure, one branch network is used to extract texture features, and the other branch network is used to extract defect features;
[0019] Each branch network includes three convolution modules with the same structure, each convolution module includes two residual modules, and each residual module includes two convolution layers that add head and tail features in a jump connection manner; the number of convolution kernels in the three convolution modules is twice that of the previous layer.
[0020] Furthermore, the segmentation module includes four deconvolution modules, a deconvolution layer and a Sigmoid activation layer;
[0021] The structures of the four deconvolution modules are the same, the number of convolution kernels decreases in multiples of 1 / 2, and each deconvolution module includes two deconvolution layers.
[0022] In a second aspect, the present invention provides a texture surface defect detection method, comprising:
[0023] Inputting the texture image to be tested into the texture surface defect detection model constructed by the method for constructing the texture surface defect detection model described in the first aspect to obtain a texture segmentation result and a defect segmentation result;
[0024] The texture segmentation result and the defect segmentation result are weighted averaged to obtain a final detection result.
[0025] In a third aspect, the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the method for constructing a texture surface defect detection model as described in the first aspect and / or the method for detecting texture surface defects as described in the second aspect.
[0026] In general, the above algorithm conceived by the present invention can achieve the following beneficial effects compared with the existing algorithms:
[0027] 1. The present invention decomposes texture semantic information and defect semantic information from the feature map extracted by the feature extraction module by adopting a feature separation and extraction module, thereby avoiding the adverse effect of the coupling of the two types of information on the final segmentation accuracy. Specifically, by maximizing the difference between the texture feature map and the defect feature map at the corresponding pixel positions, minimizing the distance between the texture feature map and the defect feature map and the clustering center, and minimizing the inter-class similarity between the texture feature map and the defect feature map, the texture semantic information and the defect semantic information are effectively decomposed from the shared feature map, which is beneficial to improving the segmentation accuracy of the subsequent network.
[0028] 2. The present invention establishes global semantic information correlation by adopting a global semantic relationship module, captures the contextual information of the entire image, and enhances the expression of local features, thereby improving the robustness of texture segmentation and defect segmentation of the network model.
[0029] 3. The present invention generates false defect samples based on defect-free good product texture images combined with randomly generated Mask images, which to a certain extent solves the problem of few real defect samples in actual scenes, and enables the present invention to accurately segment various types of texture surface defects without using any real defect samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is one of the flow charts of the method for constructing a texture surface defect detection model provided by an embodiment of the present invention;
[0031] Figure 2 This is a second flow chart of a method for constructing a texture surface defect detection model provided by an embodiment of the present invention;
[0032] Figure 3 is a schematic diagram of a residual module provided by an embodiment of the present invention;
[0033] Figure 4 is a schematic diagram of a global semantic relationship module provided by an embodiment of the present invention;
[0034] Figure 5 It is a schematic diagram of the defect detection effect provided by an embodiment of the present invention, wherein the first line is a test set sample image, the second line is a label image of the test set sample image, the third line is a texture segmentation result, and the fourth line is a defect segmentation result. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0036] Example 1
[0037] See also Figure 1 , combined with Figure 2 and Figure 3 The present invention proposes a method for constructing a texture surface defect detection model, comprising:
[0038] S1, building a texture surface defect detection model; the texture surface defect detection model includes a feature extraction module, a feature separation extraction module and a segmentation module connected in sequence; wherein: the feature extraction module is used to extract features from an input texture image to obtain a feature map; the feature separation extraction module is used to separate texture semantic information and defect semantic information in the feature map to extract a texture feature map and a defect feature map; the segmentation module is used to segment the texture feature map and the defect feature map to obtain a texture segmentation result and a defect segmentation result.
[0039] S2, with the goal of maximizing the difference between the texture feature map and the defect feature map at the corresponding pixel position, minimizing the distance between the texture feature map and the defect feature map and the cluster center, minimizing the inter-class similarity of the texture feature map and the defect feature map, and minimizing the difference between the predicted value and the true value of the texture segmentation result and the defect segmentation result, the texture surface defect detection model is trained using a training sample set.
[0040] In this embodiment, Figure 2 As shown in Figure 1, the detection model consists of three conventional modules: defect generation module (DGM), feature extraction module (FEM) and segmentation module (SM), as well as two proposed new modules: feature separation extraction module (FSEM) and global semantic relation module (GSRM). Each module is described in detail below.
[0041] (1) Defect generation module
[0042] like Figure 2 As shown, the defect generation module is used to generate the defect-free sample I p Based on this, the randomly generated Mask image I m To generate false defect negative samples:
[0043] I n (x,y)=(1-I m (x,y))·Ip (x,y)+I m (x,y)·I g (x,y)
[0044] In the formula, I n ,I m ,I p and I g ∈R W×H×1 , W and H represent the width and height of the input image, both of which are 256 in the present invention. x=1,...,W,y=1,...,H,I g Represents a noisy image generated using Gaussian random sampling.
[0045] (2) Feature extraction module
[0046] like Figure 2 As shown, the feature extraction module is used to extract the input texture image I n The latent space convolution feature Z:
[0047] Z=f fem (I n θ e )
[0048] In the formula, Z∈R W / 2×H / 2×2C , f fem (·) represents the mapping function learned by the FEM network, θ e Represents the network weight parameters of the FEM module. The FEM is composed of two convolution modules. The first convolution module is composed of a convolution layer and a residual module, wherein the convolution kernel of the convolution layer is 3x3, the step size is 1, and the number of convolution kernels is C, which is set to 16 in the present invention; the residual module is composed of two convolution layers, and the head and tail features are added in a jump connection manner, wherein the convolution kernel of the first convolution layer is 3x3, the step size is 1, and the number of convolution kernels is 16, and the convolution kernel of the second convolution layer is 3x3, the step size is 1, and the number of convolution kernels is 16. The second convolution module contains two residual modules, and the structure is consistent with the previous one. The number of convolution kernels is twice that of the previous one, i.e. 32, and the step size of the first convolution layer in the first residual module is 2. The residual module structure is as follows Figure 3 shown.
[0049] (3) Feature separation and extraction module
[0050] like Figure 2 As shown, the feature separation and extraction module is used to extract the texture semantic information Z t and defect semantic information Z d Decompose the feature map Z extracted from the feature extraction module to avoid the adverse effect of the coupling of the two information on the final segmentation accuracy:
[0051]
[0052]
[0053] The feature separation and extraction module contains two branch networks, one branch is used to extract texture features, and the other branch is used to extract defect features. The network structures of the two branches are exactly the same. Each branch network contains three convolution modules, each of which has the same structure and contains two residual modules. The structure is the same as the second convolution module in the feature extraction module, but the number of convolution kernels is twice that of the previous layer. Therefore, the outputs of the three convolution modules of each branch are feature maps with 64 channels, 128 channels, and 256 channels respectively.
[0054] Latent space feature Z t and Z d It can be regarded as a collection of local features, that is, To perform preliminary feature separation, let Z t and Z d It is necessary that the differences in corresponding pixel positions are as large as possible:
[0055]
[0056] To further promote feature separation, a new model based on multi-hypersphere center constraints is proposed. Through deep feature clustering, different types of local features Z t and Z d are divided into K category clusters. represents the cluster center, that is, the center of each hypersphere. The residual between the local feature of the latent space and the cluster center is calculated as follows:
[0057]
[0058]
[0059] In the formula, i = 1, ..., N, j, k = 1, ... K, and N is the number of local features. Then, a measure of the local embedding features and With cluster center and The similarity score between is calculated as follows:
[0060]
[0061]
[0062] In the formula, α is set to 1. Each local feature z i There is a category center c k The distance dki , the corresponding shortest distance indicates which category center the feature belongs to:
[0063]
[0064] So the radius of each hypersphere is r k It can be calculated as follows:
[0065]
[0066] In the formula Yes k In order to ensure that the original distribution of local features is close to the target distribution, an auxiliary score is calculated as follows:
[0067]
[0068]
[0069] In the formula, The KL divergence loss is used to minimize the distribution difference between the distance score and the target score, that is, to minimize the distance between the texture feature map and the defect feature map and their corresponding cluster centers:
[0070]
[0071] In order to reduce the inter-class similarity of texture and defect features, a center constraint model based on multiple hyperspheres is proposed:
[0072]
[0073] The FSEM network parameters are optimized and updated based on the following loss:
[0074] L fd =λ 2 L z +λ 3 L kl +λ 4 L td
[0075] λ 2 , 3 and λ 4 is the balancing weight of each loss, and in the present invention, is set to λ 2 =0.01,λ 3 = 0.01 and λ 4 =0.01.
[0076] Due to the role of deep clustering and center constraint model, the feature separation and extraction module can effectively decompose texture semantic information and defect semantic information from the shared feature map, which is conducive to improving the segmentation accuracy of subsequent networks.
[0077] (4) Global semantic relationship module
[0078] like Figure 4 As shown in the figure, the global semantic relationship module is used to establish global semantic information correlation and capture the contextual information of the whole image to enhance the expression of local features. The self-attention mechanism allows a single feature at any position to perceive the features at all other positions, and thus obtain the contextual information of the whole image:
[0079]
[0080] However, this mechanism requires the generation of a large attention map, which is used to obtain the correlation between each pair of pixel position features, resulting in O(N 2 ) has such high time and space complexity, where N is the number of input features. In the formula, matrices Q and K often have very high dimensions, which means that methods based on the self-attention mechanism often have high computational complexity and also occupy a large amount of GPU memory. To solve this problem, this patent proposes a global semantic relationship module GSRM.
[0081] In order to establish the dependency relationship of local feature expression in the whole image with lower computational complexity and memory usage, this patent proposes the GSRM module:
[0082]
[0083]
[0084] In the formula, and represents the weight parameter of the GSRM network, and Represents the network mapping function learned by GSRM. In order to reduce computational complexity and memory consumption, the idea of this patent is to replace the large matrix Q in the attention mechanism with a smaller matrix C, which is learned by the FSEM module.
[0085] Figure 4 The detailed network structure of GSRM is shown. Given the feature map Z t or Z d ∈R W / 16×H / 16×16C , the module first uses a 1×1 convolution kernel to convolution Z t or Z d Perform convolution operation to obtain two feature maps K and V, where K, V∈R W / 16×H / 16×16C, after obtaining the matrices K and V, generate an attention map M∈R (W / 16×H / 16)×K , then aggregate the matrices C and M to obtain context information, and finally add the above information to the feature map Z t or Z d To enhance the feature expression, and then obtain the enhanced feature map Z′ t and Z′ d As a result, the computational complexity is reduced from O(N 2 ) is greatly reduced to O(N×K). Since K is much smaller than N, the complexity is approximately reduced to O(N). The whole process is expressed as follows:
[0086] M = softmax(K′C T )
[0087] Z′ t =V+reshape(MC)
[0088] where K′∈R (W / 16×H / 16)×16C is the two-dimensional expansion of K, and the matrix C represents C in the FSEM module t and C d .
[0089] GSRM establishes global semantic information correlation with low computational complexity and memory consumption, captures the context information of the whole image, and enhances the latent space feature expression to a certain extent. Therefore, Z′ t and Z′ d It has a wide contextual field of view and can selectively aggregate different contextual information according to the spatial attention map, which promotes the improvement of the robustness and accuracy of the subsequent segmentation module.
[0090] (5) Segmentation module
[0091] The segmentation module uses the feature Z′ enhanced by the previous GSRM module t and Z′ d The texture and defects are directly segmented, so the following texture segmentation results are obtained And defect segmentation results
[0092]
[0093]
[0094] In the formula, Z′ t ,Z′ d ∈R W / 16×H / 16×16C , and represents the mapping function learned by the SM network, and Represents the network weight parameter of SM. The segmentation module includes four deconvolution modules, one deconvolution layer and one Sigmoid activation layer. The structures of the four deconvolution modules are the same, and the number of convolution kernels decreases by 1 / 2. The number of convolution kernels in the first deconvolution module is 128. Each deconvolution module includes two deconvolution layers, the step size of the first deconvolution layer is 2, and the step size of the second deconvolution layer is 1. The step size of the deconvolution layer before the Sigmoid activation layer is 1, and the number of convolution kernels is 1. The size of all convolution kernels in the segmentation module is 3x3. Because the area of the defective area is much smaller than the area of the normal texture area, this will bring about the problem of category imbalance. In order to avoid the adverse effects of category imbalance, pixel-level weighted cross entropy loss is adopted:
[0095]
[0096] In the formula, λ 1 Indicates L s The balance weight is set to 0.1 in this patent, E,⊙ and ||·|| 1 They represent mathematical expectation, Hadamard product and L1 norm respectively.
[0097] Example 2
[0098] A texture surface defect detection method, comprising:
[0099] The texture image to be tested is input into the texture surface defect detection model constructed by the texture surface defect detection model construction method described in Example 1 to obtain texture segmentation results and defect segmentation results; the texture segmentation results and defect segmentation results are weighted averaged to obtain the final detection result.
[0100] In this embodiment, after the model optimization is completed, it can be used for texture defect detection. Figure 2 As shown in the defect detection stage, the texture image I n Input the feature extraction module to extract the feature Z, and then separate it through the FSEM module to obtain the texture semantic information Z t and defect semantic information Z d , and then Z′ is obtained by the GSRM enhancement t and Z′ d Finally, the texture and defect are segmented by the SM to obtain the texture segmentation result. And defect segmentation results The texture surface defects can be detected by taking a weighted average of the two:
[0101]
[0102] Among them, the parameter λ f (0≤λ f≤1) is set to 0.5 in this patent. s Represents the final segmentation result. The defect detection effect is as follows Figure 5 shown.
[0103] Example 3
[0104] A computer-readable storage medium, the computer-readable storage medium including a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the method for constructing a texture surface defect detection model as described in Example 1 and / or the method for detecting texture surface defects as described in Example 2.
[0105] The relevant technical means are the same as those in Example 1 and Example 2 and will not be described in detail here.
[0106] In summary, the texture surface defect detection algorithm based on the semantic information decomposition network proposed in the present invention adopts a defect generation module to generate a large number of artificial defect samples, which solves the problem of the small number of real defect samples in actual scenes to a certain extent, and enables the present invention to accurately segment various types of texture surface defects without using any real defect samples; a feature separation and extraction module is used to decompose the texture semantic information and the defect semantic information from the feature map extracted by the feature extraction module to avoid the mutual coupling of the two types of information and cause adverse effects on the final segmentation accuracy; a global semantic relationship module is used to establish the correlation relationship of global semantic information and capture the contextual information of the whole image to enhance the local feature expression, thereby improving the robustness of the texture segmentation and defect segmentation of the network model.
[0107] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for constructing a texture surface defect detection model, It is characterized in that include: Build a texture surface defect detection model; the texture surface defect detection model includes a feature extraction module, a feature separation extraction module and a segmentation module connected in sequence; wherein: The feature extraction module is used to extract features from the input texture image to obtain a feature map; the feature separation and extraction module is used to separate the texture semantic information and the defect semantic information in the feature map to extract a texture feature map and a defect feature map; the segmentation module is used to segment the texture feature map and the defect feature map to obtain a texture segmentation result and a defect segmentation result; The texture surface defect detection model is trained using a training sample set with the goals of maximizing the difference between the texture feature map and the defect feature map at corresponding pixel positions, minimizing the distance between the texture feature map and the defect feature map and the cluster center, minimizing the inter-class similarity between the texture feature map and the defect feature map, and minimizing the difference between the predicted value and the true value of the texture segmentation result and the defect segmentation result.
2. The method for constructing a texture surface defect detection model according to claim 1, It is characterized in that The texture surface defect detection model also includes a global semantic relationship module located between the feature separation and extraction module and the segmentation module. The global semantic relationship module is used to obtain global context information and add the global context information to the texture feature map and defect feature map extracted by the feature separation and extraction module to enhance the expression ability of texture features and defect features.
3. The method for constructing a texture surface defect detection model according to claim 2, It is characterized in that The global semantic relationship module is based on the QKV self-attention mechanism, and uses a small matrix C to replace the large matrix Q in the QKV self-attention mechanism; wherein the small matrix C is composed of cluster center features learned based on feature clustering in the feature separation and extraction module.
4. The method for constructing a texture surface defect detection model according to any one of claims 1 to 3, It is characterized in that The training samples in the training sample set are obtained in the following way: The inverse color image of the Mask image is multiplied with the texture image of the defect-free product to obtain the normal texture area, and then the Mask image is multiplied with the noise image generated by two-dimensional Gaussian sampling to obtain the defect area, and the two are added to synthesize the false defect texture sample image; The Mask image is a binary image with a pixel value of 0 or 1. The area with a pixel value of 1 represents a defect area, and the area with a pixel value of 0 represents a normal texture area.
5. The method for constructing a texture surface defect detection model according to any one of claims 1 to 3, It is characterized in that The feature extraction module includes a first convolution module and a second convolution module; The first convolution module includes a first convolution layer and a first residual module, and the first residual module includes two convolution layers that add head and tail features in a skip connection manner; The second convolution module includes two residual modules, the structures of the two residual modules are the same as those of the first residual module, and the number of convolution kernels is twice that of the convolution layer in the first residual module.
6. The method for constructing a texture surface defect detection model according to any one of claims 1 to 3, It is characterized in that The feature separation and extraction module includes two branch networks with the same structure, one branch network is used to extract texture features, and the other branch network is used to extract defect features; Each branch network includes three convolution modules with the same structure, each convolution module includes two residual modules, and each residual module includes two convolution layers that add head and tail features in a jump connection manner; the number of convolution kernels in the three convolution modules is twice that of the previous layer.
7. The method for constructing a texture surface defect detection model according to any one of claims 1 to 3, It is characterized in that The segmentation module includes four deconvolution modules, a deconvolution layer and a Sigmoid activation layer; The structures of the four deconvolution modules are the same, the number of convolution kernels decreases in multiples of 1 / 2, and each deconvolution module includes two deconvolution layers.
8. A texture surface defect detection method, It is characterized in that include: Inputting the texture image to be tested into the texture surface defect detection model constructed by the method for constructing a texture surface defect detection model according to any one of claims 1 to 7 to obtain a texture segmentation result and a defect segmentation result; The texture segmentation result and the defect segmentation result are weighted averaged to obtain a final detection result.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the method for constructing a texture surface defect detection model as described in any one of claims 1 to 7 and / or the method for detecting texture surface defects as described in claim 8.
