# Image clustering and Dirichlet process

I am reading a paper about the Dirichlet process and image segmentation. (http://dl.acm.org/citation.cfm?id=2404806)

How is (3) below derived? Do any articles or posts explain image segmentation and the Dirichlet process?

## 1 Answer

By the Law of Total Probability: $$p(\boldsymbol X_k^\phi) = \int p(\boldsymbol X_k^\phi, \theta_k) \, \mathrm{d} \theta_k,$$ for which we can rewrite by the definition of conditional probability $$p(\boldsymbol X_k^\phi, \theta_k) = p(\boldsymbol X_k^\phi \mid \theta_k) \, p(\theta_k),$$ to get the final product \begin{align} p(\boldsymbol X_k^\phi) &= \int p(\boldsymbol X_k^\phi, \theta_k) \, \mathrm{d} \theta_k \\ &= \int p(\boldsymbol X_k^\phi \mid \theta_k) \, p(\theta_k) \, \mathrm{d} \theta_k \\ &= \int \left\{ \prod_{x_n \in \boldsymbol X_k^\phi} p(x_n \mid \theta_k) \right\} \, p(\theta_k) \, \mathrm{d} \theta_k. \end{align} Observe that because we believe the points $x_n$ are assigned clusters independently, we can rewrite $$p(\boldsymbol X_k^\phi \mid \theta_k) = \prod_{x_n \in \boldsymbol X_k^\phi} p(x_n \mid \theta_k).$$