This is the source code package of the algorithm described in the paper Mid-level Deep Pattern Mining which has been accepted by CVPR 2015. More details are provided on the project page. This package has been tested using Matlab 2014a on a 64-bit Linux machine. This code is for research purposes only.
If you find MDPM useful in your research, please consider citing:
@inproceedings{LiLSH15CVPR,
author = {Yao Li and Lingqiao Liu and Chunhua Shen and Anton van den Hengel},
title = {Mid-level Deep Pattern Mining},
booktitle = {Computer Vision and Pattern Recognition},
year = {2015}
}
- Prerequisites
- Caffe: install Caffe by following its installation instructions.
Do not forget to run
make matcaffe
to compile Caffe's Matlab interface. You also need to download Caffe's reference model (rundownload_model_binary.py models/bvlc_reference_caffenet
fromscripts
) and the ImageNet mean file (runget_ilsvrc_aux.sh
fromdata/ilsvrc12
). Note: As we only use Caffe CNN as a feature extractor, installing Caffe using the CPU mode is OK. - Apriori algorithm: we use this implementation. Click the link to download this package. You need
to uncompress it and run
make
to compile it in theapriori/apriori/src
. Detailed usage of this package can be found here. - Liblinear: download liblinear and compile it by following its instructions.
- KSVDS-Box v11: as we use the
im2colstep
function in this toolbox, you need to download and compile it (im2colstep
is found inksvdsbox11/private
). - Configuring MDPM
- Download MDPM:
git clone https://github.com/yaoliUoA/MDPM
. - Download MIT Indoor dataset from here.
- Open
init.m
in the Matlab. Change values of sereval variables based on your configuration, includingconf.pathToLiblinear
,conf.pathToCaffe
,conf.dataset
andconf.imgDir
based on your local configuration. - Copy the executable file
aprior
under directoryapriori/apriori/src
and paste it undermining
directory. - Copy the mex file
im2colstep
and paste it undercnn
directory. - Runing MDPM
- Run the
demo.m
. It should be working properly if you have followed aforementioned instructions. - Important: It may takes some time to get the final classification result, so it is suggested to run MDPM on a cluster
where jobs can be run in parallel. The
*.sh
scripts are provided to submit jobs on a cluster.
For MIT Indoor dataset, we have provided some pre-computed models
0. Pre-trained element detectors. After uncompressing the downloaded file,
copy the .mat
files to data/MIT67/detCom_lda_128_32_150
directory (create it by yourself), you should be able to run the feaEncodingMultiscaleSPM_lda.m
from encoding
to generate image features if cnn features have already been extracted.
0. Pre-computed image features.
After uncompressing the downloaded file, copy the .mat
files to data/MIT67/feaFinal_128_32_150
directory (create it by yourself), you should be able to run classify.m
from classify
directly to reproduce the classification result in the paper.
If you have any issues (question, feedback) or find bugs in the code, please contact yao.li01@adelaide.edu.au.