Few-sample cable production surface defect detection method, system, equipment and medium

By using pre-trained Resnet50 model and channel-space attention module in cable defect detection, combined with the K-Means algorithm and the adaptive threshold segmentation module, the problems of low detection accuracy and insufficient adaptability in the prior art are solved, and high accuracy and adaptability of cable surface defect detection are achieved.

CN119515866AActive Publication Date: 2025-02-25SHANDONG ELECTRIC GRP DIGITAL TECH CO LTD +1

Patent Information

Application Number
CN202411738759.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-02-25
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

The existing cable surface defect detection technology has problems such as low detection accuracy, poor recognition ability of subtle defects and complex backgrounds, slow processing speed and insufficient adaptability, especially in scenarios with small sample data, which are difficult to effectively detect.

Method used

The Resnet50 model pre-trained by ImageNet dataset is used, and a channel-space attention module is added to the model. The positive sample core feature library is built with the K-Means algorithm, and the adaptive threshold segmentation module is used to detect defects to achieve high accuracy identification of cable surface defects.

Benefits of technology

It improves the accuracy and adaptability of cable surface defect detection, can effectively identify subtle defects and defects in complex backgrounds with few sample data, reduces the false detection rate, and has good generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119515866A_ABST
    Figure CN119515866A_ABST
Patent Text Reader

Abstract

The invention relates to the field of cable quality detection, in particular to a few-sample cable production surface defect detection method and device and a medium. The method comprises the following steps: firstly, loading a Resnet50 model pre-trained by an ImageNet data set, and migrating the universal feature extraction capability of the model learned from a big data set to the method; introducing a channel-space attention mechanism to enhance the perception capability of the model on the surface defect characteristics of the cable; performing structure and distribution modeling on the positive sample features through unsupervised learning, and constructing a positive sample feature library; in the detection stage, abnormal features are detected by comparing the difference between the test image features and the positive sample library, and then the detected abnormal feature heat map matrix is input into the self-adaptive threshold interception module to obtain a defect detection result. According to the method, the requirement for the data size is reduced, the cable defect detection requirement in a few-sample scene is met, and the false detection rate is effectively reduced based on the self-adaptive threshold interception method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cable quality detection, and in particular to a method, system, equipment and medium for detecting surface defects in cable production with a small number of samples. Background Art

[0002] With the continuous improvement of industrial automation level, the cable manufacturing industry has higher and higher requirements for product quality. As an important carrier of power transmission and signal conduction, it is crucial to ensure the surface quality of cables during their production process. Traditional cable surface defect detection methods mostly rely on manual visual inspection, which is not only inefficient, but also has a high missed detection rate due to the fatigue of the human eye after long-term work.

[0003] In recent years, with the development of image processing technology and machine vision, automated cable surface defect detection systems have gradually become a research hotspot. Such systems use high-speed cameras to capture cable surface images and analyze them through computer software, which can detect common defects such as bulges, pits, scratches, and sand holes in real time. However, the current technical solutions still have some shortcomings: the detection accuracy based on traditional visual algorithms is low, and traditional visual detection algorithms are prone to false alarms or missed alarms when facing subtle defects or defects in complex backgrounds; the processing speed of detection algorithms based on deep learning is slow, and as the speed of cable production lines increases, higher requirements are placed on the real-time performance of the detection system; in addition, the industrial scene is changeable, and algorithm adaptability is also an important indicator: the existing algorithms have poor adaptability, especially for unique scenes and unique products, it is difficult to build large-scale data sets, which is not enough to support the training needs of existing deep learning algorithms. Therefore, the field of cable defect detection has an urgent need for cable defect detection methods based on few samples. Summary of the invention

[0004] In view of the defects of the prior art, the present invention provides a small sample cable production surface defect detection method, system, equipment and medium, which are used to improve the accuracy of cable identification and realize the identification of subtle defects or defects in complex backgrounds.

[0005] In order to solve the technical problem, the technical solution adopted by the present invention is: a method for detecting surface defects in cable production with a small number of samples, comprising the following steps: S01. Load the Resnet50 model pre-trained with the ImageNet dataset and add a channel-spatial attention module to the Resnet50 model. S02, reading a normal cable sample image, which is pre-processed and input into the Resnet50 model of step S01, and the Resnet50 model performs feature extraction, feature dimension transformation and feature screening on the normal cable sample image to obtain a core feature library; S03, reading the test cable defect image, the test cable defect image is pre-processed and input into the Resnet50 model of step S01, the Resnet50 model performs feature extraction and feature dimension transformation on the test cable defect image to obtain a query feature vector, and all query feature vectors constitute a feature vector query library; S04, calculating the distance between all query feature vectors in the feature vector query library and the feature vectors in the core feature library, for a single query feature vector in the feature vector query library, calculating the distance between it and all feature vectors in the core feature library, taking the minimum value of the distance as the result, traversing the query feature vectors to obtain a metric matrix; S05. Reshape and interpolate the metric matrix to obtain a defect detection feature heat map matrix; S06. Input the defect detection feature heat map matrix into the adaptive threshold segmentation module. The adaptive threshold segmentation module includes three parts: a fixed threshold, a percentage interception threshold, and an adaptive threshold. The adaptive threshold segmentation module intercepts the defect detection feature heat map matrix. The obtained matrix is ​​named the threshold segmentation matrix. A convolution kernel is used to perform boundary detection on the threshold segmentation matrix. The detection result is projected onto the original input image to obtain the final surface defect detection image.

[0006] Furthermore, the Resnet50 model performs feature extraction and feature dimension transformation on normal cable sample images and test cable defect images as follows: S11. The Resnet50 model extracts features from the normal cable sample image and the test cable defect image to obtain the second layer features and the third layer features of the Resnet50 model; S12, performing sliding window processing on the second layer features and the third layer features of each input image, and stretching all features in the window into a one-dimensional vector; S13, transforming the dimensions of the two sets of feature tensors after the sliding window processing by a permute operation, expanding the dimensions by a linear interpolation method, compressing the two sets of features by an adaptive pooling layer and then concatenating them, and reducing the dimension of the concatenated result by an adaptive pooling layer to obtain a feature representation of a single image sample; S14, all input images are subjected to the operations of S12 and S13 to obtain their own feature representations, and the feature representations of all input images are concatenated and reshaped to obtain a feature representation combination of the input images; S15. The feature representation combination obtained in step S14 is adjusted in tensor dimension through a Linear layer, and the adjusted tensor constitutes a sample feature library.

[0007] Furthermore, the K-Means algorithm is used to screen the positive sample feature library to obtain the core feature library.

[0008] Furthermore, the threshold is fixed at 0.3.

[0009] Furthermore, the percentage cutoff threshold The 90th percentile of all elements in the defect feature heat map matrix, the adaptive threshold The value is mean_value×1.8, where mean_value is the mean of the defect feature heat map matrix. Percentage cutoff threshold , Adaptive Threshold The calculation process is: , Where M is the defect feature heat map matrix, and its elements represents the pixel value of the i-th row and j-th column in the matrix, To calculate the values ​​of more than 90% of the elements in M, is the 90th percentile value in M, N is the number of all elements in M; renew Pixel value: , Represents the threshold segmentation matrix, element express The pixel value at the i-th row and j-th column in the matrix.

[0010] Furthermore, in step S04, the cosine distances between all query feature vectors in the feature vector query library and the feature vectors in the core feature library are calculated.

[0011] The present invention also discloses a small number of sample cable production surface defect detection system, including a data acquisition module, a feature extraction module, a positive sample core feature library construction module, a feature measurement module and an adaptive threshold segmentation module; The data acquisition module is used to acquire training set images and test set images; The feature extraction module uses the Resnet50 model pre-trained with the ImageNet dataset, and adds a channel-spatial attention module to the Resnet50 model to extract features from the training set images and the test set images. The second and third layer outputs of the Resnet50 model are extracted as the extracted features, and the output features are transformed and pooled. The positive sample core feature library construction module clusters and screens the feature vectors obtained by the feature extraction module based on the K-Means algorithm to obtain the core feature library, which is used as the metric support set in the inference stage. The feature measurement module is used to calculate the distance between the feature vector of the test image and the vector in the core feature library during the inference phase. The larger the distance value, the greater the direction difference between the two vectors, that is, the lower the similarity between the two vectors; The adaptive threshold segmentation module is used to perform threshold processing on the metric matrix output by the feature metric module. The processing result is used for boundary detection through the convolution kernel, and the detected boundary is projected on the initial input image to obtain the cable defect detection result. A computer device includes a processor and a memory, the memory is used to store a computer executable program, the processor reads the computer executable program from the memory and executes it, and the processor executes the surface defect detection method for cable production with a small number of samples as described above when executing the computer executable program.

[0012] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the surface defect detection method for a small number of cable samples is implemented.

[0013] Beneficial effects of the present invention: The present invention uses transfer learning technology to migrate the general feature extraction model Resnet50 trained under large data sets to the field of cable defect detection, providing better model initialization for cable defect detection, and integrating the channel-space attention mechanism to enhance the model's ability to focus on defective parts. The present invention proposes a K-Means method for constructing a core feature set of positive samples in the field of cable defect detection, and designs a plug-and-play core feature library construction module, which is highly portable and can be quickly applied to other fields. The present invention designs an adaptive threshold extraction module. Currently, most fixed threshold methods are used in the field of defect detection, and can only be used for detection of specific data sets. When the data distribution changes, the original threshold defect detection effect is significantly reduced, and it needs to be manually adjusted according to the data. The adaptive threshold extraction module proposed in the present invention can automatically adjust the segmentation threshold according to the input data, and its adaptability is significantly better than the existing solutions. Based on the above points, the present invention proposes a new framework for cable surface defect detection with a small number of samples. The positive sample data is used as a support set to construct a positive sample feature library, the distribution pattern of the positive sample data is modeled, and the defect image is used as a query set for measurement through the cosine distance. The advantage of this framework lies in its flexibility in the amount of small sample data, and there is no dimension or quantity restriction on the input support set. That is, when the positive sample data has only one image, the framework can still operate normally and maintain a good segmentation effect. When there are multiple positive samples, a more accurate positive sample model can be constructed to provide a more accurate segmentation.

[0014] Compared with the existing algorithms, this algorithm only uses defect-free positive samples in the training stage, and does not need to use defective data, which greatly reduces the requirement for data volume and solves the cable defect detection needs in the scenario of few samples. In the post-processing stage, the adaptive threshold interception method effectively reduces the false detection rate. At the same time, the algorithm has good generalization ability in defect detection based on visible light images and has high promotion value in different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a flow chart of the method for detecting surface defects in cable production with a small number of samples described in Example 1; Figure 2 This is a diagram of the architecture of the surface defect detection system for cable production with a small number of samples described in Example 2; Figure 3 Schematic diagram of the channel-spatial attention (CBAM) module added to the Resnet50 network; Figure 4 This is the effect diagram of adaptive threshold segmentation; Figure 5 This is the double threshold segmentation effect diagram; Figure 6 This is the fixed threshold segmentation effect diagram; Figure 7 Schematic diagram of cable surface defects detected by this method; Figure 8 This is a schematic diagram of the detection effect overview. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings of the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0017] Example 1 This embodiment discloses a method for detecting surface defects in cable production with a small number of samples. This method first loads a Resnet50 model pre-trained with the ImageNet dataset, and transfers the general feature extraction capabilities learned by the model from the large data set to this method, providing a good model initialization for the cable defect detection algorithm through transfer learning; then the channel-space attention mechanism is introduced to enhance the model's perception of cable surface defect features; the positive sample features are structurally and distributedly modeled through unsupervised learning to build a positive sample feature library; in the algorithm reasoning stage, the differences between the test image features and the positive sample library are compared to detect abnormal features, and then the detected abnormal feature heat map matrix is ​​input into the adaptive threshold interception module to obtain defect detection results. Figure 1 As shown, the specific steps include: S01. Load the Resnet50 model pre-trained with the ImageNet dataset and add a channel-spatial attention module to the Resnet50 model. Figure 3 This is a schematic diagram of the channel-spatial attention (CBAM) module added to the Resnet50 network. The channel-spatial attention module is added to the Resnet50 model as the backbone extraction network for feature extraction.

[0018] S02. Read the normal cable sample image, and after Resize and Normalize preprocessing, the data dimension is 3×224×224, and input it into the Resnet50 model of step S01. The Resnet50 model extracts features of the normal cable sample image, and obtains the second and third layer features of the network through the Hook function. The second layer feature A dimension is 1×512×28×28, and the third layer feature B dimension is 1×1024×14×14.

[0019] The second and third layer features are processed by sliding windows. The sliding window size of the second layer feature group is 3×3×512. The entire feature group is slid in the dimension of 28×28, and all features in the window are stretched into one-dimensional vectors. The second layer feature A of 1×512×28×28 is converted into a tensor of 1×4608×784; for the third layer feature group B, the sliding window size is 3×3×1024, and the output tensor dimension is 1×9216×196.

[0020] The dimensionality transformation of the two groups of output feature tensors is performed through the permute operation, transforming them into 4608×28×28 and 9216×14×14. The dimension of B is expanded from 9216×14×14 to 9216×28×28 through the linear interpolation method. Then, the two groups of features are compressed through the adaptive pooling layer, and concatenated to obtain 784×2×1024. The concatenated result passes through the adaptive pooling layer and is reduced to a dimension of 784×1024 to obtain the feature representation of a single image sample. After all input images go through the above operations respectively, all the obtained image feature vectors are concatenated and reshaped to obtain the combined feature representation of the input images. Assuming that a total of N positive sample images are input, the output is (N×784)×1024.

[0021] Construct the core feature library C of positive samples. The features after concatenation and pooling dimensionality reduction pass through the Linear layer to obtain a tensor of (N×784)×128, which is named the positive sample feature library S. The K-Means algorithm is used to screen the features of the positive sample feature library to obtain the core feature library ((M×784)×128, M << N). The K-Means operation can enhance the difference between features while reducing the number of features, and screen out better features to represent the model of positive sample data.

[0022] S03. Read the test cable defect image. The test cable defect image is preprocessed and input into the Resnet50 model in step S01. The Resnet50 model performs the same feature extraction and feature dimensionality transformation on the test cable defect image as in step S02 to obtain the query feature vectors. All the query feature vectors form the feature vector query library; for a single test image, the dimension of its feature vector query library is 784*1024.

[0023] S04. Calculate the cosine distance between all the query feature vectors in the feature vector query library and the feature vectors in the core feature library to measure the difference between the query features and the positive sample features. For a single query feature vector in the feature vector query library, calculate its distance from all the feature vectors in the core feature library, and take the minimum value of the distance as the result. Traverse all the query feature vectors to obtain the metric matrix, and the dimension of the metric matrix is 1×784.

[0024] S05. Reshape the metric matrix into a 28×28 matrix, and each element in the matrix corresponds to the image patch at the corresponding position of the initial input data; perform interpolation transformation on the reshaped metric matrix to obtain a 224×224 Mask matrix, that is, the defect feature heat map matrix.

[0025] S06. Input the defect detection feature heat map matrix into the adaptive threshold segmentation module. The adaptive threshold segmentation module includes three parts: a fixed threshold, a percentage interception threshold, and an adaptive threshold. The adaptive threshold segmentation module intercepts the defect detection feature heat map matrix. The obtained matrix is ​​named the threshold segmentation matrix. A convolution kernel is used to perform boundary detection on the threshold segmentation matrix. The detection result is projected onto the original input image to obtain the final surface defect detection image.

[0026] In this embodiment, the fixed threshold is 0.3. Percentage cutoff threshold The 90th percentile of all elements in the defect feature heat map matrix, the adaptive threshold The value is mean_value×1.8, where mean_value is the mean of the defect feature heat map matrix. Percentage cutoff threshold , Adaptive Threshold The calculation process is: , Where M is the defect feature heat map matrix, and its elements represents the pixel value of the i-th row and j-th column in the matrix, To calculate the values ​​of more than 90% of the elements in M, is the 90th percentile value in M, N is the number of all elements in M; renew Pixel value: , Represents the threshold segmentation matrix, element express The pixel value at the i-th row and j-th column in the matrix.

[0027] The matrix obtained by intercepting the result Named as the threshold segmentation matrix, a convolution kernel Cov_kernel is used to perform boundary detection on the matrix. The convolution kernel Cov_kernel for boundary detection on the threshold segmentation matrix is: .

[0028] This embodiment implements the method proposed in this article and performs defect detection on cable images collected in actual factories. In the cable dataset used, all 42 defective images are used as test sets. 60 positive sample images are stretched by cutting out the defect-free parts of the defective images, 30 of which are used as support sets for training and 30 as test sets.

[0029] The hyperparameters are set to resize=240, imagesize=224, and the test results are as follows: the normal image false detection rate is 0%, and the defect image detection rate is 100%. The detection results output 69 defects, 62 defects are all detected, the recall rate is 100%, and the precision rate is about 89.86%.

[0030] In this embodiment, the present invention compares different threshold segmentation methods. Figure 4 This is the adaptive threshold segmentation effect diagram of this method. Figure 5 This is a double threshold (fixed threshold, percentile intercept threshold) segmentation effect diagram. Figure 6 This is a fixed threshold segmentation effect diagram. Figure 4 , Figure 5 and Figure 6 It was found that the adaptive threshold segmentation method proposed in this method has the best effect.

[0031] The final implementation effect is shown in Figure 7 , this method can identify defect-free images (such as Figure 7 a), pit defect image (as shown in Figure 7 b), bulge defect image (as shown in Figure 7 c), scratch defect image (as shown in Figure 7 d) and trachoma defect images (as shown in Figure 7 e), and gives an overview of the detection effect (as shown in Figure 8 as shown). Example 2 This embodiment discloses a system for detecting surface defects in cable production with a small number of samples. Figure 2 As shown, it includes a data acquisition module, a feature extraction module, a positive sample core feature library construction module, a feature measurement module and an adaptive threshold segmentation module.

[0032] The data acquisition module is used to obtain training set images and test set images (also called support set and query set in the field of few samples).

[0033] The feature extraction module uses the Resnet50 model pre-trained with the ImageNet dataset, such as Figure 3 As shown, a channel-spatial attention module is added to the Resnet50 model as the backbone extraction network for feature extraction, which is used to extract features from the training set images and the test set images. The second and third layer outputs of the Resnet50 model are extracted as the extracted features, and the output features are dimensionally transformed and pooled.

[0034] The positive sample core feature library construction module clusters and screens the feature vectors obtained by the feature extraction module based on the K-Means algorithm to obtain the core feature library, which is used as the metric support set in the inference stage.

[0035] The feature measurement module is used to calculate the distance between the feature vector of the test image and the vector in the core feature library during the inference phase. The cosine distance is used as the measurement method. The larger the distance value, the greater the difference in the directions of the two vectors, that is, the lower the similarity between the two vectors.

[0036] The adaptive threshold segmentation module is used to perform threshold processing on the metric matrix output by the feature metric module. The processing result is subjected to boundary detection through the convolution kernel, and the detected boundary is projected onto the initial input image to obtain the cable defect detection result.

[0037] Example 3 This embodiment discloses a computer device, including a processor and a memory, the memory is used to store a computer executable program, the processor reads the computer executable program from the memory and executes it, and when the processor executes the computer executable program, it performs the surface defect detection method for cable production with a small number of samples as described in Example 1.

[0038] Example 4 A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for detecting surface defects in cable production with a small number of samples using an adaptive threshold as described in Example 1 can be implemented.

[0039] The contents not described in detail in the specification of the present invention belong to the common knowledge of those skilled in the art.

[0040] The above is the embodiment of the present application. The above embodiments and the specific parameters in the embodiments are only for the purpose of clearly describing the verification process of the application, and are not intended to limit the scope of patent protection of the present application. The scope of patent protection of the present application is still subject to its claims, and any equivalent structural changes made by using the description and drawings of the present application should be included in the scope of protection of the present application.

Claims

1. A method for detecting surface defects in cable production with a small number of samples, characterized in that: The following steps are involved: S01. Load the Resnet50 model pre-trained with the ImageNet dataset and add a channel-spatial attention module to the Resnet50 model. S02, reading a normal cable sample image, which is pre-processed and input into the Resnet50 model of step S01, and the Resnet50 model performs feature extraction, feature dimension transformation and feature screening on the normal cable sample image to obtain a core feature library; S03, reading the test cable defect image, the test cable defect image is pre-processed and input into the Resnet50 model of step S01, the Resnet50 model performs feature extraction and feature dimension transformation on the test cable defect image to obtain a query feature vector, and all query feature vectors constitute a feature vector query library; S04, calculating the distance between all query feature vectors in the feature vector query library and the feature vectors in the core feature library, for a single query feature vector in the feature vector query library, calculating the distance between it and all feature vectors in the core feature library, taking the minimum value of the distance as the result, traversing the query feature vectors to obtain a metric matrix; S05. Reshape and interpolate the metric matrix to obtain a defect detection feature heat map matrix; S06. Input the defect detection feature heat map matrix into the adaptive threshold segmentation module. The adaptive threshold segmentation module includes three parts: a fixed threshold, a percentage interception threshold, and an adaptive threshold. The adaptive threshold segmentation module intercepts the defect detection feature heat map matrix. The obtained matrix is ​​named the threshold segmentation matrix. A convolution kernel is used to perform boundary detection on the threshold segmentation matrix. The detection result is projected onto the original input image to obtain the final surface defect detection image.

2. The method for detecting surface defects in cable production with a small number of samples according to claim 1, characterized in that: The process of Resnet50 model extracting features and transforming feature dimensions for normal cable sample images and test cable defect images is as follows: S11. The Resnet50 model extracts features from the normal cable sample image and the test cable defect image to obtain the second layer features and the third layer features of the Resnet50 model; S12, performing sliding window processing on the second layer features and the third layer features of each input image, and stretching all features in the window into a one-dimensional vector; S13, transforming the dimensions of the two sets of feature tensors after the sliding window processing by a permute operation, expanding the dimensions by a linear interpolation method, compressing the two sets of features by an adaptive pooling layer and then concatenating them, and reducing the dimension of the concatenated result by an adaptive pooling layer to obtain a feature representation of a single image sample; S14, all input images are subjected to the operations of S12 and S13 to obtain their own feature representations, and the feature representations of all input images are concatenated and reshaped to obtain a feature representation combination of the input images; S15. All image feature representation combinations obtained in step S14 are adjusted in tensor dimension through a Linear layer, and the adjusted tensors constitute a sample feature library.

3. The method for detecting surface defects in cable production with a small number of samples according to claim 2, characterized in that: The K-Means algorithm is used to screen the positive sample feature library to obtain the core feature library.

4. The method for detecting surface defects in cable production with a small number of samples according to claim 1, characterized in that: The threshold is fixed at 0.

3.

5. The method for detecting surface defects in cable production with a small number of samples according to claim 1, characterized in that: Percentage cutoff threshold The 90th percentile of all elements in the defect feature heat map matrix, the adaptive threshold The value is mean_value×1.8, where mean_value is the mean of the defect feature heat map matrix. Percentage cutoff threshold , Adaptive Threshold The calculation process is: , Where M is the defect feature heat map matrix, and its elements represents the pixel value of the i-th row and j-th column in the matrix, To calculate the values ​​of more than 90% of the elements in M, is the 90th percentile value in M, and N is the number of all elements in M; renew Pixel value: , Represents the threshold segmentation matrix, element express The pixel value at the i-th row and j-th column in the matrix.

6. The method for detecting surface defects in cable production with a small number of samples according to claim 1, characterized in that: The convolution kernel Cov_kernel for boundary detection of the threshold segmentation matrix is: 。 7. The method for detecting surface defects in cable production with a small number of samples according to claim 1, characterized in that: In step S04, the cosine distances between all query feature vectors in the feature vector query library and the feature vectors in the core feature library are calculated.

8. A small sample cable production surface defect detection system, characterized by: It includes data acquisition module, feature extraction module, positive sample core feature library construction module, feature measurement module and adaptive threshold segmentation module; The data acquisition module is used to acquire training set images and test set images; The feature extraction module uses the Resnet50 model pre-trained with the ImageNet dataset, and adds a channel-spatial attention module to the Resnet50 model to extract features from the training set images and the test set images. The second and third layer outputs of the Resnet50 model are extracted as the extracted features, and the output features are transformed and pooled. The positive sample core feature library construction module clusters and screens the feature vectors obtained by the feature extraction module based on the K-Means algorithm to obtain the core feature library, which is used as the metric support set in the inference stage. The feature measurement module is used to calculate the distance between the feature vector of the test image and the vector in the core feature library during the inference phase. The larger the distance value, the greater the direction difference between the two vectors, that is, the lower the similarity between the two vectors; The adaptive threshold segmentation module is used to perform threshold processing on the metric matrix output by the feature metric module. The processing result is subjected to boundary detection through the convolution kernel, and the detected boundary is projected onto the initial input image to obtain the cable defect detection result.

9. A computer device, comprising a processor and a memory, the memory being used to store a computer executable program, the processor reading the computer executable program from the memory and executing it, and the processor executing the method for detecting surface defects in cable production with a small number of samples as described in any one of claims 1 to 7 when executing the computer executable program.

10. A computer-readable storage medium having a computer program stored therein, wherein the computer program, when executed by a processor, performs the method for detecting surface defects in cable production with a small number of samples as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Surface defect detection method based on positive case training

    CN108961217A

  • Unsupervised defect detection method based on deep learning feature correlation

    CN114862772A

  • Small sample surface defect image generation method and system based on feedback reinforcement learning

    CN117710349A

  • Deep learning defect detection method and device based on positive sample

    CN118396919A

  • KR20240055931A

Cited By

  • Multi-party cooperative scheduling and production process tracking method for cable outsourcing supply chain

    CN122550312A