FrameDuplication Forgery Detection and Localization Algorithm Based on the Improved Levenshtein Distance

College of Information and Computer Engineering, Northeast Forestry University, Harbin 150040, China Heilongjiang Forestry Intelligent Equipment Engineering Research Center, Harbin 150040, China Department of Computer Science, Faculty of Computers and Information, Menoufia University, Shebin El-Koom 32511, Egypt Cyberspace Institute of Advance Technology, Guangzhou University, Guangzhou, China Department of Mathematics and Computer Science, Faculty of Science, Menoufia University, Shebin El-Koom 32511, Egypt


Introduction
In our daily life, digital videos are playing a vital role in many fields of applications such as surveillance systems, medical fields, and criminal investigations. Because of the availability of low-cost digital video cameras and powerful video editing tools (such as Adobe Premiere, Microsoft Movie Maker, and Magix Vegas), it is now easy for common users to edit the video contents without leaving any visual traces of forgeries. So, we cannot trust in the authenticity of such videos anymore. erefore, the authentication of such videos is becoming a very important research area these days. Digital video forensics is an emerging research area which aims at validating the authenticity of such videos [1]. e classification of digital video forensics is shown in Figure 1, where it can be divided into 3 categories: identification of the source camera, discrimination of computer-generated videos, and video forgery detection (video tampering detection) [1].
Video forgery manipulations can be acted in the three domains: spatial domain (intraframe forgery), temporal domain (interframe forgery), and spatio-temporal domain. Intraframe forgeries may include region duplication (copymove) and splicing inside the frame itself whereas interframe forgeries include frame duplication, frame insertion, frame shuffling, and frame deletion [1].
Digital video forgery detection algorithms aim to detect the traces of forgeries in the digital video sequence. As in digital images, digital video forgery detection techniques also can be classified into active and passive (blind) techniques. In the passive video forgery detection techniques, the authenticity of a forged video is verified without the existence of the original video and only depends on extracting some features or footprints from the forged video which have been left by the editing operations [1]. ese footprints may include the high spatio-temporal correlation among frame intensity values [2], noise and motion residues [3], artifacts in optical flow [4], motion-compensated edge artifact (MCEA) [5], and frames quality assessments [6] whereas active techniques require embedding information into the video such as digital watermarking [7], but this kind of techniques is not preferable by many researchers because it requires the existence of the original video along with the tampered one which is usually unavailable.
Frame duplication forgery is a common forgery types in digital videos, and it is an interframe forgery which occurs in the temporal domain. It can be performed by copying and pasting some frames in another location in the same video sequence in order to hide or replicate some events from the video. Figure 2 shows the process of frame duplication attack, where frames from 1 to 6 are copied and then pasted at another location instead of frames from 7 to 12 in order to remove the existence of a moving car crosses a parking area and passes behind a lamppost, without leaving any visual traces of forgeries. e original video example is taken from the LASIESTA dataset [8].
Cloning frames from the same video sequence raise the difficulty of frame duplication forgery detection, making it uneasy to detect color changes and illumination condition [9]. Although a variety of methods have been proposed, these methods still face the following challenges in frame duplication forgery: (1) High computational complexity (2) Low detection rate in the static scenes (3) Unable to locate the location of the duplicated frame pairs In this paper, we proposed an efficient and robust frame duplication detection technique to detect duplicated frames from the video sequence based on the improved Levenshtein distance. At First, we divided the video sequence into small overlapping subsequences and measure the similarity of them by using the improved Levenshtein distance (ILD). Next, the value of ILD is used to detect the duplication forgery frame, in which the higher the value, the lower the similarity between the frame pair. Hence finally, the duplicated frames are located. In the experimental results, the proposed algorithm showed efficacy compared with the state-of-the-art techniques. e rest of this paper is organized as follows. In related work section, an overview of the related work and contributions in the field of frame duplication forgery detection are provided. Proposed Method section delineates the conceptual and implementation details of the proposed method. e experiments used during performance validation and the obtained results are discussed in Experimental Results section, and the paper is concluded in the last section.

Related Work
e frame duplication attacks can be detected from the tampered videos by using the existing digital image forgery detection techniques [10] as the video is a sequence of sequential images in one temporal (time t) and two spatial (x, y) dimensions. However, it may not seem a good idea due to the huge computational complexity obtained rather than the complex scenarios that the videos have such as static scenes [11]. Wang and Farid [12] proposed the first frame duplication forgery detection algorithm by using the spatial and temporal correlations between video frames. A coarse-to-fine comparison manner was used to compare the video subsequences. e high similarities in the temporal correlation coefficients lead to the spatial correlation coefficients comparison. However, their method was unable to detect the frame duplication forgeries in the static scenes and in case of postprocessing attacks such as adding noise on the duplicated frames. Using the previous framework, Yang et al. [6] proposed another two-stage similarity analysis-based method. In the first stage, they extracted the features from each video frame by using the singular value  decomposition (SVD). en, the Euclidean distance similarity was calculated between the features of reference frame (first frame of the video) and each frame. In the second stage, a random block matching was used to indicate the candidate duplications. However, their method failed to detect the forgeries when frame duplications were done in different order and also when the duplicated frames were less than the window size [1]. Singh et al. [13] divided each video frame into four subblocks and then nine features were extracted from each frame. en, they lexicographically sorted the extracted features to group the most similar frames. Root mean square error (RMSE) was then calculated between the features of adjacent sorted frames to identify the suspicious frames. en, to detect the frame duplications, the correlation among suspicious frames was performed. eir method failed to detect the forged videos taken by a stationary camera and when duplication was done in different order [1]. Lin and Chang [14] presented an approach for frame duplication detection with four steps: candidate segment selection followed by spatial similarity measurement then frame duplication classification and finally postprocessing. However, many subsequence candidates were selected for the video that results in a significantly high computational time. Li and Huang [15] proposed another frame duplication forgery detection method based on the structural similarity (SSIM) [16]. e similarities between the video subsequences were calculated to find the duplicated frames. However, their method also failed to detect the frame duplication forgeries in the static scenes. D'Amiano et al. [17] proposed an algorithm for frame duplication forgery detection based on the dense-field method with invariant features. ey used a suitable video-oriented version of patch-match to limit complexity. Jia et al. [9] proposed a novel approach to detect frame copy-move forgeries based on optical flow (OF), and stable parameters was designed. e aforementioned methods used predefined fixed global thresholds during the candidates' selection or duplication detection stages. ese thresholds may calibrate for a certain condition and may not work for other situations. Moreover, it makes these methods less generalized. Additionally, time complexity is one of the most challenging problems for frame duplication detection algorithms, which increases dramatically with increasing the number of frames within a given video sequence. Furthermore, there is inability to differentiate between the duplicated frame pairs and highly similar frame pairs (misdetected or false positive frame pairs) for the videos with long time static or still scenes.

Proposed Method
In interframe forgery (frame duplication), some frames from the video timeline are replaced by a copy from other frames from the same timeline (as shown in Figure 2). In this section, the proposed method for frame duplication forgery detection and localization is introduced in detail. e proposed method includes four stages as shown in Figure 3.
First, the video sequence is divided into small overlapping subsequences; second, similarity measurements based on Levenshtein distance [18] is calculated; third, frame duplication forgery is detected; and fourth, frame duplication forgery is located. To calculate the similarity between the video frames and identify the high similarities of the subsequences, the improved Levenshtein distances for all overlapping subsequences are calculated first. For the experiments, we tampered the video sequences with frame duplication forgery by randomly selecting the location in each video timeline.

Partition of Video Subsequence.
In the experiments, the tampered video sequence V is first divided into overlapping subsequences (Seq i ; i � 1, 2, 3, . . . , L), which begin at time ζ.

Scientific Programming
L is the total number of all overlapping subsequences. We assumed that each subsequence length from the overlapping subsequences is (r) frames and the length of the test video is (N) frames. So, the total number of all overlapping subsequences (L) can be given by (1) Next, we detect the potentially duplicated candidates by calculating the similarities among these subsequences. e similarity of each subsequence has to be calculated with the rest of the other subsequences. e improved Levenshtein distance is adopted and used as a measure of similarities in the proposed method, to measure the similarities between the corresponding frame pairs for each two candidates.

Similarity Measurements Based on the Improved Levenshtein Distance.
e Levenshtein distance is a metric for measuring the similarities between two sets A and B as a simple function of their lengths (|A| and |B|) [18]. e generalized Levenshtein distance (GLD) is the most common used measure to compare sets of different edit processes such as insertion, deletion, and substitution of sets elements [19]. e GLD can be obtained from the methods presented in [18,20]. It shows a distinct tool in some applications as error correction and pattern recognition [21,22].
Assume that a pair of subsequences Seq i and Seq j from the tampered video V is denoted as Seq i � F 1 i F 2 i . . . F r i and Seq j � F 1 j F 2 j . . . F r j , respectively, where F m i is the mth frame of Seq i and F n j is the nth frame of Seq j . e length of Seq i is given by |Seq i |. We set up the length of each subsequence to r = 5 and the length of overlap is r − 1.
If c is a metric over the sequence of elementary edit processes, Marzal and Vidal in [23] defined the GLD as in the following equation: where P F k i ,F k j is an editing path between F m i and F n j and which is a set of points or ordered pairs (i k , j k ), 0 ≤ k ≤ L(P F m i ,F n j ) � l satisfying the following conditions: e improved Levenshtein distance similarity (ILD) is normalization for the GLD, and it can be easily computed through GLD. e improved Levenshtein distance between two frames F m i and F n j can be given as follows: where |F i | and |F j | are the length of F i and F j , respectively. e final value of the improved Levenshtein distance calculated for two frames is included in the [0, ∞) where 0 means that the two frames are identical (duplicated or replica) whereas any integer number between 1:∞ indicates the number of the different intensities in the corresponding frames.
To illustrate the advantages of ILD, we cut two consecutive frames representing a static scene in an authentic video, as shown in Figure 4. ey have a high correlation coefficient that may cause misdetection. For example, the structural similarity (SSIM) between these two frames is calculated and it is equal to 0.9935, which means that if the threshold value in the SSIMbased algorithms [14,15] is set to be smaller than or equal 0.9935, the detection performance of these frame duplication forgery detection algorithms will decrease dramatically due to the existence of falsely detected frame pairs as duplicated (misdetected frame pairs). Furthermore, they fail to detect the duplication in the static scenes whereas the improved Levenshtein distance between these two authentic frames is equal to 109, which means that there are 109 different pixel intensity values between these frames, and this indicates that these two frames are different and not a duplication from each other.

Merging Subsequences and Duplication Localization.
A helpful distance metric technique significantly improves the performance of localization, clustering, and classification processes [24]. erefore, the distance metric techniques help algorithms to measure the similarities between the video contents. e tampered video sequence has been divided into small overlapping subsequences to detect frame duplication forgery. In order to form a set of candidate duplicated frames, several duplicated subsequences should be merged to form a complete duplicated sequence. Also, we need to identify which subsequence is original and which subsequence is duplicated (replica).
Due to the small overlapping subsequences, one or more subsequence could match with two or more duplicated subsequences. So, the subsequences with distances equal to 0 between their corresponding frame pairs are selected as a duplicated frame pairs to merge these subsequences in order to form a complete candidate subsequence of duplicated frames. In each subsequence, the similarities between each frame and all other frames of the other subsequences are calculated. erefore, in this paper, we used the improved Levenshtein distance to calculate the similarities D[i] among the corresponding candidate frames (f i , f i ′ ) as follows: where i � 1, 2, . . . r.
Assume that (S, T) is a duplicated subsequence, S and T have the same number of frames (same length), and (S i , T i ) is a pair of corresponding matched frames. If all the ILD distances D i between (S i , T i ) are equal to 0, then S is considered to be the source subsequence and T is the duplicated one.

e Dataset.
In the experiments, we selected some test video sequences from the commonly used video test sequences from video trace library (VTL) dataset which is available at http://trace.eas.asu.edu/yuv/index.html. e selected videos are captured with stationary and moving camera modes. e resolution of each one is 352 × 288 pixels and has the frame rate of 30 fps. Table 1 shows the details of the test tampered videos.

Performance Evaluation and Analysis.
e Precision and Recall rates are used as in equations (6) and (7) to evaluate the detection capability of the proposed method. We also calculate another measure F 1 score that combines both Precision and Recall as shown in equation (8). Recall where T P (true positive duplicated frame pairs) represents the number of correctly detected frame pairs as duplicated frames, F P (false positive duplicated frame pairs) represents the number of falsely detected frame pairs as duplicated frames, and F N (false negative duplicated frame pairs) represents the number of duplicated frame pairs which are classified as authentic.
To evaluate the performance of our proposed method, we compared our proposed method with Wang and Farid [12] and Li and Huang [15]. e Precision, Recall, and F 1 score rates are calculated for all of the forged videos in the Scientific Programming   dataset. e higher the Precision as well as the Recall rates and F 1 score are, the better performance will be. Table 2 shows the detection results of the proposed method for the tested video sequences. It seems that the proposed method is not only able to achieve a high detection of frame duplication forgeries but also accurately locate the duplicated video clips in the video sequences. Table 3 indicates the comparison for the detection capabilities and location of duplication between the proposed method and the methods in [12,15].
For the test tampered video Akiyo, the frames from 1 : 20 are duplicated in the location from 301 : 320. is video has a static (still) scene as shown in Figure 5, where the first four frames inside that video are visually the same (authentic frames-not duplicated). Figure 6 and Table 2 indicate that the proposed method is able to detect the frame duplication forgeries in the static scenes where the proposed method can correctly detect and locate the frame duplication forgeries (precision rate of 100%). However, the method in Wang and Farid [12] failed and identified this tampered video as an authentic video sequence whereas the method in Li and Huang [15] detected the frame duplication forgeries with low precision rate (9.43%) due to the existence of 192 misdetected frame pairs (false positive duplicated frame pairs). erefore, the performance of our proposed method is much better than that of the other state-of-the-art methods in [12,15], as shown in Tables 2 and 3 and Figure 6.

4.3.
e Running Time. e comparison between the running time of the proposed method and the methods in Wang and Farid [12] and Li and Huang [15] is shown in Table 4. From that table, we can notice that the method proposed in Wang and Farid [12] has the lowest average time than others. e main reason is that the method proposed by Wang and Farid [12] was unable to locate the location of the duplicated frame pairs, which cost the other methods more time to localize the location of the duplicated frames. However, the method proposed in [12] has the worst detection accuracy than the other algorithms for frame duplication forgery detection (see Figure 6 and Table 2).
All the experiments are conducted on a workstation with Intel Core i7-8750H CPU and 32 GB RAM. We implemented the three methods on MATLAB R2018a.
Generally, the results presented in this paper reveal that the proposed algorithm offers a good performance in comparison with the state-of-the-art techniques. For the future directions, recently, deep learning approaches have been introduced in different fields of detection and identification problems [25][26][27]. It showed an efficacy and robustness against malicious attacks. Furthermore, copy-move forgery detection (CMFD) algorithms that have been presented for digital images can be used for video frame duplication forgery detection [28][29][30].

Conclusion
is paper introduces a frame duplication forgery detection and localization approach based on the similarity analysis of the improved Levenshtein distance. e tampered video sequence is first divided into overlapping subsequences. Next, each subsequence has to calculate the similarities with the rest of the other subsequences. e improved Wang et al. [12] Li et al. [15] Proposed method Wang et al. [12] Li et al. [15] Proposed method Wang et al. [12] Li et al. [15] Proposed method (c)  Levenshtein distance is adopted and used as a measure of similarities in this paper. e similarities between all the subsequences are measured to find out the potentially duplicated frame pairs. ese duplicated frame pairs are combined together into a complete duplicated sequence, and hence the location of the frame duplication forgeries is located. Extensive experiments are conducted on some tampered videos downloaded from VTL dataset. e results show that the precision of the proposed method can achieve 99.5% which is higher than the state-of-the-art methods. Furthermore, the proposed method is able to locate the exact location of the replica in addition to the detection capabilities of frame duplication forgeries from the static scenes.

Data Availability
No private data were used to support this study.

Conflicts of Interest
e authors declare that they have no conflicts of interest.