A method, system and storage medium for locating surface defects in wood

By employing a lightweight backbone network with multi-scale Retinex illumination equalization preprocessing and collaborative attention mechanism, combined with an adaptive bidirectional feature pyramid network and dynamic anchor box regression algorithm, the problem of high-precision localization of minute defects on wood surfaces was solved, enabling real-time detection on edge computing devices.

CN123181569APending Publication Date: 2026-11-27HEZE HENGDELI WOOD IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611376041.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing deep learning detection models have a large number of parameters and high computational complexity, making it difficult to achieve real-time processing on edge devices with limited computing resources. Furthermore, they lack the ability to extract features when faced with minor defects on the wood surface, resulting in low positioning accuracy and inaccurate bounding box regression.

Method used

A lightweight backbone network combining multi-scale Retinex adaptive illumination equalization preprocessing with a collaborative attention mechanism is adopted. Multi-scale features are fused through an adaptive bidirectional feature pyramid network cascade, and a dynamic anchor box regression algorithm is used for high-precision defect localization. The TensorRT acceleration engine is integrated to optimize the model.

Benefits of technology

While ensuring the real-time operation of the detection system, it significantly improves the feature capture capability of multi-scale and minute defects, realizes high-precision wood surface defect localization, reduces computational overhead, and meets the real-time deployment requirements of edge computing terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123181569A_ABST
    Figure CN123181569A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of wood surface defect positioning method, system and storage medium, it is related to wood processing and intelligent detection technical field, including: obtaining the original image of wood surface to be detected and carries out adaptive light equalization pretreatment;Through the backbone network of introducing collaborative attention mechanism, multi-scale defect feature map is extracted;Using adaptive bidirectional feature pyramid network, the multi-scale feature cascade fusion of feature map is carried out, and enhanced feature map is generated;The enhanced feature map is input into decoupling detection head, and the boundary box coordinates of wood surface defect are calculated using dynamic anchor frame regression algorithm, and the defect class is determined in combination with classifier.This application can effectively eliminate the influence of uneven light on wood image quality under complex environment, significantly enhance the capture sensitivity of small and hidden defect features, improve the positioning accuracy of multi-scale wood defects under the premise of ensuring real-time operation of algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wood processing and intelligent detection technology, and in particular to a method, system and storage medium for locating defects on the wood surface. Background Technology

[0002] Timber, as a natural and renewable resource, is widely used in industries such as construction, furniture, and papermaking. However, due to the influence of various factors such as natural environment, climate, and processing techniques during its growth, harvesting, and processing, timber inevitably develops various types of defects on its surface, such as dead knots, live knots, cracks, wormholes, pith spots, and discoloration. These defects not only severely affect the appearance quality of the timber but also significantly reduce its mechanical strength and service life. Therefore, accurate detection and location of surface defects in timber are crucial for its intensive processing and efficient utilization.

[0003] In traditional timber processing production lines, the detection of surface defects in timber mainly relies on manual visual inspection. This manual inspection method is not only labor-intensive and inefficient, but also highly susceptible to the subjective experience, fatigue levels, and ambient lighting conditions of the inspectors, leading to high rates of missed and false detections, making it difficult to meet the real-time and high-precision requirements of modern large-scale production. With the development of computer vision and digital image processing technologies, traditional machine vision methods are increasingly being applied to timber defect detection. These methods typically employ median filtering, edge detection, and threshold segmentation to extract defect features, and then combine them with classifiers such as support vector machines or decision trees for defect identification. However, in actual working conditions, the surface texture of timber is extremely complex and inherently random. Uneven lighting, shadow interference, and the irregular shapes and small sizes of defects themselves make traditional machine vision methods based on manually designed features prone to misjudgment, making it difficult to accurately locate small and hidden defects.

[0004] In recent years, deep learning technology has made groundbreaking progress in the field of object detection, and wood defect detection methods based on deep neural networks have been proposed one after another. However, existing deep learning detection models have a large number of parameters and high computational complexity, making it difficult to achieve real-time processing on edge detection devices with limited computing resources. At the same time, existing methods are insufficient in feature extraction when dealing with small defects on the wood surface and defects that are highly similar to the background texture, easily losing key spatial location information, resulting in low localization accuracy and inaccurate bounding box regression. Therefore, how to improve the feature capture capability for multi-scale and small defects while ensuring the real-time operation of the detection system, and achieve rapid and high-precision localization of wood surface defects, is the main technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] To address the aforementioned issues, this application provides a method, system, and storage medium for locating defects on the wood surface.

[0006] This application provides a method for locating defects on the surface of wood, employing the following technical solution: A method for locating defects on the surface of wood includes the following steps: S1: Acquire the original image of the wood surface to be detected, and perform adaptive illumination equalization preprocessing on the original image to obtain a preprocessed image; S2: Input the preprocessed image into a pre-constructed lightweight feature extraction network, and extract multi-scale defect feature maps by introducing a backbone network with a collaborative attention mechanism; S3: Use an adaptive bidirectional feature pyramid network to perform multi-scale feature concatenation and fusion on the multi-scale defect feature map to generate an enhanced feature map; S4: Input the enhanced feature map into the decoupled detection head, use the dynamic anchor frame regression algorithm to calculate the bounding box coordinates of the wood surface defects, and combine it with the classifier to determine the defect category to achieve defect localization.

[0007] By adopting the above technical solution, the interference of ambient light on defect recognition is eliminated by acquiring wood images and performing illumination preprocessing; a lightweight backbone network incorporating a collaborative attention mechanism is used for feature extraction, which enhances the ability to capture key defect features while reducing computational load; then, multi-scale features are cascaded and fused through an adaptive bidirectional feature pyramid network to strengthen the feature expression of minor defects; finally, a decoupled detection head and a dynamic anchor box regression algorithm are used to achieve high-precision defect localization and classification, ensuring detection accuracy and real-time performance under complex wood surface textures.

[0008] Optionally, step S1 involves performing adaptive illumination equalization preprocessing on the original image, specifically including: The brightness component of the original image is estimated using the multi-scale Retinex algorithm. The calculation formula is as follows:

[0009] in, For the original image, The reflection properties of a reflecting object, i.e., the preprocessed image. For the first Gaussian filter function of scale For the first Weighting coefficients for each scale Let the total number of scales be , and satisfy the following condition: .

[0010] By adopting the above technical solution, the multi-scale Retinex algorithm recovers the true reflectivity of the wood surface from Gaussian blurred images of different scales, effectively reducing overexposure and loss of dark details caused by uneven lighting, shadows or reflections on the wood surface, and enhancing the contrast between defects and background textures.

[0011] Optionally, the collaborative attention mechanism introduced in the backbone network in step S2 includes embedding spatial attention channels and channel attention channels in the residual structure of the lightweight backbone network, obtaining channel descriptors through global average pooling and global max pooling, realizing cross-channel interaction through one-dimensional convolution, generating channel weights through the Sigmoid activation function, and multiplying the channel weights with the input feature map to realize feature reconstruction in the channel domain.

[0012] By adopting the above technical solution, the introduction of a collaborative attention mechanism can guide the feature extraction network to focus on the salient areas where wood defects are located, suppress complex wood background texture noise, and improve the sensitivity of capturing small and hidden defect features while keeping the network lightweight.

[0013] Optionally, step S3 utilizes an adaptive bidirectional feature pyramid network for multi-scale feature cascade fusion, specifically including: A bidirectional path aggregation structure, employing both top-down and bottom-up approaches, is adopted. Learnable weight parameters are introduced into the lateral connections of feature fusion to perform weighted fusion of feature maps at different levels. The calculation formula for the weighted fusion is as follows:

[0014] in, To output the feature map, For the input of the first Layer feature map, and The non-negative weight parameters are learnable. It is a very small positive number to avoid the denominator being zero.

[0015] By adopting the above technical solution, dynamic weighted fusion of feature maps of different resolutions is performed through learnable weight parameters, which effectively solves the problem of information loss caused by simple splicing or addition of traditional feature pyramids, and greatly preserves the positional details in low-level features and the semantic information in high-level features.

[0016] Optionally, step S4 uses a dynamic anchor frame regression algorithm to calculate the bounding box coordinates of the wood surface defects, specifically including: Based on the initial anchor box predicted for each pixel on the feature map, the intersection-over-union (IoU) ratio between the anchor box and the ground truth defect box is calculated. A dynamic unbiased anchor box selection strategy is used to filter out positive sample anchor boxes, and the CIoU loss function is applied for bounding box regression optimization. The formula for calculating the CIoU loss function is as follows:

[0017] in, and These represent the center points of the predicted bounding box and the ground truth bounding box, respectively. For Euclidean distance, The diagonal length of the smallest closure region that can simultaneously contain both predicted and ground truth boxes. Used to measure the consistency of aspect ratio. These are the weight parameters.

[0018] By adopting the above technical solutions, the dynamic unbiased anchor box selection strategy can dynamically match the best positive sample according to the actual aspect ratio and scale of the defect. The CIoU loss function accelerates the convergence speed of the bounding box by introducing multiple geometric constraints such as overlapping area, center point distance and aspect ratio, and significantly improves the positioning accuracy of multi-scale defects.

[0019] This application also provides a wood surface defect location system, the system comprising: The image acquisition and preprocessing module is used to acquire the original image of the wood surface to be detected, and to perform adaptive illumination equalization preprocessing on the original image to obtain a preprocessed image. The multi-scale feature extraction module is used to input the preprocessed image into a preset lightweight feature extraction network, and extract multi-scale defect feature maps by introducing a backbone network with a collaborative attention mechanism. The feature concatenation and fusion module is used to perform multi-scale feature concatenation and fusion on the multi-scale defect feature map using an adaptive bidirectional feature pyramid network to generate an enhanced feature map. The defect localization and classification module is used to input the enhanced feature map into the decoupled detection head, use the dynamic anchor frame regression algorithm to calculate the bounding box coordinates of the defects on the wood surface, and combine the classifier to determine the defect category to achieve defect localization.

[0020] By adopting the above technical solution, the positioning method is integrated into the system module. The modules work together to realize the pipeline-style closed-loop processing of wood surface images from acquisition, preprocessing, feature extraction and fusion to defect classification and positioning, ensuring the stability and efficiency of industrial field deployment.

[0021] Optionally, the image acquisition and preprocessing module includes: An industrial computer, and an industrial camera and an LED line light source electrically connected to the industrial computer; The LED line light source is arranged at an inclined angle relative to the conveyor line of the wood to be inspected, so as to form a uniform illumination field on the wood surface; the industrial camera is used to capture high-definition images of the wood surface and transmit them to the industrial control computer for adaptive illumination equalization preprocessing.

[0022] By adopting the above technical solution, and using obliquely arranged LED line light sources in conjunction with high-speed industrial cameras, projection and reflection can be minimized, providing high-quality, high-contrast raw data for subsequent image processing and improving the system's environmental adaptability.

[0023] Optionally, the defect localization and classification module is equipped with a TensorRT acceleration engine, which is used to perform model pruning, quantization and layer fusion optimization on the lightweight feature extraction network, the adaptive bidirectional feature pyramid network and the decoupled detection head, so as to improve the computational inference speed at the edge computing end.

[0024] By adopting the above technical solution and using the TensorRT acceleration engine to optimize the deep learning model, the inference latency and power consumption of the model on edge devices are reduced, enabling complex neural network models to meet the real-time detection requirements of embedded devices in industrial production lines.

[0025] This application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of a method for locating defects on the surface of wood.

[0026] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a method for locating defects on a wood surface.

[0027] In summary, this application includes at least one of the following beneficial technical effects: By employing multi-scale Retinex adaptive illumination equalization preprocessing and combining it with a lightweight backbone network that incorporates a collaborative attention mechanism, we achieved the effect of effectively eliminating interference from complex lighting changes and wood background textures in industrial settings, significantly improving the ability to capture minute defect features, and significantly enhancing detection sensitivity while maintaining extremely low computational overhead. By adopting an adaptive bidirectional feature pyramid weighted fusion scheme and a CIoU-based dynamic anchor box regression algorithm, the dynamic weighting can accurately preserve multi-scale spatial information, and the CIoU loss introduces multiple geometric constraints such as aspect ratio, resulting in higher positioning accuracy, faster and more stable bounding box regression, and easier real-time deployment on the edge computing side. Attached Figure Description

[0028] Figure 1This is a flowchart of a method for locating defects on the surface of wood.

[0029] Figure 2 This is a flowchart of the multi-scale Retinex adaptive preprocessing process.

[0030] Figure 3 It is a residual structure diagram incorporating a collaborative attention mechanism.

[0031] Figure 4 This is a schematic diagram of the hardware layout of a wood surface defect location system.

[0032] Explanation of reference numerals in the attached diagram: 1. Conveyor line; 2. Industrial camera; 3. LED line light source; 4. Industrial control computer. Detailed Implementation

[0033] The present application will be further described in detail below with reference to all the accompanying drawings.

[0034] This application discloses a method for locating defects on the surface of wood.

[0035] Reference Figures 1 to 3 A method for locating defects on the surface of wood, comprising: Step S1: Obtain the original image of the wood surface to be detected, and perform adaptive illumination equalization preprocessing on the original image to obtain the preprocessed image; In practice, an image acquisition device installed above the timber conveyor line captures high-resolution images of the timber surface. This device includes an industrial camera and LED line light sources. For example, the industrial camera could be a Daheng Imaging MER-503-36U3M monochrome industrial camera or a Hikvision MV-CA050-11UM area array industrial camera. The LED line light sources are symmetrically arranged at an angle of 45° to 60° relative to the timber surface; suitable models include the Opt-LISS300-W high-uniformity white strip light source or the WDP-LSS300-W white strip light source.

[0036] Obtain the original image Subsequently, due to uneven lighting distribution or differences in wood reflectivity, images are prone to glare or localized shadows. Therefore, the multi-scale Retinex (MSR) algorithm is used for adaptive illumination equalization. The specific steps are as follows: First, calculate the single-scale Retinex, using the following formula: In this context, "*" represents a convolution operation. For the first The expression for the Gaussian filter function with multiple scales is:

[0037] In the Gaussian filter function mentioned above, Represents the two-dimensional coordinates of a pixel. It is the first The Gaussian filter radius, also known as the scale space factor, is used to control the degree of blurring in an image. It is a normalization constant and must satisfy the condition that the double integral value is 1.

[0038] The multi-scale Retinex algorithm weights and sums the reflectance properties at different scales to obtain an adaptive illumination equalization preprocessed image. : Among them, the total number of scales The value is set to 3, and the corresponding three scale space factors are respectively set to values ​​of 3. =15、 =80、 =250. Weighting coefficient Set as follows =0.3、 =0.4、 =0.3, and satisfies .

[0039] By using the multi-scale Retinex algorithm, low-frequency lighting backgrounds in the image were filtered out, while high-frequency edges and texture details representing wood defects were preserved and enhanced, resulting in a pre-processed image with significantly improved contrast.

[0040] Step S2: Input the preprocessed image into a pre-built lightweight feature extraction network, and extract multi-scale defect feature maps by introducing a backbone network with a collaborative attention mechanism; The lightweight backbone network is an improvement on the MobileNetV3 network architecture. To enhance the representation of minute defects with extremely low computational overhead, a collaborative attention mechanism is embedded after the channel transition layer of the InvertedResidualBlock in the backbone network.

[0041] The collaborative attention mechanism reconstructs features through two dimensions: spatial and channel-based. For the input intermediate feature map... (Where C is the number of channels, and H and W are the height and width, respectively), the feature map is first processed through a channel attention branch. To capture cross-channel interaction information without significantly increasing the number of parameters, global average pooling (GAP) and global max pooling (GMP) are used to compress the spatial dimensions of the feature map to obtain channel descriptors. The two pooled vectors are then added together, and one-dimensional convolution (1D Convolution) is used to achieve local cross-channel interaction, with the following formula:

[0042] in, This represents a one-dimensional convolution with a kernel size of k, where the size of k is adaptively correlated with the number of channels C. , here b=1. It is the Sigmoid activation function. For adaptively generated channel weights. and Multiplication enables channel domain reconstruction features .

[0043] In the spatial attention branch, for Perform average pooling and max pooling along the channel axis, then concatenate the compressed 2D feature maps from the two channels, using a size of [missing value]. The two-dimensional convolution is mapped, and a spatial weight map is generated by activation using the Sigmoid function. :

[0044] in, This represents a convolution operation with a kernel size of 7. This indicates a splicing operation. Ultimately, it will... and Multiplying these results in the reconstructed feature map. The backbone network outputs multi-scale defect feature maps with resolutions of 1 / 8, 1 / 16, and 1 / 32 in stages 3, 4, and 5, respectively, denoted as [missing information]. , , .

[0045] Step S3: Use an adaptive bidirectional feature pyramid network to perform multi-scale feature cascade fusion on the multi-scale defect feature map to generate an enhanced feature map; Multi-scale defect feature map , , The input adaptive bidirectional feature pyramid network (BiFPN) has bidirectional paths from top to bottom and bottom to top. In the lateral connections, nodes with only one input or output are removed, and a jump connection from the original input to the output node is added.

[0046] Because multi-scale features have different resolutions during fusion, their contribution to defect localization also varies. This embodiment uses dynamic weighted feature fusion, and the calculation formula is as follows:

[0047] in, This represents the j-th input feature map at the fusion node. The output feature map; and These are the non-negative weight parameters obtained by the network through adaptive learning via the backpropagation algorithm. The value is an extremely small positive number, set to 0.0001, to prevent the denominator from being zero. Through the above adaptive dynamic weighted fusion, BiFPN can automatically adjust the ratio of high- and low-level features according to the guidance of the loss function, and output an enhanced feature map containing rich spatial location details and semantic information.

[0048] Step S4: Input the enhanced feature map into the decoupled detection head, use the dynamic anchor frame regression algorithm to calculate the bounding box coordinates of the wood surface defects, and combine it with the classifier to determine the defect category to achieve defect localization.

[0049] Traditional detection heads typically place classification and localization tasks in the same convolutional layer for prediction, which can easily lead to feature conflicts. This application employs a decoupled detection head, inputting the enhanced feature maps separately into parallel classification and regression branches.

[0050] In the regression branch, a dynamic unbiased anchor box selection strategy is applied. For each defect target, the top M best anchor boxes are dynamically selected as positive samples based on the intersection-over-union (IoU) ratio between the predicted bounding box and the ground truth defect box.

[0051] To improve the accuracy and speed up convergence of bounding box regression, the CIoU (Complete Intersection over Union) loss function is used. The CIoU loss function considers the overlap area, center point distance, and aspect ratio simultaneously, and its calculation formula is as follows:

[0052] Wherein, IoU represents the intersection-union ratio between the predicted bounding box and the ground truth bounding box. and These represent the center coordinates of the predicted bounding box and the ground truth bounding box, respectively. This indicates the calculation of the Euclidean distance between two points. c is the diagonal length of the smallest closure region that can simultaneously contain both the predicted and ground truth boxes.

[0053] The variable v is used to measure the consistency between the aspect ratio of the predicted bounding box and the ground truth bounding box, and its calculation formula is:

[0054] in, and These represent the width and height of the actual bounding box, respectively. and These represent the width and height of the prediction box, respectively.

[0055] coefficient The weighting parameters used to balance the loss from non-overlapping regions and the loss from aspect ratio consistency are defined as follows:

[0056] By minimizing The loss function allows the network to dynamically adjust the center point position and aspect ratio of the predicted bounding box, outputting the precise bounding box coordinates of the defect. Meanwhile, the classification branch outputs the category label and corresponding confidence score of the wood surface defect through the Softmax classifier, thereby achieving accurate location and classification of the defect.

[0057] The working principle of the wood surface defect localization method in this application embodiment is as follows: The acquired original image is processed using a multi-scale Retinex algorithm. This process decomposes the original image into reflection and incident components. By filtering out the incident component, which represents changes in illumination, the interference of uneven lighting, reflections, and shadows in the industrial environment on the wood image background is eliminated, improving defect contrast. Next, the preprocessed image is fed into a backbone network integrating a collaborative attention mechanism. This attention mechanism reconstructs the feature map in both spatial and channel dimensions, enabling the network to automatically suppress background wood grain interference, focus on the defect area, and extract highly discriminative multi-scale features. Subsequently, an adaptive bidirectional feature pyramid network (BiFPN) is used to dynamically fuse multi-scale features through learnable weight parameters. This preserves the high-resolution texture location in shallow features while incorporating strong semantic information from deep features. Finally, based on a decoupled detection head, a geometric constraint mechanism including overlapping area, center distance, and aspect ratio is established using a dynamic unbiased anchor box selection strategy and a CIoU loss function. This guides the bounding box to converge quickly and accurately to the true defect boundary, achieving high-precision defect localization.

[0058] Reference Figure 4 This application also discloses a wood surface defect localization system for performing a wood surface defect localization method. The system includes: The image acquisition and preprocessing module is used to acquire the original image of the wood surface to be inspected, and to perform adaptive illumination equalization preprocessing on the original image to obtain the preprocessed image. The multi-scale feature extraction module is used to input the preprocessed image into a preset lightweight feature extraction network, and extract multi-scale defect feature maps by introducing a backbone network with a collaborative attention mechanism. The feature concatenation and fusion module is used to perform multi-scale feature concatenation and fusion on multi-scale defect feature maps using an adaptive bidirectional feature pyramid network to generate enhanced feature maps. The defect localization and classification module is used to input the enhanced feature map into the decoupled detection head, use the dynamic anchor frame regression algorithm to calculate the bounding box coordinates of the defects on the wood surface, and combine the classifier to determine the defect category to achieve defect localization.

[0059] In practical implementation, the physical topology and connection relationships of the system are as follows: The image acquisition and preprocessing module includes an industrial computer 4, an industrial camera 2 electrically connected to the industrial computer 4 via a USB 3.0 or Gigabit Ethernet interface, and an LED line light source 3 connected to the industrial computer 4 via a serial port through a light source controller. The industrial computer 4 acts as the core processing terminal, receiving images acquired by the industrial camera 2 and running preprocessing programs.

[0060] The multi-scale feature extraction module, feature cascade fusion module, and defect localization and classification module are deployed in the industrial control computer 4 as algorithm software. As an example of the performance characteristics of the computing chip (hardware platform), the industrial control computer 4 is equipped with an edge computing chip, which can be either the NVIDIA Jetson Orin Nano development kit (8GB version) or the NVIDIA Jetson Xavier NX edge computing module.

[0061] To improve the system's detection efficiency on industrial production lines, a TensorRT acceleration engine is deployed in the defect localization and classification module. After training, the model is exported in ONNX format and converted into an optimized inference engine using TensorRT. As an example of model quantization accuracy, FP16 (half-precision floating-point) quantization or INT8 (8-bit integer) quantization can be used. Through layer fusion, memory optimization, and quantization acceleration, the inference latency per image is reduced to less than 15ms while maintaining localization accuracy, fully meeting the requirements of real-time online detection.

[0062] The working principle of the wood surface defect localization system in this embodiment is as follows: An industrial control computer (ICC) 4 controls an LED line light source 3 and an industrial camera 2 to work synchronously, continuously scanning the wood on the conveyor line 1. Images captured by the industrial camera 2 are transmitted in real-time to the memory of the ICC 4. The image acquisition and preprocessing module calls a multi-scale Retinex algorithm to quickly denoise the images. The processed images are then fed into an edge computing chip, where a multi-scale feature extraction module, a feature cascade fusion module, and a defect localization and classification module run on a GPU hardware accelerator. Spatial semantic features of the defects are extracted using a convolutional neural network incorporating an attention mechanism and an adaptive feature fusion algorithm. Subsequently, a decoupled detection head, accelerated and optimized by TensorRT, completes defect category probability calculation and CIoU-based dynamic anchor box bounding box regression in a very short time, generating localization results. Finally, the ICC 4 transmits the defect location coordinates, size, and category to the lower-level execution mechanism for the removal or grading of defective wood, achieving automatic, real-time closed-loop localization and detection.

[0063] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.

Claims

1. A method for locating defects on the surface of wood, characterized in that, Includes the following steps: S1: Acquire the original image of the wood surface to be detected, and perform adaptive illumination equalization preprocessing on the original image to obtain a preprocessed image; S2: Input the preprocessed image into a pre-constructed lightweight feature extraction network, and extract multi-scale defect feature maps by introducing a backbone network with a collaborative attention mechanism; S3: Use an adaptive bidirectional feature pyramid network to perform multi-scale feature concatenation and fusion on the multi-scale defect feature map to generate an enhanced feature map; S4: Input the enhanced feature map into the decoupled detection head, use the dynamic anchor frame regression algorithm to calculate the bounding box coordinates of the wood surface defects, and combine it with the classifier to determine the defect category to achieve defect localization.

2. The method for locating defects on the surface of wood according to claim 1, characterized in that: The adaptive illumination equalization preprocessing of the original image in step S1 specifically includes: The brightness component of the original image is estimated using the multi-scale Retinex algorithm. The calculation formula is as follows: ; in, For the original image, The reflection properties of a reflecting object, i.e., the preprocessed image. For the first Gaussian filter function of scale For the first Weighting coefficients for each scale Let the total number of scales be , and satisfy the following condition: .

3. The method for locating defects on the surface of wood according to claim 1, characterized in that: The collaborative attention mechanism introduced in the backbone network in step S2 includes embedding spatial attention channels and channel attention channels in the residual structure of the lightweight backbone network, obtaining channel descriptors through global average pooling and global max pooling, realizing cross-channel interaction through one-dimensional convolution, generating channel weights through the Sigmoid activation function, and multiplying the channel weights with the input feature map to realize feature reconstruction of the channel domain.

4. The method for locating defects on the surface of wood according to claim 1, characterized in that: Step S3 utilizes an adaptive bidirectional feature pyramid network for multi-scale feature cascade fusion, specifically including: A bidirectional path aggregation structure, employing both top-down and bottom-up approaches, is adopted. Learnable weight parameters are introduced into the lateral connections of feature fusion to perform weighted fusion of feature maps at different levels. The calculation formula for the weighted fusion is as follows: ; in, To output the feature map, For the input of the first Layer feature map, and The non-negative weight parameters are learnable. It is a very small positive number to avoid the denominator being zero.

5. The method for locating defects on the surface of wood according to claim 1, characterized in that: Step S4 uses a dynamic anchor frame regression algorithm to calculate the bounding box coordinates of wood surface defects, specifically including: Based on the initial anchor box predicted for each pixel on the feature map, the intersection-over-union (IoU) ratio between the anchor box and the ground truth defect box is calculated. A dynamic unbiased anchor box selection strategy is used to filter out positive sample anchor boxes, and the CIoU loss function is applied for bounding box regression optimization. The formula for calculating the CIoU loss function is as follows: ; in, and These represent the center points of the predicted bounding box and the ground truth bounding box, respectively. For Euclidean distance, The diagonal length of the smallest closure region that can simultaneously contain both predicted and ground truth boxes. Used to measure the consistency of aspect ratio. These are the weight parameters.

6. A system for locating defects on the surface of wood, characterized in that, The system for performing the wood surface defect localization method according to any one of claims 1 to 5, the system comprising: The image acquisition and preprocessing module is used to acquire the original image of the wood surface to be detected, and to perform adaptive illumination equalization preprocessing on the original image to obtain a preprocessed image. A multi-scale feature extraction module is used to input the preprocessed image into a preset lightweight feature extraction network, and extract multi-scale defect feature maps by introducing a backbone network with a collaborative attention mechanism. The feature concatenation and fusion module is used to perform multi-scale feature concatenation and fusion on the multi-scale defect feature map using an adaptive bidirectional feature pyramid network to generate an enhanced feature map. The defect localization and classification module is used to input the enhanced feature map into the decoupled detection head, use the dynamic anchor frame regression algorithm to calculate the bounding box coordinates of the defects on the wood surface, and combine the classifier to determine the defect category to achieve defect localization.

7. A wood surface defect location system according to claim 6, characterized in that, The image acquisition and preprocessing module includes: An industrial computer (4), and an industrial camera (2) and an LED line light source (3) electrically connected to the industrial computer (4); The LED line light source (3) is arranged at an inclined angle relative to the conveyor line (1) of the wood to be tested, so as to form a uniform illumination field on the surface of the wood; the industrial camera (2) is used to capture high-definition images of the wood surface and transmit them to the industrial control computer (4) for adaptive illumination equalization preprocessing.

8. A wood surface defect location system according to claim 6, characterized in that, The defect localization and classification module is equipped with a TensorRT acceleration engine, which is used to perform model pruning, quantization, and layer fusion optimization on the lightweight feature extraction network, the adaptive bidirectional feature pyramid network, and the decoupled detection head, so as to improve the computational inference speed at the edge computing end.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1 to 5.