# The Study of Multiple Classes Boosting Classification Method Based on Local Similarity
## 3 Our Framework
### Find the Appropriate Local Similarity  
Assuming a data set with N samples, there are about \(N^{2}\) possible local similarities, the following algorithm flowchart can effectively select the appropriate local similarity.  
The purpose of the algorithm shown in Figure 2 is to select the appropriate local similarity, that is, to learn a set of predictors, so that the algorithm can mine the semantic information within the modal and the semantic correlation between the modal. Moreover, to make the optimization problem simple, we learn each predictor in turn [27]. First, we load the bimodal data set, initialize the inter-modal parameters, the parameters of the multi-class weak learner, and the number of iterations. The data set parameters include image set, text set and semantic vocabulary, and each semantic class is coded with a different unit vector, thereby representing the data point as a corresponding feature vector. At the beginning of the iteration, the predictors for images and text are initialized. Then, learn each predictor in turn, update the obtained image and text predictor to the latest predictor, increase the number of iterations by 1, and continue to execute the iterative loop until the loop condition is not satisfied. The learning of weak learners is mainly divided into the following steps:  
1. For the selection of the image weak learner, Formula (5) is used to calculate the basic loss \(L_{1}\) of the weak learner \(f_{1}\).
2. Because each non-negative feature value is related to an independent feature vector, let \(\mathbf{v}_{n}\) be the eigenvector corresponding to the nth eigenvalue \(\lambda\), and define \(\mathbf{f}\) as the row vector of the element \(f(x_{n})\). Therefore, \(\mathbf{f}\) can be decomposed into \[[\mathbf{f}=\langle\mathbf{f},\mathbf{v}_{1}\rangle\mathbf{v}_{1}+\sum_{n=2} ^{N}\left\langle\mathbf{f},\mathbf{v}_{n}\right\rangle\mathbf{v}_{n}]\] (9) From the above formula, the feature vector \(\mathbf{v}_{1}\) can be calculated, and all points are labeled according to their binarization class label \(b_{n}\).
3. Find the optimal local similarity \(f_{i}\), that is, the point \(x_{i}\) that is closer to the threshold \(\tau\), and all the points that meet the conditions i is marked as \(+1\), and the other points are marked as \(-1\). Then, calculate the loss of \(f_{i}\) by Formula (8). Compared with \(f_{i}\), the one with smaller loss is regarded as the best so far.
4. Find the point \(x_{j}\) that is most similar to \(x_{j}\), which can be obtained by the following formula, \[[x_{j}=\arg\min_{b_{j}=-b_{i}}\{\left\|x_{i}-x_{j}\right\|^{2}\}]\] (10)
5. Use the two-point local similarity \(f_{ij}\) to calculate the loss. If its performance exceeds the previous best, store the new learner and update the best loss so far.
6. Find all points that are sufficiently similar to \(x_{j}\) and remove them from the rest of the current iteration. In our implementation, we removed all \(x_{n}\): \[[f_{ij}(x_{n})\leq f_{ij}(x_{j})/2]\] (11)  
If all points are deleted, return the best local similarity so far; otherwise, re-find the point \(x_{j}\) that is most similar to \(x_{i}\). After completing this step, ensure that the best local similarity [28] so far can be sufficient. For the selection of weak learner for text, an analogy to the selection of weak learner for the above image can be obtained.