This is the MIForest package, implementing the Multiple Instance Learning Algorithm with Random Forests as proposed in [1]. Note that this is a reimplementation of the original package used in [1] for off-line binary machine learning. On you will also find on-line random forest learning code.


Version 1.0: MIForest-1.0.tar.gz


We provide both a common Makefile as well as a CMakeLists file for cmake. For usage of cmake, simply create a binary folder, go to the folder and type: cmake <path to CMakeLists.txt>. If everything works fine, cmake should have created a valid Makefile for you. Be sure to have installed libeigen2 and libconfig++. If you want to use multithreading, install openmp (should be fixed part of most linux distributions) and uncomment -fopenmp in CMakeLists.txt.


Simply start the compiled binary and add the path to the config file

./MIForest ../config.conf

Config file:

All the settings for the classifier are passed via the config file. You can find the config file in “conf” folder. It is
easy to see what are the meanings behind each of these settings:

* data_file = path to the training data (features)
* sample_labels = path to the training labels
* bag_sample_indices = points to the corresponding bag for each index
* bag_labels = path to the bag labels
* train_bag_indices = indicates the bags used for training
* test_bag_indices = indicates the bags used for testing

* debugging_on = 1 // prints some debug messages

For the rest see the reference config file and the comments therein.

Data format:

The data formats used is a simple ASCII format. Data is a represented as a matrix (vectors are matrices with 1
column). The first line in data file indicates the datatype, i.e., either int or double. In the second line, matrix rows and columns, respectively, are indicated. The third number indicates the number of classes.


[1] Christian Leistner, Amir Saffari, and Horst Bischof,
MIForests: Multiple Instance Learning with Randomized Trees“, in the 11th European Conference on Computer Vision, 2010.


Christian Leistner: leisti “-a-t-”

Amir Saffari

5 thoughts on “MILForests

  1. Hi Amir,

    Any luck at looking at your source code implementation yet for MILForest? I am very interested. Great job BTW. Thanks


  2. I successfully compiled the package on my Ubuntu 10.04 but I’m getting a segmentation fault while running “./MIForest ../config.conf”. Here is the output of the program:

    ################### MILForest ##################

    ========== Application parameters ==========
    Configuration file loaded …
    Application settings loaded
    Dataset configuration loaded …
    Random forest configuration loaded …
    Determinstic annealing configuration loaded …

    ========== Dataset ==========
    Data file: ../data/
    Trainset has 180 bags and 1255 samples
    Testset has 20 bags and 136 samples

    ========== Training & Testing ==========
    Create the MILForest with 230 features per sample and 2 classes

    Train a MIL forest EXACT …
    Train the initial random forest with 1255 samples
    Current temperature = 5
    Segmentation fault

  3. Would be great if you can update the package and replace the math and random functions with boost.math template library..
    this will make it very portable.

Leave a Reply