Machine learning-based methods, devices, equipment, and media for obtaining proportions.

By using a nonlinear regression model based on machine learning, the problem of dimensional inaccuracies caused by deformation during laser sintering was solved, enabling more accurate proportional calculation and printing, and improving the robustness and adaptability of additive manufacturing.

CN115983122BActive Publication Date: 2026-04-03HUNAN FARSOON HIGH TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2026-04-03

Smart Images

  • Figure CN115983122B_ABST
    Figure CN115983122B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, and medium for obtaining scaling ratios based on machine learning, belonging to the field of laser sintering technology. The method includes: acquiring additive manufacturing data; dividing the additive manufacturing data into a training set, a test set, and a validation set; training and testing an initial nonlinear regression model using the training and test sets until the loss corresponding to the test set is within a preset loss range, thus obtaining a corrected nonlinear regression model; validating the corrected nonlinear regression model using the validation set, and if the validation error is within a preset error range, using the corrected nonlinear regression model as the final nonlinear regression model; and calculating the predicted scaling ratio using the final nonlinear regression model for the coordinates of multiple vertices of a 3D model. In this way, the predicted scaling ratio can be calculated more accurately through the final nonlinear regression model, improving the robustness and generalization of additive manufacturing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of laser sintering technology, and in particular to a method, apparatus, device and medium for obtaining proportions based on machine learning. Background Technology

[0002] Currently, deformation occurs during the laser sintering process in additive manufacturing, which is one of the important factors leading to inaccurate final workpiece dimensions. Pre-scaling and offsetting the workpiece before printing can compensate for the deformation that occurs during laser sintering and can overcome the influence of deformation to a certain extent.

[0003] Currently, the common approach is to use a fixed scaling factor and bias value to scale and bias all points on the workpiece by the same ratio. This approach usually has poor robustness and generalization, and the results obtained by constant scaling bias vary greatly for different printed workpieces. Summary of the Invention

[0004] To address the aforementioned technical problems, embodiments of this application provide a method, apparatus, device, and medium for obtaining proportions based on machine learning.

[0005] In a first aspect, embodiments of this application provide a ratio acquisition method based on machine learning, the method comprising:

[0006] Additive manufacturing data is obtained based on multiple real dimensions of the pre-printed sample and multiple vertex coordinates of the 3D model;

[0007] The additive manufacturing data is preprocessed and divided into training set, test set and validation set.

[0008] An initial nonlinear regression model is constructed based on the neural network;

[0009] The initial nonlinear regression model is trained using the training set, and the trained nonlinear regression model is tested using the test set until the loss corresponding to the test set is within a preset loss range, at which point training stops and a corrected nonlinear regression model is obtained.

[0010] The modified nonlinear regression model is validated using the validation set to obtain the validation error. If the validation error is within a preset error range, the modified nonlinear regression model is used as the final nonlinear regression model.

[0011] The final nonlinear regression model is used to calculate the coordinates of multiple vertices of the 3D model to obtain the predicted scaling ratio.

[0012] In one embodiment, obtaining additive manufacturing data based on multiple real dimensions of the pre-printed sample and multiple vertex coordinates of the 3D model includes:

[0013] Multiple theoretical dimensions of the pre-printed sample are obtained based on multiple vertex coordinates;

[0014] Calculate the change ratio based on each actual size and its corresponding theoretical size;

[0015] The vertex coordinates and the change ratios are used as the additive manufacturing data.

[0016] In one embodiment, the preprocessing of the additive manufacturing data, dividing the preprocessed additive manufacturing data into a training set, a test set, and a validation set, includes:

[0017] Store the coordinates of the multiple vertices into a first file;

[0018] The change ratios are sequentially stored in the second file according to the correspondence between the change ratio and the vertex coordinates.

[0019] According to a preset division ratio, the coordinates of multiple vertices in the first file are divided into a first training subset, a first test subset, and a first verification subset;

[0020] According to the preset division ratio, the multiple change ratios in the second file are divided into a second training subset, a second test subset, and a second verification subset;

[0021] The first training subset and the second training subset are combined to form the training set, the first test subset and the second test subset are combined to form the test set, and the first verification subset and the second verification subset are combined to form the verification set.

[0022] In one embodiment, the initial nonlinear regression model includes the following formula:

[0023]

[0024] Among them, S p α represents the proportion of change. ijk The x, y, and z values ​​represent the model parameters, with x, y, and z representing the vertex coordinates.

[0025] In one embodiment, training the initial nonlinear regression model using the training set and testing the trained nonlinear regression model using the test set includes:

[0026] Substitute the first training subset and the second training subset into the formula to calculate the model parameters. Perform a nonlinear transformation on the model parameters using an activation function to obtain delinearized model parameters. Substitute the delinearized model parameters into the model parameters in the formula to obtain the trained nonlinear regression model.

[0027] Substitute the first test subset into the trained nonlinear regression model to calculate the test results.

[0028] The loss between the test results and the second test subset is calculated using a loss function;

[0029] Determine whether the loss is within the preset loss range;

[0030] If so, the trained nonlinear regression model shall be used as the modified nonlinear regression model;

[0031] If not, the optimizer adjusts the model parameters of the trained nonlinear regression model based on the learning rate, fuzzy factor, weight decay ratio, and loss. The adjusted nonlinear regression model is then trained and tested until the loss corresponding to the adjusted nonlinear regression model falls within the preset loss range, at which point training stops.

[0032] In one embodiment, validating the modified nonlinear regression model using the validation set includes:

[0033] The first validation subset is input into the modified nonlinear regression model for calculation to obtain the validation result. The difference between the validation result and the second validation subset is determined as the validation error.

[0034] In one embodiment, the method further includes:

[0035] Print according to the predicted scaling ratio and the coordinates of multiple vertices of the 3D model.

[0036] Secondly, embodiments of this application provide a ratio acquisition device based on machine learning, the device comprising:

[0037] The acquisition module is used to acquire additive manufacturing data based on multiple real dimensions of the pre-printed sample and multiple vertex coordinates of the 3D model;

[0038] The partitioning module is used to preprocess the additive manufacturing data and divide the preprocessed additive manufacturing data into a training set, a test set, and a validation set.

[0039] The building block is used to construct an initial nonlinear regression model based on the neural network;

[0040] The training module is used to train the initial nonlinear regression model using the training set and to test the trained nonlinear regression model using the test set until the loss corresponding to the test set is within a preset loss range, at which point training stops and a corrected nonlinear regression model is obtained.

[0041] The verification module is used to verify the modified nonlinear regression model using the verification set, obtain the verification error, and, if the verification error is within a preset error range, use the modified nonlinear regression model as the final nonlinear regression model.

[0042] The calculation module is used to calculate the coordinates of multiple vertices of the 3D model using the final nonlinear regression model to obtain the predicted scaling ratio.

[0043] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the computer program executes the machine learning-based ratio acquisition method provided in the first aspect when the processor is running.

[0044] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a processor, executes the machine learning-based ratio acquisition method provided in the first aspect.

[0045] The scaling method, apparatus, device, and medium based on machine learning provided in this application acquire additive manufacturing data based on multiple real dimensions of a pre-printed sample and multiple vertex coordinates of a 3D model; preprocess the additive manufacturing data, dividing it into a training set, a test set, and a validation set; construct an initial nonlinear regression model based on a neural network; train the initial nonlinear regression model using the training set, and test the trained nonlinear regression model using the test set until the loss corresponding to the test set is within a preset loss range, at which point training stops, resulting in a corrected nonlinear regression model; validate the corrected nonlinear regression model using the validation set to obtain a validation error, and if the validation error is within a preset error range, use the corrected nonlinear regression model as the final nonlinear regression model; and calculate the predicted scaling ratio using the final nonlinear regression model on the multiple vertex coordinates of the 3D model. In this way, the initial nonlinear regression model is trained, tested, and validated using training, testing, and validation sets to obtain the final nonlinear regression model. The final nonlinear regression model can accurately calculate the predicted scaling ratio, effectively correcting the scaling problem caused by deformation during additive manufacturing, improving the robustness and generalization of additive manufacturing, and meeting the printing needs of various workpieces. Attached Figure Description

[0046] To more clearly illustrate the technical solutions of this application, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and should not be considered as a limitation on the scope of protection of this application. In the various drawings, similar components are numbered similarly.

[0047] Figure 1 This illustration shows one of the flowcharts of the proportion acquisition method based on machine learning provided in an embodiment of this application;

[0048] Figure 2 This is a second schematic flowchart of the proportion acquisition method based on machine learning provided in an embodiment of this application;

[0049] Figure 3 One of the comparative diagrams provided in the embodiments of this application is shown;

[0050] Figure 4 One of the schematic diagrams shows the spatial proportions produced by existing linear fitting schemes;

[0051] Figure 5 One of the spatial representation examples of the final nonlinear regression model provided in the embodiments of this application is shown;

[0052] Figure 6 This paper shows one of the structural schematic diagrams of a machine learning-based ratio acquisition device provided in an embodiment of this application.

[0053] Icons: 600 - Machine learning-based ratio acquisition device; 601 - Acquisition module; 602 - Division module; 603 - Construction module; 604 - Training module; 605 - Validation module; 606 - Calculation module. Detailed Implementation

[0054] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0055] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0056] In the following, the terms “comprising,” “having,” and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as excluding, firstly, the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations thereof.

[0057] Furthermore, the terms "first," "second," and "third" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0058] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.

[0059] Example 1

[0060] This application provides a method for obtaining proportions based on machine learning.

[0061] For details, see Figure 1 The ratio acquisition method based on machine learning includes steps S101-S106, and each step is explained below.

[0062] Step S101: Obtain additive manufacturing data based on multiple real dimensions of the pre-printed sample and multiple vertex coordinates of the 3D model.

[0063] In existing technologies, deformation occurs during the laser sintering process in additive manufacturing, so it is necessary to pre-print a sample based on the 3D model. The additive manufacturing data is determined based on the actual size of the pre-printed sample and the theoretical size of the 3D model. This additive manufacturing data can also be called production data.

[0064] Please see Figure 2 Step S101 includes:

[0065] Step S1011: Obtain multiple theoretical dimensions of the pre-printed sample based on the multiple vertex coordinates;

[0066] Step S1012: Calculate the change ratio based on each actual size and its corresponding theoretical size;

[0067] Step S1013: The multiple vertex coordinates and multiple change ratios are used as the additive manufacturing data.

[0068] In this embodiment, the change ratio can be calculated according to the following formula 1.

[0069] Formula 1:

[0070] Where s represents the percentage change, d a d represents the actual dimensions described. n This represents the theoretical dimension corresponding to each of the stated actual dimensions.

[0071] In this embodiment, each theoretical dimension can be calculated according to the following formula 2.

[0072] Formula 2:

[0073] Where, x i y i , z i , i = 1 or 2, represents the xyz coordinates of the two vertices corresponding to a dimension in the 3D model.

[0074] It should be noted that the 3D model can be a stereolithography (STL) model.

[0075] Step S102: Preprocess the additive manufacturing data and divide the preprocessed additive manufacturing data into a training set, a test set, and a validation set.

[0076] In this embodiment, the dimensions of the workpiece portion of the pre-printed sample are measured, and the corresponding vertex coordinate data are obtained from the STL model. Based on the theoretical size (theoretical value) and the actual measured size after printing (true value), the true value is subtracted from the theoretical value, and the difference is divided by the theoretical value to obtain the change ratio. The theoretical coordinate data is then placed point by point into a TXT file 1, and the calculated change ratios are placed into a TXT file 2 in the order corresponding to the theoretical coordinate data. The data in files 1 and 2 are divided into training, testing, and validation sets.

[0077] In one embodiment, step S102 includes:

[0078] Store the coordinates of the multiple vertices into a first file;

[0079] The change ratios are sequentially stored in the second file according to the correspondence between the change ratio and the vertex coordinates.

[0080] According to a preset division ratio, the coordinates of multiple vertices in the first file are divided into a first training subset, a first test subset, and a first verification subset;

[0081] According to the preset division ratio, the multiple change ratios in the second file are divided into a second training subset, a second test subset, and a second verification subset;

[0082] The first training subset and the second training subset are combined to form the training set, the first test subset and the second test subset are combined to form the test set, and the first verification subset and the second verification subset are combined to form the verification set.

[0083] In this embodiment, the first file and the second file can be in txt format, and the preset division ratio can be set to 6:2:2, or other ratios, which are not limited here.

[0084] See Table 1, which shows the first file. The first file consists of three columns, representing the x, y, and z coordinates of the vertex. That is, the first column is the x-axis coordinate of the vertex, the second column is the y-axis coordinate of the vertex, and the third column is the z-axis coordinate of the vertex.

[0085] Table 1. Example table of the first document.

[0086] -141.568 171.188 14.328 -141.568 171.188 104.328 -141.568 171.188 314.328 ... ... ... 139.23 -144.49 105.097 139.23 -144.49 315.097 139.23 -144.49 415.097

[0087] See Table 2, which shows the second file. The second file has one column, representing the change ratio calculated according to Formula 1. The number of change ratios in the second file is determined based on the number of vertex coordinates in the first file.

[0088] Table 2, Example Table of Second Documents.

[0089] -0.0028 -2.636364E-03 -0.0018 ... -4.545455E-04 0.0004 0.00045

[0090] Step S103: Construct an initial nonlinear regression model based on the neural network.

[0091] In one implementation, an initial nonlinear regression model can be constructed based on the forward propagation function of the neural network.

[0092] An exemplary initial nonlinear regression model includes the following formula 3.

[0093] Formula 3:

[0094] Among them, S p α represents the proportion of change. ijk The model parameters are represented by x, y, and z, which represent the vertex coordinates. i y j z k The independent variable is the power of the x, y, z coordinates of each vertex in the 3D model.

[0095] Step S104: Train the initial nonlinear regression model using the training set, and test the trained nonlinear regression model using the test set until the loss corresponding to the test set is within a preset loss range, then stop training to obtain the corrected nonlinear regression model.

[0096] In one embodiment, step S104 includes:

[0097] Substitute the first training subset and the second training subset into Formula 3 to calculate the model parameters. Perform a nonlinear transformation on the model parameters using an activation function to obtain delinearized model parameters. Substitute the delinearized model parameters into the model parameters in the formula to obtain the trained nonlinear regression model.

[0098] Substitute the first test subset into the trained nonlinear regression model to calculate the test results.

[0099] The loss between the test results and the second test subset is calculated using a loss function;

[0100] Determine whether the loss is within the preset loss range;

[0101] If so, the trained nonlinear regression model shall be used as the modified nonlinear regression model;

[0102] If not, the optimizer adjusts the model parameters of the trained nonlinear regression model based on the learning rate, fuzzy factor, weight decay ratio, and loss. The adjusted nonlinear regression model is then trained and tested until the loss corresponding to the adjusted nonlinear regression model falls within the preset loss range, at which point training stops.

[0103] In this embodiment, an activation function, a loss function, and an optimizer need to be set. The activation function can be any one of the following: Tanh activation function, Sigmoid activation function, ReLU activation function, Leaky ReLU activation function, PReLU activation function, and EReLU activation function. The loss function can be any one of the following: mean squared loss function (MSELoss), L1 loss, and Smooth L1 loss.

[0104] The Tanh activation function includes the following formula 4:

[0105] Formula 4:

[0106] Where e is the natural base, approximately 2.718281828459, and x is α in Formula 3. ijk .

[0107] It should be noted that the Tanh activation function performs a nonlinear transformation on the initial model parameters or the trained model parameters.

[0108] The mean squared loss function includes formula 5:

[0109] Formula 5:

[0110] Where n is the number of samples in the training or test set, y i It is the change ratio of the i-th sample, i.e., s, y' in Formula 1. i It is the scaling factor for the prediction of the i-th sample calculated by the trained nonlinear regression model, i.e., s in Formula 3. p .

[0111] The optimizer can be any one of AdamW optimizer, SGD optimizer, Adam optimizer, or Adagrad optimizer. The optimizer parameters include: learning rate, fuzz factor, and weight decay ratio. The learning rate is set between 0.1 and 0.001, the fuzz factor is set between 1e-7 and 1e-9, and the weight decay ratio is set between 1e-2 and 1e-6.

[0112] As an example, the first and second training subsets are fed into the constructed initial nonlinear regression model, including the following formula 3, for training, and the model parameters α in formula 3 are calculated. ijk After applying the Tanh activation function to the model parameters α ijk The nonlinear transformation is applied, and the delinearized model parameters are substituted into Formula 3. Then, the first subset of the test set is substituted into Formula 3 with the delinearized model parameters to obtain the test results. These results consist of multiple prediction scaling ratios, the number of which is the same as the number of samples in the first test subset. The test results and the corresponding change ratios in the second test subset are then substituted into the loss function for calculation. If the loss is outside the preset loss range, the optimizer will adjust the model parameters α defined in Formula 3 according to the set learning rate, fuzziness factor, and weight decay ratio. ijk This reduces the loss on the test set, thus initiating the next cycle. The training continues until the loss of Formula 3 on the test set is within the allowable range, at which point the model training stops and is complete.

[0113] It should be noted that the preset loss range can be obtained from experimental data or determined based on empirical values, and is not limited here.

[0114] It should be noted that formula 3, when expanded, yields the following formula 6:

[0115] Formula 6:

[0116] Where at represents the model parameter α in Formula 3. ijk .

[0117] In this embodiment, the parameters of the model can be set according to Table 3.

[0118] Table 3. Model parameter setting table.

[0119] Activation function Tanh loss function MSELoss(reduction="mean") Optimizer AdamW(parameters(),lr=0.01,weight_decay=0.0001)

[0120] After training the model, the training results can be saved. See Table 4, which shows an example of the training results.

[0121] Table 4. Example of training results.

[0122]

[0123]

[0124] The data in Table 4 means: the first row and first column are the loss function and optimizer used in this training, the second column is the number of model training iterations (901378), and the test loss at this time is 1.101269049286202e-06, which meets the expected requirements. The subsequent parameters in the second column represent the parameter values ​​in the model corresponding to those in the first column.

[0125] Using the validation set data in Table 5, we substituted it into the trained model to obtain the data in Table 7, and then performed error calculations with the validation set data in Table 6.

[0126] Table 5. Example table of the first validation subset of the validation set.

[0127] -141.568 171.188 14.328 -141.568 171.188 104.328 ... ... ... 171.601 171.188 314.328 171.601 171.188 414.328

[0128] Table 6. Example table of the second validation subset of the validation set.

[0129]

[0130] Table 7. Example of verification results.

[0131]

[0132]

[0133] Step S105: The modified nonlinear regression model is validated using the validation set to obtain the validation error. If the validation error is within a preset error range, the modified nonlinear regression model is used as the final nonlinear regression model.

[0134] To improve the accuracy of the model, the error of the modified linear regression model can be further calculated using a validation set.

[0135] In one embodiment, step S105 includes:

[0136] The first validation subset is input into the modified nonlinear regression model for calculation to obtain the validation result. The difference between the validation result and the second validation subset is determined as the validation error.

[0137] As an example, the first validation subset is substituted into the trained model parameters α. ijk The nonlinear regression model, i.e., substituting the trained model parameters α ijk In Formula 3, the obtained verification results include multiple predicted scaling ratios, the number of which is the same as the sample size of the first verification subset. If the error between the obtained verification results and the second verification subset is within a preset error range, the model is saved, and this model can be well applied to solve the problem of inaccurate scaling bias calculation in the field of additive manufacturing. The error between the verification results and the second verification subset can be mean square error, mean absolute error, and mean relative error, which are not limited here. It should be noted that the preset error range can be obtained from experimental data or determined based on empirical values, and is not limited here.

[0138] In this embodiment, a comparison chart can be drawn between the change ratio calculated according to Formula 1 and the predicted scaling ratio generated by model fitting. This comparison chart is as follows: Figure 3 As shown. Figure 3 In the diagram, the first curve A1 is plotted based on the change ratio calculated according to Formula 1, and the second curve A2 is plotted based on the predicted scaling ratio generated by model fitting.

[0139] In this embodiment, the mean absolute error is used to calculate the validation set data error as 0.000782. See [link to documentation]. Figure 3 The maximum error occurred in the 9th item of the validation set, approximately 0.002028, and the minimum error occurred in the 16th item of the validation set, approximately 0.000129. This error is within the allowable range.

[0140] Figure 4 This represents the proportions in space generated by traditional linear fitting methods. Figure 5 This is an example diagram illustrating the spatial representation of the final nonlinear regression model provided in this embodiment. (Comparison is shown below.) Figure 4 and Figure 5 As can be seen, the final nonlinear regression model provided in this embodiment can well represent the proportional changes at each point in the printing space. In summary, the final nonlinear regression model performs well and can be used as the final proportional bias prediction model.

[0141] Step S106: The final nonlinear regression model is used to calculate the coordinates of multiple vertices of the 3D model to obtain the predicted scaling ratio.

[0142] In this embodiment, the vertex coordinates of the STL model are input into the final nonlinear regression model, and the final nonlinear regression model, i.e., the trained formula 3, is used to predict the vertex coordinates of the STL model by scaling, so as to obtain a relatively accurate prediction scaling ratio.

[0143] In this embodiment, the proportion acquisition method based on machine learning further includes:

[0144] Print according to the predicted scaling ratio and the coordinates of multiple vertices of the 3D model.

[0145] In this way, the predicted scaling ratio and the coordinates of multiple vertices of the 3D model can be combined for more accurate printing, avoiding the impact of deformation during laser sintering on the printed object and improving the robustness and generalization of additive manufacturing.

[0146] The scaling method based on machine learning provided in this embodiment obtains additive manufacturing data based on multiple real dimensions of a pre-printed sample and multiple vertex coordinates of a 3D model. The additive manufacturing data is preprocessed and divided into a training set, a test set, and a validation set. An initial nonlinear regression model is constructed based on a neural network. The initial nonlinear regression model is trained using the training set, and the trained nonlinear regression model is tested using the test set until the loss corresponding to the test set is within a preset loss range. Training is then stopped to obtain a corrected nonlinear regression model. The corrected nonlinear regression model is validated using the validation set to obtain a validation error. If the validation error is within a preset error range, the corrected nonlinear regression model is used as the final nonlinear regression model. The final nonlinear regression model is used to calculate the predicted scaling ratio using the multiple vertex coordinates of the 3D model. In this way, the initial nonlinear regression model is trained, tested, and validated using training, testing, and validation sets to obtain the final nonlinear regression model. The final nonlinear regression model can accurately calculate the predicted scaling ratio, effectively correcting the scaling problem caused by deformation during additive manufacturing, improving the robustness and generalization of additive manufacturing, and meeting the printing needs of various workpieces.

[0147] Example 2

[0148] Furthermore, embodiments of this application provide a ratio acquisition device based on machine learning.

[0149] Specifically, such as Figure 6 As shown, the machine learning-based ratio acquisition device 600 includes:

[0150] The acquisition module 601 is used to acquire additive manufacturing data based on multiple real dimensions of the pre-printed sample and multiple vertex coordinates of the 3D model;

[0151] The partitioning module 602 is used to preprocess the additive manufacturing data and divide the preprocessed additive manufacturing data into a training set, a test set, and a validation set.

[0152] Module 603 is used to build an initial nonlinear regression model based on the neural network;

[0153] Training module 604 is used to train the initial nonlinear regression model using the training set and to test the trained nonlinear regression model using the test set until the loss corresponding to the test set is within a preset loss range, at which point training stops and a corrected nonlinear regression model is obtained.

[0154] The verification module 605 is used to verify the modified nonlinear regression model using the verification set, obtain the verification error, and, if the verification error is within a preset error range, use the modified nonlinear regression model as the final nonlinear regression model.

[0155] The calculation module 606 is used to calculate the coordinates of multiple vertices of the 3D model using the final nonlinear regression model to obtain the predicted scaling ratio.

[0156] In one embodiment, the acquisition module 601 is further configured to acquire multiple theoretical dimensions of the pre-printed sample based on multiple vertex coordinates;

[0157] Calculate the change ratio based on each actual size and its corresponding theoretical size;

[0158] The vertex coordinates and the change ratios are used as the additive manufacturing data.

[0159] In one embodiment, the partitioning module 602 is further configured to store the coordinates of the plurality of vertices into a first file;

[0160] The change ratios are sequentially stored in the second file according to the correspondence between the change ratio and the vertex coordinates.

[0161] According to a preset division ratio, the coordinates of multiple vertices in the first file are divided into a first training subset, a first test subset, and a first verification subset;

[0162] According to the preset division ratio, the multiple change ratios in the second file are divided into a second training subset, a second test subset, and a second verification subset;

[0163] The first training subset and the second training subset are combined to form the training set, the first test subset and the second test subset are combined to form the test set, and the first verification subset and the second verification subset are combined to form the verification set.

[0164] In one embodiment, the initial nonlinear regression model includes the following formula:

[0165]

[0166] Among them, S p α represents the proportion of change. ijk The x, y, and z values ​​represent the model parameters, with x, y, and z representing the vertex coordinates.

[0167] In one embodiment, the training module 604 is used to substitute the first training subset and the second training subset into the formula, calculate the model parameters, perform a nonlinear transformation on the model parameters through an activation function to obtain delinearized model parameters, and substitute the delinearized model parameters into the model parameters of the formula to obtain the trained nonlinear regression model.

[0168] Substitute the first test subset into the trained nonlinear regression model to calculate the test results.

[0169] The loss between the test results and the second test subset is calculated using a loss function;

[0170] Determine whether the loss is within the preset loss range;

[0171] If so, the trained nonlinear regression model shall be used as the modified nonlinear regression model;

[0172] If not, the optimizer adjusts the model parameters of the trained nonlinear regression model based on the learning rate, fuzzy factor, weight decay ratio, and loss. The adjusted nonlinear regression model is then trained and tested until the loss corresponding to the adjusted nonlinear regression model falls within the preset loss range, at which point training stops.

[0173] In one embodiment, the verification module 605 is further configured to input the first verification subset into the modified nonlinear regression model for calculation to obtain a verification result, and to determine the difference between the verification result and the second verification subset as the verification error.

[0174] In one embodiment, the machine learning-based ratio acquisition device further includes:

[0175] A printing module is used to print according to the predicted scaling ratio and the coordinates of multiple vertices of the 3D model.

[0176] The ratio acquisition device 600 based on machine learning provided in this embodiment can implement the ratio acquisition method based on machine learning provided in Embodiment 1. To avoid repetition, it will not be described again here.

[0177] The scaling device based on machine learning provided in this embodiment acquires additive manufacturing data based on multiple real dimensions of a pre-printed sample and multiple vertex coordinates of a 3D model. The additive manufacturing data is preprocessed and divided into a training set, a test set, and a validation set. An initial nonlinear regression model is constructed based on a neural network. The initial nonlinear regression model is trained using the training set, and the trained nonlinear regression model is tested using the test set until the loss corresponding to the test set is within a preset loss range. Training is then stopped to obtain a corrected nonlinear regression model. The corrected nonlinear regression model is validated using the validation set to obtain a validation error. If the validation error is within a preset error range, the corrected nonlinear regression model is used as the final nonlinear regression model. The final nonlinear regression model is used to calculate the predicted scaling ratio using the multiple vertex coordinates of the 3D model. In this way, the initial nonlinear regression model is trained, tested, and validated using training, testing, and validation sets to obtain the final nonlinear regression model. The final nonlinear regression model can accurately calculate the predicted scaling ratio, effectively correcting the scaling problem caused by deformation during additive manufacturing, improving the robustness and generalization of additive manufacturing, and meeting the printing needs of various workpieces.

[0178] Example 3

[0179] Furthermore, this application provides an electronic device, including a memory and a processor. The memory stores a computer program, which executes the machine learning-based ratio acquisition method provided in Embodiment 1 when the computer program is run on the processor.

[0180] The electronic device provided in this embodiment can implement the proportion acquisition method based on machine learning provided in Embodiment 1. To avoid repetition, it will not be described again here.

[0181] Example 4

[0182] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the machine learning-based ratio acquisition method provided in Embodiment 1.

[0183] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0184] The computer-readable storage medium provided in this embodiment can implement the proportion acquisition method based on machine learning provided in Embodiment 1. To avoid repetition, it will not be described again here.

[0185] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.

[0186] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0187] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A ratio acquisition method based on machine learning, characterized in that, The method includes: Additive manufacturing data is obtained based on multiple real dimensions of the pre-printed sample and multiple vertex coordinates of the 3D model; The additive manufacturing data is preprocessed and divided into training set, test set and validation set. An initial nonlinear regression model is constructed based on the neural network; The initial nonlinear regression model is trained using the training set, and the trained nonlinear regression model is tested using the test set until the loss corresponding to the test set is within a preset loss range, at which point training stops and a corrected nonlinear regression model is obtained. The modified nonlinear regression model is validated using the validation set to obtain the validation error. If the validation error is within a preset error range, the modified nonlinear regression model is used as the final nonlinear regression model. The final nonlinear regression model is used to calculate the coordinates of multiple vertices of the 3D model to obtain the predicted scaling ratio; The process of obtaining additive manufacturing data based on multiple real dimensions of the pre-printed sample and multiple vertex coordinates of the 3D model includes: Multiple theoretical dimensions of the pre-printed sample are obtained based on multiple vertex coordinates; Calculate the change ratio based on each actual size and its corresponding theoretical size; The vertex coordinates and the multiple change ratios are used as the additive manufacturing data; The initial nonlinear regression model includes the following formula: ; Among them, S p α represents the proportion of change. ijk The x, y, and z values ​​represent the model parameters, with x, y, and z representing the vertex coordinates.

2. The method according to claim 1, characterized in that, The preprocessing of the additive manufacturing data, which divides the preprocessed data into a training set, a test set, and a validation set, includes: Store the coordinates of the multiple vertices into a first file; The change ratios are sequentially stored in the second file according to the corresponding order between the change ratio and the vertex coordinates. According to a preset division ratio, the coordinates of multiple vertices in the first file are divided into a first training subset, a first test subset, and a first verification subset; According to the preset division ratio, the multiple change ratios in the second file are divided into a second training subset, a second test subset, and a second verification subset; The first training subset and the second training subset are combined to form the training set, the first test subset and the second test subset are combined to form the test set, and the first verification subset and the second verification subset are combined to form the verification set.

3. The method according to claim 2, characterized in that, The step of training the initial nonlinear regression model using the training set and testing the trained nonlinear regression model using the test set includes: Substitute the first training subset and the second training subset into the formula to calculate the model parameters. Perform a nonlinear transformation on the model parameters using an activation function to obtain delinearized model parameters. Substitute the delinearized model parameters into the model parameters in the formula to obtain the trained nonlinear regression model. Substitute the first test subset into the trained nonlinear regression model to calculate the test results. The loss between the test results and the second test subset is calculated using a loss function; Determine whether the loss is within the preset loss range; If so, the trained nonlinear regression model shall be used as the modified nonlinear regression model; If not, the optimizer adjusts the model parameters of the trained nonlinear regression model based on the learning rate, fuzzy factor, weight decay ratio, and loss. The adjusted nonlinear regression model is then trained and tested until the loss corresponding to the adjusted nonlinear regression model falls within the preset loss range, at which point training stops.

4. The method according to claim 3, characterized in that, The validation of the modified nonlinear regression model using the validation set includes: The first validation subset is input into the modified nonlinear regression model for calculation to obtain the validation result. The difference between the validation result and the second validation subset is determined as the validation error.

5. The method according to claim 1, characterized in that, The method further includes: Print according to the predicted scaling ratio and the coordinates of multiple vertices of the 3D model.

6. A ratio acquisition device based on machine learning, characterized in that, The device includes: The acquisition module is used to acquire additive manufacturing data based on multiple real dimensions of the pre-printed sample and multiple vertex coordinates of the 3D model; The partitioning module is used to preprocess the additive manufacturing data and divide the preprocessed additive manufacturing data into a training set, a test set, and a validation set. The building block is used to construct an initial nonlinear regression model based on the neural network; The training module is used to train the initial nonlinear regression model using the training set and to test the trained nonlinear regression model using the test set until the loss corresponding to the test set is within a preset loss range, at which point training stops and a corrected nonlinear regression model is obtained. The verification module is used to verify the modified nonlinear regression model using the verification set, obtain the verification error, and, if the verification error is within a preset error range, use the modified nonlinear regression model as the final nonlinear regression model. The calculation module is used to calculate the coordinates of multiple vertices of the 3D model using the final nonlinear regression model to obtain the predicted scaling ratio; The acquisition module is further configured to acquire multiple theoretical dimensions of the pre-printed sample based on multiple vertex coordinates; calculate the change ratio based on each actual dimension and its corresponding theoretical dimension; and use the multiple vertex coordinates and the multiple change ratios as the additive manufacturing data. The initial nonlinear regression model includes the following formula: ; Among them, S p α represents the proportion of change. ijk The x, y, and z values ​​represent the model parameters, with x, y, and z representing the vertex coordinates.

7. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program that executes the machine learning-based ratio acquisition method according to any one of claims 1 to 5 when the processor is running.

8. A computer-readable storage medium, characterized in that, It stores a computer program that, when run on a processor, executes the machine learning-based ratio acquisition method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • 3D printing error compensation method, system and device based on neural network

    CN109808183A