# Real-Time Advanced Computational Intelligence for Deep Fake Video Detection
## 5 Experiments
### Performance Evaluation  
To evaluate our model and compare it with other models, we used various evaluation metrics like Accuracy, Precision, Recall, and F1 Score. These metrics were calculated using predefined methods of the sklearn library. Mathematically these parameters can be calculated using the below equations. Precision: The ratio of correct positive predictions to that of the total positive predictions. It shows how many correct predications our model has made out of the total positive predictions. In our case, it gives us the answer of all videos that were predicted as fake, and how many of them were actually fake, or how many of them were correctly predicted. \[\text{Precision }=\text{ True Positive}/(\text{True Positive }+\text{ False Positive}) \tag{5}\]  
Recall: The ratio of correct positive predictions to that of the total predictions of that particular class(es). It shows how many of the total positive inputs are correctly predicted by our model. In our case, it tells us about all the videos that were truly fake, and how many of them were labeled correctly by our model. \[\text{Recall }=\text{ True Positive}/(\text{True Positive }+\text{ False Negative}) \tag{6}\]  
F1 Score: The weighted average of Precision and Recall. It takes into consideration both False positives and False negatives. It is generally more useful than accuracy; however, it cannot be intuitively understood as accuracy. It is calculated as:  
\[\text{F1 }-\text{Score }=2\times(\text{Recall }\times\text{ Precision})/(\text{Recall }+\text{ Precision}) \tag{7}\]  
Figure 8: Saliency map of various images. Accuracy: The most general and intuitive term to measure performance. It is the ratio of correct predictions by the model relative to the total inputs provided to the model. It can be calculated as:  
\[\text{Accuracy }=(\text{True Positive }+\text{True Negative})/(\text{True Positive }+\text{False Positive }+\text{True Negative }+\text{False Negative}) \tag{8}\]  
Log Loss: In our model, the main goal is to minimize the log loss error function, as shown below. It is the most important classification metric for binary classification models based on probabilities. The lower the log loss value, the better the predictions will be and vice versa. \[H_{p}(q)=\frac{-1}{N}\sum_{i=1}^{N}y_{i}*log(p(y_{i}))+(1-y_{i})*log(1-p(y_{i })) \tag{9}\]  
\(y\) is the label: 1 for positive and 0 for negative. \(N\) is the number of input observations. \(p(y)\) is the probability of being positive for all \(N\) inputs. \(H(q)\) is the binary cross entropy/log loss. Confusion Matrix: A way of evaluating the performance of a classification model. It is a N \(\times\) N matrix where N is the number of target classes. It is used to evaluate how well our model is performing and the types of errors our model is making. In our model, we are classifying two classes, Real and Fake. Thus, we have a 2 \(\times\) 2 confusion matrix. This matrix shows the exact count of the input values that are predicted by our model for both classes. It shows the count of observations that are real and predicted-real by our model, observations that are real but predicted-fake by our model, observations that are fake and predicted-fake by our model, and observations that are fake but predicted-real by our model. Figure 9 shows the graphical representation of the performance of our model with the increase in number of epochs. This graph shows both training as well as testing accuracy of the model on the augmented dataset. It is evident from the graph that performance was better on the training dataset; however, as we can see that the difference in performance is not large, we can say that our model does not suffers from an overfit problem. Our model is generalized and performs well on unseen data with an accuracy of 93.28%. Figure 9: Testing and training accuracy of our proposed model on the augmented dataset. Figure 10 shows the training and testing loss of our model on the augmented dataset.