\documentclass[aspectratio=169]{beamer} % "Beamer" is a word used in Germany to mean video projector. 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% N.B. : to compile these slides, you should use
%        lualatex -shell-escape ot_lddmm.tex
%        bibtex ot_lddmm
%        lualatex -shell-escape ot_lddmm.tex
%
% Don't forget to install the 'metropolis' theme from github.
% If the file is a tad too heavy, you can try
% to use the pre-rendered 'pdfpc' for display.
%
% Cheers,
%                    Jean.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




\RequirePackage{luatex85}

\usetheme{metropolis} % Search online for beamer themes to find your favorite or use the Berkeley theme as in this file.

%\setsansfont{Overlock} % cute !
%\setsansfont{Alegreya Sans}

\usepackage{color} % It may be necessary to set PCTeX or whatever program you are using to output a .pdf instead of a .dvi file in order to see color on your screen.
\usepackage[utf8x]{inputenc}   % LaTeX, comprends les accents !
%\usepackage[T1]{fontenc}      % Police contenant les caractÃ¨res franÃ§ais
\usepackage[english,french]{babel}  % Placez ici une liste de langues, la
                              % derniÃ¨re Ã©tant la langue principale
\usepackage{marginnote}
\usepackage{graphicx}
\usepackage{multimedia}

\usepackage{tikz}
\usepackage{pgffor}
\newcommand\mytikzmark[3][]{%
  \tikz[remember picture,baseline=(#2.base)]{\node(#2)[outer sep=0pt,#1]{#3};}%
}

\usepackage{minted}

\usepackage{float}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{subcaption}
\usepackage{hyperref}
\usepackage[normalem]{ulem}
\usepackage{makecell}

\renewcommand{\d}{\mathrm{d}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
%\newcommand{\C}{\mathbb{C}}
\newcommand{\telque}{~|~}
\newcommand{\ilexiste}{\exists~}
\newcommand{\pourtout}{\forall~}
\newcommand{\non}{\neg\,}
\renewcommand{\t}[1]{#1^{\mathsf{T}}}
\renewcommand{\phi}{\varphi}
\newcommand{\fou}[1]{\widehat{#1}}
\newcommand{\zp}[2][p]{%
  \!\IfStrEqCase{#1}{%
    {p}{\left(}%
    {c}{\:\left[}%
    {a}{\left\{}%
    {abs}{\left|}%
    {n}{\left\|}%
    {s}{\left<}%
    {i}{\left[\!\left[}%
  }[\left(]%
    #2%
  \IfStrEqCase{#1}{%
    {p}{\right)}%
    {c}{\right]}%
    {a}{\right\}}%
    {abs}{\right|}%
    {n}{\right\|}%
    {s}{\right>}%
    {i}{\right]\!\right]}%
  }[\right)]%
} 

\theoremstyle{definition}
%\newtheorem{definition}{Définition}
\newtheorem{dfn}{Définition}

\theoremstyle{plain}
\newtheorem{theoreme}{Théorème}
\newtheorem{lemme}{Lemme}
\newtheorem{proposition}{Proposition}

\theoremstyle{remark}
\newtheorem{rque}{Remarque}
\newtheorem{rques}[rque]{Remarques}
\newtheorem{propriete}{Propriété}
\newtheorem{exemple}{Exemple}
\newtheorem{exercice}{Exercice}

%\theoremstyle{definition} % See Lesson Three of the LaTeX Manual for more on this kind of "proclamation."
%\newtheorem*{dfn}{A Reasonable Definition}               

\usepackage{appendixnumberbeamer}

\usepackage{booktabs}
\usepackage[scale=2]{ccicons}

\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}

\usepackage{xspace}
\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}

\definecolor{x}{RGB}{8,8,153}
\definecolor{y}{RGB}{153,8,8}
\definecolor{c}{RGB}{0,100,0}
\definecolor{k}{RGB}{0,100,0}
\definecolor{q}{RGB}{60,60,200}
\definecolor{v}{RGB}{60,180,200}
\definecolor{p}{RGB}{30,140,210}
%\definecolor{phi}{RGB}{130,130,130}
\definecolor{phi}{RGB}{100,123,139}
\definecolor{gamma}{RGB}{100,123,139}

\newcommand{\xc}[1]{\textcolor{x}{#1}}
\newcommand{\yc}[1]{\textcolor{y}{#1}}

\title{``Réseaux de neurones'' artificiels}
\subtitle{Les questions à poser}
\date{}
\author{Jean Feydy}
\institute{HeKA team, Inria, Inserm, Université Paris-Cité, PRAIRIE-PSAI}

\metroset{subsectionpage=progressbar,
          progressbar=frametitle,
          block=fill}

\begin{document}

\maketitle


\begin{frame}{Aujourd'hui}

\vspace{.2cm}
Réseaux de neurones~?\\
\hspace*{10mm} Une généralisation de la \textbf{régression linéaire}\\
\hspace*{10mm} à des modèles plus complexes.

\vspace{.4cm}

Et ça marche~? En général, \textbf{non}.\\
\hspace*{10mm} Par contre, cette idée permet aujourd'hui de produire\\
\hspace*{10mm} d'excellents \textbf{détecteurs de motifs}.

\vspace{.6cm}

\begin{center}
En tant que médecins, quel \textbf{regard critique}\\
pouvez-vous porter sur ces techniques~?
\end{center}
\end{frame}


\section{Que lit-on sur une radio ?}


\begin{frame}{Une image~: trois niveaux d'analyse~\cite{heart_raw, heart_pop}}

	\vspace{-.5cm}
	\begin{align*}
		\onslide<2->{ \text{1. Texture} }&&
		\onslide<3->{ \text{2. Anatomie} } &&
		\onslide<5->{ \text{3. Fonction} }
	\end{align*}

	\begin{figure}
		\centering %
		\only<1-2>{ \includegraphics[height=.7\textheight]{images/hearts/heart_raw.png} }%
		\only<3-4>{ \includegraphics[height=.7\textheight]{images/hearts/heart_segmented.png} }%
		%\only<4>{ \includegraphics[height=.7\textheight]{images/hearts/dev_coeurs_2.png} }%
		\only<5>{ \includegraphics[height=.7\textheight]{images/hearts/hearts_0.png} }%
		\only<6>{ \includegraphics[height=.7\textheight]{images/hearts/hearts_1.png} }%
		\only<7>{ \includegraphics[height=.7\textheight]{images/hearts/hearts_2.png} }%
		\only<8>{ \includegraphics[height=.7\textheight]{images/hearts/hearts_3.png} }%
		\only<9>{ \includegraphics[height=.7\textheight]{images/hearts/hearts_4.png} }%
		\only<10>{ \includegraphics[height=.7\textheight]{images/hearts/hearts_5.png} }%
		\only<11>{ \includegraphics[height=.7\textheight]{images/hearts/hearts_6.png} }%
		\only<12>{ \includegraphics[height=.7\textheight]{images/hearts/hearts_7.png} }%
		\only<13>{ \includegraphics[height=.7\textheight]{images/hearts/hearts_8.png} }%
		\only<14>{ \includegraphics[height=.7\textheight]{images/hearts/hearts_9.png} }%
		\only<15>{ \includegraphics[height=.7\textheight]{images/hearts/hearts_0.png} }%
		\onslide<16->{ 
			\begin{center}
			Chacun de ces niveaux d'abstraction peut être\\
			\textbf{modélisé} en se reposant sur le précédent. \\ ~\\

			\onslide<17>{
				Découvrons la plus fondamentale de toutes ces théories:\\
				l'analyse par \textbf{filtrage multi-résolution}.
			}
			\vfill
			\end{center}
		 }%
	\end{figure}
\end{frame}



\begin{frame}{Le filtrage, ou ``produit de convolution''}
	\textbf{Convolution} (i.e. moyenne pondérée des pixels voisins)~:\\
	\hspace*{10mm} Généralisation peu coûteuse du \textbf{produit} ``$a\cdot \xc{x}$'',\\
	\hspace*{10mm} paramétrée par les coefficients d'un petit filtre $\varphi$.

	\vspace{1cm}
    \begin{center}
	\begin{tabular}{ccccc}
		\begin{minipage}{1cm}
		\only<1>{ \includegraphics[width=\linewidth]{images/convolution/filter_1.png} }
		\only<2>{ \includegraphics[width=\linewidth]{images/convolution/filter_2.png} }
		\only<3>{ \includegraphics[width=\linewidth]{images/convolution/filter_3.png} }
		\only<4>{ \includegraphics[width=\linewidth]{images/convolution/filter_4.png} }
		\only<5>{ \includegraphics[width=\linewidth]{images/convolution/filter_5.png} }
		\only<6>{ \includegraphics[width=\linewidth]{images/convolution/filter_6.png} }
		\only<7>{ \includegraphics[width=\linewidth]{images/convolution/filter_7.png} }
		\only<8>{ \includegraphics[width=\linewidth]{images/convolution/filter_8.png} }
		\end{minipage}
		& 
		\begin{minipage}{1cm} \vspace{-.5cm} {\huge $~\star$ } \end{minipage}
		&
		\begin{minipage}{3cm}
		\only<1>{ \includegraphics[width=\linewidth]{images/convolution/filtered_1.png} }
		\only<2>{ \includegraphics[width=\linewidth]{images/convolution/filtered_1.png} }
		\only<3>{ \includegraphics[width=\linewidth]{images/convolution/filtered_1.png} }
		\only<4>{ \includegraphics[width=\linewidth]{images/convolution/filtered_1.png} }
		\only<5>{ \includegraphics[width=\linewidth]{images/convolution/filtered_1.png} }
		\only<6>{ \includegraphics[width=\linewidth]{images/convolution/filtered_1.png} }
		\only<7>{ \includegraphics[width=\linewidth]{images/convolution/filtered_1.png} }
		\only<8>{ \includegraphics[width=\linewidth]{images/convolution/filtered_1.png} }
		\end{minipage}
		& 
		\begin{minipage}{1cm} \vspace{.1cm} {\huge $~~=~~$ } \end{minipage}
		 &
		\begin{minipage}{3cm}
		\only<1>{ \includegraphics[width=\linewidth]{images/convolution/filtered_1.png} }
		\only<2>{ \includegraphics[width=\linewidth]{images/convolution/filtered_2.png} }
		\only<3>{ \includegraphics[width=\linewidth]{images/convolution/filtered_3.png} }
		\only<4>{ \includegraphics[width=\linewidth]{images/convolution/filtered_4.png} }
		\only<5>{ \includegraphics[width=\linewidth]{images/convolution/filtered_5.png} }
		\only<6>{ \includegraphics[width=\linewidth]{images/convolution/filtered_6.png} }
		\only<7>{ \includegraphics[width=\linewidth]{images/convolution/filtered_7.png} }
		\only<8>{ \includegraphics[width=\linewidth]{images/convolution/filtered_8.png} }
		\end{minipage} \\
		$\varphi$ && $\xc{x}$ && \only<1-5>{$\varphi \star \xc{x}$}\only<6->{$|\varphi \star \xc{x}|$}
	\end{tabular}
    \end{center}
\end{frame}

\begin{frame}{A priori multi-échelles sur les images}
	Théorie des \textbf{ondelettes} (Meyer, Mallat, Daubechies...)~:\\
	\hspace*{10mm} Petits filtres + dé-zooms en cascade~\cite{mallatcnn}:

	\vspace{.2cm}
    \begin{center}
	\includegraphics[width=.7\linewidth]{images/wavelet.png}
    \end{center}
	%\pause
	\begin{center}
	\begin{tabular}{ccc}
		Image & $\longrightarrow$& Coefficients pertinents \\
		$\simeq$~~Audio ``.wav'' & $\longrightarrow$& Partition
	\end{tabular}
	\end{center}
	%\pause
	\vspace{-.2cm}
	\begin{center}
		$\Longrightarrow~~~$ Format \textbf{JPEG 2000}, standard du cinéma numérique.
	\end{center}
\end{frame}









\section{Voilà pour les modèles classiques.\\Quid des réseaux de neurones ?}

\begin{frame}{``Apprentissage supervisé''~~=~~ régression}
  On dispose~:
  \begin{itemize}[<+->]

    \item D'une base de données~~ $\{ \, (\xc{x_1}\rightarrow \yc{y_1}), \, (\xc{x_2}\rightarrow \yc{y_2}), \, \dots\, \}$.

    \item D'un modèle explicatif

    \begin{center}
    \tikzset{var/.style={}}

    \begin{figure}[h]
    \centering
      \begin{tikzpicture}[remember picture]
    
        \coordinate  (Eq1) at (0,0);
    
        \node at (Eq1) {$F\,(\,\mytikzmark[var]{w}{$\mathbf{w}$}\,;\,\mytikzmark[var]{x}{$\xc{x}$}\,)
        ~~\rightarrow~~ \mytikzmark[var]{y}{$\yc{y}$} ,$};
        \node[anchor=mid] (yy) at (2.5, -1) {\yc{sortie}};
        \node[anchor=mid] (ww) at ( -2.5, -1) {paramètres};
        \node[anchor=mid] (xx) at ( -0.2, -1) {\xc{entrée}};
        \draw[->,>=latex, color=red!65!black] (y)  to[in=130, out=-60] (yy);
        \draw[->,>=latex]                     (w)  to[in=60, out=-120 ] (ww);
        \draw[->,>=latex, color=blue!65!black] (x)  to[in=90,out=-90 ] (xx);

    \end{tikzpicture}
    \end{figure}
  \end{center}

  \end{itemize}

  %\pause
  \begin{center}
  Trouvons, pas-à-pas, un choix $\mathbf{w}_{\text{optimal}}$ des paramètres qui minimise\\
  \textbf{l'erreur moyenne sur les prédictions}.
  \end{center}
\end{frame}

\begin{frame}{Un jeu de donnée jouet, en dimension~1}
	\begin{figure}
		\centering
		\includegraphics<1>[width=.7\linewidth]{images/regression/dataset/data_1.png}%
		\includegraphics<2>[width=.7\linewidth]{images/regression/dataset/data_2.png}%
		\includegraphics<3>[width=.7\linewidth]{images/regression/dataset/data_3.png}%
		\includegraphics<4>[width=.7\linewidth]{images/regression/dataset/data_4.png}%
		\includegraphics<5>[width=.7\linewidth]{images/regression/dataset/data_5.png}%
		\includegraphics<6>[width=.7\linewidth]{images/regression/dataset/data_6.png}%
		\includegraphics<7>[width=.7\linewidth]{images/regression/dataset/data_7.png}%
		\includegraphics<8>[width=.7\linewidth]{images/regression/dataset/data_8.png}%
		\includegraphics<9-9>[width=.7\linewidth]{images/regression/dataset/data_9.png} %
	\end{figure}
\end{frame}

\begin{frame}{Exemple fondamental~: la régression linéaire}
	\begin{figure}
		\centering
		\includegraphics<1>[width=.7\linewidth]{images/regression/poly_1/plot_0.png}%
		\includegraphics<2>[width=.7\linewidth]{images/regression/poly_1/plot_1.png}%
		\includegraphics<3>[width=.7\linewidth]{images/regression/poly_1/plot_2.png}%
		\includegraphics<4>[width=.7\linewidth]{images/regression/poly_1/plot_3.png}%
		\includegraphics<5>[width=.7\linewidth]{images/regression/poly_1/plot_5.png}%
		\includegraphics<6>[width=.7\linewidth]{images/regression/poly_1/plot_10.png}%
		\includegraphics<7>[width=.7\linewidth]{images/regression/poly_1/plot_20.png}%
		\includegraphics<8>[width=.7\linewidth]{images/regression/poly_1/plot_50.png}%
		\includegraphics<9>[width=.7\linewidth]{images/regression/poly_1/plot_100.png}%
		\includegraphics<10-10>[width=.7\linewidth]{images/regression/poly_1/plot_157.png}%
	\end{figure}
\end{frame}


\begin{frame}{Un modèle plus complexe~: la régression quadratique}
	\begin{figure}
		\centering
		\includegraphics<1>[width=.7\linewidth]{images/regression/poly_2/plot_0.png}%
		\includegraphics<2>[width=.7\linewidth]{images/regression/poly_2/plot_1.png}%
		\includegraphics<3>[width=.7\linewidth]{images/regression/poly_2/plot_2.png}%
		\includegraphics<4>[width=.7\linewidth]{images/regression/poly_2/plot_3.png}%
		\includegraphics<5>[width=.7\linewidth]{images/regression/poly_2/plot_5.png}%
		\includegraphics<6>[width=.7\linewidth]{images/regression/poly_2/plot_10.png}%
		\includegraphics<7>[width=.7\linewidth]{images/regression/poly_2/plot_20.png}%
		\includegraphics<8>[width=.7\linewidth]{images/regression/poly_2/plot_50.png}%
		\includegraphics<9>[width=.7\linewidth]{images/regression/poly_2/plot_100.png}%
		\includegraphics<10>[width=.7\linewidth]{images/regression/poly_2/plot_200.png}%
		\includegraphics<11-12>[width=.7\linewidth]{images/regression/poly_2/plot_205.png}%
	\end{figure}
\end{frame}

% \begin{frame}{Un modèle plus complexe~: la régression polynomiale d'ordre~4}
% 	\begin{figure}
% 		\centering
% 		\includegraphics<1>[width=\linewidth]{images/regression/poly_4/plot_0.png} %
% 		\includegraphics<2>[width=\linewidth]{images/regression/poly_4/plot_1.png} %
% 		\includegraphics<3>[width=\linewidth]{images/regression/poly_4/plot_2.png} %
% 		\includegraphics<4>[width=\linewidth]{images/regression/poly_4/plot_3.png} %
% 		\includegraphics<5>[width=\linewidth]{images/regression/poly_4/plot_5.png} %
% 		\includegraphics<6>[width=\linewidth]{images/regression/poly_4/plot_10.png} %
% 		\includegraphics<7>[width=\linewidth]{images/regression/poly_4/plot_20.png} %
% 		\includegraphics<8>[width=\linewidth]{images/regression/poly_4/plot_50.png} %
% 		\includegraphics<9>[width=\linewidth]{images/regression/poly_4/plot_100.png} %
% 		\includegraphics<10>[width=\linewidth]{images/regression/poly_4/plot_200.png} %
% 		\includegraphics<11>[width=\linewidth]{images/regression/poly_4/plot_500.png} %
% 		\includegraphics<12>[width=\linewidth]{images/regression/poly_4/plot_1000.png} %
% 		\includegraphics<13>[width=\linewidth]{images/regression/poly_4/plot_2000.png} %
% 		\includegraphics<14-15>[width=\linewidth]{images/regression/poly_4/plot_5000.png} %
% 	\end{figure}
% \end{frame}

% \begin{frame}{Complexifions le modèle par l'ajout de variables intermédiaires...}
% 	\begin{figure}
% 		\centering
% 		\includegraphics<1>[width=\linewidth]{images/regression/linear_2/plot_1.png} %
% 		\includegraphics<2>[width=\linewidth]{images/regression/linear_2/plot_5.png} %
% 		\includegraphics<3>[width=\linewidth]{images/regression/linear_2/plot_20.png} %
% 		\includegraphics<4>[width=\linewidth]{images/regression/linear_2/plot_50.png} %
% 		\includegraphics<5>[width=\linewidth]{images/regression/linear_2/plot_100.png} %
% 		\includegraphics<6-7>[width=\linewidth]{images/regression/linear_2/plot_141.png} %
% 	\end{figure}
% \end{frame}

% \begin{frame}{Et l'introduction de non-linéarités -- des coudes~!}
\begin{frame}{Complexifions le modèle par l'ajout de variables intermédiaires...}
	\begin{figure}
		\centering
		\includegraphics<1>[width=.7\linewidth]{images/regression/single_2/plot_1.png}%
		\includegraphics<2>[width=.7\linewidth]{images/regression/single_2/plot_5.png}%
		\includegraphics<3>[width=.7\linewidth]{images/regression/single_2/plot_10.png}%
		\includegraphics<4>[width=.7\linewidth]{images/regression/single_2/plot_20.png}%
		\includegraphics<5>[width=.7\linewidth]{images/regression/single_2/plot_50.png}%
		\includegraphics<6>[width=.7\linewidth]{images/regression/single_2/plot_100.png}%
		\includegraphics<7>[width=.7\linewidth]{images/regression/single_2/plot_179.png}%
		\includegraphics<8>[width=.7\linewidth]{images/regression/single_2/plot_a.png}%
		\includegraphics<9>[width=.7\linewidth]{images/regression/single_2/plot_b.png}%
		\includegraphics<10>[width=.7\linewidth]{images/regression/single_2/plot_c.png}%
		\includegraphics<11>[width=.7\linewidth]{images/regression/single_2/plot_d.png}%
	\end{figure}
\end{frame}

% \begin{frame}{On peut alors augmenter le nombre de ``neurones''...}
% 	\begin{figure}
% 		\centering
% 		\includegraphics<1>[width=\linewidth]{images/regression/single_4/plot_1.png} %
% 		\includegraphics<2>[width=\linewidth]{images/regression/single_4/plot_10.png} %
% 		\includegraphics<3>[width=\linewidth]{images/regression/single_4/plot_20.png} %
% 		\includegraphics<4>[width=\linewidth]{images/regression/single_4/plot_50.png} %
% 		\includegraphics<5>[width=\linewidth]{images/regression/single_4/plot_100.png} %
% 		\includegraphics<6-7>[width=\linewidth]{images/regression/single_4/plot_164.png} %
% 	\end{figure}
% \end{frame}

\begin{frame}{On peut alors augmenter le nombre de ``neurones'' et de couches~!}
	\begin{figure}
		\centering
		\includegraphics<1>[width=.7\linewidth]{images/regression/dual_100x100/plot_0.png}%
		\includegraphics<2>[width=.7\linewidth]{images/regression/dual_100x100/plot_2.png}%
		\includegraphics<3>[width=.7\linewidth]{images/regression/dual_100x100/plot_3.png}%
		\includegraphics<4>[width=.7\linewidth]{images/regression/dual_100x100/plot_50.png}%
		\includegraphics<5>[width=.7\linewidth]{images/regression/dual_100x100/plot_100.png}%
		\includegraphics<6>[width=.7\linewidth]{images/regression/dual_100x100/plot_200.png}%
		\includegraphics<7>[width=.7\linewidth]{images/regression/dual_100x100/plot_500.png}%
		\includegraphics<8>[width=.7\linewidth]{images/regression/dual_100x100/plot_1000.png}%
		\includegraphics<9>[width=.7\linewidth]{images/regression/dual_100x100/plot_2000.png}%
		\includegraphics<10-11>[width=.7\linewidth]{images/regression/dual_100x100/plot_4279.png}%
	\end{figure}
\end{frame}


\begin{frame}{Les réseaux de neurones, en bref}
  \begin{itemize} %[<+->]
	\item Généralisation de la \textbf{régression linéaire} à des modèles arbitraires.
	\item Introduction de \textbf{variables intermédiaires} et de \textbf{coudes}.
	\item Entraînement \textbf{naïf} (barre souple + ressorts).
  \end{itemize}
  \vspace{.5cm}
  	%\pause
  \begin{center}
	Réseau de neurones générique \\ 
	$~~\simeq~~$ \textbf{Interpolation} entre les échantillons de la BDD.\\[.5cm] %\pause
	\textbf{Est-ce suffisant~?}
  \end{center}
\end{frame}


\begin{frame}{Analyse d'images $~~\neq~~$ Big Data générique}
	%\pause

	\vspace{-.2cm}
	\hspace{-.2cm}

	\begin{center}
	\begin{tikzpicture}[scale=.6]
	\begin{scope}[xshift = 0cm]
		\draw[->,>=latex,thick] (-.5,0)--(4.7,0);
		\foreach \x in {0,1,2,3,4}
		{
			\pgfmathtruncatemacro{\mycol}{10+20*\x}
			\fill[color=green!\mycol!blue] (\x,0) circle (0.1cm);
		}
		\node[anchor=mid] at (2,-1) {1 nombre};
		\node[anchor=mid] at (2,-1.9) {~$\rightarrow$~$5$ échantillons};
	\end{scope}
	%\pause

	\begin{scope}[xshift = 7.5cm]
		\draw[->,>=latex,thick] (-.5,0)--(4.7,0);
		\draw[->,>=latex,thick] (0,-.5)--(0,4.7);
		\foreach \x in {0,1,2,3,4}
		\foreach \y in {0,1,2,3,4}
		{
			\pgfmathtruncatemacro{\mycola}{10+20*\x}
			\pgfmathtruncatemacro{\mycolb}{90-20*\y}
			\fill[color=green!\mycola!blue!\mycolb!red] (\x,\y) circle (0.1cm);
		}
		\node[anchor=mid] at (2,-1) {2 nombres};
		\node[anchor=mid] at (2,-1.9) {$\rightarrow$~$5^2$ échantillons};
	\end{scope}
	%\pause


	\begin{scope}[xshift = 15cm]
		\node[anchor=center] at (2,2) {\includegraphics[width=3.2cm]{images/Cardiac_mri_slice_bionerd.jpg}} ;
		\node[anchor=mid] at (2,-1) {$128\cdot 128$ nombres};
		\node[anchor=mid] at (2,-1.9) {$\rightarrow$~$5^{128\cdot 128}$ échantillons};
	\end{scope}
	\end{tikzpicture}
    \end{center}

	\vspace{.2cm}
	\begin{center}
		L'ensemble de toutes les images est \textbf{beaucoup trop vaste}\\
		pour pouvoir être échantillonné avec la précision requise.
	\end{center}
	
\end{frame}

\begin{frame}{En imagerie médicale, \textbf{un bon modèle} $F(\mathbf{w} ; x\,)\simeq y$~ doit donc~:}
	Refléter un \textbf{a priori} raisonnable sur les données\\
	\hspace*{10mm} Qu'est-ce qu'un scan IRM de cœur~? Un modèle déformé~?
  
	\vspace{.3cm}
	%\pause
	Être \textbf{contraignant}\\
	\hspace*{10mm} Pour guider le modèle \textbf{en dehors}
	    des cas couverts par la BDD.
	
	\vspace{.3cm}
	%\pause
	Reposer sur des opérations \textbf{élémentaires}\\
	\hspace*{10mm} Pour tourner sur des volumes 3D/4D.
	%\pause
	\vspace{.5cm}
	\begin{center}
		$\Longrightarrow$ \textbf{Combinons la régression avec JPEG2000~!}
	\end{center}
	
\end{frame}
  
\section{Filtrage multi-résolution~:\\ $\Longrightarrow$~~Réseaux convolutifs}

\begin{frame}{Vers une optimisation des filtres de JPEG~2000}
	
	Traitement du signal \only<1>{classique \cite{wikijpeg}} \only<2->{moderne \cite{hollandais}}~:
	\vspace{.5cm}

	\begin{center}
	\only<1>{
		\includegraphics[width=.7\linewidth]{images/classical.png}
	}
	\onslide<2->{
		\includegraphics[width=.7\linewidth]{images/modern.png}
	}
	\end{center}
	
	\vspace{.3cm}
	\begin{center}
	\only<1>{
        \vspace{-1cm}
		\includegraphics[width=.3\linewidth]{images/Allessio_Damato_Jpeg2000.png}
	}
	\onslide<2->{
		\includegraphics[width=.7\linewidth]{images/CNN_archi.png}
	}
	\end{center}

\end{frame}

\begin{frame}{Convolutional Neural Networks~: un excellent compromis}
	JPEG2000, c'est un modèle~$F(\mathbf{w}\,;\xc{x}\,)\simeq \yc{y}$~:
	\begin{itemize} %[<+->]
		\item Algorithmiquement simple.
		\item Contraignant.
		\item Encodant un a priori \textbf{multi-résolution} sur les images.
	\end{itemize}
	
	%\pause
	En \textbf{optimisant ses coefficients} sur une base d'images labellisées,\\
	on obtient un \textbf{CNN} ~~$\simeq$~~ ``JPEG 2020'' adapté au problème.


	\vspace{.5cm}
	\begin{center}
	\begin{tikzpicture}[scale=.9]

	\draw[color=blue!40,very thick] (-3,-1) rectangle (0,2);
	\draw[color=blue!40,->,>=latex,very thick] (0,.5)--(4,.5);
	\node[anchor=mid] at (-1.5,.5) {$\xc{x}$};
	\node[color=blue, anchor=south] at (2,.6) {CNN};

	\begin{scope}[xshift = 4cm]
		\fill[color=blue!20] (1.5,0)--(1.5,1)--(.25,1) arc (90:180:.25)--(0,.25) arc (180:270:.25)--cycle;
		\node[color=blue!50!black, anchor=mid] at (.75,.5) {$\mu(\xc{x})$};
		\fill[color=blue!30] (1.5,0)--(3,0)--(3,1)--(1.5,1)--cycle;
		\node[color=blue!50!black, anchor=mid] at (2.25,.5) {$m(\xc{x})$};
		\fill[color=blue!40] (3,1)--(3,0)--(4.25,0) arc (-90:0:.25)--(4.5,.75) arc (0:90:.25)--cycle;
		\node[color=blue!50!black, anchor=mid] at (3.75,.5) {$M(\xc{x})$};
	\end{scope}
	\end{tikzpicture}
	\end{center}

\end{frame}


\begin{frame}{Une application emblématique~: le Deep Art~\cite{yaroslav}}

	%\vspace{.1cm}
\begin{center}
	\begin{tikzpicture}[scale=.45]
	
	\onslide<2->{
	\begin{scope}[xshift=-4.5cm,yshift=3.5cm]
		\fill[color=blue!40] (-1.575/.5,-1.2/.5)--(1.575/.5,-1.2/.5)
		                    --(1.575/.5,1.2/.5)--(-1.575/.5,1.2/.5)--cycle;
		\only<2-8>{ 
		\node[inner sep=0pt] at (0,0) { \includegraphics[width=3cm]{images/cats/style_0.png} } };
		\only<9>{ 
		\node[inner sep=0pt] at (0,0) { \includegraphics[width=3cm]{images/cats/style_a.png} } };
		\only<10>{ 
		\node[inner sep=0pt] at (0,0) { \includegraphics[width=3cm]{images/cats/style_d.png} } };
		\only<11>{ 
		\node[inner sep=0pt] at (0,0) { \includegraphics[width=3cm]{images/cats/style_e.png} } };
		\only<12>{ 
		\node[inner sep=0pt] at (0,0) { \includegraphics[width=3cm]{images/cats/style_f.png} } };
		\only<13>{ 
		\node[inner sep=0pt] at (0,0) { \includegraphics[width=3cm]{images/cats/style_g.png} } };
		\only<14>{ 
		\node[inner sep=0pt] at (0,0) { \includegraphics[width=3cm]{images/cats/style_h.png} } };
		\only<15>{ 
		\node[inner sep=0pt] at (0,0) { \includegraphics[width=3cm]{images/cats/style_j.png} } };
		\only<16>{ 
		\node[inner sep=0pt] at (0,0) { \includegraphics[width=3cm]{images/cats/style_k.png} } };
		\only<17>{ 
		\node[inner sep=0pt] at (0,0) { \includegraphics[width=3cm]{images/cats/style_i.png} } };
	 \end{scope}
	}
	\onslide<3->{
	\begin{scope}[xshift=9cm,yshift=3.5cm]
		\fill[color=green!40] (-1.575/.5,-1.2/.5)--(1.575/.5,-1.2/.5)
							--(1.575/.5,1.2/.5)--(-1.575/.5,1.2/.5)--cycle;
		\node[inner sep=0pt] at (0,0) {\includegraphics[width=3cm]{images/cats/cat.jpg}};
	\end{scope}
	}

	\onslide<7>{
	\draw[->,>=latex,very thick,color=blue!33!green!40] (2.25,-1)--(2.25,-2); 
	\begin{scope}[xshift=2cm,yshift=-6cm]
		\fill[color=blue!33!green!40] (-2.625/.5,-2/.5)--(2.625/.5,-2/.5)
							--(2.625/.5,2/.5)--(-2.625/.5,2/.5)--cycle;
		\node[inner sep=0pt] at (0,0) {\includegraphics[width=5cm]{images/cats/cat_0a.jpg}};
	\end{scope}
	}

	\onslide<8->{
	\draw[->,>=latex,very thick,color=blue!66!green!40] (2.25,-1)--(2.25,-2); 
	\begin{scope}[xshift=2cm,yshift=-6cm]
		\fill[color=blue!66!green!40] (-2.625/.5,-2/.5)--(2.625/.5,-2/.5)
							--(2.625/.5,2/.5)--(-2.625/.5,2/.5)--cycle;
		\only<8>{
		\node[inner sep=0pt] at (0,0) {\includegraphics[width=5cm]{images/cats/cat_0b.jpg}}; }
		\only<9>{
		\node[inner sep=0pt] at (0,0) {\includegraphics[width=5cm]{images/cats/cat_a.jpg}}; }
		\only<10>{
		\node[inner sep=0pt] at (0,0) {\includegraphics[width=5cm]{images/cats/cat_d.jpg}}; }
		\only<11>{
		\node[inner sep=0pt] at (0,0) {\includegraphics[width=5cm]{images/cats/cat_e.jpg}}; }
		\only<12>{
		\node[inner sep=0pt] at (0,0) {\includegraphics[width=5cm]{images/cats/cat_f.jpg}}; }
		\only<13>{
		\node[inner sep=0pt] at (0,0) {\includegraphics[width=5cm]{images/cats/cat_g.jpg}}; }
		\only<14>{
		\node[inner sep=0pt] at (0,0) {\includegraphics[width=5cm]{images/cats/cat_h.jpg}}; }
		\only<15>{
		\node[inner sep=0pt] at (0,0) {\includegraphics[width=5cm]{images/cats/cat_j.jpg}}; }
		\only<16>{
		\node[inner sep=0pt] at (0,0) {\includegraphics[width=5cm]{images/cats/cat_k.jpg}}; }
		\only<17>{
		\node[inner sep=0pt] at (0,0) {\includegraphics[width=5cm]{images/cats/cat_i.jpg}}; }
	\end{scope}
	}

	\onslide<4->{ \draw[->,>=latex,thick,color=blue!40] (-1.5,4.5)--(0,4.5); }
	\onslide<4->{ \draw[->,>=latex,thick,color=green!40] (6,2.5)--(4.5,2.5); }

	\begin{scope}[yshift=4cm]
		\onslide<4->{
		\fill[color=blue!20] (1.5,0)--(1.5,1)--(.25,1) arc (90:180:.25)--(0,.25) arc (180:270:.25)--cycle;
		\node[color=blue!50!black, anchor=mid] at (.75,.5) {$\mu$};
		}
		\onslide<4,8->{
		\fill[color=blue!30] (1.5,0)--(3,0)--(3,1)--(1.5,1)--cycle;
		\node[color=blue!50!black, anchor=mid] at (2.25,.5) {$m$};
		}
		\onslide<5-7>{
		\fill[color=blue!6] (1.5,0)--(3,0)--(3,1)--(1.5,1)--cycle;
		\node[color=blue!50!black!20, anchor=mid] at (2.25,.5) {$m$};
		}
		\onslide<4>{
		\fill[color=blue!40] (3,1)--(3,0)--(4.25,0) arc (-90:0:.25)--(4.5,.75) arc (0:90:.25)--cycle;
		\node[color=blue!50!black, anchor=mid] at (3.75,.5) {$M$};
		}
		\onslide<5->{
		\fill[color=blue!8] (3,1)--(3,0)--(4.25,0) arc (-90:0:.25)--(4.5,.75) arc (0:90:.25)--cycle;
		\node[color=blue!50!black!20, anchor=mid] at (3.75,.5) {$M$};
		}
	\end{scope}
	\begin{scope}[yshift=2cm]
		\onslide<4>{
		\fill[color=green!20] (1.5,0)--(1.5,1)--(.25,1) arc (90:180:.25)--(0,.25) arc (180:270:.25)--cycle;
		\node[color=green!50!black, anchor=mid] at (.75,.5) {$\mu$};
		}
		\onslide<5->{
		\fill[color=green!4] (1.5,0)--(1.5,1)--(.25,1) arc (90:180:.25)--(0,.25) arc (180:270:.25)--cycle;
		\node[color=green!50!black!20, anchor=mid] at (.75,.5) {$\mu$};
		}
		\onslide<4-7>{
		\fill[color=green!30] (1.5,0)--(3,0)--(3,1)--(1.5,1)--cycle;
		\node[color=green!50!black, anchor=mid] at (2.25,.5) {$m$};
		}
		\onslide<8->{
		\fill[color=green!6] (1.5,0)--(3,0)--(3,1)--(1.5,1)--cycle;
		\node[color=green!50!black!20, anchor=mid] at (2.25,.5) {$m$};
		}
		\onslide<4->{
		\fill[color=green!40] (3,1)--(3,0)--(4.25,0) arc (-90:0:.25)--(4.5,.75) arc (0:90:.25)--cycle;
		\node[color=green!50!black, anchor=mid] at (3.75,.5) {$M$};
		}
	\end{scope}
	\begin{scope}[yshift=-1cm]
		\onslide<6->{
		\fill[color=blue!20] (1.5,0)--(1.5,1)--(.25,1) arc (90:180:.25)--(0,.25) arc (180:270:.25)--cycle;
		\node[color=blue!50!black, anchor=mid] at (.75,.5) {$\mu$};
		}
		\onslide<8->{
		\fill[color=blue!30] (1.5,0)--(3,0)--(3,1)--(1.5,1)--cycle;
		\node[color=blue!50!black, anchor=mid] at (2.25,.5) {$m$};
		}
		\onslide<6-7>{
		\fill[color=green!30] (1.5,0)--(3,0)--(3,1)--(1.5,1)--cycle;
		\node[color=green!50!black, anchor=mid] at (2.25,.5) {$m$};
		}
		\onslide<6->{
		\fill[color=green!40] (3,1)--(3,0)--(4.25,0) arc (-90:0:.25)--(4.5,.75) arc (0:90:.25)--cycle;
		\node[color=green!50!black, anchor=mid] at (3.75,.5) {$M$};
		}
	\end{scope}

	\onslide<6->{ \draw[->,>=latex,thick,color=blue!40]  (.75,4)--(.75,0); }
	\onslide<8->{ \draw[->,>=latex,thick,color=blue!40] (2.25,4)--(2.25,0); }
	\onslide<6-7>{ \draw[->,>=latex,thick,color=green!40] (2.25,2)--(2.25,0); }
	\onslide<6->{ \draw[->,>=latex,thick,color=green!40] (3.75,2)--(3.75,0); }

	\end{tikzpicture}
\end{center}
\end{frame}


\begin{frame}{Une application rêvée~: la classification d'images}

	\begin{center}
		À partir de $\xc{\text{CNN}(\,\xc{x}\,)} = [\,\mu(\xc{x})\, ,\, m(\xc{x}) \,,\, M(\xc{x})\,]$,\\
		peut-on facilement \textbf{distinguer} une mouette d'un panda~?
	\end{center}

	%\pause
	Ce que les chercheurs ont en tête~\cite{nnviz}:
    \begin{center}
	\includegraphics[width=.7\linewidth]{images/single_layer.png}
    \end{center}
\end{frame}

\begin{frame}{Limites de l'analyse multi-résolution}

	Les CNNs font de la \textbf{détection de motif}, ni plus ni moins~\cite{fooledai}:
	%\pause
	\begin{center}
		\textbf{«~$\mu(\xc{x})$ est fiable ; $M(\xc{x})$ ne l'est pas.~»}
		
		\vspace{.3cm}
	%\pause
	%\only<3>{
	%\includegraphics[width=.7\linewidth]{images/imagenet_fooled_1.png}
	%}
	\includegraphics[width=.45\linewidth]{images/imagenet_fooled_2.png}

	\end{center}

	%\pause
	%\pause

	\begin{center}
		Problème~: les modèles \textbf{structuraux} sont \textbf{beaucoup} plus coûteux.\\
		(c'est mon métier...\,)
	\end{center}

\end{frame}

\section{Conclusion}

\begin{frame}{Un point sur le vocabulaire}
	On l'a vu~:
	\begin{center}
		\begin{tabular}{ccc}
			\yc{Perceptron} \xc{multicouche} & $\Longleftrightarrow$ & \xc{Réseau} de \yc{neurones} \\[.5cm] %\pause
			\makecell{\xc{Régression} sur une banque\\de filtres \yc{multi-résolution}}
			& $\Longleftrightarrow$ & \xc{Apprentissage} \yc{profond} \\[1cm] %\pause
			\begin{minipage}{4cm}\includegraphics[width=4cm]{images/neural_net.png}\end{minipage} 
				& $\xLeftrightarrow{~~~?~~~}$&
			~~~\begin{minipage}{4cm}\includegraphics[width=4cm]{images/intelligence_artificielle.jpg} \end{minipage}
		\end{tabular}
	\end{center}
\end{frame}

\begin{frame}{Un point sur le vocabulaire}
	On l'a vu~:
	\begin{center}
		\begin{tabular}{ccc}
			\yc{Perceptron} \xc{multicouche} & $\Longleftrightarrow$ & \xc{Réseau} de \yc{neurones} \\[.5cm]
			\makecell{\xc{Régression} sur une banque\\de filtres \yc{multi-résolution}}
			& $\Longleftrightarrow$ & \xc{Apprentissage} \yc{profond} \\[1cm]
			\begin{minipage}{4cm}\includegraphics[width=4cm]{images/saucisse_strasbourg.png}\end{minipage}
				& $\xLeftrightarrow{~~~?~~~}$&
			~~~\begin{minipage}{4cm}\includegraphics[width=4cm]{images/cochon_truffier.jpg} \end{minipage}
		\end{tabular}
	\end{center}
\end{frame}


\begin{frame}{Bilan}
	La révolution du Deep Learning en imagerie, c'est~:
	\begin{itemize} %[<+->]
		\item \sout{L'intelligence artificielle.}
		\item Le premier modèle de \textbf{texture} vraiment convaincant.
		\item Le développement d'\textbf{outils logiciels} permettant
		      \\\textbf{d'ajuster les paramètres} de nos modèles -- TensorFlow, PyTorch...
	\end{itemize}

	%\pause
	\begin{center}
		Un logiciel d'analyse d'images repose \textbf{toujours} sur
		une \\\textbf{modélisation simpliste} des données.\\[.5cm]
		Il n'y a pas de miracle.
	\end{center}
\end{frame}

\begin{frame}{À retenir}
	Devant un produit ``IA''~:
	\begin{itemize} %[<+->]
		\item \textbf{«~Montrez-moi ce qui ne marche pas.~»}
		\item «~\textbf{Expliquez-moi} cette erreur.~»
		\item \makebox[\linewidth][l]{``Les données'' \textbf{ne résoudront pas} automagiquement le problème.}
	\end{itemize}
	\vspace{1cm}

	%\pause
	Pour aller plus loin~:
	\begin{center}
		Cours de \textbf{Sciences des données} au Collège de France,

		\url{www.college-de-france.fr/site/stephane-mallat/}

		Jetez un œil à la leçon inaugurale, très accessible~!
	\end{center}
\end{frame}


\begin{frame}{MasterClass IA-Imagerie}

	\begin{center}

		%\url{sites.google.com/view/masterclassiaimagerie/home}

		\includegraphics[width=.65\linewidth]{images/masterclass.jpg}

        Mes cours et TPs sont en ligne: \url{www.jeanfeydy.com/Teaching/}
	\end{center}
\end{frame}


\begin{frame}[standout]
  Merci pour votre attention.\\[1cm]
  Avez-vous des questions~?
\end{frame}

\appendix

\begin{frame}[allowframebreaks]{References}
  \bibliography{reseaux_neurones}
  \bibliographystyle{alpha}
\end{frame}

\end{document}

