\begin{tikzpicture}[scale=0.35]
    
	\onslide<1->{   \renewcommand{\forefillColor}{black!50!white}
		\renewcommand{\borderColor}{white}
		\renewcommand{\toprsidefillcolor}{red}
		%% input layer
		\handmadecube{0}{4.5}{2.5}{-1}{0}
		\renewcommand{\toprsidefillcolor}{green}
                              
		\handmadecube{0}{4.5}{2.5}{-1+0.2}{0}
		\renewcommand{\toprsidefillcolor}{blue!60!white}
                      
		\handmadecube{0}{4.5}{2.5}{-1+0.4}{0}
		\node[scale=0.85] at (1-0.6*2.6-0.1,0-4.8){\tiny{Input}};
		\node [scale=0.7, rotate=53] at (1-0.6*2.6+0.6,0.2) {\tiny{224}};
		\node [scale=0.7, rotate=90] at (1-0.6*2.6+0.2,-2) {\tiny{224}};
      
     
	}
	%% convolution
	%\onslide<2->{ 
	\renewcommand{\forefillColor}{red!50!white}
	\renewcommand{\borderColor}{white}
	\renewcommand{\toprsidefillcolor}{red!50!white!50}
     
	\pgfmathsetmacro{\seedx}{1}
	\pgfmathsetmacro{\seedy}{0}
	\pgfmathsetmacro{\anim}{1}
	\foreach \xct in {1,...,2}
	{
                  
		\pgfmathparse{int(\anim+\xct)}
		\onslide<1->{
			\pgfmathsetmacro{\xcti}{\seedx+\xct*0.5}
			\pgfmathsetmacro{\ycti}{\seedy}
			\handmadecube{0.5}{4.5}{2.5}{\xcti}{\ycti}
		}
              
              
              
	}
	\onslide<1->{\node[scale=0.85] at (1+0.5,0-4.8){\tiny{Conv}};}
	\onslide<1->{\node [scale=0.7, rotate=53] at (1-0.6*2.6+3.2,0.2) {\tiny{224}};
		\node [scale=0.7, rotate=90] at (1-0.6*2.6+0.2+2.6,-2) {\tiny{224}};
		\node[scale=0.7] at (1+0.725,0-4.2){\tiny{64}};}
	% }
            
	%%%% pooling layer
	\onslide<1->{ 
		\renewcommand{\forefillColor}{blue!50!white}
		\renewcommand{\borderColor}{white}
		\renewcommand{\toprsidefillcolor}{blue!50!white!50}
		\pgfmathsetmacro{\seedx}{3.6}
		\pgfmathsetmacro{\seedy}{0}
                                
		\foreach \xct/\yct in {1}
		{
                       
			\pgfmathsetmacro{\xcti}{\seedx+\xct*0.5}
			\pgfmathsetmacro{\ycti}{\seedy}
			\handmadecube{0.5}{3.8}{1.8}{\xcti}{\ycti}
		}
		\node[scale=0.85] at (1+2.8,0-4.2){\tiny{maxpool}};
		\node [scale=0.6, rotate=53] at (1+3.7,0.2) {\tiny{112}};
		\node [scale=0.6, rotate=90] at (1+3.3,-2+0.5) {\tiny{112}};
		\node[scale=0.7] at (1+2.85,0-3.5){\tiny{64}};
	}  
	%%%% convolution layer
	%\onslide<4->{
	\renewcommand{\forefillColor}{red!50!white}
	\renewcommand{\borderColor}{white}
	\renewcommand{\toprsidefillcolor}{red!50!white!50}
	\pgfmathsetmacro{\seedx}{5.2}
	\pgfmathsetmacro{\seedy}{0}
	\pgfmathsetmacro{\anim}{4}
	\foreach \xct in {1,...,2}
	{
                      
		\pgfmathparse{int(\anim+\xct)}
		\onslide<1->{
			\pgfmathsetmacro{\xcti}{\seedx+\xct}
			\pgfmathsetmacro{\ycti}{\seedy}
			\handmadecube{0.95}{3.8}{1.8}{\xcti}{\ycti}}
	}  
	\onslide<1->{\node[scale=0.85] at (1+5.25,0-4.2){\tiny{Conv}};}
	\onslide<1->{ \node [scale=0.6, rotate=53] at (1+6.7,0.2) {\tiny{112}};
		\node [scale=0.6, rotate=90] at (1+6.4,-1.5) {\tiny{112}};
		\node[scale=0.6] at (1+5.65,0-3.5){\tiny{128}};}
	%   }      
	%%%%% pooling
	\onslide<1->{       \renewcommand{\forefillColor}{blue!50!white}
		\renewcommand{\borderColor}{white}
		\renewcommand{\toprsidefillcolor}{blue!50!white!50}
		\pgfmathsetmacro{\seedx}{8.8}
		\pgfmathsetmacro{\seedy}{0}
                      
		\foreach \xct/\yct in {1}
		{
			\pgfmathsetmacro{\xcti}{\seedx+\xct*0.5}
			\pgfmathsetmacro{\ycti}{\seedy}
			\handmadecube{0.95}{3.3}{1.3    }{\xcti}{\ycti}
		}  
                  
		\node[scale=0.85] at (1+7.8,0-3.6){\tiny{maxpool}};
		\node [scale=0.6, rotate=49] at (1+8.7,0.1) {\tiny{56}};
		\node [scale=0.6, rotate=90] at (1+8.5,-1.35) {\tiny{56}};
		\node[scale=0.6] at (1+7.8,0-3){\tiny{128}};
                      
	}
	%%%% convolution layer
	%                    \onslide<6->{  
	\renewcommand{\forefillColor}{red!50!white}
	\renewcommand{\borderColor}{white}
	\renewcommand{\toprsidefillcolor}{red!50!white!50}
	\pgfmathsetmacro{\seedx}{10.2}
	\pgfmathsetmacro{\seedy}{0}
	\pgfmathsetmacro{\anim}{7}
	\foreach \xct/\yct in {1,...,3}
	{
		\pgfmathparse{int(\anim+\xct)}
		\onslide<1->{
			\pgfmathsetmacro{\xcti}{\seedx+1.35*\xct}
			\pgfmathsetmacro{\ycti}{\seedy}
			\handmadecube{1.3}{3.3}{1.3}{\xcti}{\ycti}
		}
	}
                     
	\onslide<1->{  \node[scale=0.85] at (1+11.2,0-3.6){\tiny{Conv}};}
	\onslide<1->{   \node [scale=0.6, rotate=49] at (1+13.625,0.1) {\tiny{56}};
		\node [scale=0.6, rotate=90] at (1+13.425,-1.35) {\tiny{56}};
		\node[scale=0.6] at (1+12.6,0-3){\tiny{256}};
	}
	%}  
	%%%%% pooling
	\onslide<1->{   \renewcommand{\forefillColor}{blue!50!white}
		\renewcommand{\borderColor}{white}
		\renewcommand{\toprsidefillcolor}{blue!50!white!50}
		\pgfmathsetmacro{\seedx}{15.1}
		\pgfmathsetmacro{\seedy}{0}
                          
		\foreach \xct/\yct in {1}
		{
			\pgfmathsetmacro{\xcti}{\seedx+\xct*1.35}
			\pgfmathsetmacro{\ycti}{\seedy}
			\handmadecube{1.3}{2.7}{0.8}{\xcti}{\ycti}
		}
                          
		\node[scale=0.85] at (1+14.8,0-3.2){\tiny{maxpool}};
		\node [scale=0.6, rotate=49] at (1+15.7,0) {\tiny{28}};
		\node [scale=0.6, rotate=90] at (1+15.6,-1.2) {\tiny{28}};
		\node[scale=0.6] at (1+14.8,0-2.4){\tiny{256}};
	}  
	%%%%%%%%% Convolution
	%\onslide<8->{
	\renewcommand{\forefillColor}{red!50!white}
	\renewcommand{\borderColor}{white}
	\renewcommand{\toprsidefillcolor}{red!50!white!50}
	\pgfmathsetmacro{\seedx}{17.1}
	\pgfmathsetmacro{\seedy}{0}
	\pgfmathsetmacro{\anim}{11}
	\foreach \xct/\yct in {1,...,3}
	{
		\pgfmathparse{int(\anim+\xct)}
		\onslide<1->{
                                   
			\pgfmathsetmacro{\xcti}{\seedx+1.8*\xct}
			\pgfmathsetmacro{\ycti}{\seedy}
			\handmadecube{1.8}{2.7}{0.8}{\xcti}{\ycti}}
	}
                         
	\onslide<1->{  \node[scale=0.85] at (1+18.75,0-3.2){\tiny{Conv}};}                            \onslide<1->{\node [scale=0.6, rotate=49] at (1+21.7,0) {\tiny{28}};
		\node [scale=0.6, rotate=90] at (1+21.7,-1.1) {\tiny{28}};
		\node[scale=0.6] at (1+20.75,0-2.4){\tiny{512}};}
	% }
	%%%%%%% pooling
	\onslide<1->{\renewcommand{\forefillColor}{blue!50!white}
		\renewcommand{\borderColor}{white}
		\renewcommand{\toprsidefillcolor}{blue!50!white!50}
		\pgfmathsetmacro{\seedx}{23.2}
		\pgfmathsetmacro{\seedy}{0}
                          
		\foreach \xct/\yct in {1}
		{
			\pgfmathsetmacro{\xcti}{\seedx+\xct*1.8}
			\pgfmathsetmacro{\ycti}{\seedy}
			\handmadecube{1.8}{2.4}{0.6}{\xcti}{\ycti}
		}
                          
		\node[scale=0.85] at (1+23.2,0-3.2){\tiny{maxpool}};
		\node [scale=0.55, rotate=45] at (1+24.15,-0.15) {\tiny{14}};
		\node [scale=0.6, rotate=90] at (1+23.7,-1.1) {\tiny{14}};
		\node[scale=0.6] at (1+23,0-2.2){\tiny{512}};
	}
	%%%%%%%%%% convolution
	%\onslide<10->{
	\renewcommand{\forefillColor}{red!50!white}
	\renewcommand{\borderColor}{white}
	\renewcommand{\toprsidefillcolor}{red!50!white!50}
	\pgfmathsetmacro{\seedx}{25.5}
	\pgfmathsetmacro{\seedy}{0}
	\pgfmathsetmacro{\anim}{15}
                             
	\foreach \xct/\yct in {1,...,3}
	{
		\pgfmathparse{int(\anim+\xct)}
		\onslide<1->{
                                      
			\pgfmathsetmacro{\xcti}{\seedx+1.8*\xct}
			\pgfmathsetmacro{\ycti}{\seedy}
			\handmadecube{1.8}{2.4}{0.6}{\xcti}{\ycti}
		}
	}  
                             
	\onslide<1->{ \node[scale=0.85] at (1+27.5,0-3.2){\tiny{Conv}};}
	\onslide<1->{   \node [scale=0.55, rotate=45] at (1+30.1,-0.1) {\tiny{14}};
		\node [scale=0.6, rotate=90] at (1+29.6,-1.1) {\tiny{14}};
		\node[scale=0.6] at (1+29,0-2.2){\tiny{512}};}
	% }
	%%%%%% pooling
	\onslide<1->{  \renewcommand{\forefillColor}{blue!50!white}
		\renewcommand{\borderColor}{white}
		\renewcommand{\toprsidefillcolor}{blue!50!white!50}
		\pgfmathsetmacro{\seedx}{31.4}
		\pgfmathsetmacro{\seedy}{-0.25}
                                  
		\foreach \xct/\yct in {1}
		{
			\pgfmathsetmacro{\xcti}{\seedx+\xct*1.8}
			\pgfmathsetmacro{\ycti}{\seedy}
			\handmadecube{1.7}{1.5}{0.3}{\xcti}{\ycti}
		}
                                  
		\node[scale=0.85] at (1+31.5,0-3){\tiny{maxpool}};
		\node [scale=0.6, rotate=10] at (1+32.25,-0.42) {\tiny{7}};
		\node [scale=0.6, rotate=90] at (1+32,-1) {\tiny{7}};
		\node[scale=0.6] at (1+31.5,0-1.6){\tiny{512}};
	}
	%%%%% fc
	%\onslide<12->{
	\renewcommand{\forefillColor}{purple!50!white}
	\renewcommand{\borderColor}{white}
	\renewcommand{\toprsidefillcolor}{purple!50!white!50}
	\pgfmathsetmacro{\seedx}{34}
	\pgfmathsetmacro{\seedy}{4.3}
	\pgfmathsetmacro{\anim}{19}
                 
	\foreach \xct/\yct in {1,...,2}
	{
		\pgfmathparse{int(\anim+\xct)}
		\onslide<1->{
                           
			\pgfmathsetmacro{\xcti}{\seedx+\xct}
			\pgfmathsetmacro{\ycti}{\seedy}
			\handmadecube{0.6}{10}{0.1}{\xcti}{\ycti}
		}
	}  
                 
                 
                 
	%%fc
	\onslide<1->{ \node[scale=0.85] at (1+33.658,0-5){\tiny{fc}};}
	%        \onslide<22->{ \node[scale=0.85] at (1+35.75,0-5){\tiny{fc}};}
	\onslide<1->{ \node[scale=0.85] at (1+34.75,0-5){\tiny{fc}};}
                 
	\onslide<1->{\node [scale=0.7, rotate=0] at (1+33.658,-6) {\tiny{4096}};}
	%         \onslide<22->{\node [scale=0.7, rotate=0] at (1+35.75,-6) {\tiny{4096}};}
	\onslide<1->{\node [scale=0.7, rotate=0] at (1+34.75,-6) {\tiny{4096}};}
	%}
	%%
	\onslide<1->{  \renewcommand{\forefillColor}{white!50!white}
		\renewcommand{\borderColor}{black}
		\renewcommand{\toprsidefillcolor}{white!50!white!50}
		\handmadecube{1}{6.5}{0.01}{39}{2.5}
                      
		% % softmax
                      
		\node[scale=0.85] at (1+37.5,3){\tiny{softmax}};
                      
                      
		\node [scale=0.7, rotate=0] at (1+37.5,-4.5) {\tiny{1000}};}
	%%
	\onslide<1->{\draw[->,black] (36,-0.7) -- (36.5,-0.7);}
	\onslide<1->{  \draw[->,black] (35,-0.7) -- (35.5,-0.7);}
	%% parameters
	\onslide<1->{
		\draw[->,line width=0.25mm,red] (33.6,-0.7) -- (34.2,-0.7);
	}
	\onslide<1->{ \draw[->,line width=0.25mm,red] (35,-0.7) -- (35.5,-0.7);}
	\onslide<1->{\draw[->,line width=0.25mm,red] (36,-0.7) -- (36.5,-0.7);}
                     
	\onslide<1->{\draw[->,line width=0.25mm,red] (37.2,-0.7) -- (37.8,-0.7);}
                     
\end{tikzpicture}