## 3 Proposed Approach
### Keyframe Detection with Transfer Learning  
Keyframe detection is defined as the extraction of unique representative frames while preserving the key activities of the original video. It facilitates video analysis and processing [34]. In this study, deep transfer learning was used on the ResNet101v2 backbone to detect keyframes among 37653 frames in the ABODA dataset consisting of 11 videos in total. The block diagram of the ResNet101v2-based keyframe detection is presented in Figure 3. First, all the frames were divided into two classes as \"keyframe\" and \"nonkeyframe\". Initial keyframe selections were made based on expert knowledge during the data preprocessing stage. If there was no human or object class on the image, it was determined as non-keyframe. Images containing human and/or object class were determined as keyframe. Binary classification was performed with the dataset, and the weights obtained as a result of training were recorded. Later, keyframes in the videos will be extracted using these weights. Model training parameters are presented in Table 3.  
Figure 3: Block diagram of keyframe detection based on ResNet101v2. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset** & **Model** & **Epoch** & **Optimizer** & **Image Size** \\ \hline ABODA & ResNet101v2 & 10 & Adam & \(720\times 480\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Transfer learning training parameter details. Figure 2: Block diagram of the proposed approach. ResNet101v2 is an architecture trained on the ImageNet dataset. Although it is deeper than VGG networks, it has lower complexity. ResNet101 architecture was created by creating 101-layer blocks using more 3-layer blocks. Thanks to the increased layers, the accuracy gains of the model were significantly increased [35]. Due to these advantages, ResNet101v2 deep neural network architecture was used for keyframe detection in this study. As a result of the training, a 98.9% train accuracy was obtained. The keyframe detection method was tested using the images allocated for testing. Classification predictions are generally analyzed in 4 categories. These are: TP (True Positive), TN (True Negative), FP (False Positive), and FN (False Negative). Using these classification estimates, the accuracy, precision, recall, and f1-score evaluation metrics were calculated. Thus, we determined how successfully the model classified the keyframe and non-keyframe classes. The model evaluation results are presented in the Experimental Results section. Accuracy is calculated by dividing the correct classifications (TP, TN) by the total (TP, TN, FP, FN). It shows the overall accuracy of the model. \[\text{Accuracy}=\frac{\text{TP}+\text{TN}}{\text{TP}+\text{TN}+\text{FP}+ \text{FN}} \tag{1}\]  
Precision is used to determine success in a positively predicted state. A good classifier is desired to have a precision value of 1. \[\text{Precision}=\frac{\text{TP}}{\text{TP}+\text{FP}} \tag{2}\]  
Recall is used to determine how many of the classes that should be predicted as positive are predicted as positive. A good classifier wants the recall value to be 1. \[\text{recall}=\frac{\text{TP}}{\text{TP}+\text{FN}} \tag{3}\]  
F1-score is the harmonic mean of precision and recall values. A high F1-score value indicates a balance between the correct and incorrect identification of classes. \[\text{f1 score}=2\times\frac{\text{recall}\times\text{precision}}{\text{recall}+ \text{precision}} \tag{4}\]  
Keyframe extraction was performed from the videos provided as the input using the recorded model weights after training. The performance of detecting keyframes in the proposed keyframe detection method was measured by calculating the compression ratio (CR), computation time, keyframe_precision, keyframe_recall, and keyframe_f1 score. The explanations of the metrics used in the Equations are presented in Table 4.  
Compression ratio shows the rate of compression based on the number of extracted keyframes and the number of original keyframes. It is calculated using Equation (5).