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:
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
- MATLAB (tested with R2014a on 64-bit Linux)
- Caffe
Installation
-
Download and unzip the project code. Unzip
features.zip
which is used to extract Fisher Vectors. -
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 namedliblinear
. Install the two dependencies. -
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
-
Download the CIFAR10 dataset. Extract all the files into
$FL_ROOT/datasets/CIFAR10
. -
Download the pre-trained ImageNet model and put it into
$FL_ROOT/models
. -
Install the project.
cd $FL_ROOT # Start MATLAB matlab >> startup
Usage
-
Extract low-level features (Fisher Vectors).
>> prepare_data >> extract_features
Note:
- You may set different params to extract FV features for different datasets, e.g., totalFeatLimit and numImg in compute_dense.m.
- We resize the image to 256*256 to extract FV features (L32 of compute_dense.m in feature.zip).
- It takes a few days to extract features for the ImageNet 1M images with parallelization.
-
Mine constraints.
>> extract_pairs_pos >> extract_pairs_neg
-
Train the Siamese network for binary classification.
>> prepare_train cd $FL_ROOT sh train.sh
-
Test for image classification.
>> test_cifar