# Improving Multi-Instance Multi-Label Learning by Extreme Learning Machine
## 3 The Proposed Approach MIMLELM
### Transformation from MIML to SIML  
With the number of clusters computed, we start to transform the MIML learning task, _i.e._, learning a function \(f_{MIML}\): \(2^{X}\)\(\rightarrow\)\(2^{Y}\), to a multi-label learning task, _i.e._, learning a function \(f_{MLL}\): \(Z\)\(\rightarrow\)\(2^{Y}\).  
Given an MIML training example, the goal of this step is to get a mapping function \(z_{i}=\phi(X_{i})\), where \(\phi\): \(2^{x}\)\(\rightarrow\)\(Z\), such that for any \(z_{i}\)\(\in\)\(Z\), \(f_{MLL}(z_{i})=f_{MIML}(X_{i})\) if \(z_{i}=\phi(X_{i})\). As such, the proper labels of a new example \(X_{k}\) can be determined according to \(Y_{k}=f_{MLL}(\phi(X_{k}))\). Since the proper number of clusters has been automatically determined in Section 3.1, we implement the mapping function \(\phi()\) by performing the following \(k\)-medoids clustering process.  
Initially, each MIML example \((X_{u},Y_{u})\)\((u=1,2,\ldots,m)\) is collected and put into a dataset \(\Gamma\left(\text{Line 1}\right)\). Then, a \(k\)-medoids clustering method is performed. In this process, we first randomly select \(k\) elements from \(\Gamma\) to initialize the \(k\) medoids \(M_{t}\left(t=1,2,\ldots,k\right)\). _Note_: instead of a user-specified parameter, \(k\) is an automatically-determined value by Equation (6) in Section 3.1. Since each data item in \(\Gamma\), _i.e._, \(X_{u}\), is an unlabeled multi-instance bag instead of a single instance, we employ the Hausdorff distance [40] to measure the distance between two different multi-instance bags. The Hausdorff distance is a famous metric for measuring the distance between two bags of points, which has often been used in computer vision tasks. In detail, given two bags \(A=\{a_{1},a_{2},\ldots,a_{n_{A}}\}\) and \(B=\{b_{1},b_{2},\ldots,b_{n_{B}}\}\), the Hausdorff distance \(dH\) between \(A\) and \(B\) is defined as:  
\[d_{H}(A,B)=\max\{\max_{a\in A}\min_{b\in B}||a-b||,\max_{b\in B}\min_{a\in A}|| b-a||\} \tag{6}\]  
where \(||a-b||\) is used to measure the distance between the instances \(a\) and \(b\), which takes the form of the Euclidean distance; \(\max\limits_{a\in A}\min\limits_{b\in B}||a-b||\) and \(\max\limits_{b\in B}\min\limits_{a\in A}||b-a||\) denote the maximized minimum distance of every instance in \(A\) and all instances in \(B\) and the maximized minimum distance of every instance in \(B\) and all instances in \(A\), respectively. The Hausdorff distance-based \(k\)-medoids clustering method divides the dataset \(\Gamma\) into \(k\) partitions, the medoids of which are \(M_{1}\), \(M_{2}\), \(\ldots\), \(M_{k}\), respectively. With the help of these medoids, every original multi-instance example \(X_{u}\) can be transformed into a \(k\)-dimensional numerical vector \(z_{u}\), where the \(i\)-th \((i=1,2,\ldots,k)\) component of \(z_{u}\) is the Hausdorff distance between \(X_{u}\) and \(M_{i}\), _i.e._, \(d_{H}(X_{u},M_{i})\). In this way, every MIML example \((X_{u},Y_{u})\)\((u=1,2,\ldots,m)\) is transformed into an MIML example \((z_{u},Y_{u})\)\((u=1,2,\ldots,m)\) by replacing itself with its structure information, _i.e._, the relationship of \(X_{u}\) and the \(k\) medoids. Figure 2 is an illustration of this transformation, where the dataset \(\Gamma\) is divided into three clusters, and thus, any MIML example \(X_{u}\) is represented as a three-dimensional numerical vector \(z_{u}=(d_{1},d_{2},d_{3})\).  
After this process, we obtain the mapping function \(z_{i}=\phi(X_{i})\) such that for any \(z_{i}\in\)Z, \(f_{MLL}(z_{i})=f_{MIML}(X_{i})\) if \(z_{i}=\phi(X_{i})\).