# A Novel Malware Detection Model in the Software Supply Chain Based on LSTM and SVMs
## 3 Technical Overview
### Bayesian Optimization  
BO is a method used for global optimization [24; 26; 27], which can make full use of the information from previous parameter evaluation and effectively avoid falling into local optimal solutions. Its goal is to find the optimal solution of the objective function within a limited computational budget without explicitly knowing the mathematical expression of the objective function.  
The core idea of the BO is to integrate Bayesian statistics with response surface modeling to efficiently find the optimal solution of an objective function. This is achieved through a balanced approach of exploration and exploitation. The BO algorithm typically follows these steps:  
1. Probabilistic Surrogate Model Selection: At each iteration, a surrogate model is chosen to approximate the objective function. Common surrogate models include Gaussian process (GP) regression and RF, among others. In this paper, GP regression is selected as the surrogate model, the expression of which is detailed in Equation (6). \[f(x)\sim GP\big{[}m(x),k\big{(}x,x^{\prime}\big{)}\big{]}\] (6) In Equation (6), the mean function \(m(x)=E[f(x)]\) represents the mathematical expectation of the data sample. \(k(x,x^{\prime})=E\big{\{}[f(x)-m(x)][f(x^{\prime})-m(x^{\prime})]\big{\}}\) is the covariance function.
2. Sampling Strategy Selection: The subsequent sample point is selected by evaluating the uncertainty or the confidence level within the surrogate model. This iterative process is referred to as the sampling strategy. Well-established sampling strategies encompass the Gaussian process upper confidence bound and the Expected Improvement (EI), among others. In this paper, EI is utilized as the sampling strategy, with its functional form delineated in Equation (7). \[EI(x)=\bigg{\{}\begin{bmatrix}[\mu(x)-f(x^{+})]\phi(z)+\sigma(x)\varphi(z)\; \sigma>0\\ 0\;\sigma=0\end{bmatrix},\] (7) In Equation (7), \(\mu(x)\) represents the function value of the sampling point, \(f(x^{+})\) represents the maximum value in the searched points, \(z=\frac{\mu(x)-f\big{(}x^{+})}{\sigma}\), \(\phi\) (\(z\)) is the distribution function of the standard normal distribution, and \(\varphi\) (\(z\)) is the probability density function of the standard normal distribution.
3. Surrogate Model Update: The surrogate model is refined by new candidate solutions, which include both actual observations of the objective function and a collection of previous candidate solutions.
4. Iteration: The process iterates by repeating steps 2 and 3 until a pre-specified number of iterations is reached or the desired objective is achieved. The optimal candidate solution and its corresponding optimal value of the objective function are then identified as the outputs.  
The BO algorithm takes full account of previous parameter evaluations, making it less susceptible to becoming trapped in local optima when addressing non-convex problems. It also demonstrates strong performance in high-dimensional, complex optimization scenarios. Therefore, this paper employs the BO algorithm to ascertain the Gaussian kernel parameters and penalty factors within the SVM model, thereby optimizing the model's performance.