3D Printing Quality Prediction Method Based on BOHB Algorithm and Neural Network
By combining the BOHB algorithm and BP neural network, the FDM printing parameters are optimized, and the problem of time-consuming and labor-consuming selection of process parameters in the existing technology is solved, and high-precision molded parts quality prediction is achieved.
Patent Information
- Application Number
- CN202210677875.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-15
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2042-06-15
AI Technical Summary
Selecting suitable process parameters in the existing FDM technology requires a lot of experiments, which consumes manpower and material resources, and has insufficient prediction accuracy.
The BOHB algorithm is used to combine with the BP neural network, and by building a standard spline model, data processing and training set division, the variables of the BP neural network model are optimized, and the BOHB algorithm is used to find the optimal process parameters.
It improves the accuracy of molded parts quality prediction, reduces trial and error costs, improves training efficiency, adapts to the nonlinear and linear characteristics of the input data, and avoids the random blindness of the BP neural network.
Smart Images

Figure CN115049127B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of 3D printing, and particularly to a 3D printing quality prediction method based on the BOHB algorithm and neural network. Background Art
[0002] Fused Deposition Modeling (FDM) technology is one of the 3D printing technologies and is an additive manufacturing technology. Its printing material is a thermoplastic material, and products are manufactured by layer-by-layer printing. During printing, the printing material is heated to a molten state, pressure is applied, and it is extruded into a filament directly below the nozzle. The nozzle continuously moves along a certain path during the printing process, and the filamentous material is extruded through the nozzle onto the printing platform and quickly cools and solidifies to form a shape.
[0003] When using FDM technology to manufacture formed parts, since there are many process parameters involved, such as layer thickness, forming chamber temperature, number of scans, filling interval, scan path, etc., and the process parameters have a great impact on the quality of the formed parts, it is crucial to find a suitable method to predict the effects brought by different combinations of process parameters and reduce the poor quality of formed parts caused by incorrect selection of process parameters. Currently, in the field of FDM technology, selecting suitable process parameters still relies on experiments, and the control variable method is used to test the effects of different process parameters on the quality of FDM formed parts. However, due to too many variables to be controlled and the non-linear characteristics, a large number of experiments need to be conducted to find a better process plan, consuming a large amount of manpower, material resources and time. Summary of the Invention
[0004] The purpose of the present invention is to make up for the deficiencies of the existing solutions and provide a 3D printing quality prediction method based on the BOHB algorithm and neural network.
[0005] The technical solution adopted by this application is: A 3D printing quality prediction method based on the BOHB algorithm and neural network, including:
[0006] Step 1, determining process parameters: determining the process parameters of fused deposition modeling;
[0007] Step 2, constructing a standard spline model and adjusting process parameters: establishing a standard tensile test spline model, constructing a mechanical property test spline model, layering the test spline model, and adjusting the process parameters according to the standard after layering;
[0008] Step 3, printing the test spline model and testing: importing the test spline model into a 3D printer for printing, conducting mechanical property and roughness tests according to a preset standard, recording the test results, and obtaining an experimental data set;
[0009] Step 4: Process the experimental data set: normalize the experimental data set and divide it into training set and test set;
[0010] Step 5: Constructing a BP neural network prediction model: constructing a BP neural network prediction model, wherein the input of the BP neural network prediction model is the process parameters, and the output is the tensile strength and the surface roughness;
[0011] Step 6: Use the training set to train the BP neural network prediction model, construct a BOHB algorithm to search and optimize the variables of the BP neural network prediction model in training, use the test set to test the BP neural network prediction model, and continuously train the BP neural network prediction model until a preset accuracy is reached;
[0012] Step 7: Establish an optimization algorithm, the objective function of which is to optimize the output of the BP neural network prediction model and obtain the optimal process parameters.
[0013] Preferably, in step six, one or more of the activation function, the number of hidden layer nodes, the weight and the bias value are set as variables of the BP neural network prediction model, and the variables are optimized as the BOHB algorithm.
[0014] Preferably, the BP neural network prediction model constructed in step five includes an input layer, a hidden layer and an output layer, the selection range of the activation function from the input layer to the hidden layer is {relu, tanh}, the selection range of the activation function from the hidden layer to the output layer is {relu, tanh}, the number of input layer nodes x is adapted to the number of process parameters changed during printing, the input layer neurons respectively input the corresponding process parameter values, the number of output layer nodes is y, the output layer neurons correspond to the number of parameters for evaluating the quality of FDM printed parts, the number of hidden layer nodes is m, m is a preset value, the evaluation function of the neural network uses the mse function, and the loss function of the BOHB algorithm in step six uses the mse function. M is the total number of samples.
[0015] Preferably, the number m of hidden layer nodes is calculated based on the number x of input layer neuron nodes and the number y of output layer neuron nodes, including: calculating m2=log2x, Take the value α∈[1,10] and select any one from m1, m2 and m3 as the value of m.
[0016] As a preferred embodiment, the number m of hidden layer nodes is m1, and the search range of the number m of hidden layer nodes is Use the randint(1,10) function to determine the search value.
[0017] Preferably, for each connection weight w of the neural network and the bias value b of the neuron, the search range is [-3, 3], and the uniform function is used to obtain the values.
[0018] Preferably, the ratio of the data volume of the experimental data between the training set and the test set is 7:3.
[0019] Preferably, the process parameters of fused deposition modeling are one or more of the filling interval, the number of scanning times, and the printing layer thickness.
[0020] The beneficial technical effects of the present invention are as follows: providing reference for users when selecting printing parameters, reducing the cost of trial and error, using the combination of the BOHB algorithm and the neural network, being able to predict the quality of the formed parts more accurately; being able to adapt to the non-linear correlation and linear correlation characteristics of the input data and the output data, and the BOHB algorithm optimizing the variables through the evaluation function values feedback in real time by the neural network, avoiding the random blindness of the BP neural network prediction model when selecting variable values, being able to greatly improve the prediction accuracy and accelerate the training efficiency of the BP neural network prediction model.
[0021] Other features and advantages of the present invention will be disclosed in detail in the following specific embodiments and the drawings. Description of the Drawings
[0022] The present invention will be further described below with reference to the drawings:
[0023] Figure 1 It is a schematic flow chart of the 3D printing quality prediction method in the embodiment of the present invention.
[0024] Figure 2 It is a comparison curve graph of the true values and the prediction results of three models of surface roughness.
[0025] Figure 3 It is a comparison curve graph of the true values and the prediction results of three models of tensile strength and surface roughness. Specific Embodiments
[0026] The technical solutions of the embodiments of the present invention will be explained and described below with reference to the drawings of the embodiments of the present invention. However, the following embodiments are only the preferred embodiments of the present invention and not all of them. Based on the embodiments in the embodiments, other embodiments obtained by those skilled in the art without creative efforts all belong to the protection scope of the present invention.
[0027] In the following description, terms such as "inner", "outer", "upper", "lower", "left", "right", etc., which indicate orientation or positional relationship, are only for the convenience of describing embodiments 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 thus should not be construed as a limitation of the present invention.
[0028] Embodiment:
[0029] A 3D printing quality prediction method based on the BOHB algorithm and neural network. Please refer to the appendix Figure 1 , including:
[0030] Step 1. Determine process parameters: Determine the process parameters of fused deposition modeling.
[0031] Step 2. Build a standard spline model and adjust process parameters: Establish a standard tensile test spline model, construct a mechanical property test spline model, layer the test spline model, and adjust the process parameters according to the standard after layering.
[0032] Step 3. Print the test spline model and test: Import the test spline model into a 3D printer for printing, conduct mechanical property and roughness tests according to the preset standard, record the test results, and obtain an experimental data set.
[0033] Step 4. Process the experimental data set: Normalize the experimental data set and divide it into a training set and a test set.
[0034] Step 5. Build a BP neural network prediction model: Build a BP neural network prediction model. The input of the BP neural network prediction model is the process parameters, and the output is the tensile strength and surface roughness.
[0035] Step 6. Use the training set to train the BP neural network prediction model, build the BOHB algorithm to search and optimize the variables of the BP neural network prediction model during training, use the test set to test the BP neural network prediction model, and continuously train the BP neural network prediction model until the preset accuracy is reached.
[0036] Step 7. Establish an optimization algorithm. The objective function is to make the output of the BP neural network prediction model optimal, and obtain the optimal process parameters.
[0037] In Step 6, one or more of the activation function, the number of hidden layer nodes, the weights, and the bias values are set as variables of the BP neural network prediction model, and the variables are optimized by the BOHB algorithm.
[0038] In this embodiment, in Step 3, a standard tensile spline model is designed using CAD software; the constructed mechanical property test spline model is exported as an STL file, and the STL file is read and sliced using the software supporting the FDM printer, and the process parameters are adjusted according to the CCD scheme. After the process parameters are adjusted, the set model data is imported into the FDM printer for preparation of printing; after all the test splines are printed, the mechanical properties and roughness are tested respectively according to the standards, and the test results are recorded to obtain the experimental data set.
[0039] In Step 4, the experimental data set is first normalized by min-max normalization so that the data is normalized to the range of [0, 1]; the train_test_split function is used to divide the experimental data set into a training set and a test set according to a certain ratio for training the model. In Step 5, a quality prediction model model for FDM printed parts based on a BP neural network is constructed in Python, and four hyperparameters, namely the activation function, the number of hidden layer nodes, the weights and biases of the BP neural network, are set as variables. In Step 6, a Bayesian Optimization and HyperBand (BOHB) algorithm is constructed in Python, and the BOHB algorithm is used to search and optimize the activation function, the number of hidden layer nodes, the weights and biases of the BP neural network of the quality prediction model model for FDM printed parts. After each set of experimental data is input into the BP neural network prediction model, the loss function value of the BP neural network prediction model is obtained. The loss function value is regarded as the loss value of the BOHB algorithm, and the activation function, the number of hidden layer nodes, the weights and biases of the BP neural network are updated using the BOHB algorithm. Then it is input into the BP neural network prediction model again. The training parameters, the number of iterations, the learning efficiency, and the target accuracy are set, and the training stops when the loss function value reaches the target accuracy or the number of iterations reaches the maximum value.
[0040] In this embodiment, the plt.show function can also be used to process the image and display the prediction result graph, and according to the curve trend in the graph, the optimal process parameter range is found manually. Within the optimal process parameter range, parameter optimization is carried out.
[0041] The BP neural network prediction model constructed in Step 5 includes an input layer, a hidden layer, and an output layer. The selection range of activation functions from the input layer to the hidden layer is {relu, tanh}, and the selection range of activation functions from the hidden layer to the output layer is {relu, tanh}. The number of nodes x in the input layer is adapted to the number of process parameters changed during printing. The neurons in the input layer respectively input the corresponding process parameter values. The number of nodes in the output layer is y, and the neurons in the output layer correspond to the number of parameters for evaluating the quality of FDM printed parts. The number of nodes in the hidden layer is m, and m is a preset value. The evaluation function of the neural network uses the mse function, and the loss function of the BOHB algorithm in Step 6 uses the mse function. M is the total number of samples.
[0042] The number of nodes m in the hidden layer is calculated and determined according to the number of nodes x of the neurons in the input layer and the number of nodes y of the neurons in the output layer, including: calculating m2 = log2x, Taking the value α ∈ [1, 10], and randomly selecting one from m1, m2, and m3 as the value of m.
[0043] In this embodiment, the following method can also be used to set the value of the number of nodes m in the hidden layer: The number of nodes m in the hidden layer takes the value m1, and the search range of the number of nodes m in the hidden layer is Using the randint(1, 10) function to determine the search value.
[0044] For each connection weight w and neuron bias value b of the neural network, the search range is [-3, 3], and the uniform function is used to take values. The ratio of the data volume of the experimental data of the training set to the test set is 7:3.
[0045] The process parameters of fused deposition modeling are one or more of filling interval, scanning times, and printing layer thickness.
[0046] The beneficial technical effects of this embodiment are: providing a reference for users when selecting printing parameters, reducing the trial - and - error cost. Using the combination of the BOHB algorithm and the neural network can more accurately predict the quality of the formed parts; it can adapt to the non - linear and linear correlation characteristics of input data and output data, and the BOHB algorithm optimizes variables through the evaluation function values feedback by the neural network in real time, avoiding the random blindness of the BP neural network prediction model when selecting variable values, and can greatly improve the prediction accuracy and accelerate the training efficiency of the BP neural network prediction model.
[0047] Embodiment 2:
[0048] According to prior knowledge and existing equipment condition limitations, process parameters and the number of levels are determined in this embodiment. A suitable central composite design experiment is selected. The factor level table is shown in Table 1, and a central composite design table with three factors and three levels is selected.
[0049] Table 1 Factor Level Table
[0050] Horizontal Filling interval / (Nf) Scanning times / (Ns) Layer thickness / (mm) -1 3 2 0.17 0 4 3 0.20 1 5 4 0.25
[0051] Adopting the tensile spline standard of GB / T 1040.2-2006, a standard spline model is designed through CAD software.
[0052] The three-dimensional model of the mechanical property test spline constructed is exported as an STL file, sliced using the software supporting the FDM printer, and the process parameters are adjusted according to the central composite design scheme. The process parameter schemes of some experiments are shown in Table 2.
[0053] Table 2 Parameter Setting Schemes of Some Experiments
[0054] Number Filling interval / (Nf) Scanning times / (Ns) Layer thickness / (mm) 1 -1 -1 -1 2 1 -1 -1 3 -1 1 -1 4 1 1 -1 5 -1 -1 1 6 1 -1 1
[0055] After parameter adjustment, the set spline model is imported into the FDM printer for preparation of printing. After all the test splines are printed, the tensile strength and surface roughness are tested respectively according to the standards of GB / T 1040.2-2006 and GB / T 1031-2009, the test results are recorded, and conversions are made according to the corresponding formulas. The results of some experiments are shown in Table 3. The units of the data are as follows: the filling interval unit is Nf, the scanning times unit is Ns, the layer thickness unit is mm, the surface roughness unit is μm, and the tensile strength unit is MPa.
[0056] Table 3. Results of Some Experiments
[0057] Number Filling interval Scanning times Layer thickness Surface roughness Tensile strength 1 -1 -1 -1 5.883 15.33 2 1 -1 -1 5.308 13.76 3 -1 1 -1 6.113 18.04 4 1 1 -1 7.84 17.96 5 -1 -1 1 16.738 14.76 6 1 -1 1 15.438 14.54
[0058] The obtained data is imported into the python software. Taking the tensile strength and surface roughness obtained from the experiments as the target variables and the three process parameters as the independent variables, machine learning modeling and prediction are prepared. Figure 2 and Figure 3 are respectively the prediction situations of the BP neural network and the BOHB-BP algorithm for the tensile strength and surface roughness. Both models have a certain prediction accuracy for data prediction. Through the analysis of the mean square error of the two models, it can be seen that for the prediction of the tensile strength, the mean square error of the BOHB-BP prediction model has decreased by 62.75% compared with the BP prediction model; for the prediction of the surface roughness, the mean square error has decreased by 53.21%. It can be seen that the BOHB-BP prediction model can achieve better prediction.
[0059] Other features and advantages of the present invention will be disclosed in detail in the following specific embodiments and the accompanying drawings.
[0060] The above is only the specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes but is not limited to the content described in the accompanying drawings and the above specific embodiments. Any modification that does not deviate from the functional and structural principles of the present invention will be included in the scope of the claims.
Claims
1. A 3D printing quality prediction method based on the BOHB algorithm and neural network, characterized in that: It includes: Step 1, determine process parameters: Determine the process parameters of fused deposition modeling. Step 2, construct a standard spline model and adjust process parameters: Establish a standard tensile test spline model, construct a mechanical property test spline model, layer the test spline model, and adjust the process parameters according to the standard after layering. Step 3, print the test spline model and test: Import the test spline model into a 3D printer for printing, conduct mechanical property and roughness tests according to a preset standard, record the test results, and obtain an experimental data set. Step 4, process the experimental data set: Normalize the experimental data set and divide it into a training set and a test set. Step 5, construct a BP neural network prediction model: Construct a BP neural network prediction model, where the input of the BP neural network prediction model is the process parameter, and the output is the tensile strength and surface roughness. Step 6, train the BP neural network prediction model: Use the training set to train the BP neural network prediction model, construct the BOHB algorithm to search and optimize the variables of the BP neural network prediction model during training, use the test set to test the BP neural network prediction model, and continuously train the BP neural network prediction model until the preset accuracy is reached. Step 7, optimize process parameters: Establish an optimization algorithm, with the objective function being to make the output of the BP neural network prediction model optimal, and obtain the optimal process parameters. In Step 6, one or more of the activation function, the number of hidden layer nodes, the weight value, and the bias value are set as variables of the BP neural network prediction model, and the variables are optimized by the BOHB algorithm.
2. The 3D printing quality prediction method based on the BOHB algorithm and neural network according to claim 1, wherein The BP neural network prediction model constructed in Step 5 includes an input layer, a hidden layer, and an output layer. The selection range of activation functions from the input layer to the hidden layer is {relu, tanh}, and the selection range of activation functions from the hidden layer to the output layer is {relu, tanh}. The number of nodes x in the input layer is adapted to the number of process parameters changed during printing. The neurons in the input layer respectively input the corresponding process parameter values. The number of nodes in the output layer is y, and the neurons in the output layer correspond to the number of parameters for evaluating the quality of the FDM printed part. The number of nodes in the hidden layer is m, where m is a preset value. The evaluation function of the neural network uses the mse function, and the loss function of the BOHB algorithm in Step 6 uses the mse function. M is the total number of samples.
3. The 3D printing quality prediction method based on the BOHB algorithm and neural network according to claim 2, characterized in that, The number of hidden layer nodes m is calculated based on the number of input layer neuron nodes x and the number of output layer neuron nodes y, including: calculation m2=log2x, Take the value α∈[1, 10] and select any one from m1, m2 and m3 as the value of m.
4. The 3D printing quality prediction method based on the BOHB algorithm and neural network according to claim 3, wherein The number of hidden layer nodes \(m\) takes the value \(m1\), and the search range of the number of hidden layer nodes \(m\) is Use the \(randint(1, 10)\) function to determine the search value.
5. The 3D printing quality prediction method based on the BOHB algorithm and neural network according to claim 2, characterized in that, For each connection weight w of the neural network and the bias value b of the neuron, the search range is [-3, 3], and the uniform function is used to obtain values.
6. The 3D printing quality prediction method based on the BOHB algorithm and neural network according to claim 1, characterized in that, The data volume ratio of the experimental data of the training set to the test set is 7:
3.
7. The 3D printing quality prediction method based on the BOHB algorithm and neural network according to claim 1, characterized in that The process parameters of fused deposition modeling are one or more of the filling interval, the number of scanning times, and the printing layer thickness.
Citation Information
Patent Citations
Method for quickly optimizing polylactic acid fused deposition modeling process based on double-index orthogonal test in combination with support vector machine
CN112172128A
Surface exposure 3D printing process optimization method based on genetic algorithm and BP neural network
CN112659548A
Additive manufacturing size prediction and process optimization method and system based on machine learning
CN113569352A