For you who wants to download this, please follow this link: http://sdrv.ms/SkymHg
A simpler version of my previous seminar slide, but provides a clearer explanation to the LDA.
11. Why Latent?
贝叶斯网络通过如下几个方面描述变量之间的关系:
∙ 连接结点的边和边的指向;
∙ 结点的概率分布――先验分布和后验分布。
对于无法准确描述的变量关系通过引入隐 含结点 来解决。
隐
LDA中,通过隐含结点的后 验概率来描述词的共现现象,并且对其赋予
后
较高的概率。
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 11 / 35
12. 主题模型:前人工作
有效的找到语料库中大量文档的简短描述,同时保留其内部的统计特
征,为分类、文摘、异常点检测和相似性检验提供基础。
∙ 1983年— tf-idf
统计词频,无法捕捉到文档内部和文档间的统计特征;
∙ 1990年— LSI(Latent Semantic Indexing)
在词与文档(term-by-document)矩阵上使用SVD,tf-idf 的线性组合,
能捕捉到一些语法特征;
∙ 1999年— pLSI(aka Aspect Model 内容模型)
参数随着语料库的容量增长,容易过拟合,在文档层面没有一个统
计模型,无法对文档指定概率;
∙ 2003年— LDA
bag-of-word假设,同时考虑词和文档交换性的混合模型
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 12 / 35
13. Graphical Model
∙ 结点代表变量,边代表可能的依赖关系
∙ 隐含结点为空心,观测结点为实心
∙ 盒子表示重复结构
N
∏︁
P(y , x1 , . . . , xn ) = P(y ) P(xn |y )
n=1
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 13 / 35
14. LDA in graphical model
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 14 / 35
15. LDA过程
对于语料库������中的每个文档w ,LDA是如下的变参数层次贝叶斯网络:
1 选择单词的个数N ∼ Poission(������)
2 选择文档中话题比率������ ∼ Dir(������)
3 对于每个单词wn
1 选择话题zn ∼ Multi(������)
2 从分布p(wn |zn , ������)中选择单词wn
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 15 / 35
16. The “Actual” LDA过程
1 将语料库中的每个文档表示成词汇计数的向量模型
2 建立LDA模型
3 通过逼近方法计算这个模型
4 评价模型
5 模型应用
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 16 / 35
17. Topic Model解释
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 17 / 35
18. Topic Model主题指定示意
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 18 / 35
19. Latent Dirichlet Allocation
∙ Dirichlet起到了“平滑”的作用
∙ ������ ∼ Dir (������)保证了每个文档中都包含了所有话题
∙ ������ ∼ Dir (������)保证了每个话题包含所有词汇
∙ Dirichelt和Multinomial是共轭的
∙ ������控制着������的均值和稀疏度
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 19 / 35
20. Dirichlet Distribution — ������
������i 控制分布的聚集程度
∑︀
∙
∙ 当������ < 1的时候,越来越稀疏
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 20 / 35
21. Dirichlet Distribution — samples
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 21 / 35
22. LDA — 后验概率估计方法
利用后验概率来估计参数
∙ Mean field Variational Inference
∙ Collapse Gibbs sampling
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 22 / 35
23. LDA — 结果
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 23 / 35
24. LDA — 结果
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 24 / 35
28. 如何得到LDA中的参数— 推断
LDA模型中最重要的计算任务是计算隐含变量的后验概率
p(������, z, w |������, ������)
p(������, z|w , ������, ������) =
p(w |������, ������)
近似推断方法有两种:
∙ 变分法(Variational Inference)
∙ 抽样法(Gibbs Sampling)
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 28 / 35
29. 推断方法
∙ 判定方法(变分、优化)
∙ Mean Field, Belief Propagation
∙ Variational Bayes, Expectation Propagation
∙ 计算量小,不精确,可以给出边界
∙ 随机方法(抽样)
∙ Metropolis-Hasting, Gibbs, MCMC, etc
∙ 计算量大,但相对精确
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 29 / 35
30. LDA in Vision
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 30 / 35
31. Main difficulties
要解决的问题:
∙ 什么作为词?
∙ 什么是文档?
∙ 什么作为主题?
解决方案:
∙ 简单做法:每副图像作为一个文档,图像块(image patches)作
为codebook当做词
∙ Spatial Latent Dirichlet Allocation
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 31 / 35
32. 将LDA直接应用到图像领域
将图像做为文档,将图像中的部分视为词汇。具体处理过程如下:
1 抽取局部特征
2 利用局部特征构建codebook,通常采用简单的聚类方法将相似特征
聚类
3 在bag-of-feature假设下,利用codebook将图像分割
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 32 / 35
33. Spatial LDA
∙ bag-of-word假设无法反应图像中的空间位置信息
∙ 被LDA训练出来的模型通常会将共同出现的词赋予相同主题,但
是,图像领域这样假设不恰当(汽车和天空经常同时出现)
∙ 在LDA中小概率的词语通常会被指定到高概率的主题中,在图像
中,小块的图像极有可能被指定到大块图像的主题中
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 33 / 35
34. Spatial LDA
SLDA通过将文档作为隐含变量达到将空间信息和时间信息引入模型的
目的:
ci ∼ Normal(cd , ������); cjd = (gjd , xjd , yjd )
gjd 是文档j所在图像的索引,(xjd , yjd )是文档的位置
Figure: 将空间信息加入文档的方法。(a): 将图像分割成不重叠的区域,每个
区域当成一个文档。每个区域中的图像块被指定到对应文档。(b): 一个图像块
被多个区域重叠覆盖。(c): 每个图像对应一个点。如果一个图像块举例一个文
档近,则有较高概率被指定到该文档。
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 34 / 35
35. 部分参考文献
∙ D. Blei, A. Ng, and M. Jordan. Latent Dirichlet allocation. Journal of
Machine Learning Research, 3:993-1022, January 2003.
∙ D. Blei and M. Jordan. Variational inference for Dirichlet process
mixtures. Journal of Bayesian Analysis, 1:121-144, 2006.
∙ M. Steyvers and T. Griffiths. Probabilistic Topic Models. In Latent
Semantic Analysis: A Road to Meaning, T. Landauer, Mcnamara, S.
Dennis, and W. Kintsch eds. Laurence Erlbaum, 2006.
∙ Y. Teh, M. Jordan, M. Beal, and D. Blei. Hierarchical Dirichlet
processes. Journal of the American Statistical Association,
101:1566-1581, 2006.
∙ J. Zhu, A. Ahmed and E. P. Xing. MedLDA: Maximum Margin
Supervised Topic Models for Regression and Classification. The 26th
International Conference on Machine Learning, 2009.
∙ D. Blei and J. Lafferty. Dynamic topic models. In International
Conference on Machine Learning, 2006.
肖智博 (DLMU-ITREC) Topic Models, LDA and all that April 21, 2011 35 / 35