Vision-based laser cutting defect detection method and system
By using a target detection model based on the YOLO architecture and a combined loss function, efficient and accurate detection of defects in laser cutting is achieved, and a closed-loop control is formed with process parameters. This solves the problems of low detection efficiency and poor consistency in existing technologies, and improves cutting quality and production consistency.
Patent Information
- Application Number
- CN202511564762.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-03-17
AI Technical Summary
Existing laser cutting defect detection methods are inefficient and highly subjective, making it difficult to meet the demands of modern manufacturing for high-precision, high-speed, and high-consistency production. Furthermore, they fail to achieve closed-loop control from detection to process parameter optimization.
A target detection model based on the YOLO architecture is adopted, which combines a combined loss function and a task alignment allocator to identify defects and match process parameters, generate parameter optimization suggestions, and form a closed-loop quality control.
It enables rapid and accurate identification of various laser cutting defects, improving detection efficiency and accuracy. It is applicable to cutting scenarios with various materials and different thicknesses, thereby improving product quality and production stability.
Smart Images

Figure CN121685371A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of laser cutting, and particularly relates to a laser cutting defect detection method and system based on vision. BACKGROUND
[0002] As a precision machining technology widely used in the current manufacturing industry, the cutting quality of laser cutting directly affects the performance, appearance and safety in use of products. In the actual cutting process, defects such as slag hanging, too deep lines, overburning and uneven section often occur. These defects not only affect the appearance and function of products, but also may cause adverse effects on subsequent assembly and use. Therefore, efficient and accurate detection of laser cutting defects is the key to ensuring product quality.
[0003] At present, the industry generally adopts manual visual inspection to identify defects. This method mainly depends on the experience of operators, and has problems such as low efficiency, strong subjectivity, poor consistency and fatigue, which is difficult to meet the needs of modern manufacturing for high precision, high speed and high consistency production. Although some automatic detection methods based on image recognition have made certain progress in laser cutting defect identification, most of these detection methods are limited to simple defect types and have weak recognition ability for responsible defect patterns (such as subtle uneven lines, different degrees of molten edge, etc.), and lack of generalization. Importantly, existing methods usually only stay in the defect identification stage, and fail to effectively associate and deeply analyze the identified defect type with the laser cutting process parameters (such as cutting speed, laser power, auxiliary gas pressure, focal position) that produce the defect, so as to form a closed-loop quality control mechanism from detection to analysis and optimization, which limits the role in intelligent manufacturing.
[0004] Therefore, there is an urgent need for an intelligent detection method with high precision, strong adaptability and process parameter feedback optimization to overcome the shortcomings of the prior art. SUMMARY
[0005] In a first aspect, the embodiments of the present application provide a laser cutting defect detection method based on vision, comprising the following steps: S1. Collecting a section image of a laser cutting workpiece, and using a labeling tool to label the defect category and position in the section image to generate a training sample; S2. Training a target detection model based on a YOLO architecture using the training sample, optimizing the model parameters by combining a loss function, and obtaining a trained model for laser cutting defect identification; S3. Image acquisition of the section of the laser cut workpiece to be detected, and standardization processing of the collected image to obtain a preprocessed section image; S4. Input the preprocessed cross-sectional image into the trained model, and the trained model outputs the recognition results including defect category, location and confidence level; S5. Match the defect category with the current cutting process parameters, and output the process parameters to be adjusted and the adjustment direction according to the preset rule library; S6. Based on the output process parameters to be adjusted and the adjustment direction, query the preset process knowledge base to generate parameter optimization suggestions.
[0006] Furthermore, the specific steps of step S1 are as follows: S11. Acquire images of the cross-section of the workpiece after laser cutting using an image acquisition device fixed on a bracket, under the illumination of a ring fill light; S12. Record the cutting process parameters corresponding to each workpiece cross-section image, including cutting speed, laser power, auxiliary gas pressure, focal point position, and material thickness; S13. Use the annotation tool to annotate the defects in the workpiece cross-section image to generate training samples; wherein, the annotated defect categories include at least one of slag, uneven cross-section, uneven texture, melted edge, and burned edge.
[0007] Furthermore, the combined loss function in step S2 includes classification loss, regression loss, and VFL loss, with the specific formulas as follows:
[0008] in, Indicates the total loss. Represents classification loss, Indicates regression loss, VFL loss represents the loss function used to address class imbalance. , as well as These are preset weighting coefficients; Specifically, classifying losses The binary cross-entropy loss is used, and the specific formula is as follows:
[0009] Where N is the sample size. Let i be the true label of the i-th sample. The probability predicted by the model; Regression loss The CIoU loss is used, and the specific formula is as follows:
[0010] in, and These are the center coordinates of the ground truth bounding box and the predicted bounding box, respectively. It is the true bounding box With predicted bounding box The complete intersection-union ratio between them; VFL loss The calculation formula is as follows:
[0011] Where N represents the number of samples, This represents the probability that the model predicts the i-th sample to be the category corresponding to the true label. γ is the weight coefficient of the i-th sample, and γ is the focusing hyperparameter.
[0012] Furthermore, in step S2, during the training of the YOLO-based object detection model using training samples, a dynamic matching strategy using a task alignment allocator is employed to allocate positive and negative samples. The specific steps are as follows: S21. Input the training samples into the object detection model based on the YOLO architecture. The object detection model generates several candidate prediction boxes on the feature map through forward propagation. ; S22. For each ground truth defect box labeled in the training samples. Iterate through all candidate prediction boxes generated by the model on the current feature map. ; S23. For each pair of real defect boxes With candidate prediction boxes Calculate the task alignment score The calculation formula is:
[0013] in, The i-th candidate prediction box and the j-th real frame The intersection and union ratio; This represents the classification score of the i-th candidate prediction box, which measures the confidence of the model in predicting the defect category; This represents the category prediction information of the prediction box. Category labels representing the actual bounding boxes; S24. From all candidate prediction boxes In the selection process, the task alignment score with the highest value is chosen as the true defect bounding box. Positive sample prediction box The index m is calculated using the following formula:
[0014] in, Represents the i-th candidate prediction box and the j-th real frame The intersection and union ratio, This represents the classification score of the i-th candidate predicted box. It is to obtain the task alignment score The highest independent variable index; S25. Use the selected positive sample prediction box Participate in the calculation of regression loss and classification loss during model training; In step S2, during the training of the YOLO-based object detection model using training samples, steps S21-S25 are repeated until all true defect boxes in the training samples are found. All were assigned to the corresponding positive sample prediction boxes. .
[0015] Furthermore, the specific steps of step S3 are as follows: S31. Using an image acquisition device fixed on a bracket, under the illumination of a ring fill light, acquire images of the cross-section of the workpiece to be inspected after laser cutting to obtain the original cross-section image; S32. Normalize and resize the original cross-sectional image to convert it into a standard-sized image that meets the input requirements of the trained model, thus obtaining the preprocessed cross-sectional image.
[0016] Furthermore, the image acquisition step in step S11 or S31 is as follows: Select an industrial camera, mobile phone camera, or digital camera with a resolution not lower than the set threshold as the image acquisition device according to the workpiece cross-sectional dimensions and cutting requirements. The image acquisition device is fixed on the bracket, and the lens of the image acquisition device is adjusted with a level so that it is directly facing the center area of the workpiece cross-section. At the same time, a ring light is set in the image acquisition area to provide uniform illumination.
[0017] Furthermore, the specific steps of step S4 are as follows: S41. Input the preprocessed cross-sectional image into the trained model; S42. After training, the model uses its internal backbone network, feature pyramid network, and detection head to perform feature extraction and target detection on the input image, and outputs the defect identification result; the identification result includes the defect category label, bounding box coordinates, and corresponding confidence score; S43. Set a confidence threshold to filter out recognition results with confidence levels below the preset threshold and retain recognition results with confidence levels that meet the requirements.
[0018] Furthermore, the specific steps of step S5 are as follows: S51. Extract the category label of the defect from the retained identification results and determine the defect category; S52. Based on the determined defect category, query the rule base that pre-stores the relationship between defect category and process parameter, match the process parameter associated with the corresponding defect category, and determine whether the adjustment direction of the matched process parameter is to increase or decrease.
[0019] Furthermore, step S6 is detailed as follows: S61. Based on the determined defect category, the matched process parameters, and the determined adjustment direction of the process parameters, query the preset process knowledge base to obtain the adjustment amount or adjustment ratio corresponding to the corresponding defect category and process parameters; S62. Based on the current parameter values of the process parameters, calculate and generate suggested parameter optimization values.
[0020] Secondly, embodiments of this application also provide a vision-based laser cutting defect detection system, comprising: The training sample construction module is used to acquire cross-sectional images of laser-cut workpieces and use annotation tools to annotate the defect categories and locations in the cross-sectional images to generate training samples. The model training module is used to train the target detection model based on the YOLO architecture using training samples, and optimize the model parameters by combining loss functions to obtain a trained model for laser cutting defect recognition. The image acquisition module is used to acquire images of the cross-section of the laser-cut workpiece to be inspected, and to standardize the acquired images to obtain pre-processed cross-section images. The defect recognition module is used to input the preprocessed cross-sectional image into the trained model, and the trained model outputs the recognition result containing the defect category, location and confidence level. The process parameter matching module is used to match the defect category with the current cutting process parameters, and output the process parameters to be adjusted and the adjustment direction according to the preset rule library; The parameter value determination module is used to query a preset process knowledge base and generate parameter optimization suggestions based on the output process parameters to be adjusted and the adjustment direction.
[0021] As can be seen from the above technical solutions, this application has the following advantages: The vision-based laser cutting defect detection method and system provided in this application utilizes the YOLO target detection model to achieve rapid and accurate identification of various laser cutting defects, improving detection efficiency and accuracy. It matches and analyzes the defect identification results with cutting process parameters, generating parameter optimization suggestions based on a preset rule base and process knowledge base. This achieves closed-loop control from defect detection to process optimization, improving the quality and stability of laser-cut products. The method is applicable to laser cutting scenarios with various materials and thicknesses, possesses strong recognition capabilities for complex defect patterns, and enhances the precision, speed, and consistency of manufacturing production. Attached Figure Description
[0022] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic flowchart of the vision-based laser cutting defect detection method of the present invention.
[0024] Figure 2 This is a schematic diagram of the target detection model based on the YOLO architecture of the present invention.
[0025] Figure 3 This is a schematic diagram of the actual defects cut by laser according to the present invention.
[0026] Figure 4 This is a schematic diagram of the target detection model of the YOLO architecture of the present invention for identifying defects, wherein (1) is a schematic diagram of the output of identifying deep texture defects, and (2) is a schematic diagram of identifying bottom scraping defects.
[0027] Figure 5 This is a schematic diagram of the vision-based laser cutting defect detection system of the present invention. Detailed Implementation
[0028] The various embodiments of this disclosure will be described more fully in the detailed steps of the vision-based laser cutting defect detection method described below. This disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of this disclosure to the specific embodiments disclosed herein, but rather this disclosure should be understood to cover all adjustments, equivalents, and / or alternatives falling within the spirit and scope of the various embodiments of this disclosure.
[0029] For example, laser cutting is widely used in manufacturing, and its cutting quality is crucial to product performance, appearance, and safety. In practice, problems such as slag buildup, excessively deep grooves, overheating, and uneven cross-sections easily occur, affecting product quality and hindering subsequent processes. Currently, the industry largely relies on manual visual inspection to identify defects. This method is inefficient, subjective, and prone to fatigue, making it difficult to meet the demands of modern manufacturing. Although some image recognition-based automatic detection methods have made progress, these methods are mostly limited to simple defects, with limited ability to identify complex defect patterns and insufficient generalization. More importantly, most existing methods only remain at the defect identification stage, failing to effectively correlate and deeply analyze laser cutting process parameters (such as cutting speed, laser power, auxiliary gas pressure, and focal point position), thus failing to form a complete closed loop from detection to analysis and optimization, limiting their application in intelligent manufacturing. Therefore, there is an urgent need for a high-precision, highly adaptable intelligent detection method with process parameter feedback optimization capabilities to overcome the limitations of existing technologies.
[0030] To address the aforementioned issues, this embodiment provides a vision-based laser cutting defect detection method, which enables efficient and accurate detection of laser cutting defects. Furthermore, through correlation analysis with cutting process parameters, a closed-loop quality control system is formed, from detection to optimization.
[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0032] Please see Figure 1 The diagram shows a flowchart of a vision-based laser cutting defect detection method in a specific embodiment. The method includes the following steps: S1. Acquire cross-sectional images of laser-cut workpieces, and use annotation tools to annotate the defect categories and locations in the cross-sectional images to generate training samples; It should be noted that by acquiring cross-sectional images of laser-cut workpieces and labeling the defect categories and locations, high-quality training samples can be generated, providing data support for subsequent model training and ensuring the model's ability to learn and recognize various defect features. Using annotation tools to annotate defects in detail improves the model's ability to identify defect features and enhances the accuracy of detection. S2. The target detection model based on the YOLO architecture is trained using training samples. The model parameters are optimized by combining loss functions to obtain a trained model for laser cutting defect recognition. It should be noted that by adopting a target detection model based on the YOLO architecture and optimizing the model parameters through a combined loss function, the model's performance in recognizing laser-cut defects can be effectively improved, enabling it to accurately detect various defect types in complex backgrounds. The use of a combined loss function comprehensively considers classification, regression, and class imbalance issues, allowing the model to better learn defect features during training and improve detection accuracy and recall. S3. Acquire images of the cross-section of the laser-cut workpiece to be inspected, and standardize the acquired images to obtain preprocessed cross-section images; It should be noted that standardizing the cross-sectional images of the workpiece to be inspected can eliminate noise interference and size differences during the image acquisition process, making the image data input to the model more standardized and uniform, and improving the detection effect of the model; it also ensures that the pre-processed cross-sectional images meet the input requirements of the trained model, and guarantees the model's accurate extraction and recognition of image features. S4. Input the preprocessed cross-sectional image into the trained model, and the trained model outputs the recognition results including defect category, location and confidence level; It should be noted that by inputting the preprocessed cross-sectional image into the trained model, the model can quickly output recognition results containing defect category, location, and confidence level, thereby improving the detection efficiency of laser cutting defects. By filtering the recognition results through a pre-set confidence threshold, false detection results with low confidence can be effectively filtered out, thereby improving the reliability and credibility of the detection results. S5. Match the defect category with the current cutting process parameters, and output the process parameters to be adjusted and the adjustment direction according to the preset rule library; It should be noted that by matching defect categories with current cutting process parameters, the process parameters to be adjusted and the adjustment direction are output according to the preset rule library, providing direction for subsequent process parameter optimization; through the correlation analysis between defects and process parameters, the causes of defects can be analyzed, providing support for quality control. S6. Based on the output process parameters to be adjusted and the adjustment direction, query the preset process knowledge base to generate parameter optimization suggestion values; It should be noted that, based on the process parameters to be adjusted and the direction of adjustment, the system queries the preset process knowledge base to generate parameter optimization suggestions, which can directly provide specific process parameter adjustment schemes for the production process and realize real-time optimization of the cutting process. By generating parameter optimization suggestions, the occurrence of defects can be reduced, product quality and production efficiency can be improved, and production costs can be reduced.
[0033] This embodiment accurately identifies laser cutting defects through visual inspection, quickly locates the defect type using the YOLO model, and automatically optimizes cutting process parameters through rule base and process knowledge base, forming a closed-loop control, improving cutting quality and stability, reducing production costs, and is applicable to various materials and cutting scenarios.
[0034] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, in order to fully illustrate the specific implementation process in this embodiment, another vision-based laser cutting defect detection method is provided. Taking the laser cutting scenario of 304 stainless steel sheet with a thickness of 8mm as an example, the execution process of the vision-based laser cutting defect detection method is explained in detail, focusing on the entire process of image acquisition, defect identification, parameter matching and optimization suggestion generation, to ensure that it meets the actual industrial production needs. The method includes the following steps: S1. Acquire cross-sectional images of the laser-cut workpiece, and use annotation tools to label the defect categories and locations in the cross-sectional images to generate training samples; the specific steps of step S1 are as follows: S11. Acquire images of the cross-section of the workpiece after laser cutting using an image acquisition device fixed on a bracket, under the illumination of a ring fill light; Specifically, considering the characteristics of the cut surface of 8mm stainless steel sheet, such as slight weld edges and differences in the depth of the texture, an industrial camera with a resolution of 2448×2048 pixels (such as the Basler acA2448-75uc model) is selected as the acquisition device. Its pixel density can clearly capture the defect details at the 0.1mm level of the cut surface. If there is no industrial camera on site, a mobile phone camera with a pixel of no less than 48 million can also be selected, and the shooting stability can be ensured by manually fixing the bracket. Fix the industrial camera on an adjustable bracket, calibrate the perpendicularity of the lens to the cross-section of the stainless steel plate using a level, and ensure that the center of the lens is aligned with the geometric center of the cross-section. Set the distance between the lens and the cross-section to 30cm (tested to ensure that the field of view covers the entire cross-section while avoiding edge distortion). Install an 8-bead ring light (e.g., color temperature 5500K, and adjustable brightness) around the camera lens. The distance between the light and the cross-section is 15cm. The reflection of the stainless steel cross-section is eliminated by finely adjusting the angle of the light (e.g., the stainless steel surface is smooth and easy to reflect light, so the brightness of the light needs to be adjusted to 60% and tilted at 5° to avoid direct light). A standard ruler with a 1mm scale is placed on the cross-section beforehand for subsequent image size calibration to ensure that the coordinates of the defect location are consistent with the actual physical size; S12. Record the cutting process parameters corresponding to each workpiece cross-section image, including cutting speed, laser power, auxiliary gas pressure, focal point position, and material thickness; Specifically, after laser cutting is completed, the stainless steel workpiece is fixed on the worktable to ensure that the cross-section is free of movement and stains; the industrial camera is then activated to capture three cross-section images using continuous shooting mode. Three cross-sectional images are used to avoid missing defects due to accidental factors in a single image; Simultaneously record the current cutting process parameters: cutting speed 3.8m / min, laser power 3200W, auxiliary gas (e.g., nitrogen) pressure 0.8MPa, focal position -0.3mm, material thickness 8mm, and associate and name the parameters with the three acquired images; S13. Use the annotation tool to annotate defects in the workpiece cross-sectional image to generate training samples; wherein, the annotated defect categories include at least one of slag adhesion, uneven cross-section, uneven texture, melted edge, and burned edge; slag adhesion and deep texture defects are as follows: Figure 3 As shown; Specifically, the Labelme annotation tool is used to annotate defects in the acquired images: If a molten edge defect is present in the image, select the molten edge area with a polygon and label it as a molten edge. Molten edge defects are common defects in stainless steel cutting, which are manifested as irregular molten protrusions at the edge of the cross-section. If uneven texture exists, select the area with abnormal texture and label it as uneven texture; uneven texture defect is when the difference in the spacing between textures on the cross section exceeds 0.2mm; Of the three images collected, two were labeled with welded edges and one with uneven texture. The labeled images were added to the fine-tuning sample set of the YOLO11 model to improve the model's accuracy in identifying defects in stainless steel. S2. The target detection model based on the YOLO architecture is trained using training samples. The model parameters are optimized by combining loss functions to obtain a trained model for laser cutting defect recognition. The object detection model in step S2 using the YOLO architecture is as follows: Figure 2 As shown, it includes the following: 1. Backbone (main network) A cascaded structure of C3K2 and SPPF modules is adopted, in which the C3K2 module optimizes feature extraction by fusing convolution operations, while the SPPF module is responsible for multi-scale feature fusion. The C3K2 module is the core module for feature extraction in YOLO11. It optimizes the feature extraction process by fusing convolutional operations, thereby enhancing the model's expressive power. It consists of multiple convolutional layers, typically including standard convolutions and depthwise separable convolutions, as shown in the following formula: C3k2( x =Conv( x)+DWConv( x ) Among them, Conv( x ) represents the standard convolution operation, DWConv( x ) represents depthwise separable convolution, which implements residual connections, enabling the model to learn features better; The SPPF (Spatial Pyramid Pooling Fast) module is used for multi-scale feature fusion to improve the model's ability to detect targets at different scales. Its formula is as follows: SPPF ( x =Concat(MaxPool) k1 ( x MaxPool k2 ( x MaxPool k3 ( x ), x ) Among them, MaxPool ki ( x () indicates the use of different core sizes k i The max pooling operation, where Concat represents the concatenation operation; 2. Neck (Feature Pyramid Network) The PAN (Path Aggregation Network) structure, combined with the C3K2 module, improves feature transfer efficiency and supports multi-scale prediction. PAN aggregates features through top-down and bottom-up paths, as shown in the following formula: PAN ( x 1, x 2, x 3) = UpSample( x 3)+ x 2,UpSample( x 2)+ x 1 in, x 1, x 2, x 3 represent feature maps at different levels, UpSample represents the upsampling operation, and the addition operation realizes feature fusion; 3. Head (Detection Head) YOLO11 uses an anchor-free mechanism in conjunction with a decoupled head. The classification head uses DWConv convolution, while the regression head uses regular convolution operations, which can directly predict the bounding box and class of the target. Bounding box prediction:
[0035] in, Indicates the center coordinates of the bounding box. Indicates the width and height of the bounding box; Classification prediction:
[0036] in, f The input features are represented by DWConv, which represents a depthwise separable convolution operation, and Softmax is used to calculate the classification probability. Decoupled-Head decouples classification and regression tasks, processing them separately. The formula is as follows: Category Header:
[0037] Return to the head:
[0038] in, f i Indicates the first i The feature maps of the layer, where DWConv and Conv represent depthwise separable convolution and regular convolution, respectively; The combined loss function in step S2 includes classification loss, regression loss, and VFL loss, and the specific formulas are as follows:
[0039] in, Indicates the total loss. Represents classification loss, Indicates regression loss, VFL loss represents the loss function used to address class imbalance. , as well as These are preset weighting coefficients; Specifically, classifying losses The binary cross-entropy loss is used, and the specific formula is as follows:
[0040] Where N is the sample size. Let i be the true label of the i-th sample. The probability predicted by the model; Regression loss The CIoU (Complete Intersection to Union) loss is used, and the specific formula is as follows:
[0041] in, and These are the center coordinates of the ground truth bounding box and the predicted bounding box, respectively. It is the true bounding box With predicted bounding box The complete intersection-union ratio between them; The calculation comprehensively considers the overlapping area, the distance between center points, and the consistency of aspect ratio, and the specific definitions are as follows:
[0042] in, The intersection-union ratio (IU) of the predicted bounding box and the ground truth bounding box. It is the length of the diagonal of the smallest enclosed rectangle that covers both boxes. Weighting coefficients It is a parameter that measures the consistency of aspect ratio. Indicates Euclidean distance; VFL loss The calculation formula is as follows:
[0043] Where N represents the number of samples, This represents the probability that the model predicts the i-th sample to be the category corresponding to the true label. γ is the weight coefficient of the i-th sample, and γ is the focusing hyperparameter; γ is used to adjust the degree of attention the loss function pays to hard and easy samples. gamma When >0, the predicted probability The lower the value (i.e., the less certain the model is about classifying the corresponding sample, and the more difficult the sample is to classify), the more difficult it is to classify. The larger the value, the higher the weight of the corresponding sample in the loss; conversely, the smaller the predicted probability... The higher the weight of easy samples, the lower the weight; by focusing the hyperparameter γ, the model can focus more on learning difficult samples and avoid being dominated by easy samples during training. In step S2, during the training of the YOLO-based object detection model using training samples, a dynamic matching strategy using a task alignment allocator is employed to allocate positive and negative samples. The specific steps are as follows: S21. Input the training samples into the object detection model based on the YOLO architecture. The object detection model generates several candidate prediction boxes on the feature map through forward propagation. ; S22. For each ground truth defect box labeled in the training samples. Iterate through all candidate prediction boxes generated by the model on the current feature map. ; S23. For each pair of real defect boxes With candidate prediction boxes Calculate the task alignment score The calculation formula is:
[0044] in, The i-th candidate prediction box and the j-th real frame The intersection-union ratio (IU) is used to measure the degree of positional overlap between two bounding boxes. Its value ranges from [0,1], and the larger the value, the higher the positional matching degree. This represents the classification score of the i-th candidate prediction box, which measures the confidence of the model in predicting the defect category; This represents the category prediction information of the prediction box. Category labels representing the actual bounding boxes; S24. From all candidate prediction boxes In the selection process, the task alignment score with the highest value is chosen as the true defect bounding box. Positive sample prediction box The index m is calculated using the following formula:
[0045] in, Represents the i-th candidate prediction box and the j-th real frame The intersection and union ratio, This represents the classification score of the i-th candidate predicted box. It is to obtain the task alignment score The highest independent variable index; S25. Use the selected positive sample prediction box Participate in the calculation of regression loss and classification loss during model training; In step S2, during the training of the YOLO-based object detection model using training samples, steps S21-S25 are repeated until all true defect boxes in the training samples are found. All were assigned to the corresponding positive sample prediction boxes. ; S3. Acquire images of the cross-section of the laser-cut workpiece to be inspected, and standardize the acquired images to obtain preprocessed cross-section images; The specific steps of step S3 are as follows: S31. Using an image acquisition device fixed on a bracket, under the illumination of a ring fill light, acquire images of the cross-section of the workpiece to be inspected after laser cutting to obtain the original cross-section image; S32. Normalize and resize the original cross-sectional image to convert it into a standard-sized image that meets the input requirements of the trained model, thus obtaining the preprocessed cross-sectional image. Load the pre-trained YOLO11-large model weights and fine-tune them on the newly added stainless steel defect sample set (containing 500 labeled images). Set the training rounds to 50 rounds, with an initial learning rate of 0.001, which decays to 1 / 10 of the original rate every 10 rounds. Keeping the parameters of the combined loss function constant: Classification loss (BCE loss) weights =1.0, weight of regression loss (CIoU loss) =2.0, VFL loss weight =1.5, focusing hyperparameter γ=2.0, to ensure that the model balances the accuracy of defect classification and the accuracy of bounding box localization; The three stainless steel cross-section images were preprocessed: the image size was uniformly adjusted to 640×640 pixels (the standard input size of the YOLO11 model), and the pixel values were compressed to the [0,1] range using Min-Max normalization to eliminate the influence of light intensity differences on model recognition. The image acquisition steps in step S11 or S31 are as follows: Select an industrial camera, mobile phone camera, or digital camera with a resolution not lower than the set threshold as the image acquisition device according to the workpiece cross-sectional dimensions and cutting requirements. The image acquisition device is fixed on the bracket and adjusted with a level so that the lens of the image acquisition device is facing the center area of the workpiece cross-section. At the same time, a ring light is set in the image acquisition area to provide uniform illumination. S4. Input the preprocessed cross-sectional image into the trained model, and the trained model outputs the recognition results including defect category, location and confidence level; The specific steps of step S4 are as follows: S41. Input the preprocessed cross-sectional image into the trained model; S42. After training, the model uses its internal backbone network, feature pyramid network, and detection head to perform feature extraction and target detection on the input image, outputting defect identification results. These results include the defect's category label, bounding box coordinates, and corresponding confidence score. The defect identification results output by the trained model are as follows: Figure 4 As shown; S43. Set a confidence threshold to filter out recognition results with confidence levels below the preset confidence threshold and retain recognition results with confidence levels that meet the requirements; The preprocessed images are sequentially input into the fine-tuned YOLO11 model. The model extracts cross-sectional features through the backbone network (C3K2+SPPF), performs multi-scale feature fusion through the Neck layer (PAN structure), and finally outputs the defect identification results by the detection head. Model output results: The recognition confidence scores of the two images labeled with fused edges are 0.85 and 0.82 respectively, and the bounding box coordinates accurately cover the fused edge area; the recognition confidence score of the one image labeled with uneven texture is 0.78, and the bounding box completely selects the area of texture abnormality; The system has a preset confidence threshold of 0.6. The recognition confidence of the above three images is higher than the threshold, so they are judged as valid results and proceed to the subsequent process parameter matching stage. If the recognition confidence of any image is lower than 0.6 (e.g., 0.55), the system will prompt "The recognition result is unreliable, it is recommended to re-acquire the image" and automatically trigger the re-shooting process. S5. Match the defect category with the current cutting process parameters, and output the process parameters to be adjusted and the adjustment direction according to the preset rule library; The specific steps of step S5 are as follows: S51. Extract the category label of the defect from the retained identification results and determine the defect category; S52. Based on the determined defect category, query the rule base that pre-stores the relationship between defect category and process parameter, match the process parameter associated with the corresponding defect category, and determine whether the adjustment direction of the matched process parameter is to increase or decrease. Defect types were extracted from the valid identification results: 2 cases of weld edge defects and 1 case of uneven texture. The system's built-in rule base for associating stainless steel laser cutting defects and process parameters (built based on 5000 sets of historical production data) yielded the following matching results: Melting edge defects: The associated process parameters are laser power and cutting speed. The rule base records the causes as follows: excessive laser power leads to excessive melting of the cross-section, or excessive cutting speed causes the laser to stay in the same position for too long. Uneven texture defect: The associated process parameter is the auxiliary gas pressure. The rule library records the cause as: insufficient gas pressure, which cannot effectively remove the slag generated during the cutting process, resulting in irregular texture formation.
[0046] Based on the rule base matching results, the direction of process parameter adjustment is output: For edge defects, it is recommended to reduce laser power and increase cutting speed. Uneven texture defect: It is recommended to increase the auxiliary gas pressure; S6. Based on the output process parameters to be adjusted and the adjustment direction, query the preset process knowledge base to generate parameter optimization suggestion values; The specific steps of step S6 are as follows: S61. Based on the determined defect category, the matched process parameters, and the determined adjustment direction of the process parameters, query the preset process knowledge base to obtain the adjustment amount or adjustment ratio corresponding to the corresponding defect category and process parameters; S62. Based on the current parameter values of the process parameters, calculate and generate suggested parameter optimization values; Query the process knowledge base for stainless steel sheets (containing the optimal parameter adjustment range for different thicknesses and materials) to obtain the adjustment rules that match the current defect type: For edge defects: laser power adjustment range is 5%~8% decrease, and cutting speed adjustment range is 3%~5% increase; Uneven texture defect: The auxiliary gas pressure adjustment range is: increase by 0.05~0.1MPa; The specific optimization recommendation value is calculated by combining the current process parameters to determine the specific adjustment recommendation value: Edge defects (e.g., current laser power 3200W, cutting speed 3.8m / min): Laser power adjustment: 3200W×(1-6%)=3008W (take the middle value of 6% of the adjustment range to balance the defect elimination effect and cutting efficiency). Cutting speed adjustment: 3.8m / min×(1+4%)=3.95m / min (take the middle value of 4% of the adjustment range to avoid other defects caused by excessive speed); Uneven texture defects (e.g., current auxiliary gas pressure 0.8 MPa): Gas pressure adjustment: 0.8MPa + 0.08MPa = 0.88MPa (take the midpoint of the adjustment range, 0.08MPa, to ensure effective slag blowing without affecting the flatness of the cross section). Optimization suggestions output and application: The optimization suggestions are pushed to the terminal in a visual interface, as shown below: To address edge melting defects: it is recommended to adjust the laser power from 3200W to 3008W and the cutting speed from 3.8m / min to 3.95m / min; To address the uneven texture defect: it is recommended to adjust the auxiliary gas pressure from 0.8MPa to 0.88MPa; Operators can choose between automatic execution or manual confirmation: when automatic execution is selected, the optimized parameters are sent directly to the laser cutting equipment control system, and the process parameters are updated in real time; when manual confirmation is selected, the operator checks the parameters and clicks confirmation to complete the adjustment.
[0047] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0048] like Figure 5As shown, the following are embodiments of the vision-based laser cutting defect detection system provided in this disclosure. This system and the vision-based laser cutting defect detection methods described above belong to the same inventive concept. For details not described in detail in the embodiments of the vision-based laser cutting defect detection system, please refer to the embodiments of the vision-based laser cutting defect detection methods described above.
[0049] The system includes: The training sample construction module is used to acquire cross-sectional images of laser-cut workpieces and use annotation tools to annotate the defect categories and locations in the cross-sectional images to generate training samples. The model training module is used to train the target detection model based on the YOLO architecture using training samples, and optimize the model parameters by combining loss functions to obtain a trained model for laser cutting defect recognition. The image acquisition module is used to acquire images of the cross-section of the laser-cut workpiece to be inspected, and to standardize the acquired images to obtain pre-processed cross-section images. The defect recognition module is used to input the preprocessed cross-sectional image into the trained model, and the trained model outputs the recognition result containing the defect category, location and confidence level. The process parameter matching module is used to match the defect category with the current cutting process parameters, and output the process parameters to be adjusted and the adjustment direction according to the preset rule library; The parameter value determination module is used to query a preset process knowledge base and generate parameter optimization suggestions based on the output process parameters to be adjusted and the adjustment direction.
[0050] This embodiment achieves efficient and accurate detection of laser cutting defects through the interactive collaboration of a training sample construction module, a model training module, a test image acquisition module, a defect identification module, a process parameter matching module to be adjusted, and a parameter value determination module.
[0051] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A vision-based method for detecting defects in laser cutting, characterized in that, Includes the following steps: S1. Acquire cross-sectional images of laser-cut workpieces, and use annotation tools to annotate the defect categories and locations in the cross-sectional images to generate training samples; S2. The target detection model based on the YOLO architecture is trained using training samples. The model parameters are optimized by combining loss functions to obtain a trained model for laser cutting defect recognition. S3. Acquire images of the cross-section of the laser-cut workpiece to be inspected, and standardize the acquired images to obtain preprocessed cross-section images; S4. Input the preprocessed cross-sectional image into the trained model, and the trained model outputs the recognition results including defect category, location and confidence level; S5. Match the defect category with the current cutting process parameters, and output the process parameters to be adjusted and the adjustment direction according to the preset rule library; S6. Based on the output process parameters to be adjusted and the adjustment direction, query the preset process knowledge base to generate parameter optimization suggestions.
2. The vision-based laser cutting defect detection method according to claim 1, characterized in that, The specific steps of step S1 are as follows: S11. Acquire images of the cross-section of the workpiece after laser cutting using an image acquisition device fixed on a bracket, under the illumination of a ring fill light; S12. Record the cutting process parameters corresponding to each workpiece cross-section image, including cutting speed, laser power, auxiliary gas pressure, focal point position, and material thickness; S13. Use the annotation tool to annotate the defects in the workpiece cross-section image to generate training samples; wherein, the annotated defect categories include at least one of slag, uneven cross-section, uneven texture, melted edge, and burned edge.
3. The vision-based laser cutting defect detection method according to claim 2, characterized in that, The combined loss function in step S2 includes classification loss, regression loss, and VFL loss, and the specific formulas are as follows: in, Indicates the total loss. Represents classification loss, Indicates regression loss, VFL loss represents the loss function used to address class imbalance. , as well as These are preset weighting coefficients; Specifically, classifying losses The binary cross-entropy loss is used, and the specific formula is as follows: Where N is the sample size. Let i be the true label of the i-th sample. The probability predicted by the model; Regression loss The CIoU loss is used, and the specific formula is as follows: in, and These are the center coordinates of the ground truth bounding box and the predicted bounding box, respectively. It is the true bounding box With predicted bounding box The complete intersection-union ratio between them; VFL loss The calculation formula is as follows: Where N represents the number of samples, This represents the probability that the model predicts the i-th sample to be the category corresponding to the true label. γ is the weight coefficient of the i-th sample, and γ is the focusing hyperparameter.
4. The vision-based laser cutting defect detection method according to claim 3, characterized in that, In step S2, during the training of the YOLO-based object detection model using training samples, a dynamic matching strategy using a task alignment allocator is employed to allocate positive and negative samples. The specific steps are as follows: S21. Input the training samples into the object detection model based on the YOLO architecture. The object detection model generates several candidate prediction boxes on the feature map through forward propagation. ; S22. For each ground truth defect box labeled in the training samples. Iterate through all candidate prediction boxes generated by the model on the current feature map. ; S23. For each pair of real defect boxes With candidate prediction boxes Calculate the task alignment score The calculation formula is: in, The i-th candidate prediction box and the j-th real frame The intersection and union ratio; This represents the classification score of the i-th candidate prediction box, which measures the confidence of the model in predicting the defect category; This represents the category prediction information of the prediction box. Category labels representing the actual bounding boxes; S24. From all candidate prediction boxes In the selection process, the task alignment score with the highest value is chosen as the true defect bounding box. Positive sample prediction box The index m is calculated using the following formula: in, Represents the i-th candidate prediction box and the j-th real frame The intersection and union ratio, This represents the classification score of the i-th candidate predicted box. It is to obtain the task alignment score The highest independent variable index; S25. Use the selected positive sample prediction box Participate in the calculation of regression loss and classification loss during model training; In step S2, during the training of the YOLO-based object detection model using training samples, steps S21-S25 are repeated until all true defect boxes in the training samples are found. All were assigned to the corresponding positive sample prediction boxes. .
5. The vision-based laser cutting defect detection method according to claim 4, characterized in that, The specific steps of step S3 are as follows: S31. Using an image acquisition device fixed on a bracket, under the illumination of a ring fill light, acquire images of the cross-section of the workpiece to be inspected after laser cutting to obtain the original cross-section image; S32. Normalize and resize the original cross-sectional image to convert it into a standard-sized image that meets the input requirements of the trained model, thus obtaining the preprocessed cross-sectional image.
6. The vision-based laser cutting defect detection method according to claim 5, characterized in that, The image acquisition steps in step S11 or S31 are as follows: Select an industrial camera, mobile phone camera, or digital camera with a resolution not lower than the set threshold as the image acquisition device according to the workpiece cross-sectional dimensions and cutting requirements. The image acquisition device is fixed on the bracket, and the lens of the image acquisition device is adjusted with a level so that it is directly facing the center area of the workpiece cross-section. At the same time, a ring light is set in the image acquisition area to provide uniform illumination.
7. The vision-based laser cutting defect detection method according to claim 5, characterized in that, The specific steps of step S4 are as follows: S41. Input the preprocessed cross-sectional image into the trained model; S42. After training, the model uses its internal backbone network, feature pyramid network, and detection head to perform feature extraction and target detection on the input image, and outputs the defect identification result; the identification result includes the defect category label, bounding box coordinates, and corresponding confidence score; S43. Set a confidence threshold to filter out recognition results with confidence levels below the preset threshold and retain recognition results with confidence levels that meet the requirements.
8. The vision-based laser cutting defect detection method according to claim 7, characterized in that, The specific steps of step S5 are as follows: S51. Extract the category label of the defect from the retained identification results and determine the defect category; S52. Based on the determined defect category, query the rule base that pre-stores the relationship between defect category and process parameter, match the process parameter associated with the corresponding defect category, and determine whether the adjustment direction of the matched process parameter is to increase or decrease.
9. The vision-based laser cutting defect detection method according to claim 8, characterized in that, The specific steps of step S6 are as follows: S61. Based on the determined defect category, the matched process parameters, and the determined adjustment direction of the process parameters, query the preset process knowledge base to obtain the adjustment amount or adjustment ratio corresponding to the corresponding defect category and process parameters; S62. Based on the current parameter values of the process parameters, calculate and generate suggested parameter optimization values.
10. A vision-based laser cutting defect detection system, characterized in that, include: The training sample construction module is used to acquire cross-sectional images of laser-cut workpieces and use annotation tools to annotate the defect categories and locations in the cross-sectional images to generate training samples. The model training module is used to train the target detection model based on the YOLO architecture using training samples, and optimize the model parameters by combining loss functions to obtain a trained model for laser cutting defect recognition. The image acquisition module is used to acquire images of the cross-section of the laser-cut workpiece to be inspected, and to standardize the acquired images to obtain pre-processed cross-section images. The defect recognition module is used to input the preprocessed cross-sectional image into the trained model, and the trained model outputs the recognition result containing the defect category, location and confidence level. The process parameter matching module is used to match the defect category with the current cutting process parameters, and output the process parameters to be adjusted and the adjustment direction according to the preset rule library; The parameter value determination module is used to query a preset process knowledge base and generate parameter optimization suggestions based on the output process parameters to be adjusted and the adjustment direction.
Citation Information
Cited By
Diesel generator set base laser cutting defect detection method based on machine vision
CN122505926A