A machine vision-based intelligent detection method and system for surface defects of artificial boards
Through high-resolution image acquisition, multi-scale convolutional neural network and Mask R-CNN model, combined with the error correction algorithm of the deep learning model, the misjudgment problem of traditional visual systems in identifying multiple defects on the surface of artificial boards is solved, and efficient and accurate defect detection and production line automation control are achieved.
Patent Information
- Application Number
- CN202510476961.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-04-16
AI Technical Summary
When there are multiple defects on the surface of artificial boards, traditional machine vision systems have difficulty accurately identifying and classifying adjacent or overlapping defects, and are prone to misjudgment or omission.
A high-resolution industrial camera is used to capture and preprocess images, and a multi-scale convolutional neural network and Mask R-CNN model are used for feature extraction and segmentation. The non-maximum suppression algorithm is used to remove redundant frames, and a deep learning model is used to combine the spatial relationship and morphological characteristics of defects for error correction.
It achieves accurate identification and classification of various defect types, improves the accuracy and robustness of detection, and can provide real-time feedback of defect information to the production line control system, automatically eliminating defective products or adjusting the production process, thereby improving the automation and intelligence level of the production process.
Smart Images

Figure CN120355688B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial board surface defect detection, and in particular to an artificial board surface defect intelligent detection method and system based on machine vision. Background Art
[0002] Intelligent surface defect detection for artificial boards utilizes artificial intelligence (AI) technologies, particularly computer vision and deep learning algorithms, to automatically detect defects on the surfaces of artificial boards (such as medium-density fiberboard and particleboard). This detection method uses a camera to capture images of the board surface. Intelligent algorithms then analyze the images to identify various surface defects, such as cracks, bubbles, scratches, and color variations. However, when multiple defects are present on the board surface, traditional machine vision systems may experience interference between the defects. For example, if multiple cracks or bubbles are close together, the system may misidentify them as a single, larger defect, or misclassify similar defects as different types, leading to misclassification. Summary of the Invention
[0003] The purpose of the present invention is to provide a method and system for intelligent detection of surface defects of artificial boards based on machine vision, so as to solve the shortcomings of the background technology.
[0004] In order to achieve the above-mentioned object, the present invention provides the following technical solution: a method for intelligent detection of surface defects of artificial boards based on machine vision, comprising:
[0005] Use high-resolution industrial cameras to capture and pre-process images of the wood-based panel surface;
[0006] A multi-scale convolutional neural network is used to extract features from the preprocessed image. The shallow convolution layer is used to extract the detailed features of small defects, and the deep convolution layer is used to extract the global features of large defects, and generate a feature fusion map.
[0007] Based on the extracted feature fusion map, the Mask R-CNN model is used to segment the defect area, and the non-maximum suppression algorithm is used to remove redundant detection frames;
[0008] Each defect area after segmentation is classified and the defect type is identified using a deep learning model. For interference between adjacent defects, the spatial relationship and morphological characteristics between the defects are combined and classified and corrected using an error correction algorithm.
[0009] The defect information is fed back to the production line control system in real time, and the control system automatically removes defective products or adjusts production process parameters based on the feedback information.
[0010] Preferably, a high-resolution industrial camera is used to capture the surface image of the artificial board, and denoising, grayscale and contrast enhancement processing are performed.
[0011] Preferably, after extracting shallow and deep features, the feature maps of different layers are fused: the feature maps output by the shallow convolution layer and the deep convolution layer are spliced in the channel dimension to obtain a multi-scale feature map. By assigning different weights to the shallow and deep feature maps, they are weighted summed. The fused feature map is passed as input to the convolution layer to further extract features, and the final classification or regression task is performed through the fully connected layer to identify the specific defect type and location.
[0012] Preferably, the Mask R-CNN model first uses a convolutional neural network as a feature extractor to extract a feature map from the input feature fusion map. Based on the feature map, the region proposal network (RPN) generates candidate regions. The RPN generates multiple candidate boxes using a sliding window method to mark the areas where defects exist. Each candidate box is assigned a confidence score to indicate whether there is a defect in the area. The candidate regions generated by the RPN are mapped back to the feature map and aligned through the RoIAlign layer.
[0013] For each candidate region, the Mask R-CNN model uses a convolution operation to perform secondary processing on it, thereby generating a binary mask for each region. The generated mask can segment the edges of the defective region, and classify each region according to the characteristics of the candidate region to identify different types of defects.
[0014] Preferably, a non-maximum suppression algorithm is used to remove redundant frames:
[0015] First, the candidate boxes are sorted in descending order according to their confidence scores. The confidence scores indicate the reliability of the candidate area as a defect area.
[0016] From the sorted candidate frames, select the frame with the highest confidence as the reference frame, and consider the reference frame as the final detection frame;
[0017] For the remaining candidate boxes, calculate their overlap with the reference box, usually measured by Intersection over Union (IoU), which represents the ratio of the overlapping area of two boxes to their union area.
[0018] If the IoU value of two boxes exceeds the set threshold, they are considered redundant boxes and the boxes with high overlap are removed. Otherwise, the candidate boxes are retained.
[0019] Preferably, the method for obtaining the bounding box overlap rate is as follows: defining two bounding boxes: a real box represents the actual position of the object, and a predicted box represents the position of the object predicted by the model;
[0020] Calculate the intersection area. The intersection area is the rectangular area where the two bounding boxes overlap. Calculate the area of the intersection area: the width and height of the intersection are: ; ; The intersection area Aint is: ; Calculate the area of the union region: the areas of the true box and the predicted box are: Agt=(x2−x1)×(y2−y1), Apred=(p3−p1)×(p4−p2); x1, y1 are the coordinates of the upper left corner of the true box, x2, y2 are the coordinates of the lower right corner of the true box, p1, p2 are the coordinates of the upper left corner of the predicted box, and p3, p4 are the coordinates of the lower right corner of the predicted box;
[0021] The union area Aunion is: ; The union area is equal to the total area of the two boxes minus the intersection area; the bounding box overlap ratio is the ratio of the intersection area to the union area: ; Among them, Aint is the area of the intersection area, Agt is the area of the true box, Apred is the area of the predicted box, and Aunion is the area of the union area, which represents the total area of the two boxes minus the overlapping part.
[0022] Preferably, the morphological feature analysis includes calculating the morphological feature similarity difference value: extracting morphological features for each defect area: area A: representing the size of the defect area, aspect ratio: circularity, perimeter P;
[0023] Calculate the difference in morphological features: For two defect areas, their morphological features are represented as vectors: V1=(A1,Aspect Ratio1,Circularity1,P1) and V2=(A2,Aspect Ratio2,Circularity2,P2), where each vector element represents the corresponding morphological feature. Calculate the morphological feature similarity difference value. The difference between the two defect morphological features is calculated using the Euclidean distance as the morphological feature similarity difference value.
[0024] Preferably, the bounding box overlap ratio and the morphological feature similarity difference value are normalized so that both are between [0, 1], and the normalized bounding box overlap ratio and morphological feature similarity difference value are weightedly summed to calculate the defect assessment factor;
[0025] The obtained defect assessment factor is compared with the preset threshold. If the defect assessment factor is greater than or equal to the preset threshold, the detection area is divided into a defect area; if the defect assessment factor is less than the preset threshold, the detection area is divided into a normal detection area.
[0026] Preferably, by analyzing the spatial relationship and morphological characteristics of the defects, an error correction algorithm is designed to perform classification correction:
[0027] Use the deep learning model to independently classify each defect area to obtain the preliminary type of each defect, and cluster the defect features using the adjacency matrix and spatial relationship rules;
[0028] For each clustering area, determine whether the defects in the area belong to the same defect. If the morphological features of adjacent defects are similar and their spatial positions have a high degree of overlap, they are merged into one defect.
[0029] The merged defective areas will be reclassified as a whole;
[0030] In the case of misclassification, the classification results of adjacent defects are corrected through the algorithm.
[0031] The present invention also provides an intelligent detection system for surface defects of artificial boards based on machine vision, which includes an image acquisition and processing module, a feature extraction module, a defect segmentation module, an error correction module and a feedback control module;
[0032] Image acquisition and processing module: uses a high-resolution industrial camera to capture images of the surface of the artificial board and performs preprocessing;
[0033] Feature extraction module: Uses a multi-scale convolutional neural network to extract features from the preprocessed image. The shallow convolution layer is used to extract the detailed features of small defects, and the deep convolution layer is used to extract the global features of large defects, and generate a feature fusion map.
[0034] Defect segmentation module: Based on the extracted feature fusion map, the Mask R-CNN model is used to segment the defect area, and the non-maximum suppression algorithm is used to remove redundant detection frames;
[0035] Error correction module: Classifies each defect area after segmentation and uses a deep learning model to identify the defect type. For interference between adjacent defects, the error correction algorithm is used to classify and correct the defects based on their spatial relationship and morphological characteristics.
[0036] Feedback control module: Feedback defect information to the production line control system in real time. The control system automatically removes defective products or adjusts production process parameters based on the feedback information.
[0037] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0038] 1. This invention combines deep learning and computer vision technologies to automatically detect defects on the surface of wood-based panels using high-resolution industrial cameras. This method accurately identifies various defect types, such as cracks, bubbles, and scratches. It uses a multi-scale convolutional neural network and Mask R-CNN model for efficient feature extraction and defect segmentation, addressing the interference issues that traditional vision systems encounter when defects are adjacent or overlapping. By providing real-time feedback of defect information to the production line control system, the system can automatically remove defective products or adjust production process parameters, effectively reducing manual intervention and improving the automation and intelligence of the production process.
[0039] 2. The error correction algorithm of this invention further optimizes defect classification by incorporating spatial relationships and morphological characteristics between defects, improving the accuracy and robustness of the system. The application of this system not only improves production line inspection efficiency but also significantly enhances product quality consistency, reduces losses caused by human misjudgment, and lowers production costs. As the system adaptively optimizes the production environment, inspection accuracy and production efficiency are gradually improved, promoting the intelligent upgrade of the wood-based panel production process. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments described in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0041] Figure 1 This is a mind map of the method of the present invention.
[0042] Figure 2 This is a mind map of the system modules of the present invention. DETAILED DESCRIPTION
[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0044] Example 1, please refer to Figure 1 As shown, the present embodiment provides a method for intelligently detecting surface defects of artificial boards based on machine vision, comprising:
[0045] Use high-resolution industrial cameras to capture and pre-process images of the wood-based panel surface;
[0046] A multi-scale convolutional neural network is used to extract features from the preprocessed image. The shallow convolution layer is used to extract the detailed features of small defects, and the deep convolution layer is used to extract the global features of large defects, and generate a feature fusion map.
[0047] Based on the extracted feature fusion map, the Mask R-CNN model is used to segment the defect area, and the non-maximum suppression algorithm is used to remove redundant detection frames;
[0048] Each defect area after segmentation is classified and the defect type is identified using a deep learning model. For interference between adjacent defects, the spatial relationship and morphological characteristics between the defects are combined and classified and corrected using an error correction algorithm.
[0049] The defect information is fed back to the production line control system in real time, and the control system automatically removes defective products or adjusts production process parameters based on the feedback information.
[0050] High-resolution industrial cameras are installed at key locations on the wood-based panel production line to ensure that every detail of the panel surface is captured. The image capture resolution must meet the inspection accuracy requirements, typically at least 300 dots per inch (DPI) or higher. Industrial cameras should have high-speed acquisition capabilities to accommodate the high-frequency operation of the production line.
[0051] Use a camera to capture images of the wood-based panel surface, covering as much of the surface area as possible and ensuring that the captured images include all possible defects. The camera typically captures images at a rate of several to dozens of images per second, depending on the speed of the production line.
[0052] The camera position should be optimized according to the layout of the production line to minimize the impact of reflections, shadows, etc. on image quality. Typically, the camera is installed above or to the side of the production line to ensure that surfaces at different angles can be captured.
[0053] After image acquisition, it goes through a preprocessing step to enhance image quality and make defect features more prominent, facilitating subsequent defect identification. The specific steps are as follows:
[0054] Denoising: The captured images are often affected by noise, which may come from factors such as the camera sensor, ambient light, or surface reflection. In order to remove these unnecessary interference signals, appropriate denoising algorithms are used. For example:
[0055] Gaussian filtering: Apply the Gaussian filtering algorithm to smooth the image to remove high-frequency noise, especially the noise at the edge of the image, so as to keep the key features of the defect from being blurred.
[0056] Mean filtering: In some simple scenarios, mean filtering technology can also be used to denoise images.
[0057] Grayscale processing: Converting a color image to grayscale reduces computational effort and simplifies subsequent processing. In grayscale images, defects are often more pronounced through brightness variations, making them easier to distinguish from the background. This step is achieved by converting the RGB channel information in the image into brightness values.
[0058] Contrast enhancement: To make surface defects more noticeable, especially those tiny cracks, bubbles, etc., it is necessary to enhance the contrast of the image. Common contrast enhancement methods include:
[0059] Histogram equalization: By adjusting the pixel distribution of the image, the brightness value of the image is distributed more evenly, thereby increasing the contrast of the image and highlighting the defective areas.
[0060] Local contrast enhancement: Fine-tune the contrast of local areas of the image to make local defects easier to identify.
[0061] Edge enhancement: Using edge detection algorithms (such as the Sobel operator and Canny edge detection), we enhance image edges, making the edges of surface defects more distinct. Edge enhancement effectively highlights the outlines of defects such as cracks and scratches, facilitating subsequent defect location.
[0062] If the image captured by the camera has geometric distortion (for example, due to perspective effects caused by an incorrect camera angle or tilted surfaces), the image needs to be corrected for perspective. Typically, a perspective transformation matrix is used to restore the tilted image to its normal view, ensuring that the proportions and positions of objects in the image are correct.
[0063] Image quality on the surface of artificial boards can be affected by changes in ambient lighting, especially reflected light, which can affect the visibility of defects. In this case, a lighting equalization algorithm can be used to adjust the image lighting, making the contrast between the defect area and the background more obvious.
[0064] Based on the image's grayscale values, an appropriate threshold is set to binarize the image (i.e., the pixels in the image are divided into two categories, usually defective areas and non-defective areas, based on the threshold). Binarization helps quickly segment the main defect areas in the image, providing a clear image foundation for subsequent feature extraction and classification.
[0065] During production line operation, every image undergoes the aforementioned preprocessing steps to ensure optimal image quality. Real-time and efficient image preprocessing is crucial to ensuring the proper functioning of the entire inspection system, especially in high-speed production environments where every image frame must be processed promptly and accurately.
[0066] The preprocessed images will be passed to the subsequent deep learning network for feature extraction, defect detection and classification, ensuring that defects can be accurately identified and located.
[0067] Through the above detailed image acquisition and preprocessing steps, this embodiment ensures that the machine vision system can stably and accurately capture and process defect images of the surface of artificial boards in a complex production environment, providing high-quality image data support for subsequent defect detection, classification and production line control.
[0068] This example uses a multi-scale convolutional neural network to extract features from preprocessed images. The network consists of multiple convolutional layers, divided into shallow and deep layers, each used to extract features at different scales. Shallow convolutional layers capture the detailed features of small defects in the image, while deep convolutional layers primarily extract the global features of large defects. This multi-scale structure enables the network to simultaneously identify defects of varying sizes and shapes, improving detection accuracy.
[0069] Shallow convolutional layer:
[0070] Feature extraction: Shallow convolutional layers focus on local details in the image, such as tiny cracks, scratches, or bubbles. Through multiple convolution operations, these layers are able to extract texture information, edge features, and pattern variations within a small area.
[0071] Convolution kernel size: Shallow convolution layers use small convolution kernels (such as 3x3 or 5x5) to finely capture small defect details in the image. At this stage, the stride of the convolution layer is usually small to preserve higher resolution features.
[0072] Activation function: The output of the shallow convolutional layer undergoes nonlinear transformation through an activation function (such as ReLU), which increases the representation capability of the model and enables accurate extraction of features of tiny defects.
[0073] Deep convolutional layer:
[0074] Feature extraction: Deep convolutional layers are used to extract global features of large defects in the image, such as large cracks, obvious bubbles, or surface depressions. At this point, the deep convolutional layers begin to focus on a wider range of image content and identify more complex defect morphologies.
[0075] Convolution kernel size: Deep convolution layers use larger convolution kernels (such as 7x7 or 9x9) to capture global information and identify large defects. The stride is larger to reduce computational complexity and enhance the expression of global features.
[0076] Activation function and pooling: The output of the deep convolutional layer is activated by an activation function (such as ReLU) and a pooling layer (such as maximum pooling or average pooling) is used for dimensionality reduction to further extract high-level information of the features while reducing the spatial resolution of the features to ensure that the features are expressed at a larger scale.
[0077] Feature fusion map generation:
[0078] Feature map fusion: After extracting shallow and deep features, the system fuses the feature maps of different layers. Through feature fusion, the detailed features of small defects are combined with the global features of large defects. Common fusion methods include:
[0079] Feature splicing: The feature maps output by the shallow convolutional layer and the deep convolutional layer are spliced in the channel dimension to obtain a multi-scale feature map. This method helps to preserve the different scale information extracted by each convolutional layer.
[0080] Weighted summation: This method assigns different weights to shallow and deep feature maps and performs a weighted summation. This method fuses feature maps based on their importance, ensuring that important features have a greater impact on the final result.
[0081] Fused feature map: The fused feature map contains information about defects at all scales in the image, helping the inspection system better identify defects of different sizes and shapes. This feature map is passed to subsequent layers of the network for further processing, such as defect classification and localization.
[0082] The fused feature map will be passed as input to the subsequent convolutional layer to further extract high-level features, and the final classification or regression task will be performed through the fully connected layer to identify the specific defect type and location.
[0083] During the network training process, a large number of labeled defect images are used for supervised learning, and the network weights are optimized through the back-propagation algorithm, so that the accuracy of feature extraction is continuously improved.
[0084] A multi-scale convolutional neural network is used to extract features from preprocessed images. Shallow convolutional layers can extract detailed features of small defects, while deep convolutional layers can capture the global characteristics of large defects. The generated feature fusion map effectively combines feature information at different scales, enhancing the network's ability to recognize defects of varying sizes and types. Ultimately, the fused feature map provides a solid foundation for subsequent defect classification and location, improving detection accuracy and robustness.
[0085] In a multi-scale convolutional neural network (CNN), the aforementioned steps yield a fusion map that combines shallow and deep features. This fusion map contains defect information at different scales, including local features for small defects and global features for larger defects. This fusion map serves as input to the Mask R-CNN model.
[0086] Mask R-CNN model architecture:
[0087] Backbone Network: The Mask R-CNN model first uses a convolutional neural network (such as ResNet or VGG) as a feature extractor to extract high-level feature maps from the input feature fusion map. These feature maps capture the spatial information of defects and provide the possible defect locations in each region.
[0088] Region Proposal Network (RPN): Based on the feature map, the RPN generates candidate regions (region proposals). Using a sliding window, the RPN generates multiple candidate boxes, identifying areas where defects may exist. Each candidate box is assigned a confidence score, indicating whether the region contains a defect.
[0089] RoIAlign layer: Through the RoIAlign (Region of Interest Align) layer, the candidate regions generated by the RPN are mapped back to the feature map and aligned to ensure that the size of each candidate box is consistent. This step can more accurately refine the candidate boxes, providing more accurate input for subsequent classification and segmentation.
[0090] Defect area segmentation:
[0091] Secondary Convolution: The Mask R-CNN model performs a secondary convolution operation on each candidate region, generating a binary mask for each region. This mask represents the precise pixel location of the defect within the candidate frame. The generated mask enables fine-grained segmentation of the defect region's edges, ensuring clear and visible defect outlines.
[0092] Classification: Mask R-CNN not only generates masks but also classifies defect categories, such as cracks, bubbles, and scratches. The model classifies each candidate region based on its characteristics and identifies different types of defects.
[0093] Non-maximum suppression (NMS):
[0094] Redundant box removal: After Mask R-CNN generates multiple candidate boxes and assigns them confidence levels, multiple detection boxes may overlap the same defect area. To avoid duplicate defect detection due to multiple overlapping boxes, which could affect subsequent defect location and classification, the non-maximum suppression (NMS) algorithm is used to remove redundant boxes.
[0095] NMS algorithm steps:
[0096] Candidate box sorting: First, the candidate boxes are sorted in descending order based on their confidence score. The confidence score indicates the reliability of the candidate area as a defect area.
[0097] Select a high-confidence box: From the sorted candidate boxes, select the box with the highest confidence as the reference box, and consider this box as the final detection box.
[0098] Calculate overlap: For the remaining candidate boxes, calculate their overlap with the reference box, usually measured by Intersection over Union (IoU). The IoU value represents the ratio of the overlapping area of two boxes to their union area.
[0099] Threshold judgment: If the IoU value of two boxes exceeds the set threshold (usually 0.5), they are considered redundant boxes and the box with higher overlap is removed. Otherwise, the candidate box is retained.
[0100] Repeat: Repeat the above steps until all candidate boxes have been processed.
[0101] Segmentation result output:
[0102] Defective region calibration: Mask R-CNN uses segmentation masks to accurately extract pixel information for each defective region and classify its defect type based on the classification results. Finally, after performing non-maximum suppression, the bounding box of each defective region, along with its corresponding defect category and precise mask, is output.
[0103] Defect location and type output: Each detected defect area is accompanied by its location (represented by a bounding box), type (such as cracks, bubbles, etc.), and defect mask information as input for subsequent defect assessment and production line control.
[0104] The defect area, defect type and mask information optimized by NMS are transmitted to the production line control system to automatically remove defective products or adjust the production process (such as adjusting temperature, pressure, etc.).
[0105] By using the Mask R-CNN model to segment defect areas from the feature fusion image and removing redundant detection frames using the non-maximum suppression algorithm, the accuracy and robustness of defect detection can be significantly improved. This method can accurately segment the edges of each defect while effectively eliminating redundancy caused by overlapping candidate frames, providing high-quality data support for subsequent defect classification and production line control.
[0106] In the preceding steps, the Mask R-CNN model segmented the defect regions within the input feature fusion image and used the non-maximum suppression (NMS) algorithm to remove redundant detection boxes, ensuring the accurate location of each individual defect region. After these steps, the system generated a bounding box for each defect and a corresponding mask, where each mask represents the precise pixel location of the defect.
[0107] Defect type classification:
[0108] Deep learning model classification: After obtaining the mask of each defect area, the deep learning model is used to classify each defect type. The purpose of the classification task is to identify different types of defects (such as cracks, bubbles, scratches, etc.). The specific steps are as follows:
[0109] Feature extraction: Each segmented defect region mask is used as input for feature extraction via a deep convolutional neural network (CNN). The model extracts features based on local details, texture, shape, and other aspects to distinguish different types of defects.
[0110] Fully connected layer classification: After feature extraction, the extracted high-dimensional features are input into the fully connected layer for processing, ultimately outputting the classification results for each defect area. The output of the classification task is typically a probability distribution, indicating the probability of the defect belonging to a different type (such as crack, bubble, scratch, etc.).
[0111] Softmax activation function: The classification layer typically uses the Softmax activation function to handle multi-category tasks. By calculating the probability of each category, the type of defect area is ultimately determined. Each defect area is assigned to a category based on the highest probability value.
[0112] Defect type identification process:
[0113] Training Datasets: Deep learning model training requires a large, labeled dataset containing images of known defect types, each labeled with the defect type. Through supervised learning, the model can learn the characteristics of different defect types.
[0114] For example, cracks typically appear linear or curved, bubbles may appear as circular or oval localized bulges, and scratches are typically long, thin ribbons. By learning these features, the model can identify and classify different types of defects.
[0115] Multi-class classification: This embodiment supports classification of multiple defect types and can identify multiple defect categories, including but not limited to cracks, bubbles, scratches, dents, and color differences. Each defect area is assigned a category label, such as "crack," "bubble," or "scratch," and a confidence score for that category is given.
[0116] Defect type post-processing:
[0117] Confidence Threshold: For each defect type classification result, a confidence threshold is set. Only when the confidence level of the classification result exceeds the set threshold is the area considered to be a specific defect type. For example, when the confidence level is below 0.8, the area may be marked as "pending" or "other" to avoid misclassification.
[0118] Output defect type: After the deep learning model's classification and post-processing steps, each defect region is assigned a specific defect type. For example, one region might be identified as a "crack" and assigned a high confidence value, such as 0.95, while another region might be identified as a "bubble" with a confidence value of 0.87.
[0119] Defect type identification result output:
[0120] Defect type and location: Each segmented defect area will output the following information:
[0121] Defect location: The location of the defect area is calibrated by the bounding box coordinates, usually a rectangular box in the image, indicating the location of the defect in the image.
[0122] Defect type: The type label of each defect (such as crack, bubble, scratch, etc.) and its corresponding confidence score, indicating the probability that the defect belongs to a certain type.
[0123] Mask information: The mask of the defect area can be used to accurately describe the pixel range of the defect, helping with subsequent defect processing.
[0124] Information such as defect type, location, and confidence level is transmitted to the production line control system. The control system then takes appropriate action based on the defect type. For example, if a bubble defect is detected, production parameters are automatically adjusted; if a crack or scratch defect is found, unqualified products may need to be rejected.
[0125] The classification results can also be used to record and analyze production data. Through statistical analysis of defect types, quality problems in the production process can be identified and optimized and improved.
[0126] By using deep learning models to classify and identify defect types, this embodiment can accurately identify each defect type and provide detailed defect location and classification information. This not only provides a basis for quality control on the production line, but also improves the automation and intelligence level of the inspection system, ensuring the consistency and reliability of product quality.
[0127] In practical applications, the surface of artificial boards may contain multiple adjacent defects, such as cracks, bubbles, or scratches. These defects may touch or overlap in the image. Due to the proximity and morphological similarity of these defects, traditional defect classification methods may result in misclassification or omission, especially between morphologically similar defect types. For example, two adjacent small cracks may be misclassified as one large crack, or two morphologically similar defects may be incorrectly classified as different types. To address this issue, an error correction algorithm is used to perform classification correction based on the spatial relationship and morphological characteristics of the defects.
[0128] Spatial relationship modeling:
[0129] Adjacency Matrix Construction: First, using the location and size information of the defect regions, an adjacency matrix is constructed between defects. Each defect region is demarcated in the image by its bounding box. Defects that are spatially close or have similar morphology are associated in the adjacency matrix. For example, if the distance between the bounding boxes of two defects is less than a set threshold, they are considered adjacent defects and are marked in the adjacency matrix.
[0130] Spatial Relationship Rules: By setting spatial relationship rules, the system can identify the relationship between adjacent defects, such as whether they belong to the same physical defect. For example, if two defects are of similar type and have a large spatial overlap, they may be different parts of the same defect. This rule can be set based on the bounding box overlap ratio (IoU value). If the IoU value of two defects exceeds a set threshold, they are considered to belong to the same physical defect.
[0131] The bounding box overlap ratio is obtained by defining two bounding boxes: The ground truth box represents the actual position of the object. It is usually represented by the coordinates of its upper left corner (x1, y1) and lower right corner (x2, y2), indicating the boundaries of the rectangle.
[0132] Prediction box: This represents the object's predicted location as determined by the model. It is also represented by its upper left corner coordinates (p1, p2) and lower right corner coordinates (p3, p4).
[0133] Calculate the intersection area: The intersection area is the rectangular area where the two bounding boxes overlap. The coordinates of its upper left corner and lower right corner can be calculated:
[0134] The upper left corner of the intersection area: xint=max(x1,p1), yint=max(y1,p2);
[0135] The lower right corner of the intersection area: xint2=min(x2,p3), yint2=min(y2,p4);
[0136] If the width or height of the intersection area is negative, it means that the two boxes do not overlap and the intersection area is 0.
[0137] Calculate the area of the intersection:
[0138] The width and height of the intersection are:
[0139] ; ;
[0140] The intersection area Aint is: ;
[0141] If the width or height of the intersection is negative, Aint=0, indicating no intersection.
[0142] Compute the area of the union:
[0143] The areas of the real box and the predicted box are:
[0144] Agt=(x2−x1)×(y2−y1), Apred=(p3−p1)×(p4−p2);
[0145] The union area Aunion is: ; The union area is equal to the total area of the two boxes minus the intersection area.
[0146] Bounding box overlap ratio is the ratio of the intersection area to the union area: ; If IoU is close to 1, it means that the two bounding boxes overlap very much; if it is close to 0, it means that the two boxes have almost no overlap. Where: x1, y1: coordinates of the upper left corner of the true box. x2, y2: coordinates of the lower right corner of the true box. p1, p2: coordinates of the upper left corner of the predicted box. p3, p4: coordinates of the lower right corner of the predicted box. Aint: area of the intersection region, representing the overlapping part of the two boxes. Agt: area of the true box. Apred: area of the predicted box. Aunion: area of the union region, representing the total area of the two boxes, minus the overlapping part.
[0147] Morphological characteristics analysis:
[0148] Morphological feature extraction: Analyzes the defect geometry based on the morphological features of each defect region (such as area, aspect ratio, roundness, and edge smoothness) extracted by a deep learning model. Morphological features can be used to further determine whether two adjacent defects share the same or similar morphological features. For example, if two adjacent defects have similar areas and shapes, the system may identify them as different parts of the same defect.
[0149] Similarity Judgment: For defects with similar morphological features, similarity metrics (such as cosine similarity and Euclidean distance) are used for judgment. If the morphological features of two adjacent defects are slightly different and located close together, they can be considered to belong to the same defect type.
[0150] Calculate the morphological feature similarity difference value: extract the following morphological features for each defect area:
[0151] Area A: Indicates the size of the defect area. A = width × height. Aspect Ratio: Indicates the aspect ratio of the defect. Aspect Ratio = length / width. Circularity: Indicates the degree of circularity of the defect, usually defined as: Where A is the area and P is the perimeter. The roundness of a circular object approaches 1, with the closer it is to 1, the rounder it is. Perimeter: This indicates the edge length of a defect.
[0152] Calculating the difference in morphological features: For two defect regions (assuming they are Region 1 and Region 2), their morphological features can be represented as vectors: V1 = (A1, Aspect Ratio 1, Circularity 1, P1) and V2 = (A2, Aspect Ratio 2, Circularity 2, P2), where each vector element represents the corresponding morphological feature. Calculate the morphological feature similarity difference value. The difference between the two defect morphological features is calculated using the Euclidean distance. The smaller the morphological feature similarity difference value, the more similar the two defect morphologies are. Based on the calculated morphological feature similarity difference value, a threshold can be set to determine whether the two defect regions belong to the same type. For example, when the morphological feature similarity difference value is less than a certain threshold (such as 0.5), the two defects are considered to have similar morphologies and may belong to the same physical defect. When the morphological feature similarity difference value is greater than or equal to a certain threshold (such as 0.8), they are considered to have similar morphologies.
[0153] The bounding box overlap ratio and the morphological feature similarity difference value are normalized so that they are both between [0, 1]. The defect assessment factor is calculated by weighted summing the normalized bounding box overlap ratio and morphological feature similarity difference value.
[0154] The obtained defect assessment factor is compared with the preset threshold. If the defect assessment factor is greater than or equal to the preset threshold, the detection area is divided into a defect area; if the defect assessment factor is less than the preset threshold, the detection area is divided into a normal detection area.
[0155] By analyzing the spatial relationship and morphological characteristics of defects, an error correction algorithm is designed to perform classification correction. The specific steps are as follows:
[0156] A deep learning model is used to independently classify each defect area and obtain the preliminary type of each defect (such as cracks, bubbles, scratches, etc.). At the same time, information such as the spatial location and morphological characteristics of each defect is recorded.
[0157] Defect features are clustered using the adjacency matrix and spatial relationship rules. For each cluster region, it is determined whether the defects within that region belong to the same defect. Adjacent defects with similar morphological features and a high degree of spatial overlap are merged into a single defect.
[0158] The merged defect areas are reclassified as a whole. The merged areas are then fed back into the classification model for accurate defect type identification. If defects were originally misclassified as different types, they will be more accurately identified as a single, unified defect type after merging.
[0159] In the event of misclassification, the algorithm corrects the classification results of adjacent defects. For example, two adjacent areas originally classified as "crack" and "scratch" may be corrected to the same defect type (such as a crack) after morphological feature analysis. Furthermore, if multiple defects belong to the same physical defect, the system will classify them as a single large defect to avoid over-segmentation.
[0160] After error correction, all defect areas receive final classification results. These classifications include not only the defect type (e.g., cracks, bubbles, scratches, etc.), but also the specific location and size of the defect. For interference issues involving multiple adjacent defects, the corrected results accurately reflect the true defect type and distribution.
[0161] The final classification results are output to the production line control system for subsequent quality control and production adjustments. For example, if a "crack" defect is detected, the control system may automatically adjust the processing technology; if multiple adjacent "bubble" defects are found, the automatic rejection device may be activated.
[0162] Error correction algorithms can be continuously optimized based on feedback from actual production. By learning from new data, the model can continuously adjust spatial relationship rules and morphological feature judgment criteria, thereby improving the accuracy of classification corrections. The algorithm optimization process typically uses incremental learning and online learning methods to ensure that the system can adaptively improve performance in different production environments.
[0163] By combining the spatial relationships and morphological characteristics of defects and implementing an error correction algorithm, we can effectively address the problem of interference between adjacent defects. This algorithm not only improves classification accuracy but also prevents defects with similar morphology or close proximity from being misclassified as different types, thereby improving the robustness and accuracy of the intelligent detection system.
[0164] In this embodiment, a machine vision-based intelligent inspection system is used to detect defects on the surface of artificial boards. This information is fed back to the production line control system in real time, and defective products are automatically removed or production process parameters are adjusted based on this feedback, ensuring the stability and consistency of product quality. The following is a detailed description of this process:
[0165] The machine vision system on the production line uses high-definition industrial cameras to capture real-time images of the wood-based panels' surfaces. It then uses deep learning models (such as Mask R-CNN) to identify and classify defects. After image processing, the system identifies the location, type (e.g., cracks, bubbles, scratches), and size of each defect and calculates its distribution across the surface.
[0166] Once a defect is detected, the system will encapsulate the defect's detailed information (including defect type, location, size, confidence level, etc.) into a data packet. The data packet typically contains the following fields:
[0167] Defect ID: A number that uniquely identifies a defect.
[0168] Type: The classification result of the defect (such as cracks, bubbles, etc.).
[0169] Position coordinates: The coordinate information of the defect on the plate (such as the upper left corner and lower right corner of the bounding box).
[0170] Size information: defect area, aspect ratio, perimeter and other characteristics.
[0171] Confidence: The confidence of the model in defect classification, indicating the credibility of the classification result.
[0172] Data transmission to the production line control system: After defect information is extracted, the data packets are transmitted in real time to the production line's central control system via high-speed communication protocols (such as Ethernet / IP, Modbus TCP, and Profinet). Upon receiving the defect data packets, the production line control system further analyzes them and takes appropriate action.
[0173] The control system uses the location and type information in the received defect data packets to determine which products have defects. For example, if a "bubble" defect is detected, the control system will instruct the automatic rejection system to remove the defective product from the production line based on the location and size of the defect. The automatic rejection system can use the following devices:
[0174] Robotic arm rejection: The robot arm accurately locates the defective position and removes the defective product from the production line.
[0175] Air jet device: Based on the defect location information, the air jet device will be automatically triggered to "blow away" the defective products from the production line to prevent them from entering the next process.
[0176] Slide rail system: For small defects, the slide rails of the production line may be adjusted to guide the defective plates through the sorting system for automatic removal.
[0177] Automatic adjustment of production process parameters:
[0178] In addition to rejecting defective products, the production line control system will also automatically adjust the production process parameters based on the type of defects detected to optimize the production process and reduce the occurrence of defects. Common adjustment methods include:
[0179] Adjust temperature: If multiple "bubble" defects are detected, it means that there may be problems with temperature control in the production process. The control system will automatically adjust the temperature of the heating device to prevent bubbles from forming in the material due to overheating.
[0180] Adjusting pressure: When a large number of "cracks" or "uneven surface" defects are detected, it may be caused by insufficient or uneven pressure. The control system will adjust the pressure of the pressing equipment to ensure uniform pressure during the production process.
[0181] If the defect is caused by the production line speed being too fast or too slow, the system will automatically adjust the production line speed to ensure that each plate can get the appropriate processing time during the processing process, avoiding surface defects caused by operating too fast or too slow.
[0182] Based on real-time feedback, the control system also monitors real-time data from the production process and verifies the effectiveness of adjustments based on defect information and real-time data from the production process. If the adjusted process parameters still fail to effectively reduce defects, the control system will continue to adjust the process settings until the defect rate is reduced to an acceptable level.
[0183] Automatic optimization of process parameters: To improve production efficiency, the control system can also use data-driven methods to analyze trends in historical defect data and predict and optimize process parameters for future production. For example, based on past defect data, the system can predict the changing trends of certain production process parameters and automatically adjust production parameters to further reduce the defect rate.
[0184] The control system displays defect detection results and production process adjustments to the operator in real time. The interface displays detailed information about each defect (type, location, confidence level, etc.) and automatically adjusted production parameters. Operators can monitor the production process in real time, review the effectiveness of defect handling, and make decisions about further manual intervention.
[0185] If the number of detected defects exceeds a predetermined threshold (for example, the number or type of defects exceeds the acceptable range), the control system notifies operators or managers through an alarm system. This triggers emergency response procedures, such as halting the production line or initiating additional inspections, to ensure production quality is not compromised.
[0186] The control system also regularly generates production reports, including defect detection results, the number of defective products rejected, adjusted process parameters, and the overall quality status of the production line. These reports not only help the production line with quality control but also provide a basis for future production improvements.
[0187] The control system intelligently learns from historical defect data and production feedback, automatically optimizing defect detection models and production process parameters through machine learning algorithms. This adaptive optimization process enables the system to gradually improve its detection and adjustment accuracy as the production environment and raw materials change.
[0188] The system continuously collects and analyzes new data, adjusting algorithms and production process parameters in real time. For example, across different production batches, the system can automatically adjust defect detection models based on material differences, ensuring that each production line operates under optimal conditions.
[0189] By feeding back defect information to the production line control system in real time and automatically removing defective products or adjusting production process parameters based on the feedback information, this embodiment achieves a highly automated quality control process. This system not only improves production efficiency and reduces manual intervention, but also ensures high product quality and
[0190] Example 2, please refer to Figure 2 As shown, the machine vision-based intelligent detection system for surface defects of artificial boards described in this embodiment includes an image acquisition and processing module, a feature extraction module, a defect segmentation module, an error correction module, and a feedback control module;
[0191] Image acquisition and processing module: uses a high-resolution industrial camera to capture images of the surface of the artificial board and performs preprocessing;
[0192] Feature extraction module: Uses a multi-scale convolutional neural network to extract features from the preprocessed image. The shallow convolution layer is used to extract the detailed features of small defects, and the deep convolution layer is used to extract the global features of large defects, and generate a feature fusion map.
[0193] Defect segmentation module: Based on the extracted feature fusion map, the Mask R-CNN model is used to segment the defect area, and the non-maximum suppression algorithm is used to remove redundant detection frames;
[0194] Error correction module: Classifies each defect area after segmentation and uses a deep learning model to identify the defect type. For interference between adjacent defects, the error correction algorithm is used to classify and correct the defects based on their spatial relationship and morphological characteristics.
[0195] Feedback control module: Feedback defect information to the production line control system in real time. The control system automatically removes defective products or adjusts production process parameters based on the feedback information.
[0196] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.
[0197] It should be understood that the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. A and B can be singular or plural. Furthermore, the character " / " as used herein generally indicates an "or" relationship between the associated objects, but it may also indicate an "and / or" relationship. For specific understanding, please refer to the context.
[0198] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0199] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
Claims
1. A machine vision-based intelligent detection method for surface defects of artificial boards, characterized by: include: Use high-resolution industrial cameras to capture and pre-process images of the wood-based panel surface; A multi-scale convolutional neural network is used to extract features from the preprocessed image. The shallow convolution layer is used to extract the detailed features of small defects, and the deep convolution layer is used to extract the global features of large defects, and generate a feature fusion map. Based on the extracted feature fusion map, the Mask R-CNN model is used to segment the defect area, and the non-maximum suppression algorithm is used to remove redundant detection frames; Each defect area after segmentation is classified, and the defect type is identified using a deep learning model. For the interference of adjacent defects, the spatial relationship and morphological characteristics between the defects are combined and classified and corrected through an error correction algorithm, including: Use the deep learning model to independently classify each defect area to obtain the preliminary type of each defect, and cluster the defect features using the adjacency matrix and spatial relationship rules; For each clustering area, determine whether the defects in the area belong to the same defect. If the morphological features of adjacent defects are similar and their spatial positions have a high degree of overlap, they are merged into one defect. The merged defective areas will be reclassified as a whole; In the case of misclassification, the classification results of adjacent defects are corrected through the algorithm; The defect information is fed back to the production line control system in real time, and the control system automatically removes defective products or adjusts production process parameters based on the feedback information.
2. The method for intelligent detection of surface defects of artificial boards based on machine vision according to claim 1, characterized in that: A high-resolution industrial camera is used to capture images of the surface of artificial boards, and then denoising, grayscale conversion and contrast enhancement are performed.
3. The method for intelligent detection of surface defects of artificial boards based on machine vision according to claim 1, characterized in that: After extracting shallow and deep features, the feature maps of different layers are fused: the feature maps output by the shallow convolution layer and the deep convolution layer are spliced in the channel dimension to obtain a multi-scale feature map. By assigning different weights to the shallow and deep feature maps, they are weighted summed. The fused feature map is passed as input to the convolution layer for further feature extraction, and the final classification or regression task is performed through the fully connected layer to identify the specific defect type and location.
4. The method for intelligent detection of surface defects of artificial boards based on machine vision according to claim 3, characterized in that: The Mask R-CNN model first uses a convolutional neural network as a feature extractor to extract a feature map from the input feature fusion map. Based on the feature map, the region proposal network (RPN) generates candidate regions. The RPN uses a sliding window method to generate multiple candidate boxes to mark the areas with defects. Each candidate box is assigned a confidence score to indicate whether there is a defect in the area. The candidate regions generated by the RPN are mapped back to the feature map and aligned through the RoIAlign layer. For each candidate region, the Mask R-CNN model uses a convolution operation to perform secondary processing on it, thereby generating a binary mask for each region. The generated mask can segment the edges of the defective region, and classify each region according to the characteristics of the candidate region to identify different types of defects.
5. The method for intelligent detection of surface defects of artificial boards based on machine vision according to claim 4, characterized in that: Use non-maximum suppression algorithm to remove redundant frames: First, the candidate boxes are sorted in descending order according to their confidence scores. The confidence scores indicate the reliability of the candidate area as a defect area. From the sorted candidate frames, select the frame with the highest confidence as the reference frame, and consider the reference frame as the final detection frame; For the remaining candidate boxes, calculate their overlap with the reference box, usually measured by Intersection over Union (IoU), which represents the ratio of the overlapping area of two boxes to their union area. If the IoU value of two boxes exceeds the set threshold, they are considered redundant boxes and the boxes with high overlap are removed. Otherwise, the candidate boxes are retained.
6. The method for intelligent detection of surface defects of artificial boards based on machine vision according to claim 5, characterized in that: The bounding box overlap ratio is obtained by defining two bounding boxes: the ground truth box represents the actual position of the object, and the predicted box represents the object position predicted by the model; Calculate the intersection area. The intersection area is the rectangular area where the two bounding boxes overlap. Calculate the area of the intersection area. The intersection area Aint is: Aint = widthint × heightint, where widthint is the width of the intersection and heightint is the height of the intersection. Calculate the area of the union region. The areas of the real box and the predicted box are: Agt = (x2-x1) × (y2-y1), Apred = (p3-p1) × (p4-p2), x1, y1 are the coordinates of the upper left corner of the real box, x2, y2 are the coordinates of the lower right corner of the real box, p1, p2 are the coordinates of the upper left corner of the predicted box, and p3, p4 are the coordinates of the lower right corner of the predicted box; The union area Aunion is: Aunion = Agt + Apred - Aint; the union area is equal to the total area of the two boxes minus the intersection area, and the bounding box overlap rate IoU is the ratio of the intersection area to the union area: Among them, Aint is the area of the intersection region, Agt is the area of the true box, Apred is the area of the predicted box, and Aunion is the area of the union region, which represents the total area of the two boxes minus the overlapping part.
7. The method for intelligent detection of surface defects of artificial boards based on machine vision according to claim 6, characterized in that: Morphological feature analysis includes calculating the morphological feature similarity difference value: extracting morphological features for each defect area: area A represents the size of the defect area, aspect ratio, circularity, and perimeter P; Calculate the difference in morphological features: For two defect areas, their morphological features represent The vectors are: V1 = (A1, AspectRatio1, Circularity1, P1) and V2 = (A2, Aspect Ratio2, Circularity2, P2), where each vector element represents the corresponding morphological feature, and the morphological feature similarity difference value is calculated. The difference between the two defect morphological features is calculated by the Euclidean distance as the morphological feature similarity difference value.
8. The method for intelligent detection of surface defects of artificial boards based on machine vision according to claim 7, characterized in that: Normalize the bounding box overlap rate and the morphological feature similarity difference value so that they are both between [0, 1], and perform weighted summation of the normalized bounding box overlap rate and morphological feature similarity difference value to calculate the defect assessment factor; Comparing the obtained defect assessment factor with a preset threshold, and if the defect assessment factor is greater than or equal to the preset threshold, dividing the inspection area into a defect area; If the defect assessment factor is less than the preset threshold, the inspection area is divided into a normal inspection area.
9. A machine vision-based intelligent detection system for surface defects of artificial boards, used to implement the machine vision-based intelligent detection method for surface defects of artificial boards according to any one of claims 1 to 8, characterized in that: It includes image acquisition and processing module, feature extraction module, defect segmentation module, error correction module and feedback control module; Image acquisition and processing module: uses a high-resolution industrial camera to capture images of the surface of the artificial board and performs preprocessing; Feature extraction module: Uses a multi-scale convolutional neural network to extract features from the preprocessed image. The shallow convolution layer is used to extract the detailed features of small defects, and the deep convolution layer is used to extract the global features of large defects, and generate a feature fusion map. Defect segmentation module: Based on the extracted feature fusion map, the Mask R-CNN model is used to segment the defect area, and the non-maximum suppression algorithm is used to remove redundant detection frames; Error correction module: Classifies each defect area after segmentation and uses a deep learning model to identify the defect type. For interference between adjacent defects, the error correction algorithm is used to classify and correct the defects based on their spatial relationship and morphological characteristics. Feedback control module: Feedback defect information to the production line control system in real time. The control system automatically removes defective products or adjusts production process parameters based on the feedback information.
Citation Information
Patent Citations
Workpiece surface defect detection method based on deep learning
CN111415329A
Fire hose defect detection method and system based on computer vision
CN114842016A