A computer-implemented variational autoencoder neural network system, comprising: an input to receive an input image data item consisting of pixel values; an encoder neural network configured to encode the input image data item to determine a set of parameters defining a first, posterior distribution of a set of latent variables; a subsystem to sample from the posterior distribution to determine values of the set of latent variables; a decoder neural network configured to receive the values of the set of latent variables and to generate an output image data item representing the values of the set of latent variables, the output image data item consisting of pixel values for an output image; wherein the variational autoencoder neural network system is configured for training the encoder neural network and the decoder neural network with an objective function which has a first term dependent upon a difference between the input image data item and the output image data item and a second term dependent upon a difference between the posterior distribution and a second, prior distribution of the set of latent variables, and wherein a structure of the prior distribution is different to a structure of the posterior distribution such that the posterior distribution cannot be matched to the prior distribution; wherein the encoder is configured to determine a sequence of sets of parameters defining a sequence of distributions for a sequence of sets of latent variables, one for each of a plurality of time steps, wherein the prior distribution comprises an autoregressive distribution such that at each time step the prior distribution depends on the prior distribution at a previous time step, and wherein the values of the set of latent variables at a time step t, are defined by a sum of α times the values of the set of latent variables at a previous time step and a noise component, where | α | < 1. an input to receive an input image data item consisting of pixel values; an encoder neural network configured to encode the input image data item to determine a set of parameters defining a first, posterior distribution of a set of latent variables; a subsystem to sample from the posterior distribution to determine values of the set of latent variables; a decoder neural network configured to receive the values of the set of latent variables and to generate an output image data item representing the values of the set of latent variables, the output image data item consisting of pixel values for an output image; wherein the variational autoencoder neural network system is configured for training the encoder neural network and the decoder neural network with an objective function which has a first term dependent upon a difference between the input image data item and the output image data item and a second term dependent upon a difference between the posterior distribution and a second, prior distribution of the set of latent variables, and wherein a structure of the prior distribution is different to a structure of the posterior distribution such that the posterior distribution cannot be matched to the prior distribution; wherein the encoder is configured to determine a sequence of sets of parameters defining a sequence of distributions for a sequence of sets of latent variables, one for each of a plurality of time steps, wherein the prior distribution comprises an autoregressive distribution such that at each time step the prior distribution depends on the prior distribution at a previous time step, and wherein the values of the set of latent variables at a time step t, are defined by a sum of α times the values of the set of latent variables at a previous time step and a noise component, where | α | < 1.