# A Visual Mining Approach to Improved Multiple-Instance Learning
## 4 Visual Multiple-Instance Learning
### Creating a Multiple-Instance Tree (MILTree)
Figure 5(b) shows the selected training set for the People dataset, where red bags represent the training set and blue bags represent the test dataset. The selected training set is then used to create an initial classifier (in our experiments, an SVM classifier). After applying the model over the validation set, we display the _InstancePrototypes ClassMatch_ tree that highlights, in a contrasting color, the misclassified _training_ bags, whose instance prototypes are likely to be non-representative. Figure 5(c) shows the _InstancePrototypes ClassMatch_ tree for the People dataset, highlighting in red the misclassified points belonging to the training set. We then use the second level projection of MILTree to explore the instance space projection of those bags, aiming to improve the classification model. To improve the MIL classification model, users have two options. The first option is to automatically change the \(B_{\textit{protoClass}}\) of all misclassified training bags identified in the _InstancePrototypes ClassMatch_ tree by replacing it with the alternative instance prototypes \(B_{\textit{iy}}\). The second option, which we show in this case study, is to visually explore the instance space projection of all misclassified bags highlighted in the _InstancePrototypes ClassMatch_ tree and individually choose how to update the instance prototypes. Figure 7 shows the instance space layout of each highlighted bag, here referred to as A, B, C, D, E, F and G. Each instance space layout is a new NJ tree formed by instances that belong to the explored bag. We show the four possible visual steps required to update the prototypes. Note that the first, second and third steps could be executed automatically, but by exploring it manually, the user is allowed to see and control those steps individually. For instance, the bag C required a manual selection of the correct prototype, so a fourth step is added. This allows users to explore and analyze the instances in the instance space layout. Using the example shown in Figure 7, we follow the four steps. The _first step_ presents the initial status: the green and red points represent, respectively, the correct classified and misclassified instances in the training set; the current instance prototypes (\(B_{\textit{ix}}\)) are highlighted with larger circles. In the _second step_, the alternative prototypes \(B_{\textit{iy}}\) selected by MILTree-Med are shown. In our example, it makes no sense to update the prototypes of D, E, F and G because all instances were classified in the same class. However, inside bags A, B and C, two classes are available, so users can then accept the automatic MILTree-Med update by changing the prototype to the one with the correct classification result. In the _third step_, the new instance prototypes of bags A, B and C are shown, but the alternative prototype \(B_{\textit{iy}}\) is still misclassified in C. Due to this, a _fourth step_ can be carried out to manually choose a new instance prototype--in this case, a correctly classified one (green point) that is near the previous prototype. After updating the bags' prototypes detected through the _InstancePrototypes ClassMatch_ tree, we retrain the classification model. An accuracy of 72% was achieved before the update, and by updating only three bags, it was possible to increase it to 75%. In Figure 7(a), we show the classification results using MILTree, and its correspondent _ClassMatch_ tree is shown in Figure 7(b). Note that the _ClassMatch_ tree shows the bags that were misclassified in the whole dataset, including training and validation/test sets, while the _InstancePrototypes ClassMatch_ tree only shows the bags that were misclassified in the training set. This case study demonstrates the positive impact of selecting representative instances on the accuracy of the classifier and that the visual exploration can play an important role by making this task easier.