danielegrattarola / spektral

Graph Neural Networks with Keras and Tensorflow 2.
https://graphneural.network
MIT License
2.36k stars 334 forks source link

Converting large images are graphs for classification tasks #349

Open INF800 opened 2 years ago

INF800 commented 2 years ago

I have large high-res images (4000x4000px). And the ML problem at hand is image classification. 50 percent of important features present in the image are as small as 30x30px.

  1. How to convert these images (grayscale or RGB) into graph format supported by spektral like in MNIST.
  2. Will we have any advantages of features representation using GNNs because with CNN we usually resize the image causing loss in information.
danielegrattarola commented 2 years ago

You can have a look at the code here to generate a similar dataset to MNIST.

However, note that a GNN is unlikely to perform as well as a CNN on image data, while also being significantly more expensive to train.