{
  "id": 134456,
  "title": "best frames_per_video for prediction",
  "url": "/competitions/deepfake-detection-challenge/discussion/134456",
  "author_name": "ant1",
  "post_date": "2020-03-08T09:13:38.979000",
  "votes": 10,
  "comment_count": 16,
  "views": 0,
  "content": "<p>I test resnet50 model with different frames_per_video for prediction according to the kernel of @humananalog\n<a href=\"https://www.kaggle.com/humananalog/inference-demo\">https://www.kaggle.com/humananalog/inference-demo</a></p>\n\n<p>here is the result:\nframes_per_video 1         public score 0.618\nframes_per_video 17       public score 0.413\nframes_per_video 20      public score 0.410\nframes_per_video 32      public score 0.408\nframes_per_video 64      public score 0.409</p>\n\n<p>In my experience,  frames_per_video=32 is a good choice</p>",
  "messages": [
    {
      "id": 766506,
      "postDate": "2020-03-08T09:13:38.980Z",
      "content": "<p>I test resnet50 model with different frames_per_video for prediction according to the kernel of @humananalog\n<a href=\"https://www.kaggle.com/humananalog/inference-demo\">https://www.kaggle.com/humananalog/inference-demo</a></p>\n\n<p>here is the result:\nframes_per_video 1         public score 0.618\nframes_per_video 17       public score 0.413\nframes_per_video 20      public score 0.410\nframes_per_video 32      public score 0.408\nframes_per_video 64      public score 0.409</p>\n\n<p>In my experience,  frames_per_video=32 is a good choice</p>",
      "rawMarkdown": "I test resnet50 model with different frames_per_video for prediction according to the kernel of @humananalog\nhttps://www.kaggle.com/humananalog/inference-demo\n\nhere is the result:\nframes_per_video 1         public score 0.618\nframes_per_video 17       public score 0.413\nframes_per_video 20      public score 0.410\nframes_per_video 32      public score 0.408\nframes_per_video 64      public score 0.409\n\nIn my experience,  frames_per_video=32 is a good choice\n\n\n\n",
      "votes": 9
    },
    {
      "id": 766558,
      "postDate": "2020-03-08T11:16:35.740Z",
      "content": "<p>May I ask how many epochs do you train? I find it hard to prevent overfitting :( </p>",
      "rawMarkdown": "May I ask how many epochs do you train? I find it hard to prevent overfitting :( ",
      "votes": 2,
      "replies": [
        {
          "id": 766598,
          "postDate": "2020-03-08T12:39:44.287Z",
          "content": "<p>On resnet50, I trained  100 epochs with cyclic learning rate.\nMore data, more data augmentation, more regulation will help to prevent overfitting</p>",
          "rawMarkdown": "On resnet50, I trained  100 epochs with cyclic learning rate.\nMore data, more data augmentation, more regulation will help to prevent overfitting",
          "votes": 6
        },
        {
          "id": 767005,
          "postDate": "2020-03-09T02:57:29.947Z",
          "content": "<p>What regulation do you use?</p>",
          "rawMarkdown": "What regulation do you use?",
          "isDeleted": true
        }
      ]
    },
    {
      "id": 776123,
      "postDate": "2020-03-17T06:13:27.663Z",
      "content": "<p>100 frames for draft And plan to 300 frames for final. :)</p>",
      "rawMarkdown": "100 frames for draft And plan to 300 frames for final. :)"
    },
    {
      "id": 771989,
      "postDate": "2020-03-14T22:10:49.930Z",
      "content": "<p><a href=\"/ant1ss\">@ant1ss</a> This is very dependent on how good or bad your model is. That kernel averages the predictions of each frame,  which means, that it might average the predictions of real and fake images in the same video, cause there are fake videos, where not all frames have been altered.</p>",
      "rawMarkdown": "@ant1ss This is very dependent on how good or bad your model is. That kernel averages the predictions of each frame,  which means, that it might average the predictions of real and fake images in the same video, cause there are fake videos, where not all frames have been altered.",
      "replies": [
        {
          "id": 772211,
          "postDate": "2020-03-15T06:49:25.880Z",
          "content": "<p>thanks for remind, maybe I can try some different way for average probability</p>",
          "rawMarkdown": "thanks for remind, maybe I can try some different way for average probability"
        }
      ]
    },
    {
      "id": 769552,
      "postDate": "2020-03-12T02:12:21.080Z",
      "content": "<p>it seems for every frame of real and corresponding fake videos at least for folder 0, the frame values gotten from the numpy array by OpenCV are not the same. Does that mean the fake video is fake from start to end?</p>",
      "rawMarkdown": "it seems for every frame of real and corresponding fake videos at least for folder 0, the frame values gotten from the numpy array by OpenCV are not the same. Does that mean the fake video is fake from start to end?"
    },
    {
      "id": 768544,
      "postDate": "2020-03-10T23:59:28.503Z",
      "content": "<p>I was wondering if there is a better alternative than just averaging the probability of frames, because there could be frames that the faking software couldn't detect face or the person was not facing the camera. which will make the average much lower than it should</p>",
      "rawMarkdown": "I was wondering if there is a better alternative than just averaging the probability of frames, because there could be frames that the faking software couldn't detect face or the person was not facing the camera. which will make the average much lower than it should"
    },
    {
      "id": 767164,
      "postDate": "2020-03-09T08:54:09.290Z",
      "content": "<p>Hi, ant1\nMay I ask how do you split train and validation? Some part as training data ,and other parts as validation part?\nAnd how many images in the training sets? I use part41-49as training data, and part1-20 as validation, there are 400k\nfaces in my training sets, 60k in the val, I do data augmentation, regulation and all I can do to prevent overfitting , But I just got a good score in training data and bad score in val....</p>",
      "rawMarkdown": "Hi, ant1\nMay I ask how do you split train and validation? Some part as training data ,and other parts as validation part?\nAnd how many images in the training sets? I use part41-49as training data, and part1-20 as validation, there are 400k\nfaces in my training sets, 60k in the val, I do data augmentation, regulation and all I can do to prevent overfitting , But I just got a good score in training data and bad score in val....",
      "replies": [
        {
          "id": 767181,
          "postDate": "2020-03-09T09:18:27.780Z",
          "content": "<p>That's what I'm studying now. I just random split train and valid set , and there is leakage between train and validation as @pete said. So in my case, my validation loss is always lower than training loss.  </p>",
          "rawMarkdown": "That's what I'm studying now. I just random split train and valid set , and there is leakage between train and validation as @pete said. So in my case, my validation loss is always lower than training loss.  "
        },
        {
          "id": 767198,
          "postDate": "2020-03-09T09:47:36.257Z",
          "content": "<p>Here we have a spider man talking to an ant man 😄 </p>",
          "rawMarkdown": "Here we have a spider man talking to an ant man 😄 ",
          "votes": 3
        },
        {
          "id": 767204,
          "postDate": "2020-03-09T09:53:30.923Z",
          "content": "<p>In my case, validation score is always very very bad...,acc around 60%, I am going crazy....</p>",
          "rawMarkdown": "In my case, validation score is always very very bad...,acc around 60%, I am going crazy...."
        },
        {
          "id": 767217,
          "postDate": "2020-03-09T10:13:47.880Z",
          "content": "<p>Maybe there is too many similar faces in your training set. In my training set, one video provide only one face.</p>",
          "rawMarkdown": "Maybe there is too many similar faces in your training set. In my training set, one video provide only one face."
        }
      ]
    },
    {
      "id": 767021,
      "postDate": "2020-03-09T03:40:55.933Z",
      "content": "<p>Overfitting here is not really due to lack of data or regulation. It is due to leakage between train and validation making it difficult to choose a stopping point, presumable because the same face appears in multiple chunk directories. It may be a solved problem for some but I haven't seen any convincing claims that that is the case. If I had solved it, I might not not share the solution.</p>",
      "rawMarkdown": "Overfitting here is not really due to lack of data or regulation. It is due to leakage between train and validation making it difficult to choose a stopping point, presumable because the same face appears in multiple chunk directories. It may be a solved problem for some but I haven't seen any convincing claims that that is the case. If I had solved it, I might not not share the solution.",
      "replies": [
        {
          "id": 767023,
          "postDate": "2020-03-09T03:51:53.320Z",
          "content": "<p>By overfitting here I mean the too-complicated architecture that can capture irrelevant images' details and memorize them instead of learning the task (of classifying between reals and fakes). </p>",
          "rawMarkdown": "By overfitting here I mean the too-complicated architecture that can capture irrelevant images' details and memorize them instead of learning the task (of classifying between reals and fakes). "
        },
        {
          "id": 768537,
          "postDate": "2020-03-10T23:52:45.017Z",
          "content": "<p>are you sure same actor can be in multiple parts (the 1-49 parts) ? I've tried multiple data splits but from what I noticed (didn't do a conclusive check though) that an actor is usually in one part</p>\n\n<p>that being said, I did check that an original video always has its fake videos in the same part. </p>",
          "rawMarkdown": "are you sure same actor can be in multiple parts (the 1-49 parts) ? I've tried multiple data splits but from what I noticed (didn't do a conclusive check though) that an actor is usually in one part\n\nthat being said, I did check that an original video always has its fake videos in the same part. "
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 766558,
      "author_name": "Kha Vo",
      "author_url": "",
      "post_date": "2020-03-08T11:16:35.740000",
      "content": "<p>May I ask how many epochs do you train? I find it hard to prevent overfitting :( </p>",
      "votes": 2,
      "replies": [
        {
          "id": 766598,
          "author_name": "ant1",
          "author_url": "",
          "post_date": "2020-03-08T12:39:44.287000",
          "content": "<p>On resnet50, I trained  100 epochs with cyclic learning rate.\nMore data, more data augmentation, more regulation will help to prevent overfitting</p>",
          "votes": 6,
          "replies": []
        },
        {
          "id": 767005,
          "author_name": "",
          "author_url": "",
          "post_date": "2020-03-09T02:57:29.947000",
          "content": "<p>What regulation do you use?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 776123,
      "author_name": "Johnny Lee",
      "author_url": "",
      "post_date": "2020-03-17T06:13:27.663000",
      "content": "<p>100 frames for draft And plan to 300 frames for final. :)</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 771989,
      "author_name": "Nuno Ferreira",
      "author_url": "",
      "post_date": "2020-03-14T22:10:49.930000",
      "content": "<p><a href=\"/ant1ss\">@ant1ss</a> This is very dependent on how good or bad your model is. That kernel averages the predictions of each frame,  which means, that it might average the predictions of real and fake images in the same video, cause there are fake videos, where not all frames have been altered.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 772211,
          "author_name": "ant1",
          "author_url": "",
          "post_date": "2020-03-15T06:49:25.880000",
          "content": "<p>thanks for remind, maybe I can try some different way for average probability</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 769552,
      "author_name": "A*DF",
      "author_url": "",
      "post_date": "2020-03-12T02:12:21.080000",
      "content": "<p>it seems for every frame of real and corresponding fake videos at least for folder 0, the frame values gotten from the numpy array by OpenCV are not the same. Does that mean the fake video is fake from start to end?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 768544,
      "author_name": "B. Allabadi",
      "author_url": "",
      "post_date": "2020-03-10T23:59:28.503000",
      "content": "<p>I was wondering if there is a better alternative than just averaging the probability of frames, because there could be frames that the faking software couldn't detect face or the person was not facing the camera. which will make the average much lower than it should</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 767164,
      "author_name": "tomholland",
      "author_url": "",
      "post_date": "2020-03-09T08:54:09.290000",
      "content": "<p>Hi, ant1\nMay I ask how do you split train and validation? Some part as training data ,and other parts as validation part?\nAnd how many images in the training sets? I use part41-49as training data, and part1-20 as validation, there are 400k\nfaces in my training sets, 60k in the val, I do data augmentation, regulation and all I can do to prevent overfitting , But I just got a good score in training data and bad score in val....</p>",
      "votes": 0,
      "replies": [
        {
          "id": 767181,
          "author_name": "ant1",
          "author_url": "",
          "post_date": "2020-03-09T09:18:27.780000",
          "content": "<p>That's what I'm studying now. I just random split train and valid set , and there is leakage between train and validation as @pete said. So in my case, my validation loss is always lower than training loss.  </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 767198,
          "author_name": "Kha Vo",
          "author_url": "",
          "post_date": "2020-03-09T09:47:36.257000",
          "content": "<p>Here we have a spider man talking to an ant man 😄 </p>",
          "votes": 3,
          "replies": []
        },
        {
          "id": 767204,
          "author_name": "tomholland",
          "author_url": "",
          "post_date": "2020-03-09T09:53:30.923000",
          "content": "<p>In my case, validation score is always very very bad...,acc around 60%, I am going crazy....</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 767217,
          "author_name": "ant1",
          "author_url": "",
          "post_date": "2020-03-09T10:13:47.880000",
          "content": "<p>Maybe there is too many similar faces in your training set. In my training set, one video provide only one face.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 767021,
      "author_name": "pete",
      "author_url": "",
      "post_date": "2020-03-09T03:40:55.933000",
      "content": "<p>Overfitting here is not really due to lack of data or regulation. It is due to leakage between train and validation making it difficult to choose a stopping point, presumable because the same face appears in multiple chunk directories. It may be a solved problem for some but I haven't seen any convincing claims that that is the case. If I had solved it, I might not not share the solution.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 767023,
          "author_name": "Kha Vo",
          "author_url": "",
          "post_date": "2020-03-09T03:51:53.320000",
          "content": "<p>By overfitting here I mean the too-complicated architecture that can capture irrelevant images' details and memorize them instead of learning the task (of classifying between reals and fakes). </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 768537,
          "author_name": "B. Allabadi",
          "author_url": "",
          "post_date": "2020-03-10T23:52:45.017000",
          "content": "<p>are you sure same actor can be in multiple parts (the 1-49 parts) ? I've tried multiple data splits but from what I noticed (didn't do a conclusive check though) that an actor is usually in one part</p>\n\n<p>that being said, I did check that an original video always has its fake videos in the same part. </p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "766506": "I test resnet50 model with different frames_per_video for prediction according to the kernel of @humananalog\nhttps://www.kaggle.com/humananalog/inference-demo\n\nhere is the result:\nframes_per_video 1         public score 0.618\nframes_per_video 17       public score 0.413\nframes_per_video 20      public score 0.410\nframes_per_video 32      public score 0.408\nframes_per_video 64      public score 0.409\n\nIn my experience,  frames_per_video=32 is a good choice\n\n\n\n",
    "766558": "May I ask how many epochs do you train? I find it hard to prevent overfitting :( ",
    "776123": "100 frames for draft And plan to 300 frames for final. :)",
    "771989": "@ant1ss This is very dependent on how good or bad your model is. That kernel averages the predictions of each frame,  which means, that it might average the predictions of real and fake images in the same video, cause there are fake videos, where not all frames have been altered.",
    "769552": "it seems for every frame of real and corresponding fake videos at least for folder 0, the frame values gotten from the numpy array by OpenCV are not the same. Does that mean the fake video is fake from start to end?",
    "768544": "I was wondering if there is a better alternative than just averaging the probability of frames, because there could be frames that the faking software couldn't detect face or the person was not facing the camera. which will make the average much lower than it should",
    "767164": "Hi, ant1\nMay I ask how do you split train and validation? Some part as training data ,and other parts as validation part?\nAnd how many images in the training sets? I use part41-49as training data, and part1-20 as validation, there are 400k\nfaces in my training sets, 60k in the val, I do data augmentation, regulation and all I can do to prevent overfitting , But I just got a good score in training data and bad score in val....",
    "767021": "Overfitting here is not really due to lack of data or regulation. It is due to leakage between train and validation making it difficult to choose a stopping point, presumable because the same face appears in multiple chunk directories. It may be a solved problem for some but I haven't seen any convincing claims that that is the case. If I had solved it, I might not not share the solution."
  }
}