The relentless evolution of presentation attacks poses a threat to the security of facial recognition systems,and low-cost deepfake technology has caused widespread social security issues. With the continuous confrontation between forgery and anticounterfeiting technologies,the difference between real and forged data is becoming increasingly subtle,transient,and sparse. However,when the generated patches (or occluded patches) are mixed with the original image,global inconsistencies in lighting,geometric proportions,motion patterns,and other aspects are inevitable. This study proposes an adaptive face fraud detection model based on Transformer graph representation learning,which utilizes fraud clues with widespread global spatial inconsistency in fraud samples. This model aims to improve the accuracy and generalization ability of face fraud detection to address increasingly complex security challenges.
First,the model constructs the complementary advantages of graph neural networks (GNN) and Transformer layers by alternately stacking them. GNN shields irrelevant nodes and converts Transformer’s blind global attention into sparse,low rank,and structurally sensitive; Transformer expands the receptive field of GNN through long-range dependencies,making message transmission farther and more flexible. The combination of GNN and Transformer makes it easier for the model to capture globally inconsistent fraud clues. Second,given the strong dependence of GNN on graph topology,this model applies the dynamic K-nearest neighbor dense algorithm to improve the sampling method of neighboring nodes. The algorithm adaptively adjusts the connectivity (degree) of each node based on the local feature density distribution in the latent space. In sparse or ambiguous regions,nodes connect to more neighbors to gather broader context; in dense,discriminative regions,connections focus on the most relevant neighbors,thus dynamically constructing data-adaptive graph topologies that are inherently more resilient to noise and variations,providing a robust foundation for subsequent processing. Third,this model uses a dual attention mechanism to weight the nodes and edges in the graph separately. The weight of nodes reflects the degree of influence of image patches in different regions on image labels,and adding weights to nodes can enable the model to focus on image patches that carry more discriminative information. Meanwhile,the weight of edges reflects the degree of influence of neighboring nodes on the central node,and adding weights to edges can highlight the key pathways of information flow. This dual attention explicitly models the complex interplay between nodes and their relationships,allowing the model to focus on the most salient and informative features and connections,thereby dramatically boosting its relational learning capacity and sensitivity to subtle cues. Fourth,considering that static models fail against novel attacks,this model incorporates meta learning optimization strategies to enable the model to quickly adapt to new types of attacks or new scenarios. The core improvement of this strategy is a new combination of soft-label loss functions. In the inner-loop training stage,the model utilizes the sensitivity of the Kullback-Leibler (KL) divergence loss to adjust uncertain model parameters quickly,while in the outer-loop stage,it utilizes the strong fault tolerance of the soft-target cross-entropy loss function to ensure stable and robust feature representations across various data. The improved meta learning algorithm not only demonstrates increased stability during training,but also maintains good generalization performance on different datasets.
This study investigates the effectiveness of the proposed model on seven major,publicly available benchmarks,which belong to traditional face antispoofing or deepfake detection tasks. In the face antispoofing experiment,four classic datasets,i.e.,MSU-MFSD,Replay-Attack,OULU-NPU,and CASIA-FASD,were used for cross-dataset experiments. The average half total error rate (HTER) obtained from the experiment exceeded all comparison algorithms,indicating that the proposed model has good generalization performance in face antispoofing. In the deepfake detection experiment,FaceForensics++ (FF++) and Celeb-DF (v2) were used for intradataset experiments,achieving classification accuracies of 98.93% and 98.44%,respectively; Then,FF++ was used to conduct cross subset experiments within the dataset,and FF++,deepfake detection dataset),and Celeb-DF were used to conduct cross-dataset experiments. The above cross domain experimental results show that the accuracy and area under the curve of this model are higher than those of the latest model. Further ablation experiments confirmed that density-based dynamic K-nearest neighbors (DBD-KNN),meta learning optimization,TransGNN module,and FFN module in the model are all beneficial for improving model performance. The comparative experiment between K-nearest neighbors,and DBD-KNN confirms that even if the KNN algorithm uses the optimal K value,its performance remains inferior to DBD-KNN. The DBD-KNN algorithm leads by 5.55% in the HTER metric,mainly because of its ability to adapt to changes in data dynamically,thereby more effectively adapting to the characteristics of the dataset. In the loss function combination experiment of meta learning,it was confirmed that the best experimental results can be obtained when selecting the KL divergence loss function for the inner loop and the soft-target cross entropy loss function for the outer loop. After analyzing the complexity of the model,we found that although the proposed model has remarkable advantages in computational efficiency and parameter quantity,its detection accuracy remains at a high level. Finally,observing the evolution of the topological structure of the graph reveals that as the model training deepens,the connections between nodes are no longer limited to local areas,but begin to capture semantic features with distinctive characteristics throughout the entire image range. This result reveals the inherent logic of the model in making detection decisions.
The method proposed in this study can effectively capture and identify subtle fraud clues and global inconsistencies present in fraud samples,thereby improving the detection accuracy of the model. This method is particularly remarkable in enhancing the model’s generalization ability to different datasets and adaptability to new environments,ensuring that the model can achieve high recognition performance in diverse practical application scenarios. The dataset for this study has been archived in ScienceDB and can be accessed via https://doi.org/10.57760/sciencedb.j00240.00096.
| 科 Family | 属数 Number of genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) | 属 Genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) |
|---|---|---|---|---|---|---|
| 鹅膏菌科Amanitaceae | 2 | 11 | 5.26 | 鹅膏菌属 Amanita | 10 | 4.78 |
| 小菇科 Mycenaceae | 2 | 12 | 5.74 | 丝盖伞属 Inocybe | 5 | 2.39 |
| 多孔菌科 Polyporaceae | 8 | 14 | 6.70 | 蜡蘑属 Laccaria | 5 | 2.39 |
| 红菇科 Russulaceae | 3 | 23 | 11.00 | 小皮伞属 Marasmius | 6 | 2.87 |
| 小菇属 Mycena | 11 | 5.26 | ||||
| 光柄菇属 Pluteus | 5 | 2.39 | ||||
| 红菇属 Russula | 17 | 8.13 | ||||
| 栓菌属 Trametes | 5 | 2.39 |