# Cheating Detection in Online Exams Using Deep Learning and Machine Learning
## 2 Materials and Methods
### Classification Metrics  
In binary classification, the confusion matrix is an important tool used to evaluate the prediction performance of the model. Table 1 shows the confusion matrix for binary classification. In Table 1, the confusion matrix for a two-class classification problem summarizes four different cases:  
1. True positive (TP): The number of instances where the true class is positive and predicted as positive by the model. True negative (TN): Number of instances where the true class is negative and the model predicts it to be negative. 3. False positive (FP): Number of instances where the true class is negative but predicted as positive by the model. 4. False negative (FN): Number of instances where the true class is positive but predicted as negative by the model. In Table 2, the confusion matrix for a three-class classification problem summarizes four different cases:  
1. True A (TA), True B (TB), True C (TC): These cells represent the number of instances where the model correctly predicted each class. 2. False B as A (FBA), False C as A (FCA): These cells represent the cases where the model incorrectly predicted Class B and Class C instances as Class A. 3. False A as B (FAB), False C as B (FCB): These cells indicate cases where the model incorrectly predicts Class A and Class C instances as Class B. 4. False A as C (FAC), False B as C (FBC): These cells indicate cases where the model incorrectly predicts Class A and Class B instances as Class C.  
The classification metrics used in the study are given below:  
**Accuracy:** It is a performance metric that measures how accurately the model predicts in classification problems. It can give misleading results in unbalanced data sets where all classes are not equally represented. The accuracy value varies between 0 and 1. 1: The model made all its predictions correctly. 0: The model made all its predictions incorrectly. It is calculated by Formula (1). \[Accuracy=\frac{TP+TN}{TP+TN+FP+FN} \tag{1}\]  
**Precision:** Measures the proportion of instances predicted as a positive class that are actually positive. Precision ranges from 0 to 1. 1: All predicted positives are true. 0: None of the predicted positives are true. It is calculated by Formula (2). \[Precision=\frac{TP}{TP+FP} \tag{2}\] \begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{3}{*}{**True Class**} & \multicolumn{2}{c}{**Predicted Class**} \\ \cline{2-3}  & A & B & C \\ \hline A & True A (TA) & False B as A (FBA) & False C as A (FCA) \\ \hline B & False A as B (FAB) & True B (TB) & False C as B (FCB) \\ \hline C & False A as C (FAC) & False B as C (FBC) & True C (TC) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Triple classification confusion matrix. \begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{3}{*}{**True Class**} & \multicolumn{2}{c}{**Predicted Class**} \\ \cline{2-3}  & Positive & Negative \\ \hline True & True Positive (TP) & False Negative (FN) \\ \hline False & False Positive (FP) & True Negative (TN) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Binary classification confusion matrix. **Sensitivity:** It indicates the model's ability to correctly recognize positive classes. A high recall value indicates that the model is good at avoiding false negatives. It is calculated by Formula (3). \[Sensitivity=\frac{TP}{TP+FN} \tag{3}\]  
**F1-Score:** It is calculated as the harmonic mean of precision and sensitivity. A high F1-Score indicates that the model has both high precision and recall, meaning that the model both correctly recognizes positive classes and minimizes false positives. The F1-Score value varies between 0 and 1. 1: Model performs perfectly. 0: Model fails. It is calculated by Formula (4). \[F1=2*\frac{Precision*Recall}{Precision+Recall}\text{ or }F1=\frac{2*TP}{2*TP+FP+FN} \tag{4}\]  
**Specificity:** Measures the rate of correctly detecting the negative class. It is especially useful in imbalanced data sets or when false positives are significant.