diff options
Diffstat (limited to 'tikz')
-rw-r--r-- | tikz/asset/data.tex | 20 | ||||
-rw-r--r-- | tikz/attack/4att.tex | 20 | ||||
-rw-r--r-- | tikz/attack/attack.tex | 37 | ||||
-rw-r--r-- | tikz/attack/bin.tex | 18 | ||||
-rw-r--r-- | tikz/attack/bin_ens.tex | 31 | ||||
-rw-r--r-- | tikz/attack/ef.tex | 22 | ||||
-rw-r--r-- | tikz/attack/nobin_ens.tex | 31 | ||||
-rw-r--r-- | tikz/attack_mia.tex | 37 | ||||
-rw-r--r-- | tikz/chaussette/a.tex | 60 | ||||
-rw-r--r-- | tikz/chaussette/ba.tex | 70 | ||||
-rw-r--r-- | tikz/data.tex | 17 | ||||
-rw-r--r-- | tikz/synth/data.tex | 71 |
12 files changed, 434 insertions, 0 deletions
diff --git a/tikz/asset/data.tex b/tikz/asset/data.tex new file mode 100644 index 0000000..663b59c --- /dev/null +++ b/tikz/asset/data.tex @@ -0,0 +1,20 @@ +\makeatletter +\tikzset{ + database/.style={ + path picture={ + \draw (0, 1.5*\database@segmentheight) circle [x radius=\database@radius,y radius=\database@aspectratio*\database@radius]; + \draw (-\database@radius, 0.5*\database@segmentheight) arc [start angle=180,end angle=360,x radius=\database@radius, y radius=\database@aspectratio*\database@radius]; + \draw (-\database@radius,-0.5*\database@segmentheight) arc [start angle=180,end angle=360,x radius=\database@radius, y radius=\database@aspectratio*\database@radius]; + \draw (-\database@radius,1.5*\database@segmentheight) -- ++(0,-3*\database@segmentheight) arc [start angle=180,end angle=360,x radius=\database@radius, y radius=\database@aspectratio*\database@radius] -- ++(0,3*\database@segmentheight); + }, + minimum width=2*\database@radius + \pgflinewidth, + minimum height=3*\database@segmentheight + 2*\database@aspectratio*\database@radius + \pgflinewidth, + }, + database segment height/.store in=\database@segmentheight, + database radius/.store in=\database@radius, + database aspect ratio/.store in=\database@aspectratio, + database segment height=0.1cm, + database radius=0.25cm, + database aspect ratio=0.35, +} +\makeatother diff --git a/tikz/attack/4att.tex b/tikz/attack/4att.tex new file mode 100644 index 0000000..009b58a --- /dev/null +++ b/tikz/attack/4att.tex @@ -0,0 +1,20 @@ +\begin{tikzpicture} + + \def \h{4} + \def \s{1} + + \draw (0,0) rectangle (\h,\h); + \node (a) at (1,1) {$id$}; + + \draw (\h+\s,0) rectangle (2*\h+\s,\h); + \node (a) at (1,1) {$1-id$}; + + \draw (0,\h+\s) rectangle (\h,2*\h+\s); + \node (a) at (1,1) {$0$}; + + \draw (\h+\s,\h+\s) rectangle (2*\h+\s,2*\h+\s); + \node (a) at (1,1) {$1$}; + + +\end{tikzpicture} + diff --git a/tikz/attack/attack.tex b/tikz/attack/attack.tex new file mode 100644 index 0000000..9177ecd --- /dev/null +++ b/tikz/attack/attack.tex @@ -0,0 +1,37 @@ +\begin{tikzpicture} + + \def \h{-2} + + %Donnée utilisateur + \node[color=gray] (ludata) at (0,1) {User's data}; + \node (udata) at (0,-0.36) {}; + \draw[color=gray] (-4,0.5) rectangle (4,-0.5); + \node[rectangle,draw] (x) at (-2,0) {Input data}; + \node[rectangle,draw=red] (s) at (2,0) {Sensitive attribute}; + + %Modèle cible + \draw[color=gray] (-4.5,\h+0.5) rectangle (1.5,\h-2); + \node[color=gray] (lmcible) at (-1.5,\h-2.5) {Target model}; + + %Pipeline + \node[rectangle,draw] (model) at (0,\h) {Model}; + \node[rectangle,draw=blue] (inf) at (0,\h-1) {Classification}; + \node[rectangle,draw] (train) at (-3,\h) {Training}; + + \draw[->] (udata) to (model); + \draw[->] (model) to (inf); + \draw[->] (train) to (model); + + %Attaque + \node[rectangle,draw=blue] (att) at (5,\h) {Attack}; + + %\draw[->,color=blue] (x) to (att); + %\draw[->,color=blue] (model) to (att); + \draw[->,color=blue] (inf) to (att); + \draw[->,color=red] (att) to (s); + + + %\draw[color=red] (-2,0.5) rectangle (2,-0.5); + %\node[color=red] (cible) at (0,1) {Cible de l'attaque}; +\end{tikzpicture} + diff --git a/tikz/attack/bin.tex b/tikz/attack/bin.tex new file mode 100644 index 0000000..714ff6b --- /dev/null +++ b/tikz/attack/bin.tex @@ -0,0 +1,18 @@ +\begin{tikzpicture} + + \def \h{4} + + %Donnée utilisateur + \node[rectangle,draw=red] (s) at (2*\h,0) {Sensitive attribute}; + + %Pipeline + \node[rectangle,draw=blue] (inf) at (0,0) {Classification}; + + %Attaque + \node[rectangle,draw=blue] (att) at (\h,0) {Attack}; + + \draw[->,color=blue] (inf) to (att); + \draw[->,color=red] (att) to (s); + +\end{tikzpicture} + diff --git a/tikz/attack/bin_ens.tex b/tikz/attack/bin_ens.tex new file mode 100644 index 0000000..3a80a6b --- /dev/null +++ b/tikz/attack/bin_ens.tex @@ -0,0 +1,31 @@ +\begin{tikzpicture} + + \def \h{4} + + %Pipeline + \node[rectangle,draw=red] (s) at (2*\h,0) {Sensitive attribute}; + \node[rectangle,draw=blue] (inf) at (0,0) {Classification}; + \node[rectangle,draw=blue] (att) at (\h,0) {Attack}; + \draw[->,color=blue] (inf) to (att); + \draw[->,color=red] (att) to (s); + + %Ensembles + \node (c0) at (0,1) {$0$}; + \node (c1) at (0,2) {$1$}; + \node (c2) at (0,3) {$0$}; + \node (c3) at (0,4) {$\vdots$}; + + \node (a0) at (2*\h,1) {$1$}; + \node (a1) at (2*\h,2) {$0$}; + \node (a2) at (2*\h,3) {$1$}; + \node (a3) at (2*\h,4) {$\vdots$}; + + \draw[->] (c0) to (a0); + \draw[->] (c1) to (a1); + \draw[->] (c2) to (a2); + \draw[->] (c3) to (a3); + + + +\end{tikzpicture} + diff --git a/tikz/attack/ef.tex b/tikz/attack/ef.tex new file mode 100644 index 0000000..ed7da7f --- /dev/null +++ b/tikz/attack/ef.tex @@ -0,0 +1,22 @@ +\begin{tikzpicture} + + \def \h{4} + + %Pipeline + \node[rectangle,draw=red] (s) at (2*\h,0) {Sensitive attribute}; + \node[rectangle,draw=blue] (inf) at (0,0) {Classification}; + \node[rectangle,draw=blue] (att) at (\h,0) {Attack}; + \draw[->,color=blue] (inf) to (att); + \draw[->,color=red] (att) to (s); + + %Ensembles + \node (c0) at (0,1) {$E=\{0,\cdots,m-1\}$}; + + \node (a0) at (2*\h,1) {$F=\{0,\cdots,n-1\}$}; + + \draw[->] (c0) to (a0); + + + +\end{tikzpicture} + diff --git a/tikz/attack/nobin_ens.tex b/tikz/attack/nobin_ens.tex new file mode 100644 index 0000000..0d3b81a --- /dev/null +++ b/tikz/attack/nobin_ens.tex @@ -0,0 +1,31 @@ +\begin{tikzpicture} + + \def \h{4} + + %Pipeline + \node[rectangle,draw=red] (s) at (2*\h,0) {Sensitive attribute}; + \node[rectangle,draw=blue] (inf) at (0,0) {Classification}; + \node[rectangle,draw=blue] (att) at (\h,0) {Attack}; + \draw[->,color=blue] (inf) to (att); + \draw[->,color=red] (att) to (s); + + %Ensembles + \node (c0) at (0,1) {$0$}; + \node (c1) at (0,2) {$1$}; + \node (c2) at (0,3) {$2$}; + \node (c3) at (0,4) {$\vdots$}; + + \node (a0) at (2*\h,1) {$853$}; + \node (a1) at (2*\h,2) {$22$}; + \node (a2) at (2*\h,3) {$312$}; + \node (a3) at (2*\h,4) {$\vdots$}; + + \draw[->] (c0) to (a0); + \draw[->] (c1) to (a1); + \draw[->] (c2) to (a2); + \draw[->] (c3) to (a3); + + + +\end{tikzpicture} + diff --git a/tikz/attack_mia.tex b/tikz/attack_mia.tex new file mode 100644 index 0000000..e60137e --- /dev/null +++ b/tikz/attack_mia.tex @@ -0,0 +1,37 @@ +\begin{tikzpicture} + + \def \h{-2} + + %Donnée utilisateur + \node[color=gray] (ludata) at (0,1) {Donnée utilisateur}; + \node (udata) at (0,-0.36) {}; + \draw[color=gray] (-4,0.5) rectangle (4,-0.5); + \node[rectangle,draw] (x) at (-2,0) {Donnée d'entrée}; + \node[rectangle,draw=red] (s) at (2,0) {Attribut sensible}; + + %Modèle cible + \draw[color=gray] (-4.5,\h+0.5) rectangle (1.5,\h-2); + \node[color=gray] (lmcible) at (-1.5,\h-2.5) {Modèle cible}; + + %Pipeline + \node[rectangle,draw] (model) at (0,\h) {Modèle}; + \node[rectangle,draw=blue] (inf) at (0,\h-1) {Classification}; + \node[rectangle,draw] (train) at (-3,\h) {Entrainement}; + + \draw[->] (udata) to (model); + \draw[->] (model) to (inf); + \draw[->] (train) to (model); + + %Attaque + \node[rectangle,draw=blue] (att) at (5,\h) {Attaque}; + + %\draw[->,color=blue] (x) to (att); + %\draw[->,color=blue] (model) to (att); + \draw[->,color=blue] (model) to (att); + \draw[->,color=red] (att) to [bend right] (train); + + + %\draw[color=red] (-2,0.5) rectangle (2,-0.5); + %\node[color=red] (cible) at (0,1) {Cible de l'attaque}; +\end{tikzpicture} + diff --git a/tikz/chaussette/a.tex b/tikz/chaussette/a.tex new file mode 100644 index 0000000..1d001c2 --- /dev/null +++ b/tikz/chaussette/a.tex @@ -0,0 +1,60 @@ + +\begin{tikzpicture} +\def \h{4} +\node () at (0,1) {$X=0$}; +\node[rectangle,draw=bonus] (G0) at (0,0) {$\begin{matrix}\bigcirc&\bigcirc\\\bigcirc&\bigcirc\end{matrix}$}; +\node () at (\h,1) {$X=1$}; +\node[rectangle,draw=bonus] (G1) at (\h,0){$\begin{matrix}\bigcirc&\bigcirc&\bigtriangleup\\&\bigcirc&\bigtriangleup\end{matrix}$}; +\node () at (2*\h,1) {$X=2$}; +\node[rectangle,draw=bonus] (G2) at (2*\h,0){$\begin{matrix}\bigcirc&\bigcirc&\times\\&\bigcirc&\times\end{matrix}$}; + \pause + + \node (L0) at (0,-2) {$ + \begin{matrix} + P(Y=\bigcirc|X=\emph{0}) = 1\\[6pt] + P(Y=\bigtriangleup|X=\emph{0}) = 0\\[6pt] + P(Y=\times|X=\emph{0}) = 0 + \end{matrix} + $}; + \node (L1) at (\h,-2) {$ + \begin{matrix} + P(Y=\bigcirc|X=\emph{1}) = \frac{3}{5}\\[6pt] + P(Y=\bigtriangleup|X=\emph{1}) = \frac{2}{5}\\[6pt] + P(Y=\times|X=\emph{1}) = 0 + \end{matrix} + $}; + \node (L2) at (2*\h,-2) {$ + \begin{matrix} + P(Y=\bigcirc|X=\emph{2}) = \frac{3}{5}\\[6pt] + P(Y=\bigtriangleup|X=\emph{2}) =0 \\[6pt] + P(Y=\times|X=\emph{2}) = \frac{2}{5} + \end{matrix} + $}; + +\draw[->] (G0) to (L0); +\draw[->] (G1) to (L1); +\draw[->] (G2) to (L2); + +\draw (-2,-1) rectangle (1.9,-3); + \node (x0) at (0,-3) {}; +\draw (-2+\h,-1) rectangle (1.9+\h,-3); + \node (x1) at (\h,-3) {}; +\draw (-2+2*\h,-1) rectangle (1.9+2*\h,-3); +\pause + \draw[blue] (-2,-1) rectangle (1.9,-1.6); + \draw[blue] (-2+\h,-1) rectangle (1.9+\h,-1.6); + \draw[blue] (-2+2*\h,-1) rectangle (1.9+2*\h,-1.6); +\pause + \node (x2) at (2*\h,-3) {}; + + \node (f0) at (0,-4) {$f(\emph{0}) = \bigcirc$}; + \node (f1) at (\h,-4) {$f(\emph{1}) = \bigcirc$}; + \node (f2) at (2*\h,-4) {$f(\emph{2}) = \bigcirc$}; + + \draw[->] (x0) to (f0); + \draw[->] (x1) to (f1); + \draw[->] (x2) to (f2); + \pause +\node[anchor=west] () at (-2,-4.5) {Exactitude $=\frac{10}{14}(\approx 0.7)$}; +\node[anchor=west] () at (-2,-5) {$A(\bigcirc)=1$~$A(\bigtriangleup)=0$~$A(\times)=0$ Exactitude équilibrée $=\frac{1}{3}$}; +\end{tikzpicture} diff --git a/tikz/chaussette/ba.tex b/tikz/chaussette/ba.tex new file mode 100644 index 0000000..b1cc883 --- /dev/null +++ b/tikz/chaussette/ba.tex @@ -0,0 +1,70 @@ + +\begin{tikzpicture} +\def \h{4} +\node () at (-1.5,-1) {$Y=\bigcirc$}; + \node[rectangle,draw=,anchor=north] (G0) at (0,0) {$\begin{matrix}0&0\\0&0\\1&1\\&1\\2&2\\&2\end{matrix}$}; +\node () at (\h-1.5,-1) {$Y=\bigtriangleup$}; + \node[rectangle,draw=,anchor=north] (G1) at (\h,0){$\begin{matrix}1&1\end{matrix}$}; +\node () at (2*\h-1.5,-1) {$Y=\times$}; + \node[rectangle,draw=,anchor=north] (G2) at (2*\h,0){$\begin{matrix}2&2\end{matrix}$}; + \pause + \node (L0) at (0,-4.5) {$ + \begin{matrix} + P(X=\emph{0}|Y=\bigcirc) = \frac{4}{10}\\[6pt] + P(X=\emph{1}|Y=\bigcirc) = \frac{3}{10}\\[6pt] + P(X=\emph{2}|Y=\bigcirc) = \frac{3}{10} + \end{matrix} + $}; + \node (L1) at (\h,-4.5) {$ + \begin{matrix} + P(X=\emph{0}|Y=\bigtriangleup) = 0\\[6pt] + P(X=\emph{1}|Y=\bigtriangleup) = 1\\[6pt] + P(X=\emph{2}|Y=\bigtriangleup) = 0 + \end{matrix} + $}; + \node (L2) at (2*\h,-4.5) {$ + \begin{matrix} + P(X=\emph{0}|Y=\times) = 0\\[6pt] + P(X=\emph{1}|Y=\times) = 0\\[6pt] + P(X=\emph{2}|Y=\times) =1 + \end{matrix} + $}; + +\draw[->] (G0) to (L0); +\draw[->] (G1) to (L1); +\draw[->] (G2) to (L2); + + \def \s{0.6} + \def \o{0} +\draw (-2,-3.5) rectangle (1.9+2*\h,-4.1); + \node (x0) at (-2-\o,-3.5-\o) {}; +\draw (-2,-3.6-\s) rectangle (1.9+2*\h,-4.2-\s); + \node (x1) at (-2-\o,-3.6-\s-\o) {}; +\draw (-2,-3.7-2*\s) rectangle (1.9+2*\h,-4.3-2*\s); + \node (x2) at (-2-\o,-3.7-2*\s-\o) {}; + + \pause + \draw[blue] (-2,-3.5) rectangle (2,-4.1); + \draw[blue] (-2+\h,-3.6-\s) rectangle (2+\h,-4.2-\s); + \draw[blue] (-2+2*\h,-3.7-2*\s) rectangle (1.9+2*\h,-4.3-2*\s); + \pause + + \node[anchor=west] () at (-2,-6) {$f(\emph{2}) = \times$}; + \node[anchor=west] () at (-2,-6-\s) {$f(\emph{1}) = \bigtriangleup$}; + \node[anchor=west] () at (-2,-6-2*\s) {$f(\emph{0}) = \bigcirc$}; + + \node[anchor=west] (f2) at (-2.1,-6) {}; + \node[anchor=west] (f1) at (-2.1,-6-\s) {}; + \node[anchor=west] (f0) at (-2.1,-6-2*\s) {}; + + + \draw[->] (x0) to[bend right] (f0); + \draw[->] (x1) to[bend right] (f1); + \draw[->] (x2) to[bend right] (f2); + + \pause + + \node[anchor=west] () at (1,-6) {Exactitude $=\frac{8}{14}(\approx 0.57)$}; + \node[anchor=west] () at (1,-6.5) {$A(\bigcirc)=\frac{4}{10}$~$A(\bigtriangleup)=1$~$A(\times)=1$}; + \node[anchor=west]() at (1,-7) {Exactitude équilibré $=\frac{24}{30}=0.8$}; +\end{tikzpicture} diff --git a/tikz/data.tex b/tikz/data.tex new file mode 100644 index 0000000..62a09d0 --- /dev/null +++ b/tikz/data.tex @@ -0,0 +1,17 @@ +\input{tikz/asset/data} +\begin{tikzpicture} + \node[database,label={[align=center]above:Donnée\\cible}] (base) at (0,0) {}; + \node[rectangle,draw,align=center] (cible) at (10,0) {Modèle\\cible}; + \draw[->,align=center] (base) to[bend left] node[midway,above] {80\% entraînement\\sans attribut sensible} (cible); + \draw[->,blue] (base) to[bend right] node[midway,below] (test) {20\% évaluation} (cible); + \pause + \node[database,label={[align=left]right:Donnée\\auxiliaire}] (aux) at (10,-4.5) {}; + \draw[->] (test) to[out=-90,in=90] node[midway,above] {\hspace{50px}Attribut sensible} (aux); + \draw[->,blue] (cible) to node[midway,right] {Prédiction} (aux); + \pause + \node[rectangle,draw,align=center] (attaque) at (3,-4.5) {Modèle\\AIA}; + \draw[->] (aux) to node[midway,below] {80\% entraînement} (attaque); + \draw[->] (aux) to node[midway,above] {20\% évaluation} (attaque); + \node[rectangle,align=center] (result) at (0,-4.5) {Exactitude\\équilibrée}; + \draw[->] (attaque) to (result); +\end{tikzpicture} diff --git a/tikz/synth/data.tex b/tikz/synth/data.tex new file mode 100644 index 0000000..c06a06a --- /dev/null +++ b/tikz/synth/data.tex @@ -0,0 +1,71 @@ +\input{tikz/asset/data} + + +\begin{tikzpicture} + \def\h{3.5} %décalage modèle + \def\i{1.5} %décalage split + \def\j{4.5} %décalage données synthétique + + %\draw[fill=red] (-1.1,1) rectangle (7.2,-2.5); + %\draw[fill=green] (-1.1,-2.5) rectangle (7.2,-5); + %\draw[fill=blue] (-1.1,-5) rectangle (7.2,-8); + %\draw[fill=white,fill opacity=0.8] (-1.1,1) rectangle (7.2,-8); + + %\node[single arrow, anchor=west, very thick, fill=lightgray, fill opacity=0.9, + % minimum width = 30pt, single arrow head extend=3pt, + % minimum height=89mm, + % rotate=-90] () at (3,1){}; + + \node[database,label={[align=left]left:Données\\réelles}] (d) at (0,0){}; + \node[rectangle,draw,align=center] (overfit) at (2,0) {OVR\\CTRL}; + \draw[->] (d) to node[midway,above] {80\%} (overfit); + \node[database,label=above:$m$] (realtr) at (4,0){}; + \draw[->] (overfit) to (realtr); + \node[rectangle,draw,align=center] (gen) at (6+\h,0) {Modèle\\génératif}; + \draw[->] (realtr) to node[midway,above] {entraînement} (gen); + \pause + + \node[database,label={[align=left]right:Données\\synthétiques}] (syn) at (5+\j,-2) {}; + \draw[->] (gen) to (syn); + \node[database,label=below:$\bar{m}$] (realte) at (0,-1.5) {}; + \draw[->,blue] (d) to node[midway,left] {20\%}(realte); + \node[rectangle,draw,align=center] (tarmod) at (2,-2) {Modèle\\cible}; + \draw[->,blue] (realte) to[out=0,in=130] node[midway,above] {eval} (tarmod); + \draw[->,red] (realtr) to node[midway,right] {eval} (tarmod); + \draw[->] (syn) to[out=180,in=0] node[midway,above] {entraînement} (tarmod); + \pause + \node[database,label={[align=center]left:coût\\$\bar{m}$}] (miam) at (1.5,-5) {}; + \node[database,label={[align=center]right:coût\\$m$}] (mian) at (2.5,-5) {}; + \node[database,label={[align=center]below:Base\\MIA}] (mia) at (2,-6.5) {}; + \draw[->,blue] (tarmod) to node[midway,fill=white] (aiabranch) {\small prédiction} (miam); + \draw[->,red] (tarmod) to (mian); + \draw[->,blue] (miam) to (mia); + \draw[->,red] (mian) to (mia); + + \node[database,label=above:Entraînement] (miatr) at (4+\i,-6.5) {}; + \node[database,label=below:Evaluation] (miate) at (4+\i,-7) {}; + \draw[->] (mia) to node[midway,above] {80\%} (miatr); + \draw[->] (mia) to node[midway,below] {20\%} (miate); + \node[rectangle,draw,align=center] (miamod) at (6.5+\h,-6) {Modèle\\MIA}; + \draw[->] (miatr) to node[midway,above] {entraînement} (miamod); + \node[align=center] (miares) at (6.5+\h,-7) {Résultat\\MIA}; + \draw[->] (miate) to node[midway,below] {eval} (miamod); + \draw[->] (miamod) to (miares); + \pause + + \node[blue,database,label={[align=center]above:Base\\AIA}] (aiad) at (3.2,-3.6){}; + \node[align=center] (ures) at (-1,-3.6) {Résultat\\utilité}; + \draw[->,blue] (aiabranch) to (aiad); + \draw[->,blue] (aiabranch) to (ures); + \node[database,label=above:Entraînement] (aiatr) at (4.5+\i,-3.6) {}; + \node[database,label=below:Evaluation] (aiate) at (4.5+\i,-4.1) {}; + \draw[->] (aiad) to node[midway,above] {80\%} (aiatr); + \draw[->] (aiad) to node[midway,below] {20\%} (aiate); + \node[rectangle,draw,align=center] (aiamod) at (6.5+\h,-3.8) {Modèle\\AIA}; + + \draw[->] (aiatr) to node[midway,above] {entraînement} (aiamod); + \draw[->] (aiate) to node[midway,below] {eval} (aiamod); + \node[align=center] (aiares) at (6.5+\h,-5) {Résultat\\AIA}; + \draw[->] (aiamod) to (aiares); +\end{tikzpicture} + |