1. A method for representing an input image, the method comprising the following procedures: applying a trained neural network on said input image; selecting a plurality of feature maps of an output of at least one selected layer of said trained neural network according to values attributed to said plurality of feature maps by said trained neural network; for each of said plurality of feature maps, determining a location corresponding thereto in an image space of said input image; defining a plurality of interest points of said input image, based on said locations corresponding to said plurality of feature maps; and representing said input image as a graph according to said plurality of interest points and according to geometric relations between interest points of said plurality of interest points; employing said graph for performing said visual task; wherein said graph comprises a plurality of vertices and edges; and wherein said graph maintains data respective of said geometric relations between said interest points.