Neural network training method, system, equipment and product for apparent defect detection
By designing a neural network training method for appearance defect detection in complex environments, using dynamic wavelet convolution networks and improved YOLOv5 networks, the problem of high-precision detection of surface defects in complex environments is solved, and higher detection accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN202411932004.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-09
AI Technical Summary
In complex environments, high-precision detection of surface defects is an urgent problem, mainly due to small defects, irregular shapes or similar background colors.
A neural network training method for appearance defect detection is designed to adaptively filter background noise through dynamic wavelet convolution networks and use the improved YOLOv5 network for defect detection. This method improves the model's ability to extract information about different types of defects through Mosaic-9 data enhancement, adding CA attention mechanism module to the Backbone network, and using CARAFE upsampling operator.
This method significantly improves the defect detection performance of the YOLOv5 model, especially in high-precision detection in complex environments, and the average average accuracy is significantly improved.
Smart Images

Figure CN119963484A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of defect detection technology, and in particular to a neural network training method, system, equipment and product for appearance defect detection. Background Art
[0002] With the development of automation and intelligence in the production process, defect detection on the surface of products has become an important part of industrial production. As an important part of product quality monitoring in industrial production, defect detection can effectively improve product quality and production efficiency. Conventional surface defect non-destructive testing technologies mainly include magnetic powder, penetration, eddy current, ultrasonic and X-ray detection methods. Although these methods have achieved good detection results for specific application scenarios, they have high requirements for test samples and operators and are difficult to meet the requirements of automation, intelligence and high precision. The traditional method of using manual detection of surface defects is restricted by various factors, such as subjective factors such as the proficiency, mood and sense of responsibility of the detection personnel. Different degrees of false detection and missed detection are inevitable in defect detection. In addition, there are unfavorable factors such as high labor costs and long-term human eye detection that can easily cause eye fatigue.
[0003] With the continuous development of artificial intelligence technology and the advancement of image processing technology, surface defect detection technology has developed rapidly and made great progress. At present, various surface defect detection methods based on machine vision have been proposed one after another, and the performance of surface defect detection has been continuously improved. There are many practical applications in product quality monitoring and equipment maintenance, making it possible for machines to replace manual defect detection. At present, defect detection technology has made great progress in aerospace, textile industry, and manufacturing industry. Surface defect detection technology based on machine vision can well solve the problems existing in conventional and manual surface defect detection methods. It has the characteristics of good safety and high efficiency, and can meet the needs of the development of automation and intelligent surface defect detection.
[0004] In recent years, the deep integration of new generation information technology and industry has brought about major changes in industrial product manufacturing, which has gradually shifted from quantitative expansion to quality upgrading. With the development of machine vision and artificial intelligence technology, good detection results have been achieved for surface defects in simple environments such as single background and obvious defects, with high accuracy. However, for surface defects in complex environments, due to the many interference factors and the wide range of fields involved, the difficulty of defect detection is greatly increased. At present, high-precision detection of surface defects in complex environments is an urgent problem to be solved. Current defect detection methods face challenges in high-precision defect detection, which may be caused by the fact that the defects are small, irregular in shape, or similar in color to the background. Therefore, researchers need to find effective methods to enhance the representation and detection of these defects. Summary of the invention
[0005] In order to solve the above-mentioned problems, the present invention proposes a neural network training method, system, equipment and product for appearance defect detection. This method designs a dynamic wavelet convolution network to adaptively filter out background noise, and proposes to use an improved YOLOv5 network for appearance defect detection. The data enhancement adopts the Mosaic-9 method, which is an improvement of Mosaic-4. The CA attention mechanism module is added to the Backbone network to improve the model's ability to extract channel features and spatial feature information of different types of defects. The CARAFE upsampling operator is used to replace the upsampling operator in the original YOLOv5 to effectively increase the receptive field of the model. Finally, the average accuracy, average precision mean and recall rate are used as evaluation criteria for target detection to calculate the defect detection performance. The specific technical scheme is as follows:
[0006] In a first aspect, the present invention provides a neural network training method for appearance defect detection, the method comprising:
[0007] Adaptively filter out background noise through a dynamic wavelet convolutional network;
[0008] Appearance defect detection is performed by using an improved YOLOv5 model, wherein the improved YOLOv5 model performs data enhancement by using a Mosaic-9 method, adds an attention mechanism by adding a CA attention mechanism module in a Backbone network, replaces an upsampling operator in the original YOLOv5 with a CARAFE upsampling operator, and increases the receptive field of the YOLOv5 model;
[0009] The improved YOLOv5 model detection results are evaluated for target detection to determine the defect detection performance.
[0010] In another embodiment of the present invention, the method adaptively filters out background noise through a dynamic wavelet convolution network, comprising:
[0011] Determine a scale function and a wavelet function by a dual-scale equation, wherein the scale function and the wavelet function are used to convert the wavelet transform into a convolution operation;
[0012] Decomposing the original image signal into high-frequency components and low-frequency components by using multi-resolution analysis;
[0013] The background noise in the decomposed high-frequency component and the low-frequency component is filtered out through the wavelet convolution network.
[0014] In another embodiment of the present invention, the input end of the improved YOLOv5 model preprocesses the input image; the preprocessing scales the input image to the input size of the network and performs a normalization operation.
[0015] In another embodiment of the present invention, the input image is preprocessed at the input end of the improved YOLOv5 model, and then the following steps are further included:
[0016] The Backbone network of the improved YOLOv5 model performs slicing, convolution, pooling, and fusion processing on the preprocessed image to determine a fusion feature map; and inputs the fusion feature map into the Neck part through an attention mechanism;
[0017] The Neck part of the improved YOLOv5 model deeply acquires the image features of the fused feature map and realizes multi-scale feature fusion, and the appearance defect information and position information are determined through the picture fused with multi-scale features.
[0018] In another embodiment of the present invention, performing target detection evaluation on the result of the improved YOLOv5 model detection includes:
[0019] Determine the average precision based on the correctly classified positive samples and the incorrectly classified positive samples in the classification task;
[0020] The average precision determines an average precision mean;
[0021] Determine the recall rate based on the correctly classified positive samples and incorrectly classified negative samples in the classification task;
[0022] The average precision, the average precision mean and the recall rate are used as evaluation criteria for target detection.
[0023] In a second aspect, the present invention further provides a neural network training system for appearance defect detection, the system comprising: a denoising module, a detection module, and an evaluation module;
[0024] The denoising module is used to adaptively filter out background noise through a dynamic wavelet convolutional network;
[0025] The detection module is used to perform appearance defect detection through an improved YOLOv5 model, wherein the improved YOLOv5 model performs data enhancement through a Mosaic-9 method, adds an attention mechanism by adding a CA attention mechanism module in a Backbone network, replaces an upsampling operator in the original YOLOv5 with a CARAFE upsampling operator, and increases the receptive field of the YOLOv5 model;
[0026] The evaluation module is used to perform target detection evaluation on the detection results of the improved YOLOv5 model to determine the defect detection performance.
[0027] Preferably, the denoising module is specifically used for:
[0028] Determine a scale function and a wavelet function by a dual-scale equation, wherein the scale function and the wavelet function are used to convert the wavelet transform into a convolution operation;
[0029] Decomposing the original image signal into high-frequency components and low-frequency components by using multi-resolution analysis;
[0030] The background noise in the decomposed high-frequency component and the low-frequency component is filtered out through the wavelet convolution network.
[0031] Preferably, the detection module is specifically used for:
[0032] The input end of the improved YOLOv5 model preprocesses the input image; the preprocessing scales the input image to the input size of the network and performs a normalization operation;
[0033] The Backbone network of the improved YOLOv5 model performs slicing, convolution, pooling, and fusion processing on the preprocessed image to determine a fusion feature map; and inputs the fusion feature map into the Neck part through an attention mechanism;
[0034] The Neck part of the improved YOLOv5 model deeply acquires the image features of the fused feature map and realizes multi-scale feature fusion, and the appearance defect information and position information are determined through the picture fused with multi-scale features.
[0035] In a third aspect, the present invention further provides an electronic device, the device comprising a processor and a memory electrically connected to the processor, the memory being used to store a computer program, and the processor being used to call the computer program to perform the following steps:
[0036] Adaptively filter out background noise through a dynamic wavelet convolutional network;
[0037] Appearance defect detection is performed by using an improved YOLOv5 model, wherein the improved YOLOv5 model performs data enhancement by using a Mosaic-9 method, adds an attention mechanism by adding a CA attention mechanism module in a Backbone network, replaces an upsampling operator in the original YOLOv5 with a CARAFE upsampling operator, and increases the receptive field of the YOLOv5 model;
[0038] The improved YOLOv5 model detection results are evaluated for target detection to determine the defect detection performance.
[0039] In a fourth aspect, the present invention further provides a computer program product, wherein the computer program product is used to perform the following steps:
[0040] Adaptively filter out background noise through a dynamic wavelet convolutional network;
[0041] Appearance defect detection is performed by using an improved YOLOv5 model, wherein the improved YOLOv5 model performs data enhancement by using a Mosaic-9 method, adds an attention mechanism by adding a CA attention mechanism module in a Backbone network, replaces an upsampling operator in the original YOLOv5 with a CARAFE upsampling operator, and increases the receptive field of the YOLOv5 model;
[0042] The improved YOLOv5 model detection results are evaluated for target detection to determine the defect detection performance.
[0043] The beneficial effects of the present invention are as follows:
[0044] The present invention discloses a neural network training method, system, equipment and product for appearance defect detection. First, a dynamic wavelet convolution network is designed to adaptively filter out background noise. Then, an improved YOLOv5 network is used for appearance defect detection. The data enhancement adopts the Mosaic-9 method, which is an improvement of Mosaic-4. A CA attention mechanism module is added to the Backbone network to improve the model's ability to extract channel features and spatial feature information of different types of defects. The Neck part adopts the CARAFE upsampling operator to replace the upsampling operator in the original YOLOv5, which effectively increases the receptive domain of the model. The results show that the model can improve the defect detection performance of the YOLOv5 model, and the average precision mean is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flowchart of a neural network training method for appearance defect detection;
[0046] Figure 2 This is a schematic diagram of the YOLOv5 network structure;
[0047] Figure 3 This is the schematic diagram of the CBL module;
[0048] Figure 4 This is the schematic diagram of the Focus module;
[0049] Figure 5 This is the schematic diagram of the CSP1_X module;
[0050] Figure 6 It is a schematic diagram of the CA attention module. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of this specification clearer, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and their corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this document.
[0052] The following combination Figure 1-6 , describes in detail the technical solutions provided by each embodiment of this specification. Specific embodiment 1:
[0054] S10, design a dynamic wavelet convolutional network to adaptively filter out background noise.
[0055] S20 uses the improved YOLOv5 network for appearance defect detection, and the data enhancement adopts the Mosaic-9 method, which is an improvement of Mosaic-4. A CA attention mechanism module is added to the Backbone network to improve the model's ability to extract channel features and spatial feature information of different types of defects. The CARAFE upsampling operator is used to replace the upsampling operator in the original YOLOv5, which effectively increases the receptive field of the model.
[0056] S30, using average precision, mean average precision and recall as evaluation criteria for target detection, and calculating defect detection performance.
[0057] Furthermore, in the step S10, the steps are included:
[0058] S11, in order to convert the wavelet transform into a convolution operation, the scaling function φ(t) and the wavelet function ψ(t) are calculated using a dual-scaling equation.
[0059]
[0060] Among them, h(a) and g(a) are a pair of low-pass and high-pass filter banks.
[0061] S12, using multi-resolution analysis to decompose the original image signal into high-frequency components and low-frequency components. Through multi-resolution analysis, the signal x(t) can be expressed as
[0062]
[0063] Among them, c n,k is the approximation coefficient, c n,k = <x(t),φ n,k (t)>,d n,k is the detail coefficient, d n,k = <x(t),ψ n,k(t)>.
[0064] S13, in order to maintain the basic structure of the signal and filter out noise, the present invention designs a wavelet neural network, and updates the kernel function of the wavelet through training. The calculation method is as follows:
[0065]
[0066] Where n represents the scale, k represents the translation coefficient, <> represents the inner product operation, x(t) represents the input signal, ψ n,k (t) represents the basis wavelet family.
[0067] The following combination Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 , specific embodiment 2:
[0068] S21, the network structure of YOLOv5 includes the Input end, Backbone network, Neck part and Prediction end. The input image size is 640×640, and the feature map changes in the order of 640→320→160→80→40→20.
[0069] S22, the input end mainly preprocesses the input image. The network input image is 640×640. The preprocessing mainly involves scaling the input image to the network input size and performing normalization operations.
[0070] The present invention adopts the Mosaic-9 data enhancement method, which is an improvement of Mosaic-4. The Mosaic-9 algorithm selects 9 images in a batch and randomly combines them. This improvement increases the amount of information for training without greatly affecting the training speed.
[0071] S23, Backbone network consists of Focus module, convolution module (CBL), CSP1_X structure, spatial pyramid pooling SPP module, and CA attention module.
[0072] The Focus module introduces a slice operation. The original image size is 640×640×3. After the slice operation, a 320*320*12 feature map is obtained. After another convolution operation with 32 convolution kernels, it finally becomes a 320×320×32 feature map.
[0073] The convolution module (CBL) consists of a convolutional layer (Conv), a batch normalization operation (Batch Normalization, BN) and an activation function.
[0074] The CSP1_X structure is composed of CBL module, Res unit module and Concat, where X means there are X CSP1 modules.
[0075] SPP module: This structure consists of CBL module, maximum pooling and convolution operation, and uses 1×1, 5×5, 9×9, 13×13 maximum pooling to perform multi-scale fusion.
[0076] CA attention module (coordinate attention module): The attention mechanism is decomposed into a one-dimensional feature encoding process in the X direction and the Y direction. One direction captures long-distance dependencies and the other direction captures position information, embedding the position information of the feature map into the channel attention.
[0077] S24, Neck part: The Neck part adopts a feature map pyramid network and a path aggregation network. The structure uses the CSP2_X structure, CBL module, CARAFE upsampling operator and Concat. It connects the backbone network and the output end to deeply obtain image features.
[0078] The CSP2_X structure consists of a CBL module and a convolutional layer Concat.
[0079] CARAFE upsampling operator: The CARAFE upsampling operator is used to replace the upsampling operator in the original YOLOv5. The CARAFE upsampling operator includes an upsampling feature module and a feature recombination module. Assuming that the upsampling ratio is σ and the shape of the input feature map is H×W×C, the upsampling feature module first predicts the upsampling kernel, and then the feature recombination module completes the upsampling to obtain an output feature map of σH×σW×σC.
[0080] Concat: Tensor concatenation can expand the dimensions of two tensors and achieve multi-scale feature fusion.
[0081] S25, the Prediction side designs a non-maximum suppression module and a bounding box loss function, and the bounding box loss function uses the GIOU_Loss function. Specific embodiment 3:
[0083] S31, using AP (average precision), mAP (mean average precision) and Recall (recall rate) as the evaluation criteria for target detection
[0084]
[0085]
[0086] Among them, TP stands for True Positives, which means the positive samples that are correctly classified in the classification task, TN stands for True Negatives, which means the negative samples that are correctly classified in the classification task, FP stands for False Positives, which means the positive samples that are incorrectly classified in the classification task, and FN stands for False Negative, which means the negative samples that are incorrectly classified in the classification task. M stands for the number of images in the validation set of the dataset, and N stands for a total of N label categories. Specific embodiment 2:
[0088] In order to solve the above-mentioned problems, the present invention proposes a neural network training method, system, equipment and product for appearance defect detection. This method designs a dynamic wavelet convolution network to adaptively filter out background noise, and proposes to use an improved YOLOv5 network for appearance defect detection. The data enhancement adopts the Mosaic-9 method, which is an improvement of Mosaic-4. The CA attention mechanism module is added to the Backbone network to improve the model's ability to extract channel features and spatial feature information of different types of defects. The CARAFE upsampling operator is used to replace the upsampling operator in the original YOLOv5 to effectively increase the receptive field of the model. Finally, the average accuracy, average precision mean and recall rate are used as evaluation criteria for target detection to calculate the defect detection performance. The specific technical scheme is as follows:
[0089] In a first aspect, the present invention provides a neural network training method for appearance defect detection, the method comprising:
[0090] Adaptively filter out background noise through a dynamic wavelet convolutional network;
[0091] Appearance defect detection is performed by using an improved YOLOv5 model, wherein the improved YOLOv5 model performs data enhancement by using a Mosaic-9 method, adds an attention mechanism by adding a CA attention mechanism module in a Backbone network, replaces an upsampling operator in the original YOLOv5 with a CARAFE upsampling operator, and increases the receptive field of the YOLOv5 model;
[0092] The improved YOLOv5 model detection results are evaluated for target detection to determine the defect detection performance.
[0093] In another embodiment of the present invention, the method adaptively filters out background noise through a dynamic wavelet convolution network, comprising:
[0094] Determine a scale function and a wavelet function by a dual-scale equation, wherein the scale function and the wavelet function are used to convert the wavelet transform into a convolution operation;
[0095] Decomposing the original image signal into high-frequency components and low-frequency components by using multi-resolution analysis;
[0096] The background noise in the decomposed high-frequency component and the low-frequency component is filtered out through the wavelet convolution network.
[0097] In another embodiment of the present invention, the input end of the improved YOLOv5 model preprocesses the input image; the preprocessing scales the input image to the input size of the network and performs a normalization operation.
[0098] In another embodiment of the present invention, the input image is preprocessed at the input end of the improved YOLOv5 model, and then the following steps are further included:
[0099] The Backbone network of the improved YOLOv5 model performs slicing, convolution, pooling, and fusion processing on the preprocessed image to determine a fusion feature map; and inputs the fusion feature map into the Neck part through an attention mechanism;
[0100] The Neck part of the improved YOLOv5 model deeply acquires the image features of the fused feature map and realizes multi-scale feature fusion, and the outer tube defect information and position information are determined through the multi-scale feature fused picture.
[0101] In another embodiment of the present invention, performing target detection evaluation on the result of the improved YOLOv5 model detection includes:
[0102] Determine the average precision based on the correctly classified positive samples and the incorrectly classified positive samples in the classification task;
[0103] The average precision determines an average precision mean;
[0104] Determine the recall rate based on the correctly classified positive samples and incorrectly classified negative samples in the classification task;
[0105] The average precision, the average precision mean and the recall rate are used as evaluation criteria for target detection.
[0106] In a second aspect, the present invention further provides a neural network training system for appearance defect detection, the system comprising: a denoising module, a detection module, and an evaluation module;
[0107] The denoising module is used to adaptively filter out background noise through a dynamic wavelet convolutional network;
[0108] The detection module is used to perform appearance defect detection through an improved YOLOv5 model, wherein the improved YOLOv5 model performs data enhancement through a Mosaic-9 method, adds an attention mechanism by adding a CA attention mechanism module in a Backbone network, replaces an upsampling operator in the original YOLOv5 with a CARAFE upsampling operator, and increases the receptive field of the YOLOv5 model;
[0109] The evaluation module is used to perform target detection evaluation on the detection results of the improved YOLOv5 model to determine the defect detection performance.
[0110] Preferably, the denoising module is specifically used for:
[0111] Determine a scale function and a wavelet function by a dual-scale equation, wherein the scale function and the wavelet function are used to convert the wavelet transform into a convolution operation;
[0112] Decomposing the original image signal into high-frequency components and low-frequency components by using multi-resolution analysis;
[0113] The background noise in the decomposed high-frequency component and the low-frequency component is filtered out through the wavelet convolution network.
[0114] Preferably, the detection module is specifically used for:
[0115] The input end of the improved YOLOv5 model preprocesses the input image; the preprocessing scales the input image to the input size of the network and performs a normalization operation;
[0116] The Backbone network of the improved YOLOv5 model performs slicing, convolution, pooling, and fusion processing on the preprocessed image to determine a fusion feature map; and inputs the fusion feature map into the Neck part through an attention mechanism;
[0117] The Neck part of the improved YOLOv5 model deeply acquires the image features of the fused feature map and realizes multi-scale feature fusion, and the appearance defect information and position information are determined through the picture fused with multi-scale features.
[0118] In a third aspect, the present invention further provides an electronic device, the device comprising a processor and a memory electrically connected to the processor, the memory being used to store a computer program, and the processor being used to call the computer program to perform the following steps:
[0119] Adaptively filter out background noise through a dynamic wavelet convolutional network;
[0120] Appearance defect detection is performed by using an improved YOLOv5 model, wherein the improved YOLOv5 model performs data enhancement by using a Mosaic-9 method, adds an attention mechanism by adding a CA attention mechanism module in a Backbone network, replaces an upsampling operator in the original YOLOv5 with a CARAFE upsampling operator, and increases the receptive field of the YOLOv5 model;
[0121] The improved YOLOv5 model detection results are evaluated for target detection to determine the defect detection performance.
[0122] In a fourth aspect, the present invention further provides a computer program product, wherein the computer program product is used to perform the following steps:
[0123] Adaptively filter out background noise through a dynamic wavelet convolutional network;
[0124] Appearance defect detection is performed by using an improved YOLOv5 model, wherein the improved YOLOv5 model performs data enhancement by using a Mosaic-9 method, adds an attention mechanism by adding a CA attention mechanism module in a Backbone network, replaces an upsampling operator in the original YOLOv5 with a CARAFE upsampling operator, and increases the receptive field of the YOLOv5 model;
[0125] The improved YOLOv5 model detection results are evaluated for target detection to determine the defect detection performance.
[0126] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
Claims
1. A neural network training method for appearance defect detection, characterized in that: The method comprises: Adaptively filter out background noise through a dynamic wavelet convolutional network; Appearance defect detection is performed by using an improved YOLOv5 model, wherein the improved YOLOv5 model performs data enhancement by using a Mosaic-9 method, adds an attention mechanism by adding a CA attention mechanism module in a Backbone network, replaces an upsampling operator in the original YOLOv5 with a CARAFE upsampling operator, and increases the receptive field of the YOLOv5 model; The improved YOLOv5 model detection results are evaluated for target detection to determine the defect detection performance.
2. A neural network training method for appearance defect detection according to claim 1, characterized in that: The method adaptively filters out background noise through a dynamic wavelet convolutional network, including: Determine a scale function and a wavelet function by a dual-scale equation, wherein the scale function and the wavelet function are used to convert the wavelet transform into a convolution operation; Decomposing the original image signal into high-frequency components and low-frequency components by using multi-resolution analysis; The background noise in the decomposed high-frequency component and the low-frequency component is filtered out through the wavelet convolution network.
3. A neural network training method for appearance defect detection according to claim 1, characterized in that: The input end of the improved YOLOv5 model preprocesses the input image; the preprocessing scales the input image to the input size of the network and performs a normalization operation.
4. A neural network training method for appearance defect detection according to claim 3, characterized in that: The input image is preprocessed at the input end of the improved YOLOv5 model, and then the following steps are included: The Backbone network of the improved YOLOv5 model performs slicing, convolution, pooling, and fusion processing on the preprocessed image to determine a fusion feature map; and inputs the fusion feature map into the Neck part through an attention mechanism; The Neck part of the improved YOLOv5 model deeply acquires the image features of the fused feature map and realizes multi-scale feature fusion, and the appearance defect information and position information are determined through the picture fused with multi-scale features.
5. A neural network training method for appearance defect detection according to claim 1, characterized in that: The target detection evaluation of the improved YOLOv5 model detection results includes: Determine the average precision based on the correctly classified positive samples and the incorrectly classified positive samples in the classification task; The average precision determines an average precision mean; Determine the recall rate based on the correctly classified positive samples and incorrectly classified negative samples in the classification task; The average precision, the average precision mean and the recall rate are used as evaluation criteria for target detection.
6. A neural network training system for appearance defect detection, characterized in that: The system comprises: a noise removal module, a detection module, and an evaluation module; The denoising module is used to adaptively filter out background noise through a dynamic wavelet convolutional network; The detection module is used to perform appearance defect detection through an improved YOLOv5 model, wherein the improved YOLOv5 model performs data enhancement through a Mosaic-9 method, adds an attention mechanism by adding a CA attention mechanism module in a Backbone network, replaces an upsampling operator in the original YOLOv5 with a CARAFE upsampling operator, and increases the receptive field of the YOLOv5 model; The evaluation module is used to perform target detection evaluation on the detection results of the improved YOLOv5 model to determine the defect detection performance.
7. A neural network training system for appearance defect detection according to claim 6, characterized in that: The denoising module is specifically used for: Determine a scale function and a wavelet function by a dual-scale equation, wherein the scale function and the wavelet function are used to convert the wavelet transform into a convolution operation; Decomposing the original image signal into high-frequency components and low-frequency components by using multi-resolution analysis; The background noise in the decomposed high-frequency component and the low-frequency component is filtered out through the wavelet convolution network.
8. A neural network training system for appearance defect detection according to claim 6, characterized in that: The detection module is specifically used for: The input end of the improved YOLOv5 model preprocesses the input image; the preprocessing scales the input image to the input size of the network and performs a normalization operation; The Backbone network of the improved YOLOv5 model performs slicing, convolution, pooling, and fusion processing on the preprocessed image to determine a fusion feature map; and inputs the fusion feature map into the Neck part through an attention mechanism; The Neck part of the improved YOLOv5 model deeply acquires the image features of the fused feature map and realizes multi-scale feature fusion, and the appearance defect information and position information are determined through the picture fused with multi-scale features.
9. An electronic device, characterized in that: The device comprises a processor and a memory electrically connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program to perform the following steps: Adaptively filter out background noise through a dynamic wavelet convolutional network; Appearance defect detection is performed by using an improved YOLOv5 model, wherein the improved YOLOv5 model performs data enhancement by using a Mosaic-9 method, adds an attention mechanism by adding a CA attention mechanism module in a Backbone network, replaces an upsampling operator in the original YOLOv5 with a CARAFE upsampling operator, and increases the receptive field of the YOLOv5 model; The improved YOLOv5 model detection results are evaluated for target detection to determine the defect detection performance.
10. A computer program product, characterized in that The computer program product is used to perform the following steps: Adaptively filter out background noise through a dynamic wavelet convolutional network; Appearance defect detection is performed by using an improved YOLOv5 model, wherein the improved YOLOv5 model performs data enhancement by using a Mosaic-9 method, adds an attention mechanism by adding a CA attention mechanism module in a Backbone network, replaces an upsampling operator in the original YOLOv5 with a CARAFE upsampling operator, and increases the receptive field of the YOLOv5 model; The improved YOLOv5 model detection results are evaluated for target detection to determine the defect detection performance.