Method and system for judging laser texture process parameters of mold
Through YOLOv11 model and image processing technology, the accuracy and robustness of mold texture recognition are solved, the precise judgment of mold processing parameters is realized, and the efficiency and quality of mold processing are improved.
Patent Information
- Application Number
- CN202510235594.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-05-30
AI Technical Summary
Traditional mold texture recognition methods have subjectivity and errors. Automatic texture recognition technology has low accuracy and robustness in complex situations, making it difficult to capture global and local texture information, and cannot provide effective processing-assisted decisions.
The recognition model trained by YOLOv11 is adopted to extract the texture direction and normal position through image processing steps, and combined with LabelMe tool and cross-validation, the model parameters are optimized to achieve accurate identification and judgment of mold texture.
It improves the accuracy and robustness of mold texture recognition, ensures the accuracy and consistency of processing parameters, and reduces subjective errors in manual intervention.
Smart Images

Figure CN120070405A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to a method and system for judging laser texture process parameters of a mold. Background Art
[0002] With the rapid development of the mold industry and the continuous improvement of the demand for part texture processing, the mold, as a high-quality surface texture processing equipment, especially for high-end products, has higher requirements for fine textures. However, there are many defects in traditional mold texture recognition methods, which limit their effectiveness and efficiency in practical applications.
[0003] Traditional manual recognition methods mainly rely on human eye observation. Workers need to spend a lot of time and effort to identify the direction of mold textures. This method has obvious subjectivity and errors because different workers may get inconsistent results when identifying textures. Moreover, as the working time increases, the fatigue of workers will also lead to a decrease in the accuracy of recognition results, which will cause inaccurate adjustment of process parameters when processing molds later.
[0004] In addition to manually recognized textures, existing automated texture recognition technologies also have some problems. These technologies are usually based on image processing and feature extraction algorithms. Although they can achieve partial automation, in the case of complex mold textures, their recognition accuracy and robustness are relatively low. The complex and diverse mold textures make it difficult for traditional feature extraction methods to capture global and local texture information and cannot further provide information about the direction of mold textures. Therefore, they cannot provide effective auxiliary decision-making for subsequent processing work. Summary of the Invention
[0005] Aiming at the above defects, the purpose of the present invention is to propose a method and system for judging laser texture process parameters of a mold, so as to solve the problems of low robustness and accuracy in existing texture recognition.
[0006] To achieve this purpose, the present invention adopts the following technical solutions: A method for judging laser texture process parameters of a mold, comprising the following steps:
[0007] Obtain a sample image of the laser texture process, train an identification model based on the sample image, and obtain a first model, where the first model is obtained by training with YOLOv11;
[0008] Obtain the texture image of a standard mold as the first image, obtain the texture image of a processed workpiece as the second image, and input the first image and the second image into the first model respectively to obtain a first recognition result and a second recognition result;
[0009] Based on the first recognition result and the second recognition result, it is determined whether the current mold needs to be modified.
[0010] Preferably, training the model based on the sample image includes:
[0011] Extract the central position of the texture orientation and the normal position of the texture in the sample image to obtain a first processed image;
[0012] Perform image annotation on the first processed image to generate training samples;
[0013] Input the training samples into the model for training.
[0014] Preferably, the steps for obtaining the first processed image are as follows:
[0015] Step A1: Perform low-pass processing on the sample image to obtain a first image. Compare the B-channel image in the RGB channels of the first image with the sample image to obtain a texture edge information image;
[0016] Step A2: Perform continuous wavelet transform denoising on the texture edge information image to obtain a first denoised image;
[0017] Step A3: Filter the first denoised image based on the median filtering method to obtain a first texture image;
[0018] Step A4: Perform gray-scale segmentation on the first texture image based on a preset gray-scale threshold to obtain a second texture image;
[0019] Step A5: Perform Canny edge extraction on the second texture image to obtain a texture contour, and obtain a first processed image containing the central position of the texture orientation and the normal position of the texture.
[0020] Preferably, the steps for performing image annotation on the first processed image are as follows:
[0021] Step C1: Use the drawing tool of LabelMe to draw each texture area in the first processed image;
[0022] Step C2: Analyze each texture area to obtain a polygon boundary, and generate a mask of the same size as the original image, where the texture area is 1 and the non-texture area is 0;
[0023] Step C3: Scan each row of the mask of each texture area; for each row, identify the index range containing 1;
[0024] Step C4: For the index range identified in each row, calculate its median value to obtain the central position of the texture orientation of that row. Connect all the central positions to form a texture orientation central vector;
[0025] Step C5: Label the center position of the texture orientation and its texture orientation center vector.
[0026] Preferably, the steps of training the recognition model based on the sample image are as follows:
[0027] Step B1: Divide the training samples into a test sample group and a training sample group according to a ratio;
[0028] Step B2: Create a new python3.8 virtual environment and install pytorch, torchvision and ultralytics in this environment;
[0029] Step B3: Perform parameter settings, including setting the type of image enhancement, and preliminarily setting the image input size of the YOLOv11 network model, the learning rate of the YOLOv11 network model, the type of optimizer, the batch size of Batch, the number of iterations, the number of worker threads, the confidence threshold, and the non-maximum suppression threshold;
[0030] Step B4: Use the training sample group to train the recognition model;
[0031] Step B5: Select the optimal parameter settings through cross-validation, including using a loss function to calculate the positive and negative sample allocation strategy and loss calculation during the training process;
[0032] The positive and negative sample allocation strategy is as follows: Select the largest k positive samples, and sort according to the scores weighted by the classification and regression scores. The calculation formula of the weighted score is as follows:
[0033] t = s α × u β , where t represents the weighted score, s represents the predicted score corresponding to the labeled tool category, u represents the intersection over union of the predicted bounding box and the texture bounding box, α and β are weight hyperparameters, and s multiplied by u is used to measure the alignment degree;
[0034] Step B6: Based on the test sample group, test the trained recognition model to generate test results, and optimize the trained recognition model based on the test results to obtain an optimized recognition model. Loop steps B4 to B6 until the number of iterations meets the threshold, and determine the optimized recognition model as the first model.
[0035] A judgment system for laser texture process parameters of a mold, using the judgment method for laser texture process parameters of the mold, includes: a graphics processing module, a recognition module, and a judgment module;
[0036] The image processing module is used to obtain a sample image of the laser texture process, train an identification model based on the sample image, and obtain a first model, where the first model is obtained by training YOLOv11;
[0037] The identification module is used to obtain the texture image of the standard mold as the first image, obtain the texture image of the processed workpiece as the second image, and input the first image and the second image into the first model respectively to obtain a first identification result and a second identification result;
[0038] The judgment module judges whether the current mold needs to be modified based on the first identification result and the second identification result.
[0039] Preferably, the graphics processing module includes a first processing sub-module, an annotation sub-module, and a training sub-module;
[0040] The first processing sub-module is used to extract the central position of the texture direction and the normal position of the texture in the sample image to obtain a first processed image;
[0041] The annotation sub-module is used to perform image annotation on the first processed image to generate training samples;
[0042] The training sub-module is used to input the training samples into the model for training.
[0043] Preferably, the first processing sub-module includes a first adjustment unit, a noise reduction unit, a filtering unit, a segmentation unit, and an extraction unit;
[0044] The first adjustment unit is used to perform low-pass processing on the sample image to obtain a first image, compare the B-channel image in the RBG channels of the first image with the sample image to obtain a texture edge information image;
[0045] The noise reduction unit is used to perform continuous wavelet transform noise reduction on the texture edge information image to obtain a first noise reduction map;
[0046] The filtering unit is used to filter the first noise reduction map based on the median filtering method to obtain a first texture image;
[0047] The segmentation unit performs gray-scale segmentation on the first texture image based on a preset gray-scale threshold to obtain a second texture image;
[0048] The extraction unit is used to perform Canny edge extraction on the second texture image to extract the texture contour, and obtain a first processed image containing the central position of the texture direction and the normal position of the texture.
[0049] Preferably, the annotation sub-module includes a drawing unit, a mask unit, a scanning unit, a calculation unit, and an annotation unit;
[0050] The drawing unit is used to draw each texture region in the first processed image using the drawing tool of LabelMe;
[0051] The mask unit is used to parse each texture region, obtain the polygon boundary, and generate a mask with the same size as the original image, where the texture region is 1 and the non-texture region is 0;
[0052] The scanning unit scans each row of the mask of each texture region; for each row, it identifies the index range containing 1;
[0053] The calculation unit is used to calculate the median value of the index range identified in each row to obtain the center position of the texture orientation of that row, and connect all the center positions to form the texture orientation center vector;
[0054] The annotation unit is used to annotate the center position of the texture orientation and its texture orientation center vector.
[0055] Preferably, the training sub-module includes a grouping unit, an environment building unit, a setting unit, a training unit, a verification unit, and a loop unit;
[0056] The grouping unit is used to divide the training samples into a test sample group and a training sample group according to a ratio;
[0057] The environment building unit is used to create a python3.8 virtual environment and install pytorch, torchvision, and ultralytics in this environment;
[0058] The setting unit is used to perform parameter settings, including setting the type of image enhancement, and preliminarily setting the image input size of the YOLOv11 network model, the learning rate of the YOLOv11 network model, the type of optimizer, the batch size, the number of iterations, the number of worker threads, the confidence threshold, and the non-maximum suppression threshold;
[0059] The training unit is used to train the recognition model using the training sample group;
[0060] The verification unit is used to select the optimal parameter settings through cross-validation, including using a loss function to calculate the positive and negative sample allocation strategy and loss calculation during the training process;
[0061] Among them, the positive and negative sample allocation strategy is: select the largest k positive samples, and sort according to the scores weighted by the classification and regression scores. The calculation formula of the weighted score is as follows:
[0062] t = s α ×u β, where \(t\) represents the weighted score, \(s\) represents the predicted score corresponding to the labeled tool category, \(u\) represents the intersection over union of the predicted bounding box and the texture bounding box, and \(\alpha\) and \(\beta\) are weight hyperparameters. The product of \(s\) and \(u\) is used to measure the alignment degree;
[0063] The loop unit is used to test the trained recognition model based on the test sample group, generate a test result, optimize the trained recognition model based on the test result to obtain an optimized recognition model, repeatedly call the training unit, the verification unit, and the loop unit until the number of iterations meets the number threshold, and determine the optimized recognition model as the first model.
[0064] One of the above technical solutions has the following advantages or beneficial effects: The method of the present invention can effectively extract laser texture information, and perform corresponding processing according to the laser texture information to obtain a matching result, realizing the judgment of process parameters, and greatly improving the accuracy and robustness of process parameter judgment. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 is a flowchart of an embodiment of the method of the present invention.
[0066] Figure 2 is a schematic structural diagram of an embodiment of the system of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0067] The embodiments of the present invention will be described in detail below. The examples of the embodiments are shown in the drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions from beginning to end. The embodiments described below with reference to the drawings are exemplary and are only used to explain the present invention and should not be construed as a limitation of the present invention.
[0068] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "axial", "radial", "circumferential", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention.
[0069] Furthermore, the terms "first" and "second" are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise specified, the meaning of "a plurality" is two or more.
[0070] In the description of the present invention, it should be noted that, unless otherwise clearly defined and limited, the terms "mounted", "connected" and "coupled" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be directly connected, or indirectly connected through an intermediate medium, and it may be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0071] As Figures 1 to 2 shown, a method for judging the laser texturing process parameters of a mold includes the following steps:
[0072] Obtain a sample image of the laser texturing process, train an identification model based on the sample image, and obtain a first model, where the first model is obtained by training with YOLOv11;
[0073] Obtain the texture image of the standard mold as the first image, obtain the texture image of the machined workpiece as the second image, and input the first image and the second image into the first model respectively to obtain a first identification result and a second identification result;
[0074] Based on the first identification result and the second identification result, judge whether the current mold needs to be modified.
[0075] In the present invention, the first model is obtained by training with YOLOv11, and YOLOv11 adds a C2PSA module (Cross-Stage Partial Spatial Attention). This module introduces an attention mechanism, which improves the model's attention to important regions in the image by emphasizing the spatial correlation in the feature map, and is friendly to the recognition of smaller texture parts or partially occluded parts. And the C2PSA network module in YOLOv11 uses two PSA (Partial Spatial Attention) modules, which operate on different branches of the feature map and then are connected, similar to the C2F block structure. This setting ensures that the model focuses on spatial information while maintaining a balance between computational cost and detection accuracy. The C2PSA module refines the model's ability to selectively focus on regions of interest (global and local texture information) by applying spatial attention to the extracted features. This makes the first model better in the refinement and accuracy of scene detection of details such as laser texture than other models.
[0076] After training the first model with sample images obtained through the laser texturing process, the first model can identify the texture patterns of the images. Then, the first image of the texture image of the standard mold and the second image of the texture image of the machined workpiece are obtained respectively. The first image can be exported from the modeled standard mold in the user's computer drawing software, while the second image can be obtained by the user taking a picture of the machined workpiece. The first image and the second image are input into the first model to obtain the first recognition result and the second recognition result respectively. In one embodiment, the average precision can be added to the first model. By comparing the average precision S1 of the first recognition result with the average precision S2 of the first recognition result, if the difference is less than the precision threshold, it indicates that there is a certain gap in the texture between the product machined by the newly generated mold and the standard mold. Therefore, the current model needs to be modified. In another embodiment, the similarity between the first recognition result and the second recognition result can be calculated as the basis for judging whether the mold needs to be modified. Since there are many ways to judge by the first recognition result and the second recognition result, they will not be elaborated one by one here.
[0077] Through the method of the present invention, laser texture information can be effectively extracted, corresponding processing can be performed according to the laser texture information, a matching result can be obtained, and the judgment of process parameters can be realized, greatly improving the accuracy and robustness of the judgment of process parameters.
[0078] Preferably, training the model based on the sample image includes:
[0079] Extract the central position of the texture orientation and the normal position of the texture in the sample image to obtain a first processed image;
[0080] Perform image annotation on the first processed image to generate training samples;
[0081] Input the training samples into the model for training.
[0082] Preferably, the steps of obtaining the first processed image are specifically as follows:
[0083] Step A1: Perform low-pass processing on the sample image to obtain a first image. Compare the B-channel image in the RBG channels of the first image with the sample image to obtain a texture edge information image;
[0084] Step A2: Perform continuous wavelet transform (CWT) denoising on the texture edge information image to obtain a first denoised image;
[0085] Step A3: Filter the first denoised image based on the median filtering method to obtain a first texture image;
[0086] Step A4: Perform gray-scale segmentation on the first texture image based on a preset gray-scale threshold to obtain a second texture image;
[0087] Step A5: Perform Canny edge extraction on the second texture image to obtain a first processed image containing the central position of the texture orientation and the normal position of its texture.
[0088] To better train the first model, a large number of actual captured pictures are used as sample images for training during training. During the actual capture process, due to the characteristics of the mold material (metal material) itself, it has the property of reflection, and the light source brightness is low during imaging, resulting in difficulty in presenting and marking texture information. Therefore, in the present invention, the sample image will first be processed by a low-pass filter. After the low-pass processing, the low-frequency signals in the image are allowed to pass through, while the high-frequency signals are weakened or suppressed. This helps to capture the average intensity of the image, that is, the general outline and color of the image, while weakening or removing the noise in the image. Then, by comparing the B-channel image with the sample image, a texture edge information image is obtained. The metal reflective part is more likely to appear in the blue channel. After comparing with the sample image, the highlight part can be repaired, so that the texture details are presented.
[0089] The low-pass processing is mainly to eliminate high-frequency noise, but it blurs the edge and contour information of the first image. Then, the edge and contour information are enhanced by continuous wavelet transform. Therefore, denoising the edge information image by CWT can enhance the texture edge information and remove noise at the same time. Because CWT can capture the characteristics of the signal at different scales and positions, thus effectively distinguishing the signal and noise. Then, a gray threshold is set, and the gray range can be set in the interval of 20 - 50 to initially locate the texture shape. This is because the texture usually has a specific gray range, while the background or other non-texture areas may have different gray values. Finally, the Canny edge extraction is used to effectively extract the edge information in the image. The central position of the texture orientation and the normal position of its texture are extracted for subsequent marking. In the subsequent training, the role of extracting the central position of the texture orientation and the normal position of its texture is to judge whether the laser processing of the mold is in accordance with the requirements, so as to judge whether the processed texture is correct.
[0090] Preferably, the steps for image annotation of the first processed image are as follows:
[0091] Step C1: Use the drawing tool of LabelMe to draw each texture area in the first processed image;
[0092] Step C2: Analyze each texture area to obtain a polygon boundary and generate a mask of the same size as the original image, where the texture area is 1 and the non-texture area is 0;
[0093] Step C3: Perform a line-by-line scan of the mask for each texture region; for each line, identify the index range containing 1s;
[0094] Step C4: For the index range identified in each line, calculate its median value (i.e., the average of the index range) to obtain the center position of the texture orientation for that line. Connect all the center positions to form a texture orientation center vector;
[0095] Step C5: Label the center position of the texture orientation and its texture orientation center vector.
[0096] Since there are a large number and variety of laser textures, manual annotation would be very time-consuming. Therefore, by first using manual annotation and mask technology, texture regions in the image can be accurately identified and analyzed. Although the initial annotation is manual, subsequent steps (such as mask generation, line-by-line scanning, and center position calculation) can be automated, improving the processing efficiency. This method can be applied to different types of texture images, and only the annotation tools or parameters need to be adjusted to meet different texture analysis requirements.
[0097] Preferably, the steps for training the recognition model based on the sample image are as follows:
[0098] Step B1: Divide the training samples into a test sample group and a training sample group according to a ratio;
[0099] Step B2: Create a new Python 3.8 virtual environment and install PyTorch, torchvision, and Ultralytics in this environment; create a new Python virtual environment and strictly specify the dependency versions to completely solve the library version conflict problem. Combining the efficient GPU computing power of the PyTorch framework and the optimization of the YOLO model by Ultralytics provides a stable and reliable basic environment for model training, ensuring the traceability of the experimental process and the reproducibility of the results.
[0100] Step B3: Perform parameter settings, including setting the type of image enhancement, and initially setting the image input size of the YOLOv11 network model, the learning rate of the YOLOv11 network model, the type of optimizer, the batch size, the number of iterations, the number of worker threads, the confidence threshold, and the non-maximum suppression threshold;
[0101] Step B4: Use the training sample group to train the recognition model;
[0102] Step B5: Select the optimal parameter settings through cross-validation, including using a loss function to calculate the positive and negative sample allocation strategy and loss calculation during the training process;
[0103] The positive and negative sample allocation strategy is as follows: Select the largest k positive samples, and sort them according to the scores weighted by the classification and regression scores. The calculation formula for the weighted score is as follows:
[0104] t = s α ×u β , where t represents the weighted score, s represents the predicted score corresponding to the labeled tool category, u represents the intersection over union of the predicted bounding box and the texture bounding box, α and β are weight hyperparameters, and s multiplied by u is used to measure the alignment degree;
[0105] Dynamically adjust the contribution weights of classification and localization through the hyperparameters α and β to solve the problem of false detection with high scores and low IoU in traditional methods. Then, use s×u as the alignment degree index to ensure that positive samples have both high classification confidence and accurate localization. Experiments show that this strategy can increase the F1-score of tool detection by 8 - 12%, especially reducing the false detection rate by 20% in the scenario of dense small targets. This makes the model pay more attention to difficult-to-classify samples and samples with high alignment degree, thereby improving the recognition accuracy of the model.
[0106] Step B6: Based on the test sample group, test the trained recognition model to generate test results, and optimize the trained recognition model based on the test results to obtain an optimized recognition model. Loop through steps B4 - B6 until the number of iterations meets the threshold, and determine the optimized recognition model as the first model.
[0107] A judgment system for the laser texture process parameters of a mold, using the judgment method for the laser texture process parameters of a mold, includes: an image processing module, a recognition module, and a judgment module;
[0108] The image processing module is used to obtain a sample image of the laser texture process, train a recognition model based on the sample image, and obtain a first model, where the first model is obtained by training with YOLOv11;
[0109] The recognition module is used to obtain the texture image of the standard mold as the first image, obtain the texture image of the processed workpiece as the second image, and input the first image and the second image into the first model respectively to obtain a first recognition result and a second recognition result;
[0110] The judgment module judges whether the current mold needs to be modified based on the first recognition result and the second recognition result.
[0111] Preferably, the image processing module includes a first processing sub-module, a labeling sub-module, and a training sub-module;
[0112] The first processing sub-module is used to extract the central position of the texture orientation and the normal position of the texture in the sample image to obtain a first processed image;
[0113] The annotation sub-module is used to perform image annotation on the first processed image to generate training samples;
[0114] The training sub-module is used to input the training samples into the model for training.
[0115] Preferably, the first processing sub-module includes a first adjustment unit, a noise reduction unit, a filtering unit, a segmentation unit, and an extraction unit;
[0116] The first adjustment unit is used to perform low-pass processing on the sample image to obtain a first image, compare the B-channel image in the RBG channels of the first image with the sample image, and obtain a texture edge information image;
[0117] The noise reduction unit is used to perform continuous wavelet transform denoising on the texture edge information image to obtain a first denoised image;
[0118] The filtering unit is used to filter the first denoised image based on the median filtering method to obtain a first texture image;
[0119] The segmentation unit is based on a preset gray threshold to perform gray segmentation on the first texture image to obtain a second texture image;
[0120] The extraction unit is used to perform Canny edge extraction on the second texture image to extract the texture contour, and obtain a first processed image containing the central position of the texture trend and the normal position of its texture.
[0121] Preferably, the annotation sub-module includes a drawing unit, a mask unit, a scanning unit, a calculation unit, and an annotation unit;
[0122] The drawing unit is used to use the drawing tool of LabelMe to draw each texture area in the first processed image;
[0123] The mask unit is used to parse each texture area to obtain a polygon boundary, and generate a mask of the same size as the original image, where the texture area is 1 and the non-texture area is 0;
[0124] The scanning unit scans each row of the mask of each texture area; for each row, it identifies the index range containing 1;
[0125] The calculation unit is used for the index range identified in each row, calculates the median value thereof, obtains the central position of the texture trend of this row, and connects all the central positions to form a texture trend central vector;
[0126] The annotation unit is used to annotate the central position of the texture trend and its texture trend central vector.
[0127] Preferably, the training sub-module includes a grouping unit, an environment setup unit, a setting unit, a training unit, a verification unit, and a loop unit;
[0128] The grouping unit is used to divide the training samples into a test sample group and a training sample group according to a ratio;
[0129] The environment setup unit is used to create a Python 3.8 virtual environment and install PyTorch, torchvision, and ultralytics in this environment;
[0130] The setting unit is used to perform parameter settings, including setting the type of image enhancement, and preliminarily setting the image input size of the YOLOv11 network model, the learning rate of the YOLOv11 network model, the type of optimizer, the batch size, the number of iterations, the number of worker threads, the confidence threshold, and the non-maximum suppression threshold;
[0131] The training unit is used to train the recognition model using the training sample group;
[0132] The verification unit is used to select the optimal parameter settings through cross-validation, including using a loss function to calculate the positive and negative sample assignment strategy and loss calculation during the training process;
[0133] The positive and negative sample assignment strategy is as follows: Select the largest k positive samples, and sort according to the scores weighted by the classification and regression scores. The calculation formula of the weighted score is as follows:
[0134] t = s α × u β , where t represents the weighted score, s represents the predicted score corresponding to the labeled tool category, u represents the intersection over union of the predicted box and the texture bounding box, α and β are weight hyperparameters, and s multiplied by u is used to measure the alignment degree;
[0135] The loop unit is used to test the trained recognition model based on the test sample group, generate test results, optimize the trained recognition model based on the test results to obtain an optimized recognition model, and repeatedly call the training unit, the verification unit, and the loop unit until the number of iterations meets the number threshold, and determine the optimized recognition model as the first model.
[0136] In the description of this specification, the descriptions with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0137] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A method for determining laser texturing process parameters of a mold, characterized in that: The steps include: Acquire a sample image of a laser texturing process, and train a recognition model based on the sample image to acquire a first model, wherein the first model is trained by YOLOv11; Acquire a texture image of a standard mold as a first image, acquire a texture image of a processed workpiece as a second image, input the first image and the second image into a first model respectively, and acquire a first recognition result and a second recognition result; Based on the first recognition result and the second recognition result, it is determined whether the current mold needs to be modified.
2. The method for determining laser texturing process parameters of a mold according to claim 1, characterized in that: Training the model based on the sample image includes: Extracting the center position of the texture direction and the normal position of the texture in the sample image to obtain a first processed image; Annotating the first processed image to generate a training sample; Input the training samples into the model for training.
3. The method for determining laser texturing process parameters of a mold according to claim 2, characterized in that: The steps of obtaining the first processed image are as follows: Step A1: performing low-channel processing on the sample image to obtain a first image, comparing the B channel image in the RBG channel of the first image with the sample image to obtain a texture edge information image; Step A2: performing continuous wavelet transform on the texture edge information image to reduce noise, and obtaining a first reduced noise image; Step A3: filtering the first noise reduction image based on a median filtering method to obtain a first texture image; Step A4: performing grayscale segmentation on the first texture image based on a preset grayscale threshold to obtain a second texture image; Step A5: Perform Canny edge extraction on the second texture image to obtain a first processed image including the center position of the texture direction and the normal position of the texture.
4. The method for determining laser texturing process parameters of a mold according to claim 2, characterized in that: The steps of image annotation for the first processed image are as follows: Step C1: Use the drawing tool of LabelMe to draw each texture area in the first processed image; Step C2: parse each texture area, obtain the polygon boundary, and generate a mask with the same size as the original image, where the texture area is 1 and the non-texture area is 0; Step C3: Scan the mask of each texture region line by line; for each line, identify the index range containing 1; Step C4: for each row of identified index ranges, calculate the middle value thereof to obtain the texture trend center position of the row, connect all the center positions to form the texture trend center vector; Step C5: Mark the texture center position and the texture center vector.
5. The method for determining laser texturing process parameters of a mold according to claim 4, characterized in that: The steps of training the recognition model based on the sample image are as follows: Step B1: Divide the training samples into a test sample group and a training sample group according to the ratio; Step B2: Create a new python3.8 virtual environment and install pytorch, torchvision and ultralytics in it; Step B3: Perform parameter settings, including setting the image enhancement type, and preliminarily setting the image input size of the YOLOv11 network model, the learning rate of the YOLOv11 network model, the type of optimizer, the batch size, the number of iterations, the number of working threads, the confidence threshold, and the non-maximum suppression threshold; Step B4: training the recognition model using the training sample group; Step B5: Select the optimal parameter setting through cross-validation method, including using loss function to calculate the positive and negative sample allocation strategy and loss calculation during training; The positive and negative sample allocation strategy is: select the largest k positive samples and sort them according to the weighted scores of classification and regression. The calculation formula of the weighted score is as follows: t=s α ×u β , where t represents the weighted score, s represents the predicted score corresponding to the annotated tool category, u represents the intersection-over-union ratio of the predicted box and the texture bounding box, α and β are weight hyperparameters, and s is multiplied by u to measure the degree of alignment; Step B6: Based on the test sample group, the trained recognition model is tested to generate test results, and the trained recognition model is tuned based on the test results to obtain the tuned recognition model. Steps B4 to B6 are repeated until the number of iterations meets the number threshold, and the tuned recognition model is determined as the first model.
6. A system for determining laser texturing process parameters of a mold, characterized in that: A method for determining laser texturing process parameters of a mold using any one of claims 1 to 5, comprising: a graphics processing module, a recognition module and a determination module; The image processing module is used to obtain a sample image of the laser texturing process, and train a recognition model based on the sample image to obtain a first model, wherein the first model is trained by YOLOv11; The recognition module is used to obtain a texture image of a standard mold as a first image, obtain a texture image of a processed workpiece as a second image, input the first image and the second image into a first model respectively, and obtain a first recognition result and a second recognition result; The judging module judges whether the current mold needs to be modified based on the first recognition result and the second recognition result.
7. The system for determining laser texturing process parameters of a mold according to claim 6, characterized in that: The graphics processing module includes a first processing submodule, a labeling submodule and a training submodule; The first processing submodule is used to extract the center position of the texture direction and the normal position of the texture in the sample image to obtain a first processed image; The annotation submodule is used to perform image annotation on the first processed image to generate a training sample; The training submodule is used to input training samples into the model for training.
8. The system for determining laser texturing process parameters of a mold according to claim 7, characterized in that: The first processing submodule includes a first adjustment unit, a noise reduction unit, a filtering unit, a segmentation unit, and an extraction unit; The first adjustment unit is used to perform low-channel processing on the sample image, obtain the first image, compare the B channel image in the RBG channel of the first image with the sample image, and obtain the texture edge information image; The denoising unit is used to perform continuous wavelet transform denoising on the texture edge information image to obtain a first denoised image; The filtering unit is used to filter the first noise reduction image based on a median filtering method to obtain a first texture image; The segmentation unit performs grayscale segmentation on the first texture image based on a preset grayscale threshold to obtain a second texture image; The extraction unit is used to perform Canny edge extraction on the second texture image to extract the texture contour, and obtain a first processed image including the center position of the texture direction and the normal position of the texture.
9. The system for determining laser texturing process parameters of a mold according to claim 8, characterized in that: The annotation submodule includes a drawing unit, a mask unit, a scanning unit, a calculation unit and an annotation unit; The drawing unit is used to draw each texture area in the first processed image using a drawing tool of LabelMe; The mask unit is used to parse each texture area, obtain the polygon boundary, and generate a mask with the same size as the original image, where the texture area is 1 and the non-texture area is 0; The scanning unit scans the mask of each texture region row by row; for each row, the index range containing 1 is identified; The calculation unit is used to calculate the middle value of the index range identified in each row, obtain the texture trend center position of the row, and connect all the center positions to form the texture trend center vector; The marking unit is used to mark the center position of the texture trend and the center vector of the texture trend.
10. The system for determining laser texturing process parameters of a mold according to claim 9, characterized in that: The training submodule includes a grouping unit, an environment building unit, a setting unit, a training unit, a verification unit and a loop unit; The grouping unit is used to divide the training samples into a test sample group and a training sample group according to a ratio; The environment building unit is used to create a new python3.8 virtual environment and install pytorch, torchvision and ultralytics in this environment; The setting unit is used to set parameters, including setting the image enhancement type, and making preliminary settings for the image input size of the YOLOv11 network model, the learning rate of the YOLOv11 network model, the type of optimizer, the batch size, the number of iterations, the number of working threads, the confidence threshold, and the non-maximum suppression threshold; The training unit is used to train the recognition model using the training sample group; The validation unit is used to select the optimal parameter settings through the cross-validation method, including using the loss function to calculate the positive and negative sample allocation strategy and loss calculation during the training process; The positive and negative sample allocation strategy is: select the largest k positive samples and sort them according to the weighted scores of classification and regression. The calculation formula of the weighted score is as follows: t=s α ×u β , where t represents the weighted score, s represents the predicted score corresponding to the annotated tool category, u represents the intersection-over-union ratio of the predicted box and the texture bounding box, α and β are weight hyperparameters, and s is multiplied by u to measure the degree of alignment; The loop unit is used to test the trained recognition model based on the test sample group, generate test results, tune the trained recognition model based on the test results to obtain the tuned recognition model, repeatedly call the training unit, the verification unit and the loop unit until the number of iterations meets the number threshold, and determine the tuned recognition model as the first model.