{
  "id": 12326,
  "title": "Duplicate images",
  "url": "/competitions/datasciencebowl/discussion/12326",
  "author_name": "",
  "post_date": "2015-01-25T05:12:28.780Z",
  "votes": 9,
  "comment_count": 5,
  "views": 1912,
  "content": "<p>If this were a &quot;normal&quot; data analysis project (and not a competition), I would remove a number of the images as duplicates.</p>\n<p>I found duplicates by comparing md5sums of the image files.</p>\n<p><strong>Train set.</strong>&nbsp; Image 14864.jpg in <em>chaetognath_non_sagittal</em> and Image 271.jpg in <em>chaetognath_other</em> have the same md5sum, the same number of bytes, and visually look identical.</p>\n<p><strong>Test set</strong>.&nbsp; In the 93,789 test images I found only 72,397 unique md5sums.&nbsp;</p>\n<p>A count of the number of duplicates shows this:</p>\n<p><code>counts<br>&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp; 8<br>57513&nbsp; 9931&nbsp; 3695&nbsp; 1004&nbsp;&nbsp; 218&nbsp;&nbsp;&nbsp; 30&nbsp;&nbsp;&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code></p>\n<p>Only 57,513 images had no duplicates.&nbsp; There were 9931 cases where two images shared the same md5sum. ... 5 cases of 7 images matching, and 1 case of 8 images matching.</p>\n<p>Here are the image numbers of the 8 identical images in the test set:&nbsp;</p>\n<p>10084<br>117336<br>120878<br>137310<br>159251<br>3105<br>39527<br>56867</p>\n<p>Here are the image numbers of one of the 5 cases of 7 duplicates:</p>\n<p>11574<br>12828<br>19976<br>36521<br>4847<br>49518<br>59124</p>\n<p>Prediction is likely not that CPU intensive once a model is built, so the 21,391 duplicate test images that could be eliminated are perhaps not that big of a deal, but do introduce&nbsp;a likely minor&nbsp;overrepresentation bias.</p>\n<p><strong>Duplicates&nbsp;between Train and Test Sets?</strong>&nbsp; Luckily, there was only one:&nbsp; 159128.jpg from <em>appendicularian_straight</em> matches test set image 108193.jpg.</p>\n<p>For&nbsp;additional details on the duplicates and how they were found, see https://github.com/EarlGlynn/kaggle-plankton</p>\n\n<p>&nbsp;&nbsp;</p>",
  "messages": [
    {
      "id": "63126",
      "postDate": "01/25/2015 05:12:28",
      "content": "<p>If this were a &quot;normal&quot; data analysis project (and not a competition), I would remove a number of the images as duplicates.</p>\n<p>I found duplicates by comparing md5sums of the image files.</p>\n<p><strong>Train set.</strong>&nbsp; Image 14864.jpg in <em>chaetognath_non_sagittal</em> and Image 271.jpg in <em>chaetognath_other</em> have the same md5sum, the same number of bytes, and visually look identical.</p>\n<p><strong>Test set</strong>.&nbsp; In the 93,789 test images I found only 72,397 unique md5sums.&nbsp;</p>\n<p>A count of the number of duplicates shows this:</p>\n<p><code>counts<br>&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp; 8<br>57513&nbsp; 9931&nbsp; 3695&nbsp; 1004&nbsp;&nbsp; 218&nbsp;&nbsp;&nbsp; 30&nbsp;&nbsp;&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code></p>\n<p>Only 57,513 images had no duplicates.&nbsp; There were 9931 cases where two images shared the same md5sum. ... 5 cases of 7 images matching, and 1 case of 8 images matching.</p>\n<p>Here are the image numbers of the 8 identical images in the test set:&nbsp;</p>\n<p>10084<br>117336<br>120878<br>137310<br>159251<br>3105<br>39527<br>56867</p>\n<p>Here are the image numbers of one of the 5 cases of 7 duplicates:</p>\n<p>11574<br>12828<br>19976<br>36521<br>4847<br>49518<br>59124</p>\n<p>Prediction is likely not that CPU intensive once a model is built, so the 21,391 duplicate test images that could be eliminated are perhaps not that big of a deal, but do introduce&nbsp;a likely minor&nbsp;overrepresentation bias.</p>\n<p><strong>Duplicates&nbsp;between Train and Test Sets?</strong>&nbsp; Luckily, there was only one:&nbsp; 159128.jpg from <em>appendicularian_straight</em> matches test set image 108193.jpg.</p>\n<p>For&nbsp;additional details on the duplicates and how they were found, see https://github.com/EarlGlynn/kaggle-plankton</p>\n\n<p>&nbsp;&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63129",
      "postDate": "01/25/2015 06:48:57",
      "content": "<p>good catch :) &nbsp;thanks for sharing.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63171",
      "postDate": "01/26/2015 03:12:00",
      "content": "<p>Any&nbsp;explainations of these duplicates? And the duplicates in Test Dataset belong to the same category? @Admin</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63191",
      "postDate": "01/26/2015 15:23:49",
      "content": "<p>[quote=efg2;63126]</p>\n<p>the 21,391 duplicate test images that could be eliminated are perhaps not that big of a deal, but do introduce&nbsp;a likely minor&nbsp;overrepresentation bias.</p>\n<p>[/quote]<br><br>Rest assured, the duplicates are not an accident and do not introduce bias. On the data page we cautioned that, &quot;Kaggle has supplemented the test set with additional &quot;ignored&quot; images. These are not counted in the scoring.&quot; This is what you've found&nbsp;here. Specifically, the exact duplicates are either intentional or images which were, by chance, transformed back to their original state (e.g. flipped twice).&nbsp;These ignored images are there to&nbsp;discourage hand labeling. Anyone who tries&nbsp;to hand label has both more images and less&nbsp;certainty about which are actually part of the scoring.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63284",
      "postDate": "01/28/2015 19:20:15",
      "content": "<p>I discovered the stats I originally reported were incomplete.&nbsp; I discovered my test.zip was corrupt.&nbsp;</p>\n<p>After getting the complete set of 130,400 test images from a new copy of test.zip,&nbsp;the duplicate count in the test&nbsp;set&nbsp;is now&nbsp;36,898 -- there are only 93,502 unique test set images.</p>\n<p>The counts of the number of kinds of duplicates is now:</p>\n<p><code>[1] 93502<br>counts<br>&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp;&nbsp;&nbsp;&nbsp; 9<br>71244 12346&nbsp; 6393&nbsp; 2597&nbsp;&nbsp; 684&nbsp;&nbsp; 195&nbsp;&nbsp;&nbsp; 38&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp; </code></p>\n<p>So, 71,244 test images&nbsp;are completely unique.&nbsp; At the other extreme, there is one case of 9 images being identically&nbsp;the same.&nbsp; There are four cases of 8 images being identically the same.</p>\n<p>I would have thought minor variations in the&nbsp;test set (e.g, a variety of rotations of a particular image)&nbsp;would be a better test strategy than just repeating the same images so many times.&nbsp;</p>\n<p>A second test image was found to match a train image.</p>\n<p>I updated the scripts and stats in the GitHub repository mentioned above.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "63285",
      "postDate": "01/28/2015 19:48:19",
      "content": "<p>[quote=efg2;63284]</p>\n<p>I would have thought minor variations in the&nbsp;test set (e.g, a variety of rotations of a particular image)&nbsp;would be a better test strategy than just repeating the same images so many times.&nbsp;</p>\n<p>[/quote]</p>\n<p>And you would be correct :) There are many other ignored images with many types of linear and nonlinear transformations.</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 63129,
      "author_name": "drpatrickchan",
      "author_url": "",
      "post_date": "01/25/2015 06:48:57",
      "content": "<p>good catch :) &nbsp;thanks for sharing.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63171,
      "author_name": "liangpang",
      "author_url": "",
      "post_date": "01/26/2015 03:12:00",
      "content": "<p>Any&nbsp;explainations of these duplicates? And the duplicates in Test Dataset belong to the same category? @Admin</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63191,
      "author_name": "wcukierski",
      "author_url": "",
      "post_date": "01/26/2015 15:23:49",
      "content": "<p>[quote=efg2;63126]</p>\n<p>the 21,391 duplicate test images that could be eliminated are perhaps not that big of a deal, but do introduce&nbsp;a likely minor&nbsp;overrepresentation bias.</p>\n<p>[/quote]<br><br>Rest assured, the duplicates are not an accident and do not introduce bias. On the data page we cautioned that, &quot;Kaggle has supplemented the test set with additional &quot;ignored&quot; images. These are not counted in the scoring.&quot; This is what you've found&nbsp;here. Specifically, the exact duplicates are either intentional or images which were, by chance, transformed back to their original state (e.g. flipped twice).&nbsp;These ignored images are there to&nbsp;discourage hand labeling. Anyone who tries&nbsp;to hand label has both more images and less&nbsp;certainty about which are actually part of the scoring.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63284,
      "author_name": "efglynn",
      "author_url": "",
      "post_date": "01/28/2015 19:20:15",
      "content": "<p>I discovered the stats I originally reported were incomplete.&nbsp; I discovered my test.zip was corrupt.&nbsp;</p>\n<p>After getting the complete set of 130,400 test images from a new copy of test.zip,&nbsp;the duplicate count in the test&nbsp;set&nbsp;is now&nbsp;36,898 -- there are only 93,502 unique test set images.</p>\n<p>The counts of the number of kinds of duplicates is now:</p>\n<p><code>[1] 93502<br>counts<br>&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp;&nbsp;&nbsp;&nbsp; 9<br>71244 12346&nbsp; 6393&nbsp; 2597&nbsp;&nbsp; 684&nbsp;&nbsp; 195&nbsp;&nbsp;&nbsp; 38&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp; </code></p>\n<p>So, 71,244 test images&nbsp;are completely unique.&nbsp; At the other extreme, there is one case of 9 images being identically&nbsp;the same.&nbsp; There are four cases of 8 images being identically the same.</p>\n<p>I would have thought minor variations in the&nbsp;test set (e.g, a variety of rotations of a particular image)&nbsp;would be a better test strategy than just repeating the same images so many times.&nbsp;</p>\n<p>A second test image was found to match a train image.</p>\n<p>I updated the scripts and stats in the GitHub repository mentioned above.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 63285,
      "author_name": "wcukierski",
      "author_url": "",
      "post_date": "01/28/2015 19:48:19",
      "content": "<p>[quote=efg2;63284]</p>\n<p>I would have thought minor variations in the&nbsp;test set (e.g, a variety of rotations of a particular image)&nbsp;would be a better test strategy than just repeating the same images so many times.&nbsp;</p>\n<p>[/quote]</p>\n<p>And you would be correct :) There are many other ignored images with many types of linear and nonlinear transformations.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "63126": "",
    "63129": "",
    "63171": "",
    "63191": "",
    "63284": "",
    "63285": ""
  },
  "source": "meta"
}