# TMVDPatch: A Trusted Multi-View Decision System for Security Patch Identification
## 4 Design and Implementation
### Trusted Multi-View Decision Rule  
In this subsection, we mainly elaborate on trusted multi-view decision rules based on the evidence obtained. As described in Section 2.3, using a softmax output as confidence for predictions often leads to high confidence values, even for erroneous predictions since the largest softmax output is used for the final prediction. In addition, subjective logic associates the parameters of Dirichlet distribution with belief distribution. Related work [26; 27] first apply this work to the field of multi-view learning in the framework of deep learning. They introduce a new paradigm theory in multi-view classification to provide credible and interpretable decisions based on the uncertainty of each view. Taking into account all factors, how to fully utilize the patch submission information in an interpretable way is crucial to the identification of security patches. In cutting edge research [26, 27], they propose a new multi-view classification algorithm, which aims to integrate multi-view information for trusted decision-making. This coincides with our motivation. Therefore, we obtain multi-view evidence, including control dependency information, data dependency information and description information, to comprehensively represent the semantic and syntax information of security patches. In our work,we first learn the patch information based on the neural network model proposed in Section 4.4, and takes the results as evidence in the multi-view learning framework. And then, this paper uses the theoretical framework to observe the possibilities (believe masses) of different views and overall uncertainty (uncertainty mass) based on the evidence collected from patch commit. Note that the evidence refers to the metrics collected from the input to support the classification and is closely related to the concentration parameters of Dirichlet distribution. Based on the original framework, this paper determines the relevance of different views as the weight of evidence input according to the Grey Relational Analysis method, and makes self-learning correction. In this way, we can improve the ability of trusted multi-view decision-making. Figure 3 shows the methods of trusted multi-view decision rule. Figure 3: The process of trusted multi-view decision. Figure 2: The neural network structure for evidence obtained from the code diff view. In our work, for the view \(v\), according to Step(c) in the Figure 3, the subjective logic associates \(e^{v}=[e_{1}^{v},e_{2}^{v},\cdots,e_{K}^{v}]\) with the parameters of the Dirichlet distribution \(\alpha^{v}=[\alpha_{1}^{v},\alpha_{2}^{v},\cdots,\alpha_{K}^{v}]\). Especially, \(e^{1}\) represents the evidence from the code diff view and \(e^{2}\) represents the commit message evidence. Its subjective opinion corresponds to a Dirichlet distribution with parameter \(\alpha_{K}^{v}=e_{k}^{v}+1\). Then, this paper calculates the belief quality \(b_{k}^{v}\) and uncertainty quality \(u^{v}\) according to Step(c) in the Figure 3. For the category \(k\) under the view \(v\), its belief quality \(b_{k}^{v}\) is calculated from its corresponding evidence \(e_{k}^{v}\), and the calculation formula is as follows:  
\[b_{k}^{v}=\frac{e_{k}^{v}}{S^{v}}\textit{ and }u^{v}=\frac{K}{S^{v}} \tag{5}\]  
\(S^{v}=\sum_{i=1}^{K}\alpha_{i}^{v}=\sum_{i=1}^{K}\left(e_{i}^{v}+1\right)\) is Dirichlet strength. Therefore, uncertainty \(u^{v}\) is invercely proportional to the totality of evidence \(S^{v}\). Next, this paper calculates the joint probability mass assignment set \(\mathcal{M}=\left\{\{b_{k}\}_{k=1}^{K},u\right\}\) according to Step(c) in the Figure 3. It is obtained by combining the sets of probability mass assignments \(\mathcal{M}^{v}=\left\{\{b_{k}^{v}\}_{k=1}^{K},u^{v}\right\}\) from different views \(v\). In this paper, the specific calculation formula is as follows.