\begin{tikzpicture}
	\centering
	\onslide<1->{
		\pgfmathsetmacro\x{0}
		\pgfmathsetmacro\y{3}

		\draw (0,0+\y) grid[xstep=0.5,ystep=0.5] (5,0.5+\y);
		\node (w) at (0.25,\y+0.25) {\scriptsize $\hat{c}$};
		\node (h) at (0.75,\y+0.25) {\scriptsize $\hat{w}$};
		\node (x) at (1.25,\y+0.25) {\scriptsize $\hat{h}$};
		\node (y) at (1.75,\y+0.25) {\scriptsize $\hat{x}$};
		\node (pc) at (2.25,\y+0.25) {\scriptsize $\hat{y}$};
		\node (pd) at (2.75,\y+0.25) {\scriptsize $\hat{\ell_1}$};

		\node (w) at (3.25,\y+0.25) {\scriptsize $\hat{\ell_2}$};
		\node (h) at (3.75,\y+0.25) {$\cdot$};

		\node (w) at (4.25,\y+0.25) {$\cdot$};
		\node (h) at (4.75,\y+0.25) {\scriptsize $\hat{\ell_k}$};   

		\draw (0,0+\y)--(5,0+\y);

		\node(img) at (2.5,0){
			\includegraphics[scale=0.4,trim={0cm 4.5cm 21.2cm 4cm},clip]{images/dog.pdf}
		};

	}

	\onslide<2->{

		\pgfmathsetmacro\x{0}
		\pgfmathsetmacro\y{0.5}

		\node(img) at (2.5,0){
			\includegraphics[scale=0.4,trim={0cm 4.5cm 21.2cm 4cm},clip]{images/dog.pdf}
		};
		
		\pgfmathsetmacro\x{1.3}
		\pgfmathsetmacro\y{-0.6}
		\filldraw[fill=cyan!30!white, draw=black,opacity=0.6](\x,\y) rectangle (\x+0.48,\y+0.48);
		
		\pgfmathsetmacro\x{0}
		\pgfmathsetmacro\y{2}
		\draw[line width=0.7mm,color=cyan] (\x+1,\y-3.3) rectangle (\x+2,\y-1.5);     
	}
	
	\only<5>{
		\filldraw[fill=green!40!white, draw=black](0,3) rectangle (0.5,3.5);    
		\node (w) at (0.25,3.25) {\scriptsize $c$};
	}

	\only<6>{
		\filldraw[fill=green!40!white, draw=black](0.5,3) rectangle (1,3.5);    
		\node (h) at (0.75,3.25) {\scriptsize $w$};
	}

	\only<7>{
		\filldraw[fill=green!40!white, draw=black](1,3) rectangle (1.5,3.5);    
		\node (x) at (1.25,3.25) {\scriptsize $h$};
	} 
	
	\only<8-9>{
		\filldraw[fill=green!40!white, draw=black](1.5,3) rectangle (2,3.5);    
		\node (y) at (1.75,3.25) {\scriptsize $x$};
		\filldraw[fill=green!40!white, draw=black](2,3) rectangle (2.5,3.5);    
		\node (x) at (2.25,3.25) {\scriptsize $y$};
	} 

	\onslide<10->{

		\filldraw[fill=green!40!white, draw=black](2.5,3) rectangle (5,3.5);
		\draw (0,3) grid[xstep=0.5,ystep=0.5] (5,3.5);
		\node (pd) at (2.75,4.25) {\scriptsize $P(cow)$};

		\node (w) at (3.25,2.75) {\scriptsize $P(dog)$};
		\node (h) at (3.75,3.25) {$\cdot$};

		\node (w) at (4.25,3.25) {$\cdot$};
		\node (h) at (4.75,3.75) {\scriptsize $P(truck)$};
	}   
	

	
\end{tikzpicture}
