## 4 Construction and Optimization for the Deepfake Detection Model
### Construction of the FG-TEFusionnet Model for Deepfake Detection
#### 4.3.1 Construction of the LRnet Network Model Incorporating SENet Attention  
The LRNet framework, by employing its specifically designed calibration module, enhances the accuracy of facial landmarks in input face images and effectively mitigates irregular jitter and noise resulting from video compression or facial movements within videos. Consequently, the geometric features of facial landmarks can be utilized for the detection of deepfake face videos. However, LRNet still has several limitations. Due to the specific nature of optical flow calculations, the tracking and denoising of facial landmarks can only be carried out between adjacent frames and propagated downwards. This approach lacks the capability to extract cross-frame information and does not sufficiently consider long-range temporal features, leading to inadequate extraction of inter-frame information. Thus, by comprehensively utilizing the detailed features within the facial landmarks, the accuracy and robustness of the deepfake face video detection model can be significantly improved. Building on the aforementioned concepts, an inter-frame information-based deepfake face detection model, SEAR-Net (SENet Attention in Two-RNN-Net), is proposed. To enhance the feature representation of inter-frame information in deepfake videos, the facial landmark calibration module from the LRNet framework was retained, while a SENet attention mechanism module was incorporated into the recurrent neural network branches. The outputs of these two branches are then fed into a decision fusion module. The SEAR-Net method extracts features from the inter-frame information of the input sample video and generates the results from the network branches, thus achieving the detection of deepfake face videos. The framework of the SEAR-Net method is illustrated in Figure 9.  
* Facial Landmarks Calibration Module  
The facial landmarks obtained after preprocessing can accurately represent the contours and details of facial features. However, due to the continuous nature of video dynamics, these landmarks still exhibit noticeable jitter, which hinders the effective extraction of inter-frame information. To address this, a facial landmark calibration module is employed to reduce the impact of jitter noise, thereby enhancing the resolution and accuracy of the facial landmarks and improving detection accuracy. The facial landmark calibration module used in this study is illustrated in Figure 10. It incorporates the Pyramid Lucas-Kanade algorithm and the Kalman filter, which are utilized for predicting the position in the next frame and denoising the inter-frame facial landmarks, respectively. Figure 9: The framework of the SEAR-Net model. To calibrate facial landmarks, the algorithm adjusts the landmarks by matching small patches in the surrounding area. The calibration module employs the optical flow method to track the positional changes of facial landmarks across consecutive video frames. Given that deepfake face images are highly detailed and the Lucas-Kanade algorithm is sensitive to patch size, a pyramidal structure is introduced. The Pyramid Lucas-Kanade algorithm facilitates the tracking of facial landmarks between adjacent frames, as depicted in Step 1 of the LK operation in Figure 10.  
In applications, the Lucas-Kanade algorithm may introduce noise to facial landmark movement in sample videos, affecting network model feature extraction. Thus, the Kalman filter is used. It combines actual and predicted landmark positions to remove most noise, enhancing feature-point precision and stability, as shown in Figure 10 Step 2. The working principle of the facial landmark calibration module is further detailed. First, the Lucas-Kanade algorithm tracks the facial feature points in the previous frame to predict the approximate location of the face in the next frame. To ensure prediction accuracy, small image patches with unreasonable predicted positions that exhibit significant discrepancies are discarded.