Part surface defect detection method, device, equipment and medium

By establishing an initial model based on a high-resolution network and performing multiple sampling and dual-channel processing in the image recognition part surface defect detection, the problem of low accuracy of detection results due to the loss of small-area features in the prior art is solved, and higher computing power and detection accuracy are achieved.

CN115063348BActive Publication Date: 2025-06-06ZHAOTONG LIANGFENGTAI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210549864.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2025-06-06
Estimated Expiration
2042-05-17

AI Technical Summary

Technical Problem

The surface defects of existing image recognition parts lose small area features due to compression, resulting in low accuracy of detection results.

Method used

The initial model is established based on high-resolution network, and the initial model is trained through training data to obtain the target model. Then four sampling processes are performed in the target model. After processing by the convolution module, processing module and fusion module, feature maps of different resolutions are connected in parallel, and interactions between feature maps of different resolutions are added. Dual-channel processing is used to exchange information on each pixel point on the feature map, and features are extracted using separable convolutions in the fusion module.

Benefits of technology

The calculation capability and accuracy of the detection model are improved, and the problem of low accuracy of detection results caused by the loss of small area characteristics in the prior art is overcome.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115063348B_ABST
    Figure CN115063348B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, equipment and medium for detecting surface defects of parts, which relates to the field of target detection technology, and comprises the following steps: establishing an initial model based on a high-resolution network, training the initial model with training data, and obtaining a target model; in the target model, connecting feature maps of different resolutions in parallel, and adding interactions between feature maps of different resolutions on the basis of the parallelized feature maps; using dual-channel processing in a convolution module and a processing module to exchange information in the channel dimension for each pixel point on the feature map; using separable convolution in a fusion module to extract features from the feature map for multi-resolution fusion; acquiring a target image, and using the target model to process the target image to obtain a target node with a defect mark, so as to solve the problem that the detection result accuracy of existing image recognition of surface defects of parts is low due to the loss of small area features due to compression.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of target detection technology, and in particular to a method, device, equipment and medium for detecting surface defects of parts. Background Art

[0002] Metal surface defect detection has always been the most common difficulty in industrial production. In the process of industrial metal production, cameras and other image acquisition devices are used to collect image information of the working environment, and image processing technology is used to extract effective information to replace the human eye to make various detections and judgments on metal surface defects, thereby greatly improving the efficiency and automation level of detection.

[0003] The traditional defect detection process based on machine vision generally includes image acquisition and preprocessing, defect feature extraction and identification and classification, but there are many types of defects (typical defects include: oxidation, peeling, coating leakage, water mark, crease, bump, rust, scratch, bruise, roller mark, bubble, roller spot, pitting, unpainted, shrinkage cavity, impurity, fiber, paint residue, paint explosion, corrosion, wrinkle, foreign matter intrusion, black spot, black spot, oil spot, color difference and other metal defects that are not suitable for production), which leads to cumbersome calculations.

[0004] There are two main schools of thought regarding the detection of surface defects: based on traditional image processing methods and machine learning methods, both of which are based on manual features and shallow machine learning. Traditional image processing methods use the original properties reflected by local anomalies to detect and segment defects, which are further divided into structural methods, threshold methods, spectral methods, and model-based methods. However, their disadvantage is that the recognition accuracy is too low. This is mainly because the traditional image processing process will cause the image to lose the characteristics of small areas when compressing the pattern. On the metal surface, small areas are usually more prone to defects, so a more accurate recognition method is needed. Summary of the invention

[0005] In order to overcome the above technical defects, the purpose of the present invention is to provide a method, device, equipment and medium for detecting surface defects of parts, which are used to overcome the problem that the detection results of existing image recognition of surface defects of parts are less accurate due to the loss of small area features due to compression.

[0006] The present invention discloses a method for detecting surface defects of parts, comprising the following steps:

[0007] An initial model is established based on a high-resolution network, and the initial model is trained using training data to obtain a target model, wherein the training data includes a surface image of a part with defect marks;

[0008] In the target model, four sampling processes are performed, and feature maps of different resolutions are connected in parallel after being processed by a convolution module, a processing module, and a fusion module. On the basis of the parallel feature maps, interactions between feature maps of different resolutions are added;

[0009] In the convolution module and the processing module, dual-channel processing is used to exchange information on each pixel point on the feature map in the channel dimension; wherein the dual-channel processing includes one channel sequentially using a first weight matrix, a 3*3 deep convolution layer, and a second weight matrix to process the input features, and fusing them with the input features output by another channel;

[0010] In the fusion module, separable convolution is used to extract features from feature maps for multi-resolution fusion;

[0011] A target image is acquired, and the target image is processed using the target model to obtain a target result with defect marks.

[0012] Preferably, the first weight matrix is ​​obtained by performing cross-resolution weight calculation on the input features;

[0013] The second weight matrix is ​​obtained by performing spatial weight calculation on the input features.

[0014] Preferably, adding interaction between feature maps of different resolutions based on the parallel feature maps includes:

[0015] The feature maps of different resolutions are copied, and the number of channels is unified using bilinear sampling and single-layer convolution;

[0016] Use 3*3 convolution to reduce the resolution of the feature map after the number of channels is unified;

[0017] Each feature map with reduced resolution is added and fused to increase the interaction between feature maps of different resolutions.

[0018] Preferably, GPU resources are called under the PaddleSeg framework to train the initial model to obtain the target model.

[0019] Preferably, before the initial model is trained using training data, the method includes:

[0020] The part surface images in lossless compression format are collected, and each part surface image is marked using an auxiliary marking tool to generate a part surface image with defect marks as training data.

[0021] Preferably, after marking each part surface image with an auxiliary marking tool, the following steps are performed:

[0022] Use the preset conversion tool to convert the grayscale markers into pseudo-color markers.

[0023] Preferably, the initial model is established based on the high-resolution network, and the initial model is trained using training data to obtain the target model, including:

[0024] Call the preset configuration file to configure the parameters of the initial model, and adjust the parameters during the training process until the target model is obtained;

[0025] Call the visualization interface to output the output images during the training process for real-time monitoring.

[0026] The present invention also provides a device for detecting surface defects of parts, comprising the following:

[0027] A training module, used to establish an initial model based on a high-resolution network, and train the initial model using training data to obtain a target model, wherein the training data includes a surface image of a part with defect marks;

[0028] A processing module, used for performing four sampling processes in the target model, connecting feature maps of different resolutions in parallel, and adding interactions between feature maps of different resolutions on the basis of the parallelized feature maps, wherein each stage includes processing by a convolution module, a processing module, and a fusion module;

[0029] In the convolution module and the processing module, dual-channel processing is used to exchange information on each pixel point on the feature map in the channel dimension; wherein the dual-channel processing includes one channel sequentially using a first weight matrix, a 3*3 deep convolution layer, and a second weight matrix to process the input features, and fusing them with the input features output by another channel;

[0030] In the fusion module, separable convolution is used to extract features from feature maps for multi-resolution fusion;

[0031] The recognition module is used to acquire a target image, process the target image using the target model, and obtain a target result with defect marks.

[0032] The present invention also provides a computer device, the computer device comprising:

[0033] A memory for storing executable program code; and

[0034] The processor is used to call the executable program code in the memory to execute the detection method.

[0035] The present invention also includes a computer-readable storage medium having a computer program stored thereon.

[0036] When the computer program is executed by a processor, the steps of the detection method are implemented.

[0037] Compared with the prior art, the above technical solution has the following beneficial effects:

[0038] The present invention integrates dual-channel processing on the basis of the HRNet network, so that the trained target model tends to be lightweight. At the same time, a weight matrix is ​​used instead of 1*1 convolution in the dual-channel processing operation to improve the computing power of the detection model, maintain high-resolution performance while increasing accuracy, so as to overcome the problem of low accuracy of detection results due to the loss of small area features in existing image recognition of surface defects of parts due to compression. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 This is a flow chart of Embodiment 1 of a method for detecting surface defects of parts according to the present invention;

[0040] Figure 2 It is a flowchart for adding interaction between feature maps of different resolutions based on the feature maps after parallel connection in Embodiment 1 of a part surface defect detection method of the present invention;

[0041] Figure 3 This is a schematic diagram showing the output dimensions of each layer in the target model in the first embodiment of the part surface defect detection method of the present invention;

[0042] Figure 4 This is a module schematic diagram of a second embodiment of a device for detecting surface defects of parts according to the present invention;

[0043] Figure 5 A schematic diagram of a module of an embodiment of the device of the present invention.

[0044] Reference numerals:

[0045] 6-part surface defect detection device; 61-training module; 62-processing module; 63-identification module; 7-computer equipment; 71-memory; 72-processor. DETAILED DESCRIPTION

[0046] The advantages of the present invention are further described below in conjunction with the accompanying drawings and specific embodiments.

[0047] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0048] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0049] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0050] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0051] In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a mechanical connection or an electrical connection, or it can be the internal connection between two components. It can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to the specific circumstances.

[0052] In the following description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no specific meanings. Therefore, "module" and "component" can be used interchangeably.

[0053] Example 1: This example provides a method for detecting surface defects of parts. It should be noted that this embodiment introduces a multi-scale high-precision target recognition based on the PaddleSeg framework using the HRnet network model for surface defect features of parts, and trains a high-performance and multi-functional application scenario model with high recognition accuracy and capable of covering more metal defects. Figure 1 , specifically including the following steps:

[0054] S100: establishing an initial model based on a high-resolution network, and training the initial model using training data to obtain a target model, wherein the training data includes a surface image of a part with defect marks;

[0055] In this embodiment, the GPU resources are called to run the training of the initial model under the PaddleSeg framework to obtain the target model. Specifically, prepare the relevant training running environment (Paddle>=1.7.0Python>=3.5+), obtain a large number of pictures of metal surface defects as training data, wherein the pictures used as training data contain existing metal surface defects, so as to obtain a target model that can detect metal types with a larger coverage range after training.

[0056] In the above steps, before the initial model is trained using training data, the following steps are included:

[0057] The part surface images in lossless compression format are collected, and each part surface image is marked using an auxiliary marking tool to generate a part surface image with defect marks as training data.

[0058] Specifically, to annotate the surface image of the part, the annotation tool can use the auxiliary marking tool EISeg (EfficientInteractive Segmentation), which is an efficient and intelligent interactive segmentation and annotation software developed based on Paddle based on RITM and EdgeFlow algorithms. It covers high-quality interactive segmentation models in different directions to reduce the annotation cost. In addition, the annotations obtained by EISeg are applied to other segmentation models provided by PaddleSeg for training, and high-precision models of metal defect detection scenarios can be obtained, opening up the entire process of segmentation tasks from data annotation to model training and prediction.

[0059] In the above steps, it is important to note that during the annotation process: the part surface image uses a PNG lossless compression format image, and the annotation categories are various metal defect features (including but not limited to oxidation, peeling, coating leakage, watermarks, creases, bumps, rust spots, scratches, bruises, roller marks, bubbles, roller spots, pitting and other defects); PaddleSeg supports grayscale annotation as well as pseudo-color annotation, but in order to make the annotation uniform, after marking each part surface image with an auxiliary marking tool, it includes: using a preset conversion tool to convert grayscale marks into pseudo-color marks. Specifically, use a unified pseudo-color mark so that the mark clearly reflects the defect type, or convert the pseudo-color mark into a grayscale mark. You can choose to use it depending on the specific implementation scenario.

[0060] Specifically, the initial model is established based on the high-resolution network, and the initial model is trained using training data to obtain a target model, including:

[0061] Call the preset configuration file to configure the parameters of the initial model, and adjust the parameters during the training process until the target model is obtained;

[0062] Call the visualization interface to output the output image during the training process for real-time monitoring

[0063] In the specific implementation, the configuration parameters are jointly determined by the imported config.py and hrnet.yaml, where the .yaml file has a higher priority than config.py. Then, call train.py - call GPU resources - initial model to perform training (cfg pre-trained model), and then call vis.py (the above-mentioned visualization interface) - call GPU resources - initial model to perform training to achieve training visualization.

[0064] In this embodiment, high-resolution representation is required for position-sensitive computer vision tasks. HRnet (high-resolution network) maintains high-resolution representation throughout the recognition process, so the HRnet network is introduced in the defect detection process to improve the accuracy of metal surface defect detection. By simply fusing the Shuffle Block and HRNet in ShuffleNet (CNN model), a lightweight HRNet can be obtained, which can expand the application scenarios of metal surface defect detection. Using a specific weight matrix in HRNet to replace the 1*1 convolution can further improve the computational efficiency of the metal surface defect detection network.

[0065] S200: In the target model, four sampling processes are performed, and feature maps of different resolutions are connected in parallel after being processed by a convolution module, a processing module, and a fusion module. On the basis of the parallel feature maps, interactions between feature maps of different resolutions are added;

[0066] In the above steps, the target model is formed based on HRNet, and HRNet has four parallel branches. In this embodiment, the target model constructed based on HRNet in this embodiment includes a Steam part and a Stage part. The Stem part includes a convolution module (a 3*3 convolution with a step size of 2 + dual-channel processing), and the Stage part includes multiple processing modules (dual-channel processing) and a fusion module (multi-resolution) (see Figure 3Schematic diagram of the output dimension after four stage sampling processing). For illustration, the sampling process is assumed to be 3×3 convolution with a stride of 2. That is, 1 / 4 of the input original image is first subjected to 2 3×3 convolutions with a stride of 2. Then, the feature maps of different resolutions are connected in parallel. On the basis of the parallel connection, the interaction between the feature maps of different resolutions is added, which is different from the existing common method of reducing the resolution first and then increasing the resolution. Specifically, on the basis of the feature maps after parallel connection, the interaction between the feature maps of different resolutions is added. Figure 2 , including the following steps:

[0067] S210: Copy feature maps of different resolutions and use bilinear sampling and single-layer convolution to unify the number of channels;

[0068] Specifically, in the above steps, bilinear upsample + 1*1 convolution is used to unify the number of channels. Bilinear sampling is faster and has better sampling effect, so it is widely used. As an explanation, the output pixel value of the bilinear sampling method is the average value of the sampling points in the 2*2 field of the input image, that is, the new pixel value is calculated by weighted average based on the pixel values ​​of the four nearest points around it.

[0069] S220: Use 3*3 convolution to reduce the resolution of the feature map after the number of channels is unified;

[0070] It should be noted that in this step, strided3*3 convolution is used to reduce information loss through learning. The existing common maximum pooling or combined pooling is not used here.

[0071] S230: Add and fuse the feature maps with reduced resolutions to increase the interaction between feature maps with different resolutions.

[0072] Specifically, in the above steps, the feature maps with reduced resolution are fused by addition, which can be implemented by calling the cv.add() function.

[0073] S300: using dual-channel processing in the convolution module and the processing module to exchange information on each pixel point on the feature map in the channel dimension; wherein the dual-channel processing includes one channel sequentially using a first weight matrix, a 3*3 deep convolution layer, and a second weight matrix to process the input features, and fusing them with the input features output by another channel;

[0074] It should be noted that, in the above steps, the first weight matrix is ​​obtained by performing cross-resolution weight calculation on the input features; and the second weight matrix is ​​obtained by performing spatial weight calculation on the input features.

[0075] As a supplementary explanation, the dual-channel processing includes a processing process with two branches, one of which directly outputs the input feature map, and the other branch performs the first weight matrix, 3*3 depthwise convolution and the second full-center matrix on the input features, and then concatenates the outputs of the two branches and then performs a shuffle operation to obtain the final output features. The first weight matrix and the second full-center matrix are used instead of the existing common convolution structure to reduce the amount of calculation while ensuring high precision and high resolution, making the model more lightweight, improving processing efficiency and reducing errors.

[0076] S400: In the fusion module, separable convolution is used to extract features from the feature map for multi-resolution fusion;

[0077] As an illustration, the target model in this embodiment uses dual-channel processing (ShuffleBlock) to replace the second 3*3 convolution and all processing modules in the Stem, and uses separable convolution to replace the traditional convolution in the fusion module, compared to the existing lightweight HRNet network (the Stem part contains 21 3*3 convolutions with a step size of 2, and the Stage part contains a residual module and a fusion module). This distinguishes it from the existing common HRNet network, so that the recognition process further focuses on small areas and improves the accuracy of the recognition results.

[0078] S500: Acquire a target image, and process the target image using the target model to obtain a target result with defect marks.

[0079] In the above steps, the target image is an image of the part surface containing defects to be identified, and the target model is used to output defect labels. The target model is improved based on the HRnet network, and multi-scale high-precision target recognition is performed on the surface defect features of the two parts to obtain the target results.

[0080] This implementation introduces the PaddleSeg framework based on computer vision technology, supports multi-process I / O, multi-card parallel training acceleration strategies, etc., which can greatly reduce the video memory overhead of the segmentation model, complete image training at a lower cost and more efficiently, and integrate dual-channel processing on the basis of the original HRNet network to make the trained target model lighter. At the same time, the weight matrix is ​​used instead of 1*1 convolution in the dual-channel processing operation to improve the computing power of the detection model, maintain high-resolution performance while increasing accuracy, so as to overcome the problem of low accuracy of detection results due to the loss of small area features in existing image recognition of surface defects of parts due to compression.

[0081] Embodiment 2: The present invention also provides a device for detecting surface defects of parts 6, see Figure 4 , including the following:

[0082] A training module 61 is used to establish an initial model based on a high-resolution network, and train the initial model using training data to obtain a target model, wherein the training data includes a part surface map with defect marks;

[0083] Specifically, GPU resources are called to run the training of the initial model under the PaddleSeg framework, part surface images in lossless compression format are collected, and each part surface image is marked using the auxiliary marking tool EISeg.

[0084] The processing module 62 is used to perform four sampling processes in the target model, connect the feature maps of different resolutions in parallel after being processed by the convolution module, the processing module and the fusion module, and add the interaction between the feature maps of different resolutions on the basis of the parallel feature maps;

[0085] In the convolution module and the processing module, dual-channel processing is used to exchange information on each pixel point on the feature map in the channel dimension; wherein the dual-channel processing includes one channel sequentially using a first weight matrix, a 3*3 deep convolution layer, and a second weight matrix to process the input features, and fusing them with the input features output by another channel;

[0086] In the fusion module, separable convolution is used to extract features from feature maps for multi-resolution fusion;

[0087] It should be noted that the first weight matrix is ​​obtained by performing cross-resolution weight calculation on the input features; and the second weight matrix is ​​obtained by performing spatial weight calculation on the input features.

[0088] Specifically, the target model is formed based on HRNet, and HRNet has four parallel branches. In this embodiment, the target model constructed based on HRNet in this embodiment includes a Steam part and a Stage part. The Stem part includes a convolution module (1 3*3 convolution with a step size of 2 + dual-channel processing), and the Stage part includes multiple processing modules (dual-channel processing) and 1 fusion module (multi-resolution). Compared with the existing lightweight HRNet network (the Stem part includes 21 3*3 convolutions with a step size of 2, and the Stage part includes a residual module and a fusion module), dual-channel processing (Shuffle Block) is used to replace the second 3*3 convolution and all processing modules in Stem, and separable convolution is used to replace the traditional convolution in the fusion module. The above-mentioned dual-channel processing includes a processing process with two branches, one of which directly outputs the input feature map, and the other branch performs a first weight matrix, a 3*3 depthwise convolution and a second full-center matrix on the input features, and then concatenates the outputs of the two branches and then performs a shuffle operation to obtain the final output features. The first weight matrix and the second full-center matrix are used instead of the existing common convolution structure to reduce the amount of calculation while ensuring high precision and high resolution, making the model more lightweight, improving processing efficiency and reducing errors.

[0089] The recognition module 63 is used to acquire a target image, process the target image using the target model, and obtain a target result with a defect mark.

[0090] In this embodiment, the PaddleSeg framework based on computer vision technology is introduced in the training module 61 to complete the training of the target model. In the target model (which can be regarded as stored in the processing module 62), based on the existing HRNet network, dual-channel processing is integrated, and a weight matrix is ​​used instead of convolution in the dual-channel processing operation to maintain high-resolution performance while increasing accuracy. The recognition module 63 is used to process the target image based on the operation of the target model in the processing module to obtain a target result with defect markings, so as to overcome the problem that the detection result accuracy of the existing image recognition of surface defects of parts is low due to the loss of small area features due to compression.

[0091] Embodiment three:

[0092] To achieve the above object, the present invention also provides a computer device 7, such as Figure 5 As shown, the computer device may be a smart phone, tablet computer, laptop computer, desktop computer, etc. that executes the program. The computer device of this embodiment includes at least but is not limited to: a memory 71 and a processor 72 that can be interconnected through a device bus, such as Figure 5It should be pointed out that Figure 5 Only a computer device with components is shown, but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0093] In this embodiment, the memory 71 may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory 71 may also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device. In this embodiment, the memory 71 is generally used to store operating devices and various application software installed on the computer device, such as program codes and training data of the part surface defect detection method in Embodiment 1. In addition, the memory 71 may also be used to temporarily store various data that have been output or are to be output.

[0094] The processor 72 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 72 is generally used to control the overall operation of the computer device. In this embodiment, the processor 72 is used to run the program code stored in the memory 71 or process data, such as running the part surface defect detection device to implement the part surface defect detection method of the first embodiment.

[0095] Embodiment 4:

[0096] To achieve the above purpose, the present invention also provides a computer-readable storage device, which includes multiple storage media, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or D* memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, App application mall, etc., on which a computer program is stored, and the program realizes the corresponding function when it is executed by the processor 72. The computer-readable storage medium of this embodiment is used to store the data storage query device, and when it is executed by the processor 72, the surface defect detection method of the part of the first embodiment is realized.

[0097] It should be noted that the embodiments of the present invention have better practicability and do not impose any form of limitation on the present invention. Any technician familiar with the field may use the technical content disclosed above to change or modify it into an equivalent effective embodiment. However, any modification or equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A method for detecting surface defects of parts, It is characterized in that Includes the following: An initial model is established based on a high-resolution network, and the initial model is trained using training data to obtain a target model, wherein the training data includes a surface image of a part with defect marks; In the target model, four sampling processes are performed, and feature maps of different resolutions are connected in parallel after being processed by a convolution module, a processing module, and a fusion module. On the basis of the parallel feature maps, interactions between feature maps of different resolutions are added; In the convolution module and the processing module, dual-channel processing is used to exchange information on each pixel point on the feature map in the channel dimension; wherein the dual-channel processing includes one channel sequentially using a first weight matrix, a 3*3 deep convolution layer, and a second weight matrix to process the input features, and performing concatenation operations and shuffle operations with the input features output by another channel for fusion; wherein the first weight matrix is ​​obtained by performing cross-resolution weight calculation on the input features; and the second weight matrix is ​​obtained by performing spatial weight calculation on the input features; In the fusion module, separable convolution is used to extract features from feature maps for multi-resolution fusion; A target image is acquired, and the target image is processed using the target model to obtain a target result with defect marks.

2. The detection method according to claim 1, It is characterized in that Adding interactions between feature maps of different resolutions based on the parallel feature maps includes: The feature maps of different resolutions are copied, and the number of channels is unified using bilinear sampling and single-layer convolution; Use 3*3 convolution to reduce the resolution of the feature map after the number of channels is unified; Each feature map with reduced resolution is added and fused to increase the interaction between feature maps of different resolutions.

3. The detection method according to claim 1, Features: In the PaddleSeg framework, GPU resources are called to train the initial model to obtain the target model.

4. The detection method according to claim 1, It is characterized in that Before the initial model is trained using the training data, the method includes: The part surface images in lossless compression format are collected, and each part surface image is marked using an auxiliary marking tool to generate a part surface image with defect marks as training data.

5. The detection method according to claim 4, It is characterized in that After marking each part surface with auxiliary marking tools, including: Use the preset conversion tool to convert the grayscale markers into pseudo-color markers.

6. The detection method according to claim 1, It is characterized in that The method of establishing an initial model based on a high-resolution network and training the initial model using training data to obtain a target model includes: Call the preset configuration file to configure the parameters of the initial model, and adjust the parameters during the training process until the target model is obtained; Call the visualization interface to output the output images during the training process for real-time monitoring.

7. A device for detecting surface defects of parts, It is characterized in that Includes the following: A training module, used to establish an initial model based on a high-resolution network, and train the initial model using training data to obtain a target model, wherein the training data includes a surface image of a part with defect marks; A processing module, used for performing four sampling processes in the target model, connecting feature maps of different resolutions in parallel, and adding interactions between feature maps of different resolutions on the basis of the parallelized feature maps, wherein each stage includes processing by a convolution module, a processing module, and a fusion module; The recognition module is used to acquire a target image, process the target image using the target model, and obtain a target result with a defect mark.

8. A computer device, Features: The computer device comprises: A memory for storing executable program code; and A processor is used to call the executable program code in the memory, and the execution steps include the detection method as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, Features: When the computer program is executed by a processor, the steps of the detection method according to any one of claims 1 to 6 are implemented.