PG_BOW_DEMO

所属分类:图形图像处理
开发工具:matlab
文件大小:3501KB
下载次数:588
上传日期:2011-11-01 17:01:09
上 传 者lipiji
说明:  图像的特征用到了Dense Sift,通过Bag of Words词袋模型进行描述,当然一般来说是用训练集的来构建词典,因为我们还没有测试集呢。虽然测试集是你拿来测试的,但是实际应用中谁知道测试的图片是啥,所以构建BoW词典我这里也只用训练集。 其实BoW的思想很简单,虽然很多人也问过我,但是只要理解了如何构建词典以及如何将图像映射到词典维上去就行了,面试中也经常问到我这个问题,不知道你们都怎么用生动形象的语言来描述这个问题? 用BoW描述完图像之后,指的是将训练集以及测试集的图像都用BoW模型描述了,就可以用SVM训练分类模型进行分类了。 在这里除了用SVM的RBF核,还自己定义了一种核: histogram intersection kernel,直方图正交核。因为很多论文说这个核好,并且实验结果很显然。能从理论上证明一下么?通过自定义核也可以了解怎么使用自定义核来用SVM进行分类。
(Image features used in a Dense Sift, by the Bag of Words bag model to describe the word, of course, the training set is generally used to build the dictionary, because we do not test set. Although the test set is used as the test you, but who knows the practical application of the test image is valid, so I am here to build BoW dictionary only the training set. In fact, BoW idea is very simple, although many people have asked me, but as long as you understand how to build a dictionary and how to image map to the dictionary D up on the line, and interviews are often asked me this question, do not know you all how to use vivid language to describe this problem? After complete description of the image with BoW, refers to the training set and test set of images are described with the BoW model, the training of SVM classification model can be classified. Apart from having to use the RBF kernel SVM, but also their own definition of a nuclear: histogram intersection kernel, histogram )

文件列表:
PG_BOW_DEMO (0, 2011-10-24)
PG_BOW_DEMO\BOW (0, 2011-10-24)
PG_BOW_DEMO\BOW\CalculateDictionary.m (3821, 2011-10-24)
PG_BOW_DEMO\BOW\CompilePyramid.m (3354, 2011-10-24)
PG_BOW_DEMO\BOW\do_assignment.m (2384, 2011-10-24)
PG_BOW_DEMO\BOW\do_classification_inter_svm.m (2198, 2011-10-24)
PG_BOW_DEMO\BOW\do_classification_rbf_svm.m (1731, 2011-10-24)
PG_BOW_DEMO\BOW\do_normalize.m (875, 2010-12-21)
PG_BOW_DEMO\BOW\do_p_classification__inter_svm.m (2243, 2011-10-24)
PG_BOW_DEMO\BOW\do_p_classification__rbf_svm.m (1382, 2011-10-24)
PG_BOW_DEMO\BOW\draw_cm.m (1132, 2011-10-24)
PG_BOW_DEMO\BOW\EuclideanDistance.m (1303, 2010-12-21)
PG_BOW_DEMO\BOW\find_grid.m (446, 2011-10-24)
PG_BOW_DEMO\BOW\find_sift_grid.m (4292, 2010-09-08)
PG_BOW_DEMO\BOW\GenerateSiftDescriptors.m (2765, 2011-10-24)
PG_BOW_DEMO\BOW\hist_isect.m (759, 2009-01-17)
PG_BOW_DEMO\BOW\hist_isect_c.c (3305, 2010-10-31)
PG_BOW_DEMO\BOW\hist_isect_c.mexw32 (8192, 2010-10-31)
PG_BOW_DEMO\BOW\load_image.m (154, 2010-06-01)
PG_BOW_DEMO\BOW\MakeDataDirectory.m (601, 2011-10-24)
PG_BOW_DEMO\BOW\make_dir.m (223, 2008-12-10)
PG_BOW_DEMO\BOW\normalize_sift.m (650, 2008-12-10)
PG_BOW_DEMO\BOW\num2string.m (324, 2010-06-01)
PG_BOW_DEMO\BOW\read_image_db.m (264, 2010-06-01)
PG_BOW_DEMO\BOW\rotateXLabels.m (14315, 2010-10-16)
PG_BOW_DEMO\BOW\show_results_script.m (551, 2011-10-24)
PG_BOW_DEMO\BOW\sumnormalize.m (258, 2010-09-27)
PG_BOW_DEMO\images (0, 2011-10-21)
PG_BOW_DEMO\images\testing (0, 2011-10-24)
PG_BOW_DEMO\images\testing\Phoning (0, 2011-10-24)
PG_BOW_DEMO\images\testing\Phoning\Phoning_0041.jpg (7711, 2010-12-01)
PG_BOW_DEMO\images\testing\Phoning\Phoning_0042.jpg (5900, 2010-12-01)
PG_BOW_DEMO\images\testing\Phoning\Phoning_0043.jpg (7294, 2010-12-01)
PG_BOW_DEMO\images\testing\Phoning\Phoning_0044.jpg (5867, 2010-12-01)
PG_BOW_DEMO\images\testing\Phoning\Phoning_0045.jpg (8424, 2010-12-01)
PG_BOW_DEMO\images\testing\Phoning\Phoning_0046.jpg (8039, 2010-12-01)
PG_BOW_DEMO\images\testing\Phoning\Phoning_0047.jpg (7224, 2010-12-01)
PG_BOW_DEMO\images\testing\Phoning\Phoning_0048.jpg (5127, 2010-12-01)
PG_BOW_DEMO\images\testing\Phoning\Phoning_0049.jpg (7508, 2010-12-01)
PG_BOW_DEMO\images\testing\Phoning\Phoning_0050.jpg (8208, 2010-12-01)
... ...

======================================================================== Image Classification using Bag of Words and Spatial Pyramid BoW Created by Piji Li (peegeelee@gmail.com) Blog: изг http://www.zhizhihu.com QQ: 379115886 IRLab. : http://ir.sdu.edu.cn Shandong University,Jinan,*** 10/24/2011 Some code are from: S. Lazebnik, C. Schmid, and J. Ponce, "Beyond Bags of Features: Spatial Pyramid Matching for Recognizing Natural Scene Categories," CVPR 2006. ======================================================================== Just modify the ini.m: rootpath=your demo path, and then run main.m. The BOW and Dictionary is in the dir:/data/global, size of BOW_sift.mat is (DictionarySize * #images). Size of dictionary.mat is (DictionarySize * dim of features).spatial_pyramid.mat is the Spatial Pyramid BoW. In /data/local is the sift features for each images. ======================================================================== Classification using BOW rbf_svm Accuracy = 75.8333% (91/120) (classification) Classification using histogram intersection kernel svm Accuracy = 82.5% (99/120) (classification) Classification using Pyramid BOW rbf_svm Accuracy = 82.5% (99/120) (classification) Classification using Pyramid BOW histogram intersection kernel svm Accuracy = 90% (108/120) (classification) ======================================================================== Idea from: S. Lazebnik, C. Schmid, and J. Ponce, "Beyond Bags of Features: Spatial Pyramid Matching for Recognizing Natural Scene Categories," CVPR 2006. Images from: Piji Li, Jun Ma, Shuai Gao. Actions in Still Web Images: Visualization, Detection and Retrieval. The 12th International Conference on Web-Age InformationManagement (WAIM 2011). Springer, 2011. SVM from: Chih-Chung Chang and Chih-Jen Lin, LIBSVM : a library for support vector machines. ACM Transactions on Intelligent Systems and Technology, 2:27:1--27:27, 2011. Software available at http://www.csie.ntu.edu.tw/~cjlin/libsvm

近期下载者

相关文件


收藏者