Wood defect detection method based on improved YOLOv11 model

By improving the YOLOv11 model and combining circular coordinate attention, detextured attention, and rectangular context guidance modules, the problem of balancing large and small targets in wood defect detection was solved, thus improving detection accuracy and real-time performance.

CN121962755APending Publication Date: 2026-05-01JIANGXI UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGXI UNIV OF SCI & TECH
Filing Date
2026-01-27
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing deep learning algorithms struggle to simultaneously address the detection needs of both large and small targets in wood defect detection, and their model parameters and computational complexity fail to meet real-time detection requirements.

Method used

An improved YOLOv11 model is adopted, introducing circular coordinate attention, detexturing attention, rectangular context-guided C3k2 and rectangular attention modules to optimize feature extraction and removal of wood texture background information.

Benefits of technology

It improves the accuracy of wood defect detection, especially the ability to extract information from circular and rectangular defects, and reduces interference from wood texture background, meeting the lightweight requirements of real-time detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962755A_ABST
    Figure CN121962755A_ABST
Patent Text Reader

Abstract

The invention discloses a wood defect detection method based on an improved YOLOv11 model. The method comprises the following steps: acquiring a surface image of wood to be detected; the to-be-detected wood surface image is input into an improved YOLOv11 model, a detection result is obtained, the improved YOLOv11 model completes feature extraction and fusion through a backbone network module, a neck module and a detection head module in sequence, and before the detection head module, the detection head module completes feature extraction and fusion of the to-be-detected wood surface image; a rectangular attention module, a texture removal attention module and a circular coordinate attention module are introduced in parallel, and reweighting is carried out on the feature maps of the corresponding hierarchies; and respectively sending the reweighted three layers of feature maps into the Detect detection heads in the corresponding detection heads, and outputting defect category and position information.
Need to check novelty before this filing date? Find Prior Art

Description

A Wood Defect Detection Method Based on an Improved YOLOv11 Model Technical Field

[0001] This invention belongs to the field of defect detection technology, and in particular relates to a wood defect detection method based on an improved YOLOv11 model. Background Technology

[0002] Wood defects refer to natural growth factors such as knots, cracks, and decay caused by biological activity, as well as problems such as splitting, scratches, and uneven texture caused by artificial processing. These defects not only significantly reduce the mechanical properties, structural stability, and aesthetic value of wood products, but also bring potential safety hazards in key application scenarios such as load-bearing structures and interior decoration.

[0003] Current technologies primarily rely on manual inspection and visual testing. In recent years, deep learning algorithms, such as convolutional neural networks and their improvements and hybrid architectures, have shown great potential and have become a trend in wood defect detection, as exemplified by the improved YOLOv11 model. Its principle involves acquiring wood images through an optical system, utilizing image processing and pattern recognition technologies to automatically extract defect features and compare them with those of normal wood, ultimately achieving defect localization, classification, and quantification. Essentially, it replaces manual visual inspection with "machine eyes + algorithmic brain." The core logic can be broken down into five stages: image acquisition → preprocessing → feature extraction → defect identification → result output. Each stage is interconnected to ensure detection accuracy.

[0004] While deep learning-based detection methods have made significant progress in detection accuracy and inference speed, existing algorithms still face challenges in handling the diversity and complexity of wood surface defects. On the one hand, wood surface defect detection involves not only large-scale targets such as cracks and discoloration, but also small targets such as dead knots and pits, increasing the difficulty of detection due to the diversity of defects. Although many current studies focus on optimizing the detection of small-target defects, few methods can simultaneously address the detection needs of both large and small targets. On the other hand, wood surface defect detection employs edge computing deployment, requiring model parameters and computational complexity to be as lightweight as possible to meet real-time detection requirements. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention proposes a wood defect detection method based on an improved YOLOv11 model. This invention proposes circular coordinate attention, detextured attention, rectangular context-guided C3k2, and rectangular attention to improve YOLOv10, so that the model can better extract information about circular and rectangular defects and remove wood texture background information, thereby improving detection performance.

[0006] To achieve the above objectives, this invention provides a wood defect detection method based on an improved YOLOv11 model, comprising: acquiring a surface image of the wood to be detected; inputting the surface image of the wood to be detected into an improved YOLOv11 model to obtain detection results, wherein the improved YOLOv11 model sequentially completes feature extraction and fusion through a backbone network module, a neck module, and a detection head module; before the detection head module, a rectangular attention module, a detexturing attention module, and a circular coordinate attention module are introduced in parallel to reweight the feature maps of the corresponding layers; the reweighted three-layer feature maps are respectively fed into the Detect detection head in the corresponding detection head module to output defect category and location information.

[0007] Optionally, inputting the image of the wood surface to be detected into the improved YOLOv11 model includes: scaling the image of the wood surface to be detected to a preset pixel size, and generating a YOLO format annotation file using the Labelme tool; and performing normalization preprocessing on the annotation file.

[0008] Optionally, the backbone network module is stacked from layer 0 to layer 10, including sequentially arranged convolutional units, a first rectangular context guidance unit, a spatial pyramid pooling fast unit, and a channel splitting attention enhancement C2 unit; wherein, the first rectangular context guidance unit appears in layers 2, 4, 6, 8, and 10, and the output of the first rectangular context guidance unit in each layer is used as the input of the subsequent layers; the convolutional unit is used to extract feature maps; the first rectangular context guidance unit is used to optimize feature representation through rectangular convolutional kernels and context guidance mechanism; the spatial pyramid pooling fast unit is used to perform multi-scale spatial sampling and fusion on the feature maps extracted by convolution; the channel splitting attention enhancement C2 unit is used to combine channel splitting mechanism and pyramid self-attention mechanism to improve the channel correlation and spatial attention focusing ability of feature maps.

[0009] Optionally, the neck module consists of layers 11 to 22, including alternating upsampling layers, splicing layers, and a second rectangular context guidance unit; wherein the outputs of the rectangular context guidance units of layers 16, 19, and 22 are respectively led out in parallel as inputs to the rectangular attention module, the detexturing attention module, and the circular coordinate attention module.

[0010] The upsampling layer is used to scale up the feature map; the stitching layer is used to stitch feature maps of different levels with consistent scales together along the channel dimension to integrate multi-dimensional feature information; the second rectangular context guidance unit is used to perform depth optimization on the stitched fused features, strengthen the vertical feature correlation, suppress redundant information, and improve the feature recognition of rectangular defects.

[0011] Optionally, the circular coordinate attention module processes the 16th layer feature map by: converting the feature map output by the neck module into a circular coordinate system through polar coordinate mapping, performing channel attention calculation within the circular coordinate system, and obtaining a circular coordinate weighted feature map; wherein, the circular coordinate weighted feature map is only sent to the Detect head corresponding to the circular coordinate attention module, and does not pass through the rectangular attention module or the detexturing attention module.

[0012] Optionally, the detexturing attention module processes the 19th layer feature map by: constructing a Gabor texture suppression branch parallel to the SE channel attention to obtain a detextured feature map; wherein, the detextured feature map is only fed into the Detect head corresponding to the texture attention module, and does not pass through the rectangular attention module or the circular coordinate attention module.

[0013] Optionally, the rectangular attention module processes the 22nd layer feature map by: using a 7×3 rectangular convolution kernel to expand the receptive field in the vertical direction, and recalibrating the channel weights through the SE module to obtain a vertically enhanced feature map; wherein, the vertically enhanced feature map is only sent to the Detect head corresponding to the rectangular attention module, and does not pass through the circular coordinate attention module or the detexturing attention module.

[0014] Optionally, the training process of the improved YOLOv11 model includes: pre-training the initial YOLOv11 network using the PascalVOC or COCO dataset to obtain initial weights; loading the initial weights into the improved YOLOv11 model; and then training the improved YOLOv11 model using wood surface images to obtain the trained improved YOLOv11 model.

[0015] Compared with existing technologies, this invention has the following advantages and technical effects: This invention proposes an improved C3k2-RCG module using the Guided Network (CGNet) module and the Rectangular Attention (RA) module, resulting in feature maps with more relevant features in the vertical direction; Rectangular Attention (RA) captures more vertical information and allows channels carrying more vertical information to receive greater weights; Detexturization Attention (DTA) compresses texture features to match the original number of channels, allowing for concatenation with global features obtained from the initial branch of global average pooling, and removing interfering texture information; Circular Coordinate Attention (CCA) enables the model to learn image features more effectively at a deeper level, thus avoiding the optimization function getting trapped in local optima and gradient vanishing problems. Ultimately, this improves the accuracy of detecting the shape of wood defects and the angle of wood texture, enabling better extraction of information from circular and rectangular defects and removal of wood texture background information, thereby improving detection performance. Attached Figure Description

[0016] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings: Figure 1 is a YOLOv11 structural diagram; Figure 2 is an improved YOLOv11 model structural diagram according to an embodiment of the present invention; Figure 3 is a circular coordinate attention structural diagram according to an embodiment of the present invention; Figure 4 is an RCG module structural diagram according to an embodiment of the present invention; Figure 5 is a detextured attention structural diagram according to an embodiment of the present invention; Figure 6 is a rectangular attention structural diagram according to an embodiment of the present invention; Figure 7 is a flowchart of a wood defect detection method based on an improved YOLOv11 model according to an embodiment of the present invention. Detailed Implementation

[0017] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0018] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0019] This embodiment proposes a wood defect detection method based on an improved YOLOv11 model, as shown in Figure 7. The method includes the following steps: acquiring a surface image of the wood to be detected; inputting the surface image into the improved YOLOv11 model to obtain the detection result; wherein the improved YOLOv11 model sequentially performs feature extraction and fusion through a backbone module, a neck module, and a head module; before the head module, a rectangular attention module, a detexturing attention module, and a circular coordinate attention module are introduced in parallel to reweight the feature maps of the corresponding layers; the reweighted three-layer feature maps are then fed into the Detect module in the corresponding head module to output the defect category and location information.

[0020] Specifically, the dataset used in this invention consists of the first and second parts of VSD-DET, initially created in actual industrial production scenarios, with the image size modified to 2800. 1024 images, each occupying approximately 1MB of disk space, with corresponding adjustments to the annotations. The dataset was manually annotated in YOLO object detection format (.txt) using the Labelme image annotation tool, and the training, validation, and test sets were randomly divided in an 8:1:1 ratio.

[0021] The software and hardware environment used in the experiment was Ultralytics 8.3.9, Python 3.9.23, torch 2.3.0 cu121, NVIDIA GeForce RTX 4070 laptop GPU, and Win11.

[0022] An initial YOLO11 object detection network model (Figure 1) was constructed and pre-trained using a sample dataset to obtain the trainable parameters and weights of the initial YOLO11 object detection network model. The initial YOLO11 object detection network model includes a first Backbone module, a first Neck module, and a first Head module. The first Backbone module performs multi-layer convolutional operations to extract and encode the basic features of the sample dataset, including layers 0 to 10, which include multiple convolutional modules (Conv and C3k2), SPPF, and C2PSA. The feature maps are then fed into the first Neck module. The first Neck module enhances feature representation capabilities through multi-scale feature fusion, integrating feature information at different scales, including layers 11 to 22. Through multiple feature fusion and upsampling operations, combined with feature concatenation and C3k2 module fusion, the extracted and optimized feature maps are input into the first Head module. The first Head module performs object regression and classification tasks, mapping the extracted features to specific detection results, including target location. The system performs target recognition and localization by classifying and scoring targets and establishing confidence levels. It includes three detection heads (Detect), each calculating regression and classification losses for feature maps at different scales. The regression and classification losses include at least the complete IoU loss, distribution focus loss, and classification loss. The initial YOLO11 target detection network model is trained using the PascalVOC or COCO dataset, yielding a pre-trained result. A parameter serialization mechanism is used to export the trainable parameters and weights from the pre-trained result into a structured storage object, generating a .pt file containing a complete description of the network's state. The trainable parameters include at least the convolutional kernel weight matrix and the moving mean or variance of the batch normalization layer.

[0023] An improved YOLO11 object detection network model was constructed (Figure 2). Based on the trainable parameters and weights of the initial YOLO11 object detection network model, the parameters of the improved YOLO11 object detection network model were initialized. The model was then validated and evaluated to obtain the feasibility evaluation results of the improved YOLO11 object detection network model.

[0024] The improved YOLO11 object detection network model includes a second Backbone module, a second Neck module, and a second Head module. The second Backbone module comprises layers 0 to 10, including multiple convolutional modules (Conv, C3k2_RGG, SPPF, and C2PSA), after which feature mapping is fed into the second Neck module. The second Neck module comprises layers 11 to 22, which involves multiple feature fusion and upsampling operations, combined with feature concatenation (Concat) and C3k2_RGG module fusion, resulting in extracted and optimized feature maps. The output of the RA attention module is sent to the second Head module. The output of the 22nd layer C3k2_RGG module is also used as the input of the DTA attention module. The output of the 16th layer C3k2_RGG module is also used as the input of the CCA attention module. The second Head module includes three attention modules and three detection heads. The output of the RA attention module is used as the input of the first detection head, the output of the DTA attention module is used as the input of the second detection head, and the output of the CCA attention module is used as the input of the third detection head.

[0025] Experimental parameters: image size 640, batch size 32, training epochs 300, worker threads 8, mosaic disabled 0, cache set to False, optimizer SGD; experimental results are shown in Table 1: Table 1 The improved YOLO11 object detection network model, initialized with training parameters based on the original graphite ore image, is validated and evaluated to obtain a feasible evaluation result. The performance of the improved YOLO11 object detection network model is monitored in real time. After each training cycle, the model evaluation effect is obtained based on the validation set to determine whether to continue or terminate training. By comparing the improved model with the initial YOLO11 object detection network model, differences in various experimental indicators are obtained, thus yielding a feasible evaluation result for the improved YOLO11 object detection network model.

[0026] Furthermore, inputting the image of the wood surface to be detected into the improved YOLOv11 model includes: uniformly scaling the size of the image of the wood surface to be detected to a preset number of pixels, and using the Labelme tool to generate a YOLO format annotation file; and performing normalization preprocessing on the annotation file.

[0027] Furthermore, the Backbone module is stacked from layer 0 to layer 10, including sequentially arranged convolutional units, a first rectangular context-guided unit (first C3k2-RCG unit), a spatial pyramid pooling fast unit (SPPF unit), and a channel splitting attention enhancement C2 unit (C2PSA unit); wherein, the C3k2-RCG unit appears in layers 2, 4, 6, 8, and 10, and the output of each C3k2-RCG unit is used as the input of the subsequent layer; the convolutional unit is used to extract feature maps; the first C3k2-RCG unit is used to optimize feature representation through rectangular convolutional kernels and context-guided mechanisms; the SPPF unit is used to perform multi-scale spatial sampling and fusion on the feature maps extracted by convolution; the C2PSA unit is used to combine channel splitting mechanisms and pyramid self-attention mechanisms to improve the channel correlation and spatial attention focusing ability of feature maps.

[0028] Specifically, the C3k2_RGG module (rectangular context-guided C3k2 unit) serves as the core feature extraction component for the Backbone and Neck modules in the improved YOLOv11 model. It replaces the original C3k2 module and optimizes feature representation through rectangular convolutional kernels and context-guided mechanisms, focusing on improving the feature extraction capability of rectangular defects (such as cracks and splits).

[0029] SPPF module (Spatial Pyramid Pooling Fast Unit): As a key feature aggregation component in the backbone network, it is used to perform multi-scale spatial sampling and fusion of feature maps extracted by convolution, solving the feature extraction problem of defects of different scales (from large color spots to small dead nodes) while maintaining computational efficiency.

[0030] C2PSA module (Channel Splitting Attention Enhancement C2 Unit): As a feature enhancement component in the backbone network, it combines the channel splitting mechanism and the pyramid self-attention mechanism to improve the channel correlation and spatial attention focusing ability of the feature map, and enhance the feature discrimination of complex defects (such as pits and decay in texture interlacing areas).

[0031] Furthermore, the Neck module consists of layers 11 to 22, including alternating upsampling layers, splicing layers, and a second rectangular context guiding unit (second C3k2-RCG unit); wherein the outputs of the C3k2-RCG units of layers 16, 19, and 22 are respectively extracted in parallel as inputs to the rectangular attention module, the detexturing attention module, and the circular coordinate attention module.

[0032] The upsampling layer is used to scale up the feature map; the stitching layer is used to stitch feature maps of different levels with consistent scales together along the channel dimension to integrate multi-dimensional feature information; the second rectangular context guidance unit is used to perform depth optimization on the stitched fused features, strengthen the vertical feature correlation, suppress redundant information, and improve the feature recognition of rectangular defects.

[0033] Specifically, the upsampling layer is used to scale up the feature map, opening up the correlation channels between features at different levels and providing a foundation for multi-scale defect detection. The stitched features include both low-level features captured by the shallow network, such as "wood surface texture details and defect edge contours", and high-level features extracted by the deep network, such as "defect category attributes and global spatial relationships", avoiding the information limitations of single-level features and providing more comprehensive input for the feature optimization of the subsequent C3k2-RCG unit.

[0034] The concat layer is used to concatenate feature maps of different levels with consistent scale along the channel dimension, integrating multi-dimensional feature information, enriching the comprehensiveness of feature expression, and accurately adapting to the feature distribution of vertically extending defects such as cracks and splits on the wood surface. The concatenated features include both low-level features captured by the shallow network, such as "wood surface texture details and defect edge contours", and high-level features extracted by the deep network, such as "defect category attributes and global spatial relationships", avoiding the information limitations of single-level features. The C3k2-RCG unit (rectangular context-guided C3k2 unit) is used to deeply optimize the concatenated fused features, strengthen the correlation of vertical features, suppress redundant information, and improve the feature recognition of rectangular defects (such as cracks and splits). Rectangular convolution kernels enhance the ability to aggregate vertical features, accurately adapting to the feature distribution of vertically extending defects such as cracks and splits on the wood surface; the context guidance mechanism expands the feature receptive field, enabling the association of the spatial relationship between defects and their surrounding background, reducing interference from isolated feature points; channel attention optimization automatically assigns higher weights to effective defect features, suppresses irrelevant background information such as wood texture, and outputs more focused and discriminative feature maps, providing high-quality input for subsequent RA (rectangular attention), DTA (detexturing attention), and CCA (circular coordinate attention) modules.

[0035] Furthermore, the circular coordinate attention module processes the 16th layer feature map by: converting the feature map output by the Neck module into a circular coordinate system through polar coordinate mapping, performing channel attention calculation within the circular coordinate system, and obtaining a circular coordinate weighted feature map; wherein, the circular coordinate weighted feature map is only sent to the Detect head corresponding to the circular coordinate attention module, and does not pass through the rectangular attention module or the detexturing attention module.

[0036] Specifically, the Circular Coordinate Attention (CCA) module is an innovative attention mechanism, as illustrated in Figure 3. It combines polar coordinate transformation to simplify the image, thereby facilitating faster training and improving performance. By leveraging the characteristics of polar coordinate images, the model's attention is guided to the region most likely to contain segmentation information. Circular Coordinate Attention is inspired by coordinate attention and strip attention, but instead of splitting attention along height and width, it splits it along the radius r and angle θ of the polar coordinates. This allows the network to better model circular structures. The process involves first converting the feature map X to polar coordinates and applying factorization global pooling to split the attention along the radius and angle, obtaining radius and angle descriptors. Next, the two descriptors are passed through a shared 1×1 convolution, BN, and activation layer to generate radius and angle attention, respectively. Then, the outer product of the two is used to obtain the attention map. Finally, it is interpolated back from polar coordinates to the original Cartesian grid. By multiplying this by the input feature map, a reweighted matrix is ​​obtained. Like other modules, it can also build residual connections, enabling the model to learn image features more effectively at a deeper level, thereby avoiding the problems of the optimization function getting trapped in local optima and gradient vanishing.

[0037] Furthermore, the detexturing attention module processes the 19th layer feature map by: constructing a Gabor texture suppression branch parallel to the SE channel attention to obtain a detextured feature map; in the embodiment, the combination of "rectangular convolution kernel processing + SE attention module" in the RA module is essentially combining the channel weight learning mechanism of SE with rectangular feature extraction to strengthen the vertical defect features; the DTA module adds a parallel branch for Gabor feature extraction on the basis of the single-branch channel compression of the SE module and improves the activation function to achieve the "detexturing" function, which is an adaptive improvement to the SE module.

[0038] The detextured feature map is only fed into the Detect head corresponding to the texture attention module, and does not pass through the rectangular attention module or the circular coordinate attention module.

[0039] Specifically, the De-texture Attention (DTA) module can facilitate the detection of texture-like defects; some defects, such as quartzite, are very similar to texture features and are difficult to distinguish. This embodiment proposes a De-texture Attention (DTA) method to remove texture information from feature maps, as shown in Figure 6. A new parallel branch is constructed, running in parallel with the channel compression branch of the SE attention module. This branch uses a Gabor feature extractor to obtain texture features of different directions and frequencies, and then compresses the texture features to match the original number of channels, so that they can be concatenated with the global features obtained by the initial branch of global average pooling. A linear network is set up to learn the optimal parameters. Most importantly, the last layer of the linear layer uses the tanh function as the activation function instead of the original sigmoid. This is because we want to remove texture information from the feature maps, which should have negative correlations. However, the output of the sigmoid is 0 to 1, and the coefficient cannot be positive. Therefore, we use the tanh function as the activation function, which can output negative numbers, with an output range of -1 to 1.

[0040] The output of DTA can be written as: O(X) = Tanh(MLP([GAP(X),Conv(...)) (X),C)]))X;where O(X) output, MLP is a three-layer network with ReLU activation function, and Conv is a convolution operation used to reduce the dimension to 1×1×C. It is a Gabor filtering function with n filters, each filter extracts 4 statistical features, so the result is 1×1×4n.

[0041] Furthermore, the rectangular attention module processes the 22nd layer feature map by: using a 7×3 rectangular convolution kernel to expand the receptive field in the vertical direction, and recalibrating the channel weights through the SE module to obtain a vertically enhanced feature map; wherein, the vertically enhanced feature map is only fed into the Detect head corresponding to the rectangular attention module, and does not pass through the circular coordinate attention module or the detexturing attention module.

[0042] Specifically, the rectangular context-guided C3k2 (C3k2-RCG) and rectangular attention module (RA): As shown in Figure 4, the context-guided network (CGNet) was first proposed as a lightweight network architecture specifically for semantic segmentation tasks. It uses the CG module to learn joint features of local features and surrounding context, and further optimizes these joint features through global context. This design embodies three layers of context modeling: capturing local features through 3×3 depthwise separable convolutions, extracting surrounding context through dilated convolutions with a larger receptive field, and then optimizing the fused features through a channel attention mechanism similar to the SE module. The invention uses 7×3 rectangular convolution kernels to extract surrounding information instead of dilated convolutions, as shown in Figure 5. Therefore, the resulting feature map has more relevant features in the vertical direction. Simultaneously, the RCG module is used to improve the C3k2 module.

[0043] Furthermore, as shown in Figure 5, the RA module is designed to reweight feature maps before detection. The rectangular attention module first performs convolution using rectangular kernels before feeding it into the SE attention module. This design aims to capture more vertical information and allow channels carrying more vertical information to receive greater weights. Therefore, the detection head is more likely to detect vertical defects such as quartzite and cracks.

[0044] Furthermore, the training process of the improved YOLOv11 model includes: pre-training the initial YOLOv11 network using the PascalVOC or COCO dataset to obtain initial weights; loading the initial weights into the improved YOLOv11 model; and then training the improved YOLOv11 model using wood surface images to obtain the trained improved YOLOv11 model.

[0045] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for detecting wood defects based on an improved YOLOv11 model, characterized in that, include: Acquire an image of the wood surface to be detected; input the image of the wood surface to be detected into an improved YOLOv11 model to obtain the detection result. The improved YOLOv11 model sequentially completes feature extraction and fusion through a backbone network module, a neck module, and a detection head module. Before the detection head module, a rectangular attention module, a detexturing attention module, and a circular coordinate attention module are introduced in parallel to reweight the feature maps of the corresponding layers. The reweighted three-layer feature maps are then fed into the Detect detection head in the corresponding detection head to output the defect category and location information.

2. The wood defect detection method based on the improved YOLOv11 model according to claim 1, characterized in that, Inputting the image of the wood surface to be detected into the improved YOLOv11 model includes: scaling the image of the wood surface to be detected to a preset pixel size, and generating a YOLO format annotation file using the Labelme tool; and performing normalization preprocessing on the annotation file.

3. The wood defect detection method based on the improved YOLOv11 model according to claim 1, characterized in that, The backbone network module is stacked from layer 0 to layer 10, including sequentially arranged convolutional units, a first rectangular context guidance unit, a spatial pyramid pooling fast unit, and a channel splitting attention enhancement C2 unit. The first rectangular context guidance unit appears in layers 2, 4, 6, 8, and 10, and the output of each first rectangular context guidance unit serves as the input to subsequent layers. The convolutional units are used to extract feature maps. The first rectangular context guidance unit is used to optimize feature representation through rectangular convolutional kernels and a context guidance mechanism. The spatial pyramid pooling fast unit is used to perform multi-scale spatial sampling and fusion of the feature maps extracted by convolution. The channel splitting attention enhancement C2 unit is used to combine a channel splitting mechanism with a pyramid self-attention mechanism to improve the channel correlation and spatial attention focusing ability of the feature maps.

4. The wood defect detection method based on the improved YOLOv11 model according to claim 1, characterized in that, The neck module consists of layers 11 to 22, including alternating upsampling layers, stitching layers, and a second rectangular context guidance unit. The outputs of the rectangular context guidance units in layers 16, 19, and 22 are extracted in parallel as inputs to the rectangular attention module, detexturing attention module, and circular coordinate attention module, respectively. The upsampling layer is used to scale up the feature maps. The stitching layer is used to stitch feature maps of different levels with consistent scale along the channel dimension, integrating multi-dimensional feature information. The second rectangular context guidance unit is used to perform depth optimization on the stitched fused features, strengthening the vertical feature correlation, suppressing redundant information, and improving the feature recognition accuracy of rectangular defects.

5. The wood defect detection method based on the improved YOLOv11 model according to claim 4, characterized in that, The circular coordinate attention module processes the 16th layer feature map by: converting the feature map output by the neck module into a circular coordinate system through polar coordinate mapping, performing channel attention calculation within the circular coordinate system, and obtaining a circular coordinate weighted feature map; wherein, the circular coordinate weighted feature map is only sent to the Detect head corresponding to the circular coordinate attention module, and does not pass through the rectangular attention module or the detexturing attention module.

6. The wood defect detection method based on the improved YOLOv11 model according to claim 5, characterized in that, The detexturing attention module processes the 19th layer feature map by: constructing a Gabor texture suppression branch parallel to the SE channel attention to obtain a detextured feature map; wherein, the detextured feature map is only fed into the Detect head corresponding to the texture attention module, and does not pass through the rectangular attention module or the circular coordinate attention module.

7. The wood defect detection method based on the improved YOLOv11 model according to claim 6, characterized in that, The rectangular attention module processes the 22nd layer feature map by: using a 7×3 rectangular convolution kernel to expand the receptive field in the vertical direction, and recalibrating the channel weights through the SE module to obtain a vertically enhanced feature map; wherein, the vertically enhanced feature map is only fed into the Detect head corresponding to the rectangular attention module, and does not pass through the circular coordinate attention module or the detexturing attention module.

8. The wood defect detection method based on the improved YOLOv11 model according to claim 1, characterized in that, The training process of the improved YOLOv11 model includes: pre-training the initial YOLOv11 network using the PascalVOC or COCO dataset to obtain initial weights; loading the initial weights into the improved YOLOv11 model; and then training the improved YOLOv11 model using wood surface images to obtain the trained improved YOLOv11 model.