用Python实现Fisher向量Image Fisher Vector In Python
来源:互联网 发布:java urlencode 中文 编辑:程序博客网 时间:2024/05/17 03:15
Image Fisher Vector In Python
Although the state of the art in image classification is deep learning,
Bag of words approaches still perform well on many image datasets.
Fisher vectors is the state of the art in that approach, allowing training more discriminative classifiers with a lower vocabulary size.
Bag of words approaches still perform well on many image datasets.
Fisher vectors is the state of the art in that approach, allowing training more discriminative classifiers with a lower vocabulary size.
I wrote a simple Python implementation for calculating fisher vectors and using it to classify image categories:
https://github.com/jacobgil/pyfishervector
You might want to look here for a derivation:
https://hal.inria.fr/hal-00830491/PDF/journal.pdf
http://www.vlfeat.org/api/fisher-derivation.html
The main improvement here is extracting a richer feature vector from images compared to bag of words.
In Bag of Words, for each local feature we find the closest word in the vocabulary, and add +1 to the histogram of the vocabulary in the input image.
But we could have sampled more data:
- How far is each feature from its closest vocabulary word.
- How far is the feature from other vocabulary words.
- The distribution of the vocabulary words themselves.
Brief outline of fisher vectors
Vocabulary learning with GMM:
- Sample many features from input images.
- Fit a Gaussian Mixture Model on those features.
- The result is a vocabulary of dominant features in the image, and their distributions.
Image representation based on the vocabulary:
- Measure the expectation of the difference and distance of the image features, from each Gaussian distrubution, using the likelihood a feature belongs to certain gaussian.
- Concatenate the resulting vector for each vocabulary word, into one large descriptor vector.
There is also a normalization step that I will skip here but is a part of the implementation, that is important if the features are fed into a classifier like SVM that needs normalized inputs.
This is a generalization of bag of words. If you set the likelihood of a feature to a vocabulary word to be 1 to it's closest word and 0 to the rest,
and if you redefine the distance to be a constant "1", you get the original bag of words model.
Trying out the implementation:
python fisher.py <path_to_image_directory> <vocabulary size>
The image directory should contain two sub folders, one for the images of each class.
It currently just trains a model and then classifies the images.
The input images definitely need to be partitioned into training and validation parts.
The input images definitely need to be partitioned into training and validation parts.
One more thing:
Fisher vectors are successfully used in image recognition, check out:
http://www.robots.ox.ac.uk/~vgg/publications/2013/Simonyan13/extras/simonyan13_ext.pdf
In their paper they extract features densely from a grid, reduce the dimensionality with PCA, and augment the features with their spacial location.
from: http://jacobcv.blogspot.com/2014/12/fisher-vector-in-python.html
0 0
- 用Python实现Fisher向量Image Fisher Vector In Python
- Fisher Vector(FV)向量
- fisher判别分析原理+python实现
- 法国INRIA的Fisher向量实现INRIA's Fisher vector implementation
- Fisher Vector费舍尔向量and FIsher Kernel费舍尔核
- Fisher Vector
- Fisher vector
- fisher vector
- Fisher Vector
- Fisher Vector
- Fisher准则线性分类器的Python实现
- LDA 两类Fisher线性判别分析及python实现
- FV(fisher vector)
- Fisher vector学习笔记
- Fisher Vector 通俗学习
- Fisher Vector 学习
- Fisher vector学习笔记
- 再谈Fisher Vector
- 【Python 笔记】Ipython中pdb调试器的使用
- 2016.2.29 腾讯电话面试
- glance上传映像(支持压缩)
- ui 画图三(画板画图)
- 类装载机制
- 用Python实现Fisher向量Image Fisher Vector In Python
- linux c 算法总结
- linux 下tomcat7 配置为服务
- Java验证辛钦大数定理
- 经典算法-插入排序Insertsort
- Android Activity为什么要细化出onCreate、onStart、onResume、onPause、onStop、onDesdroy这么多方法让应用去重载?
- POJ【3630】Phone List
- GBDT 梯度下降决策树
- 深度学习R(1):从零开始建立完全连接的神经网络