Texture surface defect detection method and device, electronic equipment and storage medium

CN116758046BActive Publication Date: 2026-09-18BEIJING INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310815564.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-04
Publication Date
2026-09-18
Estimated Expiration
2043-07-04

AI Technical Summary

Technical Problem

通过利用无缺陷图像训练的特征字典进行纹理表面缺陷的确定,避免了无法收集大量缺陷图像导致缺陷检测不准确以及效率低的问题

Benefits of technology

[0017] This invention provides a method, apparatus, electronic device, and storage medium for detecting textured surface defects. By acquiring a textured surface image, extracting texture features from the textured surface image, and then fusing the texture features to obtain fused features, the defects of the textured surface are determined using the fused features and a feature dictionary obtained by training on defect-free images. This improves the efficiency and accuracy of textured surface defect detection and avoids the problems of inaccurate defect detection and low efficiency caused by the inability to collect a large number of defect images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116758046B_ABST
    Figure CN116758046B_ABST
Patent Text Reader

Abstract

The application provides a texture surface defect detection method and device, electronic equipment and storage medium, and relates to the technical field of defect detection, and comprises the following steps: acquiring a texture surface image, and extracting texture features of the texture surface image; fusing the texture features to obtain fused features, and determining defects of the texture surface based on the fused features and a feature dictionary; wherein the feature dictionary is obtained by training based on defect-free images, and the feature dictionary comprises a plurality of defect-free multi-level features. By acquiring the texture surface image, extracting the texture features of the texture surface image, fusing the texture features to obtain the fused features, and determining the defects of the texture surface by using the fused features and the feature dictionary obtained by training based on the defect-free images, the efficiency and accuracy of the texture surface defect detection are improved, and the problems of inaccurate defect detection and low efficiency caused by the inability to collect a large number of defect images are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect detection technology, and in particular to a method, apparatus, electronic device, and storage medium for detecting defects on textured surfaces. Background Technology

[0002] Detecting defects on the surface of industrial products is time-consuming and labor-intensive. Therefore, surface defect detection technology based on machine vision is being used more and more in industrial production.

[0003] Common surface defect detection algorithms can model defects of a given type that can be referenced, including using traditional machine vision methods and supervised convolutional neural network models, but they often require collecting defect images and using the defect images for model training.

[0004] In actual industrial production scenarios, surface defects have a low probability of occurrence and are highly random. It is often difficult to collect a large number of defect images in advance. Using a small number of defect images for training will result in poor accuracy and low efficiency in model defect detection. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a method, apparatus, electronic device, and storage medium for detecting textured surface defects. By using a feature dictionary trained on defect-free images to determine textured surface defects, the problems of inaccurate defect detection and low efficiency caused by the inability to collect a large number of defect images are avoided.

[0006] In a first aspect, embodiments of the present invention provide a method, apparatus, electronic device, and storage medium for detecting defects on textured surfaces, comprising: acquiring a textured surface image and extracting texture features from the textured surface image; fusing the texture features to obtain fused features; and determining defects on the textured surface based on the fused features and a feature dictionary; wherein the feature dictionary is obtained by training on a defect-free image and includes multiple defect-free multi-level features.

[0007] In a preferred embodiment of the present invention, the method further includes: extracting features from a defect-free image to obtain deep features and shallow features; fusing the deep features and shallow features to obtain multi-level features; constructing a multi-level feature set based on the multi-level features; and reducing the dimensionality of the multi-level feature set to obtain a feature dictionary.

[0008] In a preferred embodiment of the present invention, the above-mentioned fusion of deep features and shallow features to obtain multi-level features includes: upsampling the deep features to obtain upsampled features with the same size as the shallow features; and concatenating the upsampled features and shallow features to obtain multi-level features.

[0009] In a preferred embodiment of the present invention, the above-mentioned dimensionality reduction of the multi-level feature set to obtain the feature dictionary includes: dividing the multi-level feature set into multiple multi-level feature subsets; determining the information entropy of the multiple multi-level feature subsets; and using the multi-level feature subset with the smallest information entropy as the feature dictionary.

[0010] In a preferred embodiment of the present invention, there are multiple multi-level features. The above-mentioned division of the multi-level feature set into multiple multi-level feature subsets includes: randomly selecting a first multi-level feature from the multi-level feature set and adding it to the first multi-level feature subset; deleting the first multi-level feature from the multi-level feature set to obtain the remaining multi-level features; if the number of multi-level features in the first multi-level feature subset reaches a preset number threshold, randomly selecting a second multi-level feature from the remaining multi-level features and adding it to the second multi-level feature subset.

[0011] In a preferred embodiment of the present invention, after randomly selecting a second multi-level feature from the remaining multi-level features and adding it to the second multi-level feature subset, the method includes: if the number of multi-level features in the first multi-level feature subset does not reach a preset number threshold, determining the distance between the remaining multi-level features and the first multi-level feature subset, and adding the remaining multi-level feature with the smallest distance to the first multi-level feature subset.

[0012] In a preferred embodiment of the present invention, the above-mentioned determination of the defects of each texture feature based on the fusion feature and the feature dictionary includes: determining the feature in the feature dictionary that is the nearest neighbor to the fusion feature; determining the outlier of the texture surface image based on the nearest neighbor feature and the fusion feature; if the outlier is not equal to the preset value, the texture surface corresponding to the texture surface image has a defect.

[0013] Secondly, embodiments of the present invention also provide a textured surface defect detection device, comprising: a texture feature extraction module for acquiring a textured surface image and extracting texture features from the textured surface image; and a defect determination module for fusing the texture features to obtain fused features and determining defects on the textured surface based on the fused features and a feature dictionary; wherein the feature dictionary is obtained by training on a defect-free image and includes multiple defect-free multi-level features.

[0014] Thirdly, embodiments of the present invention also provide an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the texture surface defect detection method of the first aspect described above.

[0015] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the texture surface defect detection method of the first aspect described above.

[0016] The embodiments of the present invention bring the following beneficial effects:

[0017] This invention provides a method, apparatus, electronic device, and storage medium for detecting textured surface defects. By acquiring a textured surface image, extracting texture features from the textured surface image, and then fusing the texture features to obtain fused features, the defects of the textured surface are determined using the fused features and a feature dictionary obtained by training on defect-free images. This improves the efficiency and accuracy of textured surface defect detection and avoids the problems of inaccurate defect detection and low efficiency caused by the inability to collect a large number of defect images.

[0018] Other features and advantages of this disclosure will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.

[0019] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0020] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0021] Figure 1 A flowchart of a textured surface defect detection method provided in an embodiment of the present invention;

[0022] Figure 2 A flowchart of another textured surface defect detection method provided in an embodiment of the present invention;

[0023] Figure 3 This is a schematic diagram of feature fusion provided in an embodiment of the present invention;

[0024] Figure 4 This is a schematic diagram of a textured surface defect detection method provided in an embodiment of the present invention;

[0025] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0027] Detecting defects on the surface of industrial products is time-consuming and labor-intensive. Therefore, surface defect detection technology based on machine vision is being used more and more in industrial production.

[0028] Common surface defect detection algorithms can model defects of a given type that can be referenced, including using traditional machine vision methods and supervised convolutional neural network models, but they often require collecting defect images and using the defect images for model training.

[0029] In actual industrial production scenarios, surface defects have a low probability of occurrence and are highly random. It is often difficult to collect a large number of defect images in advance. Using a small number of defect images for training will result in poor accuracy and low efficiency in model defect detection.

[0030] Based on this, the present invention provides a method, apparatus, electronic device and storage medium for detecting textured surface defects. It can obtain textured surface images, extract texture features from the textured surface images, fuse the texture features to obtain fused features, and use the fused features and a feature dictionary obtained by training on defect-free images to determine the defects of the textured surface. This improves the efficiency and accuracy of textured surface defect detection and avoids the problems of inaccurate defect detection and low efficiency caused by the inability to collect a large number of defect images.

[0031] To facilitate understanding of this embodiment, a detailed description of a textured surface defect detection method disclosed in this embodiment of the invention will be provided first.

[0032] Example 1

[0033] This invention provides a method for detecting defects on textured surfaces. Figure 1 This is a flowchart illustrating a method for detecting textured surface defects according to an embodiment of the present invention. Figure 1 As shown, the textured surface defect detection method may include the following steps:

[0034] Step S101: Obtain the textured surface image and extract the texture features from the textured surface image.

[0035] Among them, textured surface images can be images obtained by taking pictures of materials such as tiles, wood panels, corrugated boards, and fabrics using a camera.

[0036] Among these methods, pre-trained networks can be used to extract texture features from textured surface images.

[0037] Step S102: The texture features are fused to obtain fused features, and the defects of the texture surface are determined based on the fused features and the feature dictionary.

[0038] The fused features are multi-level features with multi-level semantic information. The feature dictionary is obtained based on defect-free images and includes multiple defect-free multi-level features.

[0039] Specifically, determining the defects of each texture feature based on the fusion feature and the feature dictionary may include identifying the feature in the feature dictionary that is the nearest neighbor to the fusion feature; determining outliers in the texture surface image based on the nearest neighbor feature and the fusion feature; and if the outlier is not equal to a preset value, the texture surface corresponding to the texture surface image has defects.

[0040] Specifically, the Euclidean distance between the fused feature and each feature in the feature dictionary can be calculated, and the feature with the shortest Euclidean distance is selected as the nearest neighbor feature. The nearest neighbor feature is determined using the following formula: f * =argmin||f1-f||2, where f * f1 represents the nearest neighbor feature, f1 represents the fused feature, and f represents the feature in the feature dictionary.

[0041] Specifically, the Euclidean distance between the fused feature and the nearest neighbor feature is used as the outlier of the texture surface image, and the outlier is determined by the following formula: s * =||f1-f * ||2, where s * f represents outliers, f1 represents fused features, f * It represents the characteristics of the nearest neighbor.

[0042] The texture surface defect detection method provided in this invention can obtain texture surface images, extract texture features from the texture surface images, fuse the texture features to obtain fused features, and use the fused features and a feature dictionary obtained by training on defect-free images to determine the defects of the texture surface. This improves the efficiency and accuracy of texture surface defect detection and avoids the problems of inaccurate defect detection and low efficiency caused by the inability to collect a large number of defect images.

[0043] Example 2

[0044] This invention also provides another method for detecting textured surface defects. Figure 2This is a flowchart illustrating a method for detecting textured surface defects according to an embodiment of the present invention. Figure 2 As shown, the textured surface defect detection method may include the following steps:

[0045] Step S201: Extract features from the defect-free image to obtain deep features and shallow features.

[0046] The ResNet (Deep residual network) series backbone networks pre-trained in ImageNet can be used as feature extractors to extract features from defect-free images, obtaining deep features and shallow images. Examples include ResNet18, ResNet34, ResNet50, ResNet101, and ResNet154. ImageNet is a large visualization database used for research on visual object recognition software.

[0047] In this feature extractor, the fully connected layers are removed, while the convolutional layers are retained to extract features at different levels.

[0048] Step S202: Fuse deep features and shallow features to obtain multi-level features.

[0049] More comprehensive image information can be obtained through multi-level features, thereby improving algorithm performance and the accuracy of defect detection.

[0050] Specifically, fusing deep features and shallow features to obtain multi-level features can include: upsampling deep features to obtain upsampled features of the same size as shallow features; and concatenating upsampled features and shallow features to obtain multi-level features.

[0051] For ease of understanding, Figure 3 This is a schematic diagram of feature fusion provided in an embodiment of the present invention. Because shallow features have small receptive fields and focus more on detailed information, the overlapping area of ​​the receptive fields corresponding to each pixel is very small, resulting in higher resolution. In contrast, deep features have large receptive fields and focus more on global information; the receptive field corresponding to each pixel increases, and the overlapping area between receptive fields also increases, resulting in relatively lower resolution. Therefore, to complete feature stitching, deep features are usually upsampled to obtain upsampled features of the same size as the shallow features, ensuring successful feature stitching.

[0052] Step S203: Construct a multi-level feature set based on multi-level features.

[0053] Specifically, feature extraction can be performed on multiple defect-free images to obtain their respective deep and shallow features. Then, the deep and shallow features can be concatenated to obtain their respective multi-level features. A multi-level feature set can be constructed using all the obtained multi-level features.

[0054] Among them, the multi-level feature set has completeness and contains a large number of defect-free multi-level features.

[0055] Step S204: Dimensionality reduction is performed on the multi-level feature set to obtain the feature dictionary.

[0056] Multi-level feature sets also have repetition, so there will be repeated multi-level features, which leads to excessive computation and reduced efficiency when performing defect detection. Therefore, it is necessary to reduce the dimensionality of the multi-level feature set to obtain a feature dictionary.

[0057] Specifically, dimensionality reduction of the multi-level feature set to obtain the feature dictionary can include: dividing the multi-level feature set into multiple multi-level feature subsets; determining the information entropy of multiple multi-level feature subsets; and using the multi-level feature subset with the smallest information entropy as the feature dictionary.

[0058] Specifically, there are multiple multi-level features. Dividing the multi-level feature set into multiple multi-level feature subsets can include the following steps:

[0059] Step A1: Randomly select the first multi-level feature from the multi-level feature set and add it to the first multi-level feature subset.

[0060] In this process, the first multi-level feature, which is randomly selected, is used as the initial feature of the first multi-level feature subset.

[0061] Step A2: Delete the first multi-level feature from the multi-level feature set to obtain the remaining multi-level features.

[0062] In order to avoid duplicate multi-level features, after the first multi-level feature is added to the first multi-level feature subset, the first multi-level feature will be deleted from the multi-level feature set.

[0063] Step A3: Determine whether the number of multi-level features in the first multi-level subset has reached the preset number threshold.

[0064] Among them, a preset threshold can be set for the number of multi-level features to avoid adding multi-level features similar to the multi-level features in the first multi-level feature subset to the first multi-level subset.

[0065] Specifically, when the number of multi-level features in the first multi-level feature subset reaches a preset threshold, step A4 is executed; when the number of multi-level features in the first multi-level feature subset does not reach the preset threshold, step A5 is executed.

[0066] Step A4: If the number of multi-level features in the first multi-level feature subset reaches a preset threshold, randomly select a second multi-level feature from the remaining multi-level features and add it to the second multi-level feature subset.

[0067] When the number of multi-level features in the first multi-level feature subset reaches a preset threshold, a second multi-level feature will be randomly selected from the remaining multi-level features to construct a second multi-level feature subset. After the number of multi-level features in the second multi-level feature subset reaches the preset threshold, multi-level features will be randomly selected again from the remaining multi-level features to construct a multi-level feature subset, until there are no more multi-level features in the multi-level feature subset.

[0068] Step A5: If the number of multi-level features in the first multi-level feature subset does not reach the preset number threshold, determine the distance between the remaining multi-level features and the first multi-level feature subset, and add the remaining multi-level features with the smallest distance to the first multi-level feature subset.

[0069] Specifically, when the number of multi-level features in the first multi-level feature subset does not reach a preset threshold, the distance between the remaining multi-level features and the first multi-level feature subset is determined. Specifically, the distance between the remaining multi-level features and each multi-level feature in the first multi-level feature subset is determined, and the minimum distance is taken as the distance between the remaining multi-level feature and the first multi-level feature subset.

[0070] Specifically, the remaining multi-level features with the smallest distance will be added to the first multi-level feature subset. Specifically, the distance between each remaining multi-level feature and the first multi-level feature subset will be determined, and the multi-level feature with the smallest distance will be added to the first multi-level feature subset.

[0071] The texture surface defect detection method provided in this invention can extract features from defect-free images, then fuse the extracted deep and shallow features to obtain multi-level features, thereby constructing a multi-level feature set, and then reducing the dimensionality of the multi-level feature set to obtain a feature dictionary. By using easily collected defect-free images to train the feature dictionary, the problem of inaccurate defect detection and low efficiency caused by the inability to collect a large number of defect images is avoided.

[0072] Example 3

[0073] Corresponding to the above method embodiments, this invention provides a textured surface defect detection device. Figure 4 This is a schematic diagram of the structure of a textured surface defect detection device provided in an embodiment of the present invention, as shown below. Figure 4 As shown, the textured surface defect detection device may include:

[0074] The texture feature extraction module 401 is used to acquire a texture surface image and extract the texture features of the texture surface image.

[0075] The defect determination module 402 is used to fuse texture features to obtain fused features, and to determine defects on the texture surface based on the fused features and the feature dictionary; wherein, the feature dictionary is obtained by training on a defect-free image and includes multiple defect-free multi-level features.

[0076] The texture surface defect detection device provided in this embodiment of the invention can obtain texture surface images, extract texture features from the texture surface images, fuse the texture features to obtain fused features, and use the fused features and a feature dictionary obtained by training on defect-free images to determine the defects of the texture surface. This improves the efficiency and accuracy of texture surface defect detection and avoids the problems of inaccurate defect detection and low efficiency caused by the inability to collect a large number of defect images.

[0077] In some embodiments, the textured surface defect detection device further includes a training module, which is used to extract features from a defect-free image to obtain deep features and shallow features; fuse the deep features and shallow features to obtain multi-level features; construct a multi-level feature set based on the multi-level features; and reduce the dimensionality of the multi-level feature set to obtain a feature dictionary.

[0078] In some embodiments, the training module is further configured to upsample the deep features to obtain upsampled features of the same size as the shallow features; and to concatenate the upsampled features and the shallow features to obtain multi-level features.

[0079] In some embodiments, the training module is further configured to divide the multi-level feature set into multiple multi-level feature subsets; determine the information entropy of the multiple multi-level feature subsets; and use the multi-level feature subset with the smallest information entropy as the feature dictionary.

[0080] In some embodiments, there are multiple multi-level features. The training module is further configured to randomly select a first multi-level feature from the multi-level feature set and add it to the first multi-level feature subset; delete the first multi-level feature from the multi-level feature set to obtain the remaining multi-level features; if the number of multi-level features in the first multi-level feature subset reaches a preset threshold, randomly select a second multi-level feature from the remaining multi-level features and add it to the second multi-level feature subset.

[0081] In some embodiments, the training module is further configured to determine the distance between the remaining multi-level features and the first multi-level feature subset if the number of multi-level features in the first multi-level feature subset does not reach a preset number threshold, and add the remaining multi-level features with the smallest distance to the first multi-level feature subset.

[0082] In some embodiments, the defect determination module is further configured to determine the feature in the feature dictionary that is the nearest neighbor to the fused feature; determine the outlier of the texture surface image based on the nearest neighbor feature and the fused feature; if the outlier is not equal to the preset value, the texture surface corresponding to the texture surface image has a defect.

[0083] The device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0084] Example 4

[0085] This invention also provides an electronic device for running the above-described textured surface defect detection method; see [link to previous document]. Figure 5 The diagram shows the structure of an electronic device, which includes a memory 500 and a processor 501. The memory 500 is used to store one or more computer instructions, which are executed by the processor 501 to implement the above-mentioned textured surface defect detection method.

[0086] Furthermore, Figure 5 The electronic device shown also includes a bus 502 and a communication interface 503. The processor 501, the communication interface 503 and the memory 500 are connected via the bus 502.

[0087] The memory 500 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 503 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 502 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0088] Processor 501 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 501 or by instructions in software form. Processor 501 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 500, and processor 501 reads information from memory 500 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0089] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the above-described textured surface defect detection method. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0090] The computer program product for the method of detecting textured surface defects provided in this embodiment of the invention includes a computer-readable storage medium storing non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the method described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0091] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0092] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0093] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0094] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0095] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0096] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for detecting defects in textured surfaces, characterized in that, The method includes: Acquire a textured surface image and extract the texture features from the textured surface image; The texture features are fused to obtain fused features, and defects on the texture surface are determined based on the fused features and the feature dictionary; wherein, the feature dictionary is obtained by training on a defect-free image, and the feature dictionary includes multiple defect-free multi-level features; wherein, the multi-level feature set is complete and contains a large number of defect-free multi-level features; The method further includes: Feature extraction is performed on the defect-free image to obtain deep features and shallow features; Multi-level features are obtained by fusing the deep features and the shallow features; Construct a multi-level feature set based on the aforementioned multi-level features; The multi-level feature set is dimensionality reduced to obtain a feature dictionary; The fusion of the deep features and the shallow features yields multi-level features, including: Upsampling is performed on the deep features to obtain upsampled features of the same size as the shallow features; The multi-level features are obtained by concatenating the upsampled features and the shallow features; The dimensionality reduction of the multi-level feature set to obtain the feature dictionary includes: The multi-level feature set is divided into multiple multi-level feature subsets; Determine the information entropy of multiple said multi-level feature subsets; The multi-level feature subset with the smallest information entropy is used as the feature dictionary.

2. The method according to claim 1, characterized in that, The multi-level features are multiple, and the multi-level feature set is divided into multiple multi-level feature subsets, including: Randomly select a first multi-level feature from the multi-level feature set and add it to the first multi-level feature subset; The first multi-level feature is deleted from the multi-level feature set to obtain the remaining multi-level features; If the number of multi-level features in the first multi-level feature subset reaches a preset threshold, a second multi-level feature is randomly selected from the remaining multi-level features and added to the second multi-level feature subset.

3. The method according to claim 2, characterized in that, After randomly selecting a second multi-level feature from the remaining multi-level features and adding it to the second multi-level feature subset, the method includes: If the number of multi-level features in the first multi-level feature subset does not reach a preset threshold, the distance between the remaining multi-level features and the first multi-level feature subset is determined, and the remaining multi-level feature with the smallest distance is added to the first multi-level feature subset.

4. The method according to claim 1, characterized in that, The determination of defects for each texture feature based on the fused features and feature dictionary includes: Determine the feature in the feature dictionary that is the nearest neighbor to the fused feature; The outliers of the textured surface image are determined based on the nearest neighbor features and the fused features; If the outlier value is not equal to the preset value, the texture surface corresponding to the texture surface image has a defect.

5. A textured surface defect detection device, characterized in that, A method for implementing the textured surface defect detection method according to any one of claims 1 to 4 includes: The texture feature extraction module is used to acquire a textured surface image and extract the texture features of the textured surface image; The defect determination module is used to fuse the texture features to obtain fused features, and to determine the defects of the texture surface based on the fused features and the feature dictionary; wherein, the feature dictionary is obtained by training on a defect-free image, and the feature dictionary includes multiple defect-free multi-level features.

6. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the textured surface defect detection method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the textured surface defect detection method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Order paper defect detection method based on multistage feature comparison

    CN111709936A

  • AIS radiation source identification method and system based on multi-level sparse representation

    CN112183300A