# Video Frame Interpolation Forgery Detection(视频帧间伪造检测) **Repository Path**: VIT19980106/video-frame-interpolation-forgery-detection ## Basic Information - **Project Name**: Video Frame Interpolation Forgery Detection(视频帧间伪造检测) - **Description**: 基于3DCNN的视频帧间伪造检测 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 1 - **Created**: 2023-08-22 - **Last Updated**: 2024-03-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: 深度学习 ## README # Video Frame Interpolation Forgery Detection / **基于3DCNN的视频帧间伪造检测** ![输入图片说明](1692773629519.png) ![输入图片说明](1692773643698.png) **If you need the code, please add me on QQ 869114539 or WeChat px5911** #### Introduction Video Frame Interpolation Forgery Detection based on 3DCNN #### Summary | code | function | |---|---| | dataset VIFFD | size:3.4G | | generate_video | way1-replace_for_4 / way2-copy / way3-replace_for_12 | | data_sliding_window.py | based on sliding window for processing consecutive difference frames/save npy | | train | 3DCNN train | #### Details ![输入图片说明](model_parmas.png) #### Run python datasetCreation.py --folder_path --fps 25 --forge_video_path forge_video_data python absdiffVideo.py --folder_path forge_video_data --data_path data/ python data_sliding_window.py --folder_path forge_video_data --data_path data.npy --label_path labels.npy python train #### Issue 1. The number of consecutive frames required in the input dimension of the 3DCNN,currently set to 3,the parameter affects data processing and model performance. 2.Since the input for 3DCNN consists of a sequence of consecutive frames, if the parameter 't' is set to 3, the construction of the sequence for the 0th and 1st frames is as follows: The sequence for the 0th frame is obtained by duplicating the 0th frame twice and appending itself. The sequence for the 1st frame is obtained by concatenating the 0th frame, duplicating the 1st frame, and appending itself. 3.The softmax function for binary classification is equivalent to the sigmoid function. Generally, the sigmoid function is used for binary classification, while the softmax function is used for multi-class classification. In this article, we adhere to the common practice and use the sigmoid function. 4.Anomaly detection: Treat the imbalanced class as an anomaly detection problem and use specialized algorithms to identify and classify the minority class #### 介绍 视频帧间伪造检测 基于3DCNN实现 #### 摘要 | code | function | |---|---| | dataset VIFFD | size:3.4G | | generate_video | way1-replace way2-copy | | data_sliding_window.py | based on sliding window for processing consecutive difference frames/save npy | | train | 3DCNN train | #### 细节 ![输入图片说明](model_parmas.png) #### 运行 (1) 生成伪造帧数据集代码 --forge_video_path 参数为生成数据集路径 python datasetCreation.py --folder_path --fps 25 --forge_video_path forge_video_data (2)差分帧计算代码 --data_path 为差分帧计算结果保存的路径,均为.npy文件 python absdiffVideo.py --folder_path forge_video_data --data_path data/ (3)制作3DCNN输入形状数据集,结果集保存为两个npy文件,其中,data.npy为图像帧数据,labels.npy为标签数据 python data_sliding_window.py --folder_path forge_video_data --data_path data.npy --label_path labels.npy (4)训练代码 python train (5)预测代码 --video_path 为输入伪造视频的路径,结果集保存为output_video.mp4 python predict --video_path video_path --length length --width width #### 问题 1. 3DCNN的输入维度中需要连续帧的帧数(b t h w c)-(batch_szie,帧数,h,w,通道数),等同于时间序列(LSTM)中的timeStep,当前设置为3,该参数直接影响了数据处理和模型性能。 2.由于3DCNN输入为连续图像序列,假如t取值为3,第0帧、第1帧的序列如何构建,目前解决为第0帧复制2次+自身作为第0帧的序列,第1帧为第0帧+第一帧复制+本身作为第1帧序列。 3.softmax二分类等同于sigmoid,一般情况下二分类使用sigmoid,多分类使用sotmax,本文遵循一般情况,使用了sigmoid 4.伪造的数据集中伪造帧(1)远远小于真实帧,真是应用中亦遵循该规律,属于不平衡样本分类,应考虑改进模型,否则预测结果均为真实帧(0)