The combination of ubiquitous multimedia and high performance computing resources has inspired numerous efforts to manipulate Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org. audio-visual content for both benign and sinister purposes. Recently, there has been a lot of interest in the creation and detection of high-quality videos containing facial and auditory manipulations, popularly known as deepfakes [5, 11] . Since fake videos are often indistinguishable from genuine counterparts, detection of deepfakes is challenging but topical given their potential for denigration and defamation, especially against women and in propagating misinformation [6, 27] .
Part of the challenge in detecting deepfakes via artifical intelligence (AI) approaches is that deepfakes are themselves created via AI techniques. Neural network-based architectures like Generative Adversarial Networks (GANs) [7] and Autoencoders [25] are used for generating fake media content, and due to their 'learnable' nature, output deepfakes become more naturalistic and adept at cheating fake detection methods over time. Improved deepfakes necessitate novel fake detection (FD) solutions; FD methods have primarily looked at frame-level visual features [19] for statistical inconsistencies, but temporal characteristics [9] have also been examined of late. Recently, researchers have induced audio-based manipulations to generate fake content, and therefore, corruptions can occur in both the visual and audio channels.
Deepfakes tend to be characterized by visual inconsistencies such as a lack of lip-sync, unnatural facial and lip appearance/movements or assymmetry between facial regions such as the left and right eyes (see Fig. 5 for an example). Such artifacts tend to capture user attention. Authors of [8] performed a psycho-physical experiment to study the effect of dissonance, i.e., lack of sync between the audio and visual channels on user attention and memory. Three different versions of four TV news stories were shown to users, one having perfect audio-visual sync, a second with some asynchrony, and a third with no sync. The study concluded that out-of-sync or dissonant audio-visual channels induced a high user cognitive load, while in-sync audio and video (no dissonance condition) were perceived as a single stimulus as they 'belonged together'.
We adopt the dissonance rationale for deepfake detection, and since a fake video would contain either an altered audio or visual channel, one can expect higher audio-visual dissonance for fake videos than for real ones. We measure the audio-visual dissonance in a video via the Modality Dissonance Score (MDS), and use this metric to label it as real/fake. Specifically, audio-visual dissimilarity is computed over 1-second video chunks to perform a fine-grained analysis, and then aggregated over all chunks for deriving MDS, employed as figure-of-merit for video labeling.
MDS is modeled based on the contrastive loss, which has traditionally been employed for discovering lip-sync issues in video [3] . Contrastive loss enforces the video and audio features to be closer for real videos, and farther for fake ones. Our method also works with videos involving only the audio/visual channel as our neural network architecture includes the video and audio-specific sub-networks, which seek to independently learn discriminative real/fake features via the imposition of a cross-entropy loss. Experimental results confirm that these unimodal loss functions facilitate better real-fake discriminability over modeling only the contrastive loss. Experiments on the DFDC [5] and DF-TIMIT [21] datasets show that our technique outperforms the state-of-the-art by upto 7%, which we attribute to the following factors: (1) Modeling unimodal losses in addition to the contrastive loss which measures modality dissonance, and (2) Learning discriminative features by comparing 1-second audio-visual chunks to compute MDS, as against directly learning video-level features. Chunk-wise learning also enables localization of transient video forgeries (i.e., where only some frames in a sequence are corrupted), while past works have only focused on the real-fake labeling problem.
The key contributions of our work are: (a) We propose a novel multimodal framework for deepfake video detection based on modality dissonance computed over small temporal segments; (b) To our knowledge, our method is the first to achieve temporal forgery localization, and (c) Our method achieves state-of-art results on the DFDC dataset, improving AUC score by up to 7%.
Recently, considerable research efforts have been devoted to detecting fake multimedia content automatically and efficiently. Most video faking methods focus on manipulating the video modality; audio-based manipulation is relatively rare. Techniques typically employed for generating fake visual content include 3D face modeling, computer graphics-based image rendering, GAN-based face image synthesis, image warping, etc. Artifacts are synthesized either via face swapping while keeping the expressions intact (e.g., DeepFakes 1 , FaceSwap 2 ) or via facial expression transfer, i.e., facial reenactment (e.g., Face2Face [24] ). Approaches for fake video detection can be broadly divided into three categories as follows:
These methods employ image/frame-based statistical inconsistencies for real/fake classification. For example, [15] uses visual artifacts such as missing reflections and incomplete details in the eye and teeth regions, inconsistent illumination and heterogeneous eye colours as cues for fake detection. Similarly, [28] relies on the hypothesis that the 3-D head pose generated using the entire face's landmark points will be very different from the one computed using only the central facial landmarks, in case the face is synthetically generated. Authors of [13] hypothesize that fake videos contain artifacts due to resolution inconsistency between the warped face region (which is usually blurred) and surrounding context, and models the same via the VGG and ResNet deep network architectures. A 1 https://github.com/deepfakes/faceswap 2 https://github.com/MarekKowalski/FaceSwap/ capsule network architecture is proposed in [19] for detecting various kinds of spoofs, such as video replays with embedded images and computer-generated videos.
A multi-task learning framework for fake detection-cumsegmentation of manipulated image (or video frame) regions is presented in [18] . It is based on a convolutional neural network, comprising an encoder and a Y-shaped decoder, where information gained by one of the detection/segmentation tasks is shared with the other so as to benefit both tasks. A two-stream network is proposed in [30] , which leverages information from local noise residuals and camera characteristics. It employs a GoogLeNet-based architecture for one stream, and a patch based triplet network as second stream. Authors of [1] train a CNN, named MesoNet, to classify real and fake faces generated by the DeepFake and Face2face techniques. Given the similar nature of falsifications achieved by these methods, identical network structures are trained for both problems by focusing on mesoscopic properties (intermediate-level analysis) of images.
Video-based fake detection methods also use temporal features for classification, since many a time, deepfake videos contain realistic frames but the warping used for manipulation is temporally inconsistent. For instance, variations in eye-blinking patterns are utilized in [12] to determine real and fake videos. Correlations between different pairs of facial action units across frames are employed for forgery detection in [2] . Authors of [9] extract frame-level CNN features, and use them to train a recurrent neural network for manipulation detection.
Aforementioned approaches exploit only the visual modality for identifying deepfake videos. However, examining other modalities such as audio signal in addition to the video can also be helpful. As an example, authors of [16] propose a Siamese network-based approach, which compares the multimedia as well as emotionbased differences in facial movements and speech patterns to learn differences between real and fake videos. Lip-sync detection in unconstrained settings is achieved by learning the closeness between the audio and visual channels for in-sync vs out-of-sync videos via contrastive loss modeling in [3] . While this technique is not meant to address deep-fake detection per se, lip-sync issues can also be noted from a careful examination of deepfake videos, and the contrastive loss is useful for tying up genuine audio-visual pairs.
While it may be natural to see audio and video as the two main information modes that indicate the genuineness/fakeness of a video, one can also employ multiple cues from the visual modality for identifying fake videos. Multimodal cues are especially useful while tackling sophisticated visual manipulations. In [9] , both intraframe and inter-frame visual consistencies are modeled by feeding in frame-level CNN features to train a recurrent neural network. Statistical differences between the warped face area and the surrounding regions are learned via the VGG and ResNet architectures in [13] . Hierarchical relations in image (video frame) content are learned via a Capsule Network architecture in [19] .
Upon examining related literature, we make the following remarks to situate our work with respect to existing works.
1. While frame-based methods that learn spatial inconsistencies have been proposed to detect deepfakes, temporal-based approaches are conceivably more powerful to this end, as even if the manipulation looks natural in a static image, achieving temporally consistent warping even over a few seconds of video is difficult. Our approach models temporal characteristics, as we consider 1-second long audio-visual segments to distinguish between real and fake videos. Learning over tiny video chunks allows for a fine-grained examination of temporal differences, and also enables our method to temporally localize manipulation in cases where the forgery targets only a small portion of the video. To our knowledge, prior works have only focused on assigning a real/fake video label.
where the audio/video stream may be corrupted. In this regard, two works very related to ours are [3] and [16] . In [3] , the contrastive loss function is utilized to enforce a smaller distance between lip-synced audio-visual counterparts; our work represents a novel application of the contrastive loss, employed for lip-sync detection in [3] , to deepfake detection. Additionally, we show that learning audio-visual dissonance over small chunks and aggregating these measures over the video duration is more beneficial than directly learning videolevel features. 3. Both multimedia and emotional audio-visual features are learned for FD in [16] . We differ from [16] in three respects: (a) While we do not explicitly learn emotional audio-visual coherence, forged videos need not be emotional in nature; audio-visual consistency is enforced via the contrastive loss in our approach. (b) The training framework in [16] requires a real-fake video pair. Our approach does not constrain the training process to involve video-pairs, and adopts the traditional training protocol. (c) Whilst [16] perform a video-level comparison of audio-visual features to model dissonance, we compare smaller chunks and aggregate chunk-wise measures to obtain the MDS. This enables our approach to localize transient forgeries. 4. Given that existing datasets primarily involve visual manipulations (number of datasets do not have an audio component), our architecture also includes audio and visual sub-networks which are designed to learn discriminative unimodal features via the cross-entropy loss. Our experiments show that additionally including the cross-entropy loss is more beneficial than employing only the contrastive loss. Enforcing the two losses in conjunction enables our approach to achieve state-of-the-art performance on the DFDC dataset.
As discussed in Section 1, our FD technique is based on the hypothesis that deepfake videos have higher dissonance between the audio and visual streams as compared to real videos. The dissimilarity between the audio and visual channels for a real/fake video is obtained via the Modality Dissonance Score (MDS), which is obtained as the aggregate dissimilarity computed over 1-second visual-audio chunks. In addition, our network enforces learning of discriminative visual and auditory features even if the contrastive loss is not part of the learning objective; this enables FD even if the input video is missing the audio/visual modality, in which case the contrastive loss is not computable. A description of our network architecture for MDS-based deepfake detection follows.
Given an input video, our aim is to classify it as real or fake. We begin with a training dataset
Here, v i denotes the input video and the label y i ϵ {0, 1} indicates whether the video is real (y i = 0) or fake (y i = 1). The training procedure is depicted in Fig. 1 . We extract the audio signal from input video v i using the ffmpeg library, and split it into D-second segments. Likewise for the visual modality, we divide the input video into D-second long segments, and perform face tracking on these video segments using the S3FD face detector [29] to extract the face crops. This pre-processing gives us segments of visual frames
We employ a bi-stream network, comprising the audio and video streams, for deepfake detection. Each video segment s i t , t = 1 . . . n is passed through a visual stream S v , and the corresponding audio segment a i t is passed through the audio stream S a . These streams are described in Sections 3.2 and 3.3. The network is trained using a combination of the contrastive loss and the cross-entropy loss. The contrastive loss is meant to tie up the audio and visual streams; it ensures that the video and audio streams are closer for real videos, and farther for fake videos. Consequently, one can expect a low MDS for real, and high MDS for fake videos. If either the audio or visual stream is missing in the input video, in which case the contrastive loss is not computable, the video and audio streams will still learn discriminative features as constrained by the unimodal cross-entropy losses. These loss functions are described in Sec. 3.4.
The input to the visual stream is s i t , a video sequence of size (3 ×h × w × D * f ), where 3 refers to the RGB color channels of each frame, h, w are the frame height and width, D is the segment length in seconds, and f is the video frame rate. Table 1 depicts the architecture of the video and audio sub-networks. The visual stream (S v ) architecture is inspired by the 3D-ResNet similar to [10] . 3D-CNNs have been widely used for action recognition in videos, and ResNet is one of the most popular architectures for image classification. The feature representation learnt by the visual stream, in particular the fc8 output, denoted by f v is used to compute the contrastive loss. We also add a 2-neuron classification layer at the end of this stream, which outputs the visual-based prediction label. So the output of Table 1 . Descriptors learned by the video and audio sub-networks are tuned via the cross-entropy loss, while the contrastive loss is employed to enforce higher dissimilarity between audio-visual chunks arising from fake videos. MDS is computed as the aggregate audiovisual dissonance over the video length, and employed as a figure of merit for labeling a video as real/fake. this stream, labeled asŷ i v , constitutes the unimodal cross-entropy loss.
Mel-frequency cepstral coefficients (MFCC) features are input to the audio stream. MFCC features [17] are widely used for speaker and speech recognition [14] , and have been the state-of-the-art for over three decades. For each audio segment of D second duration a i t , MFCC values are computed and passed through the audio stream S a . 13 mel frequency bands are used at each time step. Overall, audio is encoded as a heat-map image representing MFCC values for each time step and each mel frequency band. We base the audio stream architecture on convolutional neural networks designed for image recognition. Contrastive loss L 1 uses the output of fc8, denoted by f a . Similar to the visual stream, we add a classification layer at the end of the audio stream, and the outputŷ i a is incorporated in the cross-entropy loss for the audio modality.
Inspired by [3] , we use contrastive loss as the key component of the objective function. Contrastive loss enables maximization of the dissimilarity score for manipulated video sequences, while minimizing the MDS for real videos. This consequently ensures separability of the real and fake videos based on MDS (see Fig. 2 ). The loss function is represented by Equation 1. Here, y i is the label for video v i and margin is a hyper-parameter. Dissimilarity score d i t , is the Euclidean distance between the (segment-based) feature representations f v and f a of the visual and audio streams respectively.
In addition, we employ the cross-entropy loss for the visual and audio streams to learn feature representations in a robust manner. These loss functions are defined in Equations 3 (visual) and 4 (audio). The overall loss L is a weighted sum of these three losses, L 1 , L 2 and L 3 as in Eq. 5.
where λ 1 , λ 2 , λ 3 = 1 in our design. 
During test inference, the visual segments {s i 1 , s i 2 , ..., s i n } and corresponding audio segments {a i 1 , a i 2 , ..., a i n } of a video are passed through S v and S a , respectively. For each such segment, dissimilarity score d i t (Equation 2) is accumulated to compute the MDS as below:
To label the test video, we compare MDS i with a threshold τ using 1{MDS i < τ } where 1{.} denotes the logical indicator function. τ is determined on the training set. We compute MDS for both real and fake videos of the train set, and the midpoint between the average values for the real and fake videos is used as a representative value for τ .
As our method is multimodal, we use two public audio-visual deepfake datasets in our experiments. Their description is as follows:
Deepfake-TIMIT [11] : This dataset contains videos of 16 similar looking pairs of people, which are manually selected from the publicly available VIDTIMIT [21] database and manipulated using an open-source GAN-based 3 approach. There are two different models for generating fake videos, one Low Quality (LQ), with 64 × 64 input/output size, and the other High Quality (HQ), with 128 × 128 input/output size. Each of the 32 subjects has 10 videos, resulting in a total of 640 face swapped videos in the dataset; each video is of 512 × 384 resolution with 25 fps frame rate, and of ≈ 4s duration. However, the audio channel is not manipulated in any of the videos. 
For both the datasets, we used D = 1 second segment duration and the margin hyper-parameter described in Equation 
To decide the structure of the network and effect of different components, we chose 5800 videos (4000 real and 1800 fake) from the DFDC dataset, divided them into an 85:15 train-test split, following video-wise AUC and conducted the following experiments: Effect of Loss Functions: We evaluated the contribution of the audio and visual streams based cross-entropy loss functions (L 2 and L 3 , respectively). The hypothesis behind adding these two loss functions to the network is that the feature representations learnt across the audio and visual streams, respectively will be more discriminative towards the task of deep fake detection. This should further assist in the task of computing a segment dissimilarity score d i t , which disambiguates between fake and real videos. This hypothesis was tested by training the network on the DFDC dataset in two different settings. The first setting is based on training the MDS network with contrastive loss only. The second setting is combination of the three loss functions for training of the MDS network. Figure  2 shows two graphs generated using the MDS scores as predicted by the networks from the two settings above. It is observed that the distributions of real and fake videos have lesser intersection in the case of the network trained with all three losses. Overall, combined loss function and contrastive loss only based networks achieved 92.7% and 86.1% AUC scores.
The difference attributes to the observation that the gap between average MDS for real and fake videos widens when cross-entropy loss functions are also used. Hence, there is more clear distinction between the dissonance scores for real and fake.
Audio and Visual Stream Performance: We analysed the individual discriminative ability to identify fake and real videos for the audio and the visual streams. In this case the cross-entropy loss alone was used for training of the streams. It was observed that the audio stream only and visual stream only based deepfake classifiers achieved 50.0 and 89.7%, respectively. Note that audio stream achieves less performance as in the DFDC dataset, minimal manipulation is performed on the audio signal of the videos.
In Equation 6 , for the four configurations: audio stream only, contrastive loss only, visual stream only and combined loss, we set the parameters as follows: (λ 1 = 0, λ 2 = 0, λ 3 = 1), (λ 1 = 1, λ 2 = 0, λ 3 = 0), (λ 1 = 0, λ 2 = 1, λ 3 = 0) and (λ 1 = 1, λ 2 = 1, λ 3 = 1). In the case of audio stream and visual stream based classification, the cross-entropy generated real and fake probabilities are generated segment-wise. We compute a maximum over the probabilities to compute the final fake and real for these two streams, individually.
For further assessing the audio and visual stream's individual performances, we generated the plots shown in Figure 3 . The process is as follows: a fake video segment and corresponding real video segment is passed through the streams and L2 distance is computed between the output of fc8 layer of the visual/audio subnetwork. Then the average of these L2 distances for a video pair is plotted. It is observed in the audio stream plot, that most of the videos are centered close to 0 inter-pair L2 distance. This is due to the fact that audio has been modified in few cases in DFDC dataset. On the contrary, in the plot for the visual stream, we observed that the inter-pair L2 scores is spread across the dataset. This supports the argument that the visual stream is more discrimiantive due to the added cross entropy loss.
In Table 3 , we show the AUC of the four configurations mentioned above. Note that these numbers are on a smaller set of DFDC, which is used for ablation studies only. The contrastive loss only based configuration, which uses both the streams, achieves 86.1%. The fusion of the cross-entropy loss into the final MDS network (λ 1 = 1, λ 2 = 1, λ 3 = 1 for Equation 6), achieves 92.7%. This backs up the argument that comparing (using contrastive loss) features learned through supervised channels enhances the performance of the MDS network.
Segment Duration: For deciding the optimal length of the temporal segment D, we conducted empirical analysis with temporal sizes of D = [1, 2, 4] seconds. From the evaluation on the DFDC dataset, we observed that the temporal duration D = 1 second is most optimum. This can attributed to the larger number of segments 
representing each video, thereby allowing fine-grained comparison of the audio and the visual data of a video.
We compare the performance of our method on the DFDC dataset with other state-of-the-art works [1, 12, 15, 16, 19, 20, 28, 30] . A total of 18,000 videos are used in this experiment 5 . In Table 2 , it is observed that the MDS network approach outperforms the other visual-only and audio-visual based approaches by achieving 91.54%. The performance is~8% more relatively than the other audio-visual based approach [16] . Please note that the result 91.54% is achieved with the test set containing 3281 videos out of which 281 videos have two subjects each. We chose the larger face and passed it through the visual stream. The performance of the network without these multiple subject videos is 93.50%. We also report the frame-wise AUC (91.60%) as mentioned in brackets in Table 2 . This is computed by assigning each frame of a video the same label as predicted for the video by our method. We argue that the gain in performance here is due to: (a) The temporal segmentation of the video into segment helps in finegrained audio-visual feature comparison; (b) We extract task-tuned features from the audio and visual segments. Here task-tuned means that the features are learnt to discriminate between real and fake with the L 2 and L 3 loss functions, and (c) The visual stream's input is the face and an extra margin (see Figure 1 ) around it, which accounts for some rigid (head) movement along with the non-rigid (facial) movements. We visualise the important regions using the Gradient-weighted Class Activation Mapping (Grad-CAM) method [22] . Figure 4 shows the important regions localised by Grad-CAM on few frames of a video. Note that the region around the face is highlighted in the middle frame. Also, the forehead and the neck regions are highlighted in the first and third frames, respectively. This supports our argument that the disharmony between the nonrigid and rigid movement is also discriminative for the visual stream to classify between real and fake videos.
The DeepFake-TIMIT (DFTIMIT) dataset is smaller as compared to the DFDC dataset. We trained the MDS network in two resolution settings: LQ and HQ. Table 2 shows the comparison of our method with the other state-of-the-art methods. It is observed that our method achieves comparable results (LQ: 97.92% and HQ: 96.87%) with the top achieving method [13] . In the DFTIMIT test set there are 96 videos in total. This applies that the penalty for misclassification towards the overall AUC is high in DFTIMIT's case. It is interesting to note that our method mis-classified just 3 video samples in the HQ experiments and 2 videos in the LQ experiments.
[13] achieve state-of-the-art results (LQ: 99.9% and HQ: 99.7%) on DFTIMIT, however, achieve relatively lower AUC results (72.7%) on the larger dataset DFDC. In comparison our method achieved 18% more than [13] on DFDC dataset. This could also mean that the DFTIMIT dataset is now saturated due to smaller size similar to the popular ImageNet dataset [4] . We also report the frame-wise AUC (LQ: 98.3% and HQ: 94.7%) for DFTIMIT as mentioned in brackets in Table 2 .
With the advent of sophisticated forgery techniques, it is possible that an entire video or smaller portions of the video are manipulated to deceive the audience. If in case parts of the original video are corrupted, it would be useful from the FD perspective to be able to locate the timestamps corresponding to the corrupted segments. In an interesting work, Wu et al. [26] proposed a CNN which Figure 5 : Forgery Localization results: In the two examples above, the red part of the curve is detected as fake and blue as real by our method. The segment of the video with segment wise dissimilarity above the threshold is labelled as fake and below the threshold is labelled as real. On the x-axis, we have the original segment labels and on the y-axis the segmentlevel dissimilarity score (Section 4.6).
detects forgery along with the forged locations in images. However, their method is only applicable to copy-paste image forgery. As we process the vidseo by dividing it into temporal segments, a fine-grained analysis of the input video is possible, thereby enabling forgery localization. In contrast to the MDS network, earlier techniques [13, 16] computed features over the entire video. We argue that if a forgery has been performed on a small segment of a video, the forgery signatures in that segment may get diluted due to pooling across the whole video. A similar phenomenon is also observed in prior work relating to pain detection and localization [23] . As the pain event could be short and its location is not labeled, the authors divide the video into temporal segments for better pain detection.
Most of the datasets, including the ones used in this paper have data manipulation performed on practically the entire video. To demonstrate the effectiveness of our method for forgery localization in fake videos, we joined segments from real and corresponding fake videos of the same subject at random locations. In Figure 5 , we show the outputs on two videos created by mixing video segments of the same subject from the DFDC dataset. Here, the segment-wise score is shown on the y-axis. The segments for which the score is above a threshold are assigned as being fake (red on the curve) and below the threshold (blue color on the curve) are assigned are real.
In addition to Figs. 4 and 2, forgery localization makes the working of the MDS-based fake detection framework more explainable and interpretable.
We propose a novel bimodal deepfake detection approach based on the modality dissonance score (MDS), which captures the similarity between audio and visual streams for real and fake videos thereby facilitating separability. The MDS is modeled via the contrastive loss computed over segment-level audiovisual features, which constrains genuine audio-visual streams to be closer than fake counterparts. Furthermore, cross-entropy loss is enforced on the unimodal streams to ensure that they independently learn discriminative features. Experiments show that (a) the MDS-based FD framework can achieve state-of-the-art performance on the DFDC dataset, and (b) the unimodal cross-entropy losses provide extra benefit on top of the contrastive loss to enhance FD performance. Explainability and interpretability of the proposed approach are demonstrated via audio-visual distance distributions obtained for real and fake videos, Grad-CAM outputs denoting attention regions of the MDS network, and forgery localization results.
Future work would focus on (a) incorporating human assessments (acquired via EEG and eye-gaze sensing) in addition to content analysis adopted in this work; (b) exploring algorithms such as multiple instance learning for transient forgery detection, and (c) achieving real-time forgery detection (accomplished by online intrusions) given the promise of processing audio-visual information over 1-second segments.
We are grateful to all the brave frontline workers who are working hard during this difficult COVID19 situation.