A computer-implemented method of training a computer system to determine a probability of a data item being associated with a given class of a plurality of classes, wherein the data item is a vector representing an image, the method comprising: receiving training data comprising a plurality of training data items, each training data item being a vector representing an image and labelled under a respective class of the plurality of classes and comprising a plurality of elements arranged in conformity with a structured representation having an associated co-ordinate system, wherein the plurality of elements correspond to pixels in the image and wherein the coordinate system comprises one or more spatial coordinates; determining patches of the training data, each patch comprising a subset of the elements of a respective training data item and being associated with a location within the co-ordinate system of the structured representation; initialising a set of parameters for a variational Gaussian process; and iteratively: processing pairs of the determined patches, using a patch response kernel, to determine patch response data; processing the determined patch response data to determine entries of a covariance matrix; and updating the set of parameters in dependence on the determined entries of the covariance matrix, wherein the patch response kernel takes into account the locations associated with the pair of patches within the co-ordinate system of the structured representation, and wherein the patch response kernel is a product of a patch component and a location component, wherein the patch component takes into account the elements of the pair of patches, and the location component takes into account the locations associated with the pair of patches within the co-ordinate system of the structured representation. receiving training data comprising a plurality of training data items, each training data item being a vector representing an image and labelled under a respective class of the plurality of classes and comprising a plurality of elements arranged in conformity with a structured representation having an associated co-ordinate system, wherein the plurality of elements correspond to pixels in the image and wherein the coordinate system comprises one or more spatial coordinates; determining patches of the training data, each patch comprising a subset of the elements of a respective training data item and being associated with a location within the co-ordinate system of the structured representation; initialising a set of parameters for a variational Gaussian process; and iteratively: processing pairs of the determined patches, using a patch response kernel, to determine patch response data; processing the determined patch response data to determine entries of a covariance matrix; and updating the set of parameters in dependence on the determined entries of the covariance matrix, processing pairs of the determined patches, using a patch response kernel, to determine patch response data; processing the determined patch response data to determine entries of a covariance matrix; and updating the set of parameters in dependence on the determined entries of the covariance matrix, wherein the patch response kernel takes into account the locations associated with the pair of patches within the co-ordinate system of the structured representation, and wherein the patch response kernel is a product of a patch component and a location component, wherein the patch component takes into account the elements of the pair of patches, and the location component takes into account the locations associated with the pair of patches within the co-ordinate system of the structured representation.