{
  "id": 145720,
  "title": "Silver zone solo, no credits used.",
  "url": "/competitions/deepfake-detection-challenge/writeups/victor-paslay-silver-zone-solo-no-credits-used",
  "author_name": "",
  "post_date": "2020-04-24T08:54:34.764527600Z",
  "votes": 18,
  "comment_count": 6,
  "views": 0,
  "content": "<p>I regret I did not join this competition earlier, I had just one month of intensive work. \nThis should be my first silver medal. I have read many write ups about getting good score and many of them lack one detail: some guys work pretty hard to climb high - this is very important detail. When I read comments like: \"I worked 10 hrs/day on this competition\" - I could not believe(maybe it is a bit exaggerated), before that I thought - well, ok, 2-3 hrs/week. This time I quit my job partially because I wanted to join some Kaggle competition and take it seriously plus I had no computer vision experience at my job and DFDC seemed very interesting to me. Finally I can say that I spent 30-40 hrs/week in average on this competition, working also over the weekends. I did not use any external machines for training, I joined late and could not use credits. My PC specs are 32 GB RAM, 128 GB SSD + 256 GB SSD, GeForce GTX 1080 Ti. SSD helped a lot in this competition.</p>\n\n<p>I believe the main \"magic thing\" for me was proper train-validation technique. For example, I have trained EfficientNetB1 which receives 224x224 image as input and outputs a binary number(fake or real) using the next data organization:\nFor each epoch:\n1. Select single face image from unique real video(random frame).\n2. Select random fake video which was originated  from a real video in a way that you <em>do not take two or more fake videos</em> originated from one unique real video.  Then you pick the random frame and random face from each fake. Eventually you get the same number of subsampled fakes as for real samples.\n3. Every epoch you pick faces/frames/videos randomly.\n4. Also you split train/validation set by fixed folder-wise split for all epochs.\n1 EPOCH takes just 5-10 minutes(if you have all images extracted on your SSD)! And whole training takes just 1-1.5 hours! Finally I had validation score ~0.22-~0.25 for different models.\nI extracted 20 frames during inference, classified them and calculated the median of predicitons.</p>\n\n<p>I trained LRCNN(EFNB1 as backbone) as well, its input is only 3 consequent frames.\nMy final solution is the average of three single frame models multiply by 0.85 and one LRCNN model multiply by 0.15.</p>\n\n<p>I tried toooooons of things, I trained Increption-ResNet V2 during 2 days, attached the fan to my PC and I even was afraid that I will wake up in the house full of smoke :) I believe I could do better if a day had 50 hours instead of 24, if I had teamed up with someone. This competition has no end, we can apply here infinite number of approaches.</p>\n\n<p>I would like to thank guys like Human Analog and Shangqiu Li - they deserve many upvotes. And thank you all for participating!</p>",
  "messages": [
    {
      "id": "818974",
      "postDate": "04/24/2020 08:54:34",
      "content": "<p>I regret I did not join this competition earlier, I had just one month of intensive work. \nThis should be my first silver medal. I have read many write ups about getting good score and many of them lack one detail: some guys work pretty hard to climb high - this is very important detail. When I read comments like: \"I worked 10 hrs/day on this competition\" - I could not believe(maybe it is a bit exaggerated), before that I thought - well, ok, 2-3 hrs/week. This time I quit my job partially because I wanted to join some Kaggle competition and take it seriously plus I had no computer vision experience at my job and DFDC seemed very interesting to me. Finally I can say that I spent 30-40 hrs/week in average on this competition, working also over the weekends. I did not use any external machines for training, I joined late and could not use credits. My PC specs are 32 GB RAM, 128 GB SSD + 256 GB SSD, GeForce GTX 1080 Ti. SSD helped a lot in this competition.</p>\n\n<p>I believe the main \"magic thing\" for me was proper train-validation technique. For example, I have trained EfficientNetB1 which receives 224x224 image as input and outputs a binary number(fake or real) using the next data organization:\nFor each epoch:\n1. Select single face image from unique real video(random frame).\n2. Select random fake video which was originated  from a real video in a way that you <em>do not take two or more fake videos</em> originated from one unique real video.  Then you pick the random frame and random face from each fake. Eventually you get the same number of subsampled fakes as for real samples.\n3. Every epoch you pick faces/frames/videos randomly.\n4. Also you split train/validation set by fixed folder-wise split for all epochs.\n1 EPOCH takes just 5-10 minutes(if you have all images extracted on your SSD)! And whole training takes just 1-1.5 hours! Finally I had validation score ~0.22-~0.25 for different models.\nI extracted 20 frames during inference, classified them and calculated the median of predicitons.</p>\n\n<p>I trained LRCNN(EFNB1 as backbone) as well, its input is only 3 consequent frames.\nMy final solution is the average of three single frame models multiply by 0.85 and one LRCNN model multiply by 0.15.</p>\n\n<p>I tried toooooons of things, I trained Increption-ResNet V2 during 2 days, attached the fan to my PC and I even was afraid that I will wake up in the house full of smoke :) I believe I could do better if a day had 50 hours instead of 24, if I had teamed up with someone. This competition has no end, we can apply here infinite number of approaches.</p>\n\n<p>I would like to thank guys like Human Analog and Shangqiu Li - they deserve many upvotes. And thank you all for participating!</p>",
      "rawMarkdown": "I regret I did not join this competition earlier, I had just one month of intensive work. \nThis should be my first silver medal. I have read many write ups about getting good score and many of them lack one detail: some guys work pretty hard to climb high - this is very important detail. When I read comments like: \"I worked 10 hrs/day on this competition\" - I could not believe(maybe it is a bit exaggerated), before that I thought - well, ok, 2-3 hrs/week. This time I quit my job partially because I wanted to join some Kaggle competition and take it seriously plus I had no computer vision experience at my job and DFDC seemed very interesting to me. Finally I can say that I spent 30-40 hrs/week in average on this competition, working also over the weekends. I did not use any external machines for training, I joined late and could not use credits. My PC specs are 32 GB RAM, 128 GB SSD + 256 GB SSD, GeForce GTX 1080 Ti. SSD helped a lot in this competition.\n\nI believe the main \"magic thing\" for me was proper train-validation technique. For example, I have trained EfficientNetB1 which receives 224x224 image as input and outputs a binary number(fake or real) using the next data organization:\nFor each epoch:\n1. Select single face image from unique real video(random frame).\n2. Select random fake video which was originated  from a real video in a way that you *do not take two or more fake videos* originated from one unique real video.  Then you pick the random frame and random face from each fake. Eventually you get the same number of subsampled fakes as for real samples.\n3. Every epoch you pick faces/frames/videos randomly.\n4. Also you split train/validation set by fixed folder-wise split for all epochs.\n1 EPOCH takes just 5-10 minutes(if you have all images extracted on your SSD)! And whole training takes just 1-1.5 hours! Finally I had validation score ~0.22-~0.25 for different models.\nI extracted 20 frames during inference, classified them and calculated the median of predicitons.\n\nI trained LRCNN(EFNB1 as backbone) as well, its input is only 3 consequent frames.\nMy final solution is the average of three single frame models multiply by 0.85 and one LRCNN model multiply by 0.15.\n\nI tried toooooons of things, I trained Increption-ResNet V2 during 2 days, attached the fan to my PC and I even was afraid that I will wake up in the house full of smoke :) I believe I could do better if a day had 50 hours instead of 24, if I had teamed up with someone. This competition has no end, we can apply here infinite number of approaches.\n\nI would like to thank guys like Human Analog and Shangqiu Li - they deserve many upvotes. And thank you all for participating!",
      "votes": null
    },
    {
      "id": "818988",
      "postDate": "04/24/2020 09:09:35",
      "content": "<p>Great work. How did you go about storing the videos? just as jpgs on your SSD? Very interested how resource-limited people dealt with the constraints here</p>",
      "rawMarkdown": "Great work. How did you go about storing the videos? just as jpgs on your SSD? Very interested how resource-limited people dealt with the constraints here",
      "votes": null
    },
    {
      "id": "818999",
      "postDate": "04/24/2020 09:13:44",
      "content": "<p>Resource-limited sounds offensive :D Haha, just kidding.\nYes, JPGs on SSD in their original size. As I remember it occupied like 60 GiB, but not sure.\nI wanted also to test the idea with PNGs and used my external USB Hard Drive(1 TiB) in the last 3 days of competition. But that was the idea full of pain and I stopped checking it.</p>",
      "rawMarkdown": "Resource-limited sounds offensive :D Haha, just kidding.\nYes, JPGs on SSD in their original size. As I remember it occupied like 60 GiB, but not sure.\nI wanted also to test the idea with PNGs and used my external USB Hard Drive(1 TiB) in the last 3 days of competition. But that was the idea full of pain and I stopped checking it.",
      "votes": null
    },
    {
      "id": "819008",
      "postDate": "04/24/2020 09:20:40",
      "content": "<p>Haha don't mean any offense by it. My system is similar in specs to yours. In most cases that is plenty but when dealing with 500gb of video it is a little different. </p>\n\n<p>I think maybe I was just storing way too much and too concerned with looking at a lot of frames. I was putting things into hdf5 arrays and storing in lots of different formats so ended up filling up my hard drives and using my ssd as a scratch drive whenever I wanted to do experiments with a specific dataset I created. I dont know if that was the best way to do it or not though. </p>",
      "rawMarkdown": "Haha don't mean any offense by it. My system is similar in specs to yours. In most cases that is plenty but when dealing with 500gb of video it is a little different. \n\nI think maybe I was just storing way too much and too concerned with looking at a lot of frames. I was putting things into hdf5 arrays and storing in lots of different formats so ended up filling up my hard drives and using my ssd as a scratch drive whenever I wanted to do experiments with a specific dataset I created. I dont know if that was the best way to do it or not though.",
      "votes": null
    },
    {
      "id": "819326",
      "postDate": "04/24/2020 14:12:03",
      "content": "<p>Great work, congrats!</p>",
      "rawMarkdown": "Great work, congrats!",
      "votes": null
    },
    {
      "id": "819404",
      "postDate": "04/24/2020 15:17:48",
      "content": "<p>My congratulations too for your first silver!</p>",
      "rawMarkdown": "My congratulations too for your first silver!",
      "votes": null
    },
    {
      "id": "820385",
      "postDate": "04/25/2020 12:04:21",
      "content": "<p>Your dedication is great and it shows. Thanks for sharing your approach!</p>",
      "rawMarkdown": "Your dedication is great and it shows. Thanks for sharing your approach!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 818988,
      "author_name": "ryches",
      "author_url": "",
      "post_date": "04/24/2020 09:09:35",
      "content": "<p>Great work. How did you go about storing the videos? just as jpgs on your SSD? Very interested how resource-limited people dealt with the constraints here</p>",
      "votes": null,
      "replies": [
        {
          "id": 818999,
          "author_name": "vpaslay",
          "author_url": "",
          "post_date": "04/24/2020 09:13:44",
          "content": "<p>Resource-limited sounds offensive :D Haha, just kidding.\nYes, JPGs on SSD in their original size. As I remember it occupied like 60 GiB, but not sure.\nI wanted also to test the idea with PNGs and used my external USB Hard Drive(1 TiB) in the last 3 days of competition. But that was the idea full of pain and I stopped checking it.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 819008,
          "author_name": "ryches",
          "author_url": "",
          "post_date": "04/24/2020 09:20:40",
          "content": "<p>Haha don't mean any offense by it. My system is similar in specs to yours. In most cases that is plenty but when dealing with 500gb of video it is a little different. </p>\n\n<p>I think maybe I was just storing way too much and too concerned with looking at a lot of frames. I was putting things into hdf5 arrays and storing in lots of different formats so ended up filling up my hard drives and using my ssd as a scratch drive whenever I wanted to do experiments with a specific dataset I created. I dont know if that was the best way to do it or not though. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 819326,
      "author_name": "greatgamedota",
      "author_url": "",
      "post_date": "04/24/2020 14:12:03",
      "content": "<p>Great work, congrats!</p>",
      "votes": null,
      "replies": [
        {
          "id": 819404,
          "author_name": "vpaslay",
          "author_url": "",
          "post_date": "04/24/2020 15:17:48",
          "content": "<p>My congratulations too for your first silver!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 820385,
      "author_name": "yassinealouini",
      "author_url": "",
      "post_date": "04/25/2020 12:04:21",
      "content": "<p>Your dedication is great and it shows. Thanks for sharing your approach!</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "818974": "I regret I did not join this competition earlier, I had just one month of intensive work. \nThis should be my first silver medal. I have read many write ups about getting good score and many of them lack one detail: some guys work pretty hard to climb high - this is very important detail. When I read comments like: \"I worked 10 hrs/day on this competition\" - I could not believe(maybe it is a bit exaggerated), before that I thought - well, ok, 2-3 hrs/week. This time I quit my job partially because I wanted to join some Kaggle competition and take it seriously plus I had no computer vision experience at my job and DFDC seemed very interesting to me. Finally I can say that I spent 30-40 hrs/week in average on this competition, working also over the weekends. I did not use any external machines for training, I joined late and could not use credits. My PC specs are 32 GB RAM, 128 GB SSD + 256 GB SSD, GeForce GTX 1080 Ti. SSD helped a lot in this competition.\n\nI believe the main \"magic thing\" for me was proper train-validation technique. For example, I have trained EfficientNetB1 which receives 224x224 image as input and outputs a binary number(fake or real) using the next data organization:\nFor each epoch:\n1. Select single face image from unique real video(random frame).\n2. Select random fake video which was originated  from a real video in a way that you *do not take two or more fake videos* originated from one unique real video.  Then you pick the random frame and random face from each fake. Eventually you get the same number of subsampled fakes as for real samples.\n3. Every epoch you pick faces/frames/videos randomly.\n4. Also you split train/validation set by fixed folder-wise split for all epochs.\n1 EPOCH takes just 5-10 minutes(if you have all images extracted on your SSD)! And whole training takes just 1-1.5 hours! Finally I had validation score ~0.22-~0.25 for different models.\nI extracted 20 frames during inference, classified them and calculated the median of predicitons.\n\nI trained LRCNN(EFNB1 as backbone) as well, its input is only 3 consequent frames.\nMy final solution is the average of three single frame models multiply by 0.85 and one LRCNN model multiply by 0.15.\n\nI tried toooooons of things, I trained Increption-ResNet V2 during 2 days, attached the fan to my PC and I even was afraid that I will wake up in the house full of smoke :) I believe I could do better if a day had 50 hours instead of 24, if I had teamed up with someone. This competition has no end, we can apply here infinite number of approaches.\n\nI would like to thank guys like Human Analog and Shangqiu Li - they deserve many upvotes. And thank you all for participating!",
    "818988": "Great work. How did you go about storing the videos? just as jpgs on your SSD? Very interested how resource-limited people dealt with the constraints here",
    "818999": "Resource-limited sounds offensive :D Haha, just kidding.\nYes, JPGs on SSD in their original size. As I remember it occupied like 60 GiB, but not sure.\nI wanted also to test the idea with PNGs and used my external USB Hard Drive(1 TiB) in the last 3 days of competition. But that was the idea full of pain and I stopped checking it.",
    "819008": "Haha don't mean any offense by it. My system is similar in specs to yours. In most cases that is plenty but when dealing with 500gb of video it is a little different. \n\nI think maybe I was just storing way too much and too concerned with looking at a lot of frames. I was putting things into hdf5 arrays and storing in lots of different formats so ended up filling up my hard drives and using my ssd as a scratch drive whenever I wanted to do experiments with a specific dataset I created. I dont know if that was the best way to do it or not though.",
    "819326": "Great work, congrats!",
    "819404": "My congratulations too for your first silver!",
    "820385": "Your dedication is great and it shows. Thanks for sharing your approach!"
  },
  "source": "meta"
}