{
  "id": 12616,
  "title": "graph theory as an image feature",
  "url": "/competitions/datasciencebowl/discussion/12616",
  "author_name": "",
  "post_date": "2015-02-26T10:53:38.097Z",
  "votes": -5,
  "comment_count": 2,
  "views": 842,
  "content": "<p>I am not in this competition yet (and I'm afraid I won't), so I would like to share my idea of such an image processing technique - or just a feature.</p>\n<p>Looking at these images one can realize, that these animals are just like graphs, and has some very interesting features in it. For example a round with 4 &quot;roads&quot; into it. I'm wondering about a solution that could standardize these pictures:</p>\n<p>1. adjacency matrix (based on the edges of images as the vertex&nbsp;of the graph, and the neighbourhood as the edge of the graph) and&nbsp;computing the features, like number of triangles, etc.</p>\n<p>2.&nbsp;edge distribution in categories</p>\n<p>3.&nbsp;Canonical form of the graph to simply check the similarity</p>\n\n<p>There are some other graph similarity projects, which may also help in categorization.&nbsp;</p>\n\n<p>You know I hope&nbsp;that understanding the problem sometimes gives a stronger solution than a simple brute force :) So please someone try this out for me, because I won't have time for it, but I'm keen to know the effectiveness. So a response about the improvement would be nice too :D</p>\n<p>some useful links:</p>\n<p>http://politespider.com/papers/general/Graph%20similarity%20algorithms.pdf<br>https://www.cs.cmu.edu/~jingx/docs/DBreport.pdf<br>https://wadsashika.wordpress.com/2014/09/19/measuring-graph-similarity-using-neighbor-matching/<br>http://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=2761&amp;context=cstech<br>http://i11www.iti.uni-karlsruhe.de/_media/projects/spp1126/files/bl-ssg-04.pdf</p>",
  "messages": [
    {
      "id": "64927",
      "postDate": "02/26/2015 10:53:38",
      "content": "<p>I am not in this competition yet (and I'm afraid I won't), so I would like to share my idea of such an image processing technique - or just a feature.</p>\n<p>Looking at these images one can realize, that these animals are just like graphs, and has some very interesting features in it. For example a round with 4 &quot;roads&quot; into it. I'm wondering about a solution that could standardize these pictures:</p>\n<p>1. adjacency matrix (based on the edges of images as the vertex&nbsp;of the graph, and the neighbourhood as the edge of the graph) and&nbsp;computing the features, like number of triangles, etc.</p>\n<p>2.&nbsp;edge distribution in categories</p>\n<p>3.&nbsp;Canonical form of the graph to simply check the similarity</p>\n\n<p>There are some other graph similarity projects, which may also help in categorization.&nbsp;</p>\n\n<p>You know I hope&nbsp;that understanding the problem sometimes gives a stronger solution than a simple brute force :) So please someone try this out for me, because I won't have time for it, but I'm keen to know the effectiveness. So a response about the improvement would be nice too :D</p>\n<p>some useful links:</p>\n<p>http://politespider.com/papers/general/Graph%20similarity%20algorithms.pdf<br>https://www.cs.cmu.edu/~jingx/docs/DBreport.pdf<br>https://wadsashika.wordpress.com/2014/09/19/measuring-graph-similarity-using-neighbor-matching/<br>http://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=2761&amp;context=cstech<br>http://i11www.iti.uni-karlsruhe.de/_media/projects/spp1126/files/bl-ssg-04.pdf</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64934",
      "postDate": "02/26/2015 11:25:51",
      "content": "<p>&gt;So please someone try this out for me, because I won't have time for it, but I'm keen to know the effectiveness.</p>\n<p><br>If you provide some implementation ) And to check effectiveness you don`t need to get results until deadline $)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64959",
      "postDate": "02/26/2015 16:46:25",
      "content": "<p>alright, it seems that the community don't like theoritical questions, so here is a (bit mistaken, but more-or-less correct) implementation of the graph (it works on the solution of https://www.kaggle.com/c/datasciencebowl/details/tutorial):</p>\n\n<p>import networkx as nx<br>G=nx.Graph()<br>i = 1<br>for y in range(0, im[1].size-2):<br> for x in range(0, im.size/im[1].size-2):<br> if labels[x, y] == 3:<br> G.add_node(x*(y+1) + (y+1))<br> i = i+1<br> if labels[x, y-1] == 3:<br> G.add_edge(x*(y+1) + (y+1),x*y + y)<br> if labels[x-1, y] == 3:<br> G.add_edge(x*(y+1) + (y+1),(x-1)*(y+1) + (y+1))<br> if labels[x-1, y-1] == 3:<br> G.add_edge(x*(y+1) + (y+1),(x-1)*y + y)<br> if labels[x, y+1] == 3:<br> G.add_edge(x*(y+1) + (y+1),(x+1)*y + y)</p>\n<p>G=nx.Graph(G)</p>\n\n<p>G has a degree histogram (nx.degree_histogram(G)) of :</p>\n<p>[0,<br> 212,<br> 247,<br> 167,<br> 41,<br> 197,<br> 236,<br> 243,<br> 1556,<br> 47,<br> 19,<br> 19,<br> 4,<br> 25,<br> 33,<br> 19,<br> 51,<br> 2,<br> 3,<br> 2,<br> 0,<br> 1,<br> 3,<br> 1,<br> 1,<br> 0,<br> 0,<br> 0,<br> 0,<br> 1]</p>\n<p>which shows, that I started Python today, but also that it works almost well (the maximum would be 8 in theory).</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 64934,
      "author_name": "oldufo",
      "author_url": "",
      "post_date": "02/26/2015 11:25:51",
      "content": "<p>&gt;So please someone try this out for me, because I won't have time for it, but I'm keen to know the effectiveness.</p>\n<p><br>If you provide some implementation ) And to check effectiveness you don`t need to get results until deadline $)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64959,
      "author_name": "guyko81",
      "author_url": "",
      "post_date": "02/26/2015 16:46:25",
      "content": "<p>alright, it seems that the community don't like theoritical questions, so here is a (bit mistaken, but more-or-less correct) implementation of the graph (it works on the solution of https://www.kaggle.com/c/datasciencebowl/details/tutorial):</p>\n\n<p>import networkx as nx<br>G=nx.Graph()<br>i = 1<br>for y in range(0, im[1].size-2):<br> for x in range(0, im.size/im[1].size-2):<br> if labels[x, y] == 3:<br> G.add_node(x*(y+1) + (y+1))<br> i = i+1<br> if labels[x, y-1] == 3:<br> G.add_edge(x*(y+1) + (y+1),x*y + y)<br> if labels[x-1, y] == 3:<br> G.add_edge(x*(y+1) + (y+1),(x-1)*(y+1) + (y+1))<br> if labels[x-1, y-1] == 3:<br> G.add_edge(x*(y+1) + (y+1),(x-1)*y + y)<br> if labels[x, y+1] == 3:<br> G.add_edge(x*(y+1) + (y+1),(x+1)*y + y)</p>\n<p>G=nx.Graph(G)</p>\n\n<p>G has a degree histogram (nx.degree_histogram(G)) of :</p>\n<p>[0,<br> 212,<br> 247,<br> 167,<br> 41,<br> 197,<br> 236,<br> 243,<br> 1556,<br> 47,<br> 19,<br> 19,<br> 4,<br> 25,<br> 33,<br> 19,<br> 51,<br> 2,<br> 3,<br> 2,<br> 0,<br> 1,<br> 3,<br> 1,<br> 1,<br> 0,<br> 0,<br> 0,<br> 0,<br> 1]</p>\n<p>which shows, that I started Python today, but also that it works almost well (the maximum would be 8 in theory).</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "64927": "",
    "64934": "",
    "64959": ""
  },
  "source": "meta"
}