# Interested Keyframe Extraction of Commodity Video Based on Adaptive Clustering Annotation
## 4 Experiment
### Acbd Algorithm
#### 4.3.3 Effects on the UCI Dataset  
In order to test the applicability of the ACBD algorithm, we verified the effect on IRIS, WINE, and HAPT datasets and compared it with K-means algorithm and DBSCAN algorithm. We used Adjusted Rand index (ARI) [43], Fowlkes-Mallows index (FMI) [44], and Adjusted Mutual Information (AMI) [45] to evaluate the clustering results, and these evaluation criteria are defined as follows. For a given set \(S\) of \(n\) instances, assume that \(U=\{u_{1},u_{2},\ldots,u_{R}\}\) represents the ground-truth classes of \(S\) and \(V=\{v_{1},v_{2},\ldots,v_{C}\}\) represents the result of the clustering algorithm. \(n_{ij}\) represents the number of instances in \(u_{i}\) and \(v_{j}\). \(n_{i. }\) and \(n_{j. }\) represent the number of instances in \(u_{i}\) and \(v_{j}\), respectively. Rand index (RI) is calculated by \(\sum_{i,j}\binom{n_{ij}}{2}\), and thus, ARI Can be expressed as below. Figure 9: Comparison of clustering effects between the ACBD algorithm and DBSCAN algorithm. (**a**) Differential frame distribution. (**b**) DBSCAN algorithm clustering results. (**c**) K-means algorithm clustering results. (**d**) ACBD algorithm clustering results. \[ARI=\frac{RI-E(RI)}{max(RI)-E(RI)} \tag{8}\]  
In Formula (8), \(E(RI)=\frac{[\sum_{i}\binom{n_{i}}{2}\sum_{j}\binom{n_{j}}{2}]}{\binom{n_{j}}{2}}\), \(max(RI)=\frac{1}{2}[\sum_{i}\binom{n_{i}}{2}+\sum_{j}\binom{n_{j}}{2}]\). ARI is used to measure the degree of consistency between the two data distributions, and its range is [-1,1]. In order to measure the effect of the clustering algorithm more comprehensively, FMI and AMI are introduced for evaluation through different methods. Their value range is [0,1] and, the larger the value is, the more similar are the clustering results to the ground-truth. FMI and AMI can be expressed by Formulas (9) and (10), respectively. \[FMI=\frac{\sum_{i,j}\binom{n_{i}}{2}}{\sqrt{\sum_{i}\binom{n_{i}}{2}\sum_{j} \binom{n_{j}}{2}}} \tag{9}\]  
\[AMI=\frac{I(U,V)-E\{I(U,V)\}}{max\{H(U),H(V)\}-E\{I(U,V)\}} \tag{10}\]  
In Formula (10), \(I(U,V)=\sum_{i=1}^{R}\sum_{j=1}^{C}\frac{n_{i,j}}{n}log\frac{\frac{n_{i}}{n_{ j}}}{\frac{n_{i}}{n_{j}}}\), \(H(U)=-\frac{i=1}{R}\frac{n_{i}}{n}log\frac{n_{i}}{n}\). The results are shown in the following table. It can be seen from Tables 2-4 that the K-means algorithm performs the best on the Iris, Wine, and HAPT datasets, and ACBD can compete with K-means on the HAPT dataset. The DBSCAN algorithm did not obtain available clustering results after adjusting parameters many times on the WINE and HAPT datasets, so its clustering evaluation index was 0 on these two datasets. From the experimental results, the performance of the proposed algorithm (ACBD) on the large datasets, such as HAPT, is far better than that on the small datasets, such as IRIS and WINE. according to 7:3, so as to train the deep neural network. The hyperparameters are set as follows: batch size, 32; epoch, 400; learning rate, 0.0001. Finally, the trained network is used to classify the video frames. The first category showing commodity details and the second category showing commodity overall effect are the video keyframes. Considering the deep network layer of ResNet, the accuracy is higher, but if the network layer is too deep, the machine is difficult to load. So, we verified whether MobileNet-v2 meets practical requirements while ensuring accuracy compared with ResNet-50. In the experiment, the batch size was set to 64. As can be seen in Figures 10 and 11, the accuracy rates of ResNet-50 and MobileNet-V2 were similar, both at around 90%. Therefore, in consideration of applicability, we compared the training time and storage space of the two models. Compared with ResNet-50, the training speed of MobileNet-v2 increased by 14.3% and the number of parameters decreased by 66.9%, shown in Table 5. Therefore, MobileNet-v2 has a wider available range from the applicability of mobile terminal, so we adopted the MobileNet-v2 network.