{
  "id": 170744,
  "title": "Low yolov4 performance compared to yolov5",
  "url": "/competitions/global-wheat-detection/discussion/170744",
  "author_name": "Stanley Zheng",
  "post_date": "2020-07-28T22:17:09.310000",
  "votes": 2,
  "comment_count": 11,
  "views": 0,
  "content": "<p>From a few sources (<a href=\"https://medium.com/deelvin-machine-learning/yolov4-vs-yolov5-db1e0ac7962b\">https://medium.com/deelvin-machine-learning/yolov4-vs-yolov5-db1e0ac7962b</a>), yolov4 is supposed to have higher performance compared to yolov5. However, using the default config (with only image resolution changed to 480) for both yolov4 and yolov5, I get about 0.68 with yolov4 and 0.73+ with yolov5. Is there a reason for this discrepancy, since yolov4 is supposed to perform better? I've seen yolov3 notebooks performing better than my yolov4. Can anyone share tips for config for yolov4, and any inference techniques? Thanks.</p>",
  "messages": [
    {
      "id": 949756,
      "postDate": "2020-07-28T22:17:09.310Z",
      "content": "<p>From a few sources (<a href=\"https://medium.com/deelvin-machine-learning/yolov4-vs-yolov5-db1e0ac7962b\">https://medium.com/deelvin-machine-learning/yolov4-vs-yolov5-db1e0ac7962b</a>), yolov4 is supposed to have higher performance compared to yolov5. However, using the default config (with only image resolution changed to 480) for both yolov4 and yolov5, I get about 0.68 with yolov4 and 0.73+ with yolov5. Is there a reason for this discrepancy, since yolov4 is supposed to perform better? I've seen yolov3 notebooks performing better than my yolov4. Can anyone share tips for config for yolov4, and any inference techniques? Thanks.</p>",
      "rawMarkdown": "From a few sources (https://medium.com/deelvin-machine-learning/yolov4-vs-yolov5-db1e0ac7962b), yolov4 is supposed to have higher performance compared to yolov5. However, using the default config (with only image resolution changed to 480) for both yolov4 and yolov5, I get about 0.68 with yolov4 and 0.73+ with yolov5. Is there a reason for this discrepancy, since yolov4 is supposed to perform better? I've seen yolov3 notebooks performing better than my yolov4. Can anyone share tips for config for yolov4, and any inference techniques? Thanks.",
      "votes": 1
    },
    {
      "id": 949886,
      "postDate": "2020-07-29T03:30:35.713Z",
      "content": "<p>Yes, I am also seeing the same- Ultralytics' YOLOv5 is performing better than Darknet's YOLOv4 in this competition. Have you added TTA+WBF+Pseudo Labeling to your YOLOv4?\nI tried TTA with WBF but it's not working for me.\nAnd your image resolution is too small. Change it to bigger (704 or 1024) and then retrain your model.</p>",
      "rawMarkdown": "Yes, I am also seeing the same- Ultralytics' YOLOv5 is performing better than Darknet's YOLOv4 in this competition. Have you added TTA+WBF+Pseudo Labeling to your YOLOv4?\nI tried TTA with WBF but it's not working for me.\nAnd your image resolution is too small. Change it to bigger (704 or 1024) and then retrain your model.",
      "votes": 2,
      "replies": [
        {
          "id": 949899,
          "postDate": "2020-07-29T03:56:09.587Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 949954,
          "postDate": "2020-07-29T05:07:46.447Z",
          "content": "<p>With bigger resolution means in .cfg file change the width and height to 1024 and then train the model because I experimented and found that trained model with bigger resolution gives better score. Share your result once your training is done with changed anchor boxes.</p>",
          "rawMarkdown": "With bigger resolution means in .cfg file change the width and height to 1024 and then train the model because I experimented and found that trained model with bigger resolution gives better score. Share your result once your training is done with changed anchor boxes.",
          "votes": 1
        },
        {
          "id": 949966,
          "postDate": "2020-07-29T05:15:55.070Z",
          "content": "<p>Will do! Sounds good, I changed resolution to 704x704 also (not enough VRAM for 1024x1024), we'll see how it goes I guess! I'll be sure to let you know how it goes, might be a while though, it will take forever to train</p>",
          "rawMarkdown": "Will do! Sounds good, I changed resolution to 704x704 also (not enough VRAM for 1024x1024), we'll see how it goes I guess! I'll be sure to let you know how it goes, might be a while though, it will take forever to train",
          "votes": 2
        },
        {
          "id": 949985,
          "postDate": "2020-07-29T05:27:47.083Z",
          "content": "<p>I am also could not able to train with 1024 due to limited memory.</p>",
          "rawMarkdown": "I am also could not able to train with 1024 due to limited memory.",
          "votes": 1
        },
        {
          "id": 950797,
          "postDate": "2020-07-29T16:17:38.487Z",
          "content": "<p>Bit of an update. It's about 2/3 done training, but just looking at the first 4000 iterations, the yolov5 config with the changed anchors don't perform nearly as well as the default config with increased resolution. I think that the config is only optimised for yolov5 unfortunately. The increased resolution model with default config performs about 2% better from what I see in my validation set, I will update you when I actually submit it later today or tomorrow.</p>",
          "rawMarkdown": "Bit of an update. It's about 2/3 done training, but just looking at the first 4000 iterations, the yolov5 config with the changed anchors don't perform nearly as well as the default config with increased resolution. I think that the config is only optimised for yolov5 unfortunately. The increased resolution model with default config performs about 2% better from what I see in my validation set, I will update you when I actually submit it later today or tomorrow.",
          "votes": 1
        },
        {
          "id": 951312,
          "postDate": "2020-07-30T04:00:37.650Z",
          "content": "<p>Submitted! Using the default config with only changed filters, resolution, and classes, I got 0.7115 with WBF but no PL or OOF. I think it's a decent baseline, not the best but good enough for me. The one with yolov5 anchors finished training, it's awful. I get about 0.9 IoU with the model I submitted, but with the yolov5 anchors, I get 0.83, so I don't think it's good.</p>",
          "rawMarkdown": "Submitted! Using the default config with only changed filters, resolution, and classes, I got 0.7115 with WBF but no PL or OOF. I think it's a decent baseline, not the best but good enough for me. The one with yolov5 anchors finished training, it's awful. I get about 0.9 IoU with the model I submitted, but with the yolov5 anchors, I get 0.83, so I don't think it's good.",
          "votes": 2
        },
        {
          "id": 951807,
          "postDate": "2020-07-30T12:29:59.170Z",
          "content": "<p><a href=\"/stanleyjzheng\">@stanleyjzheng</a> 0.7115 is a very good baseline score with default settings. I am very happy that you achieved that. So what are iou_thres and skip_thres values you are using? Are you also using TTA?</p>",
          "rawMarkdown": "@stanleyjzheng 0.7115 is a very good baseline score with default settings. I am very happy that you achieved that. So what are iou_thres and skip_thres values you are using? Are you also using TTA?",
          "votes": 1
        },
        {
          "id": 951992,
          "postDate": "2020-07-30T14:41:26.667Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 952002,
          "postDate": "2020-07-30T14:49:43.117Z",
          "content": "<p>I see you are using PyTorch. I have seen in few competitions PyTorch result is better than keras/TF. I am confident that once you add Pseudo Labeling, your score will increased. So try it and share the result.</p>",
          "rawMarkdown": "I see you are using PyTorch. I have seen in few competitions PyTorch result is better than keras/TF. I am confident that once you add Pseudo Labeling, your score will increased. So try it and share the result."
        },
        {
          "id": 952020,
          "postDate": "2020-07-30T15:05:18.110Z",
          "content": "<p>Thanks, I will definitely try PL. It's going to be difficult, there is so little time to do PL, I really wish I started this competition earlier!</p>",
          "rawMarkdown": "Thanks, I will definitely try PL. It's going to be difficult, there is so little time to do PL, I really wish I started this competition earlier!",
          "votes": 1
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 949886,
      "author_name": "Prateek Gupta",
      "author_url": "",
      "post_date": "2020-07-29T03:30:35.713000",
      "content": "<p>Yes, I am also seeing the same- Ultralytics' YOLOv5 is performing better than Darknet's YOLOv4 in this competition. Have you added TTA+WBF+Pseudo Labeling to your YOLOv4?\nI tried TTA with WBF but it's not working for me.\nAnd your image resolution is too small. Change it to bigger (704 or 1024) and then retrain your model.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 949899,
          "author_name": "",
          "author_url": "",
          "post_date": "2020-07-29T03:56:09.587000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 949954,
          "author_name": "Prateek Gupta",
          "author_url": "",
          "post_date": "2020-07-29T05:07:46.447000",
          "content": "<p>With bigger resolution means in .cfg file change the width and height to 1024 and then train the model because I experimented and found that trained model with bigger resolution gives better score. Share your result once your training is done with changed anchor boxes.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 949966,
          "author_name": "Stanley Zheng",
          "author_url": "",
          "post_date": "2020-07-29T05:15:55.070000",
          "content": "<p>Will do! Sounds good, I changed resolution to 704x704 also (not enough VRAM for 1024x1024), we'll see how it goes I guess! I'll be sure to let you know how it goes, might be a while though, it will take forever to train</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 949985,
          "author_name": "Prateek Gupta",
          "author_url": "",
          "post_date": "2020-07-29T05:27:47.083000",
          "content": "<p>I am also could not able to train with 1024 due to limited memory.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 950797,
          "author_name": "Stanley Zheng",
          "author_url": "",
          "post_date": "2020-07-29T16:17:38.487000",
          "content": "<p>Bit of an update. It's about 2/3 done training, but just looking at the first 4000 iterations, the yolov5 config with the changed anchors don't perform nearly as well as the default config with increased resolution. I think that the config is only optimised for yolov5 unfortunately. The increased resolution model with default config performs about 2% better from what I see in my validation set, I will update you when I actually submit it later today or tomorrow.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 951312,
          "author_name": "Stanley Zheng",
          "author_url": "",
          "post_date": "2020-07-30T04:00:37.650000",
          "content": "<p>Submitted! Using the default config with only changed filters, resolution, and classes, I got 0.7115 with WBF but no PL or OOF. I think it's a decent baseline, not the best but good enough for me. The one with yolov5 anchors finished training, it's awful. I get about 0.9 IoU with the model I submitted, but with the yolov5 anchors, I get 0.83, so I don't think it's good.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 951807,
          "author_name": "Prateek Gupta",
          "author_url": "",
          "post_date": "2020-07-30T12:29:59.170000",
          "content": "<p><a href=\"/stanleyjzheng\">@stanleyjzheng</a> 0.7115 is a very good baseline score with default settings. I am very happy that you achieved that. So what are iou_thres and skip_thres values you are using? Are you also using TTA?</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 951992,
          "author_name": "",
          "author_url": "",
          "post_date": "2020-07-30T14:41:26.667000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 952002,
          "author_name": "Prateek Gupta",
          "author_url": "",
          "post_date": "2020-07-30T14:49:43.117000",
          "content": "<p>I see you are using PyTorch. I have seen in few competitions PyTorch result is better than keras/TF. I am confident that once you add Pseudo Labeling, your score will increased. So try it and share the result.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 952020,
          "author_name": "Stanley Zheng",
          "author_url": "",
          "post_date": "2020-07-30T15:05:18.110000",
          "content": "<p>Thanks, I will definitely try PL. It's going to be difficult, there is so little time to do PL, I really wish I started this competition earlier!</p>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "949756": "From a few sources (https://medium.com/deelvin-machine-learning/yolov4-vs-yolov5-db1e0ac7962b), yolov4 is supposed to have higher performance compared to yolov5. However, using the default config (with only image resolution changed to 480) for both yolov4 and yolov5, I get about 0.68 with yolov4 and 0.73+ with yolov5. Is there a reason for this discrepancy, since yolov4 is supposed to perform better? I've seen yolov3 notebooks performing better than my yolov4. Can anyone share tips for config for yolov4, and any inference techniques? Thanks.",
    "949886": "Yes, I am also seeing the same- Ultralytics' YOLOv5 is performing better than Darknet's YOLOv4 in this competition. Have you added TTA+WBF+Pseudo Labeling to your YOLOv4?\nI tried TTA with WBF but it's not working for me.\nAnd your image resolution is too small. Change it to bigger (704 or 1024) and then retrain your model."
  }
}