As an extension of my previous question which is described below...
Assume $Y_1$, $Y_2$, $\ldots$ ,$Y_n$ are random variables over a regular lattice indexed by $i= 1,2,\ldots,n$ where $Y_i\in\{1,2,...,K\}$. Let the probability of a particular configuration $\textbf{y}= (y_1,y_2,...,y_n)$ be given by
$$\mathsf P(\textbf{Y}=\textbf{y}) =C\cdot\text{exp}\left(\sum_{i=1}^n\alpha_{i,y_i}+\frac{1}{2}\beta\sum_{i=1}^n\sum_{j\in N(i)}1(y_i=y_j)\right)$$
where $C$ is the normalizing constant, $N(i)$ is the set of neighbor points of $i$ and $1(.)$ is the indicator function. This model is known as Potts model and is popular in image analysis.
Let us instead of observing $\textbf{Y}$,
we observe $Z_1,Z_2,\ldots,Z_n$ which are conditionally (on $\textbf{Y}$) independent with $$Z_i\mid\textbf{Y}\stackrel{d}{=}Z_i\mid Y_i\sim f_{Y_i}(.)$$ where $f_k(.)$ are known distributions for $k= 1,2,\ldots,K$. Show that
$$\mathsf P(\textbf{Y}\mid\textbf{Z}) =\tilde{C}\cdot\text{exp}\left(\sum_{i=1}^n\tilde{\alpha}_{i,y_i}+\frac{1}{2}\beta\sum_{i=1}^n\sum_{j\in N(i)}1(y_i=y_j)\right)$$
for appropriate choices of $\tilde{\alpha}_{i,k}$ and a new normalizing constant $\tilde{C}$.
My thoughts:
It's not clear to me what it means, in words, for $Z_1,Z_2,\ldots,Z_n$ to be conditionally independent (on $\textbf{Y}$). Does this mean $Y_i$ will give us just as much information about $Z_i$ as $\textbf{Y}$?
I thought it may be useful to use Bayes' Theorem. We have
$$\begin{align*} \mathsf P(\textbf{Y}\mid\textbf{Z}) &=\frac{\mathsf P(\textbf{Z}\mid\textbf{Y})\cdot\mathsf P(\textbf{Y})}{P(\textbf{Z})}\\\\ &\propto\mathsf P(\textbf{Z}\mid\textbf{Y})\cdot\mathsf P(\textbf{Y})\\\\ &=\left(\prod_{i=1}^n \mathsf P(Z_i\mid Y_i)\right)\mathsf P(\textbf{Y}) \end{align*}$$
However, I'm not sure if this is correct or if this is even the right approach. Any suggestions on how I can proceed or alternative approaches would be greatly appreciated.