Vision Transformer with Attention Rollout for Deepfake Face Image Detection and Localization
Generative AI and synthetic media generation tools have enabled widespread media manipulation tools and raised important privacy concerns with misinformation, identity fraud and the verification of authenticity of media. Most of the current convolution-based deepfake detection methods are hard to be deployed in real scenarios and hard to be interpretable, especially because they have limited ability to capture long-range spatial dependency. It introduces an explainable deepfake face image detection framework based on a vision transformer network for performing powerful binary classification of manipulated and real facial images and an explainable face image localization framework for localizing deepfake image faces. The proposed system involves a transformer-encoder backbone for extracting features through a patches-wise process, which proves suitable for modeling the subtle changes of features when the processes of manipulating the image are designed. To make the network more interpretable, and aid the understanding of the transformer attention distribution as well as localization of manipulated facial regions, a dedicated attention rollout mechanism is embedded. A dedicated rollout mechanism for attention distribution of the transformer and heatmap generating and attention spatial localization are incorporated to improve the interpretability of the network. The framework comprises an end-to-end inference pipeline, such as image preprocessing, estimation of confidence scores, fake-real classification, generation of explainable visualization and storage of prediction history using an integrated database system. An experimental evaluation shows the system can effectively detect deepfakes while also providing accurate local information as justification for classification decisions, contributing to transparency, reliability and trust towards automated synthetic media detection systems.