Home

Awesome

Unsupervised Visual Representation Learning by Graph-based Consistent Constraints (ECCV 2016)

This is the research code for the paper:

Dong Li, Wei-Chih Hung, Jia-Bin Huang, Shengjin Wang, Narendra Ahuja, and Ming-Hsuan Yang. "Unsupervised Visual Representation Learning by Graph-based Consistent Constraints" In Proceedings of European Conference on Computer Vision (ECCV), 2016

We take the CIFAR10 dataset as an example to test our unsupervised constraint mining approach in this code. Our mined constraints and trained model on ImageNet in the unsupervised manner can be found here:

ImageNet_unsup.zip

Project page

Citation

If you find the code and pre-trained models useful in your research, please consider citing:

@inproceedings{Li-ECCV-2016,
    author = {Li, Dong and Hung, Wei-Chih and Huang, Jia-Bin and Wang, Shengjin and Ahuja, Narendra and Yang, Ming-Hsuan},
    title = {Unsupervised Visual Representation Learning by Graph-based Consistent Constraints},
    booktitle = {European Conference on Computer Vision},
    year = {2016},
    volume = {},
    number = {},
    pages = {}
}

System Requirements

Installation

  1. Download and unzip the project code. Unzip features.zip which is used to extract Fisher Vectors.

  2. Download the VLFeat library and extract all the files into the directory named vlfeat. Download the LIBLINEAR library and extract all the files into the directory named liblinear. Install the two dependencies.

  3. Install Caffe. Please follow the Caffe installation instructions to install dependencies and then compile Caffe:

    # We call the root directory of the project code `FL_ROOT`.
    cd $FL_ROOT/caffe
    make all -j8
    make pycaffe
    make matcaffe
    
  4. Download the CIFAR10 dataset. Extract all the files into $FL_ROOT/datasets/CIFAR10.

  5. Download the pre-trained ImageNet model and put it into $FL_ROOT/models.

  6. Install the project.

    cd $FL_ROOT
    # Start MATLAB
    matlab
    >> startup
    

Usage

  1. Extract low-level features (Fisher Vectors).

    >> prepare_data
    >> extract_features
    

    Note:

    1. You may set different params to extract FV features for different datasets, e.g., totalFeatLimit and numImg in compute_dense.m.
    2. We resize the image to 256*256 to extract FV features (L32 of compute_dense.m in feature.zip).
    3. It takes a few days to extract features for the ImageNet 1M images with parallelization.
  2. Mine constraints.

    >> extract_pairs_pos
    >> extract_pairs_neg
    
  3. Train the Siamese network for binary classification.

    >> prepare_train
    cd $FL_ROOT
    sh train.sh
    
  4. Test for image classification.

    >> test_cifar