# Profit-Driven Methodology for Servo Press Motion Selection under Material Variability
## 3 Smart Forming Algorithm
### Bayesian Logistic Regression  
Bayesian Logistic Regression is a Bayesian formulation of Logistic Regression, which is the classical machine learning approach to predicting the probability of an outcome given feature information [21]. In other words, Bayesian Logistic Regression not only provides the probability of an outcome, it also provides an uncertainty for the predicted outcome. The graphical model (Figure 3) shows a representation of the Bayesian Logistic Regression trained for the Smart Forming Algorithm. (Note that Figure 3, which is a probabilistic graphical model, should not be confused with a block diagram of a closed-loop feedback system). \"\(E\)\" refers to elongation, \"\(Y\)\" refers to yield strength, \"\(w\)\" refers to weights applied to terms, \"\(b\)\" refers to an intercept term, \"\(p\)\" refers to the probability of a part being good, and \"\(R\)\" refers to the observed outcome. As the plate notation shows, the model learns from N data points, and there are two weighted terms. The model parameters are related in the following way:  
\[w_{i}\ \sim\ N\Big{(}0,\ 10^{3}\Big{)},\ i\in\{1,\ 2\} \tag{1a}\]  
\[b\ \sim\ \text{Uniform}(-\infty,\infty) \tag{1b}\]  
\[p_{j}=w_{1}E_{j}+w_{2}Y_{j}+b,\ j\in\{1,\ 2,\ \dots,\ N\} \tag{1c}\]  
\[R_{j}\ \sim\ \text{Bernoulli}(p_{j}),\ j\in\{1,\ 2,\ \dots,\ N\} \tag{1d}\]  
Figure 3: Graphical model of Bayesian Logistic Regression. The Smart Forming Algorithm trains one such model for each motion. In other words, each weight has a prior of a normal distribution centered at 0 and with standard deviation of 1000, \(b\) has a completely uninformative prior, \(p\) is a linear combination of \(E\) and \(Y\), and \(R\) is distributed as a Bernoulli with probability \(p\). Data standardization (subtraction of sample mean and division by sample standard deviation) is applied to yield strength and elongation, respectively. Training is accomplished by MCMC to probabilistically estimate the model's parameters based on training data consisting of yield strength, elongation, and outcome (i.e., whether the part was good or defective) for a particular press motion. PYMC3 was used to build and train the model by MCMC [22] (see also [23] for a descriptive example of the implementation of Bayesian logistic regression using PYMC3). Note that by design, model parameters are not shared across different press motions because it was expected that each press motion could exhibit different outcomes, even on metals with similar material properties. The Smart Forming Algorithm trained sub-models for three different press motions: \"Crank\", \"LowHigh\", and Attach-Detach 15 mm (which is referred to as \"AD15\"). Details on these motions can be found in previous work [19]; in summary, Crank is the conventional method for metal forming; LowHigh is Crank with adjustments to the blank holder force during the stroke; and AD15 is an advanced motion of the servo press. (Tests were implemented with a 300-ton AIDA servo press. The final drawing depth was set to be 68.8 mm for most testing conditions. Fuchs Anticorit PL 39 LV 12 was uniformly applied on the blank surfaces before the test using the motorized roller application equipment, UNIST. The Crank motion is a simple stamping motion applied with a blank holder force of 150 kN, while LowHigh is Crank motion with an adjustment to the blank holder force from 100 kN to 150 kN during the stroke. Figure 4 illustrates the AD15 motion from the bottom dead center. The press ram changes its moving directions during drawing the blank under a constant BHF. The intermediately drawn part does not release from the die and binder during the slide detach while the drawn top surface is separated with the stationary bottom punch that makes local springback possible and creates new contact points with the punch at the second-stroke drawing [19]). Since training with MCMC took roughly a minute per press motion, this model is not ideal for real-time updating in a metamodel approach.