A method of training a generative adversarial network for performing semantic segmentation of images, wherein the generative adversarial network comprises: a generator neural network; and a second neural network, the method comprising: using the generator neural network to generate predicted image segmentation maps from input images, wherein each predicted image segmentation map comprises a classification prediction for each of a plurality of pixels of a respective input image; providing one or more predicted image segmentation maps generated by the generator neural network to the second neural network; characterized in that the second neural network is a critic neural network, and that the method further comprises: training the critic neural network to determine a betting map comprising weights for respective pixels of a predicted image segmentation map generated by the generator neural network, wherein the sum of all the weights is limited to a threshold amount, and wherein the weight for each pixel is used, in the training of the critic neural network, to weight a pixel-wise cross entropy term in an objective function for the critic neural network; and using the weights of the betting map determined by the critic neural network to train the generator neural network. a generator neural network; and a second neural network, the method comprising: using the generator neural network to generate predicted image segmentation maps from input images, wherein each predicted image segmentation map comprises a classification prediction for each of a plurality of pixels of a respective input image; providing one or more predicted image segmentation maps generated by the generator neural network to the second neural network; using the generator neural network to generate predicted image segmentation maps from input images, wherein each predicted image segmentation map comprises a classification prediction for each of a plurality of pixels of a respective input image; providing one or more predicted image segmentation maps generated by the generator neural network to the second neural network; characterized in that the second neural network is a critic neural network, and that the method further comprises: training the critic neural network to determine a betting map comprising weights for respective pixels of a predicted image segmentation map generated by the generator neural network, wherein the sum of all the weights is limited to a threshold amount, and wherein the weight for each pixel is used, in the training of the critic neural network, to weight a pixel-wise cross entropy term in an objective function for the critic neural network; and using the weights of the betting map determined by the critic neural network to train the generator neural network. training the critic neural network to determine a betting map comprising weights for respective pixels of a predicted image segmentation map generated by the generator neural network, wherein the sum of all the weights is limited to a threshold amount, and wherein the weight for each pixel is used, in the training of the critic neural network, to weight a pixel-wise cross entropy term in an objective function for the critic neural network; and using the weights of the betting map determined by the critic neural network to train the generator neural network.