Answers.Body: <p>Applying GNNs to images can be realized in different ways. If you <em>only</em> substitute a visual ConvNet by a GNN, then the pixel values would be the same as what goes into a ConvNet. The only difference will be the input format. Whereas a ConvNet gets inputs of shape <code>[batch, height, width, channels]</code>, a GNN would receive a list of pixels <code>[batch, n_pixels, channels]</code> together with an adjacency list that contains the structural information (Each pixel may have 8 neighbors and a selfloop except for the pixels at the boarders).</p>
  <p>So basically the features doesn't change, what changes is the format of the data. For a clean library of GNNs you can checkout <a href="https://www.dgl.ai/" rel="nofollow noreferrer">DeepGraphLibrary</a>, they have tutorials on how to use their library. If you want to see a simplified standalone implementation, you can checkout <a href="https://github.com/tkipf/pygcn/blob/1600b5b748b3976413d1e307540ccc62605b4d6d/pygcn/layers.py" rel="nofollow noreferrer">this code</a>. His repository also contains more nice implementations.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-24T10:45:09.487Z
Answers.LastActivityDate: 2022-03-24T11:17:20.483Z
Answers.LastEditDate: 2022-03-24T11:17:20.483Z
Answers.UserDisplayName: Chillston
Body: <p>What kind of features does each node have as an input graph to a graph neural network? For example, we want to do image classification with GNN, what are the features of each pixel? Or if anyone could send me a link to implementing GNN on an example I would greatly appreciate it.</p>
  
Tags: <classification><geometric-deep-learning><graph-neural-networks><features><graphs>
Title: What kind of features does each node have as an input graph to a graph neural network?
UserDisplayName: selin
ThreadText: # What kind of features does each node have as an input graph to a graph neural network?
  
  (Asked by: username_0 on 2022-03-24)
  
  What kind of features does each node have as an input graph to a graph neural network? For example, we want to do image classification with GNN, what are the features of each pixel? Or if anyone could send me a link to implementing GNN on an example I would greatly appreciate it.
  
  **Tags:** classification, geometric-deep-learning, graph-neural-networks, features, graphs
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-03-24. Score: 1
  
  Applying GNNs to images can be realized in different ways. If you *only* substitute a visual ConvNet by a GNN, then the pixel values would be the same as what goes into a ConvNet. The only difference will be the input format. Whereas a ConvNet gets inputs of shape `[batch, height, width, channels]`, a GNN would receive a list of pixels `[batch, n_pixels, channels]` together with an adjacency list that contains the structural information (Each pixel may have 8 neighbors and a selfloop except for the pixels at the boarders).
  
  So basically the features doesn't change, what changes is the format of the data. For a clean library of GNNs you can checkout [DeepGraphLibrary](https://www.dgl.ai/), they have tutorials on how to use their library. If you want to see a simplified standalone implementation, you can checkout [this code](https://github.com/tkipf/pygcn/blob/1600b5b748b3976413d1e307540ccc62605b4d6d/pygcn/layers.py). His repository also contains more nice implementations.
  
  
  ---
  
  