# Forgery Detection for Anti-Counterfeiting Patterns Using Deep Single Classifier
## 2 Related Works
### One-Class Support Vector Machine  
Support vector machine (SVM) is a new machine learning algorithm developed on the basis of statistical learning theory. SVM is based on the principle of structural risk minimization, and it minimizes the empirical risk and confidence range at the same time. It has the advantages of high fitting accuracy, few parameters, strong generalization ability and global optimization. SVM provides an effective tool for solving problems in situation such as small samples, high dimensions and nonlinearity, and it has become one of the research hotspots in the field of machine learning and has been widely used. In essence, support vector machine is proposed to solve the binary classification problem. In order to achieve this goal, the training set needs positive and negative samples. However, in practical applications, it is almost impossible to obtain two types of samples or the cost is very high in some fields ([PERSON] et al., 2016; [PERSON] et al., 2016). For example, for the identification of friend or foe, attack samples, satellite failures, etc., only one type of samples can be obtained, so only this type of samples can be used for learning, forming data descriptions, and thus achieving classification. Therefore, the one-class classification algorithm has emerged as the times require. One-class support vector machine (OCSVM) was proposed by [PERSON] et al. (2016). It is a one-class classification algorithm based on support vector machine. The basic concept is similar to that of traditional support vector machines: to find the classification hyperplane  
Figure 2: Production and forgery process of anti-counterfeiting 2D code. with the largest classification interval as the optimal result, which can realize structural risk minimization and global optimization. [PERSON] et al. theoretically and strictly analyzed the convergence boundary and upper limit of classification error of OCSVM, providing a solid theoretical basis for OCSVM. For the nonlinear separable problem, OCSVM uses the kernel technique to transform it into a linear separable problem. First, the data in the original space are mapped into a feature space through a nonlinear transformation, and the origin point of the feature space is regarded as the representative of the abnormal points. Then, a hyperplane is found in the feature space, which can separate the image of the data from the origin, and the distance between the hyperplane and the origin is maximized. Given the normal sample dataset \(\{x_{i}\}_{i=1}^{N}\), \(x_{i}\in R^{d}\) represents the ith normal data, its feature dimension is d, and the image in the feature space is \(\phi(x_{i})\). Set \(w\) and \(\rho\geq 0\) represent the normal vector and offset of the separation hyperplane, respectively, and the expression form of the separation hyperplane is  
\[w^{T}\phi(x)-\rho=0 \tag{1}\]  
Similar to the SVM used for binary classification, in order to improve the classification performance of OCSVM, the corresponding relaxation variable \(\xi_{i}\) is introduced for each normal data \(x_{i}(i=1,2,\ldots,N)\). The optimization problem of OCSVM is as follows  
\[ \begin{array}{rl}\min\limits_{w,\xi,\rho}&\frac{1}{2}w^{T}w-\rho+\frac{1}{wN }\sum\limits_{i=1}^{N}\xi_{i}\\ \text{s.t.}&w^{T}\phi(x_{i})\geq\rho-\xi_{i}\end{array}  \tag{2}\]  
In the above formulation, \(\xi=\left(\xi_{1},\xi_{2},\ldots,\xi_{N}\right)^{T}\), \(\xi_{i}\geq 0\), \(i=1,2,\ldots,N\), \(v\) is the percentage estimation, also called as the \(v\) attribute, which is closely related to the number of support vectors. More specifically, \(v\) is the upper bound of the boundary support vector and the lower bound of the number of all support vectors. By solving the optimization problem with the Lagrange multiplier method and replacing the inner product with kernel function, the above optimization problem can be converted to the following one  
\[