# Lightweight Deepfake Detection Based on Multi-Feature Fusion
## 4 Implementation
### Evaluation Criteria  
Empirical benchmarking is a popular way to accurately analyze feature extraction and training times. This involves directly quantifying the time spent throughout experimental runs, resulting in exact and dependable data. This method is especially useful for machine learning tasks, where computational complexity varies depending on dataset size, hardware capabilities, and specific implementation choices. In this paper, we describe the methodological approach used to calculate feature extraction, training, and inference times for ML classifiers, providing a thorough assessment of computing efficiency.  
The time required for feature extraction can be computed as follows: for each feature extraction method, the extraction process for all the data points in the dataset is applied. The start and end times \(T_{feature}=T_{end}-T_{start}\) are recorded for each feature extraction run [61]. To mitigate variability owing to hardware or background processes, the feature extraction process is repeated multiple times, and the average time is computed as follows:  
\[\textit{Average Feature Extraction Time}=\frac{\sum_{i=1}^{n}T_{\text{ feature},i}}{n} \tag{4}\]  
where \(Tfeature,i\) denotes the feature extraction time for the \(i-th\) run and \(n\) is the number of runs. For reporting purposes, the time per data instance (e.g., per frame in video processing) can also be computed as follows:  
\[T_{feature,instance}=\frac{T_{feature}}{N} \tag{5}\]  
where \(N\) is the total number of data instances. Training time refers to the duration required to train an ML model on a specified dataset. For each classifier (e.g., RF, SVM, and CNN), the training process is initiated and calculated by recording the start and end times as follows: \(T_{train}=T_{end}-T_{start}\)[62]. Similar to feature extraction, it is often beneficial to perform multiple runs and compute the average through the following equation to obtain a reliable estimate:  
\[\textit{Average Training Time}=\frac{\sum_{i=1}^{n}T_{\text{train},i}}{n} \tag{6}\]  
For larger datasets, the training time may also be approximated on the basis of model complexity. For example, the training time complexity of RF with \(N\) trees is generally \(O(NlogN)\), whereas the support vector classifier may exhibit \(O(N_{2})\) complexity. The inference time is the duration required to classify a new instance after training. The total inference time over a dataset \(T_{inference}\) can be approximated by \(T_{inference}=T_{inference,instance}xN\), where \(N\) is the total number of instances in the test dataset. Multiple test runs were carried out to establish temporal consistency among approaches, with start and end times carefully documented. Measuring the time necessary for each instance provides for more detailed comparisons and brings out performance differences more clearly. This established approach makes sure that all important time calculations for feature extraction, training, and inference are directly comparable, resulting in a rigorous and repeatable experimental framework.  
\begin{table}
\begin{tabular}{l c c} \hline \hline
**Dataset** & **Real Images** & **Fake Images** \\ \hline Celeb-DF & 382 & 346 \\ FaceForensics++ & 496 & 458 \\ \hline \hline \end{tabular}
\end{table}
Table 1: FaceForensics++ and Celeb-DF dataset compositions.