A method for improving classification results of a classifier including: receiving, using a processor, classification results for a plurality of elements that have been classified by a classifier as one of a plurality of classes, constructing, using a processor, a graph having a plurality of nodes, each node corresponding to one of the elements, and a plurality of labels, each label corresponding to one of the classes, wherein each element is a pixel in an image and related elements are adjacent pixels in the image, adding, using a processor, edges between nodes corresponding to the related elements, and adding, using a processor, edges between each node and each label, using a graph cut algorithm to cut edges to a node and partition the graph into classes, the graph cut algorithm using as input the classification results for the element corresponding to that node and the related elements, characterised in that: the classifier is a multi-class classifier that has been applied to classify the elements as one of three or more classes, and the classification results include a confidence value for each element, indicating confidence in the classification of that element as each of the three or more classes, and the graph cut algorithm further uses as input the confidence value of the classification for the element corresponding to that node so as to cut edges to a node and partition the graph into the three or more classes. receiving, using a processor, classification results for a plurality of elements that have been classified by a classifier as one of a plurality of classes, constructing, using a processor, a graph having a plurality of nodes, each node corresponding to one of the elements, and a plurality of labels, each label corresponding to one of the classes, wherein each element is a pixel in an image and related elements are adjacent pixels in the image, adding, using a processor, edges between nodes corresponding to the related elements, and adding, using a processor, edges between each node and each label, using a graph cut algorithm to cut edges to a node and partition the graph into classes, the graph cut algorithm using as input the classification results for the element corresponding to that node and the related elements, characterised in that: the classifier is a multi-class classifier that has been applied to classify the elements as one of three or more classes, and the classification results include a confidence value for each element, indicating confidence in the classification of that element as each of the three or more classes, and the graph cut algorithm further uses as input the confidence value of the classification for the element corresponding to that node so as to cut edges to a node and partition the graph into the three or more classes. the classifier is a multi-class classifier that has been applied to classify the elements as one of three or more classes, and the classification results include a confidence value for each element, indicating confidence in the classification of that element as each of the three or more classes, and the graph cut algorithm further uses as input the confidence value of the classification for the element corresponding to that node so as to cut edges to a node and partition the graph into the three or more classes.