Wood component crack detection model, method and system under complex background based on improved YOLOv11n
By improving the neck network of the YOLOv11n model, the residual branch and weighted splicing unit BiCCT are introduced, which solves the problem of low crack detection accuracy of wood components under complex backgrounds, and achieves high-precision and efficient detection effects.
Patent Information
- Application Number
- CN202510353330.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2045-03-25
AI Technical Summary
The prior art is difficult to detect cracks in wooden components with high precision, especially small-scale cracks, in complex contexts.
Improve the neck network of the YOLOv11n model, introduce residual branching and weighted splicing unit BiCCT, and combine convolutional operations to enhance feature expression capabilities and inhibit interference from complex backgrounds.
The accuracy of crack detection in wooden structures in complex backgrounds is improved, crack representation is enhanced, information loss is reduced, and efficient detection is achieved.
Smart Images

Figure CN119863468A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of civil engineering prefabricated structure detection and computer technology, and in particular to a model, method and system for detecting cracks in wooden components under complex backgrounds based on improved YOLOv11n. Background Art
[0002] Cracks are widely distributed in infrastructure such as buildings, roads and bridges, which not only affect the appearance, but also threaten the stability and safety of the structure. Therefore, timely and effective crack detection is crucial to ensure the safety of building structures and extend their service life. Traditional building structure crack detection technologies include manual detection and machine detection. Manual detection methods are inefficient and inaccurate, while machine detection methods such as infrared and thermal imaging, ultrasonic detection, laser detection and X-ray detection have higher accuracy, but the equipment cost is high and the operation process is complicated.
[0003] Concrete structures, roads, and bridges have large components, so it is easy to obtain photos that include the entire crack features and a single environmental background. For wood, especially wooden structural components, not only are they relatively small in size, but the crack shape is also close to the wood grain features. When the photo includes the entire crack feature, the environmental background is more complex. Existing research on wood crack recognition has mostly focused on photos of small-scale cracks, and less research has been done on complex backgrounds.
[0004] With the development of artificial intelligence technology, image recognition technology has matured and has begun to be used for target detection in engineering. However, existing artificial intelligence detection technology is difficult to detect small-scale cracks in complex backgrounds, and further optimization is needed in the detection of cracks in wooden components. Summary of the invention
[0005] In order to overcome the defect that cracks in wooden components are difficult to detect in the above-mentioned prior art, the present invention proposes a training method for a wooden component crack detection model under complex background based on improved YOLOv11n, focusing on the contextual dependency of image features and multi-dimensional features, thereby suppressing the interference of complex background, enhancing crack representation, and improving the detection accuracy of wooden component cracks.
[0006] The present invention proposes a training method for a wood component crack detection model under a complex background based on an improved YOLOv11n. First, the neck network (Neck) of YOLOv11n is replaced. The new neck network includes a first convolutional network, a second convolutional network, a third convolutional network, a fourth convolutional network, and a first sampling network, a first splicing module, a second sampling network, a second splicing module, a third splicing module, a fifth convolutional network, a fourth splicing module, a sixth convolutional network, and a fifth splicing module that are sequentially connected; the inputs of the first, second, third, and fourth convolutional networks are respectively connected to the outputs of four network layers from shallow to deep of a backbone network (Backbone); the outputs of the first, second, third, and fourth convolutional networks are respectively connected to the inputs of the third, second, fourth, and fifth splicing modules; the output of the second convolutional network is also connected to the input of the third splicing module, the output of the third convolutional network is also connected to the input of the first splicing module, and the output of the fourth convolutional module is also connected to the input of the first sampling network; the output of the first splicing module is also connected to the input of the fourth splicing module; The improved model is then used to perform machine learning on a dataset of images of wooden components with cracks annotated.
[0007] Preferably, the first splicing module, the second splicing module, the third splicing module, the fourth splicing module and the fifth splicing module have the same structure, and are all composed of weighted splicing units BiCCT and C3k2 modules connected front and back; BiCCT includes a Triplet Attention layer, a Concat-T layer, a first dimensional superposition layer and an activation layer connected in sequence; the first dimensional superposition layer dimensionally superimposes the output of the Concat-T layer and the input of the BiCCT.
[0008] Preferably, the improvement to YOLOv11n also includes: the C3k2 module in the splicing module is replaced by a C3k2-Faster-CAA module, the C3k2-Faster-CAA module includes a sequentially connected input convolution layer, a Split function layer, one or more Faster-CAA modules, a second dimension overlay layer and an output convolution layer; the second dimension overlay layer is used to perform dimensional overlay on the output of the Split function layer and the output of each Faster-CAA module; the Faster-CAA module introduces an attention mechanism and a residual branch to capture contextual dependencies between distant pixels.
[0009] Preferably, the Faster-CAA module includes a sequentially connected partial convolution layer, a first point-by-point convolution layer, a second point-by-point convolution layer, an attention layer and a third dimension superposition layer, and the input of the third dimension superposition layer is also connected to the input of the Faster-CAA module.
[0010] Preferably, the C3k2 module in the backbone network is replaced with a C3k2-Faster-CAA module.
[0011] Preferably, the input of the first convolutional network is connected to the 3rd layer of the backbone network, the input of the second convolutional network is connected to the 5th layer of the backbone network, the input of the third convolutional network is connected to the 7th layer of the backbone network, and the input of the fourth convolutional network is connected to the 11th layer of the backbone network.
[0012] Preferably, the loss function used in the model training process is PIoU2 loss.
[0013] The present invention proposes a method for detecting cracks in wooden components. The method adopts the training method of the wooden component crack detection model under complex background based on improved YOLOv11n to obtain a crack detection model. The wooden component to be detected is photographed and the photograph is input into the crack detection model.
[0014] Preferably, the photograph of the wood component to be inspected is subjected to image enhancement and then input into the crack detection model for processing.
[0015] The present invention proposes a wood component crack detection system, comprising a memory and a processor, wherein the memory stores a computer program, the processor is connected to the memory, and the processor is used to execute the computer program to implement the wood component crack detection method under complex background based on improved YOLOv11n.
[0016] The advantages of the present invention are: (1) The present invention proposes a training method for a wood component crack detection model under complex background based on an improved YOLOv11n. The neck network of YOLOv11n is improved, a residual branch is introduced on the original BiFPN structure, and the convolution operation is combined to enhance the feature expression ability, avoid information loss, and improve the image feature judgment ability under complex background, thereby improving the accuracy of wood structure crack detection.
[0017] (2) The weighted concatenation unit BiCCT proposed in the present invention adjusts the weights of multiple input feature maps and the weights of each channel of the feature map, and then reorganizes the feature map by combining the weights of each feature map and the product of the channel weights, thereby improving the feature expression of the feature map and enhancing the feature map. The enhanced feature map is then superimposed on the original input to achieve contextual response of the feature map, thereby flexibly enhancing the representation of the crack area and suppressing the interference of the complex background.
[0018] (3) The present invention introduces a triple attention mechanism through Triplet Attention to capture the features of channel height, channel width and spatial dimension and interact with each other. It is combined with the activation function to improve the nonlinear expression ability and enhance the network's adaptability to complex crack morphology, thereby minimizing the loss of crack information and effectively balancing computational efficiency and accuracy.
[0019] (4) The C3k2-Faster-CAA module of the present invention enhances the interdependence between feature modeling channels and spaces by nesting and residual combination of multiple Faster-CAA modules, thereby improving the processing capability of crack targets under complex backgrounds and improving detection accuracy.
[0020] (5) The Faster-CAA module of the present invention strengthens the features through partial convolution and point-by-point convolution, reduces the amount of computation and memory access, reduces the computational burden on edge devices, and greatly improves the detection efficiency. The Faster-CAA module introduces the attention mechanism and residual branch to capture the contextual dependencies between distant pixels.
[0021] (6) The method for detecting cracks in wooden components under complex backgrounds based on improved YOLOv11n proposed in the present invention uses the crack detection model proposed in the present invention to identify cracks in wooden components, which is fast and accurate, and solves the problem that cracks in wooden components in buildings are difficult to identify with high accuracy due to complex backgrounds. The present invention has excellent comprehensive performance and low hardware requirements, making it an ideal solution for crack detection in wooden structures under complex backgrounds. The improved model proposed in the present invention not only performs well in detection accuracy, but also performs well in computational efficiency and hardware adaptability, providing strong technical support for practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is the existing YOLOv11n structure; Figure 2 The structure of YOLOv11n-B provided by the present invention; Figure 3 The BiFPN-T structure provided by the present invention; Figure 4 The BiCCT structure provided by the present invention; Figure 5 The structure of YOLOv11n-BC provided by the present invention; Figure 6 The structure of C3k2-Faster-CAA provided by the present invention; Figure 7 The structure of Faster-CAA provided by the present invention; Figure 8 This is a comparison diagram of the detection effect before and after the improvement in the embodiment; Fig. 9 This is a flow chart of the model training method in the embodiment; Fig.10 PR curve of ablation experiment in the embodiment; Fig.11 Comparison of model evaluation indicators in the embodiments; Fig.12 Detection category index comparison in the embodiment. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] The present invention proposes a crack detection model for wood components under complex background based on improved YOLOv11n, referred to as a crack detection model. The structure of the crack detection model is improved on the basis of YOLOv11n.
[0025] The present invention proposes a variety of improved methods of YOLOv11n, thereby obtaining a crack detection model for detecting cracks in wooden components with high accuracy. Figure 1 shown.
[0026] Reference Figure 2 ,The first improved model is denoted as YOLOv11n-B. Compared with YOLOv11n, the model YOLOv11n-B improves the neck network.
[0027] The neck network of model YOLOv11n-B includes the first convolutional network, the second convolutional network, the third convolutional network, the fourth convolutional network and the first sampling network, the first splicing module, the second sampling network, the second splicing module, the third splicing module, the fifth convolutional network, the fourth splicing module, the sixth convolutional network and the fifth splicing module connected sequentially; the outputs of the third splicing module, the fourth splicing module and the fifth splicing module are respectively connected to the three segmentation heads of the head network (Head).
[0028] The first convolutional network, the second convolutional network, the third convolutional network and the fourth convolutional network are connected to the input of the backbone network as the neck network. The inputs of the first convolutional network, the second convolutional network, the third convolutional network and the fourth convolutional network are respectively connected to the outputs of the four network layers of the backbone network from shallow to deep.
[0029] Specifically, the input of the first convolutional network is connected to the output of the 3rd layer C3k2 of the backbone network, the input of the second convolutional network is connected to the output of the 5th layer C3k2 of the backbone network, the input of the third convolutional network is connected to the output of the 7th layer C3k2 of the backbone network, and the input of the fourth convolutional network is connected to the output of the 11th layer C3PSA of the backbone network.
[0030] The output of the first convolutional network is connected to the input of the third splicing module; the output of the second convolutional network is respectively connected to the input of the second splicing module and the input of the third splicing module, and the output of the third convolutional network is respectively connected to the input of the first splicing module and the fourth splicing module; the output of the fourth convolutional network is respectively connected to the input of the first sampling network and the fifth splicing module; the output of the first splicing module is also connected to the input of the fourth splicing module.
[0031] Thus, the neck network appears Figure 3 The improved BiFPN structure shown in FIG. 1 can be recorded as the BiFPN-T structure. The BiFPN-T structure introduces a residual branch based on the traditional BiFPN, retains the information of the input features through additional convolution operations, further enhances the feature expression ability, and avoids information loss.
[0032] The first splicing module, the second splicing module, the third splicing module, the fourth splicing module and the fifth splicing module have the same structure and are referred to as splicing modules. The splicing module is composed of weighted splicing units BiCCT and C3k2 modules connected front and back.
[0033] Reference Figure 4 , the weighted concatenation unit BiCCT includes a sequentially connected Triplet Attention layer, Concat-T layer, first dimension superposition layer and activation layer; the Triplet Attention layer adjusts the weights of multiple input feature maps; Concat-T is used to adjust the weights of the channels of the feature map, and then extracts dimensional features from the input feature map in combination with the feature map weights and channel weights to form a new feature map. The first dimension superposition layer superimposes the feature map output by the Concat-T layer and the multiple feature maps input by BiCCT, and the superimposed feature map is activated by the activation layer and then output. The activation layer can specifically use the Swish function.
[0034] Specifically, taking the first splicing module as an example, the input of the first splicing module is two feature maps, that is, the input of the BiCCT of the first splicing module is two feature maps, which are respectively recorded as feature map A and feature map B. The spatial dimensions of A and B are the same, both R. At this time, it is assumed that the weight assigned to feature map A by the Triplet Attention layer is p A , the weight assigned to feature map B is p B , p A +p B =1; The Concat-T layer of the first concatenation module is used to configure the weights of different dimensions of the feature map. Assume that the weight of the rth dimension is denoted as q r , then q1+q2+…+q r +…+q R=1; the Concat-T layer calculates the product of the feature map weight and the dimension weight as the dimension weight of the feature map, and then extracts the corresponding value of the maximum weight on each dimension to form a new feature map.
[0035] That is, let the weight of dimension r on feature map A be denoted by h A-r =p A ×q r , the weight of dimension r on feature map B is denoted as h B-r =p B ×q r ; The feature selection principle of dimension r on the new feature map H is: if h A-r ≥h B-r , then the features of feature map A on dimension r are assigned to the new feature map H of dimension r; if h A-r <h B-r , then the features of feature map B in dimension r are assigned to the new feature map H of dimension r.
[0036] Similarly, taking the third splicing module as an example, the input of the third splicing module is a three-way feature map, that is, the input of the BiCCT of the third splicing module is a three-way feature map, which are recorded as feature map C, feature map D and feature map E respectively. The spatial dimensions of C, D and E are the same, all R. At this time, it is assumed that the weight assigned to the feature map C by the Triplet Attention layer is p C , the weight assigned to the feature map D is p D , the weight assigned to the feature map E is p E , p C +p D +p E =1; The Concat-T layer of the third concatenation module is used to configure the weights of different dimensions of the feature map. Assume that the weight of the rth dimension is denoted as q r , then q1+q2+…+q r +…+q R =1; the Concat-T layer calculates the product of the feature map weight and the dimension weight as the dimension weight of the feature map, and then extracts the corresponding value of the maximum weight on each dimension to form a new feature map.
[0037] That is, let the weight of dimension r on feature map C be denoted as h C-r =p C ×q r , the weight of dimension r on feature map D is denoted as h D-r =p D ×q r ; The weight of dimension r on feature map E is denoted as h E-r =p E ×q r ; The features of dimension r on the new feature map H come from the feature map F, F∈{C,D,E}; The weight of dimension r on feature map H is denoted as h H-r =MAX{h C-r ,h D-r ,h E-r}, which means that the feature map C, D, and E with the largest feature weight on dimension r is assigned to the dimension r of the feature map.
[0038] Triplet Attention adopts a triple attention mechanism, which consists of three parallel branches. The first two branches are dedicated to capturing the cross-dimensional interactions between channels and spatial dimensions. In the third branch, the input features are first pooled, then convolved, and finally, the spatial attention weights are generated through the Sigmoid activation function. The outputs of these three branches are aggregated by averaging to produce the final attention map. The triple attention mechanism aims to effectively balance computational efficiency and accuracy by capturing interactions on different dimensions (channel height, channel width, and spatial dimensions) separately and then aggregating these interactions together to minimize the loss of crack information.
[0039] In this way, Triplet Attention is introduced in BiCCT to adaptively adjust the contribution of each feature map according to the specific situation of the input features, dynamically generate feature map weights, and effectively improve the expressiveness of low-level features. By focusing on the features of the three dimensions of channel, row, and column, Triplet Attention can flexibly enhance the representation of the crack area while suppressing the interference of complex background. BiCCT combines residual branches and dimensional superposition to retain the information of input features, further enhance the expressiveness of features, and avoid information loss. The Swish activation function is used to improve the nonlinear expression ability and enhance the network's adaptability to complex crack morphology.
[0040] The second improved model is denoted as YOLOv11n-BC.
[0041] Reference Figure 5 , Figure 6 , Figure 7 Based on the YOLOv11n-B model, the YOLOv11n-BC model replaces the C3k2 modules in the backbone network and the C3k2 modules in each splicing module with the C3k2-Faster-CAA module.
[0042] In this embodiment, first construct Figure 7The Faster-CAA module shown includes a sequentially connected partial convolution layer P Conv, a first point-by-point convolution layer, a second point-by-point convolution layer, an attention layer and a third dimension stacking layer, and the input of the third dimension stacking layer is also connected to the input of the Faster-CAA module; the input feature map is firstly extracted with the initial features by the partial convolution layer, and then the initial features are strengthened by two point-by-point convolution layers, and the attention features are further extracted, and then the attention features are dimensionally superimposed with the input feature map and output.
[0043] In order to speed up the training and improve the accuracy of the model and avoid the problem of gradient disappearance, a batch normalization layer BN and an activation function Relu can be further set between the two point-by-point convolutional layers, so that the initial features are strengthened by the first point-by-point convolutional layer, normalized and activated, and then input into the second point-by-point convolutional layer for feature strengthening.
[0044] Partial convolution uses regular convolution on selected input channels to extract spatial features while keeping the remaining channels unchanged. Partial convolution can more effectively reduce the amount of computation and memory access, alleviating the computational burden on edge devices.
[0045] like Figure 6 As shown, the C3k2-Faster-CAA module includes a sequentially connected input convolution layer, a Split function layer, n Faster-CAA modules, a second dimension stacking layer and an output convolution layer; the second dimension stacking layer is used to perform dimension stacking on the output of the Split function layer and the output of each Faster-CAA module. n≥1.
[0046] In this way, the Faster-CAA module introduces the attention mechanism and residual branch to capture the contextual dependencies between distant pixels; through the combination of partial convolution and point-by-point convolution, the feature expression ability of the central area is enhanced.
[0047] The C3k2-Faster-CAA module enhances the interdependence between feature modeling channels and space through the nesting and residual combination of multiple Faster-CAA modules, thereby improving the processing capability of crack targets under complex backgrounds and improving detection accuracy. In subsequent specific embodiments, only one Faster-CAA module is set in the C3k2-Faster-CAA module for verification.
[0048] The improved model proposed in this embodiment may adopt PIoU, CIoU or PIoU2.
[0049] Compared with the traditional PIoU, PIoU2 (Powerful-IoU2) not only considers the position uncertainty of the crack boundary, but also adjusts the probability attenuation of the crack boundary by adjusting the factor to further capture the crack detection error caused by the complex background. PIoU2 introduces a penalty factor P that is adaptive to the target size. The penalty factor is defined as follows: ; In the formula, , , , is the absolute value of the distance between the predicted box and the corresponding edge of the target box, and represents the width and height of the target box; the denominator of the penalty factor P is only related to the size of the target box, and has nothing to do with the size of the anchor box and the minimum bounding box of the target box. This design avoids the change of the penalty factor caused by the increase in the size of the anchor box, and thus does not cause the problem of anchor box expansion; in addition, the penalty factor P will not degenerate to 0 unless the anchor box and the target box completely overlap, which ensures that it can be continuously and effectively adjusted, and P can also adapt to targets of different sizes, ensuring good performance in target detection of various sizes. The PIoU2 loss function combines the adaptive penalty factor and the attention mechanism to effectively improve the accuracy and robustness of the target detection algorithm in complex backgrounds.
[0050] The two improved models provided by the present invention are verified in combination with specific embodiments below.
[0051] In this embodiment, the original collected data set was taken by the author himself and contains three detection target categories: cracks in wooden components with complex backgrounds, wood knots, and water stains on the surface of wooden components. Data annotation uses the target detection annotation tool Labelimg to manually annotate the cracks in the collected images. In order to improve the performance and robustness of the network model, 1,200 photos were randomly cropped, translated, rotated, changed brightness, added noise and other data enhancement methods, and the wooden component crack data set was expanded to 4,482 photos, divided according to the ratio of 8:1:1, as shown in Table 1, to obtain 3,583 training sets, 449 validation sets, and 450 test sets. Data enhancement also further improves the diversity and robustness of the data set, thereby improving the generalization ability of the model in complex backgrounds.
[0052] The training set is used to train the network model, the validation set is used to verify the various indicators of the trained network model, and the test set is finally input into the network model to test the image recognition effect.
[0053]
[0054] Specifically, the model training steps are as follows: S1, extract training samples from the training set and update the model parameters based on the training samples; S2, extract verification samples from the verification set, and calculate the PIOU2 loss function of the model on the verification set; S3, determine whether the loss function converges; if not, update the model in reverse based on the loss function, and then return to step S1; if yes, end the training and fix the model.
[0055] In this implementation, after the model is fixed, the model detection accuracy is tested on the test set. The YOLOv11n-BC model is trained with the PIOU2 loss function and is recorded as the model YOLOv11n-CPB.
[0056] In order to more clearly analyze the difference in the effects of YOLOv11n-CPB and YOLOv11n in detecting cracks in wooden structures under complex backgrounds, Figure 8 As shown in the figure, the first row shows 5 randomly selected original images of wood cracks in complex backgrounds, including wood cracks on different components. The second and third rows show the detection effects of the YOLOv11n model and the improved YOLOv11n-CBP model, respectively. Figure 8 In the above, YOLOv11n fails to detect some cracks and misses detection, while YOLOv11n-CBP can accurately identify all cracks in complex backgrounds. This improvement is partly due to the C3k2-Faster-CAA module adaptively adjusting the response of each channel, which enhances the crack feature capture effect. At the same time, during the detection process, YOLOv11n has inaccurate crack detection frames and does not accurately locate the cracks well, while YOLOv11n-CBP can accurately locate cracks in complex backgrounds. The reason for this improvement is that the PIoU2 loss function effectively distinguishes crack targets from complex backgrounds through a more accurate positioning mechanism, reducing the impact of poor quality features during model training. In addition, during the detection process, YOLOv11n mistakenly identifies ground cracks in the environmental background as cracks in wooden components. However, with the help of the BiFPN-T structure and the BiCCT module, YOLOv11n-CBP effectively integrates multi-scale feature information, integrates the detailed information of cracks in wooden components in complex backgrounds and other contextual information, and achieves accurate classification. In summary, in scenes with more complex cracks, the YOLOv11n-CBP model has a more obvious advantage in detecting cracks in wooden components.
[0057] In this embodiment, YOLOv11n-CBP is further compared with various existing models shown in Table 2. The training of each model in Table 2 is as shown in the above steps S1-S3. After the training is completed, it is tested on the test set, and the test results are recorded in the following Table 2.
[0058]
[0059] As can be seen from Table 2, the YOLOv11n-CBP model proposed in this paper performs well in detecting cracks in wooden structures under complex backgrounds, especially in terms of detection accuracy, with an AP value that exceeds other models such as YOLOv5n, YOLOv7-tiny, YOLOv8n, and YOLOv10n, reaching 86.4%. This result shows that YOLOv11n-CBP can better detect cracks in wooden components under complex environments, especially in scenes with more noise and more complex backgrounds.
[0060] In addition to its advantage in accuracy, YOLOv11n-CBP also has a significant advantage in computational efficiency. The trained model is only 4.2MB, with a total of 1,827,260 parameters, which is significantly lower than other comparison models, indicating that the model optimizes computational complexity and storage requirements while maintaining high accuracy. Compared with traditional larger models, YOLOv11n-CBP can run smoothly on devices with low performance requirements, reducing dependence on high-performance hardware, which is especially important for crack detection in practical applications.
[0061] Although other models performed better in some indicators, their overall performance failed to surpass YOLOv11n-CBP. For example, YOLOv5s and YOLOv5x performed better in recall, but their higher parameter count and computational complexity resulted in more computing resources and storage space, which is not ideal for scenarios that require fast response and resource conservation. Although YOLOv5s has smaller parameters and model size than YOLOv11n-CBP, it performed poorly in key indicators such as AP and failed to meet the high-precision requirements of crack detection.
[0062] In addition, YOLOv7 and YOLOv7-tiny failed to reach the level of YOLOv11n-CBP in terms of indicators such as AP, Precision, and Recall. Especially in complex backgrounds, the recognition effect of the model on crack targets is limited.
[0063] In summary, YOLOv11n-CBP has become an ideal solution for crack detection in wooden structures under complex backgrounds due to its excellent comprehensive performance and low hardware requirements. This model not only performs well in detection accuracy, but also performs well in computational efficiency and hardware adaptability, providing strong technical support for practical applications.
[0064] The YOLOv11n-CPB model integrates the BiFPN-T structure and C3k2_faster_CAA module based on YOLOv11n, and adopts the PIOU2 loss function. In order to further analyze the specific contribution of each improvement point to the model performance, this embodiment conducts an ablation experiment on the wood component crack dataset. All experiments are completed under the same parameter settings and training environment. The ablation experiment results are shown in Table 3 and Fig.10 shown.
[0065]
[0066] The model structures of Experiments 1 and 4 are traditional YOLOv11n; the model structures of Experiments 2 and 6 are based on the traditional YOLOv11n with all C3k2 modules replaced by C3k2_faster_CAA modules; the model structures of Experiments 3 and 7 are YOLOv11n-B given in the present invention; the model structures of Experiments 5 and 8 are YOLOv11n-BC given in the present invention; Experiments 1-8 all use the above steps S1-S3 to learn on the Timber Framework dataset. The PIOU2 loss function is used during the training of Experiments 1, 2, 3, and 5, and the PIOU loss function is used during the training of Experiments 4, 6, 7, and 2.
[0067] This example uses the Precision-Recall (PR) curve to provide a detailed comparison of the performance differences of the various models in the ablation experiment for detecting cracks in wood components under complex backgrounds. When the IoU threshold is 0.5, the PR curves of the various models are as follows: Fig.10 Among them, the YOLOv11n-CBP model shown in Experiment 8 has the best detection performance in wood structure crack detection under complex background.
[0068] The results of Experiment 2 show that after replacing the C3k2 module with the C3k2-Faster-CAA module, the number of model parameters and computational complexity decreased by 8.62% and 4.76% respectively, and the model size decreased by 7.27%. This improvement is particularly prominent in the crack detection task, with Precision and AP increased by 3.6% and 10% respectively, verifying the effect of the C3k2-Faster-CAA module in reducing redundant calculations, reducing model complexity and enhancing the ability to capture crack features. Compared with Experiment 1 and Experiment 3, the precision (Precision) and AP indicators of crack detection were significantly improved after the improved BiFPN-T was incorporated into the basic model. At the same time, the number of model parameters and size decreased by 20% and 24.21% respectively. This improvement shows that BiFPN-T can better adapt to the diversity of crack morphology in complex backgrounds by optimizing feature fusion capabilities, while reducing the demand for computing resources. Compared with Experiment 1 and Experiment 4, after introducing the PIoU2 loss function, the recall rate (Recall) and AP of cracks increased by 2.2% and 3.5% respectively. It shows that PIoU2 optimizes the advantages of bounding box regression through a more accurate positioning mechanism.
[0069] From Experiment 5, we can see that after fusing the C3k2-Faster-CAA module with the BiFPN-T feature fusion network, the YOLOv11n-BC model combines the advantages of the two enhancements, and compared with Experiment 2, the precision and AP of Experiment 5 are increased by 4.5% and 0.5% respectively, while the weight and parameter volume of the model are reduced to the minimum, indicating that the model has achieved a good balance between efficient performance and computing resources. Compared with YOLOv11n-B, the precision and AP of YOLOv11n-BC are increased by 6.3% and 7.2% respectively, further verifying the synergistic effect of the two modules on improving crack detection performance.
[0070] In order to further verify the performance of the model YOLOv11n-CBP. In this embodiment, the detection accuracy of YOLOv11n and YOLOv11n-CBP on cracks, wood knots and water stains, as well as the average detection accuracy and recall rate on the three categories are further verified. The results are shown in Table 4 below.
[0071]
[0072] It can be seen that compared with the original YOLOv11n model, the improved YOLOv11n-CPB has achieved significant improvements in multiple performance indicators. Specifically, the improvements of YOLOv11n-CPB in precision (P), recall (R), mAP50 and mAP50-95 are 0.73%, 1.43%, 6.2% and 13.6% respectively. In the crack detection of wooden components under complex backgrounds, Fig.11 , Fig.12 As shown in the figure, AP increased from 70.6% to 86.4%, indicating that the average performance of the improved model at a lower IoU threshold has been significantly improved. The robustness of the model has been significantly enhanced, and it can more accurately locate and identify cracks in complex backgrounds, thereby better meeting the requirements of wood structure crack detection. In the detection tasks of wood knots and water stains, AP increased by 1.9% and 1.1% respectively. In summary, YOLOv11n-CPB maintains good detection performance within the IoU threshold range, can more clearly distinguish crack targets from background interference, and provides more reliable technical support for wood structure crack detection.
[0073] Of course, it is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, but also includes the same or similar structures that can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any reference numerals in the claims should not be regarded as limiting the claims involved.
[0074] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
[0075] The techniques, shapes, and structural parts not described in detail in the present invention are all well-known techniques.
Claims
1. A training method for a wood component crack detection model under complex background based on improved YOLOv11n, characterized in that: First, the neck network of YOLOv11n is replaced. The new neck network includes the first convolutional network, the second convolutional network, the third convolutional network, the fourth convolutional network and the first sampling network, the first splicing module, the second sampling network, the second splicing module, the third splicing module, the fifth convolutional network, the fourth splicing module, the sixth convolutional network and the fifth splicing module connected in sequence; the inputs of the first, second, third and fourth convolutional networks are respectively connected to the outputs of the four network layers from shallow to deep of the backbone network; the outputs of the first, second, third and fourth convolutional networks are respectively connected to the inputs of the third, second, fourth and fifth splicing modules; the output of the second convolutional network is also connected to the input of the third splicing module, the output of the third convolutional network is also connected to the input of the first splicing module, and the output of the fourth convolutional module is also connected to the input of the first sampling network; the output of the first splicing module is also connected to the input of the fourth splicing module; then the improved model is allowed to perform machine learning on a dataset of images of wooden components with cracks marked.
2. The training method of the wood component crack detection model under complex background based on improved YOLOv11n as claimed in claim 1, characterized in that: The first splicing module, the second splicing module, the third splicing module, the fourth splicing module and the fifth splicing module have the same structure, and are all composed of weighted splicing units BiCCT and C3k2 modules connected front and back; BiCCT includes a sequentially connected Triplet Attention layer, a Concat-T layer, a first dimension superposition layer and an activation layer; the first dimension superposition layer dimensionally superimposes the output of the Concat-T layer and the input of the BiCCT.
3. The training method of the wood component crack detection model under complex background based on improved YOLOv11n as claimed in claim 2, characterized in that: Improvements to YOLOv11n also include: the C3k2 module in the splicing module is replaced by the C3k2-Faster-CAA module, which includes a sequentially connected input convolution layer, a Split function layer, one or more Faster-CAA modules, a second dimension overlay layer, and an output convolution layer; the second dimension overlay layer is used to perform dimensional overlay on the output of the Split function layer and the output of each Faster-CAA module; the Faster-CAA module introduces an attention mechanism and a residual branch to capture contextual dependencies between distant pixels.
4. The training method of the wood component crack detection model under complex background based on improved YOLOv11n as claimed in claim 3 is characterized in that: The Faster-CAA module includes a sequentially connected partial convolution layer, a first point-by-point convolution layer, a second point-by-point convolution layer, an attention layer, and a third dimension stacking layer. The input of the third dimension stacking layer is also connected to the input of the Faster-CAA module.
5. The training method of the wood component crack detection model under complex background based on improved YOLOv11n as claimed in claim 3, characterized in that: The C3k2 module in the backbone network is replaced by the C3k2-Faster-CAA module.
6. The training method for the wood component crack detection model under complex background based on improved YOLOv11n as claimed in claim 1, characterized in that: The input of the first convolutional network is connected to the 3rd layer of the backbone network, the input of the second convolutional network is connected to the 5th layer of the backbone network, the input of the third convolutional network is connected to the 7th layer of the backbone network, and the input of the fourth convolutional network is connected to the 11th layer of the backbone network.
7. The training method for a wood component crack detection model under complex background based on improved YOLOv11n according to any one of claims 1 to 6, characterized in that: The loss function used in the model training process is PIoU2 loss.
8. A method for detecting cracks in wooden components using the training method for the wooden component crack detection model under complex background based on improved YOLOv11n as claimed in any one of claims 1 to 7, characterized in that: A crack detection model is obtained by adopting the training method of the wood component crack detection model under complex background based on the improved YOLOv11n as described in any one of claims 1 to 7; taking a photo of the wood component to be detected, and inputting the photo into the crack detection model.
9. The method for detecting cracks in wooden components under complex backgrounds based on improved YOLOv11n as claimed in claim 8, characterized in that: The photos of the wood components to be inspected are enhanced and then input into the crack detection model for processing.
10. A wood component crack detection system, characterized in that: It includes a memory and a processor, the memory stores a computer program, the processor is connected to the memory, and the processor is used to execute the computer program to implement the method for detecting cracks in wooden components under complex backgrounds based on improved YOLOv11n as described in claim 8 or 9.
Citation Information
Patent Citations
Gap detection method and system based on YOLOv7 optimization and storage medium
CN117237312A
Bird target detection method based on deep learning
CN118470483A
Insect detection method and system under complex background based on deep learning feature enhancement
CN119229476A
X-ray security check image dangerous goods detection system based on improved YOLOv11
CN119624939A
Method of using deep discriminate network model for person re-identification in image or video
US20210150268A1
Cited By
Pedestrian detection method and system for coping with automatic driving under complex background influence
CN120032429A