Zero-sample visual defect rapid detection method based on core set strategy
By employing a zero-shot visual defect detection method based on a core set strategy, which utilizes deep neural networks and sparse sampling to generate core sets, the dependence of traditional methods on training data is eliminated, enabling fast and accurate defect detection and improving detection time performance and generalization.
Patent Information
- Application Number
- CN202511912554.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies for industrial defect detection are highly dependent on training data, which increases resource costs and makes it difficult to meet the requirements for real-time performance and speed, especially in zero-sample scenarios where defect detection performance is insufficient.
A zero-shot visual defect detection method based on a core set strategy is adopted. By collecting product surface images, multi-scale features are extracted using a pre-set deep neural network. An initial core set is generated by combining a sparse sampling strategy. The core set is then expanded and filtered through mutual scoring to generate a normal paradigm core set. Finally, the core set is used to perform similarity scoring for defect detection.
It significantly improves the time performance and generalization of detection in zero-sample scenarios, enabling rapid and accurate defect detection, reducing dependence on external data, and meeting the real-time and accuracy requirements of industrial production.
Smart Images

Figure CN121685505A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of defect detection technology, and in particular to a zero-sample rapid visual defect detection method based on a core set strategy. Background Technology
[0002] In today's industrial production environment, any product defect exceeding certain standards can lead to significant and uncontrollable risks and losses. These potential safety risks and property damages have prompted producers to seek a detection algorithm that can promptly and accurately identify product defects, precisely adapt to complex and ever-changing industrial environments, and meet the dual requirements of ensuring both production efficiency and quality.
[0003] Due to manufacturers' considerations regarding time and cost, the quality analysis of industrial products is often based on a series of images captured by cameras on the production line. The problem of defect detection in industrial products can be transformed into the task of identifying and locating abnormal regions in the images, and related anomaly detection algorithms are widely used in industrial defect detection. However, traditional image anomaly detection methods still have some shortcomings, preventing them from perfectly meeting certain scenarios in industrial defect detection, especially since industrial defect detection tasks often have high requirements for both the cost of training data acquisition and annotation, as well as actual detection speed. In industrial inspection application scenarios, it is impossible to know in advance about potential defects that may occur during product manufacturing. Even with the most abundant data, only a few sample images of normal products can be provided; more often, due to difficulties in data acquisition and manual annotation, providing training images is also challenging. Simultaneously, practical applications require timely inspection and rapid feedback of products on the production line; otherwise, massive amounts of data will inevitably lead to missed detections, accumulation, and a series of serious consequences. Therefore, industrial production urgently needs a method for rapid and accurate defect detection that does not rely on training samples. Patent document CN116228754A (application number: 202310504401.X) discloses a surface defect detection method based on deep learning and global differential information. The method includes: constructing a benchmark sample set and a normal training sample set from a training set of datasets collected from industrial sites; fitting the features of the benchmark sample set to a multivariate Gaussian distribution to obtain Gaussian distribution parameters corresponding to local regions at different locations on the sample images; calculating the Mahalanobis distance between the features of each sample in the normal training sample set and the corresponding Gaussian distribution fitted by the benchmark sample set to obtain a global differential information distribution map; fusing this map with the original corresponding sample image representation to obtain the final input data; inputting each pair of original sample images and the differential information distribution map into a segmentation network to output a defect score map; and constructing a loss function to train the network model. The shortcomings of this technique are: the assumption made manually about the multivariate Gaussian distribution of sample features in surface defect detection is inaccurate, and some data scenarios do not conform to this assumption; furthermore, the training data requires relatively complex manual pre-screening and labeling, resulting in relatively high resource costs for industrial production.The paper LIX, HUANGZ, XUEF, et al. Musc: Zero-shot industrial anomaly classification and segmentation with mutual scoring of the unlabeled images [C] / / The Twelfth International Conference on Learning Representations. 2024. discloses a defect detection method suitable for zero-shot scenarios. The surface defect detection method includes: summarizing the prior distribution characteristics of defects in industrial production data; extracting features from test images using a pre-trained visual Transformer-ViT; scoring the similarity of each local feature in the feature space using all other data; comprehensively evaluating the frequency of each local data paradigm at the image level to calculate the pixel-level anomaly degree; optimizing the image-level anomaly score using a graph network method; and correcting the image-level score using the similarity between images. This method achieves state-of-the-art (SOTA) performance in a completely zero-shot defect detection task, even surpassing most full-shot methods, demonstrating strong learning capabilities. However, this method involves comparing massive amounts of data, resulting in relatively high time complexity. As the amount of data increases, the processing cost of a single image further rises, which does not meet the demands of industrial production for real-time performance and speed. Summary of the Invention
[0004] To overcome the shortcomings of existing technologies, the purpose of this invention is to provide a zero-sample rapid visual defect detection method based on a core set strategy, thereby solving the problem of dependence on training data in traditional methods.
[0005] To achieve the above objectives, the present invention provides the following solution:
[0006] A zero-shot visual defect rapid detection method based on a core set strategy includes:
[0007] Surface images of products on the target production line are acquired and preprocessed to obtain test image data;
[0008] The test image data is processed by an encoder using a pre-defined deep neural network to extract features and obtain multi-scale features.
[0009] The multi-scale features are sampled using a sparse sampling strategy to obtain an initial core set;
[0010] The initial core set is expanded and filtered by scoring the multi-scale features and the initial core set to obtain the normal paradigm core set.
[0011] The test image data is scored for similarity using the core set of the normal paradigm to obtain anomaly scores for the image and local regions.
[0012] Preferably, surface images of products on the target production line are acquired, and the surface images are preprocessed to obtain test image data, including:
[0013] The surface of the product to be inspected is captured using a pre-deployed camera to obtain the surface image, and the surface image is corrected using camera intrinsic parameters;
[0014] The surface image is preprocessed to obtain the test image data; the preprocessing includes: cropping, scaling, and regularization.
[0015] Preferably, the test image data is subjected to feature extraction using a pre-defined deep neural network encoder to obtain multi-scale features, including:
[0016] The deep neural network is configured; the deep neural network includes any one of ResNet-18 and VisionTransformer.
[0017] The test image data is input into the deep neural network for encoding. The output tensors of several intermediate layers of the deep neural network are set as local region features, and the features output by the final layer of the deep neural network are set as overall image features.
[0018] The local region features are projected onto the same resolution using bilinear interpolation and then stitched together along the channel dimension to obtain a feature map.
[0019] The multi-scale features are obtained by integrating the feature map and the overall image features.
[0020] Preferably, a sparse sampling strategy is used to sample the multi-scale features to obtain an initial core set, including:
[0021] Select from the multi-scale features using the k-center-greedy strategy or random sampling strategy. Image features are extracted and fused by channel to obtain initial sparse features; among them... It is an integer not less than 1;
[0022] The k-center-greedy strategy is used to select the initial sparse features. The initial core set is obtained by considering local features; wherein, It is an integer not less than 1.
[0023] Preferably, the initial core set is expanded and filtered by scoring the multi-scale features and the initial core set to obtain a normal paradigm core set, including:
[0024] Based on the multi-scale features, the initial core set is subjected to a first supplementary processing or a second supplementary processing to obtain an expanded core set;
[0025] The extended core set is subjected to a first filtering process or a second filtering process to obtain the normal paradigm core set.
[0026] Preferably, the test image data is scored for similarity using the normal paradigm core set to obtain anomaly scores for the image and local regions, including:
[0027] The nearest distance between each data point in the test image data and the core set of the normal paradigm is extracted using a first anomaly degree formula to obtain the original local anomaly data; the first anomaly degree formula is: ;in, For the first The first one in the picture The distance between each data point and the core data points of the normal paradigm; For data point sequence numbers;
[0028] The original local anomaly data is calculated using a second anomaly degree formula to obtain comprehensive local anomaly data; the second anomaly degree formula is: or ;in, For the first The degree of abnormality in the image; , These are the width and height of the original image, respectively; Indicates the domain; For the field Data points within;
[0029] The comprehensive local anomaly data is upsampled to the original image resolution of the test image data using bilinear interpolation to obtain the image and the anomaly score of the local region.
[0030] Preferably, the first supplementary processing includes:
[0031] Define an extraction parameter set; the extraction parameter set is an increasing sequence.
[0032] Based on the initial core set, distance evaluation is performed on all local region features extracted by channel for each multi-scale feature using the first distance calculation formula to obtain similarity evaluation data; the first distance calculation formula is: ;in, For the initial core set and the first The first one in the picture Data points The distance; For the initial core set of the first Data points With the The first one in the picture Data points The distance;
[0033] Based on the similarity evaluation data, the first... The image that is farthest from the initial core set Each data point is updated to the initial core set, and the process returns to the step "Based on the initial core set, use the first distance calculation formula to evaluate the distance of all local region features extracted by each channel for each multi-scale feature, and obtain similarity evaluation data", until the extraction parameter set traversal is completed, resulting in an expanded core set; wherein, This refers to the m-th parameter in the extracted parameter set;
[0034] The second supplementary processing procedure includes:
[0035] Set fixed extraction parameters;
[0036] Based on the initial core set, the second distance calculation formula is used to evaluate the distance of all local region features extracted by channel for each of the multi-scale features, thereby obtaining the similarity evaluation data; the second distance calculation formula is: ;in, This refers to the initial core set;
[0037] Based on the similarity evaluation data, the first... The image that is farthest from the initial core set Each data point is updated to the initial core set, and the process returns to the step "Based on the initial core set, use the first distance calculation formula to perform distance evaluation on all local region features extracted by channel for each multi-scale feature to obtain similarity evaluation data", until iteration. This process stops there, resulting in an expanded core set; among which... The fixed extraction parameters; The total amount of data is the same as the total amount of data in the extracted parameter set.
[0038] Preferably, the first screening process includes:
[0039] The expanded core set is calculated using the third distance calculation formula to obtain anomaly level data; the third distance calculation formula is: ;in, The abnormality level data; , These are the width and height of the original image, respectively;
[0040] Remove the data with the highest degree of anomaly from the expanded core set. The system returns to the step "Calculate the expanded core set using the third distance calculation formula to obtain the anomaly level data" until the extraction parameter set traversal is completed, and the normal paradigm core set is obtained.
[0041] The second screening process includes:
[0042] The anomaly level data is obtained by calculating the expanded core set using the third distance calculation formula.
[0043] Remove the data with the highest degree of anomaly from the expanded core set. The system iterates through the data points and returns to the step "Calculate the expanded core set using the third distance calculation formula to obtain the anomaly level data" until the iteration ends. After stopping, the normal paradigm core set is obtained.
[0044] The present invention discloses the following technical effects:
[0045] This invention provides a zero-shot visual defect rapid detection method based on a core set strategy. By introducing a small core set in the zero-shot scenario, it solves the problem of excessive time complexity caused by comparing massive amounts of data, thereby improving the time performance of the algorithm in real-world scenarios. By extracting the general distribution pattern of defect features in the test data and evaluating whether the data is defective, it solves the problem of dependence on external data information in conventional zero-shot methods, thereby improving the generalization of the method. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 A schematic diagram of a zero-sample visual defect rapid detection process based on a core set strategy provided in an embodiment of the present invention;
[0048] Figure 2 This is a flowchart of a zero-sample rapid visual defect detection method provided in an embodiment of the present invention.
[0049] Figure 3 This is a schematic diagram of the feature extraction framework provided in an embodiment of the present invention;
[0050] Figure 4 A schematic diagram of the core set learning framework provided in an embodiment of the present invention. Detailed Implementation
[0051] The technical solutions of the embodiments 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, and 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.
[0052] The purpose of this invention is to provide a zero-sample rapid visual defect detection method based on a core set strategy, which solves the problem of dependence on training data in traditional methods.
[0053] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0054] Figure 1 This is a schematic diagram of a zero-sample rapid visual defect detection process based on a core set strategy provided in an embodiment of the present invention. Figure 2 The flowchart for zero-sample rapid detection of visual defects provided in embodiments of the present invention is as follows: Figure 1 and Figure 2 As shown, this invention provides a zero-shot visual defect rapid detection method based on a core set strategy, comprising:
[0055] Step 100: Acquire surface images of products on the target production line and preprocess the surface images to obtain test image data;
[0056] Step 200: Use a preset deep neural network encoder to extract features from the test image data to obtain multi-scale features;
[0057] Step 300: Use a sparse sampling strategy to sample the multi-scale features to obtain an initial core set;
[0058] Step 400: Expand and filter the initial core set by scoring the multi-scale features and the initial core set to obtain the normal paradigm core set;
[0059] Step 500: Use the normal paradigm core set to score the similarity of the test image data to obtain the image and local region anomaly scores.
[0060] In summary, this embodiment proposes a zero-shot defect detection method: In a task scenario that does not rely on training image data, firstly, an image of the product surface to be inspected is acquired from an industrial production line using a suitable image acquisition device, and the image is corrected and preprocessed according to camera parameters; then, a pre-trained deep neural network model (such as a ResNet convolutional network or a visual Transformer) is used to quickly extract local features from the preprocessed image, and an initial core set is obtained through step-by-step downsampling; based on this, a core set learning method combining expansion and filtering is proposed to further generate a rich and defect-free reference feature core set; finally, based on the reference feature core set, all local features of the processed image are re-scored by nearest neighbors, and the degree of anomaly in the local area is approximately estimated by the degree of nearest neighbor, thus meeting the need for accurate and rapid detection of product surface defects.
[0061] Specifically, this embodiment employs the following steps to achieve industrial defect detection in zero-sample task scenarios:
[0062] S1: Collect surface images of the products on the production line and preprocess them to obtain test image data;
[0063] S2: Input the test image data into a deep neural network, use an encoder to extract and process features, and obtain multi-scale features of the test data;
[0064] S3: Use a sparse sampling strategy to obtain the initial core set from the massive multi-scale features of the test data;
[0065] S4: Expand and filter the initial core set by using the mutual scoring method between the multi-scale features of the test data and the core set features to obtain the final normal paradigm core set.
[0066] S5: Use the final normal paradigm core set to perform the final similarity score on the test data, which serves as the anomaly score between the image and the local region.
[0067] Furthermore, S1 includes the following steps:
[0068] S1.1: Use a suitable platform to mount a camera to acquire high-resolution image data of the surface to be inspected, transmit it to the camera controller via cable or wireless transmission, and perform image correction according to the camera parameters;
[0069] S1.2: Preprocess the corrected image data, including but not limited to cropping, scaling, and regularization, to obtain image data of uniform specifications that can be processed by deep neural networks. Each image has the following dimensions: ,in Indicates the number of channels. and These represent the horizontal resolution and the vertical resolution, respectively.
[0070] refer to Figure 3 S2 includes the following steps:
[0071] S2.1: Use a deep neural network such as ResNet-18 or VisionTransformer as the encoder, input the image data into it, and select the output tensors of multiple intermediate layers as local region features, such as taking the feature maps output by two intermediate layers. Its size is and ,in This represents the number of channels in the feature map. This represents the lateral resolution of the feature map. This represents the vertical resolution of the feature map. The final layer of the network outputs the features... The features representing the overall image, with a size of .
[0072] S2.2: For multi-scale features, the feature map with lower resolution is adjusted to the same resolution as the feature map with higher resolution through bilinear interpolation, and then concatenated along the channel dimension to obtain the feature map. The number of channels is Generally, shallow features have a higher resolution than deep features. Subsequently, each image to be tested corresponds to a set of feature maps at a specified resolution and an image-level feature.
[0073] Specifically, S3 includes the following steps:
[0074] Preferably, S3.1: For the test image obtained after processing in step S2 Each size is Feature maps and The strip size is Image features, using a k-center-greedy strategy from Sparse selection of image features And this The feature maps corresponding to the images are extracted by channel and then fused to obtain the total. The length of the strip is Its characteristics.
[0075] Optionally, S3.1: For the test image obtained after processing in step S2 Each size is Feature maps and The strip size is Image features, using a random sampling strategy from Quickly and randomly select from image features Image features, and this The feature maps corresponding to the images are extracted by channel and then fused to obtain... The length of the strip is Its characteristics.
[0076] S3.2: From what was just obtained The length of the strip is Among the features, the k-center-greedy strategy is used again to sparsely select... These local features form an initial core set to roughly simulate the distribution of local region feature data in all test images. The size of the initial core set is [size missing]. .
[0077] refer to Figure 4 S4 includes the following steps:
[0078] Preferably, S4.1: Incrementally select parameters , represents the number of features added to the core set by a single image in each step, and is recommended to be a natural number within the range [1, 30]. The values are respectively... Repeat the following process Next: Using the existing core set, distance evaluation is performed between it and all local region features extracted by channel for each feature map. The Middle Data points With the The first one in the picture Data points The distance calculation method is as follows:
[0079]
[0080]
[0081] For each image, perform core set similarity evaluation on all data points, and select the first core set similarity. Zhang Tu and Core Set The farthest Each data point is added to the core set. Each time this operation is performed, the number of features in the core set increases. indivual.
[0082] Optionally, S4.1: Select parameters , representing the number of features added to the core set by a single image in each step, with a recommended value range of natural numbers within [1, 30]. Repeat the following process. Next: Using the existing core set, distance evaluation is performed between it and all local region features extracted by channel for each feature map. The Middle Data points With the The first one in the picture Data points The distance calculation method is as follows:
[0083]
[0084]
[0085] For each image, perform core set similarity evaluation on all data points, and select the first core set similarity. Zhang Tu ( In the core set The farthest Each data point is added to the core set. Each time this operation is performed, the number of features in the core set increases. indivual.
[0086] Preferably, S4.2: After each m-th expansion of the core set as described in step S4.1, the data in the core set is also filtered once. Calculate the m-th... Data points With the The first one in the picture Data points Distance:
[0087]
[0088] Then the first Zhang Tu focuses on the core content. Data points The distance is expressed as:
[0089]
[0090] Summing all image pairs of data points The sum of the distances represents the core concentration of the first Data points The degree of anomaly was determined. Data points in the core set were ranked according to their anomaly severity, and those with the highest anomaly severity were filtered out. There are M data points. After all M operations are completed, the final normal paradigm core set is obtained;
[0091] Optionally, S4.2: After all the expansions of the core set are completed, the data in the core set is filtered. Calculate the first... Data points With the The first one in the picture Data points Distance:
[0092]
[0093] Then the first Zhang Tu focuses on the core content. Data points The distance is expressed as:
[0094]
[0095] Summing all image pairs of data points The sum of the distances represents the core concentration of the first Data points The degree of anomaly was used to rank the data points in the core set, and the data with the highest degree of anomaly was filtered out. There are M data points. After all M operations are completed, the final normal paradigm core set is obtained.
[0096] Furthermore, S5 includes the following steps:
[0097] S5.1: Section The first one in the picture Data points The degree of anomaly is given by the distance between that point and the core data points. The degree of anomaly is determined by the closest distance between the point and all data points in the core set. This is used to derive the degree of anomaly for each local region in each image.
[0098] Preferably, S5.2: the first The degree of anomaly in the image is as described in S5.1, which refers to all local region data points in the image. abnormality ( The combined results are expressed as follows:
[0099]
[0100] in Representing data points The neighborhood in the feature space.
[0101] Optionally, S5.2: The The degree of anomaly in the image is as described in S5.1, which refers to all local region data points in the image. The most prominent degree of abnormality ( The given information is represented as: .
[0102] S5.3: Since the resolution of the feature map is lower than that of the original image, the resolution of the anomaly score distribution map obtained using the features is also lower than that of the original image. In order to obtain the specific degree of anomaly for each pixel, the predicted anomaly score distribution map is upsampled to the resolution of the original image using bilinear interpolation. At this point, the anomaly score at each location corresponds to the degree of anomaly of the corresponding pixel in the original image.
[0103] The beneficial effects of this invention are as follows:
[0104] (1) This invention significantly improves the time performance of the algorithm in real-world scenarios by introducing a small core set in zero-sample scenarios, thus ensuring real-time performance.
[0105] (2) The present invention obtains the initial core set by a sparse downsampling method based on the greedy method, which can more accurately and fully represent the feature distribution information, thereby ensuring that the core set features obtained from the test data can be closer to the true distribution of the test data as a whole.
[0106] (3) This invention extracts the general distribution pattern of defect features in test data and evaluates whether the data is defective based on this pattern, thereby avoiding the dependence of conventional zero-sample methods on external data information and effectively improving the generalization and robustness of the method.
[0107] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0108] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A core-set policy based zero-shot visual defect rapid detection method, characterized in that, The method comprises the following steps: Collecting the surface image of the product on the target flow line, and pre-processing the surface image to obtain test image data; Using the encoder of the preset deep neural network to extract features from the test image data to obtain multi-scale features; Using a sparse sampling strategy to sample the multi-scale features to obtain an initial core set; The initial core set is expanded and screened by scoring each other between the multi-scale features and the initial core set to obtain a normal norm core set; Using the normal norm core set to score the similarity of the test image data to obtain image and local area anomaly scores.
2. The method of claim 1, wherein, Collecting the surface image of the product on the target flow line, and pre-processing the surface image to obtain test image data, comprising: Using a pre-deployed camera to collect the image of the product surface to be detected to obtain the surface image, and using the camera internal parameter to correct the surface image; Preprocessing the surface image to obtain the test image data; the preprocessing includes cropping, scaling, and regularization.
3. The method of claim 1, wherein the method is based on a core-set policy. Using the encoder of the preset deep neural network to extract features from the test image data to obtain multi-scale features, comprising: Setting the deep neural network; the deep neural network includes any one of ResNet-18 and Vision Transformer; Input the test image data into the deep neural network for encoding, set the output tensor of several intermediate layers of the deep neural network as local area features, and set the features output by the final layer of the deep neural network as image overall features; Using bilinear interpolation to project the local area features to the same resolution and splice them in the channel dimension to obtain a feature map; Integrate the feature map and the image overall features to obtain the multi-scale features.
4. The method of claim 1, wherein the method is based on a core-set policy. Using a sparse sampling strategy to sample the multi-scale features to obtain an initial core set, comprising: selecting image features from the multi-scale features using a k-center-greedy strategy or a random sampling strategy a plurality of image features, and fusing the selected image features after being extracted by channel to obtain initial sparse features; wherein, is an integer not less than 1. using a k-center-greedy strategy on the initial sparse feature selection a local feature, to obtain the initial core set; wherein, is an integer no less than 1.
5. The method of claim 1, wherein the method is based on a core-set policy. Through the way of scoring each other between the multi-scale features and the initial core set, the initial core set is expanded and screened to obtain a normal norm core set, comprising: According to the multi-scale features, the initial core set is subjected to first supplementary processing or second supplementary processing to obtain an expanded core set; According to the expanded core set, the expanded core set is subjected to first screening processing or second screening processing to obtain the normal norm core set.
6. The method of claim 1, wherein, Using the normal norm core set to score the similarity of the test image data to obtain image and local area anomaly scores, comprising: The nearest distance of data points of each image in the test image data and the normal norm core set is extracted by using a first abnormality degree formula to obtain original local abnormality data. The first abnormality degree formula is: ; wherein, is the distance between the i th data point in the j th image and the data point in the normal norm core set; is the distance between the i th data point in the j th image and the data point in the normal norm core set; is the distance between the i th data point in the j th image and the data point in the normal norm core set; is the data point serial number; The original local anomaly data is calculated by using a second anomaly degree formula to obtain comprehensive local anomaly data; the second anomaly degree formula is: Or ; wherein, is the anomaly degree of the first th graph; , respectively, the width and height of the original image; represents the field; is the data point in the field . Using bilinear interpolation to upsample the comprehensive local anomaly data to the original image resolution of the test image data to obtain the image and local area anomaly scores.
7. The method of claim 5, wherein the method further comprises: The process of the first supplementary processing comprises: Setting an extraction parameter set; the extraction parameter set is an increasing sequence; Based on the initial core set, distance evaluation is performed on all local region features extracted by channel for each multi-scale feature using the first distance calculation formula to obtain similarity evaluation data; the first distance calculation formula is: ;in, For the initial core set and the first The first one in the picture Data points The distance; For the initial core set of the first Data points With the The first one in the picture Data points The distance; Based on the similarity evaluation data, the first... The image that is farthest from the initial core set Each data point is updated to the initial core set, and the process returns to the step "Based on the initial core set, use the first distance calculation formula to evaluate the distance of all local region features extracted by each channel for each multi-scale feature, and obtain similarity evaluation data", until the extraction parameter set traversal is completed, resulting in an expanded core set; wherein, This refers to the m-th parameter in the extracted parameter set; The process of the second supplementary processing comprises: Setting a fixed extraction parameter; According to the initial core set, distance evaluation is performed on all local region features extracted from each multi-scale feature by channel using the second distance calculation formula to obtain the similarity evaluation data; the second distance calculation formula is: ; wherein, represents the initial core set. Based on the similarity evaluation data, the first... The image that is farthest from the initial core set Each data point is updated to the initial core set, and the process returns to the step "Based on the initial core set, use the first distance calculation formula to perform distance evaluation on all local region features extracted by channel for each multi-scale feature to obtain similarity evaluation data", until iteration continues. This process stops there, resulting in an expanded core set; among which... The fixed extraction parameters; The total amount of data is the same as the total amount of data in the extracted parameter set.
8. The method of claim 7, wherein the method is based on a core-set policy. The process of the first screening processing comprises: The third distance calculation formula is used to calculate the extended core set to obtain abnormality degree data; the third distance calculation formula is: ; wherein, is the abnormality degree data; , is the width and height of the original image, respectively. Remove the data with the highest degree of anomaly from the expanded core set. The system returns to the step "Calculate the expanded core set using the third distance calculation formula to obtain the anomaly level data" until the extraction parameter set traversal is completed, and the normal paradigm core set is obtained. The process of the second screening processing comprises: Using the third distance calculation formula to calculate the expanded core set to obtain the anomaly degree data; Remove the data with the highest degree of anomaly from the expanded core set. The system iterates through the data points and returns to the step "Calculate the expanded core set using the third distance calculation formula to obtain the anomaly level data" until the iteration ends. After stopping, the normal paradigm core set is obtained.
Citation Information
Patent Citations
Surface defect detection method based on deep learning and global difference information
CN116228754A