Skip to main content
. 2022 Mar 24;22(7):2500. doi: 10.3390/s22072500
Algorithm 1 Deepfake Detection Using Optical Flow Model
  1. For video V in the dataset
    1. Extract frames from video V.
    2. Pass the frames to MTCNN.
      1. Detect the face in video.
      2. Crop the face.
      3. Export the faces as images.
    3. Pass the frames sequences PWC-Net
    4. Export the optical flow sequence as RGB images.
  2. Prepare the model
    1. Load the model trained on imagnet dataset.
    2. Remove the last classification layers.
    3. Freeze the model and keep the last three layers trainable.
    4. Add dropout layer with rate of 0.2
    5. Add dense layer with softmax.
  3. Train the model
    1. Add reduce learning rate callback.
    2. Add early stopping callback.
    3. Start training the model.
  4. Evaluate the model