Wood board surface defect detection method and system based on industrial vision

Through a two-stage strategy based on industrial vision, sub-block segmentation and standard reference library are used to locate abnormal areas, and then use deep learning models to identify defect types, the problems of high computational complexity and difficulty in identification of wooden board surface defect detection in the prior art are solved, and efficient and accurate defect detection is achieved.

CN120471896AActive Publication Date: 2025-08-12LANGFANG XINGCHI WOOD IND CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The existing wooden board surface defect detection methods have high amount of information and high complexity in processing high-resolution image, resulting in high computational complexity and low processing efficiency, making it difficult to meet the real-time detection requirements of production lines. The defect information is easily masked by background information, making it difficult to identify and have low accuracy.

Method used

A two-stage strategy based on industrial vision is adopted, firstly, the overall image is converted into local image comparison through sub-block segmentation and position encoding, and the abnormal area positioning is used to locate the abnormal area, and then the pre-trained defect classification model is used to identify defect types, reducing the computational complexity and improving the recognition accuracy.

Benefits of technology

Through the combination of local image comparison and deep learning models, the calculation complexity and data volume are significantly reduced, the accuracy of abnormal area positioning and the efficiency and accuracy of defect type recognition are improved, and it is adapted to various known and unknown types of defects, and has strong versatility and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471896A_ABST
    Figure CN120471896A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of visual identification, and discloses a board surface defect detection method and system based on industrial vision, and the method comprises the steps: constructing a standard board reference library; acquiring raw material information and visual data of a to-be-detected wood board; selecting a plurality of board images from the reference library according to the to-be-detected board information to form a contrast image set; performing comparative analysis on the to-be-detected wood board image and the contrast image set to obtain an abnormal region; and monitoring an abnormal region, if the abnormal region is empty, judging that no defect exists, otherwise, extracting an abnormal region image and inputting the abnormal region image into a pre-trained classification model to identify a defect type. According to the method, a two-stage strategy of firstly positioning the abnormal area and then identifying the defect type is adopted, the abnormal area is positioned by comparing with a defect-free sample, and only defect identification is performed on the abnormal area, so that the problem that defect features are diluted in the whole image is avoided; the problems of high identification difficulty, low accuracy and the like caused by overlarge information amount of the whole image in the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of visual recognition technology, and more specifically, to a method and system for detecting surface defects of wooden boards based on industrial vision. Background Art

[0002] With the rapid development of industrial automation and intelligent manufacturing, visual inspection technology is playing an increasingly important role in manufacturing quality control. As an important part of traditional manufacturing, the wood processing industry has increasingly stringent requirements for product quality. Surface defect detection for wood panels, a key step in wood quality control, directly impacts the quality and value of the final product.

[0003] Existing automated wood board defect detection solutions generally use a global analysis method for the entire wood board image. This method attempts to directly identify defects by processing the complete high-resolution image, but due to the huge amount of information and high complexity of wood board images, the detection system faces a huge challenge. The surface of the wood board usually has rich textures, changing colors, and complex natural features. When the system processes the entire image, the key defect information is often obscured by a large amount of background information, making it difficult to accurately identify the defects in the wood board. In addition, the defect detection method based on the whole image suffers from high computational complexity and low processing efficiency. High-resolution wood board images usually contain millions of pixels of data. Directly processing this massive amount of information requires a large amount of computing resources, which makes it difficult to meet the requirements of real-time detection on the production line. Summary of the Invention

[0004] In order to overcome the problem that the existing technology is difficult to accurately distinguish normal wood grain changes from actual defects, the present invention proposes a wood board surface defect detection method and system based on industrial vision to solve the above problem.

[0005] The present invention provides the following technical solutions: A method for detecting surface defects of wooden boards based on industrial vision, comprising: 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, wherein the visual data of wooden boards includes wooden board images and image descriptions; Obtaining the raw material information and visual data of the wood board to be inspected; According to the raw material information and visual data of the wood board to be inspected, a number of wood board images are selected from the standard wood board reference library to form a control image set; Compare and analyze the image of the wood board to be tested with the images of the wood boards in the reference image set to obtain abnormal areas; Monitor the abnormal area. If the abnormal area is empty, the board is judged to be defect-free. Otherwise, the image of the abnormal area is extracted and input into the pre-trained defect classification model to identify the defect type.

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

[0007] Preferably, the step of acquiring the image features includes: The image is converted into a grayscale image and grayscale quantization is performed to map the pixel values to a predetermined number of grayscale levels; a grayscale co-occurrence matrix of the image in at least four directions is constructed; the constructed grayscale co-occurrence matrix is normalized; statistical features are extracted from the normalized grayscale co-occurrence matrix, including contrast, energy, homogeneity, correlation and entropy; the extracted statistical features are normalized, and the feature vector of the image is constructed as the image feature.

[0008] Preferably, the selecting of a plurality of wood board images from a standard wood board reference library to form a control image set comprises: Based on the raw material information of the wood board to be inspected, visual data of wood boards with the same wood species, age, origin, and cutting method are selected from the standard wood board reference library. Furthermore, visual data of wood boards with the same image size are further selected based on the visual data of the wood board to be inspected. Calculate the similarity between the image features of the wood board to be detected and the image features obtained by screening, 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 first N wood board images with the highest similarity are selected as the control image set, where N is an integer greater than 2.

[0009] Preferably, the comparing and analyzing the image of the wood board to be inspected with the images of the wood boards in the reference image set to obtain the abnormal area includes: The wooden board image of the wooden board to be detected and the wooden board images in the reference image set are equally divided into M sub-blocks, where M is an integer greater than 2; Encode the position of each sub-block and use row and column coordinates (i, j) to represent it; For each sub-block position (i, j) of the wood board image to be detected, traverse the corresponding sub-blocks of all wood board images in the reference image set; Determine whether the sub-block at position (i, j) of the wood board image to be detected is similar to the sub-block at the same position in the reference image set; and count the number of dissimilar sub-blocks; The abnormality degree is obtained by dividing the number of dissimilar sub-blocks by the total number of wood board images in the control image set; When the abnormality of a sub-block is greater than the preset abnormality threshold, it is located as an abnormal area.

[0010] Preferably, the step of determining whether the sub-block at position (i, j) of the image of the wooden board to be detected is similar to the sub-block at the same position in the reference image set includes: Calculate the color feature similarity of the two sub-blocks. If the color feature similarity is less than a preset color similarity threshold, 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, the texture feature similarity of the two sub-blocks is calculated; if the texture feature similarity is less than the preset texture similarity threshold, 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 of 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 a preset structural similarity threshold, the two sub-blocks are determined to be similar.

[0011] Preferably, the step of calculating the color feature similarity includes: extracting color histograms of the two sub-blocks, counting 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 a histogram intersection method to calculate the similarity of the two color histograms as the color feature similarity; The step of calculating the texture feature similarity includes: calculating the gray level co-occurrence matrix for each of the two sub-blocks, extracting contrast, energy, homogeneity, correlation and entropy from the matrix to form a texture feature vector, and then calculating the cosine similarity between the two texture feature vectors as the texture feature similarity; The steps of calculating the structural feature similarity include: applying the Sobel operator to extract gradient information from the two sub-blocks respectively, calculating the gradient direction histogram, and calculating the structural feature similarity using a structural similarity measurement formula.

[0012] Preferably, the training process of the defect classification model includes: Obtain a labeled wood board defect sample set, wherein the sample set includes multiple types of wood board defect images and their corresponding defect type labels; Divide the sample set into training set and validation set according to the preset ratio; Using a convolutional neural network as the basic framework, a network structure consisting of multiple convolutional layers, pooling layers, and fully connected layers was designed. The last layer used an activation function to output the probability distribution of defect types. Initialize the network parameters, input the training set images into the network, and calculate the error between the predicted results and the true labels using the cross entropy loss function; Use the stochastic gradient descent optimization algorithm to update the network parameters according to the calculated error; The model performance is regularly evaluated on the validation set. When the accuracy of the model on the validation set reaches the preset threshold, the model training is completed and the trap classification model is obtained.

[0013] The present invention also provides a wood board surface defect detection system based on industrial vision, which is used to implement a wood board surface defect detection method based on industrial vision, including: a standard library construction module for acquiring historical visual data of wooden boards, selecting visual data of defect-free wooden boards and corresponding raw material information, and classifying and storing the acquired visual data of wooden boards according to the raw material information to construct a standard wooden board reference library, wherein the visual data of wooden boards includes wooden board images and image descriptions; Real-time acquisition module, used to obtain the raw material information and visual data of the wood board to be inspected; The reference image selection module is used to select a number of wood board images from the standard wood board reference library according to the raw material information and wood board visual data of the wood board to be tested, so as to form a reference image set; An image comparison and analysis module is used to compare and analyze the image of the wood board to be inspected with the images of the wood boards in the reference image set to obtain abnormal areas; The defect recognition module is used to monitor abnormal areas. If the abnormal area is empty, the board is judged to be defect-free. Otherwise, the image of the abnormal area is extracted and input into the pre-trained defect classification model to identify the defect type.

[0014] The present invention provides a method and system for detecting wood board surface defects based on industrial vision, which has the following beneficial effects: Through sub-block segmentation and position encoding, the complex overall image problem is transformed into multiple simple local image comparison problems, significantly reducing the amount of information and computational complexity required for a single processing step. Each sub-block contains only image information from a local region, allowing for a sharper focus on subtle feature changes. This effectively prevents defect information from being obscured by background information and improves the accuracy of locating abnormal areas.

[0015] During the localization phase, the system precisely identifies areas where anomalies may exist by comparing them with defect-free samples in a standard reference library. This comparison-based approach requires no prior knowledge of the specific characteristics of each defect; it simply determines the degree of difference between the area under inspection and a normal sample. Therefore, it can adapt to a variety of known and unknown defect types, offering greater versatility and robustness.

[0016] During the recognition phase, only the located abnormal area needs to be processed, rather than the entire plank image. This significantly reduces the amount of data required for analysis and improves processing efficiency. Furthermore, because the recognition model only needs to focus on the identified abnormal area, the proportion of defect features in the input data is greatly increased, avoiding the problem of defect features being diluted in the overall image. This allows the model to focus more on feature extraction and classification of the defect itself, improving the accuracy of defect type identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 Schematic diagram of the process of a method for detecting wood board surface defects based on industrial vision according to the present invention; Figure 2 This is a module schematic diagram of a wood board surface defect detection system based on industrial vision of the present invention. DETAILED DESCRIPTION

[0018] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0019] Example 1 See also Figure 1 In this embodiment, a method for detecting wood board surface defects based on industrial vision includes: S1. 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 wooden board visual data includes wooden board images and image descriptions; The raw material information includes wood species, tree age, origin and cutting method; the image description includes image size and image features.

[0020] The step of acquiring the image features includes: The image is converted into a grayscale image and grayscale quantization is performed to map the pixel values to a predetermined number of grayscale levels; a grayscale co-occurrence matrix of the image in at least four directions is constructed; the constructed grayscale co-occurrence matrix is normalized; statistical features are extracted from the normalized grayscale co-occurrence matrix, including contrast, energy, homogeneity, correlation and entropy; the extracted statistical features are normalized, and the feature vector of the image is constructed as the image feature.

[0021] In this embodiment, the construction process of the standard wood board reference library is as follows: First, we obtain historical wood samples from multiple wood suppliers. Professional quality inspectors examine these samples and select defect-free wood samples. We also record the raw material information of each defect-free wood board, including wood species, age, origin, and cutting method. For these defect-free boards, we capture images using a standardized shooting environment to obtain high-resolution images.

[0022] Next, image features can be obtained by first converting the color image into a grayscale image. Then, the grayscale image is quantized to map the grayscale values to a predetermined number of gray levels, reducing computational complexity.

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

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

[0025] Finally, the visual data of the planks is categorized and stored based on their raw material information (wood species, 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 rapid retrieval and matching.

[0026] S2. Obtaining the raw material information and visual data of the wood board to be inspected; 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 control image set; The method of selecting a plurality of wood board images from the standard wood board reference library to form a control image set includes: Based on the raw material information of the wood board to be inspected, visual data of wood boards with the same wood species, age, origin, and cutting method are selected from the standard wood board reference library. Furthermore, visual data of wood boards with the same image size are further selected based on the visual data of the wood board to be inspected. Calculate the similarity between the image features of the wood board to be detected and the image features obtained by screening, 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 first N wood board images with the highest similarity are selected as the control image set, where N is an integer greater than 2.

[0027] In this embodiment, the process of obtaining the wood board data to be detected and constructing the reference image set is as follows: First, the raw material information and visual data of the wood planks to be inspected are acquired. In a production environment, when a plank enters the inspection area, raw material information, including wood species, age, origin, and cutting method, is acquired through pre-entered batch data, barcodes, or RFID tag reading. Simultaneously, images of the planks to be inspected are captured using the same shooting environment used to construct the standard reference library, acquiring visual data.

[0028] Next, based on the acquired wood material information and visual data, a suitable set of reference images is selected from the standard wood reference library. This process is divided into the following three steps: The first step involves preliminary screening based on raw material information. Based on the raw material information of the board being inspected (wood species, age, origin, and cutting method), visual data of boards with identical raw material properties are selected from a standard board reference library. For example, if the board being inspected is a flat-cut piece of medium-aged European oak, all defect-free boards with the same properties will be selected. Furthermore, data matching the image size of the board being inspected is selected to ensure accuracy in subsequent comparisons.

[0029] The second step is to calculate image feature similarity. Feature extraction is performed on the image of the wood board to be tested. Using the same method used to construct the standard reference library, the image is converted to grayscale and quantized. A grayscale co-occurrence matrix is constructed, and statistical features such as contrast, energy, homogeneity, correlation, and entropy are extracted to form a feature vector for the wood board to be tested. The similarity between the feature vector of the wood board to be tested and the feature vector of each initially selected reference image is then calculated. The similarity is calculated using the cosine similarity method, which quantitatively evaluates the cosine of the angle between the two vectors. Values closer to 1 indicate higher similarity.

[0030] The third step is to construct the final control image set. The calculated similarity values are sorted in descending order, and the top N wood board images with the highest similarity are selected as the control image set. In this example, N is set to 5, meaning the five most similar images of defect-free wood boards are selected as the control image set. This value was determined through extensive experimental verification to ensure the representativeness of the control set while limiting the subsequent computational effort.

[0031] Through these steps, we can quickly find the reference image that most closely matches the wood grain of the board being inspected, building a targeted set of comparison images. This dual screening mechanism, based on initial screening of raw material information and refined screening based on feature similarity, greatly improves the relevance and representativeness of the reference images, providing a reliable reference foundation for subsequent comparative analysis and defect detection.

[0032] S4, comparing and analyzing the image of the wood board to be inspected with the images of the wood boards in the reference image set to obtain abnormal areas; Comparing and analyzing the image of the wood board to be detected with the images of the wood boards in the reference image set to obtain the abnormal area includes: The wooden board image of the wooden board to be detected and the wooden board images in the reference image set are equally divided into M sub-blocks, where M is an integer greater than 2; Encode the position of each sub-block and use row and column coordinates (i, j) to represent it; For each sub-block position (i, j) of the wood board image to be detected, traverse the corresponding sub-blocks of all wood board images in the reference image set; Determine whether the sub-block at position (i, j) of the wood board image to be detected is similar to the sub-block at the same position in the reference image set; and count the number of dissimilar sub-blocks; The abnormality degree is obtained by dividing the number of dissimilar sub-blocks by the total number of wood board images in the control image set; When the abnormality of a sub-block is greater than the preset abnormality threshold, it is located as an abnormal area.

[0033] The step of determining whether the sub-block at position (i, j) of the detected wooden board image is similar to the sub-block at the same position in the reference image set comprises: Calculate the color feature similarity of the two sub-blocks. If the color feature similarity is less than a preset color similarity threshold, 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, the texture feature similarity of the two sub-blocks is calculated; if the texture feature similarity is less than the preset texture similarity threshold, 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 of 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 a preset structural similarity threshold, the two sub-blocks are determined to be similar.

[0034] The color feature similarity calculation step includes: extracting color histograms of the two sub-blocks, counting 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 a histogram intersection method to calculate the similarity of the two color histograms as the color feature similarity; The step of calculating the texture feature similarity includes: calculating the gray level co-occurrence matrix for each of the two sub-blocks, extracting contrast, energy, homogeneity, correlation and entropy from the matrix to form a texture feature vector, and then calculating the cosine similarity between the two texture feature vectors as the texture feature similarity; The steps of calculating the structural feature similarity include: applying the Sobel operator to extract gradient information from the two sub-blocks respectively, calculating the gradient direction histogram, and calculating the structural feature similarity using a structural similarity measurement formula.

[0035] In this embodiment, the process of comparing and analyzing the wood board to be detected with the reference image set and obtaining the abnormal area is as follows: First, the image of the wood board to be tested and all the wood board images in the reference 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 (ranging from 1 to 4) and j represents the column number (ranging from 1 to 4). This encoding method accurately locates each sub-block, facilitating subsequent comparative analysis.

[0036] Next, we process each sub-block position (i, j) of the wood board image to be inspected. Taking position (1, 2) as an example, we extract the sub-block of the wood board image at that position and then traverse all sub-blocks of the wood board image at the same position (1, 2) in the reference image set for a one-to-one comparison analysis.

[0037] The comparative analysis adopts a three-level cascade judgment mechanism to compare the similarity of color features, texture features, and structural features in turn: The first stage calculates color feature similarity. The color histograms of the two sub-blocks are extracted, and the pixel values in the RGB color space are counted into predetermined histogram intervals to form a color histogram. The histogram intersection method is then 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 deemed dissimilar, and no further comparison is required.

[0038] The second stage calculates texture feature similarity. If the color feature similarity meets the criteria, the gray-level co-occurrence matrix is further calculated for each of the two sub-blocks. Statistical features such as contrast, energy, homogeneity, correlation, and entropy are extracted from the matrix to form a texture feature vector. The cosine similarity between the two texture feature vectors is then 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 deemed dissimilar and no further comparison is required.

[0039] The third stage calculates structural feature similarity. If the texture feature similarity also meets the requirements, the Sobel operator is applied to each of the two sub-blocks to extract gradient information, calculate the gradient direction histogram, and calculate the structural feature similarity using the structural similarity metric formula. If the similarity is less than the preset structural similarity threshold (which can be set to 0.75 in this embodiment), the two sub-blocks are considered dissimilar.

[0040] If the similarity of all three levels of features meets the requirements, the two sub-blocks are considered similar. This cascade judgment mechanism can comprehensively consider the differences between sub-blocks in color, texture, and structure, improving the accuracy and reliability of judgment.

[0041] After all comparisons are complete, the number of dissimilar sub-blocks at each position (i, j) is counted and the outlier score is calculated. The outlier score is calculated as: the number of dissimilar sub-blocks divided by the total number of wood board images in the reference image set. For example, if the reference image set contains five images, and three sub-blocks at position (1, 2) are judged dissimilar, the outlier score for that position is 3 / 5 = 0.6.

[0042] Finally, each sub-block position is determined to be an abnormal region based on a preset abnormality threshold (set to 0.5 in this example). If the abnormality of a position is greater than the abnormality threshold, the position is identified as an abnormal region. In the above example, the abnormality of position (1, 2) is 0.6, which is greater than the threshold of 0.5, and is therefore marked as an abnormal region.

[0043] Compared to simple image differencing or single-feature comparison, this method, based on cascaded multi-feature judgment and statistical anomaly analysis, can more comprehensively capture various defect characteristics, including color difference, texture anomalies, and structural deformation. Furthermore, through statistical analysis of multiple comparison images, it effectively reduces the potential for misjudgment caused by single-image comparison, thereby improving detection robustness. Furthermore, the cascaded judgment mechanism significantly improves computational efficiency. For clearly dissimilar sub-blocks, conclusions can be drawn at the first or second level, eliminating the need for subsequent, more complex feature extraction and calculation. This saves significant computing resources and meets the needs of real-time detection.

[0044] Through this step, the abnormal area on the wooden board to be inspected can be accurately located, providing accurate area positioning for subsequent defect type identification, greatly improving the pertinence and accuracy of defect identification.

[0045] S5. Monitor the abnormal area. If the abnormal area is empty, the board is judged to be defect-free. Otherwise, the image of the abnormal area is extracted and input into the pre-trained defect classification model to identify the defect type.

[0046] The training process of the defect classification model includes: Obtain a labeled wood board defect sample set, wherein the sample set includes multiple types of wood board defect images and their corresponding defect type labels; Divide the sample set into training set and validation set according to the preset ratio; Using a convolutional neural network as the basic framework, a network structure consisting of multiple convolutional layers, pooling layers, and fully connected layers was designed. The last layer used an activation function to output the probability distribution of defect types. Initialize the network parameters, input the training set images into the network, and calculate the error between the predicted results and the true labels using the cross entropy loss function; Use the stochastic gradient descent optimization algorithm to update the network parameters according to the calculated error; The model performance is regularly evaluated on the validation set. When the accuracy of the model on the validation set reaches the preset threshold, the model training is completed and the trap classification model is obtained.

[0047] In this embodiment, the process of abnormal area monitoring and defect type identification is as follows: First, monitor the abnormal areas obtained in the previous step. If the abnormal area list is empty, that is, no abnormal areas are detected, the board is directly judged to be defect-free and the test result can be marked as qualified.

[0048] If abnormal areas are detected, the images of these areas will be further extracted. The specific operation is to crop the corresponding sub-block images from the original image of the wood board to be detected according to the position coordinates (i, j) of the abnormal area. In order to retain the complete information of the defect edge, Next, the extracted abnormal area 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: First, a large number of images of wood planks containing various defects were collected. Experienced quality inspection experts annotated these images and identified the defect types. This resulted in a sample set of 10,000 defect images, covering defect types such as knots, cracks, wormholes, decay, and discoloration, with approximately 1,500 to 2,000 samples of each defect type.

[0049] Then, the sample set is divided into a training set and a validation set in a ratio of 8:2. The training set is used to learn the model parameters, and the validation set is used to evaluate the model performance and prevent overfitting.

[0050] Next, a defect classification model was designed and constructed. The model uses a convolutional neural network as its basic framework and can include five convolutional layers, three pooling layers, and two fully connected layers. The specific structure can be as follows: the input layer receives the image, the first convolutional layer uses 64 3×3 convolution kernels, followed by a ReLU activation function and a maximum pooling layer; the second to fifth convolutional layers use 128, 256, 512, and 512 convolution kernels, respectively, each followed by a ReLU activation function, and a maximum pooling layer is added after the third and fifth convolutional layers; this is followed by two fully connected layers with 1024 and 512 neurons, respectively, each followed by a dropout layer to prevent overfitting; and finally, the output layer contains neurons corresponding to the number of defect types, and uses a softmax activation function to output the probability distribution of each defect type.

[0051] During model training, the network parameters are randomly initialized, and then the training set images are batch-fed into the network. A 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 this error. The learning rate is initially set to 0.001, and a learning rate decay strategy is used, reducing the learning rate to 90% of its original value every 10 training epochs.

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

[0053] Returning to the defect detection process, when an image of an abnormal area is fed into a trained classification model, the model outputs the most likely defect type and its probability for that area. A confidence threshold strategy can be employed, whereby the prediction is only accepted if the probability exceeds a preset threshold (set to 0.85 in this example). Otherwise, the area is marked as an unknown defect, requiring further manual inspection.

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

[0055] This deep learning-based defect classification method offers significant advantages over traditional rule-based or simple feature-based methods. It can automatically learn the complex feature representations of various defects, adapting to variations in wood species and defect morphology, significantly improving classification accuracy and robustness.

[0056] Through the above complete detection process, this embodiment achieves high-precision automatic detection and classification of wood board defects, significantly improves the efficiency and accuracy of wood quality control, reduces labor costs for wood processing companies, and improves product quality and competitiveness.

[0057] Example 2 See also Figure 2 The present invention provides a wood board surface defect detection system based on industrial vision, which is used to implement a wood board surface defect detection method based on industrial vision, including: a standard library construction module for acquiring historical visual data of wooden boards, selecting visual data of defect-free wooden boards and corresponding raw material information, and classifying and storing the acquired visual data of wooden boards according to the raw material information to construct a standard wooden board reference library, wherein the visual data of wooden boards includes wooden board images and image descriptions; Real-time acquisition module, used to obtain the raw material information and visual data of the wood board to be inspected; The reference image selection module is used to select a number of wood board images from the standard wood board reference library according to the raw material information and wood board visual data of the wood board to be tested, so as to form a reference image set; An image comparison and analysis module is used to compare and analyze the image of the wood board to be inspected with the images of the wood boards in the reference image set to obtain abnormal areas; The defect recognition module is used to monitor abnormal areas. If the abnormal area is empty, the board is judged to be defect-free. Otherwise, the image of the abnormal area is extracted and input into the pre-trained defect classification model to identify the defect type.

[0058] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only one type. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0059] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be covered by the scope of protection of the present invention.

[0060] Finally: 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 in the scope of protection of the present invention.

Claims

1. A method for detecting wood board surface defects based on industrial vision, characterized in that: include: 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, wherein the visual data of wooden boards includes wooden board images and image descriptions; Obtaining the raw material information and visual data of the wood board to be inspected; According to the raw material information and visual data of the wood board to be inspected, a number of wood board images are selected from the standard wood board reference library to form a control image set; Compare and analyze the image of the wood board to be tested with the images of the wood boards in the reference image set to obtain abnormal areas; Monitor the abnormal area. If the abnormal area is empty, the board is judged to be defect-free. Otherwise, the image of the abnormal area is extracted and input into the pre-trained defect classification model to identify the defect type.

2. The method for detecting wood board surface defects 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 wood board surface defects based on industrial vision according to claim 2, characterized in that: The step of acquiring the image features includes: The image is converted into a grayscale image and grayscale quantization is performed to map the pixel values to a predetermined number of grayscale levels; a grayscale co-occurrence matrix of the image in at least four directions is constructed; the constructed grayscale co-occurrence matrix is normalized; statistical features are extracted from the normalized grayscale co-occurrence matrix, including contrast, energy, homogeneity, correlation and entropy; the extracted statistical features are normalized, and the feature vector of the image is constructed as the image feature.

4. The method for detecting wood board surface defects based on industrial vision according to claim 3, characterized in that: The method of selecting a plurality of wood board images from the standard wood board reference library to form a control image set includes: Based on the raw material information of the wood board to be inspected, visual data of wood boards with the same wood species, age, origin, and cutting method are selected from the standard wood board reference library. Furthermore, visual data of wood boards with the same image size are further selected based on the visual data of the wood board to be inspected. Calculate the similarity between the image features of the wood board to be detected and the image features obtained by screening, 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 first N wood board images with the highest similarity are selected as the control image set, where N is an integer greater than 2.

5. The method for detecting wood board surface defects based on industrial vision according to claim 1, characterized in that: Comparing and analyzing the image of the wood board to be detected with the images of the wood boards in the reference image set to obtain the abnormal area includes: The wooden board image of the wooden board to be detected and the wooden board images in the reference image set are equally divided into M sub-blocks, where M is an integer greater than 2; Encode the position of each sub-block and use row and column coordinates (i, j) to represent it; For each sub-block position (i, j) of the wood board image to be detected, traverse the corresponding sub-blocks of all wood board images in the reference image set; Determine whether the sub-block at position (i, j) of the wood board image to be detected is similar to the sub-block at the same position in the reference image set; and count the number of dissimilar sub-blocks; The abnormality degree is obtained by dividing the number of dissimilar sub-blocks by the total number of wood board images in the control image set; When the abnormality of a sub-block is greater than the preset abnormality threshold, it is located as an abnormal area.

6. The method for detecting wood board surface defects based on industrial vision according to claim 5, characterized in that: The step of determining whether the sub-block at position (i, j) of the detected wooden board image is similar to the sub-block at the same position in the reference image set comprises: Calculate the color feature similarity of the two sub-blocks. If the color feature similarity is less than a preset color similarity threshold, 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, the texture feature similarity of the two sub-blocks is calculated; if the texture feature similarity is less than the preset texture similarity threshold, 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 of 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 a preset structural similarity threshold, the two sub-blocks are determined to be similar.

7. The method for detecting wood board surface defects based on industrial vision according to claim 6, characterized in that: The color feature similarity calculation step includes: extracting color histograms of the two sub-blocks, counting 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 a histogram intersection method to calculate the similarity of the two color histograms as the color feature similarity; The step of calculating the texture feature similarity includes: calculating the gray level co-occurrence matrix for each of the two sub-blocks, extracting contrast, energy, homogeneity, correlation and entropy from the matrix to form a texture feature vector, and then calculating the cosine similarity between the two texture feature vectors as the texture feature similarity; The steps of calculating the structural feature similarity include: applying the Sobel operator to extract gradient information from the two sub-blocks respectively, calculating the gradient direction histogram, and calculating the structural feature similarity using a structural similarity measurement formula.

8. The method for detecting wood board surface defects based on industrial vision according to claim 7, characterized in that: The training process of the defect classification model includes: Obtain a labeled wood board defect sample set, wherein the sample set includes multiple types of wood board defect images and their corresponding defect type labels; Divide the sample set into training set and validation set according to the preset ratio; Using a convolutional neural network as the basic framework, a network structure consisting of multiple convolutional layers, pooling layers, and fully connected layers was designed. The last layer used an activation function to output the probability distribution of defect types. Initialize the network parameters, input the training set images into the network, and calculate the error between the predicted results and the true labels using the cross entropy loss function; Use the stochastic gradient descent optimization algorithm to update the network parameters according to the calculated error; The model performance is regularly evaluated on the validation set. When the accuracy of the model on the validation set reaches the preset threshold, the model training is completed and the trap classification model is obtained.

9. A wood board surface defect detection system based on industrial vision, used to implement the wood board surface defect detection method based on industrial vision according to any one of claims 1 to 8, characterized in that: include: a standard library construction module for acquiring historical visual data of wooden boards, selecting visual data of defect-free wooden boards and corresponding raw material information, and classifying and storing the acquired visual data of wooden boards according to the raw material information to construct a standard wooden board reference library, wherein the visual data of wooden boards includes wooden board images and image descriptions; Real-time acquisition module, used to obtain the raw material information and visual data of the wood board to be inspected; The reference image selection module is used to select a number of wood board images from the standard wood board reference library according to the raw material information and wood board visual data of the wood board to be tested, so as to form a reference image set; An image comparison and analysis module is used to compare and analyze the image of the wood board to be inspected with the images of the wood boards in the reference image set to obtain abnormal areas; The defect recognition module is used to monitor abnormal areas. If the abnormal area is empty, the board is judged to be defect-free. Otherwise, the image of the abnormal area is extracted and input into the pre-trained defect classification model to identify the defect type.

Citation Information

Patent Citations

  • Visual inspection method and device for printing defects of corrugated paper packaging box

    CN111929323A

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

    CN113128335A

  • Part surface quality detection method and system based on machine vision

    CN118608504A

  • Wood board defect online detection method based on yov8 binocular vision

    CN119067920A

  • Method and its apparatus for detecting defect

    JP2007298505A

Cited By

  • Motorcycle cylinder cover production line quality detection method and system

    CN120806738A

  • Motorcycle cylinder head production line quality detection method and system

    CN120806738B

  • Agricultural machine intelligent detection system based on AI

    CN121256706A

  • Shaving board surface defect intelligent detection method and system based on machine vision

    CN121685465A