926 / mind3d_trellis2 /code /architecture.tex
jamie33's picture
Restore mind3d_trellis2 (docs, code, results, renders, paper)
7c61ee6 verified
Raw History Blame Contribute Delete
7.91 kB
\documentclass[tikz,border=2pt]{standalone}
\usepackage{amsmath,amssymb}
\usepackage{times}
\usetikzlibrary{arrows.meta,positioning,calc}
\definecolor{frz}{HTML}{E8EEF7}\definecolor{frzd}{HTML}{4A6FA5}
\definecolor{trn}{HTML}{FCE9D9}\definecolor{trnd}{HTML}{D9762B}
\definecolor{lane}{HTML}{F5F5F5}\definecolor{pred}{HTML}{D9762B}\definecolor{gtc}{HTML}{4A6FA5}
\definecolor{ok}{HTML}{2E8B57}\definecolor{bad}{HTML}{C0392B}
\tikzset{
box/.style={draw=#1d, fill=#1, rounded corners=3pt, line width=0.6pt, align=center,
minimum height=1.1cm, minimum width=1.9cm, inner sep=2pt, font=\footnotesize},
arr/.style={-{Stealth[length=4pt,width=4pt]}, line width=0.7pt, black!70},
lbl/.style={font=\scriptsize, align=center, text=black!80},
sub/.style={draw=frzd, fill=white, rounded corners=2pt, font=\scriptsize, minimum width=1.0cm,
minimum height=0.48cm, inner sep=1pt},
}
\newcommand{\snow}[1]{\begin{scope}[shift={(#1)}, frzd, line width=0.45pt]
\foreach \a in {0,60,120} {\draw (\a:0.085) -- (\a+180:0.085);}\end{scope}}
\newcommand{\flame}[1]{\begin{scope}[shift={(#1)}]
\fill[trnd] (0,-0.075) .. controls (0.085,-0.045) and (0.065,0.04) .. (0,0.105)
.. controls (-0.065,0.04) and (-0.085,-0.045) .. (0,-0.075);\end{scope}}
\begin{document}
\begin{tikzpicture}
% ---------------- lanes
\fill[lane, rounded corners=4pt] (0,3.0) rectangle (17.7,5.65);
\fill[lane, rounded corners=4pt] (0,0) rectangle (9.75,2.4);
\fill[lane, rounded corners=4pt] (9.95,0) rectangle (17.7,2.4);
\node[anchor=north west, font=\footnotesize] at (0.05,5.62) {\textbf{(a) Reconstruction} (inference: fMRI only)};
\node[anchor=north west, font=\footnotesize] at (0.05,2.37) {\textbf{(b) Regression target} (training objects only)};
\node[anchor=north west, font=\footnotesize] at (10.0,2.37) {\textbf{(c) Example} (test object, unseen in training)};
% legend
\begin{scope}[shift={(11.1,5.42)}]
\fill[frz, draw=frzd, rounded corners=1pt] (0,-0.1) rectangle (0.3,0.1); \snow{0.15,0}
\node[anchor=west, font=\scriptsize] at (0.33,0) {frozen};
\fill[trn, draw=trnd, rounded corners=1pt] (1.35,-0.1) rectangle (1.65,0.1); \flame{1.5,0}
\node[anchor=west, font=\scriptsize] at (1.68,0) {trained (18M)};
\draw[bad, line width=0.7pt, -{Stealth[length=4pt]}] (3.35,0) -- (3.75,0);
\node[anchor=west, font=\scriptsize] at (3.78,0) {loss};
\draw[frzd, dashed, line width=0.7pt, -{Stealth[length=4pt]}] (4.55,0) -- (4.95,0);
\node[anchor=west, font=\scriptsize] at (4.98,0) {shared};
\end{scope}
% ---------------- (a) inference
\node at (0.6,4.3) {\includegraphics[width=1.0cm]{fmri_t2.png}};
\node at (0.8,4.15) {\includegraphics[width=1.0cm]{fmri_t4.png}};
\node at (1.0,4.0) {\includegraphics[width=1.0cm]{fmri_t6.png}};
\node[lbl] at (0.8,3.27) {fMRI, frames 2--7};
\node[box=frz] (enc) at (2.95,4.15) {fMRI encoder\\[-1pt]{\scriptsize ViT-L (MinD-3D)}};
\snow{$(enc.north east)+(-0.17,-0.17)$}
\node[box=trn] (head) at (5.25,4.15) {Mapping head\\[-1pt]{\scriptsize Perceiver + linear}};
\flame{$(head.north east)+(-0.17,-0.19)$}
\draw[arr] (1.55,4.15) -- (enc.west);
\draw[arr] (enc.east) -- (head.west);
\fill[pred] (6.550,4.150) rectangle (6.635,4.630);
\fill[pred] (6.655,4.150) rectangle (6.740,4.316);
\fill[pred] (6.760,4.150) rectangle (6.845,4.408);
\fill[pred] (6.865,4.150) rectangle (6.950,4.095);
\fill[pred] (6.970,4.150) rectangle (7.055,4.071);
\fill[pred] (7.075,4.150) rectangle (7.160,3.838);
\fill[pred] (7.180,4.150) rectangle (7.265,4.254);
\fill[pred] (7.285,4.150) rectangle (7.370,4.116);
\fill[pred] (7.390,4.150) rectangle (7.475,4.299);
\fill[pred] (7.495,4.150) rectangle (7.580,4.052);
\fill[pred] (7.600,4.150) rectangle (7.685,4.069);
\fill[pred] (7.705,4.150) rectangle (7.790,4.278);
\fill[pred] (7.810,4.150) rectangle (7.895,4.187);
\fill[pred] (7.915,4.150) rectangle (8.000,4.267);
\fill[pred] (8.020,4.150) rectangle (8.105,4.247);
\fill[pred] (8.125,4.150) rectangle (8.210,4.033);
\draw[black!40, line width=0.3pt] (6.520,4.150) -- (8.230,4.150);
\node[lbl] at (7.39,4.88) {predicted $\hat c\in\mathbb{R}^{16}$};
\draw[arr] (head.east) -- (6.5,4.15);
\node[box=frz, minimum width=2.15cm] (dec) at (9.75,4.15) {Token decoder\\[-1pt]{\scriptsize $\hat T=\mathrm{LN}(\mu+\hat c B)$}};
\snow{$(dec.north east)+(-0.17,-0.17)$}
\draw[arr] (8.3,4.15) -- (dec.west);
\node (tok) at (11.55,4.15) {\includegraphics[width=0.95cm]{tokens_pred.png}};
\node[lbl] at (11.55,3.35) {$\hat T$: $1029{\times}1024$};
\draw[arr] (dec.east) -- (11.0,4.15);
\node[box=frz, minimum width=3.75cm, minimum height=1.75cm] (tr) at (14.35,4.15) {};
\node[font=\footnotesize, anchor=north] at ($(tr.north)+(0,-0.03)$) {TRELLIS.2-4B};
\snow{$(tr.north east)+(-0.17,-0.17)$}
\node[sub] (s1) at (13.17,4.12) {SS flow};
\node[sub] (s2) at (14.35,4.12) {SLat flow};
\node[sub] (s3) at (15.53,4.12) {decoder};
\draw[arr, line width=0.5pt] (s1) -- (s2); \draw[arr, line width=0.5pt] (s2) -- (s3);
\node[font=\scriptsize, text=black!75, anchor=south] at ($(tr.south)+(0,0.04)$) {CFG $w{=}50$, negative condition $\mathbf{0}$};
\draw[arr] (12.1,4.15) -- (tr.west);
\node at (17.0,4.25) {\includegraphics[width=1.2cm]{mesh_ours.png}};
\node[lbl] at (17.0,3.35) {3D mesh};
\draw[arr] (tr.east) -- (16.4,4.15);
% ---------------- (b) target
\node at (0.8,1.25) {\includegraphics[width=1.05cm]{stimulus_prep.png}};
\node[lbl] at (0.8,0.3) {stimulus, frame 24};
\node[box=frz] (dino) at (2.95,1.2) {DINOv3 ViT-L/16\\[-1pt]{\scriptsize GT tokens $T$}};
\snow{$(dino.north east)+(-0.17,-0.17)$}
\draw[arr] (1.38,1.2) -- (dino.west);
\node[box=frz] (pca) at (5.25,1.2) {PCA projection\\[-1pt]{\scriptsize $c=(T-\mu)B^{\top}$}};
\snow{$(pca.north east)+(-0.17,-0.17)$}
\draw[arr] (dino.east) -- (pca.west);
\fill[gtc] (6.550,1.200) rectangle (6.635,1.632);
\fill[gtc] (6.655,1.200) rectangle (6.740,1.415);
\fill[gtc] (6.760,1.200) rectangle (6.845,0.982);
\fill[gtc] (6.865,1.200) rectangle (6.950,1.011);
\fill[gtc] (6.970,1.200) rectangle (7.055,1.361);
\fill[gtc] (7.075,1.200) rectangle (7.160,0.960);
\fill[gtc] (7.180,1.200) rectangle (7.265,1.178);
\fill[gtc] (7.285,1.200) rectangle (7.370,1.352);
\fill[gtc] (7.390,1.200) rectangle (7.475,1.066);
\fill[gtc] (7.495,1.200) rectangle (7.580,1.054);
\fill[gtc] (7.600,1.200) rectangle (7.685,1.098);
\fill[gtc] (7.705,1.200) rectangle (7.790,1.090);
\fill[gtc] (7.810,1.200) rectangle (7.895,1.354);
\fill[gtc] (7.915,1.200) rectangle (8.000,1.361);
\fill[gtc] (8.020,1.200) rectangle (8.105,1.321);
\fill[gtc] (8.125,1.200) rectangle (8.210,1.086);
\draw[black!40, line width=0.3pt] (6.520,1.200) -- (8.230,1.200);
\node[lbl] at (7.39,0.3) {target $c\in\mathbb{R}^{16}$};
\draw[arr] (pca.east) -- (6.5,1.2);
\node[font=\scriptsize, text=bad, align=left, anchor=west] at (8.32,1.3) {$\|\hat c-c\|^2$\\$+\,\lambda\,\mathrm{InfoNCE}$\\(no class labels)};
% loss and shared basis
\draw[bad, line width=0.75pt, {Stealth[length=4pt]}-{Stealth[length=4pt]}] (7.39,1.75) -- (7.39,3.6);
\draw[bad, line width=0.75pt, -{Stealth[length=4pt]}] (7.39,2.85) -- (4.8,2.85) -- (4.8,3.58);
\draw[frzd, dashed, line width=0.7pt, -{Stealth[length=4pt]}] (5.9,1.77) -- (5.9,2.58) -- (9.75,2.58) -- (9.75,3.58);
\node[font=\scriptsize, text=frzd, fill=white, inner sep=1pt, anchor=west] at (10.0,2.7) {$\mu, B$ fit on 1200 training objects};
% ---------------- (c) example
\node at (11.0,1.3) {\includegraphics[width=1.35cm]{gt_points.png}};
\node at (12.9,1.3) {\includegraphics[width=1.35cm]{mesh_mind3d.png}};
\node at (14.8,1.3) {\includegraphics[width=1.35cm]{mesh_ours.png}};
\node at (16.7,1.3) {\includegraphics[width=1.35cm]{mesh_oracle.png}};
\node[lbl] at (11.0,0.3) {GT points\\[-2pt]\phantom{C}};
\node[lbl] at (12.9,0.3) {MinD-3D\\[-2pt]\textcolor{bad}{CD 21.78}};
\node[lbl] at (14.8,0.3) {\textbf{Ours}\\[-2pt]\textcolor{ok}{CD 3.49}};
\node[lbl] at (16.7,0.3) {GT image (bound)\\[-2pt]CD 0.33};
\end{tikzpicture}
\end{document}