Shaving board surface multi-scale defect detection method, equipment, medium and product
By adopting the PBDNet model in particleboard surface defect detection, the multi-scale feature capture strategy of SPDConv and C2f_SD modules, combined with the asymmetric data enhancement method, the problem of large-scale changes in particleboard surface defects and the coexistence of multi-scale defects is solved, and efficient and accurate defect detection is achieved.
Patent Information
- Application Number
- CN202510495705.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-04-21
AI Technical Summary
The scale of particleboard surface defects varies greatly, multi-scale defects coexist, and the number of defects is positively skewed with defect size, resulting in challenges in efficiency and accuracy of existing detection methods.
The PBDNet model is adopted, which implements spatial segmentation and channel fusion strategy and multi-scale feature capture by introducing the SPDConv module and the C2f_SD module. Combined with the asymmetric data augmentation method, different data augmentation strategies are applied to different categories of defects.
It significantly improves the efficiency and accuracy of multi-scale defect detection on particleboard surfaces, and improves the model's adaptability and detection ability to different scale defects.
Smart Images

Figure CN120013946A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of surface defect detection, and in particular to a particleboard surface multi-scale defect detection method, equipment, medium and product. Background Art
[0002] Particleboard is the main base material for custom furniture. With the increasing demand in the custom furniture market, the demand for particleboard is also increasing. Surface defect detection is an important part of ensuring product quality during the production of particleboard. However, due to the large scale variation of surface defects on particleboard, the coexistence of multi-scale defects, and the positive skewed distribution of the number of defects with the defect size, efficient and accurate detection is still challenging. Summary of the invention
[0003] The purpose of this application is to provide a method, equipment, medium and product for detecting multi-scale defects on the surface of particleboard, so as to improve the efficiency and accuracy of multi-scale defect detection on the surface of particleboard.
[0004] To achieve the above objectives, this application provides the following solutions.
[0005] In the first aspect, the present application provides a method for multi-scale defect detection on the surface of particleboard, comprising: obtaining a full-width original image of the particleboard surface and preprocessing it to construct a surface defect data set; the surface defect data set includes multiple defect images of different types of surface defects; for defect images of different types of surface defects in the surface defect data set, different data enhancement methods are applied to perform asymmetric data enhancement operations to obtain an enhanced surface defect data set; a PBDNet model including a backbone network, a neck network and a detection head is constructed; the backbone network includes an SPDConv module, a CBS module, a C2f_SD module and a C2f module; the neck network includes an SPPF module, an upsampling module, a splicing module, a C2f module and an SPDConv module; the detection head includes a CBS module, a Conv2d module, a Cls loss module and a Bbox loss module; the enhanced surface defect data set is used to train the PBDNet model, and after the training is completed, it is used as a surface defect detection model; the surface defect detection model is used to perform multi-scale defect detection on the particleboard surface image.
[0006] Optionally, the method of obtaining the full-width original image of the particleboard surface and preprocessing it to construct a surface defect data set specifically includes: performing sliding window slicing processing on the full-width original image of the particleboard surface, and capturing multiple sub-images from the full-width original image of the particleboard surface; screening the multiple sub-images to retain only sub-images with surface defects; marking the types of surface defects in the sub-images with surface defects; the surface defect types include spot defects, wood chips, oil stains, chipped edges, chalk marks, scratches and cracks; and using the marked sub-images as defect images and storing them as a surface defect data set.
[0007] Optionally, for defect images of different surface defect types in the surface defect data set, different data enhancement methods are applied to perform asymmetric data enhancement operations, specifically including: for defect images with chipped edges as the surface defect type, vertical flipping, horizontal flipping, random brightness / contrast changes, and random cropping / scaling operations are performed; for defect images with chalk marks as the surface defect type, vertical flipping, fuzzy transformation, random brightness / contrast changes, and random cropping / scaling operations are performed; for defect images with scratches as the surface defect type, vertical flipping and horizontal flipping operations are performed; for defect images with cracks as the surface defect type, vertical flipping, horizontal flipping, random brightness / contrast changes, and random cropping / scaling operations are performed.
[0008] Optionally, the SPDConv module specifically includes: a space-to-depth transformation layer and a non-step convolution layer; the space-to-depth transformation layer is used to transform the input size Feature map Split in the spatial dimension and decompose into 4 sub-graphs with half the spatial dimension through uniform grid sampling ; Then the subgraph After splicing along the channel dimension, the stacked feature map is obtained ;in is the spatial dimension, is the number of channels; express dimensional real space; the non-step convolution layer is used to stack the feature maps Use standard convolution with a stride of 1 to compress the number of channels to , get the downsampled feature map .
[0009] Optionally, the C2f_SD module specifically includes: a DEConv module, a CBS module, a segmentation module, a BottleNeck_SAC module and a splicing module; the DEConv module is composed of a normal convolution module, a horizontal differential convolution module and a vertical differential convolution module; wherein the normal convolution module is used to extract the intensity level features of the image; the horizontal differential convolution module fixedly uses the horizontal gradient convolution kernel to capture the edge features in the horizontal direction; the vertical differential convolution module fixedly uses the vertical gradient convolution kernel to capture the edge features in the vertical direction; the CBS module is used to adjust the number of channels of the image; the segmentation module is used to split the feature map in the channel dimension; the BottleNeck_SAC module is composed of a SAConv module and two global context modules attached before and after the SAConv module; the splicing module is used to splice the input feature map in the channel.
[0010] Optionally, the calculation formula of the SAConv module is: ;in Indicates that the input is , weight is , the void rate is 1 and the output is Ordinary convolution operation; is a learnable switching function; is the weight of participating in training; is the void ratio hyperparameter; is the output of the SAConv module.
[0011] Optionally, the global context module includes a 5×5 average pooling layer and a two-dimensional convolutional layer.
[0012] In a second aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the particleboard surface multi-scale defect detection method.
[0013] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for detecting multi-scale defects on the particleboard surface.
[0014] In a fourth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method for detecting multi-scale defects on the particle board surface.
[0015] According to the specific embodiments provided in this application, this application discloses the following technical effects.
[0016] The present application provides a particleboard surface multi-scale defect detection method, equipment, medium and product, which designs an asymmetric data enhancement method, applies different data enhancement strategies for different types of defects, and effectively alleviates the problem of unbalanced sample numbers between classes in the data set from the data level; in the PBDNet model, by introducing the SPDConv module, the spatial segmentation and channel fusion strategy is realized, and more fine-grained information is retained during the downsampling process, which improves the model's detection ability when the number of defects is positively skewed with the defect size; in the PBDNet model, the dual observation and dynamic weight integration mechanism of the C2f_SD module is used to capture multi-scale defect features, which enhances the model's adaptability to particleboard surface defects with large scale changes. Therefore, the present application method can significantly improve the efficiency and accuracy of particleboard surface multi-scale defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A schematic diagram of a process for detecting multi-scale defects on the surface of particleboard in this application; Figure 2 Schematic diagram of the process of making surface defect dataset; Figure 3 3D modeling diagram of special equipment for collecting images of particleboard surface defects; Figure 4 This is a schematic diagram of the types of surface defects on particleboard; Figure 5 Schematic diagram of data enhancement method; Figure 6 This is the PBDNet model architecture diagram; Figure 7 It is a schematic diagram of the SPDConv structure; Figure 8 This is a schematic diagram of the C2f_SD module structure; Fig. 9 It is a schematic diagram of the DEConv module structure; Fig.10 It is a schematic diagram of the CBS module structure; Fig.11 This is a schematic diagram of the BottleNeck_SAC module structure; Fig.12 It is a schematic diagram of the SAConv module structure; Fig.13is the defect quantity distribution diagram; Fig.14 It is the defect quantity distribution histogram under the normalized defect height dimension; Fig.15 It is the defect quantity distribution histogram under the normalized defect width dimension; Fig.16 is the normalized defect size heat map; Fig.17 is the mAP during training 50 Graphs; Fig.18 This is the Bbox loss curve of the validation set; Fig.19 Schematic diagram of visual detection results of different models; Fig. 20 Eigen-CAM (Class Activation Map) heat map of different models; Fig.21 This is a comparison chart of the convergence speed of different models during training. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0020] The purpose of this application is to propose a method, equipment, medium and product for detecting multi-scale defects on the surface of particleboard, aiming to improve the efficiency and accuracy of multi-scale defect detection on the surface of particleboard.
[0021] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0022] At present, various improved target detection models based on the YOLO framework have attracted wide attention in multiple target detection fields, including particleboard surface defect detection, due to their excellent real-time performance, algorithm stability and easy implementation. However, the existing YOLO-based improved methods focus on lightweight design, and there is limited discussion on the problem of insufficient detection ability when multi-scale defects coexist. When defects of different sizes (such as large-scale oil stains and small wood chips) appear at the same time, the existing detection methods are limited by the fixed receptive field in the feature extraction process, resulting in the algorithm model ignoring the detail information of small targets when dealing with large-size defects, and failing to effectively capture the global features of large targets when dealing with small-size defects. In addition, the particleboard surface defect samples collected during the normal operation of the production line have the problem of uneven distribution of defects of different scales, resulting in the algorithm model being more likely to be biased towards single-scale defects with a large sample size and ignoring defects of other scales under the limitation of a fixed receptive field. At the same time, the number of defects is positively skewed with the defect size, that is, the proportion of small target defect samples is high, and the defect scales vary significantly. Therefore, an effective detection method must ensure that large target defects can be accurately detected while giving more attention to small target defects.
[0023] In view of the characteristics of large scale variation of particleboard surface defects collected during normal production, coexistence of multi-scale defects, and positive skewed distribution of defect quantity with defect size, the present application provides a particleboard surface multi-scale defect detection method. In an exemplary embodiment, Figure 1 As shown, the particleboard surface multi-scale defect detection method includes the following steps 1 to 5.
[0024] Step 1: Obtain the full original image of the particleboard surface and perform preprocessing to construct a surface defect dataset; the surface defect dataset includes multiple defect images of different surface defect types.
[0025] The process of making the surface defect dataset for this application is as follows: Figure 2 In order to obtain a high-definition image of the entire original image of the particleboard surface, this application has developed a special device for collecting particleboard surface defect images. Figure 3 As shown, the particleboard surface defect image acquisition equipment is equipped with two industrial linear array cameras 301 with a resolution of 4096×2 pixels. The two cameras 301 are at the same height and collinearly distributed, and the image field overlap rate is 30%. The images collected by the left and right cameras are spliced to a resolution of 8192×4096 to obtain the full-frame original image of the particleboard surface.
[0026] See also Figure 2In order to meet the input requirements of the neural network model and ensure the integrity of the details of small targets in high-resolution images, the full-frame original image of the particleboard surface is subjected to sliding window slicing processing, also known as sliding block processing. Specifically, a sliding window of 1024×1024 pixels is used to capture multiple sub-images (referred to as sub-images) from the full-frame original image of the particleboard surface. The window moves from the upper left corner of the image to the lower right corner. The captured multiple sub-images are screened, and only sub-images with surface defects are retained. To avoid missed detection, the moving step length is 768. Furthermore, the types of surface defects in the sub-images with surface defects are annotated, including spot-like defects, shavings, oil pollution, edge breakage, chalk mark, scratches and cracks, a total of 7 types of defects, as shown below: Figure 4 As shown in parts (a) to (g) of the figure, the box in the figure is the detection box, which is used to mark the defect location. The annotation in the image uses the YOLO format. The labeled sub-images are taken as defect images and stored as samples in the surface defect dataset.
[0027] Step 2: For defect images of different surface defect types in the surface defect dataset, different data enhancement methods are applied to perform asymmetric data enhancement operations to obtain an enhanced surface defect dataset.
[0028] For particleboard produced on a specific production line, the distribution of surface defects between classes is non-uniform. In a typical case, the most common defects are patchy defects and wood particles, followed by defects such as oil stains and surface scratches, and other defects such as chalk marks and cracks are less common. Since it is difficult to obtain defects with low frequency, the number of defects of different categories in the data set varies greatly, and the imbalance of data between classes is obvious. Therefore, in order to improve the robustness and generalization of the detection model, this application performs asymmetric data enhancement operations based on the characteristics of different defects. Different data enhancement methods are applied to different categories of defects. The specific methods are as follows: Figure 5 shown.
[0029] See also Figure 5, for defect images with surface defects such as spot defects, wood shavings and oil stains, due to the large number of samples, data enhancement processing can be omitted. For defect images with surface defects such as edge collapse, vertical flipping, horizontal flipping, random brightness / contrast changes, and random cropping / scaling can be performed. For defect images with surface defects such as chalk marks, vertical flipping, fuzzy transformation, random brightness / contrast changes, and random cropping / scaling can be performed. For defect images with surface defects such as scratches, vertical flipping and horizontal flipping can be performed. For defect images with surface defects such as cracks, vertical flipping, horizontal flipping, random brightness / contrast changes, and random cropping / scaling can be performed. The symbol " / " in the text means "and" or "or". Of course, the order of the above operations can be set according to actual needs.
[0030] Taking chalk mark defects as an example, since chalk mark defects appear less frequently in the data set and are artificially marked, their morphology and features are relatively simple, this application adopts a variety of data enhancement strategies for them. First, vertical flipping can be used to enhance the simulation of defects in different board entry directions to improve the model's robustness to directional changes; secondly, random cropping and scaling enhancements are used to simulate defects of different sizes to improve the model's adaptability to scale changes; at the same time, random brightness transformation enhancements are used to simulate changes in light source conditions, making the model more robust to lighting changes; finally, blur transformation is used to simulate the camera's out-of-focus situation to enhance the model's ability to recognize blurry images.
[0031] The asymmetric data augmentation method designed in this application designs different data augmentation strategies for different categories of defects, effectively alleviating the problem of imbalance in the number of samples between classes in the data set from the data level.
[0032] Step 3: Build a PBDNet model including the backbone network, neck network, and detection head.
[0033] The PBDNet model architecture used in this application is as follows Figure 6As shown in the figure, the PBDNet model is based on YOLOv8s and mainly includes three components: backbone network (Backbone), neck network (Neck) and detection head (Head). Among them, the backbone network is used to extract features from the input image and can capture the feature representation from low to high levels in the image. The neck network adds contextual information and enhances the quality of feature representation by fusing features at different levels. The detection head is responsible for the final prediction output, and performs classification and regression operations based on the features passed by the neck network to determine the location of the detection box and its category. In order to solve the problem of insufficient detection capabilities of defects of different scales, PBDNet introduces switchable hole convolution with a gating mechanism into the C2f feature extraction module. The switchable hole convolution with a gating mechanism can adaptively adjust the receptive field range of the model, so that the model can capture global features when processing small-sized defects, and focus on local details when processing large-sized defects. In addition, this application improves the ordinary convolution in the C2f module, introduces a differential convolution module with prior knowledge, and extracts the horizontal edge texture information of the image by combining the edge detection operator, thereby enhancing the model's additional perception ability of edge features.
[0034] Specifically, see Figure 6 The backbone network includes several SPDConv modules, CBS modules, C2f_SD modules and C2f modules. The neck network includes several SPPF modules, upsample modules, concatenation modules, C2f modules and SPDConv modules. The detection head includes several CBS modules, Conv2d modules, Cls loss modules and Bbox loss modules. The input of each module can be described as follows: The feature map of size is output as The feature map of size. Represent the height, width and number of channels of the image respectively. The module names in the YOLO network (such as Backbone, Neck, Head, C2f, SPPF, CBS, etc.) are common terms in the field of computer vision. These names have been widely accepted and used in academia and industry. For example, Backbone: backbone network, responsible for feature extraction. Neck: neck network, used for feature fusion and multi-scale processing. Head: detection head, responsible for generating the final detection result. Another example, CBS (Convolution-BatchNorm-SiLU) module: ordinary convolution module, including Conv2d convolution, batch normalization (BatchNorm, BN) and activation function (SiLU). C2f (FasterImplementation of CSP Bottleneck with 2 convolutions) module: cross-stage partial connection module, a feature extraction module for efficient feature extraction. SPPF (Spatial Pyramid Pooling - Fast) module: spatial pyramid pooling fast module for multi-scale feature extraction. SPDConv module: spatial to deep downsampling module, used to replace the CBS module for downsampling operations. C2f_SD (Cross Stage Partial Connections - Space toDepth) module: Improved cross-stage partial connection module. Upsample: upsampling. Concat: concatenation, etc.
[0035] In the backbone network of this application, the SPDConv module and the CBS module are used to downsample the feature map. The height and width of the feature map of size are halved, and we get The two modules have the same function but different implementation methods. The C2f_SD module and the C2f module are used to extract features, among which the C2f_SD module is an improved version of the C2f module and is also one of the innovations of this application.
[0036] In the neck network, the SPPF module is used to perform multi-scale pooling on the feature map and extract multi-scale context information while maintaining high computational efficiency. The upsampling module has the opposite effect to the downsampling module. The height and width of the feature map of size are doubled, and we get The concatenation module has two inputs and one output, which can convert The two feature maps of are concatenated in the channel dimension to obtain Size feature map.
[0037] In the detection head, Conv2d represents two-dimensional convolution, which is the core operation for processing two-dimensional data (such as images) in deep learning. It is mainly used to extract local features of input data by sliding convolution kernels. Cls loss refers to the classification loss function, which is used to calculate the difference between the category label predicted by the model and the true category label. The BCE (Binary CrossEntropy) loss function is used in this application. Bbox loss refers to the bounding box loss function, which is used to calculate the position difference between the object bounding box predicted by the model and the true bounding box. The CIoU (Complete Intersection over Union) loss function and the DFL (Distribution Focal Loss) function are used in this application.
[0038] Each module is stacked in sequence to form the PBDNet model. Figure 6 As shown in , in the backbone network, the SPDConv module, CBS module, C2f_SD module, SPDConv module, C2f_SD module, SPDConv module, C2f_SD module, CBS module and C2f module are stacked in sequence, and the corresponding modules are numbered 0 to 8 in the upper right corner. In the neck network, the SPPF module, upsampling module, splicing module, C2f module, upsampling module, splicing module, C2f module, SPDConv module, splicing module, C2f module, SPDConv module, splicing module and C2f module are stacked in sequence, and the corresponding modules are numbered 9 to 21 in the upper right corner. Among them, the C2f_SD module numbered 4 in the backbone network is also connected to the splicing module numbered 14 in the neck network; the C2f_SD module numbered 6 in the backbone network is also connected to the splicing module numbered 11 in the neck network; the C2f_SD module numbered 8 in the backbone network is also connected to the SPPF module numbered 9 in the neck network. The SPPF module numbered 9 in the neck network is also connected to the splicing module numbered 20 in the neck network; the C2f module numbered 12 in the neck network is also connected to the splicing module numbered 17 in the neck network. The detection head includes several branches, each of which is stacked with a CBS module, a CBS module, a Conv2d module, and a Cls loss module or a Bbox loss module in sequence. The C2f modules numbered 15, 18, and 21 in the neck network are respectively connected to the two branches ending with the Cls loss module and the Bbox loss module.
[0039] During model training, Figure 6The input of the entire PBDNet model is the defect image data after data enhancement. In the process of real-time detection of particleboard surface defects, the input of the entire PBDNet model is the real-time collected particleboard surface image. The input of the entire PBDNet model is The size of the image, is the height, which is 1024 in this application; For width, this application takes 1024; is the number of image channels, and this application takes 3. The input image passes through each module in the order of the arrows to obtain the final detection result, including the detection category and the detection frame. The output of the PBDNet model is implemented by the detection head part, which outputs the detection category c and the detection frame position (x, y, w, h). Among them, c is the defect category, with a value range of {0, 1, 2, 3, 4, 5, 6}, representing 7 different defects. (x, y) is the coordinate of the center point after the detection frame size is normalized relative to the image size, with a value range of [0, 1]. (w, h) is also the width and height of the detection frame normalized relative to the image size, with a value range of [0, 1]. The PBDNet model can accurately locate the defective area in the image by outputting the detection frame position (x, y, w, h). By outputting the detection category c, the specific type of defect can be identified, such as scratches, cracks, etc.
[0040] To address the problem that the number of defects is positively skewed with size and small target defects account for a high proportion, the PBDNet model introduces the SPDConv module to replace the convolution operation with a step size of 2 in the Backbone of YOLOv8s. The SPDConv module can reduce information loss during downsampling through the mechanism of spatial segmentation, channel fusion, and dimensional compression, thereby retaining more fine-grained information and optimizing the detection capability of the model when the defect size is positively skewed.
[0041] like Figure 7 As shown, the SPDConv module specifically includes: a space-to-depth transformation (Space-to-Depth) layer and a non-step convolution layer. Figure 7 middle Represents the coordinate position in the feature map. For example, for an input size of Feature map , It represents the feature map Middle Ledi The elements of a row have a size of , that is, a A vector of channels. express dimensional real number space; other real number spaces are defined similarly, except that they have different dimensions. Figure 7As shown, first, the feature map is transformed into Split it and decompose it into 4 sub-graphs with half the spatial dimension through uniform grid sampling : (1); in, Represents the input feature map Extract the pixels at the even index positions in the height and width directions to generate a sub-image . Size is Feature map middle, are the spatial dimensions (height and width), is the number of channels. Represents a slicing operation with a stride of 2, which means sampling every other pixel in the height and width directions. Specifically, It means starting from index 0 and ending at index End, the step length is 2. Therefore, Represents the feature map Extract the pixels at even index positions in the height and width directions. Extracted subgraph The size is . Similarly, other subgraphs It is also extracted through different slicing operations. Corresponding to even index in height direction and odd index in width direction. Corresponding to odd indexes in the height direction and even indexes in the width direction. Corresponding to odd index in height direction and odd index in width direction.
[0042] Each subgraph The size is . Subgraph After splicing along the channel dimension, the stacked feature map is obtained , this decomposition method can achieve spatial compression with zero information loss. Furthermore, the non-strided convolutional layer is used to stack the feature maps. Use standard convolution with a stride of 1 to compress the number of channels to , get the downsampled feature map .
[0043] In the PBDNet model, this application implements the spatial segmentation and channel fusion strategy by introducing the SPDConv module, retains more fine-grained information during the downsampling process, and improves the detection capability of the surface defect detection model when the number of defects is positively skewed with the defect size.
[0044] Furthermore, in the PBDNet model, the present application introduces a convolutional module with switchable void ratio into the C2f feature extraction layer, and captures multi-scale defect features through dual observation and dynamic weight integration mechanism to enhance the adaptability of the detection model to particleboard surface defects with large scale variations. At the same time, the DEConv module is added to use the prior to additionally extract the edges and contours of the defects, enrich the feature information extracted by the detection model, and improve the convergence speed of the detection model.
[0045] like Figure 8 As shown, the C2f_SD module includes a DEConv module, a CBS module, a segmentation (Spilt) module, several BottleNeck_SAC modules, a splicing module and a CBS module stacked in sequence.
[0046] Among them, the DEConv module structure is as follows Fig. 9 As shown in the figure, it consists of a CBS module, a Horizontal Difference Convolution (HDC) module, and a Vertical Difference Convolution (VDC) module. The CBS module is used to extract the intensity level features of the image. The HDC module uses a fixed horizontal gradient convolution kernel to capture the edge features in the horizontal direction. Its convolution kernel weight satisfy: (2); in is a learnable parameter, and its initial value is set to the weight of the Sobel horizontal kernel, that is, , , .
[0047] The VDC module uses a fixed vertical gradient convolution kernel, and its convolution kernel weight satisfy: (3); in is a learnable parameter, and its initial value is set to the weight of the Sobel vertical kernel, that is, , , .
[0048] During the training phase, the output features of ordinary convolution, horizontal differential convolution, and vertical differential convolution are fused by element-by-element addition. When inference is performed after training, since the weights of the three-way convolution have been learned and fixed, the weights of the three convolution kernels can be equivalently merged into a standard convolution kernel through reparameterization technology, thereby eliminating the multi-branch structure and simplifying model deployment.
[0049] The CBS module structure is as follows Fig.10 As shown, it includes Conv2d convolution, batch normalization (BN) and activation function (SiLU). Figure 8 In the C2f_SD module shown in the figure, the two CBS modules located at the head end and the tail end are used to adjust the number of channels of the image, that is, The feature map of size is adjusted to size, which is convenient for splitting and compression on the channel in the next step.
[0050] The segmentation module is used to split the feature map in the channel dimension, that is, The feature map of size is split into two The two feature maps are divided into two paths for processing, one part continues to enter the next module, and the other part is sent to the end for splicing. The splicing module is used to splice the input feature map on the channel to obtain Size feature map. Indicates the number of times the BottleNeck_SAC module is repeated. Figure 8 ... indicates that BottleNeck_SAC modules are stacked repeatedly, with a total of indivual.
[0051] The BottleNeck_SAC module structure is as follows Fig.11 As shown in Figure 1, it includes CBS module and SAC module. The internal structure of BottleNeck_SAC module after expansion has two forms, as shown in Figure 1. Fig.11 The Add parameter is a Boolean value (True or False) that controls whether to use the residual connection. Fig.11 As shown in part (a) of , when Add=True, it means using residual connection. Fig.11 As shown in part (b), when Add=False, it means that residual connection is not used.
[0052] The SAC module structure is as follows Fig.12 As shown in the figure, it consists of a SAConv module and two global context modules attached before and after the SAConv module. The SAConv module includes a 5×5 average pooling layer, a two-dimensional convolution (Conv2d) module, a 3×3 two-dimensional convolution with an atrous rate of 1, and a 3×3 two-dimensional convolution with an atrous rate of 3. The two global context modules attached before and after the SAConv module are called the front-global context module and the back-global context module, respectively, each of which includes a 5×5 average pooling layer and a two-dimensional convolution module.
[0053] Assumptions Indicates that the input is , weight is , the void rate is 1, and the output is The processing of the SAConv module can be written as formula (4).
[0054] (4); in is the hole rate hyperparameter. The SAConv module divides the input into two parallel paths. The first path uses the original convolution with a weight of , no other processing is done; the second path is a convolution with a dilation rate of 3, and its weight is ,in The weights involved in the training are initialized to 0. The second hole convolution uses the weights of the original convolution Initialization is performed because objects of different scales can be detected with different void rates using the same weight. As a weight, it can reduce the learning cost of the path. is a learnable switching function, Fig.12 The simplified representation is . It is possible to weightedly fuse the convolution results of the first and second paths with different void rates. This is achieved by using a 5×5 average pooling layer followed by a 1×1 two-dimensional convolution. Represents the output of the SAConv module.
[0055] Step 4: Use the enhanced surface defect dataset to train the PBDNet model, and after training, use it as a surface defect detection model.
[0056] The enhanced surface defect dataset is divided into a training set and a test set, and the PBDNet model is trained and tested respectively. The trained PBDNet model is used as a surface defect detection model.
[0057] In this application, mAP is used 50 and mAP 50-95 As an indicator for evaluating the average recognition accuracy of all categories, mAP 50 It is the mAP value calculated when the IoU threshold is 0.5. 50-95More rigorously, the average value of the average precision calculated under different IoU thresholds between 0.50 and 0.95 is counted, which can reflect the performance of the model under different detection difficulties. At the same time, considering the requirements of the defect detection task of this application on defect detection rate, detection speed and deployment difficulty, recall rate is added as a performance evaluation indicator. The calculation method of each evaluation indicator is shown in formulas (5) to (8): (5); (6); (7); (8).
[0058] in, (True Positive) is the number of defects detected correctly, (True Negative) is the number of samples correctly identified as non-defective, (False Positive) is the number of samples that are falsely detected as defects. (False Negative) is the number of defects that were missed. It is The average precision of the categories, is the total number of categories in this application =7. Formula (7) is the average precision of a single category The calculation formula for . All categories The average value of . is the precision value under a fixed confidence threshold. It is the recall rate on the Precision-Recall (PR) curve The precision value of the change. From the graph, if the recall rate is the horizontal axis, accuracy With PR as the vertical axis, a PR curve can be drawn, and the area under the PR curve is defined as the average precision. . It means that on the PR curve, when the horizontal axis Value is The vertical axis corresponds to value. for Abbreviation of is the specific value of the calculated Recall value.
[0059] The PBDNet model, a lightweight particleboard surface defect detection model based on YOLOv8s, proposed in this application can keep the number of parameters at 6.43M without sacrificing detection speed, making the detection accuracy mAP 50The value increased by 5%, and the detection rate Recall value increased by 9.3%.
[0060] Step 5: Use the surface defect detection model to perform multi-scale defect detection on the particleboard surface image.
[0061] When in use, the real-time acquired particleboard surface image is input into the trained surface defect detection model, and the detection category c and the detection frame position (x, y, w, h) can be output. The defect area in the image can be accurately located through the detection frame position (x, y, w, h). Through the detection category c, the specific type of defect can be identified, such as scratches, cracks, etc.
[0062] The following specific examples are used to verify the effect of the method of the present application. The fine surface oriented strand board produced by a certain company is used as the object for experimental verification. The board width is 1220 mm×2440 mm and the density is 655 kg / m 3 , thickness is 18 mm, and moisture content is 8%. By adding or replacing different improved modules on the original YOLOv8s model, the impact of different improvements on the overall model is analyzed and verified, and compared with mainstream defect detection models such as Faster-RCNN, YOLOv10s, RTMDet-s, and RT-DETR.
[0063] The experimental hardware platform is an AMD EPYC 7542 (2.90GHz) computer with 256 GB memory and a Zotac RTX4090 24 GB GPU. The system operating environment is Ubuntu 22.04, the development software is Visual Studio Code, the programming language is Python 3.10, and the deep learning framework is PyTorch 2.3.0. In this experiment, the training image size is set to 1024×1024 pixels, the data set is divided into training set and validation set in a ratio of 8:2, the number of iterations (Epoch) is set to 300, the batch size (batch size) is set to 8, the learning rate is 0.001, the number of early stopping rounds (patience) is 50, AMP (AutomaticMixed Precision) is True (enable AMP optimization), the weight decay is 0.0005, and the momentum factor is 0.937.
[0064] The defect quantity distribution of each category of defect instances after data enhancement is as follows: Fig.13 As shown in the figure. After data enhancement, the dataset has a total of 3436 images, including 4324 instances. Then, for each type of defect, 20% of the images are extracted as the validation set, and the remaining 80% of the images are used as the training set. The training set includes 2749 images and 3497 instances; the validation set includes 687 images and 827 instances.
[0065] Fig.14 and Fig.15 The normalized defect height and width distribution histograms shown show that the number of defects is positively skewed with size, both in terms of defect width and defect height, with the peak concentrated on the left side, and the width and height of most defects do not exceed 20% of the width and height of the original image. Fig.16 It can be seen from the defect size heat map shown that, except for the small target defects concentrated in the lower left corner, the remaining defects are more concentrated in the four corners of the image and fewer in the middle, indicating that there are more defects with larger sizes in width or height, and fewer medium-sized defects.
[0066] This application selects mainstream models such as Faster R-CNN, YOLOv8s, RTMDet-s, RT-DETR, and YOLOv10s to construct comparative experiments. The results are shown in Table 1.
[0067] Table 1 Comparative experimental results
[0068] As can be seen from Table 1, among all the models, the mAP of PBDNet in this application is 50 Value and mAP 50-95 The values are the highest, reaching 0.881 and 0.655 respectively, and its Recall value also reaches the highest 0.840. In addition, the inference time of PBDNet is 2.46 ms, second only to YOLOv8s's 2.49 ms, showing high inference efficiency. In terms of parameter quantity, PBDNet is only 6.43 M, which is the lightest model, at the same level as YOLOv8s and YOLOv10s, and much smaller than Faster-RCNN, RTMDet-s and RT-DETR models.
[0069] Fig.17 Shows the mAP of the model during training 50 value and number of iterations (Epoch), Fig.18 This is the Bbox loss curve of the validation set, and the visual detection results are as follows Fig.19 As shown. Fig.17 and Fig.18 It can be seen that during the training process, Faster-RCNN converges the fastest and most stably, followed by PBDNet. 50 The value rises slowly but steadily. The YOLO series networks, including YOLOv8s and YOLOv10s, are the most unstable during training, and the Bbox loss fluctuates the most.
[0070] From the comparative experiments, we can see that Faster-RCNN cannot converge when training the model without using the pre-trained network. When using the pre-trained model, its convergence speed is faster, but the mAP 50 The value is only 0.702. In terms of detection accuracy, the mAP of PBDNet 50 The value reached 0.881, which is 5.5% higher than YOLOv8s, significantly ahead of RT-DETR and RTMDet series detection models, and 8% higher than YOLOv10s. 50-95 In terms of indicators, PBDNet also performed best, leading all models with an accuracy of 0.655, which is 3.6% higher than YOLOv8s. This result shows that the PBDNet model proposed in this application has stronger robustness and stronger detection capabilities at different IoU thresholds. Fig.19 It can be seen that when defects of different sizes coexist, PBDNet has no missed detection of small defects compared to Faster-RCNN and RTMDet-s, and no false detection or multiple detection compared to YOLOv8s, YOLOv10s and RT-DETR. At the same time, PBDNet can detect seven types of defects, including patchy defects (including glue spots, dust spots), wood shavings, oil stains, edge collapse, chalk marks, surface scratches and cracks. Compared with previous studies, it has added the detection of surface scratches and edge collapse defects that are more difficult to identify. The mAP of the newly added defects is 2.34477 kb / s. 50 The values are all over 0.9.
[0071] In addition, in actual applications, compared with the accuracy of defect classification, more attention will be paid to the detection rate of various defects, and the model recall value is more important. The recall value of PBDNet is 0.84, which is 6.4% higher than YOLOv8s and 15.6% higher than YOLOv10s, significantly reducing the probability of missed detection and more in line with the actual application scenarios of factories. Fig.19 It is not difficult to see from the detection examples that compared with other mainstream defect detection models, PBDNet has higher positioning accuracy and confidence for defects with weaker features (such as surface scratches) and small target defects, and the detection results are closer to the true value. In terms of model parameter quantity, PBDNet has 6.43 M parameters, which is 42.2% less than YOLOv8s's 11.14 M, and its inference time is slightly faster than YOLOv8s. Compared with other models, RTMDet-s has a parameter quantity of up to 39.00 M, but its mAP 50The value is only 0.836, which is lower than PBDNet, and the inference time overhead of 54.2 ms is far less than PBDNet. It also shows that the PBDNet model proposed in this application achieves a better balance between accuracy and efficiency through structural optimization. In addition, although the Recall value of RT-DETR-ResNet50 reaches 0.776, which is at a relatively high level, its parameter volume exceeds 80 M, which makes it difficult to deploy in real time with high performance on resource-constrained industrial edge computing devices.
[0072] Furthermore, this application designs improved modules such as C2f_SD (including DEConv module) and SPDConv and introduces them into the YOLOv8 network. At the same time, the YOLOv8 model is pruned and lightweight to form models A~H. The ablation experimental results of each model are shown in Table 2.
[0073] Table 2 Ablation experiment results
[0074] It can be seen from Table 2 that with the introduction of the improved module, the model performance shows differentiated changes. After adding the C2f_SD module, the mAP of models C and G 50 The values are increased to 0.849 and 0.867 respectively. After adding the SPDConv module, the number of parameters of models B and F is reduced to 10.11M and 5.50M respectively.
[0075] mAP of different models in ablation experiments 50 The value and Recall value were evaluated, and the results are shown in Tables 3 and 4.
[0076] Table 3 mAP of different types of defects in ablation experiments 50 Value comparison
[0077] Table 4 Comparison of Recall values of different types of defects in ablation experiments
[0078] From the results shown in Tables 3 and 4, it can be seen that there are significant differences in the detection performance of different defect categories. In all models, the oil stain defect mAP 50 The values are not high, and YOLOv8s (model A) is only 0.462. Model H improves this index to 0.618 by combining improved modules, which is 34.2% higher than model A. Model G has the best detection performance for wood shavings defects, with mAP 50 The value reaches 0.893.
[0079] This application uses Eigen-CAM to visualize the features extracted from the same layer of each model in the ablation experiment to determine whether it has learned the correct defect feature information. The visualization results are as follows: Fig. 20 As shown in the figure, the darker the red part of the heat map, the more attention the model pays to this part.
[0080] In the ablation experiment, after YOLOv8 is pruned (the number of Backbone channels is halved), the mAP of models E, F, G, and H is compared with the unpruned models A, B, C, and D. 50 The values have been improved to varying degrees. For example, the mAP of model E after lightweighting 50 The value increased from 0.833 to 0.88, indicating that for the particleboard surface detection task, the YOLOv8s model has certain parameter redundancy. At this time, pruning the channel can force the model to focus on more discriminative features.
[0081] As shown in Table 2, after replacing the downsampling method in Backbone from the CBS module with a step size of 2 to SPDConv, the performance of model F is significantly improved, with mAP 50 The value increased to 0.857, the Recall value increased to 0.823, and the number of parameters decreased significantly to 5.50 M. Fig. 20 The visualization heat map analysis shows that after adding SPDConv separately, models F and H pay more attention to small target wood particle defects, detect small wood particle defects that models E and G fail to detect, and comprehensively improve the model's attention to various defects. This shows that SPDConv's unique spatial splitting-channel stacking strategy avoids the problem of feature loss that is easily caused by traditional strided convolution, and effectively retains more fine-grained feature information during the downsampling process. In particular, for particleboard surface defects where the number of defects is positively skewed with the defect size, the small target defects occupying one side of the peak rely more on these fine-grained feature information to be correctly classified and located.
[0082] Among all the 7 types of defects, oil stains, chalk marks, and crack defects generally have larger areas, while broken edges, glue spots, and wood particle defects generally have smaller areas. Different types of defects may also appear together, resulting in complex multi-scale problems. For this reason, this application introduces the C2f_SD module to improve the model's detection capabilities when multi-scale defects coexist. The C2f_SD module integrates SAC and DEConv, in which SAC observes the input features twice through parallel convolution branches with different void rates, and uses a switching function to adaptively combine the results of different void convolution rates to expand the receptive field, thereby improving the C2f module's ability to extract particleboard defect features of different scales. From the results shown in Tables 3 and 4, it can be seen that after adding the C2f_SD module, the detection capabilities of models C, D, G, and H for defects of different scales have been significantly improved. When only the C2f_SD module is added to models C and G, the mAP of oil stain defects (large targets) is 50 The values were increased by 6.1% and 5.9% respectively, while maintaining the mAP of small target defects such as patchy defects and shavings. 50 The value is basically unchanged or slightly improved, indicating that the model with the improved module has better robustness in dealing with the coexistence of multi-scale defects.
[0083] At the same time, from Fig. 20 It can be seen from the heat map that due to the presence of DEConv in the C2f_SD module, models D and H pay much more attention to the edge of the defect. Compared with models B and F, which failed to identify the oily area, models D and H after adding the C2f_SD module pay much more attention to the edge of the oily area and successfully detect the defect. This shows that the introduction of horizontal and vertical differential convolution branches gives the model certain prior knowledge, which enables the model to pay attention to the edge information of the defect. Another advantage brought by this module is that the convergence speed during model training will also increase. Fig.21 As shown in Figure 2, after adding the C2f_SD module containing DEConv to the baseline model, the mAP of models C and G is only 100 epochs later. 50 The value is close to 0.8, and the convergence speed is greatly accelerated.
[0084] In order to solve the problems of large defect scale variation, coexistence of multi-scale defects, positive skewed distribution of defect number with defect size, and imbalance of defect sample number in fine surface oriented strand board surface defect detection task, this paper proposes a lightweight detection model PBDNet based on YOLOv8s and an asymmetric data enhancement method. The average defect detection accuracy mAP is 0.0447 on the 7 types of effective defects specified by the enterprise standard. 50The value reached 0.881, the average defect detection rate Recall value reached 0.840, and the average inference time was less than 3 ms. In the PBDNet model, the SPDConv module retains more feature information through its unique spatial splitting-channel stacking strategy, significantly enhancing the model's ability to detect small target defects and improving the model's ability to detect defects when the number of defects is positively skewed with the defect size; the C2f_SD module significantly improves the model's ability to detect multi-scale defects through a switchable hole convolution mechanism. 50 The value was increased by nearly 6.1%, while maintaining the mAP of small target defects such as patchy defects and shavings. 50 The value remained basically unchanged or slightly improved. The addition of the DEConv module introduced prior knowledge into the model, which improved the convergence speed during model training. The final PBDNet model maintained a lightweight parameter count of 6.43M while achieving a mAP of 1. 50 The accuracy and recall values of YOLOv8s are respectively increased by 4.8% and 6.4%. In terms of precision-efficiency balance, it is significantly better than mainstream target detection models such as Faster R-CNN, RT-DETR and RTMDet. It also provides an efficient, accurate and edge-deployable automated detection method for particleboard surface defect detection, which is of positive significance to improving the quality of particleboard products and promoting the upgrading of intelligent manufacturing.
[0085] In an exemplary embodiment, the present application also provides a computer device, which can be a server or a terminal. The computer device includes a processor, a memory, an input / output interface and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the multi-scale defect detection method for the particleboard surface is implemented.
[0086] In an exemplary embodiment, the present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for detecting multi-scale defects on the particleboard surface is implemented.
[0087] In an exemplary embodiment, the present application also provides a computer program product, including a computer program, which implements the multi-scale defect detection method for particle board surface when executed by a processor.
[0088] Surface defect detection is an important part of ensuring product quality in the production process of particleboard. However, due to the large scale variation of surface defects on particleboard, the coexistence of multi-scale defects, and the positively skewed distribution of the number of defects with the defect size, it is still challenging to detect them efficiently and accurately. To solve the above problems, this application proposes a multi-scale defect detection method for particleboard surface. The PBDNet model adopted in the application introduces the SPDConv module as a downsampling method, which divides the feature tensor in space and splices it on the channel, reducing the information loss in the downsampling process, retaining more fine-grained features for defects on the peak side of the positively skewed distribution, and improving the detection model's detection ability when the number of defects is positively skewed with the defect size. In addition, the C2f_SD module proposed in this application significantly improves the model's detection ability for defects of different scales by adding switchable dilated convolution and differential convolution to C2f. The results of comparative experiments and ablation experiments show that PBDNet has an mAP of 1.16. 50 Compared with YOLOv8s, PBDNet’s mAP 50 The value and recall value increased by 4.8% and 6.4% to 0.881 and 0.840 respectively. At the same time, the number of parameters was reduced by 42.2% while keeping the inference speed basically unchanged. The PBDNet model proposed in this application can better meet the needs of real-time and accurate detection of particleboard surface defects.
[0089] It can be understood by a person skilled in the art that all or part of the processes in the above-mentioned embodiment method can be completed by hardware related to computer program instructions, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the process of the embodiment of the above-mentioned method. Among them, any reference to the memory or other medium in each embodiment provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0090] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0091] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0092] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A multi-scale defect detection method for particleboard surface, characterized in that: include: Obtain the original full-frame image of the particleboard surface and perform preprocessing to build a surface defect dataset; The surface defect data set includes a plurality of defect images of different surface defect types; For defect images of different surface defect types in the surface defect dataset, different data enhancement methods are applied to perform asymmetric data enhancement operations to obtain enhanced surface defect datasets; Construct a PBDNet model including a backbone network, a neck network and a detection head; the backbone network includes an SPDConv module, a CBS module, a C2f_SD module and a C2f module; the neck network includes an SPPF module, an upsampling module, a splicing module, a C2f module and an SPDConv module; the detection head includes a CBS module, a Conv2d module, a Cls loss module and a Bbox loss module; The PBDNet model is trained using the enhanced surface defect dataset and used as a surface defect detection model after training. The surface defect detection model is used to perform multi-scale defect detection on particleboard surface images.
2. The particleboard surface multi-scale defect detection method according to claim 1, characterized in that: The method of obtaining the full-width original image of the particleboard surface and preprocessing it to construct a surface defect data set specifically includes: Perform sliding window slicing processing on the full-width original image of the particleboard surface, and extract multiple sub-images from the full-width original image of the particleboard surface; Screening multiple sub-images and retaining only sub-images with surface defects; Marking the types of surface defects in the sub-image with surface defects; the types of surface defects include spot defects, wood shavings, oil stains, edge collapse, chalk marks, scratches and cracks; The labeled sub-images are taken as defect images and stored as surface defect datasets.
3. The particleboard surface multi-scale defect detection method according to claim 2, characterized in that: The asymmetric data enhancement operation is performed by applying different data enhancement methods to defect images of different surface defect types in the surface defect dataset, specifically including: For defective images with edge collapse as the surface defect type, vertical flipping, horizontal flipping, random brightness / contrast changes, and random cropping / scaling operations are performed; For defect images with chalk marks as surface defects, vertical flipping, blur transformation, random brightness / contrast changes, and random cropping / scaling operations are performed; For defect images with scratches as the surface defect type, vertical flipping and horizontal flipping operations are performed; For defect images with cracks as the surface defect type, vertical flipping, horizontal flipping, random brightness / contrast changes, and random cropping / scaling operations are performed.
4. The particleboard surface multi-scale defect detection method according to claim 1, characterized in that: The SPDConv module specifically includes: a space-to-depth transformation layer and a non-strided convolution layer; The spatial to depth transformation layer is used to transform the input size into Feature map Split in the spatial dimension and decompose into 4 sub-graphs with half the spatial dimension through uniform grid sampling ; Then the subgraph After splicing along the channel dimension, the stacked feature map is obtained ;in is the spatial dimension, is the number of channels; express dimensional real number space; The non-stepped convolution layer is used to stack the feature maps Use standard convolution with a stride of 1 to compress the number of channels to , get the downsampled feature map .
5. The particleboard surface multi-scale defect detection method according to claim 1, characterized in that: The C2f_SD module specifically includes: a DEConv module, a CBS module, a segmentation module, a BottleNeck_SAC module and a splicing module; The DEConv module is composed of a common convolution module, a horizontal differential convolution module and a vertical differential convolution module; the common convolution module is used to extract the intensity level features of the image; the horizontal differential convolution module uses a fixed horizontal gradient convolution kernel to capture the edge features in the horizontal direction; the vertical differential convolution module uses a fixed vertical gradient convolution kernel to capture the edge features in the vertical direction; The CBS module is used to adjust the number of channels of the image; The segmentation module is used to split the feature map in the channel dimension; The BottleNeck_SAC module consists of a SAConv module and two global context modules attached before and after the SAConv module; The splicing module is used to splice the input feature maps on the channel.
6. The particleboard surface multi-scale defect detection method according to claim 5, characterized in that: The calculation formula of the SAConv module is: ;in Indicates that the input is , weight is , the void rate is 1 and the output is Ordinary convolution operation; is a learnable switching function; is the weight of participating in training; is the void ratio hyperparameter; is the output of the SAConv module.
7. The particleboard surface multi-scale defect detection method according to claim 5, characterized in that: The global context module includes a 5×5 average pooling layer and a two-dimensional convolutional layer.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the particleboard surface multi-scale defect detection method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting multi-scale defects on the particle board surface according to any one of claims 1 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for detecting multi-scale defects on the particle board surface according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Steel surface defect detection method based on improved YOLOv5
CN115294089A
Shaving board surface defect detection method and device based on improved YOLOv5
CN117058077A
Improved defect PCB detection method based on YOLOv8
CN117422970A
Group health preserving pig weight dynamic monitoring method based on multi-target tracking and segmentation
CN117475368A
Defect detection model training method and defect detection method
CN117809110A
Cited By
Working surface detection method of wall surface polishing robot and related device
CN121353867A