• Stars
    star
    631
  • Rank 71,222 (Top 2 %)
  • Language
    MATLAB
  • Created almost 10 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🌅The code of post "Image retrieval using MatconvNet and pre-trained imageNet"

CNN for Image Retrieval

License

博文:Image retrieval using MatconvNet and pre-trained imageNet,对应web演示主页picSearch

2017/10/08: 构建CBIR检索对比框架cnn-cbir-benchmark,包括Fisher Vector, VLAD, FC, RMAC, CROW.

2017/08/15更新:增加Python版本,Caffe版本Keras版本

2015/12/31更新:添加对MatConvNet最新版version 1.0-beta17的支持,预训练的模型请到Matconvnet官网下载最新的模型。

2015/12/31更新:添加对MatConvNet最新版version 1.0-beta17的支持,预训练的模型请到Matconvnet官网下载最新的模型。

2015/10/20更新:Web演示部分代码公开CNN-Web-Demo-for-Image-Retrieval

2015/09/24更新:添加对MatConvNet最新版version 1.0-beta14的支持。

2015/12/31更新:添加对MatConvNet最新版version 1.0-beta17的支持,删掉原来的版本(预训练的模型请到matconvnet官网下载最新的模型)。

2015/06/29更新:添加对MatConvNet最新版version 1.0-beta12的支持。

注意:其中文件夹matconvnet-1.0-beta17是已经编译好了的,鉴于MatConvNet只能在Matlab 2014及其以上以及系统必须是64位,所以在使用此工具箱之前得满足这两个条件。如果是Pythoner,推荐使用flask-keras-cnn-image-retrieval,纯Python,非常易于写成在线图像搜索应用。

Caltech-256图像数据库上搜索结果

search result

运行步骤

1). 如果不需要计算mAP的话,那就直接把你的图像库文件夹名字命名为database,并将图片全部放在放在database文件夹下即可。如果你要在后面计算MAP(平均检索精度)的话,要确保图像数据库做成文件夹databaseClassified中的形式,然后执行下面命令:

python movefiles.py

2). 接着便可以抽取特征。运行extractCNN.m,要用parfor并行的话,直接修改注释部分即可。

3). 检索可视化。这一步运行queryInDatabaseDemo.m即可。

4). 计算mAP。不需要计算MAP的这步略过。运行compute_MAP.m,关于mAP的计算,请参阅我画的mAP计算过程示意图:信息检索评价指标,这个计算mAP的脚本是按照那个流程中定义的mAP计算方式来写的。

降维

非常的amazing, 除了验证降维到128D后损失不减外,惊奇地发现4096D的CNN降维到128D后精度还有提高,一种可能的解释:CNN特征也有一定的信息冗余,信息冗余所带来的影响比降维所带来的损失的影响要更大。结论:You should reduce the dimension of CNN when you use if.

PCA降维对CNN特征的影响

search result

上面实验使用的是本项目代码,图像数据集使用的是Caltech101。

关于PCA对PCA降维的影响,Neural Codes for Image Retrieval中也有探讨,以及曾跟Adrian Rosebrock也有过这方面的交流:

ANN is really fantastic, it makes such much easier. You could also try something like PCA on your 4096-d vector and try to get it down to 128-d. It would save some space and (ideally) not hurt accuracy.

所以,如果采用了CNN特征的话,推荐将其降维到128D。

CNN资源列表

C++

conv-net-version-3,对应博客Convolutional Neural Networks III

Python

Keras,强力推荐

Keras资源列表:

DeepLearning tutorial(6)易用的深度学习框架Keras简介

DeepLearning tutorial(7)深度学习框架Keras的使用-进阶

Keras VGG-16模型 VGG16 model for Keras

PDNN,对应主页PDNN: A Python Toolkit for Deep Learning

Matlab

GoogLeNet, A GPU Implementation of GoogLeNet.

More Repositories

1

awesome-cbir-papers

📝Awesome and classical image retrieval papers
1,625
star
2

hashing-baseline-for-image-retrieval

:octocat:Various hashing methods for image retrieval and serves as the baselines
MATLAB
596
star
3

flask-keras-cnn-image-retrieval

🚀CNN-based image retrieval built on Keras
Python
505
star
4

pcv-book-code

📖Python计算机视觉中译本实例代码
Python
487
star
5

cnn-cbir-benchmark

CNN CBIR benchmark (ongoing)
Python
187
star
6

cvt

CVT, a Computer Vision Toolkit.
C
164
star
7

image-retrieval

image retrieval
C++
102
star
8

CNN-for-Face-Image-Retrieval

🍎Face image rerieval
MATLAB
90
star
9

practical-python-and-opencv

🍏Latex: translate the book practical python and opencv to Chinese
TeX
87
star
10

opencv-practical-code

🍎OpenCV小项目与OpenCV一些非常有用的代码
C++
74
star
11

SeetaFaceLib

🍑 SeetaFace for Xcode and Qt
C++
74
star
12

willard-yuan.github.io

💎 Yong's Homepage
CSS
67
star
13

py-cbir-image-search-engine

This is a image search engine based on BoW model
Python
47
star
14

my-awesome-awesomeness

自己使用的一些工具
22
star
15

practical-cbir-handbook

A book tries to give some guide for content-based image retrieval
TeX
19
star
16

pupil-vision

C++
17
star
17

video-text-retrieval-papers

15
star
18

tf-dml-cbir

Deep metric learning for CBIR, based on triplet-reid
Python
11
star
19

cv-and-resume

☕My resume for a job
TeX
11
star
20

sparse-reconstruction-hashing

The code of "Learning Hash Functions Using Sparse Reconstruction"
MATLAB
9
star
21

pcvwithpython

Programming Computer Vision with Python中译本
CSS
8
star
22

BoVW

A c++ implemention of bag of virtual words
C++
8
star
23

sift-match-with-ransac

C++
8
star
24

pkbigdata-image-search

:octocat:15万搜索结果
5
star
25

blcf

Python
5
star
26

qt-learning

Notes and codes to learn Qt
C++
4
star
27

tf_cpp

Tensorflow Cpp API Application
C++
4
star
28

awesome-neural-search-papers

4
star
29

cbirbook

4
star
30

machine-learning-notebook

📓My machine learning notebook
Jupyter Notebook
4
star
31

pic

🌐 🍅 PicSearch: CNN web demo for image retrieval
CSS
3
star
32

mykit

Computer Vision ToolKit
Python
3
star
33

mvs

Python
3
star
34

dive-into-caffe

lost in caffe
3
star
35

image-retrieval-based-on-Zernike

MATLAB
2
star
36

cvtk-pypi

C++
2
star
37

slides

tech slides
2
star
38

awesome-text-match-papers

2
star
39

flowingcash

1
star
40

awesome-website-design

收集的设计得很优秀的UI
1
star
41

willard-yuan

1
star
42

libpupil

1
star
43

easyIDCards

C++
1
star
44

mocap

Real-time Human Motion Tracking from Sensors
1
star
45

grpc_toolkit

C++
1
star
46

dlib-practice

C++
1
star
47

matlab-utils

useful utils for myself
MATLAB
1
star
48

habir

Project site of various hashing methods for image retrieval and serves as the baselines
CSS
1
star
49

mt_ins

Python
1
star
50

cpp-code-training

coding
HTML
1
star
51

zh-case-studies

Case Studies 中译本
CSS
1
star