In a method and apparatus for training a computer system for use in classification of an image by processing image data representing the image, image data are compressed and then loaded into a programmable quantum annealing device that includes a Restricted Boltzmann Machine. The Restricted Boltzmann Machine is trained to act as a classifier of image data, thereby providing a trained Restricted Boltzmann Machine; and, the trained Restricted Boltzmann Machine is used to initialize a neural network for image classification thereby providing a trained computer system for use in classification of an image.