A method and system for detecting surface defects in wood panels based on industrial vision.

By constructing a standard wooden board reference library and segmenting sub-blocks, and combining comparative analysis with a defect classification model, the problems of high computational complexity and low efficiency in wooden board surface defect detection are solved, achieving efficient and accurate defect identification and classification.

CN120471896BActive Publication Date: 2025-11-14LANGFANG XINGCHI WOOD IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510632676.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2025-11-14
Estimated Expiration
2045-05-16

AI Technical Summary

Technical Problem

Existing methods for detecting defects on the surface of wooden boards suffer from high computational complexity and low processing efficiency due to the large amount of information and complexity involved in processing high-resolution images. These methods are insufficient to meet the real-time detection requirements of production lines and make it difficult to accurately identify defects in wooden boards.

Method used

By constructing a standard wooden board reference library, using sub-block segmentation and positional encoding, the wooden board image is segmented into multiple local images for comparative analysis. Combined with a pre-trained defect classification model, abnormal regions are identified and defect types are classified.

Benefits of technology

It reduces computational complexity and information content, improves the accuracy and processing efficiency of anomaly area location, enhances the accuracy of defect identification and the versatility of the model, and adapts to various known and unknown types of defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471896B_ABST
    Figure CN120471896B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of visual recognition technology. It discloses a method and system for detecting surface defects in wooden boards based on industrial vision. The method includes: constructing a standard wooden board reference library; acquiring raw material information and visual data of the wooden board to be inspected; selecting several wooden board images from the reference library to form a reference image set based on the information of the wooden board to be inspected; comparing and analyzing the images of the wooden board to be inspected with the reference image set to obtain abnormal regions; monitoring the abnormal regions, determining that there are no defects if the region is empty, otherwise extracting the image of the abnormal region and inputting it into a pre-trained classification model to identify the defect type. This method adopts a two-stage strategy of first locating abnormal regions and then identifying defect types. By comparing with defect-free samples to locate abnormal regions, and only identifying defects in abnormal regions, it avoids the problem of defect features being diluted in the overall image, and solves the problems of high recognition difficulty and low accuracy caused by the large amount of information in the entire image in existing technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual recognition technology, and more specifically, to a method and system for detecting surface defects in wood panels based on industrial vision. Background Technology

[0002] With the rapid development of industrial automation and intelligent manufacturing, visual inspection technology is playing an increasingly important role in quality control in the manufacturing industry. As a crucial component of traditional manufacturing, the wood processing industry faces increasingly stringent requirements for product quality. Furthermore, the detection of surface defects in wood panels, a key aspect of wood quality control, directly impacts the quality and value of the final product.

[0003] Existing automated wood board defect detection solutions generally employ a global analysis approach, analyzing the entire wood board image. This method attempts to directly identify defects by processing the complete high-resolution image. However, due to the massive amount of information and high complexity of wood board images, the detection system faces significant challenges. Wood board surfaces typically exhibit rich textures, varied colors, and complex natural features. When the system processes the entire image, crucial defect information is often obscured by a large amount of background information, making it difficult to accurately identify defects in the wood board. Furthermore, image-based defect detection methods suffer from high computational complexity and low processing efficiency. High-resolution wood board images typically contain millions of pixels; directly processing this massive amount of information requires significant computational resources, making it difficult to meet the requirements of real-time inspection on production lines. Summary of the Invention

[0004] To overcome the problem that existing technologies cannot accurately distinguish between normal wood grain variations and actual defects, this invention proposes a method and system for detecting surface defects in wood panels based on industrial vision, in order to solve the above-mentioned problem.

[0005] This invention provides the following technical solution:

[0006] A method for detecting surface defects in wood panels based on industrial vision, comprising:

[0007] Historical visual data of wooden boards is acquired, defect-free visual data of wooden boards and corresponding raw material information are selected, and the acquired visual data of wooden boards are classified and stored according to the raw material information to construct a standard wooden board reference library. The visual data of wooden boards includes wooden board images and image descriptions.

[0008] Obtain the raw material information and visual data of the wood board to be inspected;

[0009] Based on the raw material information and visual data of the wood boards to be tested, several wood board images are selected from the standard wood board reference library to form a comparison image set;

[0010] The images of the wooden boards to be inspected are compared and analyzed with the images of wooden boards in the control image set to identify abnormal areas;

[0011] Monitor abnormal areas. If the abnormal area is empty, the wooden board is determined to be without defects. Otherwise, extract the image of the abnormal area and input it into a pre-trained defect classification model to identify the defect type.

[0012] Preferably, the raw material information includes wood species, tree age, origin, and cutting method; the image description includes image size and image features.

[0013] Preferably, the step of obtaining the image features includes:

[0014] The image is converted to grayscale and subjected to grayscale quantization, mapping pixel values ​​to a predetermined number of grayscale levels; grayscale co-occurrence matrices are constructed in at least four directions; the constructed grayscale co-occurrence matrices are normalized; statistical features, including contrast, energy, homogeneity, correlation, and entropy, are extracted from the normalized grayscale co-occurrence matrices; the extracted statistical features are normalized, and the image feature vector is constructed as image features.

[0015] Preferably, the step of selecting several wooden board images from a standard wooden board reference library to form a comparison image set includes:

[0016] Based on the raw material information of the wood board to be tested, visual data of wood boards with the same wood species, age, origin and cutting method are selected from the standard wood board reference library, and visual data of wood boards with the same image size are further selected based on the visual data of the wood board to be tested.

[0017] The similarity between the image features of the wooden board to be detected and the image features obtained through screening is calculated, and the similarity is quantitatively evaluated by the vector distance corresponding to the image features.

[0018] The calculated similarity values ​​are sorted in descending order, and the top N images of wooden boards with the highest similarity are selected as the control image set, where N is an integer greater than 2.

[0019] Preferably, the step of comparing and analyzing the image of the wooden board to be detected with images of wooden boards in a control image set to obtain abnormal regions includes:

[0020] The wooden board image to be detected and the wooden board images in the control image set are equally divided into M sub-blocks, where M is an integer greater than 2;

[0021] Each sub-block is positionally encoded, using row and column coordinates (i, j);

[0022] For each sub-block position (i, j) of the wooden board image to be detected, traverse the corresponding sub-block positions of all wooden board images in the comparison image set;

[0023] Determine whether the sub-block at position (i, j) in the image of the wooden board to be detected is similar to the sub-block at the same position in the control image set; and count the number of dissimilar sub-blocks.

[0024] The anomaly score is obtained by dividing the number of dissimilar sub-blocks by the total number of wooden board images in the control image set.

[0025] When the anomaly degree of a certain sub-block is greater than the preset anomaly degree threshold, it is identified as an abnormal region.

[0026] Preferably, the step of determining whether the sub-block of the wood plank image to be detected at position (i, j) is similar to the sub-block at the same position in the reference image set includes:

[0027] Calculate the color feature similarity between two sub-blocks. If the color feature similarity is less than a preset color similarity threshold, then the two sub-blocks are determined to be dissimilar.

[0028] If the color feature similarity is greater than or equal to the preset color similarity threshold, then the texture feature similarity of the two sub-blocks is calculated; if the texture feature similarity is less than the preset texture similarity threshold, then the two sub-blocks are determined to be dissimilar.

[0029] If the texture feature similarity is greater than or equal to the preset texture similarity threshold, the structural feature similarity between the two sub-blocks is calculated; if the structural feature similarity is less than the preset structural similarity threshold, the two sub-blocks are determined to be dissimilar.

[0030] If the structural feature similarity is greater than or equal to the preset structural similarity threshold, then the two sub-blocks are determined to be similar.

[0031] Preferably, the calculation steps of the color feature similarity include: extracting the color histograms of two sub-blocks, statistically analyzing the pixel values ​​of each sub-block image in the RGB color space into a predetermined number of histogram intervals to form a color histogram, and then using the histogram intersection method to calculate the similarity between the two color histograms as the color feature similarity.

[0032] The steps for calculating the texture feature similarity include: calculating the gray-level co-occurrence matrix for each of the two sub-blocks, extracting contrast, energy, homogeneity, correlation and entropy from them to form texture feature vectors, and then calculating the cosine similarity between the two texture feature vectors as the texture feature similarity.

[0033] The steps for calculating the structural feature similarity include: applying the Sobel operator to extract gradient information for each of the two sub-blocks, calculating the gradient direction histogram, and using the structural similarity metric formula to calculate the structural feature similarity.

[0034] Preferably, the training process of the defect classification model includes:

[0035] Obtain a labeled set of wooden board defects, which includes images of various types of wooden board defects and their corresponding defect type labels;

[0036] The sample set is divided into a training set and a validation set according to a preset ratio;

[0037] Using a convolutional neural network as the basic framework, a network structure containing multiple convolutional layers, pooling layers, and fully connected layers is designed, with the last layer using an activation function to output the probability distribution of defect types.

[0038] Initialize network parameters, input training set images into the network, and calculate the error between the prediction result and the true label using the cross-entropy loss function;

[0039] The network parameters are updated based on the calculated error using the stochastic gradient descent optimization algorithm.

[0040] The model performance is evaluated periodically on the validation set. When the model's accuracy on the validation set reaches a preset threshold, the model training is completed and a trap classification model is obtained.

[0041] This invention also provides a wood board surface defect detection system based on industrial vision, used to implement a wood board surface defect detection method based on industrial vision, comprising:

[0042] The standard library construction module is used to acquire historical visual data of wooden boards, select visual data of defect-free wooden boards and corresponding raw material information, and classify and store the acquired visual data of wooden boards according to the raw material information to construct a standard wooden board reference library. The visual data of wooden boards includes wooden board images and image descriptions.

[0043] The real-time acquisition module is used to acquire the raw material information and visual data of the wood board to be inspected.

[0044] The reference image selection module is used to select several wood board images from the standard wood board reference library based on the raw material information and visual data of the wood board to be inspected, and to form a comparison image set.

[0045] The image comparison and analysis module is used to compare and analyze the image of the wooden board to be detected with the images of wooden boards in the control image set to obtain abnormal areas;

[0046] The defect identification module is used to monitor abnormal areas. If the abnormal area is empty, it is determined that the board is not defective; otherwise, the image of the abnormal area is extracted and input into a pre-trained defect classification model to identify the defect type.

[0047] This invention provides a method and system for detecting surface defects in wood panels based on industrial vision, which has the following advantages:

[0048] By segmenting sub-blocks and using location encoding, the complex overall image problem is transformed into a problem of comparing multiple simple local images, which greatly reduces the amount of information and computational complexity of a single processing step. Each sub-block contains only image information of a local region, allowing for a greater focus on subtle feature changes and effectively avoiding the problem of defect information being masked by a large amount of background information, thus improving the accuracy of anomaly region localization.

[0049] During the localization phase, areas potentially prone to anomalies are precisely identified through comparative analysis with defect-free samples in a standard reference library. This comparison-based method does not require prior knowledge of the specific characteristics of various defects; it only needs to determine the degree of difference between the area to be detected and normal samples. Therefore, it can adapt to various known and unknown types of defects, exhibiting greater versatility and robustness.

[0050] During the identification phase, only the located abnormal areas need to be processed, rather than the entire image of the wooden board. This significantly reduces the amount of data that needs to be analyzed and improves processing efficiency. Simultaneously, since the identification model only needs to focus on the identified abnormal areas, the proportion of defect features in the input data is greatly increased. This avoids the problem of defect features being diluted in the overall image, allowing the model to focus more on feature extraction and classification of the defects themselves, thus improving the accuracy of defect type identification. Attached Figure Description

[0051] Figure 1 This is a schematic flowchart of a method for detecting surface defects of wood panels based on industrial vision according to the present invention.

[0052] Figure 2 This is a schematic diagram of a module of a wood board surface defect detection system based on industrial vision according to the present invention. Detailed Implementation

[0053] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0054] Example 1

[0055] Please see Figure 1 In this embodiment, a method for detecting surface defects in wood panels based on industrial vision includes:

[0056] S1. Obtain historical visual data of wooden boards, select visual data of defect-free wooden boards and corresponding raw material information, and classify and store the obtained visual data of wooden boards according to the raw material information to construct a standard wooden board reference library. The visual data of wooden boards includes wooden board images and image descriptions.

[0057] The raw material information includes wood species, tree age, origin, and cutting method; the image description includes image size and image features.

[0058] The steps for obtaining the image features include:

[0059] The image is converted to grayscale and subjected to grayscale quantization, mapping pixel values ​​to a predetermined number of grayscale levels; grayscale co-occurrence matrices are constructed in at least four directions; the constructed grayscale co-occurrence matrices are normalized; statistical features, including contrast, energy, homogeneity, correlation, and entropy, are extracted from the normalized grayscale co-occurrence matrices; the extracted statistical features are normalized, and the image feature vector is constructed as image features.

[0060] In this embodiment, the construction process of the standard wooden board reference library is as follows:

[0061] First, historical timber plank samples were obtained from multiple timber suppliers. These samples were inspected by professional quality inspectors, who then selected defect-free planks. The raw material information for each defect-free plank was recorded, including timber species, tree age, origin, and cutting method. For the selected defect-free planks, images were captured using a standardized shooting environment to obtain high-resolution images of the planks.

[0062] Next, image features can be obtained as follows: First, convert the color image to a grayscale image. Then, quantize the grayscale image, mapping the grayscale values ​​to a predetermined number of gray levels to reduce computational complexity.

[0063] Construct gray-level co-occurrence matrices in at least four directions. Normalize the constructed gray-level co-occurrence matrices by dividing each element of the matrix by the sum of all elements to obtain a probability matrix.

[0064] Five statistical features were extracted from the normalized gray-level co-occurrence matrix: contrast, energy, homogeneity, correlation, and entropy. The features extracted from each direction were normalized and combined into a feature vector, which serves as the feature description of the wooden board image.

[0065] Finally, the visual data of the planks is categorized and stored according to the raw material information (wood species, tree age, origin, and cutting method). A database structure is created to store the plank images and their corresponding image descriptions (image size and image features). A hierarchical directory structure can be used to organize the data for easy and rapid retrieval and matching later.

[0066] S2. Obtain the raw material information and visual data of the wood board to be inspected;

[0067] S3. Based on the raw material information and visual data of the wood board to be tested, select several wood board images from the standard wood board reference library to form a comparison image set;

[0068] The step of selecting several wooden board images from a standard wooden board reference library to form a comparison image set includes:

[0069] Based on the raw material information of the wood board to be tested, visual data of wood boards with the same wood species, age, origin and cutting method are selected from the standard wood board reference library, and visual data of wood boards with the same image size are further selected based on the visual data of the wood board to be tested.

[0070] The similarity between the image features of the wooden board to be detected and the image features obtained through screening is calculated, and the similarity is quantitatively evaluated by the vector distance corresponding to the image features.

[0071] The calculated similarity values ​​are sorted in descending order, and the top N images of wooden boards with the highest similarity are selected as the control image set, where N is an integer greater than 2.

[0072] In this embodiment, the process of acquiring the data of the wooden board to be detected and constructing a control image set is as follows:

[0073] First, the raw material information and visual data of the wood planks to be inspected are obtained. In the production environment, when the wood planks enter the inspection area, the raw material information of the wood planks, including wood species, tree age, origin, and cutting method, is obtained through pre-entered batch data, barcode reading, or RFID tag reading. At the same time, images of the wood planks to be inspected are captured using the same shooting environment as when constructing the standard reference library, obtaining the visual data of the wood planks to be inspected.

[0074] Next, based on the acquired information about the raw wood panels to be tested and the visual data, a suitable set of reference images is selected from a standard wood panel reference library. This process consists of the following three steps:

[0075] The first step involves preliminary screening based on raw material information. Based on the raw material information of the wood planks to be tested (wood species, tree age, origin, and cutting method), visual data of planks with identical raw material properties are selected from a standard plank reference library. For example, if the plank to be tested is a plain-cut mid-aged European oak, all defect-free plank data with the same properties will be selected. Furthermore, data with dimensions consistent with the image of the plank to be tested will be further selected to ensure the accuracy of subsequent comparisons.

[0076] The second step is to calculate image feature similarity. Feature extraction is performed on the image of the wooden plank to be detected, using the same method as when constructing the standard reference library. The image is converted to grayscale and quantized to construct a gray-level co-occurrence matrix. Statistical features such as contrast, energy, homogeneity, correlation, and entropy are extracted to form the feature vector of the wooden plank to be detected. Then, the similarity between the feature vector of the wooden plank to be detected and the feature vector of each of the initially selected reference images is calculated. The similarity calculation uses the cosine similarity method, which quantifies the similarity by calculating the cosine of the angle between the two vectors; the closer the value is to 1, the higher the similarity.

[0077] The third step is to construct the final control image set. The calculated similarity values ​​are sorted in descending order, and the top N most similar images of the wooden planks are selected as the control image set. In this embodiment, N is set to 5, meaning the five most similar images of defect-free wooden planks are selected as the control image set. This value was determined through extensive experimental verification, ensuring both the representativeness of the control set and controlling the subsequent computational load.

[0078] By following the steps above, reference images that most closely resemble the wood grain texture of the board to be inspected can be quickly identified, thus constructing a targeted set of comparison images. This dual screening mechanism, based on initial screening using raw material information and fine screening using feature similarity, greatly improves the relevance and representativeness of the reference images, providing a reliable reference foundation for subsequent comparative analysis and defect detection.

[0079] S4. Compare and analyze the image of the wooden board to be detected with the images of the wooden boards in the control image set to obtain abnormal areas;

[0080] The step of comparing and analyzing the image of the wooden board to be detected with images of wooden boards in a control image set to obtain abnormal regions includes:

[0081] The wooden board image to be detected and the wooden board images in the control image set are equally divided into M sub-blocks, where M is an integer greater than 2;

[0082] Each sub-block is positionally encoded, using row and column coordinates (i, j);

[0083] For each sub-block position (i, j) of the wooden board image to be detected, traverse the corresponding sub-block positions of all wooden board images in the comparison image set;

[0084] Determine whether the sub-block at position (i, j) in the image of the wooden board to be detected is similar to the sub-block at the same position in the control image set; and count the number of dissimilar sub-blocks.

[0085] The anomaly score is obtained by dividing the number of dissimilar sub-blocks by the total number of wooden board images in the control image set.

[0086] When the anomaly degree of a certain sub-block is greater than the preset anomaly degree threshold, it is identified as an abnormal region.

[0087] The step of determining whether the sub-block of the wooden board image to be detected at position (i, j) is similar to the sub-block at the same position in the reference image set includes:

[0088] Calculate the color feature similarity between two sub-blocks. If the color feature similarity is less than a preset color similarity threshold, then the two sub-blocks are determined to be dissimilar.

[0089] If the color feature similarity is greater than or equal to the preset color similarity threshold, then the texture feature similarity of the two sub-blocks is calculated; if the texture feature similarity is less than the preset texture similarity threshold, then the two sub-blocks are determined to be dissimilar.

[0090] If the texture feature similarity is greater than or equal to the preset texture similarity threshold, the structural feature similarity between the two sub-blocks is calculated; if the structural feature similarity is less than the preset structural similarity threshold, the two sub-blocks are determined to be dissimilar.

[0091] If the structural feature similarity is greater than or equal to the preset structural similarity threshold, then the two sub-blocks are determined to be similar.

[0092] The calculation steps for color feature similarity include: extracting the color histograms of two sub-blocks, statistically analyzing the pixel values ​​of each sub-block image in the RGB color space into a predetermined number of histogram intervals to form a color histogram, and then using the histogram intersection method to calculate the similarity between the two color histograms as the color feature similarity.

[0093] The steps for calculating the texture feature similarity include: calculating the gray-level co-occurrence matrix for each of the two sub-blocks, extracting contrast, energy, homogeneity, correlation and entropy from them to form texture feature vectors, and then calculating the cosine similarity between the two texture feature vectors as the texture feature similarity.

[0094] The steps for calculating the structural feature similarity include: applying the Sobel operator to extract gradient information for each of the two sub-blocks, calculating the gradient direction histogram, and using the structural similarity metric formula to calculate the structural feature similarity.

[0095] In this embodiment, the process of comparing and analyzing the wooden board to be detected with the control image set and obtaining the abnormal region is as follows:

[0096] First, all images of the wooden board to be detected and all images in the control image set are equally segmented. In this example, each image can be equally segmented into 16 sub-blocks (M=16, forming a 4×4 grid structure). Next, the segmented sub-blocks are positionally encoded, using row and column coordinates (i,j) to represent the position of each sub-block, where i represents the row number (from 1 to 4) and j represents the column number (from 1 to 4). This encoding method can accurately locate each sub-block, facilitating subsequent comparative analysis.

[0097] Then, each sub-block position (i,j) of the image of the wooden board to be detected is processed. Taking position (1,2) as an example, the sub-block of the image of the wooden board to be detected at that position is extracted, and the sub-blocks of all wooden board images in the comparison image set at the same position (1,2) are traversed and compared one by one.

[0098] The comparative analysis employs a three-level cascaded judgment mechanism, sequentially comparing the similarity of color features, texture features, and structural features:

[0099] The first step is to calculate color feature similarity. The color histograms of the two sub-blocks are extracted, and the pixel values ​​in the RGB color space are statistically analyzed and placed into predetermined histogram intervals to form color histograms. Then, the histogram intersection method is used to calculate the similarity between the two color histograms as the color feature similarity. If the similarity is less than a preset color similarity threshold (which can be set to 0.85 in this embodiment), the two sub-blocks are directly determined to be dissimilar, and no further comparison is needed.

[0100] The second stage involves calculating texture feature similarity. If the color feature similarity meets the standard, the gray-level co-occurrence matrix is ​​further calculated for each of the two sub-blocks, and statistical features such as contrast, energy, homogeneity, correlation, and entropy are extracted to form texture feature vectors. Then, the cosine similarity between the two texture feature vectors is calculated as the texture feature similarity. If the similarity is less than a preset texture similarity threshold (which can be set to 0.80 in this embodiment), the two sub-blocks are determined to be dissimilar, and no further comparison is needed.

[0101] The third step involves calculating structural feature similarity. If the texture feature similarity also meets the standard, the Sobel operator is applied to each of the two sub-blocks to extract gradient information, the gradient direction histogram is calculated, and the structural feature similarity is calculated using the structural similarity metric formula. If the similarity is less than a preset structural similarity threshold (which can be set to 0.75 in this embodiment), the two sub-blocks are determined to be dissimilar.

[0102] If the similarity of all three levels of features meets the standard, the two sub-blocks are determined to be similar. This cascaded judgment mechanism can comprehensively consider the differences between sub-blocks in the three dimensions of color, texture, and structure, improving the accuracy and reliability of the judgment.

[0103] After completing all comparisons, count the number of dissimilar sub-blocks at each position (i,j) and calculate the anomaly score. The anomaly score is calculated as: the number of dissimilar sub-blocks divided by the total number of wooden board images in the control image set. For example, if the control image set contains 5 images, and 3 sub-blocks at position (1,2) are judged to be dissimilar, then the anomaly score at that position is 3 / 5 = 0.6.

[0104] Finally, each sub-block location is determined to be an abnormal region based on a preset anomaly threshold (which can be set to 0.5 in this embodiment). If the anomaly score of a location is greater than the anomaly threshold, then that location is identified as an abnormal region. In the example above, the anomaly score of location (1,2) is 0.6, which is greater than the threshold of 0.5, and therefore it is marked as an abnormal region.

[0105] This method, based on multi-feature cascaded judgment and statistical anomaly assessment, can more comprehensively capture various defect features, including color difference, texture anomalies, and structural deformation, compared to simple image differencing or single-feature comparison. Simultaneously, through statistical analysis of multiple comparison images, it effectively reduces the false positives that may arise from single-image comparison, improving detection robustness. Furthermore, the cascaded judgment mechanism significantly improves computational efficiency. For clearly dissimilar sub-blocks, a conclusion can be reached in the first or second level of judgment, eliminating the need for subsequent more complex feature extraction and calculations, thus saving substantial computational resources and meeting the demands of real-time detection.

[0106] This step allows for the precise location of abnormal areas on the wooden board to be inspected, providing accurate area localization for subsequent defect type identification and greatly improving the targeting and accuracy of defect identification.

[0107] S5. Monitor abnormal areas. If the abnormal area is empty, it is determined that the wooden board is not defective. Otherwise, extract the image of the abnormal area and input it into the pre-trained defect classification model to identify the defect type.

[0108] The training process of the defect classification model includes:

[0109] Obtain a labeled set of wooden board defects, which includes images of various types of wooden board defects and their corresponding defect type labels;

[0110] The sample set is divided into a training set and a validation set according to a preset ratio;

[0111] Using a convolutional neural network as the basic framework, a network structure containing multiple convolutional layers, pooling layers, and fully connected layers is designed, with the last layer using an activation function to output the probability distribution of defect types.

[0112] Initialize network parameters, input training set images into the network, and calculate the error between the prediction result and the true label using the cross-entropy loss function;

[0113] The network parameters are updated based on the calculated error using the stochastic gradient descent optimization algorithm.

[0114] The model performance is evaluated periodically on the validation set. When the model's accuracy on the validation set reaches a preset threshold, the model training is completed and a trap classification model is obtained.

[0115] In this embodiment, the process of abnormal area monitoring and defect type identification is as follows:

[0116] First, monitor the abnormal areas identified in the previous step. If the abnormal area list is empty, meaning no abnormal areas were detected, the wooden board is determined to be defect-free, and the inspection result can be marked as acceptable.

[0117] If an abnormal region is detected, images of these regions will be further extracted. Specifically, based on the location coordinates (i,j) of the abnormal region, the corresponding sub-block image is cropped from the original image of the wood board to be detected. To preserve the complete information of the defect edges,

[0118] Next, the extracted abnormal region image is input into a pre-trained defect classification model to identify the specific defect type. In this embodiment, the training process of the defect classification model can be as follows:

[0119] First, a large number of images of wooden boards containing various defects were collected. These images were then labeled by experienced quality inspection experts to determine the defect types. Finally, a sample set of 10,000 defect images was compiled, covering defect types such as knots, cracks, wormholes, decay, and discoloration, with approximately 1,500-2,000 samples for each type.

[0120] Then, the sample set is divided into a training set and a validation set in an 8:2 ratio. The training set is used for learning the model's parameters, while the validation set is used to evaluate the model's performance and prevent overfitting.

[0121] Next, a defect classification model was designed and constructed. The model uses a convolutional neural network as its basic framework, containing 5 convolutional layers, 3 pooling layers, and 2 fully connected layers. The specific structure is as follows: The input layer receives the image; the first convolutional layer uses 64 3×3 convolutional kernels, followed by a ReLU activation function and a max-pooling layer; the second to fifth convolutional layers use 128, 256, 512, and 512 convolutional kernels respectively, each followed by a ReLU activation function, with max-pooling layers added after the third and fifth convolutional layers; next are two fully connected layers with 1024 and 512 neurons respectively, each followed by a Dropout layer to prevent overfitting; finally, the output layer contains the number of neurons corresponding to the number of defect types, using a Softmax activation function to output the probability distribution of each defect type.

[0122] During the model training phase, network parameters are first randomly initialized, and then training set images are input into the network in batches. The cross-entropy loss function is used to calculate the error between the model's predictions and the true labels, and the Adam optimization algorithm is used to update the network parameters based on the error. The learning rate is initially set to 0.001, and a learning rate decay strategy is adopted, reducing the learning rate to 90% of its original value every 10 training epochs.

[0123] During training, the model performance is evaluated on the validation set after each training cycle. Training is stopped when the model's accuracy on the validation set does not significantly improve for three consecutive cycles, or when it reaches a preset accuracy threshold (95% in this embodiment).

[0124] Returning to the defect detection process, when an image of an abnormal region is input into the trained classification model, the model outputs the most likely defect type for that region and its probability value. A confidence threshold strategy can be used: the prediction result is only adopted when the probability value is greater than a preset threshold (set to 0.85 in this embodiment); otherwise, the region is marked as an unknown defect and requires further manual inspection.

[0125] For each board with identified defects, a detailed inspection report is generated, including information on the location and type of defect.

[0126] This deep learning-based defect classification method has significant advantages over traditional rule-based or simple feature-based methods. It can automatically learn complex feature representations of various defects, adapting to changes in different wood species and defect morphologies, greatly improving classification accuracy and robustness.

[0127] Through the complete testing process described above, this embodiment achieves high-precision automatic detection and classification of defects in wood panels, significantly improving the efficiency and accuracy of wood quality control, reducing labor costs for wood processing enterprises, and enhancing product quality and competitiveness.

[0128] Example 2

[0129] Please see Figure 2 This invention provides a wood board surface defect detection system based on industrial vision, used to implement a wood board surface defect detection method based on industrial vision, comprising:

[0130] The standard library construction module is used to acquire historical visual data of wooden boards, select visual data of defect-free wooden boards and corresponding raw material information, and classify and store the acquired visual data of wooden boards according to the raw material information to construct a standard wooden board reference library. The visual data of wooden boards includes wooden board images and image descriptions.

[0131] The real-time acquisition module is used to acquire the raw material information and visual data of the wood board to be inspected.

[0132] The reference image selection module is used to select several wood board images from the standard wood board reference library based on the raw material information and visual data of the wood board to be inspected, and to form a comparison image set.

[0133] The image comparison and analysis module is used to compare and analyze the image of the wooden board to be detected with the images of wooden boards in the control image set to obtain abnormal areas;

[0134] The defect identification module is used to monitor abnormal areas. If the abnormal area is empty, it is determined that the board is not defective; otherwise, the image of the abnormal area is extracted and input into a pre-trained defect classification model to identify the defect type.

[0135] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only one method, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0136] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

[0137] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting surface defects in wood panels based on industrial vision, characterized in that, include: Historical visual data of wooden boards is acquired, defect-free visual data of wooden boards and corresponding raw material information are selected, and the acquired visual data of wooden boards are classified and stored according to the raw material information to construct a standard wooden board reference library. The visual data of wooden boards includes wooden board images and image descriptions. Obtain the raw material information and visual data of the wood board to be inspected; Based on the raw material information and visual data of the wood boards to be tested, several wood board images are selected from the standard wood board reference library to form a comparison image set; The images of the wooden boards to be inspected are compared and analyzed with the images of wooden boards in the control image set to identify abnormal areas; Monitor abnormal areas. If the abnormal area is empty, it is determined that the wooden board is not defective. Otherwise, extract the image of the abnormal area and input it into the pre-trained defect classification model to identify the defect type. The step of selecting several wooden board images from a standard wooden board reference library to form a comparison image set includes: Based on the raw material information of the wood board to be tested, visual data of wood boards with the same wood species, age, origin and cutting method are selected from the standard wood board reference library, and visual data of wood boards with the same image size are further selected based on the visual data of the wood board to be tested. The similarity between the image features of the wooden board to be detected and the image features obtained through screening is calculated, and the similarity is quantitatively evaluated by the vector distance corresponding to the image features. The calculated similarity values ​​are sorted in descending order, and the top N images of wooden boards with the highest similarity are selected as the control image set, where N is an integer greater than 2; The step of comparing and analyzing the image of the wooden board to be detected with images of wooden boards in a control image set to obtain abnormal regions includes: The wooden board image to be detected and the wooden board images in the control image set are equally divided into M sub-blocks, where M is an integer greater than 2; Each sub-block is positionally encoded, using row and column coordinates (i, j); For each sub-block position (i, j) of the wooden board image to be detected, traverse the corresponding sub-block positions of all wooden board images in the comparison image set; Determine whether the sub-block at position (i, j) in the image of the wooden board to be detected is similar to the sub-block at the same position in the control image set; and count the number of dissimilar sub-blocks. The anomaly score is obtained by dividing the number of dissimilar sub-blocks by the total number of wooden board images in the control image set. When the anomaly degree of a certain sub-block is greater than the preset anomaly degree threshold, it is identified as an abnormal region; The step of determining whether the sub-block of the wooden board image to be detected at position (i, j) is similar to the sub-block at the same position in the reference image set includes: Calculate the color feature similarity between two sub-blocks. If the color feature similarity is less than a preset color similarity threshold, then the two sub-blocks are determined to be dissimilar. If the color feature similarity is greater than or equal to the preset color similarity threshold, then the texture feature similarity of the two sub-blocks is calculated; if the texture feature similarity is less than the preset texture similarity threshold, then the two sub-blocks are determined to be dissimilar. If the texture feature similarity is greater than or equal to the preset texture similarity threshold, the structural feature similarity between the two sub-blocks is calculated; if the structural feature similarity is less than the preset structural similarity threshold, the two sub-blocks are determined to be dissimilar. If the structural feature similarity is greater than or equal to the preset structural similarity threshold, then the two sub-blocks are determined to be similar.

2. The method for detecting surface defects of wood panels based on industrial vision according to claim 1, characterized in that, The raw material information includes wood species, tree age, origin, and cutting method; the image description includes image size and image features.

3. The method for detecting surface defects of wood panels based on industrial vision according to claim 2, characterized in that, The steps for obtaining the image features include: The image is converted to grayscale and subjected to grayscale quantization, mapping pixel values ​​to a predetermined number of grayscale levels; grayscale co-occurrence matrices are constructed in at least four directions; the constructed grayscale co-occurrence matrices are normalized; statistical features, including contrast, energy, homogeneity, correlation, and entropy, are extracted from the normalized grayscale co-occurrence matrices; the extracted statistical features are normalized, and the image feature vector is constructed as image features.

4. The method for detecting surface defects of wood panels based on industrial vision according to claim 3, characterized in that, The calculation steps for color feature similarity include: extracting the color histograms of two sub-blocks, statistically analyzing the pixel values ​​of each sub-block image in the RGB color space into a predetermined number of histogram intervals to form a color histogram, and then using the histogram intersection method to calculate the similarity between the two color histograms as the color feature similarity. The steps for calculating the texture feature similarity include: calculating the gray-level co-occurrence matrix for each of the two sub-blocks, extracting contrast, energy, homogeneity, correlation and entropy from them to form texture feature vectors, and then calculating the cosine similarity between the two texture feature vectors as the texture feature similarity. The steps for calculating the structural feature similarity include: applying the Sobel operator to extract gradient information for each of the two sub-blocks, calculating the gradient direction histogram, and using the structural similarity metric formula to calculate the structural feature similarity.

5. The method for detecting surface defects of wood panels based on industrial vision according to claim 4, characterized in that, The training process of the defect classification model includes: Obtain a labeled set of wooden board defects, which includes images of various types of wooden board defects and their corresponding defect type labels; The sample set is divided into a training set and a validation set according to a preset ratio; Using a convolutional neural network as the basic framework, a network structure containing multiple convolutional layers, pooling layers, and fully connected layers is designed, with the last layer using an activation function to output the probability distribution of defect types. Initialize network parameters, input training set images into the network, and calculate the error between the prediction result and the true label using the cross-entropy loss function; The network parameters are updated based on the calculated error using the stochastic gradient descent optimization algorithm. The model performance is evaluated periodically on the validation set. When the model's accuracy on the validation set reaches a preset threshold, the model training is completed and a trap classification model is obtained.

6. A wood panel surface defect detection system based on industrial vision, used to implement the wood panel surface defect detection method based on industrial vision as described in any one of claims 1-5, characterized in that, include: The standard library construction module is used to acquire historical visual data of wooden boards, select visual data of defect-free wooden boards and corresponding raw material information, and classify and store the acquired visual data of wooden boards according to the raw material information to construct a standard wooden board reference library. The visual data of wooden boards includes wooden board images and image descriptions. The real-time acquisition module is used to acquire the raw material information and visual data of the wood board to be inspected. The reference image selection module is used to select several wood board images from the standard wood board reference library based on the raw material information and visual data of the wood board to be inspected, and to form a comparison image set. The image comparison and analysis module is used to compare and analyze the image of the wooden board to be detected with the images of wooden boards in the control image set to obtain abnormal areas; The defect identification module is used to monitor abnormal areas. If the abnormal area is empty, it is determined that the board is not defective; otherwise, the image of the abnormal area is extracted and input into a pre-trained defect classification model to identify the defect type.

Citation Information

Patent Citations

  • Micro paleontology fossil image detection, classification and discovery method, system and application

    CN113128335A

  • Method and its apparatus for detecting defect

    JP2007298505A