{
  "id": 17016,
  "title": "Matlab ROI and OpenCV Classifier",
  "url": "/competitions/noaa-right-whale-recognition/discussion/17016",
  "author_name": "",
  "post_date": "2015-10-15T06:25:39.420Z",
  "votes": null,
  "comment_count": 12,
  "views": 3555,
  "content": "<p>I find Matlab's Training Labeler app to be exceptionally helpful in creating bounding boxes. It's by far the best tool for this job.</p>\n\n<p>On the other hand, I find OpenCV 3.0.0's <strong>opencv_traincascade</strong>  has produced better results for me so far than Matlab's <strong>trainCascadeObjectDetector</strong>.</p>\n\n<p>I am still in the process of identifying ROIs (results improve with each new batch of images I label) and I am still fiddling with <strong>opencv_traincascade</strong> but the results are starting to make me hopeful.</p>\n\n<p>The following image was produced with a classifier from this command</p>\n\n<pre><code>opencv_traincascade -data haarcascade -vec positives.vec -bg bg.txt -numPos 1879 -numNeg 17313 -numStages 4 -precalcValBufSize 6000 -precalcIdxBufSize 6000 -stageType BOOST -featureType LBP -w 35 -h 35  -bt GAB  -minHitRate 0.999 -maxFalseAlarmRate 0.01 -weightTrimRate 0.95 -maxDepth 1 -maxWeakCount 200 -mode BASIC\n</code></pre>\n\n<p><img src=\"http://www.philadelphia-reflections.com/images/SampleCascadeResult.png\" alt=\"enter image description here\" title></p>",
  "messages": [
    {
      "id": "96234",
      "postDate": "10/15/2015 06:25:39",
      "content": "<p>I find Matlab's Training Labeler app to be exceptionally helpful in creating bounding boxes. It's by far the best tool for this job.</p>\n\n<p>On the other hand, I find OpenCV 3.0.0's <strong>opencv_traincascade</strong>  has produced better results for me so far than Matlab's <strong>trainCascadeObjectDetector</strong>.</p>\n\n<p>I am still in the process of identifying ROIs (results improve with each new batch of images I label) and I am still fiddling with <strong>opencv_traincascade</strong> but the results are starting to make me hopeful.</p>\n\n<p>The following image was produced with a classifier from this command</p>\n\n<pre><code>opencv_traincascade -data haarcascade -vec positives.vec -bg bg.txt -numPos 1879 -numNeg 17313 -numStages 4 -precalcValBufSize 6000 -precalcIdxBufSize 6000 -stageType BOOST -featureType LBP -w 35 -h 35  -bt GAB  -minHitRate 0.999 -maxFalseAlarmRate 0.01 -weightTrimRate 0.95 -maxDepth 1 -maxWeakCount 200 -mode BASIC\n</code></pre>\n\n<p><img src=\"http://www.philadelphia-reflections.com/images/SampleCascadeResult.png\" alt=\"enter image description here\" title></p>",
      "rawMarkdown": "I find Matlab's Training Labeler app to be exceptionally helpful in creating bounding boxes. It's by far the best tool for this job.\r\n\r\nOn the other hand, I find OpenCV 3.0.0's **opencv_traincascade**  has produced better results for me so far than Matlab's **trainCascadeObjectDetector**.\r\n\r\nI am still in the process of identifying ROIs (results improve with each new batch of images I label) and I am still fiddling with **opencv_traincascade** but the results are starting to make me hopeful.\r\n\r\nThe following image was produced with a classifier from this command\r\n\r\n    opencv_traincascade -data haarcascade -vec positives.vec -bg bg.txt -numPos 1879 -numNeg 17313 -numStages 4 -precalcValBufSize 6000 -precalcIdxBufSize 6000 -stageType BOOST -featureType LBP -w 35 -h 35  -bt GAB  -minHitRate 0.999 -maxFalseAlarmRate 0.01 -weightTrimRate 0.95 -maxDepth 1 -maxWeakCount 200 -mode BASIC\r\n\r\n![enter image description here][1]\r\n\r\n\r\n  [1]: http://www.philadelphia-reflections.com/images/SampleCascadeResult.png",
      "votes": null
    },
    {
      "id": "96319",
      "postDate": "10/15/2015 17:24:02",
      "content": "<p>Out of curiosity, what would you estimate your percentage of successes to failures when used to detect heads on test images that weren't cropped/trained on? I've been trying a lot of tuning and different training strategies, but the best I've been able to get is 20% error with no face at all in the photo. However, a majority of the 'success' detections have a rather large area and include the face, but it isn't a huge focus.</p>",
      "rawMarkdown": "Out of curiosity, what would you estimate your percentage of successes to failures when used to detect heads on test images that weren't cropped/trained on? I've been trying a lot of tuning and different training strategies, but the best I've been able to get is 20% error with no face at all in the photo. However, a majority of the 'success' detections have a rather large area and include the face, but it isn't a huge focus.",
      "votes": null
    },
    {
      "id": "96329",
      "postDate": "10/15/2015 18:17:15",
      "content": "<p>I ran some tests of classifier accuracy on 200 images from the test set; the test set because they've never been seen before.</p>\n\n<p>I tried two classifiers, the same as the one shown above but with 20 x 20 patches and 35 x 35 patches.</p>\n\n<p>My program ignores any bounding boxes produced that are smaller than 150 x 150 because there's not enough information to even look at.</p>\n\n<p>The results:</p>\n\n<p>20 x 20 <br>\nNo match     |  56% <br>\nBad match  |  18% <br>\nGood match |  26%   </p>\n\n<p>35 x 35 <br>\nNo match   |  20% <br>\nBad match  |  34% <br>\nGood match |  46%   </p>\n\n<p>Clearly the 35 x 35 patch classifier is superior but it still doesn't look nearly good enough. So I'm encouraged but I don't think this is yet ready for anybody's prime time.</p>\n\n<p>I didn't differentiate when I was counting but I would guess that a majority of what I called good matches were tight enough for a ML program to deal with. That said, my internal logloss results are still pretty poor.</p>",
      "rawMarkdown": "I ran some tests of classifier accuracy on 200 images from the test set; the test set because they've never been seen before.\r\n\r\nI tried two classifiers, the same as the one shown above but with 20 x 20 patches and 35 x 35 patches.\r\n\r\nMy program ignores any bounding boxes produced that are smaller than 150 x 150 because there's not enough information to even look at.\r\n\r\nThe results:\r\n\r\n20 x 20    \r\nNo match     |  56%   \r\nBad match  |  18%   \r\nGood match |  26%   \r\n\r\n35 x 35   \r\nNo match   |  20%   \r\nBad match  |  34%   \r\nGood match |  46%   \r\n\r\nClearly the 35 x 35 patch classifier is superior but it still doesn't look nearly good enough. So I'm encouraged but I don't think this is yet ready for anybody's prime time.\r\n\r\nI didn't differentiate when I was counting but I would guess that a majority of what I called good matches were tight enough for a ML program to deal with. That said, my internal logloss results are still pretty poor.",
      "votes": null
    },
    {
      "id": "96336",
      "postDate": "10/15/2015 19:04:49",
      "content": "<p>40 x 40 <br>\nNo match     |  15% <br>\nBad match  |  41% <br>\nGood match |  44%   </p>\n\n<p>40 x 40 is better on no-matches but I think it is statistically insignificantly different from 35 x 35 on good matches plus it takes a lot longer to run; so, for the time being at least, I think I'll go forward with 35 x 35.</p>",
      "rawMarkdown": "40 x 40    \r\nNo match     |  15%   \r\nBad match  |  41%   \r\nGood match |  44%   \r\n\r\n40 x 40 is better on no-matches but I think it is statistically insignificantly different from 35 x 35 on good matches plus it takes a lot longer to run; so, for the time being at least, I think I'll go forward with 35 x 35.",
      "votes": null
    },
    {
      "id": "96339",
      "postDate": "10/15/2015 19:18:02",
      "content": "<p>A few other <strong>opencv_traincascade</strong> parameters tried:</p>\n\n<p>-numStages | more than 4 often blows up <br>\n-bt | GAB is better than RAB <br>\n-precalcValBufSize, -precalcIdxBufSize | large values improve run time but not results <br>\n-maxWeakCount | too low and the process stops early, making results worse <br>\n-minHitRate, -maxFalseAlarmRate, -featureType, -weightTrimRate, -maxDepth  | more experiments needed   </p>",
      "rawMarkdown": "A few other **opencv_traincascade** parameters tried:\r\n\r\n-numStages | more than 4 often blows up      \r\n-bt | GAB is better than RAB   \r\n-precalcValBufSize, -precalcIdxBufSize | large values improve run time but not results   \r\n-maxWeakCount | too low and the process stops early, making results worse   \r\n-minHitRate, -maxFalseAlarmRate, -featureType, -weightTrimRate, -maxDepth  | more experiments needed",
      "votes": null
    },
    {
      "id": "96343",
      "postDate": "10/15/2015 19:29:54",
      "content": "<p>Hey, really appreciate all the detailed information you're providing! Nice to have some discussion around what seems to be a huge barrier to entry in the competition.</p>\n\n<p>A couple thoughts that you might want to look into, just based on my own observations during training and tweaking. Have you tried looking at the possibility of ensembling differently trained cascade classifiers? I've found some moderate success, as it appears that some of my various classifiers sometimes fail on different examples. So by processing both, the number of complete false positives where both miss the head have gone down a bit (5-10% for me).</p>\n\n<p>Also, out of curiosity, why do you choose such a low maxFalseAlarmRate combined with a low number of stages? My knowledge is limited and I'm still learning, so I don't know if that's a better/worse way, but most methods I've seen recommend a maxFalseAlarmRate around ~0.5 and train more like 10-15 stages to compensate. </p>\n\n<p>One final thing. I noticed that you have a score of 5.97927, along with ~10 other people on the scoreboard. Is that some sort of constant prediction being made, or something trained on data? Come to think of it, I only tried making a submission with equal probability for all identities, but now I'm thinking that making a prediction based on the estimated frequency of identities in the train set would give a better answer, like 5.97927?</p>",
      "rawMarkdown": "Hey, really appreciate all the detailed information you're providing! Nice to have some discussion around what seems to be a huge barrier to entry in the competition.\r\n\r\nA couple thoughts that you might want to look into, just based on my own observations during training and tweaking. Have you tried looking at the possibility of ensembling differently trained cascade classifiers? I've found some moderate success, as it appears that some of my various classifiers sometimes fail on different examples. So by processing both, the number of complete false positives where both miss the head have gone down a bit (5-10% for me).\r\n\r\nAlso, out of curiosity, why do you choose such a low maxFalseAlarmRate combined with a low number of stages? My knowledge is limited and I'm still learning, so I don't know if that's a better/worse way, but most methods I've seen recommend a maxFalseAlarmRate around ~0.5 and train more like 10-15 stages to compensate. \r\n\r\nOne final thing. I noticed that you have a score of 5.97927, along with ~10 other people on the scoreboard. Is that some sort of constant prediction being made, or something trained on data? Come to think of it, I only tried making a submission with equal probability for all identities, but now I'm thinking that making a prediction based on the estimated frequency of identities in the train set would give a better answer, like 5.97927?",
      "votes": null
    },
    {
      "id": "96346",
      "postDate": "10/15/2015 19:41:07",
      "content": "<ol>\n<li><p>What would your ensembling process be? Process one image through several classifiers? Even if you did that, I can't think of which of several bounding boxes to choose ... in the days of my yoot I learned about Fourier analysis and I have an intuition that it could help here but I think the contest will end before I find my old text book.     </p></li>\n<li><p>I'll try your suggestion of a higher maxFalseAlarmRate and a higher numStages, but I have had a lot of trouble with <strong>opencv_traincascade</strong> blowing up at higher numStages; haven't you?    </p></li>\n<li><p>My leaderboard score simply is an attempt to calibrate my internal logloss function; it does not reflect any real machine learning; I've been trying PCA, SVC and CNN with very disappointing logloss scores against a hold-out set of the training data. </p></li>\n</ol>",
      "rawMarkdown": "1. What would your ensembling process be? Process one image through several classifiers? Even if you did that, I can't think of which of several bounding boxes to choose ... in the days of my yoot I learned about Fourier analysis and I have an intuition that it could help here but I think the contest will end before I find my old text book.     \r\n\r\n2. I'll try your suggestion of a higher maxFalseAlarmRate and a higher numStages, but I have had a lot of trouble with **opencv_traincascade** blowing up at higher numStages; haven't you?    \r\n\r\n3. My leaderboard score simply is an attempt to calibrate my internal logloss function; it does not reflect any real machine learning; I've been trying PCA, SVC and CNN with very disappointing logloss scores against a hold-out set of the training data.",
      "votes": null
    },
    {
      "id": "96347",
      "postDate": "10/15/2015 19:42:30",
      "content": "<p>[quote=MrTwiggy;96343]</p>\n\n<p>One final thing. I noticed that you have a score of 5.97927, along with ~10 other people on the scoreboard. Is that some sort of constant prediction being made, or something trained on data? Come to think of it, I only tried making a submission with equal probability for all identities, but now I'm thinking that making a prediction based on the estimated frequency of identities in the train set would give a better answer, like 5.97927?</p>\n\n<p>[/quote]</p>\n\n<p>Rats! You're on to us...</p>\n\n<p>Welcome to the 5.979 club!</p>",
      "rawMarkdown": "[quote=MrTwiggy;96343]\r\n\r\nOne final thing. I noticed that you have a score of 5.97927, along with ~10 other people on the scoreboard. Is that some sort of constant prediction being made, or something trained on data? Come to think of it, I only tried making a submission with equal probability for all identities, but now I'm thinking that making a prediction based on the estimated frequency of identities in the train set would give a better answer, like 5.97927?\r\n\r\n[/quote]\r\n\r\nRats! You're on to us...\r\n\r\nWelcome to the 5.979 club!",
      "votes": null
    },
    {
      "id": "96568",
      "postDate": "10/18/2015 14:31:29",
      "content": "<p>Does any one know how to export ROIs from Matlab Image Labeler  to xml file. I can't find a button for that...</p>",
      "rawMarkdown": "Does any one know how to export ROIs from Matlab Image Labeler  to xml file. I can't find a button for that...",
      "votes": null
    },
    {
      "id": "96570",
      "postDate": "10/18/2015 15:55:31",
      "content": "<p>[quote=Vinh Nguyen;96568]</p>\n\n<p>Does any one know how to export ROIs from Matlab Image Labeler  to xml file. I can't find a button for that...</p>\n\n<p>[/quote]</p>\n\n<p>Export ROI gives you a struct called positiveInstances which you can save to a *.mat file. I then read it into Python but you can read it in Matlab, R, or whatever you please.</p>",
      "rawMarkdown": "[quote=Vinh Nguyen;96568]\r\n\r\nDoes any one know how to export ROIs from Matlab Image Labeler  to xml file. I can't find a button for that...\r\n\r\n[/quote]\r\n\r\nExport ROI gives you a struct called positiveInstances which you can save to a *.mat file. I then read it into Python but you can read it in Matlab, R, or whatever you please.",
      "votes": null
    },
    {
      "id": "96588",
      "postDate": "10/18/2015 22:33:23",
      "content": "<p>Thanks George. I noticed that Rois can be exported to a struct variable in the workspace. But Matlab documentation says that they can be exported-directly I suppose- to an XML file. So that's why I was looking for such a functionality.</p>",
      "rawMarkdown": "Thanks George. I noticed that Rois can be exported to a struct variable in the workspace. But Matlab documentation says that they can be exported-directly I suppose- to an XML file. So that's why I was looking for such a functionality.",
      "votes": null
    },
    {
      "id": "97917",
      "postDate": "11/01/2015 15:02:21",
      "content": "<p>A bit more research into image cascading boosted classifiers; classifiers built on pos/neg training images, tested on 200 test images. I may try DLib HOG features, too.</p>\n\n<p>52% accuracy</p>\n\n<pre><code>opencv_traincascade -data HAAR35x35 \n                    -featureType HAAR \n                    -numStages 5 \n                    -w 35 -h 35 \n                    -minHitRate 0.999 \n                    -maxFalseAlarmRate 0.01 \n                    -vec positives35x35.vec \n                    -bg mat_neg_bg.txt \n                    -numPos 2915 \n                    -numNeg 25571 \n                    -precalcValBufSize 7000 \n                    -precalcIdxBufSize 7000 \n                    -stageType BOOST \n                    -bt GAB \n                    -weightTrimRate 0.95 \n                    -maxDepth 1 \n                    -maxWeakCount 500 \n                    -mode BASIC\n</code></pre>\n\n<p>47% accuracy</p>\n\n<pre><code>opencv_traincascade -data LBP35x35 \n                    -featureType LBP \n                    -numStages 4 \n                    -w 35 -h 35 \n                    -minHitRate 0.999 \n                    -maxFalseAlarmRate 0.01 \n                    -vec positives35x35.vec \n                    -bg mat_neg_bg.txt \n                    -numPos 2915 \n                    -numNeg 25571 \n                    -precalcValBufSize 7000 \n                    -precalcIdxBufSize 7000 \n                    -stageType BOOST \n                    -bt GAB \n                    -weightTrimRate 0.95 \n                    -maxDepth 1 \n                    -maxWeakCount 500 \n                    -mode BASIC\n</code></pre>",
      "rawMarkdown": "A bit more research into image cascading boosted classifiers; classifiers built on pos/neg training images, tested on 200 test images. I may try DLib HOG features, too.\r\n\r\n52% accuracy\r\n\r\n    opencv_traincascade -data HAAR35x35 \r\n                        -featureType HAAR \r\n                        -numStages 5 \r\n                        -w 35 -h 35 \r\n                        -minHitRate 0.999 \r\n                        -maxFalseAlarmRate 0.01 \r\n                        -vec positives35x35.vec \r\n                        -bg mat_neg_bg.txt \r\n                        -numPos 2915 \r\n                        -numNeg 25571 \r\n                        -precalcValBufSize 7000 \r\n                        -precalcIdxBufSize 7000 \r\n                        -stageType BOOST \r\n                        -bt GAB \r\n                        -weightTrimRate 0.95 \r\n                        -maxDepth 1 \r\n                        -maxWeakCount 500 \r\n                        -mode BASIC\r\n\r\n                    \r\n \r\n                  \r\n47% accuracy\r\n\r\n    opencv_traincascade -data LBP35x35 \r\n                        -featureType LBP \r\n                        -numStages 4 \r\n                        -w 35 -h 35 \r\n                        -minHitRate 0.999 \r\n                        -maxFalseAlarmRate 0.01 \r\n                        -vec positives35x35.vec \r\n                        -bg mat_neg_bg.txt \r\n                        -numPos 2915 \r\n                        -numNeg 25571 \r\n                        -precalcValBufSize 7000 \r\n                        -precalcIdxBufSize 7000 \r\n                        -stageType BOOST \r\n                        -bt GAB \r\n                        -weightTrimRate 0.95 \r\n                        -maxDepth 1 \r\n                        -maxWeakCount 500 \r\n                        -mode BASIC",
      "votes": null
    },
    {
      "id": "98738",
      "postDate": "11/12/2015 22:30:15",
      "content": "<p>How is everyone testing their detectors for this with opencv? Specifically how do you differentiate between a &quot;Bad Match&quot; and a &quot;Good Match&quot;. I assume a bad match could be: detecting water as a whale,  returning a bounding box that contains only part of the whale or a match that includes the entire whale but also a lot of extra stuff.  </p>\n\n<p>I could do this manually where I train my detector then run it over test data, and have it draw the ROI and save the updated file. Then I could visually go over the results, but obviously this isn't very efficient. </p>",
      "rawMarkdown": "How is everyone testing their detectors for this with opencv? Specifically how do you differentiate between a \"Bad Match\" and a \"Good Match\". I assume a bad match could be: detecting water as a whale,  returning a bounding box that contains only part of the whale or a match that includes the entire whale but also a lot of extra stuff.  \r\n\r\nI could do this manually where I train my detector then run it over test data, and have it draw the ROI and save the updated file. Then I could visually go over the results, but obviously this isn't very efficient.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 96319,
      "author_name": "mrtwiggy",
      "author_url": "",
      "post_date": "10/15/2015 17:24:02",
      "content": "<p>Out of curiosity, what would you estimate your percentage of successes to failures when used to detect heads on test images that weren't cropped/trained on? I've been trying a lot of tuning and different training strategies, but the best I've been able to get is 20% error with no face at all in the photo. However, a majority of the 'success' detections have a rather large area and include the face, but it isn't a huge focus.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 96329,
      "author_name": "grfiv4",
      "author_url": "",
      "post_date": "10/15/2015 18:17:15",
      "content": "<p>I ran some tests of classifier accuracy on 200 images from the test set; the test set because they've never been seen before.</p>\n\n<p>I tried two classifiers, the same as the one shown above but with 20 x 20 patches and 35 x 35 patches.</p>\n\n<p>My program ignores any bounding boxes produced that are smaller than 150 x 150 because there's not enough information to even look at.</p>\n\n<p>The results:</p>\n\n<p>20 x 20 <br>\nNo match     |  56% <br>\nBad match  |  18% <br>\nGood match |  26%   </p>\n\n<p>35 x 35 <br>\nNo match   |  20% <br>\nBad match  |  34% <br>\nGood match |  46%   </p>\n\n<p>Clearly the 35 x 35 patch classifier is superior but it still doesn't look nearly good enough. So I'm encouraged but I don't think this is yet ready for anybody's prime time.</p>\n\n<p>I didn't differentiate when I was counting but I would guess that a majority of what I called good matches were tight enough for a ML program to deal with. That said, my internal logloss results are still pretty poor.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 96336,
      "author_name": "grfiv4",
      "author_url": "",
      "post_date": "10/15/2015 19:04:49",
      "content": "<p>40 x 40 <br>\nNo match     |  15% <br>\nBad match  |  41% <br>\nGood match |  44%   </p>\n\n<p>40 x 40 is better on no-matches but I think it is statistically insignificantly different from 35 x 35 on good matches plus it takes a lot longer to run; so, for the time being at least, I think I'll go forward with 35 x 35.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 96339,
      "author_name": "grfiv4",
      "author_url": "",
      "post_date": "10/15/2015 19:18:02",
      "content": "<p>A few other <strong>opencv_traincascade</strong> parameters tried:</p>\n\n<p>-numStages | more than 4 often blows up <br>\n-bt | GAB is better than RAB <br>\n-precalcValBufSize, -precalcIdxBufSize | large values improve run time but not results <br>\n-maxWeakCount | too low and the process stops early, making results worse <br>\n-minHitRate, -maxFalseAlarmRate, -featureType, -weightTrimRate, -maxDepth  | more experiments needed   </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 96343,
      "author_name": "mrtwiggy",
      "author_url": "",
      "post_date": "10/15/2015 19:29:54",
      "content": "<p>Hey, really appreciate all the detailed information you're providing! Nice to have some discussion around what seems to be a huge barrier to entry in the competition.</p>\n\n<p>A couple thoughts that you might want to look into, just based on my own observations during training and tweaking. Have you tried looking at the possibility of ensembling differently trained cascade classifiers? I've found some moderate success, as it appears that some of my various classifiers sometimes fail on different examples. So by processing both, the number of complete false positives where both miss the head have gone down a bit (5-10% for me).</p>\n\n<p>Also, out of curiosity, why do you choose such a low maxFalseAlarmRate combined with a low number of stages? My knowledge is limited and I'm still learning, so I don't know if that's a better/worse way, but most methods I've seen recommend a maxFalseAlarmRate around ~0.5 and train more like 10-15 stages to compensate. </p>\n\n<p>One final thing. I noticed that you have a score of 5.97927, along with ~10 other people on the scoreboard. Is that some sort of constant prediction being made, or something trained on data? Come to think of it, I only tried making a submission with equal probability for all identities, but now I'm thinking that making a prediction based on the estimated frequency of identities in the train set would give a better answer, like 5.97927?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 96346,
      "author_name": "grfiv4",
      "author_url": "",
      "post_date": "10/15/2015 19:41:07",
      "content": "<ol>\n<li><p>What would your ensembling process be? Process one image through several classifiers? Even if you did that, I can't think of which of several bounding boxes to choose ... in the days of my yoot I learned about Fourier analysis and I have an intuition that it could help here but I think the contest will end before I find my old text book.     </p></li>\n<li><p>I'll try your suggestion of a higher maxFalseAlarmRate and a higher numStages, but I have had a lot of trouble with <strong>opencv_traincascade</strong> blowing up at higher numStages; haven't you?    </p></li>\n<li><p>My leaderboard score simply is an attempt to calibrate my internal logloss function; it does not reflect any real machine learning; I've been trying PCA, SVC and CNN with very disappointing logloss scores against a hold-out set of the training data. </p></li>\n</ol>",
      "votes": null,
      "replies": []
    },
    {
      "id": 96347,
      "author_name": "johnblankenbaker",
      "author_url": "",
      "post_date": "10/15/2015 19:42:30",
      "content": "<p>[quote=MrTwiggy;96343]</p>\n\n<p>One final thing. I noticed that you have a score of 5.97927, along with ~10 other people on the scoreboard. Is that some sort of constant prediction being made, or something trained on data? Come to think of it, I only tried making a submission with equal probability for all identities, but now I'm thinking that making a prediction based on the estimated frequency of identities in the train set would give a better answer, like 5.97927?</p>\n\n<p>[/quote]</p>\n\n<p>Rats! You're on to us...</p>\n\n<p>Welcome to the 5.979 club!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 96568,
      "author_name": "vinhnguyen",
      "author_url": "",
      "post_date": "10/18/2015 14:31:29",
      "content": "<p>Does any one know how to export ROIs from Matlab Image Labeler  to xml file. I can't find a button for that...</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 96570,
      "author_name": "grfiv4",
      "author_url": "",
      "post_date": "10/18/2015 15:55:31",
      "content": "<p>[quote=Vinh Nguyen;96568]</p>\n\n<p>Does any one know how to export ROIs from Matlab Image Labeler  to xml file. I can't find a button for that...</p>\n\n<p>[/quote]</p>\n\n<p>Export ROI gives you a struct called positiveInstances which you can save to a *.mat file. I then read it into Python but you can read it in Matlab, R, or whatever you please.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 96588,
      "author_name": "vinhnguyen",
      "author_url": "",
      "post_date": "10/18/2015 22:33:23",
      "content": "<p>Thanks George. I noticed that Rois can be exported to a struct variable in the workspace. But Matlab documentation says that they can be exported-directly I suppose- to an XML file. So that's why I was looking for such a functionality.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 97917,
      "author_name": "grfiv4",
      "author_url": "",
      "post_date": "11/01/2015 15:02:21",
      "content": "<p>A bit more research into image cascading boosted classifiers; classifiers built on pos/neg training images, tested on 200 test images. I may try DLib HOG features, too.</p>\n\n<p>52% accuracy</p>\n\n<pre><code>opencv_traincascade -data HAAR35x35 \n                    -featureType HAAR \n                    -numStages 5 \n                    -w 35 -h 35 \n                    -minHitRate 0.999 \n                    -maxFalseAlarmRate 0.01 \n                    -vec positives35x35.vec \n                    -bg mat_neg_bg.txt \n                    -numPos 2915 \n                    -numNeg 25571 \n                    -precalcValBufSize 7000 \n                    -precalcIdxBufSize 7000 \n                    -stageType BOOST \n                    -bt GAB \n                    -weightTrimRate 0.95 \n                    -maxDepth 1 \n                    -maxWeakCount 500 \n                    -mode BASIC\n</code></pre>\n\n<p>47% accuracy</p>\n\n<pre><code>opencv_traincascade -data LBP35x35 \n                    -featureType LBP \n                    -numStages 4 \n                    -w 35 -h 35 \n                    -minHitRate 0.999 \n                    -maxFalseAlarmRate 0.01 \n                    -vec positives35x35.vec \n                    -bg mat_neg_bg.txt \n                    -numPos 2915 \n                    -numNeg 25571 \n                    -precalcValBufSize 7000 \n                    -precalcIdxBufSize 7000 \n                    -stageType BOOST \n                    -bt GAB \n                    -weightTrimRate 0.95 \n                    -maxDepth 1 \n                    -maxWeakCount 500 \n                    -mode BASIC\n</code></pre>",
      "votes": null,
      "replies": []
    },
    {
      "id": 98738,
      "author_name": "djatha",
      "author_url": "",
      "post_date": "11/12/2015 22:30:15",
      "content": "<p>How is everyone testing their detectors for this with opencv? Specifically how do you differentiate between a &quot;Bad Match&quot; and a &quot;Good Match&quot;. I assume a bad match could be: detecting water as a whale,  returning a bounding box that contains only part of the whale or a match that includes the entire whale but also a lot of extra stuff.  </p>\n\n<p>I could do this manually where I train my detector then run it over test data, and have it draw the ROI and save the updated file. Then I could visually go over the results, but obviously this isn't very efficient. </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "96234": "I find Matlab's Training Labeler app to be exceptionally helpful in creating bounding boxes. It's by far the best tool for this job.\r\n\r\nOn the other hand, I find OpenCV 3.0.0's **opencv_traincascade**  has produced better results for me so far than Matlab's **trainCascadeObjectDetector**.\r\n\r\nI am still in the process of identifying ROIs (results improve with each new batch of images I label) and I am still fiddling with **opencv_traincascade** but the results are starting to make me hopeful.\r\n\r\nThe following image was produced with a classifier from this command\r\n\r\n    opencv_traincascade -data haarcascade -vec positives.vec -bg bg.txt -numPos 1879 -numNeg 17313 -numStages 4 -precalcValBufSize 6000 -precalcIdxBufSize 6000 -stageType BOOST -featureType LBP -w 35 -h 35  -bt GAB  -minHitRate 0.999 -maxFalseAlarmRate 0.01 -weightTrimRate 0.95 -maxDepth 1 -maxWeakCount 200 -mode BASIC\r\n\r\n![enter image description here][1]\r\n\r\n\r\n  [1]: http://www.philadelphia-reflections.com/images/SampleCascadeResult.png",
    "96319": "Out of curiosity, what would you estimate your percentage of successes to failures when used to detect heads on test images that weren't cropped/trained on? I've been trying a lot of tuning and different training strategies, but the best I've been able to get is 20% error with no face at all in the photo. However, a majority of the 'success' detections have a rather large area and include the face, but it isn't a huge focus.",
    "96329": "I ran some tests of classifier accuracy on 200 images from the test set; the test set because they've never been seen before.\r\n\r\nI tried two classifiers, the same as the one shown above but with 20 x 20 patches and 35 x 35 patches.\r\n\r\nMy program ignores any bounding boxes produced that are smaller than 150 x 150 because there's not enough information to even look at.\r\n\r\nThe results:\r\n\r\n20 x 20    \r\nNo match     |  56%   \r\nBad match  |  18%   \r\nGood match |  26%   \r\n\r\n35 x 35   \r\nNo match   |  20%   \r\nBad match  |  34%   \r\nGood match |  46%   \r\n\r\nClearly the 35 x 35 patch classifier is superior but it still doesn't look nearly good enough. So I'm encouraged but I don't think this is yet ready for anybody's prime time.\r\n\r\nI didn't differentiate when I was counting but I would guess that a majority of what I called good matches were tight enough for a ML program to deal with. That said, my internal logloss results are still pretty poor.",
    "96336": "40 x 40    \r\nNo match     |  15%   \r\nBad match  |  41%   \r\nGood match |  44%   \r\n\r\n40 x 40 is better on no-matches but I think it is statistically insignificantly different from 35 x 35 on good matches plus it takes a lot longer to run; so, for the time being at least, I think I'll go forward with 35 x 35.",
    "96339": "A few other **opencv_traincascade** parameters tried:\r\n\r\n-numStages | more than 4 often blows up      \r\n-bt | GAB is better than RAB   \r\n-precalcValBufSize, -precalcIdxBufSize | large values improve run time but not results   \r\n-maxWeakCount | too low and the process stops early, making results worse   \r\n-minHitRate, -maxFalseAlarmRate, -featureType, -weightTrimRate, -maxDepth  | more experiments needed",
    "96343": "Hey, really appreciate all the detailed information you're providing! Nice to have some discussion around what seems to be a huge barrier to entry in the competition.\r\n\r\nA couple thoughts that you might want to look into, just based on my own observations during training and tweaking. Have you tried looking at the possibility of ensembling differently trained cascade classifiers? I've found some moderate success, as it appears that some of my various classifiers sometimes fail on different examples. So by processing both, the number of complete false positives where both miss the head have gone down a bit (5-10% for me).\r\n\r\nAlso, out of curiosity, why do you choose such a low maxFalseAlarmRate combined with a low number of stages? My knowledge is limited and I'm still learning, so I don't know if that's a better/worse way, but most methods I've seen recommend a maxFalseAlarmRate around ~0.5 and train more like 10-15 stages to compensate. \r\n\r\nOne final thing. I noticed that you have a score of 5.97927, along with ~10 other people on the scoreboard. Is that some sort of constant prediction being made, or something trained on data? Come to think of it, I only tried making a submission with equal probability for all identities, but now I'm thinking that making a prediction based on the estimated frequency of identities in the train set would give a better answer, like 5.97927?",
    "96346": "1. What would your ensembling process be? Process one image through several classifiers? Even if you did that, I can't think of which of several bounding boxes to choose ... in the days of my yoot I learned about Fourier analysis and I have an intuition that it could help here but I think the contest will end before I find my old text book.     \r\n\r\n2. I'll try your suggestion of a higher maxFalseAlarmRate and a higher numStages, but I have had a lot of trouble with **opencv_traincascade** blowing up at higher numStages; haven't you?    \r\n\r\n3. My leaderboard score simply is an attempt to calibrate my internal logloss function; it does not reflect any real machine learning; I've been trying PCA, SVC and CNN with very disappointing logloss scores against a hold-out set of the training data.",
    "96347": "[quote=MrTwiggy;96343]\r\n\r\nOne final thing. I noticed that you have a score of 5.97927, along with ~10 other people on the scoreboard. Is that some sort of constant prediction being made, or something trained on data? Come to think of it, I only tried making a submission with equal probability for all identities, but now I'm thinking that making a prediction based on the estimated frequency of identities in the train set would give a better answer, like 5.97927?\r\n\r\n[/quote]\r\n\r\nRats! You're on to us...\r\n\r\nWelcome to the 5.979 club!",
    "96568": "Does any one know how to export ROIs from Matlab Image Labeler  to xml file. I can't find a button for that...",
    "96570": "[quote=Vinh Nguyen;96568]\r\n\r\nDoes any one know how to export ROIs from Matlab Image Labeler  to xml file. I can't find a button for that...\r\n\r\n[/quote]\r\n\r\nExport ROI gives you a struct called positiveInstances which you can save to a *.mat file. I then read it into Python but you can read it in Matlab, R, or whatever you please.",
    "96588": "Thanks George. I noticed that Rois can be exported to a struct variable in the workspace. But Matlab documentation says that they can be exported-directly I suppose- to an XML file. So that's why I was looking for such a functionality.",
    "97917": "A bit more research into image cascading boosted classifiers; classifiers built on pos/neg training images, tested on 200 test images. I may try DLib HOG features, too.\r\n\r\n52% accuracy\r\n\r\n    opencv_traincascade -data HAAR35x35 \r\n                        -featureType HAAR \r\n                        -numStages 5 \r\n                        -w 35 -h 35 \r\n                        -minHitRate 0.999 \r\n                        -maxFalseAlarmRate 0.01 \r\n                        -vec positives35x35.vec \r\n                        -bg mat_neg_bg.txt \r\n                        -numPos 2915 \r\n                        -numNeg 25571 \r\n                        -precalcValBufSize 7000 \r\n                        -precalcIdxBufSize 7000 \r\n                        -stageType BOOST \r\n                        -bt GAB \r\n                        -weightTrimRate 0.95 \r\n                        -maxDepth 1 \r\n                        -maxWeakCount 500 \r\n                        -mode BASIC\r\n\r\n                    \r\n \r\n                  \r\n47% accuracy\r\n\r\n    opencv_traincascade -data LBP35x35 \r\n                        -featureType LBP \r\n                        -numStages 4 \r\n                        -w 35 -h 35 \r\n                        -minHitRate 0.999 \r\n                        -maxFalseAlarmRate 0.01 \r\n                        -vec positives35x35.vec \r\n                        -bg mat_neg_bg.txt \r\n                        -numPos 2915 \r\n                        -numNeg 25571 \r\n                        -precalcValBufSize 7000 \r\n                        -precalcIdxBufSize 7000 \r\n                        -stageType BOOST \r\n                        -bt GAB \r\n                        -weightTrimRate 0.95 \r\n                        -maxDepth 1 \r\n                        -maxWeakCount 500 \r\n                        -mode BASIC",
    "98738": "How is everyone testing their detectors for this with opencv? Specifically how do you differentiate between a \"Bad Match\" and a \"Good Match\". I assume a bad match could be: detecting water as a whale,  returning a bounding box that contains only part of the whale or a match that includes the entire whale but also a lot of extra stuff.  \r\n\r\nI could do this manually where I train my detector then run it over test data, and have it draw the ROI and save the updated file. Then I could visually go over the results, but obviously this isn't very efficient."
  },
  "source": "meta"
}