Plywood defect detection method and system combined with visual analysis

The method integrates visual analysis and machine learning to improve glued board defect detection accuracy and efficiency, addressing inefficiencies in traditional manual inspection and enhancing industrial production quality.

CN120318210APending Publication Date: 2025-07-15JIANGSU MBOTE KITCHEN & BATH CO LTD

Patent Information

Application Number
CN202510498602.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

Traditional manual detection of plywood defects is inefficient and susceptible to subjective factors. The existing visual analysis and detection accuracy are insufficient and poor adaptability are difficult to meet the needs of industrial large-scale production.

Method used

An industrial camera was used to take plywood surface images, and combined image preprocessing and machine learning-based Fast R-CNN network structure to build a plywood surface defect detection model. Through grayscale conversion, filtering noise reduction and image enhancement, the defects of plywood after sanding were identified.

Benefits of technology

It improves the accuracy and efficiency of plywood defect detection, adapts to different types of defects, avoids mechanical damage, reduces waste rate, and realizes automated and efficient defect detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318210A_ABST
    Figure CN120318210A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of material detection, in particular to a plywood defect detection method and system combined with visual analysis, and the method comprises the steps: after to-be-detected plywood is sanded, an industrial camera is adopted to shoot the surface of the plywood to obtain a surface image of the to-be-detected plywood; carrying out image preprocessing on the obtained surface image of the plywood to be detected, wherein the image preprocessing comprises gray level conversion, filtering noise reduction and image enhancement; a plywood surface defect detection model based on machine learning is constructed, plywood surface defect image samples are collected and marked to serve as training data to train the model; and after model training is completed, inputting a to-be-detected plywood surface image after image preprocessing into the model for plywood defect detection, and outputting a detection result. According to the plywood defect detection method combining visual analysis and machine learning, the surface defects of the plywood are accurately detected, the detection efficiency of the plywood defects is improved, and the product quality is improved while the production process is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of material detection, and particularly to a plywood defect detection method and system combining visual analysis. Background Art

[0002] In the process of plywood production, defects such as sanding marks, uneven board surfaces, glue spots, torn wood fibers, and sandpaper residues often appear after the plywood has been sanded, seriously affecting its quality and service performance. The traditional manual detection method is inefficient, the detection results are easily affected by subjective factors, and it is easy to miss detections, making it difficult to meet the requirements of industrial large-scale production. With the development of computer vision technology, it has become possible to use visual analysis combined with artificial intelligence technology for defect detection. However, the current detection technology for plywood has technical problems such as insufficient detection accuracy, low detection efficiency, and poor adaptability in the detection of different types of plywood defects. Summary of the Invention

[0003] In view of the above technical deficiencies, the present invention provides a plywood defect detection method and system combining visual analysis to improve the accuracy and efficiency of plywood defect detection after sanding.

[0004] The present invention is achieved through the following technical solutions:

[0005] A plywood defect detection method combining visual analysis is provided, and the method includes the following steps:

[0006] Step S10: After the plywood to be tested has been sanded, an industrial camera is used to capture an image of the surface of the plywood to obtain an image of the surface of the plywood to be tested;

[0007] Step S20: Perform image preprocessing on the obtained image of the surface of the plywood to be tested, including grayscale conversion, filtering and noise reduction, and image enhancement;

[0008] Step S30: Construct a plywood surface defect detection model based on machine learning, collect plywood surface defect image samples and perform annotation as training data to train the model;

[0009] Step S40: After the model training is completed, input the image of the surface of the plywood to be tested that has undergone image preprocessing into the model for plywood defect detection, and output the detection result;

[0010] The step S10 is carried out on the production line in the plywood production process. By setting a plywood surface image shooting area on the production line, when the plywood to be tested reaches the image shooting area through the conveyor, the conveyor stops running for 1 s. An industrial camera is installed above the plywood production line to ensure that the camera lens is perpendicular to the plywood surface and the distance from the plywood surface remains fixed. The industrial camera vertically shoots the surface image of the plywood to be tested from above. A surround - type LED backlight is installed around the industrial camera to evenly illuminate the surface of the plywood to be tested.

[0011] Preferably, in the step S10, when the plywood to be tested reaches the image shooting area through the conveyor, the conveyor stops running for 1 s, which is achieved by installing a pressure sensor under the conveyor in the image shooting area. When the plywood to be tested reaches the image shooting area through the conveyor, the pressure sensor detects the change in the pressure it receives and transmits the pressure change to the micro - processor. The micro - processor sends a braking instruction to the conveyor drive motor to stop the conveyor. At the same time, a timer is built into the micro - processor. After the timing reaches 1 s, the micro - processor sends a running instruction to the conveyor drive motor to make the conveyor continue running.

[0012] Preferably, in the step S10, the pixels of the industrial camera are not less than 5 million pixels, and the surface image of the plywood to be tested taken is a lossless image with a 2k resolution. When the industrial camera takes pictures, it automatically adjusts the focal length and aperture of the camera according to the clarity of the surface image of the plywood to be presented. For example, for plywood with a common specification of 1220 mm×2440 mm, a lens with a focal length of 12 - 16 mm is selected.

[0013] Preferably, the steps of image pre - processing the obtained surface image of the plywood to be tested in the step S20 include:

[0014] Gray - scale conversion: The obtained surface image of the plywood to be tested is gray - scaled. The weighted average method is used, and the calculation formula is shown in Equation (1):

[0015] Y = 0.299R + 0.587G + 0.114B (1)

[0016] Where R, G, and B are the pixel values of the red, green, and blue channels respectively. For the obtained surface image of the plywood to be tested, its color is represented by the pixel values of the red, green, and blue channels. Y is the gray - scale value after weighted average conversion. After traversing each pixel point in the surface image of the plywood to be tested, a gray - scale image corresponding to the surface image of the plywood to be tested is obtained;

[0017] Filtering and noise reduction: Mean filtering is used to remove the noise in the grayscale image of the surface image of the plywood to be measured. The filtering kernel uses a 5×5 filtering window. Taking each pixel point in the grayscale image of the surface image of the plywood to be measured as the center, calculate the average pixel value of all pixels within the filtering window, and replace the central pixel value with the calculated average pixel value. After traversing each pixel point in the surface image of the plywood to be measured, the mean filtering is completed;

[0018] Image enhancement: The method of contrast enhancement is adopted. Set the gain factor k, and 0 < k < 3. Process the grayscale image of the surface image of the plywood to be measured after filtering and noise reduction. The calculation formula is shown in Equation (2):

[0019]

[0020] where I(x, y) is the pixel value at the coordinate (x, y) in the grayscale image of the surface image of the plywood to be measured before image enhancement, is the average grayscale value of the grayscale image of the surface image of the plywood to be measured before image enhancement, and I'(x, y) is the grayscale image of the surface image of the plywood to be measured after image enhancement.

[0021] Preferably, the steps of constructing a plywood surface defect detection model based on machine learning, obtaining plywood surface defect image samples and performing annotation as training data to train the model in step S30 include:

[0022] Dataset preparation: Obtain plywood surface defect image samples of different defect types that currently exist, and divide them into a training set, a validation set and a test set according to the ratio of 70%:15%:15%. And mark the corresponding types in the plywood surface defect image samples in the training set for the plywood surface defect detection model to learn the defect characteristics of different types of plywood surfaces. The annotation content includes information such as the location, type and size of the defect; Use professional image annotation tools to accurately annotate the defect areas in the plywood surface defect images, such as VGG Image Annotator, Labellmg, etc., and generate corresponding annotation files, such as XML or JSON formats; Arrange multiple people to conduct cross-checks on the annotation results to ensure the accuracy and consistency of the defect information annotation. Discuss and correct the annotations with disputes;

[0023] Data preprocessing: Preprocess the obtained plywood surface defect image samples of different defect types that currently exist. The preprocessing steps are the same as the steps of image preprocessing for the obtained surface image of the plywood to be measured in step S20, including grayscale conversion, filtering and noise reduction, and image enhancement;

[0024] Construction of Plywood Surface Defect Detection Model: The plywood surface defect detection model adopts the Fast R-CNN network structure, extracts image features based on the backbone network ResNet50, including convolutional layers, batch normalization layers, activation function layers, and residual blocks; the convolutional layers include a series of convolutional operations, using convolutional kernels of different sizes, such as 3×3, 7×7, etc., to perform convolution on the preprocessed plywood surface defect images of different existing defect types to extract and learn the local features of the images; the batch normalization layers are located after the convolutional layers and are used to normalize the outputs of the convolutional layers; the activation function layers use ReLU as the activation function; the residual blocks add the inputs of the residual blocks directly to the outputs of the convolutional layers through skip connections to solve the problems of gradient disappearance and gradient explosion during the training process of the plywood surface defect detection model and optimize the training of the model. The plywood surface defect detection model also includes fully connected layers and output layers. The fully connected layers are set after the backbone network ResNet50, flatten the feature maps output by the backbone network ResNet50 into a one-dimensional vector form, and choose ReLU as the activation function; the output layer is set at the last layer of the entire plywood surface defect detection model and contains a classifier. Modify the output dimension of the classifier according to the corresponding number of plywood surface defect categories. After Softmax processing in the classifier, the probability distributions of each defect category on the plywood surface are output. Each probability distribution corresponds to the confidence level of the defect category. Set the confidence level threshold to 0.55. When the confidence level is less than 0.55, the output is that the plywood has no defects. When the confidence level is greater than or equal to 0.55, the output is that the plywood has defects and at the same time output the detected defect category on the plywood surface. The defect category is the defect category with the highest probability value in the probability distributions of each defect category on the output plywood surface; the confidence level threshold is dynamically adjusted according to the output results;

[0025] Determine the Optimizer and Learning Rate Scheduler: The optimizer adopts the Adam optimization algorithm, which is used to dynamically update the model parameters. The learning rate scheduler is used to dynamically adjust the learning rate according to the number of training rounds of the model. For example, the initial learning rate is set to 0.001 and is adjusted by decay according to the number of training rounds;

[0026] Model Training and Validation: After the construction of the plywood surface defect detection model, set the model hyperparameters and optimizer parameters, use the divided training set as the input to train the plywood surface defect detection model. In each round of training, the model calculates the loss function according to the input training set and the corresponding annotation information, and updates the model parameters through the backpropagation algorithm. After each round of training, use the divided validation set to validate the model, set performance indicators, such as accuracy, recall rate, F1 value, etc., and adjust the model hyperparameters according to the evaluation results to prevent the model from overfitting or underfitting;

[0027] Model evaluation: After the training of the plywood surface defect detection model is completed, the divided test set is used to evaluate the plywood surface defect detection model. The performance of the model is measured by setting object detection evaluation metrics, such as mean average precision, accuracy, recall rate, etc.;

[0028] Model optimization and determination: According to the model evaluation results, when any one of the set object detection evaluation metrics does not meet the requirements, adjust the model hyperparameters and retrain until the optimal combination of model hyperparameters is obtained, and determine the corresponding version of the plywood surface defect detection model.

[0029] Preferably, after the model training in step S40 is completed, the surface image of the plywood to be tested after image preprocessing is input into the model for plywood defect detection, and the detection result is output. The categories of plywood surface defects in the output detection result include sand marks, unevenness of the board surface, glue spots, torn wood fibers, and sandpaper residues. Different defect types have different characteristics, and the model determines the defect types existing in the input surface image of the plywood to be tested by learning the characteristics of different plywood surface defect types.

[0030] In addition, to achieve the above object, the present invention also proposes a plywood defect detection system combined with visual analysis. The plywood defect detection system combined with visual analysis includes:

[0031] Surface image acquisition module of the plywood to be tested: It is used to take the surface image of the plywood to be tested by using an industrial camera after the plywood to be tested undergoes sanding treatment;

[0032] Surface image preprocessing module of the plywood to be tested: It is used to perform image preprocessing on the obtained surface image of the plywood to be tested, including grayscale conversion, filtering and noise reduction, and image enhancement;

[0033] Model construction and training module for plywood surface defect detection: It is used to construct a plywood surface defect detection model based on machine learning, collect plywood surface defect image samples and label them as training data to train the model;

[0034] Defect detection module for the surface of the plywood to be tested: It is used to input the surface image of the plywood to be tested after image preprocessing into the model for plywood defect detection after the training of the plywood surface defect detection model is completed, and output the detection result;

[0035] The surface image acquisition module of the plywood to be tested is carried out on the production line in the plywood production process. By setting a plywood surface image shooting area on the production line, when the plywood to be tested reaches the image shooting area through the conveyor, the conveyor stops running for 1 s, and the industrial camera vertically shoots the surface image of the plywood to be tested from above; a surround-type LED backlight is installed around the industrial camera to evenly illuminate the surface of the plywood to be tested.

[0036] In addition, to achieve the above object, the present invention further provides a plywood defect detection device combined with visual analysis, the device comprising: a memory, a processor, and programs such as a plywood defect detection algorithm combined with visual analysis based on deep learning stored on the memory and executable on the processor, and the programs such as the plywood defect detection algorithm combined with visual analysis based on deep learning are for implementing the steps of a plywood defect detection method combined with visual analysis as described above.

[0037] In addition, to achieve the above object, the present invention further provides a computer program product, the computer program product comprising programs such as a plywood defect detection algorithm combined with visual analysis based on deep learning, and when the programs such as the plywood defect detection algorithm combined with visual analysis based on deep learning are executed by a processor, they implement a plywood defect detection method combined with visual analysis as described above.

[0038] The advantages and effects of the present invention are:

[0039] A plywood defect detection method and system combined with visual analysis proposed by the present invention accurately detect surface defects of plywood after sanding through a plywood defect detection method combining visual analysis and machine learning, make up for the lack of defect detection of plywood after sanding, improve the efficiency of plywood defect detection to meet the requirements of industrial large-scale production; at the same time, through non-contact optical acquisition and processing, mechanical damage to plywood is avoided, the integrity of the product is guaranteed, the rejection rate of the product is reduced, and automatic, high-efficiency and accurate plywood defect detection combined with visual analysis is realized, which helps to optimize the production process and improve the quality of plywood products. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings without creative efforts based on these drawings.

[0041] Figure 1 It is a flowchart of a plywood defect detection method combined with visual analysis of the present invention.

[0042] Figure 2 It is a schematic structural diagram of a plywood defect detection system combined with visual analysis of the present invention.

[0043] Figure 3 It is a schematic block diagram of the structure of an electronic device for plywood defect detection combined with visual analysis of the present invention. Specific Embodiment

[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0045] As Figure 1 shown, in an embodiment of the present invention, a plywood defect detection method combining visual analysis includes the following steps:

[0046] Step S10: After the plywood to be tested undergoes sanding treatment, an industrial camera is used to capture the surface image of the plywood to obtain the surface image of the plywood to be tested.

[0047] Among them, step S10 is carried out on the production line in the plywood production process. By setting a plywood surface image shooting area on the production line, when the plywood to be tested reaches the image shooting area through the conveyor, the conveyor stops running for 1 s. The industrial camera is installed above the plywood production line to ensure that the camera lens is perpendicular to the plywood surface and the distance from the plywood surface is fixed. The industrial camera vertically captures the surface image of the plywood to be tested from above. A ring-shaped LED backlight is installed around the industrial camera to evenly illuminate the surface of the plywood to be tested, avoiding shadows and reflections. By adjusting the angle and brightness of the light source, the defect features on the plywood surface can be clearly presented.

[0048] Specifically, in step S10, when the plywood to be tested reaches the image shooting area through the conveyor, the conveyor stops running for 1 s, which is realized by installing a pressure sensor under the conveyor in the image shooting area. When the plywood to be tested reaches the image shooting area through the conveyor, the pressure sensor detects the pressure change, transmits the pressure change to the microprocessor, and the microprocessor sends a braking instruction to the conveyor drive motor to stop the conveyor. At the same time, a timer is built into the microprocessor. After the timing reaches 1 s, the microprocessor sends a running instruction to the conveyor drive motor to make the conveyor continue to run.

[0049] Specifically, in step S10, the pixel of the industrial camera is not less than 5 million pixels, and the captured surface image of the plywood to be tested is a lossless image with a resolution of 2k. When the industrial camera takes pictures, it automatically adjusts the focal length and aperture of the camera according to the clarity of the surface image of the plywood to be tested. For example, for plywood with a common specification of 1220 mm × 2440 mm, a lens with a focal length of 12 - 16 mm is selected.

[0050] Step S20: Perform image preprocessing on the acquired surface image of the plywood to be tested, including grayscale conversion, filtering and noise reduction, and image enhancement.

[0051] Specifically, the steps of performing image preprocessing on the acquired surface image of the plywood to be tested in step S20 include:

[0052] Grayscale conversion: Perform grayscale processing on the acquired surface image of the plywood to be tested. The weighted average method is used, and the calculation formula is shown in Equation (1):

[0053] Y = 0.299R + 0.587G + 0.114B (1)

[0054] Where R, G, and B are the pixel values of the red, green, and blue channels respectively. For the acquired surface image of the plywood to be tested, its color is represented by the pixel values of the red, green, and blue channels. Y is the grayscale value after weighted average conversion. After traversing each pixel point in the surface image of the plywood to be tested, a grayscale image corresponding to the surface image of the plywood to be tested is obtained;

[0055] Filtering and noise reduction: Use mean filtering to remove the noise in the grayscale image of the surface image of the plywood to be tested. The filter kernel uses a 5×5 filter window. Taking each pixel point in the grayscale image of the surface image of the plywood to be tested as the center, calculate the average pixel value of all pixels in the filter window, and replace the central pixel value with the calculated average pixel value. After traversing each pixel point in the surface image of the plywood to be tested, the mean filtering is completed;

[0056] Image enhancement: Use the method of contrast enhancement, set the gain factor k, and 0 < k < 3, to process the grayscale image of the surface image of the plywood to be tested after filtering and noise reduction. The calculation formula is shown in Equation (2):

[0057]

[0058] Where I(x, y) is the pixel value at the coordinate (x, y) in the grayscale image of the surface image of the plywood to be tested before image enhancement, is the average grayscale value of the grayscale image of the surface image of the plywood to be tested before image enhancement, and I'(x, y) is the grayscale image of the surface image of the plywood to be tested after image enhancement.

[0059] Step S30: Build a plywood surface defect detection model based on machine learning, collect plywood surface defect image samples and perform annotation as training data to train the model.

[0060] Specifically, the steps of building a plywood surface defect detection model based on machine learning, obtaining plywood surface defect image samples and performing annotation as training data to train the model in step S30 include:

[0061] Dataset Preparation: Obtain plywood surface defect image samples of different existing defect types, and divide them into a training set, a validation set, and a test set according to the ratio of 70%:15%:15%. Mark the corresponding types in the plywood surface defect image samples in the training set for the plywood surface defect detection model to learn the surface defect characteristics of different types of plywood. The marked content includes information such as the location, type, and size of the defects. Use professional image annotation tools to accurately annotate the defect areas in the plywood surface defect images, such as VGG Image Annotator, Labellmg, etc., to generate corresponding annotation files in formats such as XML or JSON. Arrange multiple people to conduct cross-checks on the annotation results to ensure the accuracy and consistency of the defect information annotation. Discuss and correct the controversial annotations.

[0062] Data Preprocessing: Preprocess the obtained plywood surface defect image samples of different existing defect types. The preprocessing steps are the same as those for preprocessing the obtained plywood surface images to be measured in step S20, including grayscale conversion, filtering and noise reduction, and image enhancement.

[0063] Construction of Plywood Surface Defect Detection Model: The plywood surface defect detection model adopts the Fast R-CNN network structure. Image features are extracted based on the backbone network ResNet50, including convolutional layers, batch normalization layers, activation function layers, and residual blocks. The convolutional layers include a series of convolution operations, using different-sized convolutional kernels such as 3×3, 7×7, etc., to perform convolution on the preprocessed plywood surface defect images of different existing defect types to extract and learn the local features of the images. The batch normalization layer is located after the convolutional layer and is used to normalize the output of the convolutional layer. The activation function layer uses ReLU as the activation function. The residual block adds the input of the residual block directly to the output of the convolutional layer through a skip connection to solve the problems of gradient disappearance and gradient explosion during the training process of the plywood surface defect detection model and optimize the training of the model. The plywood surface defect detection model also includes a fully connected layer and an output layer. The fully connected layer is set after the backbone network ResNet50, flattens the feature map output by the backbone network ResNet50 into a one-dimensional vector form, and selects ReLU as the activation function. The output layer is set at the last layer of the entire plywood surface defect detection model and contains a classifier. The output dimension of the classifier is modified according to the corresponding number of plywood surface defect categories. After being processed by Softmax in the classifier, the probability distribution of each defect category on the plywood surface is output. Each probability distribution corresponds to the confidence of the defect category. The confidence threshold is set to 0.55. When the confidence is less than 0.55, the output is that the plywood has no defect. When the confidence is greater than or equal to 0.55, the output is that the plywood has a defect and the detected defect category on the plywood surface is also output. The defect category is the defect category with the highest probability value in the probability distribution of each defect category on the output plywood surface. The confidence threshold is dynamically adjusted according to the output results;

[0064] Determination of Optimizer and Learning Rate Scheduler: The Adam optimization algorithm is adopted as the optimizer to dynamically update the model parameters. The learning rate scheduler is used to dynamically adjust the learning rate according to the number of training rounds of the model. For example, the initial learning rate is set to 0.001 and is adjusted by decay according to the number of training rounds;

[0065] Model Training and Validation: After the construction of the plywood surface defect detection model, set the model hyperparameters and optimizer parameters. Use the divided training set as the input to train the plywood surface defect detection model. In each round of training, the model calculates the loss function based on the input training set and the corresponding annotation information, and updates the model parameters through the backpropagation algorithm. After each round of training is completed, use the divided validation set to validate the model. Set performance indicators such as accuracy, recall rate, F1 value, etc., and adjust the model hyperparameters according to the evaluation results to prevent the model from overfitting or underfitting;

[0066] Model evaluation: After the training of the plywood surface defect detection model is completed, the divided test set is used to evaluate the plywood surface defect detection model. The performance of the model is measured by setting object detection evaluation metrics, such as mean average precision, accuracy, recall, etc.;

[0067] Model optimization and determination: According to the model evaluation results, when any one of the set object detection evaluation metrics does not meet the requirements, the model hyperparameters are adjusted and retrained until the optimal combination of model hyperparameters is obtained, and the corresponding version of the plywood surface defect detection model is determined.

[0068] Step S40: After the model training is completed, the surface image of the plywood to be tested after image preprocessing is input into the model for plywood defect detection, and the detection result is output.

[0069] Specifically, after the model training in step S40 is completed, the surface image of the plywood to be tested after image preprocessing is input into the model for plywood defect detection, and the detection result is output. The categories of plywood surface defects in the output detection result include sand marks, unevenness on the board surface, glue spots, torn wood fibers, and sandpaper residues. Different defect types have different corresponding features, and the model determines the defect types existing in the input surface image of the plywood to be tested by learning the features of different plywood surface defect types.

[0070] Sand marks will cause regular changes in the gray value of the plywood surface image. Due to reasons such as uneven sanding force, the gray value at the sand mark is higher or lower than the surrounding area, forming a light and dark striped pattern. When the sand mark is deeper, the gray difference between the sand mark area and the surrounding normal plywood surface will be greater, which is more obvious in the gray scale image. The plywood surface defect detection model identifies sand marks by analyzing the regularity and light and dark degree of the gray value in the surface image of the plywood to be tested.

[0071] Unevenness on the board surface will cause obvious gray gradient changes in the gray scale image of the surface image of the plywood to be tested. The convex part of the plywood board surface will enhance the light reflection and have a relatively higher gray value; the concave part will weaken the light reflection and have a relatively lower gray value. The plywood surface defect detection model can identify the position and range of local unevenness by calculating the gray gradient of the image and detecting the areas with larger gradient values.

[0072] There is a difference between the grayscale value of the glue spot and the grayscale value of the wood part of the plywood. The grayscale value of the glue spot is higher or lower than that of the wood part, forming an obvious grayscale contrast. The plywood surface defect detection model can identify the part with a large difference in grayscale value from the surrounding wood area as a glue spot by setting an appropriate grayscale threshold. In addition, the glue spot appears as an irregular block or patchy area in the grayscale image, and its boundary is relatively clear or fuzzy. The plywood surface defect detection model can also combine the shape characteristics of the area, such as area, perimeter, circularity, etc., to comprehensively judge whether the defective area is a glue spot. For example, the shape of the glue spot is usually more irregular and has a lower circularity, which is significantly different from the normal rectangular or regular shaped plywood area.

[0073] Wood fiber tearing will destroy the continuity of the plywood surface, which is manifested as discontinuity of grayscale values in the grayscale image. There will be a break in the grayscale value at the tearing point. The plywood surface defect detection model can identify wood fiber tearing defects by detecting the discontinuity of grayscale values.

[0074] The edges of sandpaper residues are relatively clear or blurred in the grayscale image, but different from the edge features of the surrounding wood surface, sandpaper usually has a uniform gray tone, and its grayscale value is lighter or darker than the wood surface, forming obvious block or flake areas in the grayscale image. The plywood surface defect detection model can detect the strength, curvature and continuity of the edge, and compare the grayscale values of different areas to identify the areas with grayscale values that are significantly different from the surrounding wood and have a certain uniformity as sandpaper residues. For example, the edges of sandpaper residues are relatively straight or have a certain regular shape, which is different from the natural irregular edges of wood.

[0075] In addition, by collecting more training data, especially data from categories where the model performs poorly, you can also use data augmentation techniques (such as rotation, scaling, flipping, etc.) to increase the diversity of training data, further train the model, and improve the model's detection capabilities.

[0076] In addition, the present invention also proposes a plywood defect detection system combined with visual analysis, please refer to Figure 2 The plywood defect detection system combined with visual analysis comprises:

[0077] The surface image acquisition module of the plywood to be tested is used to obtain the surface image of the plywood to be tested by photographing the surface of the plywood to be tested with an industrial camera after the plywood to be tested has been sanded;

[0078] The image preprocessing module of the plywood surface to be tested is used to perform image preprocessing on the acquired image of the plywood surface to be tested, including grayscale conversion, filtering noise reduction and image enhancement;

[0079] Plywood surface defect detection model construction and training module: used to construct a plywood surface defect detection model based on machine learning, collect plywood surface defect image samples and annotate them as training data to train the model;

[0080] Defect detection module for plywood to be tested: after the plywood surface defect detection model is trained, the pre - processed surface image of the plywood to be tested is input into the model for plywood defect detection, and the detection result is output;

[0081] Among them, the surface image acquisition module for plywood to be tested is carried out on the production line during the plywood production process. By setting a plywood surface image shooting area on the production line, when the plywood to be tested reaches the image shooting area through the conveyor, the conveyor stops running for 1 s, and an industrial camera vertically shoots the surface image of the plywood to be tested from above. A ring - shaped LED backlight is installed around the industrial camera to evenly illuminate the surface of the plywood to be tested.

[0082] A plywood defect detection system combining visual analysis provided by the present application adopts the plywood defect detection method combining visual analysis in the above - mentioned embodiment, and can solve the technical problems of low efficiency and few defect identifications in the traditional plywood defect detection method. Compared with the prior art, the beneficial effects of the plywood defect detection system combining visual analysis provided by the present application are the same as those of the plywood defect detection method combining visual analysis provided by the above - mentioned embodiment, and other technical features in the plywood defect detection system combining visual analysis are the same as the features disclosed in the above - mentioned embodiment method, and will not be elaborated here.

[0083] The present application provides a plywood defect detection device combining visual analysis. The plywood defect detection device combining visual analysis includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the plywood defect detection method combining visual analysis in the first embodiment above.

[0084] Next, refer to Figure 3, which shows a schematic structural diagram of a plywood defect detection device combined with visual analysis suitable for implementing the embodiments of the present application. A plywood defect detection device combined with visual analysis in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions: tablet computers), PMPs (Portable Media Players), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The shown plywood defect detection device combined with visual analysis is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.

[0085] Figure 3 The shown plywood defect detection device combined with visual analysis may include a processing system 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage system 1003 into the random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the plywood defect detection device combined with visual analysis are also stored. The processing system 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I / O interface 1006: an input system 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output system 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage system 1003 including, for example, magnetic tapes, hard disks, etc.; and a communication system 1009. The communication system 1009 can allow the plywood defect detection device combined with visual analysis to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a plywood defect detection device combined with visual analysis having various systems, it should be understood that it is not required to implement or have all the shown systems. More or fewer systems may be alternatively implemented or had.

[0086] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication system, or installed from a storage system 1003, or installed from a ROM 1002. When the computer program is executed by a processing system 1001, the above functions defined in the methods of the embodiments disclosed in the present application are executed.

[0087] A plywood defect detection device combining visual analysis provided by the present application adopts a plywood defect detection method combining visual analysis in the above embodiments, and can solve the technical problems of low efficiency and small number of defect identifications in traditional plywood defect detection methods. Compared with the prior art, the beneficial effects of the plywood defect detection device combining visual analysis provided by the present application are the same as those of the plywood defect detection method combining visual analysis provided by the above embodiments, and other technical features in the plywood defect detection device combining visual analysis are the same as the features disclosed in the method of the previous embodiment, and will not be elaborated here.

[0088] Each part disclosed in the present application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.

[0089] The present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of a plywood defect detection method combining visual analysis as described above are implemented.

[0090] The computer program product provided by the present application can solve the technical problems of low efficiency and small number of defect identifications in traditional plywood defect detection methods. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the plywood defect detection method combining visual analysis provided by the above embodiments, and will not be elaborated here.

[0091] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these changes and modifications.

Claims

1. A plywood defect detection method combined with visual analysis, characterized in that The method includes the following steps: Step S10: After the plywood to be tested undergoes sanding treatment, an industrial camera is used to capture the surface image of the plywood to obtain the surface image of the plywood to be tested; Step S20: Perform image preprocessing on the obtained surface image of the plywood to be tested, including grayscale conversion, filtering and noise reduction, and image enhancement; Step S30: Build a plywood surface defect detection model based on machine learning, collect plywood surface defect image samples and annotate them as training data to train the model; Step S40: After the model training is completed, input the surface image of the plywood to be tested after image preprocessing into the model for plywood defect detection, and output the detection result; The above-mentioned Step S10 is carried out on the production line in the plywood production process. By setting a plywood surface image shooting area on the production line, when the plywood to be tested arrives at the image shooting area through the conveyor, the conveyor stops running for 1 s, and the industrial camera vertically shoots the surface image of the plywood to be tested from above; a surround-type LED backlight is installed around the industrial camera to evenly illuminate the surface of the plywood to be tested.

2. The plywood defect detection method combining visual analysis according to claim 1, wherein, In the above-mentioned Step S10, when the plywood to be tested arrives at the image shooting area through the conveyor, the conveyor stops running for 1 s, which is realized by installing a pressure sensor under the conveyor in the image shooting area. When the plywood to be tested arrives at the image shooting area through the conveyor, the pressure sensor detects the pressure change it receives, transmits the pressure change to the microprocessor, and the microprocessor sends a braking instruction to the conveyor drive motor to stop the conveyor. At the same time, a timer is built in the microprocessor. After the timing reaches 1 s, the microprocessor sends a running instruction to the conveyor drive motor to make the conveyor continue to run.

3. A plywood defect detection method combining visual analysis according to claim 1, characterized in that, In the above-mentioned Step S10, the pixel of the industrial camera is not less than 5 million pixels, and the surface image of the plywood to be tested captured is a lossless image with a resolution of 2k. When the industrial camera shoots, it automatically adjusts the focal length and aperture of the camera according to the clarity of the surface image of the plywood to be tested.

4. A plywood defect detection method combining visual analysis according to claim 1, characterized in that, In the above-mentioned Step S20, the steps of performing image preprocessing on the obtained surface image of the plywood to be tested include: Grayscale conversion: Perform grayscale processing on the obtained surface image of the plywood to be tested, using the weighted average method, and the calculation formula is shown in Equation (1): Y = 0.299R + 0.587G + 0.114B (1) where R, G, and B are the pixel values of the red, green, and blue channels respectively. For the obtained surface image of the plywood to be tested, its color is represented by the pixel values of the red, green, and blue channels. Y is the grayscale value after weighted average conversion. After traversing each pixel point in the surface image of the plywood to be tested, a grayscale image corresponding to the surface image of the plywood to be tested is obtained; Filtering and noise reduction: Use mean filtering to remove the noise in the grayscale image of the surface image of the plywood to be tested. The filtering kernel uses a 5×5 filtering window. Taking each pixel point in the grayscale image of the surface image of the plywood to be tested as the center, calculate the average pixel value of all pixels in the filtering window, and replace the center pixel value with the calculated average pixel value. After traversing each pixel point in the surface image of the plywood to be tested, the mean filtering is completed; Image enhancement: By using the method of contrast enhancement, a gain factor k is set, where 0 < k < 3, and the grayscale image of the surface image of the plywood to be measured after filtering and noise reduction is processed. The calculation formula is shown in Equation (2): Among them, I(x, y) is the pixel value at coordinates (x, y) in the grayscale image of the surface image of the plywood to be measured before image enhancement, is the average grayscale value of the grayscale image of the surface image of the plywood to be measured before image enhancement, and I'(x, y) is the grayscale image of the surface image of the plywood to be measured after image enhancement.

5. A plywood defect detection method combining visual analysis according to claim 1, characterized in that, The steps of constructing a plywood surface defect detection model based on machine learning and obtaining plywood surface defect image samples for annotation as training data to train the model in step S30 include: Dataset preparation: Obtain plywood surface defect image samples of different defect types that currently exist, and divide them into a training set, a validation set, and a test set according to the ratio of 70%:15%:15%. And label the corresponding types in the plywood surface defect image samples in the training set for the plywood surface defect detection model to learn the characteristics of different types of plywood surface defects; Data preprocessing: Preprocess the obtained plywood surface defect image samples of different defect types that currently exist. The preprocessing steps are the same as those for image preprocessing of the obtained surface image of the plywood to be measured in step S20, including grayscale conversion, filtering and noise reduction, and image enhancement; Construction of plywood surface defect detection model: The plywood surface defect detection model adopts the Fast R-CNN network structure, and extracts image features based on the backbone network ResNet50, including a convolutional layer, a batch normalization layer, an activation function layer, and a residual block. The plywood surface defect detection model also includes a fully connected layer and an output layer; Determine the optimizer and learning rate scheduler: The optimizer adopts the Adam optimization algorithm to dynamically update the model parameters, and the learning rate scheduler is used to dynamically adjust the learning rate according to the number of training rounds of the model; Model training and validation: After the plywood surface defect detection model is constructed, set the model hyperparameters and optimizer parameters, and use the divided training set as the input to train the plywood surface defect detection model. When each training round ends, use the divided validation set to validate the model; Model evaluation: After the plywood surface defect detection model is trained, use the divided test set to evaluate the plywood surface defect detection model, and measure the performance of the model by setting object detection evaluation metrics; Model optimization and determination: According to the model evaluation results, when any one of the set object detection evaluation metrics does not meet the requirements, adjust the model hyperparameters and retrain until the optimal combination of model hyperparameters is obtained, and determine the corresponding version of the plywood surface defect detection model.

6. A plywood defect detection method combining visual analysis according to claim 1, characterized in that, After the model is trained in step S40, the surface image of the plywood to be measured after image preprocessing is input into the model for plywood defect detection, and the detection result is output. The categories of plywood surface defects in the output detection result include sand marks, unevenness of the board surface, glue spots, tearing of wood fibers, and sandpaper residue. Different defect types have different corresponding characteristics, and the model judges the defect types existing in the input surface image of the plywood to be measured by learning the characteristics of different plywood surface defect types.

7. A plywood defect detection system combined with visual analysis, characterized in that, The plywood defect detection system combining visual analysis includes: Surface image acquisition module of plywood to be tested: It is used to take the surface image of the plywood to be tested by an industrial camera after the plywood to be tested has undergone sanding treatment; Pretreatment module for surface image of plywood to be tested: It is used to perform image preprocessing on the obtained surface image of the plywood to be tested, including grayscale conversion, filtering and noise reduction, and image enhancement; Model construction and training module for defect detection on plywood surface: It is used to construct a defect detection model for plywood surface based on machine learning, collect plywood surface defect image samples and label them as training data to train the model; Defect detection module for surface of plywood to be tested: It is used to input the surface image of the plywood to be tested after image preprocessing into the model for plywood defect detection and output the detection result after the training of the plywood surface defect detection model is completed; The surface image acquisition module of the plywood to be tested is carried out on the production line in the plywood production process. By setting a plywood surface image shooting area on the production line, when the plywood to be tested reaches the image shooting area through transmission, the conveyor belt stops running for 1 s, and the industrial camera vertically shoots the surface image of the plywood to be tested from above; a surround-type LED backlight is installed around the industrial camera to evenly illuminate the surface of the plywood to be tested.

8. A plywood defect detection device combined with visual analysis, characterized in that, The plywood defect detection device combining visual analysis includes: A memory, a processor, and a plywood defect detection program combining visual analysis stored on the memory and executable on the processor. When the plywood defect detection program combining visual analysis is executed by the processor, it implements a plywood defect detection method according to any one of claims 1 to 6.

9. A computer program product, characterized in that, The computer program product includes a plywood defect detection program combining visual analysis. When the plywood defect detection program combining visual analysis is executed by the processor, it implements a plywood defect detection method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Artificial board surface defect detection method and system

    CN110554052A

  • PCB defect detection algorithm based on convolutional neural network

    CN111709910A

  • Solar cell panel defect detection method based on deep learning

    CN116258690A

  • Metal plate surface defect detection method based on deep learning

    CN117036259A

  • Modeling and detecting method for universal defect detection model of panel production line

    CN118505704A

Cited By

  • Visual inspection method and device for stud welding threaded surface

    CN121258871A