changeset 462:f59af1648d83

cleaner le techreport
author Yoshua Bengio <bengioy@iro.umontreal.ca>
date Fri, 28 May 2010 08:49:36 -0600
parents 9609c5cf9b6b
children 5fa1c653620c
files writeup/techreport.tex
diffstat 1 files changed, 261 insertions(+), 110 deletions(-) [+]
line wrap: on
line diff
--- a/writeup/techreport.tex	Fri May 28 07:48:14 2010 -0600
+++ b/writeup/techreport.tex	Fri May 28 08:49:36 2010 -0600
@@ -6,7 +6,7 @@
 \usepackage{subfigure}
 
 \begin{document}
-\title{Generating and Exploiting Perturbed Training Data for Deep Architectures}
+\title{Generating and Exploiting Perturbed and Multi-Task Handwritten Training Data for Deep Architectures}
 \author{The IFT6266 Gang}
 \date{April 2010, Technical Report, Dept. IRO, U. Montreal}
 
@@ -28,14 +28,15 @@
 We evaluate a deep learning algorithm (Stacked Denoising Autoencoders)
 on the task of learning to classify digits and letters transformed
 with this pipeline, using the hundreds of millions of generated examples
-and testing on the full NIST test set.
+and testing on the full 62-class NIST test set.
 We find that the SDA outperforms its
 shallow counterpart, an ordinary Multi-Layer Perceptron,
 and that it is better able to take advantage of the additional
 generated data, as well as better able to take advantage of
+the multi-task setting, i.e., 
 training from more classes than those of interest in the end.
 In fact, we find that the SDA reaches human performance as
-estimated by the Amazon Mechanical Turk on the NIST test characters.
+estimated by the Amazon Mechanical Turk on the 62-class NIST test characters.
 \end{abstract}
 
 \section{Introduction}
@@ -67,170 +68,334 @@
 general) features that are more robust to unanticipated sources of
 variance extant in real data.
 
-Whereas a deep architecture can in principle be more powerful than a shallow
-one in terms of representation, depth appears to render the training problem
-more difficult in terms of optimization and local minima.
-It is also only recently that
-successful algorithms were proposed to overcome some of these
-difficulties.
-
-\section{Perturbation and Transformation of Character Images}
-This section describes the different transformations we used to generate data, in their order.
-We can differentiate two important parts in the pipeline. The first one, from slant to pinch, performs transformations 
-of the character. The second part, from blur to contrast, adds noise to the image.
-
-\subsection{Adding Slant}
-In order to mimic a slant effect, we simply shift each row of the image proportionnaly to its height: $shift = round(slant \times height)$.
-We round the shift in order to have a discret displacement. We do not use a filter to smooth the result in order to save computing time
-and also because latter transformations have similar effects.
-
-The $slant$ coefficient can be negative or positive with equal probability and its value is randomly sampled according to the complexity level.
-In our case we take uniformly a number in the range $[0,complexity]$, so the maximum displacement for the lowest 
-or highest pixel line is of $round(complexity \times 32)$.
+Whereas a deep architecture can in principle be more powerful than a
+shallow one in terms of representation, depth appears to render the
+training problem more difficult in terms of optimization and local minima.
+It is also only recently that successful algorithms were proposed to
+overcome some of these difficulties.  All are based on unsupervised
+learning, often in an greedy layer-wise ``unsupervised pre-training''
+stage~\cite{Bengio-2009}.  One of these layer initialization techniques,
+applied here, is the Denoising
+Auto-Encoder~(DEA)~\cite{VincentPLarochelleH2008-very-small}, which
+performed similarly or better than previously proposed Restricted Boltzmann
+Machines in terms of unsupervised extraction of a hierarchy of features
+useful for classification.  The principle is that each layer starting from
+the bottom is trained to encode their input (the output of the previous
+layer) and try to reconstruct it from a corrupted version of it. After this
+unsupervised initialization, the stack of denoising auto-encoders can be
+converted into a deep supervised feedforward neural network and trained by
+stochastic gradient descent.
 
 
-\subsection{Changing Thickness}
-To change the thickness of the characters we used morpholigical operators: dilation and erosion~\cite{Haralick87,Serra82}.
+\section{Perturbation and Transformation of Character Images}
+
+This section describes the different transformations we used to generate data, in their order.
+The code for these transformations (mostly python) is available at 
+{\tt http://anonymous.url.net}. All the modules in the pipeline share
+a global control parameter ($0 \le complexity \le 1$) that allows one to modulate the
+amount of deformation or noise introduced.
+
+We can differentiate two important parts in the pipeline. The first one,
+from slant to pinch, performs transformations of the character. The second
+part, from blur to contrast, adds noise to the image.
+
+\subsection{Slant}
+
+In order to mimic a slant effect, we simply shift each row of the image
+proportionnaly to its height: $shift = round(slant \times height)$.  We
+round the shift in order to have a discret displacement. We do not use a
+filter to smooth the result in order to save computing time and also
+because latter transformations have similar effects.
 
-The basic idea of such transform is, for each pixel, to multiply in the element-wise manner its neighbourhood with a matrix called the structuring element.
-Then for dilation we remplace the pixel value by the maximum of the result, or the minimum for erosion.
-This will dilate or erode objects in the image and the strength of the transform only depends on the structuring element.
+The $slant$ coefficient can be negative or positive with equal probability
+and its value is randomly sampled according to the complexity level.  In
+our case we take uniformly a number in the range $[0,complexity]$, so the
+maximum displacement for the lowest or highest pixel line is of
+$round(complexity \times 32)$.
+
+
+\subsection{Thickness}
+
+To change the thickness of the characters we used morpholigical operators:
+dilation and erosion~\cite{Haralick87,Serra82}.
 
-We used ten different structural elements with increasing dimensions (the biggest is $5\times5$).
-for each image, we radomly sample the operator type (dilation or erosion) with equal probability and one structural element
-from a subset of the $n$ smallest structuring elements where $n$ is $round(10 \times complexity)$ for dilation and $round(6 \times complexity)$ for erosion.
-A neutral element is always present in the set, if it is chosen the transformation is not applied.
-Erosion allows only the six smallest structural elements because when the character is too thin it may erase it completly.
+The basic idea of such transform is, for each pixel, to multiply in the
+element-wise manner its neighbourhood with a matrix called the structuring
+element.  Then for dilation we remplace the pixel value by the maximum of
+the result, or the minimum for erosion.  This will dilate or erode objects
+in the image and the strength of the transform only depends on the
+structuring element.
+
+We used ten different structural elements with increasing dimensions (the
+biggest is $5\times5$).  for each image, we radomly sample the operator
+type (dilation or erosion) with equal probability and one structural
+element from a subset of the $n$ smallest structuring elements where $n$ is
+$round(10 \times complexity)$ for dilation and $round(6 \times complexity)$
+for erosion.  A neutral element is always present in the set, if it is
+chosen the transformation is not applied.  Erosion allows only the six
+smallest structural elements because when the character is too thin it may
+erase it completly.
 
 \subsection{Affine Transformations}
-We generate an affine transform matrix according to the complexity level, then we apply it directly to the image.
-The matrix is of size $2 \times 3$, so we can represent it by six parameters $(a,b,c,d,e,f)$.
-Formally, for each pixel $(x,y)$ of the output image,
-we give the value of the pixel nearest to : $(ax+by+c,dx+ey+f)$, in the input image.
-This allows to produce scaling, translation, rotation and shearing variances. 
+
+We generate an affine transform matrix according to the complexity level,
+then we apply it directly to the image.  The matrix is of size $2 \times
+3$, so we can represent it by six parameters $(a,b,c,d,e,f)$.  Formally,
+for each pixel $(x,y)$ of the output image, we give the value of the pixel
+nearest to : $(ax+by+c,dx+ey+f)$, in the input image.  This allows to
+produce scaling, translation, rotation and shearing variances.
 
-The sampling of the parameters $(a,b,c,d,e,f)$ have been tuned by hand to forbid important rotations (not to confuse classes) but to give good variability of the transformation. For each image we sample uniformly the parameters in the following ranges:
-$a$ and $d$ in $[1-3 \times complexity,1+3 \times complexity]$, $b$ and $e$ in $[-3 \times complexity,3 \times complexity]$ and $c$ and $f$ in $[-4 \times complexity, 4 \times complexity]$.
+The sampling of the parameters $(a,b,c,d,e,f)$ have been tuned by hand to
+forbid important rotations (not to confuse classes) but to give good
+variability of the transformation. For each image we sample uniformly the
+parameters in the following ranges: $a$ and $d$ in $[1-3 \times
+complexity,1+3 \times complexity]$, $b$ and $e$ in $[-3 \times complexity,3
+\times complexity]$ and $c$ and $f$ in $[-4 \times complexity, 4 \times
+complexity]$.
 
 
 \subsection{Local Elastic Deformations}
-This filter induces a "wiggly" effect in the image. The description here will be brief, as the algorithm follows precisely what is described in \cite{SimardSP03}.
+
+This filter induces a "wiggly" effect in the image. The description here
+will be brief, as the algorithm follows precisely what is described in
+\cite{SimardSP03}.
 
-The general idea is to generate two "displacements" fields, for horizontal and vertical displacements of pixels. Each of these fields has the same size as the original image.
+The general idea is to generate two "displacements" fields, for horizontal
+and vertical displacements of pixels. Each of these fields has the same
+size as the original image.
 
-When generating the transformed image, we'll loop over the x and y positions in the fields and select, as a value, the value of the pixel in the original image at the (relative) position given by the displacement fields for this x and y. If the position we'd retrieve is outside the borders of the image, we use a 0 value instead.
+When generating the transformed image, we'll loop over the x and y
+positions in the fields and select, as a value, the value of the pixel in
+the original image at the (relative) position given by the displacement
+fields for this x and y. If the position we'd retrieve is outside the
+borders of the image, we use a 0 value instead.
 
-To generate a pixel in either field, first a value between -1 and 1 is chosen from a uniform distribution. Then all the pixels, in both fields, is multiplied by a constant $\alpha$ which controls the intensity of the displacements (bigger $\alpha$ translates into larger wiggles).
-
-As a final step, each field is convoluted with a Gaussian 2D kernel of standard deviation $\sigma$. Visually, this results in a "blur" filter. This has the effect of making values next to each other in the displacement fields similar. In effect, this makes the wiggles more coherent, less noisy.
+To generate a pixel in either field, first a value between -1 and 1 is
+chosen from a uniform distribution. Then all the pixels, in both fields, is
+multiplied by a constant $\alpha$ which controls the intensity of the
+displacements (bigger $\alpha$ translates into larger wiggles).
 
-As displacement fields were long to compute, 50 pairs of fields were generated per complexity in increments of 0.1 (50 pairs for 0.1, 50 pairs for 0.2, etc.), and afterwards, given a complexity, we selected randomly among the 50 corresponding pairs.
+As a final step, each field is convoluted with a Gaussian 2D kernel of
+standard deviation $\sigma$. Visually, this results in a "blur"
+filter. This has the effect of making values next to each other in the
+displacement fields similar. In effect, this makes the wiggles more
+coherent, less noisy.
 
-$\sigma$ and $\alpha$ were linked to complexity through the formulas $\alpha = \sqrt[3]{complexity} \times 10.0$ and $\sigma = 10 - 7 \times \sqrt[3]{complexity}$.
+As displacement fields were long to compute, 50 pairs of fields were
+generated per complexity in increments of 0.1 (50 pairs for 0.1, 50 pairs
+for 0.2, etc.), and afterwards, given a complexity, we selected randomly
+among the 50 corresponding pairs.
+
+$\sigma$ and $\alpha$ were linked to complexity through the formulas
+$\alpha = \sqrt[3]{complexity} \times 10.0$ and $\sigma = 10 - 7 \times
+\sqrt[3]{complexity}$.
 
 
 \subsection{Pinch}
 
-This is another GIMP filter we used. The filter is in fact named "Whirl and pinch", but we don't use the "whirl" part (whirl is set to 0). As described in GIMP, a pinch is "similar to projecting the image onto an elastic surface and pressing or pulling on the center of the surface".
-
-Mathematically, for a square input image, think of drawing a circle of radius $r$ around a center point $C$. Any point (pixel) $P$ belonging to that disk (region inside circle) will have its value recalculated by taking the value of another "source" pixel in the original image. The position of that source pixel is found on the line thats goes through $C$ and $P$, but at some other distance $d_2$. Define $d_1$ to be the distance between $P$ and $C$. $d_2$ is given by $d_2 = sin(\frac{\pi{}d_1}{2r})^{-pinch} \times d_1$, where $pinch$ is a parameter to the filter. 
+This is another GIMP filter we used. The filter is in fact named "Whirl and
+pinch", but we don't use the "whirl" part (whirl is set to 0). As described
+in GIMP, a pinch is "similar to projecting the image onto an elastic
+surface and pressing or pulling on the center of the surface".
 
-If the region considered is not square then, before computing $d_2$, the smallest dimension (x or y) is stretched such that we may consider the region as if it was square. Then, after $d_2$ has been computed and corresponding components $d_2\_x$ and $d_2\_y$ have been found, the component corresponding to the stretched dimension is compressed back by an inverse ratio.
+Mathematically, for a square input image, think of drawing a circle of
+radius $r$ around a center point $C$. Any point (pixel) $P$ belonging to
+that disk (region inside circle) will have its value recalculated by taking
+the value of another "source" pixel in the original image. The position of
+that source pixel is found on the line thats goes through $C$ and $P$, but
+at some other distance $d_2$. Define $d_1$ to be the distance between $P$
+and $C$. $d_2$ is given by $d_2 = sin(\frac{\pi{}d_1}{2r})^{-pinch} \times
+d_1$, where $pinch$ is a parameter to the filter.
 
-The actual value is given by bilinear interpolation considering the pixels around the (non-integer) source position thus found.
+If the region considered is not square then, before computing $d_2$, the
+smallest dimension (x or y) is stretched such that we may consider the
+region as if it was square. Then, after $d_2$ has been computed and
+corresponding components $d_2\_x$ and $d_2\_y$ have been found, the
+component corresponding to the stretched dimension is compressed back by an
+inverse ratio.
 
-The value for $pinch$ in our case was given by sampling from an uniform distribution over the range $[-complexity, 0.7 \times complexity]$.
+The actual value is given by bilinear interpolation considering the pixels
+around the (non-integer) source position thus found.
+
+The value for $pinch$ in our case was given by sampling from an uniform
+distribution over the range $[-complexity, 0.7 \times complexity]$.
 
 \subsection{Motion Blur}
 
-This is a GIMP filter we applied, a "linear motion blur" in GIMP terminology. The description will be brief as it is a well-known filter.
+This is a GIMP filter we applied, a "linear motion blur" in GIMP
+terminology. The description will be brief as it is a well-known filter.
 
-This algorithm has two input parameters, $length$ and $angle$. The value of a pixel in the final image is the mean value of the $length$ first pixels found by moving in the $angle$ direction. An approximation of this idea is used, as we won't fall onto precise pixels by following that direction. This is done using the Bresenham line algorithm.
+This algorithm has two input parameters, $length$ and $angle$. The value of
+a pixel in the final image is the mean value of the $length$ first pixels
+found by moving in the $angle$ direction. An approximation of this idea is
+used, as we won't fall onto precise pixels by following that
+direction. This is done using the Bresenham line algorithm.
 
-The angle, in our case, is chosen from a uniform distribution over $[0,360]$ degrees. The length, though, depends on the complexity; it's sampled from a Gaussian distribution of mean 0 and standard deviation $\sigma = 3 \times complexity$.
+The angle, in our case, is chosen from a uniform distribution over
+$[0,360]$ degrees. The length, though, depends on the complexity; it's
+sampled from a Gaussian distribution of mean 0 and standard deviation
+$\sigma = 3 \times complexity$.
 
 \subsection{Occlusion}
 
-This filter selects random parts of other (hereafter "occlusive") letter images and places them over the original letter (hereafter "occluded") image. To be more precise, having selected a subregion of the occlusive image and a desination position in the occluded image, to determine the final value for a given overlapping pixel, it selects whichever pixel is the lightest. As a reminder, the background value is 0, black, so the value nearest to 1 is selected.
+This filter selects random parts of other (hereafter "occlusive") letter
+images and places them over the original letter (hereafter "occluded")
+image. To be more precise, having selected a subregion of the occlusive
+image and a desination position in the occluded image, to determine the
+final value for a given overlapping pixel, it selects whichever pixel is
+the lightest. As a reminder, the background value is 0, black, so the value
+nearest to 1 is selected.
 
-To select a subpart of the occlusive image, four numbers are generated. For compability with the code, we'll call them "haut", "bas", "gauche" and "droite" (respectively meaning top, bottom, left and right). Each of these numbers is selected according to a Gaussian distribution of mean $8 \times complexity$ and standard deviation $2$. This means the largest the complexity is, the biggest the occlusion will be. The absolute value is taken, as the numbers must be positive, and the maximum value is capped at 15.
-
-These four sizes collectively define a window centered on the middle pixel of the occlusive image. This is the part that will be extracted as the occlusion.
+To select a subpart of the occlusive image, four numbers are generated. For
+compability with the code, we'll call them "haut", "bas", "gauche" and
+"droite" (respectively meaning top, bottom, left and right). Each of these
+numbers is selected according to a Gaussian distribution of mean $8 \times
+complexity$ and standard deviation $2$. This means the largest the
+complexity is, the biggest the occlusion will be. The absolute value is
+taken, as the numbers must be positive, and the maximum value is capped at
+15.
 
-The next step is to select a destination position in the occluded image. Vertical and horizontal displacements $y\_arrivee$ and $x\_arrivee$ are selected according to Gaussian distributions of mean 0 and of standard deviations of, respectively, 3 and 2. Then an horizontal placement mode, $endroit$ (meaning location), is selected to be of three values meaning left, middle or right.
+These four sizes collectively define a window centered on the middle pixel
+of the occlusive image. This is the part that will be extracted as the
+occlusion.
 
-If $endroit$ is "middle", the occlusion will be horizontally centered around the horizontal middle of the occluded image, then shifted according to $x\_arrivee$. If $endroit$ is "left", it will be placed on the left of the occluded image, then displaced right according to $x\_arrivee$. The contrary happens if $endroit$ is $right$.
+The next step is to select a destination position in the occluded
+image. Vertical and horizontal displacements $y\_arrivee$ and $x\_arrivee$
+are selected according to Gaussian distributions of mean 0 and of standard
+deviations of, respectively, 3 and 2. Then an horizontal placement mode,
+$place$, is selected to be of three values meaning
+left, middle or right.
 
-In both the horizontal and vertical positionning, the maximum position in either direction is such that the selected occlusion won't go beyond the borders of the occluded image.
+If $place$ is "middle", the occlusion will be horizontally centered
+around the horizontal middle of the occluded image, then shifted according
+to $x\_arrivee$. If $place$ is "left", it will be placed on the left of
+the occluded image, then displaced right according to $x\_arrivee$. The
+contrary happens if $place$ is $right$.
+
+In both the horizontal and vertical positionning, the maximum position in
+either direction is such that the selected occlusion won't go beyond the
+borders of the occluded image.
 
 This filter has a probability of not being applied, at all, of 60\%.
 
 
-\subsection{Pixel permutation}
+\subsection{Pixel Permutation}
 
-This filter permuts neighbouring pixels. It selects first $\frac{complexity}{3}$ pixels randomly in the image. Each of them are then sequentially
-exchanged to one other pixel in its $V4$ neighbourhood. Number of exchanges to the left, right, top, bottom are equal or does not differ from more than 1
-if the number of selected pixels is not a multiple of 4. 
+This filter permuts neighbouring pixels. It selects first
+$\frac{complexity}{3}$ pixels randomly in the image. Each of them are then
+sequentially exchanged to one other pixel in its $V4$ neighbourhood. Number
+of exchanges to the left, right, top, bottom are equal or does not differ
+from more than 1 if the number of selected pixels is not a multiple of 4.
 
 It has has a probability of not being applied, at all, of 80\%.
 
 
-\subsection{Distorsion gauss}
+\subsection{Gaussian Noise}
 
-This filter simply adds, to each pixel of the image independently, a gaussian noise of mean $0$ and standard deviation $\frac{complexity}{10}$.
+This filter simply adds, to each pixel of the image independently, a
+Gaussian noise of mean $0$ and standard deviation $\frac{complexity}{10}$.
 
 It has has a probability of not being applied, at all, of 70\%.
 
 
 \subsection{Background Images}
 
-This transformation adds a random background behind the letter. The background is chosen by first selecting, at random, an image from a set of images. Then we choose a 32x32 subregion of that image as the background image (by sampling x and y positions uniformly while making sure not to cross image borders).
-
-To combine the original letter image and the background image, contrast adjustments are made. We first get the maximal values (i.e. maximal intensity) for both the original image and the background image, $maximage$ and $maxbg$. We also have a parameter, $contrast$, given by sampling from a uniform distribution over $[complexity, 1]$.
+Following~\cite{Larochelle-jmlr-2009}, this transformation adds a random
+background behind the letter. The background is chosen by first selecting,
+at random, an image from a set of images. Then we choose a 32x32 subregion
+of that image as the background image (by sampling x and y positions
+uniformly while making sure not to cross image borders).
 
-Once we have all these numbers, we first adjust the values for the background image. Each pixel value is multiplied by $\frac{max(maximage - contrast, 0)}{maxbg}$. Therefore the higher the contrast, the darkest the background will be.
+To combine the original letter image and the background image, contrast
+adjustments are made. We first get the maximal values (i.e. maximal
+intensity) for both the original image and the background image, $maximage$
+and $maxbg$. We also have a parameter, $contrast$, given by sampling from a
+uniform distribution over $[complexity, 1]$.
 
-The final image is found by taking the brightest (i.e. value nearest to 1) pixel from either the background image or the corresponding pixel in the original image.
+Once we have all these numbers, we first adjust the values for the
+background image. Each pixel value is multiplied by $\frac{max(maximage -
+  contrast, 0)}{maxbg}$. Therefore the higher the contrast, the darkest the
+background will be.
+
+The final image is found by taking the brightest (i.e. value nearest to 1)
+pixel from either the background image or the corresponding pixel in the
+original image.
 
 \subsection{Salt and Pepper Noise}
 
-This filter adds noise to the image by randomly selecting a certain number of them and, for those selected pixels, assign a random value according to a uniform distribution over the $[0,1]$ ranges. This last distribution does not change according to complexity. Instead, the number of selected pixels does: the proportion of changed pixels corresponds to $complexity / 5$, which means, as a maximum, 20\% of the pixels will be randomized. On the lowest extreme, no pixel is changed.
+This filter adds noise to the image by randomly selecting a certain number
+of them and, for those selected pixels, assign a random value according to
+a uniform distribution over the $[0,1]$ ranges. This last distribution does
+not change according to complexity. Instead, the number of selected pixels
+does: the proportion of changed pixels corresponds to $complexity / 5$,
+which means, as a maximum, 20\% of the pixels will be randomized. On the
+lowest extreme, no pixel is changed.
 
 This filter also has a probability of not being applied, at all, of 75\%.
 
 \subsection{Spatially Gaussian Noise}
 
-The aim of this transformation is to filter, with a gaussian kernel, different regions of the image. In order to save computing time 
-we decided to convolve the whole image only once with a symmetric gaussian kernel of size and variance choosen uniformly in the ranges:
-$[12,12 + 20 \times complexity]$ and $[2,2 + 6 \times complexity]$. The result is normalized between $0$ and $1$.
-We also create a symmetric averaging window, of the kernel size, with maximum value at the center. 
-For each image we sample uniformly from $3$ to $3 + 10 \times complexity$ pixels that will be averaging centers
-between the original image and the filtered one.
-We initialize to zero a mask matrix of the image size. For each selected pixel we add to the mask the averaging window centered to it.
-The final image is computed from the following element-wise operation: $\frac{image + filtered image \times mask}{mask+1}$.
+The aim of this transformation is to filter, with a gaussian kernel,
+different regions of the image. In order to save computing time we decided
+to convolve the whole image only once with a symmetric gaussian kernel of
+size and variance choosen uniformly in the ranges: $[12,12 + 20 \times
+complexity]$ and $[2,2 + 6 \times complexity]$. The result is normalized
+between $0$ and $1$.  We also create a symmetric averaging window, of the
+kernel size, with maximum value at the center.  For each image we sample
+uniformly from $3$ to $3 + 10 \times complexity$ pixels that will be
+averaging centers between the original image and the filtered one.  We
+initialize to zero a mask matrix of the image size. For each selected pixel
+we add to the mask the averaging window centered to it.  The final image is
+computed from the following element-wise operation: $\frac{image + filtered
+  image \times mask}{mask+1}$.
 
 This filter has a probability of not being applied, at all, of 75\%.
 
-\subsection{"Ratures"}
+\subsection{Scratches}
+
+The scratches module places line-like white patches on the image.  The
+lines are in fact heavily transformed images of the digit "1" (one), chosen
+at random among five thousands such start images of this digit.
 
-The ratures ("scratches") filter places line-like white patches on the image. The lines are in fact heavily transformed images of the digit "1" (one), chosen at random among five thousands such start images of this digit.
+Once the image is selected, the transformation begins by finding the first
+$top$, $bottom$, $right$ and $left$ non-zero pixels in the image. It is
+then cropped to the region thus delimited, then this cropped version is
+expanded to $32\times32$ again. It is then rotated by a random angle having a
+Gaussian distribution of mean 90 and standard deviation $100 \times
+complexity$ (in degrees). The rotation is done with bicubic interpolation.
 
-Once the image is selected, the transformation begins by finding the first $top$, $bottom$, $right$ and $left$ non-zero pixels in the image. It is then cropped to the region thus delimited, then this cropped version is expanded to 32x32 again. It is then rotated by a random angle having a Gaussian distribution of mean 90 and standard deviation $100 \times complexity$ (in degrees). The rotation is done with bicubic interpolation.
+The rotated image is then resized to $50\times50$, with anti-aliasing. In
+that image, we crop the image again by selecting a region delimited
+horizontally to $left$ to $left+32$ and vertically by $top$ to $top+32$.
 
-The rotated image is then resized to 50x50, with anti-aliasing. In that image, we crop the image again by selecting a region delimited horizontally to $left$ to $left+32$ and vertically by $top$ to $top+32$.
-
-Once this is done, two passes of a greyscale morphological erosion filter are applied. Put briefly, this erosion filter reduces the width of the line by a certain $smoothing$ amount. For small complexities (< 0.5), $smoothing$ is 6, so the line is very small. For complexities ranging from 0.25 to 0.5, $smoothing$ is 5. It is 4 for complexities 0.5 to 0.75, and 3 for higher complexities.
+Once this is done, two passes of a greyscale morphological erosion filter
+are applied. Put briefly, this erosion filter reduces the width of the line
+by a certain $smoothing$ amount. For small complexities (< 0.5),
+$smoothing$ is 6, so the line is very small. For complexities ranging from
+0.25 to 0.5, $smoothing$ is 5. It is 4 for complexities 0.5 to 0.75, and 3
+for higher complexities.
 
-To compensate for border effects, the image is then cropped to 28x28 by removing two pixels everywhere on the borders, then expanded to 32x32 again. The pixel values are then linearly expanded such that the minimum value is 0 and the maximal one is 1. Then, 50\% of the time, the image is vertically flipped.
+To compensate for border effects, the image is then cropped to 28x28 by
+removing two pixels everywhere on the borders, then expanded to 32x32
+again. The pixel values are then linearly expanded such that the minimum
+value is 0 and the maximal one is 1. Then, 50\% of the time, the image is
+vertically flipped.
 
-This filter is only applied only 15\% of the time. When it is applied, 50\% of the time, only one patch image is generated and applied. In 30\% of cases, two patches are generated, and otherwise three patches are generated. The patch is applied by taking the maximal value on any given patch or the original image, for each of the 32x32 pixel locations.
+This filter is only applied only 15\% of the time. When it is applied, 50\%
+of the time, only one patch image is generated and applied. In 30\% of
+cases, two patches are generated, and otherwise three patches are
+generated. The patch is applied by taking the maximal value on any given
+patch or the original image, for each of the 32x32 pixel locations.
 
 \subsection{Color and Contrast Changes}
 
-This filter changes the constrast and may invert the image polarity (white on black to black on white). The contrast $C$ is defined here as the difference 
-between the maximum and the minimum pixel value of the image. A contrast value is sampled uniformly between $1$ and $1-0.85 \times complexity$
-(this insure a minimum constrast of $0.15$). We then simply normalize the image to the range $[\frac{1-C}{2},1-\frac{1-C}{2}]$. The polarity 
-is inverted with $0.5$ probability.
+This filter changes the constrast and may invert the image polarity (white
+on black to black on white). The contrast $C$ is defined here as the
+difference between the maximum and the minimum pixel value of the image. A
+contrast value is sampled uniformly between $1$ and $1-0.85 \times
+complexity$ (this insure a minimum constrast of $0.15$). We then simply
+normalize the image to the range $[\frac{1-C}{2},1-\frac{1-C}{2}]$. The
+polarity is inverted with $0.5$ probability.
 
 
 \begin{figure}[h]
@@ -244,20 +409,6 @@
 \label{fig:pipeline}
 \end{figure}
 
-\section{Learning Algorithms for Deep Architectures}
-
-Learning for deep network has long been a problem since well-known learning algorithms do not generalize well on deep architectures.
-Using these training algorithms on deep network usually yields to a worse generalization than on shallow networks.
-Recently, new initialization techniques have been discovered that enable better generalization overall.
-
-One of these initialization techniques is denoising auto-encoders.
-The principle is that each layer starting from the bottom is trained to encode and decode their input and the encoding part is kept as initialization for the weights and bias of the network.
-For more details see section \ref{SdA}.
-
-After initialization is done, standard training algorithms work.
-In this case, since we have large data sets we use stochastic gradient descent.
-This resemble minibatch training except that the batches are selected at random.
-To speed up computation, we randomly pre-arranged examples in batches and used those for all training experiments.
 
 \section{Experimental Setup}