A computer implemented method for learning a function configured for captioning a region of an image, the method comprising: - providing a dataset of triplets each including a respective image, a respective region of the respective image, and a respective caption of the respective region; and - learning, with the dataset of triplets, a function that is configured to generate an output caption based on an input image and on an input region of the input image, wherein the function includes: ▪ a first component, the first component being configured to determine a signature of a combination of the input image and of the input region, and ▪ a second component, the second component being configured to generate the output caption based on the signature of the combination, wherein the second component is configured to generate the output caption further based on a word embedding space, wherein the second component comprises a first recurrent neural network, a second recurrent neural network and a word embedding layer and: ▪ the first recurrent neural network is configured to recurrently generate a respective output word embedding vector based on a respective input word embedding vector, the input word embedding vector respective to the first recurrent neural network being the output of the compound of the second recurrent neural network and the word embedding layer, ▪ the second recurrent neural network is configured to recurrently generate a respective output word embedding vector based on a respective input word embedding vector and on the signature of the combination, the input word embedding vector respective to the second recurrent neural network being the output of the first recurrent neural network, and ▪ the word embedding layer is configured to generate a respective output word embedding vector based on a respective input word embedding vector, the generated word embedding vector respective to the word embedding layer being the word embedding vector corresponding to a word of a vocabulary represented in the word embedding space which is the word with highest probability. - providing a dataset of triplets each including a respective image, a respective region of the respective image, and a respective caption of the respective region; and - learning, with the dataset of triplets, a function that is configured to generate an output caption based on an input image and on an input region of the input image, ▪ a first component, the first component being configured to determine a signature of a combination of the input image and of the input region, and ▪ a second component, the second component being configured to generate the output caption based on the signature of the combination, ▪ the first recurrent neural network is configured to recurrently generate a respective output word embedding vector based on a respective input word embedding vector, the input word embedding vector respective to the first recurrent neural network being the output of the compound of the second recurrent neural network and the word embedding layer, ▪ the second recurrent neural network is configured to recurrently generate a respective output word embedding vector based on a respective input word embedding vector and on the signature of the combination, the input word embedding vector respective to the second recurrent neural network being the output of the first recurrent neural network, and ▪ the word embedding layer is configured to generate a respective output word embedding vector based on a respective input word embedding vector, the generated word embedding vector respective to the word embedding layer being the word embedding vector corresponding to a word of a vocabulary represented in the word embedding space which is the word with highest probability.