\documentclass[8pt]{beamer}
\usepackage{Vorlage}
\begin{document}

\begin{frame}[plain]
%\titlepage
\begin{center}
  \colorbox{Titolo}{
    %\vspace{.7\textwidth}
    \rule{.3\textwidth}{0pt}
    {\Huge \color{white}{Natural Images}}
    \rule{.3\textwidth}{0pt}
    \rule{4ex}{0pt}
  }{}\\ \vspace{4ex}
  {\large Giovanni Marelli}\\ \vspace{4ex}
\end{center}
\vspace{\stretch{2}}
%\rput[lt](0,0){\includegraphics[clip=true,width=\textwidth]{unipd_logo}}
\begin{figure}[!h]
\normalcolor
\includegraphics[width=8cm,keepaspectratio]{OlivoBaldo}
%\includegraphics[.2\textwidth,.9\textheight][.8\textwidth,.3\textheight]{OlivoBaldo}
\end{figure}
\vspace{\stretch{1}}
\begin{flushright}
   {\small G\"ottingen 27.01.10} 
\end{flushright}
\end{frame}

\section{Probability distribution and correlation}
\begin{frame}[label=Preliminaries]
  \begin{center}
    {\Large Infomation in Natural Images}
  \end{center}
    %\blu{1}{We are taking into account a pictures of $2^n\times 2^n$ pixels of natural/artificial landscape}
%  \scalebox{\textwidth}{3cm}{\includegraphics[width=8cm,keepaspectratio]{OlivoBaldo}}
%  \reisebox{!}{3cm}{\includegraphics[width=8cm,keepaspectratio]{OlivoBaldo}}
%  \reflect{\includegraphics[width=8cm,keepaspectratio]{OlivoBaldo}}
%  \rotate{30}{\includegraphics[width=8cm,keepaspectratio]{OlivoBaldo}}
  \begin{columns}[t]
    \begin{column}{.7\textwidth}
      \begin{itemize}
      \item<2-| alert@2> How much information do they carry?
      \item<3-| alert@3> Are they organized in some specific structures?
      \item<4-| alert@4> Do they belong to a specific class of universality?
      \end{itemize}
    \end{column} 
    \begin{column}{.3\textwidth}
      \begin{figure}[!h]
	\includegraphics[width=3.5cm,keepaspectratio]{Cipressi}
      \end{figure}
    \end{column}
  \end{columns}
\end{frame}

\begin{frame}[label=Quantities]
  \frametitle{Quantities}
  \begin{columns}[t]
    \begin{column}{.9\textwidth}
        \only<1>{\rosso{1}{A picture is composed by $n\times m$ matrix of pixels}}
        \only<2>{\rosso{2}{Every pixel contains an array of 
            \temporal<2>{\color{Rosso!10}}{\color{red}}{\color{Rosso!25}}{R},
            \temporal<2>{\color{Rosso!10}}{\color{green}}{\color{Rosso!25}}{G},
            \temporal<2>{\color{Rosso!10}}{\color{blue}}{\color{Rosso!25}}{B},
            (eventually $\alpha$ as transparency) which have values within $0,255$ which define the intensity $I$ of the picture.}}
        \only<3>{\rosso{3}{The hystogram shows the distribution of the intensities in the picture}}
        \only<4-7>{\color{Rosso}{\small We turn the image into a gray scale image \only<5->{for different coarse grained pixel: \only<5>{1:4}\only<6>{1:16}\only<7>{1:32} } }}
        \only<8>{\rosso{8}{We define the contrast as $\phi(\vet):=\log(I(\vet x)/I_0)$ where $I_0:{N(\phi<0) = N(\phi>0)}$ }}
        \only<9>{\rosso{9}{If we calculate the probability distribution \\ we see that for different coarse grained pixel the plot shows long tails}}
        \only<10-11>{\rosso{10}{If we calculate ist gradient $|\nabla\phi|$} \rosso{11}{The distribution is quite precisely exponential}}
        \only<12-14>{\color{Rosso}{\small We calculate the median of the distribution and assign $0$ (black) for every intensity below the median and $1$ (white) for every intesities above. The pixel are equally populated \only<13->{Coarse grained: \only<13>{1:4}\only<14>{1:16}} }}
        \only<15>{\rosso{15}{The power spectrum in the loglog plot shows a clear power law}} 
        \only<16>{\rosso{16}{The full distribution is invariant to block scaling if we coarse-grain and quantize (top) or quantize and coarse-grain (bottom)}}
      \end{column}
      \begin{column}{.1\textwidth}
        \vspace{1cm}
      \end{column}
    \end{columns}
  
  \vspace{\stretch{1}}
  \begin{figure}[!h]
    \begin{center}
    \only<1>{\vspace{7cm}}
    \only<2>{\includegraphics[height=7cm,keepaspectratio]{Fig1}}
    \only<3>{\includegraphics[height=7cm,keepaspectratio]{Fig2}}
    \only<4>{\includegraphics[height=7cm,keepaspectratio]{Fig3}}
    \only<5>{\includegraphics[height=7cm,keepaspectratio]{Fig4}}
    \only<6>{\includegraphics[height=7cm,keepaspectratio]{Fig5}}
    \only<7>{\includegraphics[height=7cm,keepaspectratio]{Fig6}}
    \only<8>{\includegraphics[height=7cm,keepaspectratio]{Vis1}}
    \only<9>{\includegraphics[height=5cm,keepaspectratio]{DistrPhi}}
    \only<9>{\vspace{2cm}}
    \only<10>{\includegraphics[height=7cm,keepaspectratio]{Vis3}}
    \only<11>{\includegraphics[height=5cm,keepaspectratio]{DistrNabla}}
    \only<11>{\vspace{2cm}}
    \only<12>{\includegraphics[height=7cm,keepaspectratio]{Fig7}}
    \only<13>{\includegraphics[height=7cm,keepaspectratio]{Fig8}}
    \only<14>{\includegraphics[height=7cm,keepaspectratio]{Fig9}}
    \only<15>{\includegraphics[height=5cm,keepaspectratio]{SpectrumCG}}
    \only<15>{\vspace{2cm}}
    \only<16>{\includegraphics[height=5cm,keepaspectratio]{DistributionBW}}
    \only<16>{\vspace{2cm}}
    \end{center}
  \end{figure}
\end{frame}

\section{Analysis}
\begin{frame}[label=Analysis]
  \frametitle{Analysis}
  \begin{center}
    {\fontfamily{phv}\selectfont 
      \color{Rosso}{We consider a receptor cell with a contrast noise of variance $\sigma^2$ and a Nyquist frequency of $k_c$.}
    }
  \end{center}
  \vspace{\stretch{1}}
  \begin{columns}[t]
    \begin{column}{.6\textwidth}
      \blu{1}{The power spectrum is connected with the autocorrelation (Th. Wiener-Khintchin) \\\rule{0pt}{0pt}$<\phi(\vet x)\phi(\vet x')>:=\int\frac{\di^2k}{(2\pi)^2}S_\phi(\vet k)e^{\imath\vet k(\vet x-\vet x')} $\\\rule{0pt}{0pt} }
      \blu{2}{Among all the distributions, the gaussian has the maximum entropy. In this assumption one can connect the autocorrelation of the picture with the information conveyed \\\rule{0pt}{0pt}$I\leq \frac{\pi N \pi/2}{k_c^2}\int\frac{\di^2k}{(2\pi)^2}\log_2\left(1+\frac{(1-k/k_c)^2}{\pi^2\sigma^2}k_c^2S_\phi(k)\right) $\\\rule{0pt}{0pt} }
      \blu{3}{The signal to noise ration of a single cell is \\\rule{0pt}{0pt}$R_{SNR}=\frac1{\sigma^2}\int\frac{\di^2k}{(2\pi)^2}(1-k/k_c)^1S_\phi(k) $ \\\rule{0pt}{0pt}$I\leq\frac12N\frac\pi2\int_0^1\di xx\log_2\left(1+\frac{\eta(\eta+1)(\eta+2)}{\pi}R_{SNR}\frac{(10x)^2}{x^{2-\eta}}\right) $ \\\rule{0pt}{0pt}}
    \end{column}
    \begin{column}{.4\textwidth}
      \blu{4}{A single receptor can produce a spike when the signal overcome a certain threshold}%\\\rule{0pt}{0pt}
      \blu{4}{The upper bound we have shown tells that the information contained in a natural image is less than a bit per receptor.}
      \begin{figure}[!h]
        \only<-4>{\vspace{1.7cm}}
        \only<5->{\includegraphics[height=2cm]{occhio4}}
      \end{figure}
      \blu{5}{A channel that transmit the information to the brain can have capacity lower than 1/2 bit/receptor to convey all the information}
    \end{column}
  \end{columns}
  \vspace{\stretch{1}}
  \begin{flushright}
    \blu{2}{\tiny D.L. Ruderman, dissertation, University of California at Berkley, 1993}
  \end{flushright}
  \vspace{\stretch{0}}
\end{frame}

\begin{frame}[label=Ising]
  \frametitle{Ising 2d model}
  \begin{center}
    {\fontfamily{phv}\selectfont 
      \color{Rosso}{Do the black/white pixels remember to the $(\uparrow,\downarrow)$ of the Ising model?}
    }
  \end{center}
  \begin{columns}[t]
    \vspace{6cm}
    \begin{column}{.4\textwidth}
      \blu{1}{A region of L square pixel has $2^{L\times L}$ states, considering the entropy: $S(3\times 3)=6.580\pm0.003<9\mathrm{bit}$, $S(4\times 4)=11.154\pm0.002\mathrm{bit}$ \nul \\ \nul}
      \blu{2}{To the sample $s$ of $L\times L$ we associate an energy. The Boltzmann probability distribution for a given ``Temperature'' is \nul \\ \nul}
      \blu{3}{One can define new different quantities, the heat capacity \nul \\ \nul}
      \blu{4}{A natural image will be compared to a Monte Carlo simulation of the same system size of a Ising system \nul \\ \nul}
    \end{column}
    \begin{column}{.4\textwidth}
      \begin{table}[!h]
        \blu{2}{$Z(T)=\frac{1}{\Delta}\int\di Ee^{S(E)-E/T}$ \nul \\ \nul}
      \end{table}
      \vspace{.2cm}
      \begin{table}[!h]
        \blu{2}{$P(s)=\frac{1}{Z(T)}e^{-E(s)/T}$ \nul \\ \nul}
        \blu{2}{ $S(T)=-\sum_sP(s)\log P(s)$ \nul \\ \nul}
        \blu{3}{$C(T)=T\partial_T S(T)=\frac{<(\delta E(s))^2>_T}{T^2}$ \nul \\ \nul}
        \end{table}
    \end{column}
    \begin{column}{.2\textwidth}
      \begin{figure}[!h]
        \only<-3>{\vspace{4.1cm}}
        \only<4->{\includegraphics[height=2cm]{Ising1}}\nul\\\nul
        \only<4->{\includegraphics[height=2cm]{Ising2}}
      \end{figure}
      
    \end{column}
  \end{columns}
\end{frame}

\begin{frame}[label=Zipf]
  \frametitle{Zipf's law}
  \begin{center}
    {\fontfamily{phv}\selectfont 
      \color{Rosso}{A patch in a picture is as a word in a book}
    }
  \end{center}
  \begin{columns}[t]
    \begin{column}{.7\textwidth}
      \blu{1}{Zipf's law \nul\\\nul $P_r\propto 1/r^\alpha$ \nul\\\nul}
      \blu{2}{If we identify the energy for a given rank of a Boltzmann distribution the energy for the rank $r$ is $E_r=\alpha\ln r=\ln AZ$ \nul\\\nul}
      \blu{3}{In the thermodynamic limit the density of states $\rho(E) \simeq |\di E/\di r|^{-1}=r/\alpha$ which gives \nul\\\nul $\rho(E)=\frac1\alpha(AZ)^{1/\alpha}e^{E/\alpha}e^{E/\alpha}\qquad S_{Zipf}(E)=E/\alpha+\mathrm{const}$ \nul\\\nul}
      \begin{minipage}{\textwidth}
        \begin{minipage}{.45\textwidth}
          \begin{figure}[!h]
            \only<-3>{\vspace{3cm}}
            \only<4->{\includegraphics[height=3cm]{Patches}}
          \end{figure}
        \end{minipage}
        \begin{minipage}{.45\textwidth}
          \only<4->{\blu{4}{Most common patches}}
        \end{minipage}
      \end{minipage}
    \end{column}
    \begin{column}{.3\textwidth}
      \blu{1}{$\alpha\simeq 1$, $r$ rank \nul\\\nul}
      \blu{1}{$p_r = A/r^\alpha$ \nul\\\nul}
    \end{column}
  \end{columns}
\end{frame}
\section{Appendix}
\begin{frame}[label=Increase]
  \frametitle{Class of universality}
  \begin{center}
    {\fontfamily{phv}\selectfont 
      \color{Rosso}{The natural images repeat specific patterns and }
      contain more information.\nul\\\nul}
    {Can one increase the resolution? Cheating in physics}
  \end{center}
  \begin{columns}[t]
    \begin{column}{.5\textwidth}
      \begin{figure}[!h]
        \only<1>{\vspace{4.2cm}}
        \only<2>{\includegraphics[height=4cm,keepaspectratio]{PatchImage1}}
        \only<3>{\includegraphics[height=4cm,keepaspectratio]{PatchImage2}}
        \only<4->{\includegraphics[height=4cm,keepaspectratio]{PatchImage3}}
      \end{figure}
    \end{column}
    \begin{column}{.5\textwidth}
      \verde{1}{The previous analysis shows a long correlation between the structure\nul\\\nul}
      \verde{2}{Considering many natural images one can, as was done to compress the natual languages, finding the two dimensional correlation between the words.\nul\\\nul}
      \verde{3}{The correlation should be, as we already said, both universal and dependent on the photographer and on the landscape.}
      \verde{4}{Once we have calculated the correlation function for our picture, can we substitute different coarsed grained order of pathces?}
      \verde{5}{Even the Fourier space would be sensitive to repeated structures (Bragg's planes)}
    \end{column}
  \end{columns}
\end{frame}

\begin{frame}[label=Prove]
  \frametitle{A prove}
  \begin{center}
    {\fontfamily{phv}\selectfont 
      \color{Rosso}{Proving an increment in resolution}
    }
  \end{center}
  \begin{columns}[t]
    \begin{column}{.3\textwidth}
      \verde{1}{To test different methods to increase the resolution one could \\}
      \verde{2}{Resize the original image to a coarse-grained one\nul\\\nul}
      \verde{3}{Try different methods to create one with more resolution\nul\\\nul}
      \verde{4}{Compress the original images into its more probable pathces\nul\\\nul} 
      \verde{5}{Compare the created images with the original one\nul\\\nul}
      \verde{5}{$C_c=\frac1{N^4}\sum_{ijkl}(p_{ij}-p_{kl})^2$, $C_a=\frac1{N^2}\sum_{ij}(p_{ij}-p_{ij})^2$}\nul\\\nul
      
    \end{column}
    \begin{column}{.7\textwidth}
  \begin{figure}[!h]
    \only<1>{\vspace{4cm}}
    \only<2>{\includegraphics[height=4cm,keepaspectratio]{Schema1}}
    \only<3>{\includegraphics[height=4cm,keepaspectratio]{Schema2}}
    \only<4>{\includegraphics[height=4cm,keepaspectratio]{Schema3}}
    \only<5->{\includegraphics[height=4cm,keepaspectratio]{Schema4}}
    \end{figure}
    \end{column}
  \end{columns}
  \vspace{\stretch{1}}
  \begin{flushright}
    \verde{6}{Will be the information increased whithin the error?}
  \end{flushright}
\end{frame}

\begin{frame}
  \begin{center}
    {\fontfamily{phv}\selectfont 
      \color{Rosso}{Thank you for your attention}
    }
  \end{center}
\vspace{\stretch{1}}
\color{blue}{Aknowledgments}\nul\\\nul
\blu{1}{Wolfgang Keil (tutor)}

\vspace{\stretch{1}}
\begin{flushright}
\color{blue}{References}\nul\\\nul
\rosso{1}{Thermodynamics of natural images}\nul\\\nul
\blu{1}{Stephens, Greg J; Mora, Thierry; Tkacik, Gasper; Bialek, William}\nul\\\nul
\verde{1}{http://arxiv.org/abs/0806.2694  (2008)}\nul\\\nul
\rosso{1}{Statistic of Natural Images: Scaling in the Woods}\nul\\\nul
\blu{1}{D. L. Rudeman, W. Bialek}\nul\\\nul
\verde{1}{PRL {\bf 73} 814 (1994)}\nul\\\nul
\end{flushright}
\end{frame}
\end{document}

