计算Fisher vector和VLAD
来源:互联网 发布:怎样才能学好网络 编辑:程序博客网 时间:2024/05/04 23:52
This short tutorial shows how to compute Fisher vector and VLAD encodings with VLFeat MATLAB interface.
These encoding serve a similar purposes: summarizing in a vectorial statistic a number of local feature descriptors (e.g. SIFT). Similarly to bag of visual words, they assign local descriptor to elements in a visual dictionary, obtained with vector quantization (KMeans) in the case of VLAD or a Gaussian Mixture Models for Fisher Vectors. However, rather than storing visual word occurrences only, these representations store a statistics of the difference between dictionary elements and pooled local features.
Fisher encoding
The Fisher encoding uses GMM to construct a visual word dictionary. To exemplify constructing a GMM, consider a number of 2 dimensional data points (see also the GMM tutorial). In practice, these points would be a collection of SIFT or other local image features. The following code fits a GMM to the points:
numFeatures = 5000 ;dimension = 2 ;data = rand(dimension,numFeatures) ;numClusters = 30 ;[means, covariances, priors] = vl_gmm(data, numClusters);
Next, we create another random set of vectors, which should be encoded using the Fisher Vector representation and the GMM just obtained:
numDataToBeEncoded = 1000;dataToBeEncoded = rand(dimension,numDataToBeEncoded);
The Fisher vector encoding enc
of these vectors is obtained by calling the vl_fisher
function using the output of the vl_gmm
function:
encoding = vl_fisher(datatoBeEncoded, means, covariances, priors);
The encoding
vector is the Fisher vector representation of the data dataToBeEncoded
.
Note that Fisher Vectors support several normalization options that can affect substantially the performance of the representation.
VLAD encoding
The Vector of Linearly Agregated Descriptors is similar to Fisher vectors but (i) it does not store second-order information about the features and (ii) it typically use KMeans instead of GMMs to generate the feature vocabulary (although the latter is also an option).
Consider the same 2D data matrix data
used in the previous section to train the Fisher vector representation. To compute VLAD, we first need to obtain a visual word dictionary. This time, we use K-means:
numClusters = 30 ;centers = vl_kmeans(dataLearn, numClusters);
Now consider the data dataToBeEncoded
and use the vl_vlad
function to compute the encoding. Differently from vl_fisher
, vl_vlad
requires the data-to-cluster assignments to be passed in. This allows using a fast vector quantization technique (e.g. kd-tree) as well as switching from soft to hard assignment.
In this example, we use a kd-tree for quantization:
kdtree = vl_kdtreebuild(centers) ;nn = vl_kdtreequery(kdtree, centers, dataEncode) ;
Now we have in the nn
the indexes of the nearest center to each vector in the matrix dataToBeEncoded
. The next step is to create an assignment matrix:
assignments = zeros(numClusters,numDataToBeEncoded);assignments(sub2ind(size(assignments), nn, 1:length(nn))) = 1;
It is now possible to encode the data using the vl_vlad
function:
enc = vl_vlad(dataToBeEncoded,centers,assignments);
Note that, similarly to Fisher vectors, VLAD supports several normalization options that can affect substantially the performance of the representation.
from: http://www.vlfeat.org/overview/encodings.html
- 计算Fisher vector和VLAD
- 计算Fisher vector和VLAD
- Fisher Vector
- Fisher vector
- fisher vector
- Fisher Vector
- Fisher Vector
- VLAD教程和资料 All about VLAD
- VLAD和MultiVLAD
- FV(fisher vector)
- Fisher vector学习笔记
- Fisher Vector 通俗学习
- Fisher Vector 学习
- Fisher vector学习笔记
- 再谈Fisher Vector
- Fisher vector学习笔记
- Fisher Vector的改进
- Fisher vector fundamentals
- eclipse出现 Some characters cannot be mapped using "GBK" character encoding 错误代码的解决办法
- [Servlet&JSP] 标准标签
- initWithFrame和 initWithCoder
- 十进制转换二进制
- matlab 2015a找不到编译器
- 计算Fisher vector和VLAD
- ubuntu 14.04 下通过apt-get 安装jdk
- 【C#数据结构】简单选择排序
- 南邮离散大作业欧拉回路
- 简述Struts2中Redirect和Dispatcher的区别
- Assembly x64 Intro - SSE2 Diff 8 Load
- 9本Java程序员必读的书
- CC2530外部中断
- 利用echarts-2.2.7做报表视图