Image classifier exampleThis example shows how to build a two-class Bayes point machine and apply it to an image classification problem. (A general purpose multi-class Bayes point machine is described elsewhere). The Bayes point machine is general and could be used in many different applications - that code is described in detail later. First we discuss the application. When you run the application, the first thing you see is a window containing around 3 dozen images, and along the top of the window, a green area and a red area to drag the images. The user drags one or more images to the good or bad areas - each time this happens, you are creating a good (green) or bad (red) label for the particular image. These labelled images serve as examples, and the application learns from these examples and provides an assessment of the goodness or badness of all the unlabelled images. How far to the left or right an unlabelled image appears is a measure of the degree to which the classifier thinks it is good or bad.Here is example where three example images have been dragged to the green area, and three to the red area. Each time an image is dragged, the model is updated, and the unlabelled images shift around. ![]() Here, the left-hand images tend to be faces, animals and grass, and the right hand side is concentrating on roundness, water, and buildings. The overall colour in the image is encoded in the features and will also have an effect on the classification. The features that are used to represent the images are described in the next section. Files in ImageClassifier2008.slnThis sample code is installed with Infer.NET, and can be found in the \Infer.NET 2.X\Example Solutions\ImageClassifier folder in your personal Documents folder. The example comes as a VisualStudio 2008 solution; 2008 is needed only the user interface code - the Bayes Point Machine code can be used in a VisualStudio 2005 solution. The code files are in the ImageClassifier subfolder, and are as follows:
There are also several data files which are contained in the Images subfolder. These are:
|



