Combined convolutional and recurrent neural networks for hierarchical classification of images