# Deep Anomaly Detection Based on Variational Deviation Network
## 5 Results
### Performance Evaluation Method  
In this experiment, we mainly used two important evaluation indicators, AUC-ROC and AUC-PR. Before understanding these two types of indicators, we need to understand the relevant terms. Please refer to Table 3 for details. In the AUC-ROC evaluation index, we need to use two reference values, one of which is the true positive ratio:  
\[TPR=\frac{TP}{TP+FN} \tag{10}\]  
This represents the ratio between the positive examples in the prediction and all the positive examples in the dataset, which can represent the recall rate of positive examples; one of which is the false positive ratio:  
\[FPR=\frac{FP}{FP+PN} \tag{11}\]  
This represents the ratio between the negative example in the prediction and all the negative examples in the dataset, which represents the recall rate of the negative examples. The ROC graph is made based on these two reference values. When making the ROC graph, the TPR is the \(y\)-axis and the FPR is the \(x\)-axis. Draw a straight line in the ROC chart \(x=a\), where the straight line and the ROC curve focus \((a,y(a))\) of an algorithm express how much positive case recall rate the algorithm can have when the counterexample recall rate reaches \(a\); the same is true for horizontal straight lines. In order to generate a single value as a reference indicator, the concept of AUC (area under curve) is added here, that is, the \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Actual Positive** & **Actual Negative** \\ \hline Predicted positive & True positive, TP & False positive, FP \\ Predicted negative & False negative, FN & True negative, TN \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Confusion matrix. When the data label is positive and the forecast is also positive, it is called the true positive. When the data label is negative and the forecast is positive, it is called the false positive. When the data label is positive and the forecast is negative, it is called the false negative. When the data label is negative and the forecast is also negative, it is called the true negative. size of the total area under the curve in the ROC graph. When the negative example recall rate is small, and the positive example recall rate is large, the performance of the algorithm is better. At this time, the ROC curve should tend to the upper left, as \"left convex\" as possible, and the area under the curve becomes larger, so the larger the ROC-AUC, the better the algorithm performance. Two reference values are also needed in the AUC-PR evaluation index, one is the precision:  
\[P=\frac{TP}{TP+FP} \tag{12}\]  
This can be expressed as the ratio between the positive example in the prediction and all the predictions, indicating the accuracy of the positive example in the prediction; the other is the recall rate:  
\[R=\frac{TP}{TP+FN} \tag{13}\]  
The ratio between the positive example in the prediction and all the positive examples in the dataset represents the recall rate of the positive example; when plotting the PR graph, use P as the \(y\)-axis and R as the \(x\)-axis. Generally, the PR curve is when x is greater than a certain value a, which behaves as a decreasing function. When the dataset is unchanged and the algorithm performance does not change, to increase the recall rate (\(x\)-axis), the total number of predictions needs to be increased. At this time, the number of inverse columns predicted will increase, resulting in positive examples in the prediction and the accuracy (\(y\)-axis) decreases. Similarly, in order to generate a single value as a reference indicator, AUC (area under curve) is also added here. When the algorithm can achieve a higher recall rate and accuracy of positive examples when the total number of predictions is small, it indicates that the performance of the algorithm is good. At this time, the PR curve tends to the upper right, that is, the better the performance of the curve, then it should be as \"right convex\" as possible at this time, and the area under the curve should be as large as possible.