{
  "id": 131954,
  "title": "Explanation of \"Similar images might have similar image vectors\"",
  "url": "/competitions/evohackaton/discussion/131954",
  "author_name": "OlDor123",
  "post_date": "2020-02-22T22:35:35.483000",
  "votes": 2,
  "comment_count": 0,
  "views": 0,
  "content": "<h2>Similar images might have similar image vectors</h2>\n\n<p>1) \ntake some pretrained model.\nlet's say it is one of these.\n<a href=\"https://github.com/qubvel/efficientnet\">https://github.com/qubvel/efficientnet</a></p>\n\n<p>2) \ncut out the bottom layer.</p>\n\n<p>3) \nrun <code>predict</code> for your train set.</p>\n\n<p>4) \nyou would get a a bunch of random numbers for each observation.\nit is called an image vector.\nin reality its size is &gt;1000, but let's say its size is 4.</p>\n\n<p>5) \nlet's say we have <code>3 categories, a train set size of 5, a test set of size 2</code>.</p>\n\n<p>after <code>predict</code>, your train data would look like this:\nname,category,vector0,vector1,vector2,vector3\nimage0.jpg, 0, <code>1,1,1,1</code>\nimage1.jpg, 0, <code>1,1,1,0</code>\nimage2.jpg, 1, <code>1,1,2,2</code>\nimage3.jpg, 1, <code>1,1,2,2</code>\nimage4.jpg, 2, <code>0,0,0,0</code></p>\n\n<p>and your test data would look like this:\ntestimage0.jpg, ?, <code>0,1,1,1</code>\ntestimage1.jpg, ?, <code>0,0,1,0</code></p>\n\n<p>6)\nlooking at the vector of <code>testimage0.jpg</code>, what would you say?\nwell, i would say that <code>0,1,1,1</code> is quite similar to <code>1,1,1,1</code> of <code>image0.jpg</code>, which is <code>category0</code>. which means that <code>testimage0.jpg</code> might also belong to <code>category0</code>.</p>\n\n<p>what about <code>testimage1.jpg</code>?\nits vector is <code>0,0,1,0</code>, which looks quite similar to <code>0,0,0,0</code>, which is <code>image4.jpg</code>, which is <code>category2</code>.\nso, <code>test_img1</code> should also be <code>category2</code>.</p>\n\n<p>and so on.</p>\n\n<p>as you can see, there is no training involved. at all.\nhave you tried this idea?</p>",
  "messages": [
    {
      "id": 753988,
      "postDate": "2020-02-22T22:35:35.483Z",
      "content": "<h2>Similar images might have similar image vectors</h2>\n\n<p>1) \ntake some pretrained model.\nlet's say it is one of these.\n<a href=\"https://github.com/qubvel/efficientnet\">https://github.com/qubvel/efficientnet</a></p>\n\n<p>2) \ncut out the bottom layer.</p>\n\n<p>3) \nrun <code>predict</code> for your train set.</p>\n\n<p>4) \nyou would get a a bunch of random numbers for each observation.\nit is called an image vector.\nin reality its size is &gt;1000, but let's say its size is 4.</p>\n\n<p>5) \nlet's say we have <code>3 categories, a train set size of 5, a test set of size 2</code>.</p>\n\n<p>after <code>predict</code>, your train data would look like this:\nname,category,vector0,vector1,vector2,vector3\nimage0.jpg, 0, <code>1,1,1,1</code>\nimage1.jpg, 0, <code>1,1,1,0</code>\nimage2.jpg, 1, <code>1,1,2,2</code>\nimage3.jpg, 1, <code>1,1,2,2</code>\nimage4.jpg, 2, <code>0,0,0,0</code></p>\n\n<p>and your test data would look like this:\ntestimage0.jpg, ?, <code>0,1,1,1</code>\ntestimage1.jpg, ?, <code>0,0,1,0</code></p>\n\n<p>6)\nlooking at the vector of <code>testimage0.jpg</code>, what would you say?\nwell, i would say that <code>0,1,1,1</code> is quite similar to <code>1,1,1,1</code> of <code>image0.jpg</code>, which is <code>category0</code>. which means that <code>testimage0.jpg</code> might also belong to <code>category0</code>.</p>\n\n<p>what about <code>testimage1.jpg</code>?\nits vector is <code>0,0,1,0</code>, which looks quite similar to <code>0,0,0,0</code>, which is <code>image4.jpg</code>, which is <code>category2</code>.\nso, <code>test_img1</code> should also be <code>category2</code>.</p>\n\n<p>and so on.</p>\n\n<p>as you can see, there is no training involved. at all.\nhave you tried this idea?</p>",
      "rawMarkdown": "## Similar images might have similar image vectors\n\n1) \ntake some pretrained model.\nlet's say it is one of these.\nhttps://github.com/qubvel/efficientnet\n\n2) \ncut out the bottom layer.\n\n3) \nrun `predict` for your train set.\n\n4) \nyou would get a a bunch of random numbers for each observation.\nit is called an image vector.\nin reality its size is &gt;1000, but let's say its size is 4.\n\n5) \nlet's say we have `3 categories, a train set size of 5, a test set of size 2`.\n\nafter `predict`, your train data would look like this:\nname,category,vector0,vector1,vector2,vector3\nimage0.jpg, 0, `1,1,1,1`\nimage1.jpg, 0, `1,1,1,0`\nimage2.jpg, 1, `1,1,2,2`\nimage3.jpg, 1, `1,1,2,2`\nimage4.jpg, 2, `0,0,0,0`\n\nand your test data would look like this:\ntestimage0.jpg, ?, `0,1,1,1`\ntestimage1.jpg, ?, `0,0,1,0`\n\n6)\nlooking at the vector of `testimage0.jpg`, what would you say?\nwell, i would say that `0,1,1,1` is quite similar to `1,1,1,1` of `image0.jpg`, which is `category0`. which means that `testimage0.jpg` might also belong to `category0`.\n\nwhat about `testimage1.jpg`?\nits vector is `0,0,1,0`, which looks quite similar to `0,0,0,0`, which is `image4.jpg`, which is `category2`.\nso, `test_img1` should also be `category2`.\n\nand so on.\n\nas you can see, there is no training involved. at all.\nhave you tried this idea?",
      "votes": 2
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "753988": "## Similar images might have similar image vectors\n\n1) \ntake some pretrained model.\nlet's say it is one of these.\nhttps://github.com/qubvel/efficientnet\n\n2) \ncut out the bottom layer.\n\n3) \nrun `predict` for your train set.\n\n4) \nyou would get a a bunch of random numbers for each observation.\nit is called an image vector.\nin reality its size is &gt;1000, but let's say its size is 4.\n\n5) \nlet's say we have `3 categories, a train set size of 5, a test set of size 2`.\n\nafter `predict`, your train data would look like this:\nname,category,vector0,vector1,vector2,vector3\nimage0.jpg, 0, `1,1,1,1`\nimage1.jpg, 0, `1,1,1,0`\nimage2.jpg, 1, `1,1,2,2`\nimage3.jpg, 1, `1,1,2,2`\nimage4.jpg, 2, `0,0,0,0`\n\nand your test data would look like this:\ntestimage0.jpg, ?, `0,1,1,1`\ntestimage1.jpg, ?, `0,0,1,0`\n\n6)\nlooking at the vector of `testimage0.jpg`, what would you say?\nwell, i would say that `0,1,1,1` is quite similar to `1,1,1,1` of `image0.jpg`, which is `category0`. which means that `testimage0.jpg` might also belong to `category0`.\n\nwhat about `testimage1.jpg`?\nits vector is `0,0,1,0`, which looks quite similar to `0,0,0,0`, which is `image4.jpg`, which is `category2`.\nso, `test_img1` should also be `category2`.\n\nand so on.\n\nas you can see, there is no training involved. at all.\nhave you tried this idea?"
  }
}