我正在尝试实现此paper中讨论的分类器。我已经实现了除特征提取之外的所有功能。在5.1节中,作者写道:
“对于每个超像素,提取了两种特征类型:使用有符号的平方根和L a b颜色值进行变换的密集冲浪。在我们的实验中,已证明有利于提取超像素周围的特征即在其边界框内,包含更多上下文。冲浪和颜色值均使用改进的Fisher矢量进行编码,如在VlFeat中实现, gmm,具有64种模式。我们执行<两个特征通道上的强> pca白化。最后,两个编码的特征向量被连接起来,产生一个 8'576值的密集向量。“
这里发生了很多事情,我对执行这些步骤的顺序以及数据集的哪个部分感到困惑。
这是我在伪python中的解释:
def getFeatures(images):
surfs_arr = []
colors_arr = []
for image in images:
superpixels = findSuperpixels
for superpixel in superpixels:
box = boundingBox(superpixel)
surfs = findDenseSURFs(box)
colors = findColorValues(box)
surfs_arr.append(surfs)
colors_arr.append(colors)
surfs_sample = (randomly choose X samples from surfs_arr)
colors_sample = (randomly choose Y samples from colors_arr) #or histogram?
# gmm has covariances, means properties
gmm_surf = GMM(modes=64, surfs_sample)
gmm_color = GMM(modes=64, colors_sample)
surfs_as_fisher_vectors = IFV(gmm_surf, surfs_arr)
colors_as_fisher_vectors = IFV(gmm_color, color_arr)
pca_surfs = PCA(ifv_surfs, whiten, n_components = 64)
pca_colors = PCA(ifv_colors, whiten, n_components = 64
features = concatenate((pca_surfs, pca_colors), axis=1)
return features
我的问题:
我。应该在创建GMM之前执行PCA美白吗? (就像在这个example)
II。我应该从中删除surfs_sample和colors_sample集 surfs_arr和colors_arr分别在编码为之前 费舍尔矢量?
III。至于描述颜色值,最好将它们保持原样或 创建直方图?
IV。作者声称他使用了密集的SURF,但没有提及 多么密集你推荐一个特定的起点吗? 4×4, 16×16?我误解了这个吗?
诉任何想法作者提出“密集的矢量与8,576 值“?获得具有不同大小的一致数量的特征 超像素,在我看来,他一定是
1)使用直方图来表示颜色值,并且
2a)调整每个超像素的大小,或
2b)改变他的SURF网格的密度。
我正在使用python w / numpy,opencv,scikit-learn,mahotas以及从VLFeat移植的渔民载体implementation。
感谢。