Mercurial > ift6266
diff writeup/techreport.tex @ 582:9ebb335ca904
techreport.tex
author | Yoshua Bengio <bengioy@iro.umontreal.ca> |
---|---|
date | Sat, 18 Sep 2010 16:32:08 -0400 |
parents | 8aad1c6ec39a |
children | ae77edb9df67 |
line wrap: on
line diff
--- a/writeup/techreport.tex Thu Sep 16 16:21:52 2010 -0400 +++ b/writeup/techreport.tex Sat Sep 18 16:32:08 2010 -0400 @@ -1,66 +1,87 @@ -\documentclass[12pt,letterpaper]{article} +\documentclass{article} % For LaTeX2e +\usepackage{times} +\usepackage{wrapfig} +\usepackage{amsthm,amsmath,bbm} +\usepackage[psamsfonts]{amssymb} +\usepackage{algorithm,algorithmic} \usepackage[utf8]{inputenc} -\usepackage{graphicx} -\usepackage{times} -\usepackage{mlapa} -\usepackage{subfigure} +\usepackage{graphicx,subfigure} +\usepackage[numbers]{natbib} + +\addtolength{\textwidth}{10mm} +\addtolength{\evensidemargin}{-5mm} +\addtolength{\oddsidemargin}{-5mm} + +%\setlength\parindent{0mm} + +\title{Deep Self-Taught Learning for Handwritten Character Recognition} +\author{ +Frédéric Bastien \and +Yoshua Bengio \and +Arnaud Bergeron \and +Nicolas Boulanger-Lewandowski \and +Thomas Breuel \and +Youssouf Chherawala \and +Moustapha Cisse \and +Myriam Côté \and +Dumitru Erhan \and +Jeremy Eustache \and +Xavier Glorot \and +Xavier Muller \and +Sylvain Pannetier Lebeuf \and +Razvan Pascanu \and +Salah Rifai \and +Francois Savard \and +Guillaume Sicard +} +\date{June 8th, 2010, Technical Report 1353, Dept. IRO, U. Montreal} \begin{document} -\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} +%\makeanontitle \maketitle +%\vspace*{-2mm} \begin{abstract} -Recent theoretical and empirical work in statistical machine learning has -demonstrated the importance of learning algorithms for deep -architectures, i.e., function classes obtained by composing multiple -non-linear transformations. In the area of handwriting recognition, -deep learning algorithms -had been evaluated on rather small datasets with a few tens of thousands -of examples. Here we propose a powerful generator of variations -of examples for character images based on a pipeline of stochastic -transformations that include not only the usual affine transformations -but also the addition of slant, local elastic deformations, changes -in thickness, background images, grey level, contrast, occlusion, and -various types of pixel and spatially correlated noise. -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 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 62-class NIST test characters. + Recent theoretical and empirical work in statistical machine learning has + demonstrated the importance of learning algorithms for deep + architectures, i.e., function classes obtained by composing multiple + non-linear transformations. Self-taught learning (exploiting unlabeled + examples or examples from other distributions) has already been applied + to deep learners, but mostly to show the advantage of unlabeled + examples. Here we explore the advantage brought by {\em out-of-distribution examples}. +For this purpose we + developed a powerful generator of stochastic variations and noise + processes for character images, including not only affine transformations + but also slant, local elastic deformations, changes in thickness, + background images, grey level changes, contrast, occlusion, and various + types of noise. The out-of-distribution examples are obtained from these + highly distorted images or by including examples of object classes + different from those in the target test set. + We show that {\em deep learners benefit + more from them than a corresponding shallow learner}, at least in the area of + handwritten character recognition. In fact, we show that they reach + human-level performance on both handwritten digit classification and + 62-class handwritten character recognition. \end{abstract} +%\vspace*{-3mm} \section{Introduction} +%\vspace*{-1mm} -Deep Learning has emerged as a promising new area of research in -statistical machine learning (see~\emcite{Bengio-2009} for a review). +{\bf Deep Learning} has emerged as a promising new area of research in +statistical machine learning (see~\citet{Bengio-2009} for a review). Learning algorithms for deep architectures are centered on the learning of useful representations of data, which are better suited to the task at hand. -This is in great part inspired by observations of the mammalian visual cortex, +This is in part inspired by observations of the mammalian visual cortex, which consists of a chain of processing elements, each of which is associated with a -different representation. In fact, +different representation of the raw visual input. In fact, it was found recently that the features learnt in deep architectures resemble those observed in the first two of these stages (in areas V1 and V2 -of visual cortex)~\cite{HonglakL2008}. -Processing images typically involves transforming the raw pixel data into -new {\bf representations} that can be used for analysis or classification. -For example, a principal component analysis representation linearly projects -the input image into a lower-dimensional feature space. -Why learn a representation? Current practice in the computer vision -literature converts the raw pixels into a hand-crafted representation -(e.g.\ SIFT features~\cite{Lowe04}), but deep learning algorithms -tend to discover similar features in their first few -levels~\cite{HonglakL2008,ranzato-08,Koray-08,VincentPLarochelleH2008-very-small}. -Learning increases the +of visual cortex)~\citep{HonglakL2008}, and that they become more and +more invariant to factors of variation (such as camera movement) in +higher layers~\citep{Goodfellow2009}. +Learning a hierarchy of features increases the ease and practicality of developing representations that are at once tailored to specific tasks, yet are able to borrow statistical strength from other related tasks (e.g., modeling different kinds of objects). Finally, learning the @@ -68,702 +89,823 @@ general) features that are more robust to unanticipated sources of variance extant in real data. +{\bf Self-taught learning}~\citep{RainaR2007} is a paradigm that combines principles +of semi-supervised and multi-task learning: the learner can exploit examples +that are unlabeled and possibly come from a distribution different from the target +distribution, e.g., from other classes than those of interest. +It has already been shown that deep learners can clearly take advantage of +unsupervised learning and unlabeled examples~\citep{Bengio-2009,WestonJ2008-small}, +but more needs to be done to explore the impact +of {\em out-of-distribution} examples and of the multi-task setting +(one exception is~\citep{CollobertR2008}, which uses a different kind +of learning algorithm). In particular the {\em relative +advantage} of deep learning for these settings has not been evaluated. +The hypothesis discussed in the conclusion is that a deep hierarchy of features +may be better able to provide sharing of statistical strength +between different regions in input space or different tasks. + +\iffalse 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, +stage~\citep{Bengio-2009}. One of these layer initialization techniques, applied here, is the Denoising -Auto-Encoder~(DEA)~\cite{VincentPLarochelleH2008-very-small}, which +Auto-encoder~(DA)~\citep{VincentPLarochelleH2008-very-small} (see Figure~\ref{fig:da}), +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. +useful for classification. Each layer is trained to denoise its +input, creating a layer of features that can be used as input for the next layer. +\fi +%The principle is that each layer starting from +%the bottom is trained to encode its input (the output of the previous +%layer) and to reconstruct it from a corrupted version. After this +%unsupervised initialization, the stack of DAs can be +%converted into a deep supervised feedforward neural network and fine-tuned by +%stochastic gradient descent. + +% +In this paper we ask the following questions: + +%\begin{enumerate} +$\bullet$ %\item +Do the good results previously obtained with deep architectures on the +MNIST digit images generalize to the setting of a much larger and richer (but similar) +dataset, the NIST special database 19, with 62 classes and around 800k examples? + +$\bullet$ %\item +To what extent does the perturbation of input images (e.g. adding +noise, affine transformations, background images) make the resulting +classifiers better not only on similarly perturbed images but also on +the {\em original clean examples}? We study this question in the +context of the 62-class and 10-class tasks of the NIST special database 19. + +$\bullet$ %\item +Do deep architectures {\em benefit more from such out-of-distribution} +examples, i.e. do they benefit more from the self-taught learning~\citep{RainaR2007} framework? +We use highly perturbed examples to generate out-of-distribution examples. + +$\bullet$ %\item +Similarly, does the feature learning step in deep learning algorithms benefit more +from training with moderately different classes (i.e. a multi-task learning scenario) than +a corresponding shallow and purely supervised architecture? +We train on 62 classes and test on 10 (digits) or 26 (upper case or lower case) +to answer this question. +%\end{enumerate} +Our experimental results provide positive evidence towards all of these questions. +To achieve these results, we introduce in the next section a sophisticated system +for stochastically transforming character images and then explain the methodology, +which is based on training with or without these transformed images and testing on +clean ones. We measure the relative advantage of out-of-distribution examples +for a deep learner vs a supervised shallow one. +Code for generating these transformations as well as for the deep learning +algorithms are made available. +We also estimate the relative advantage for deep learners of training with +other classes than those of interest, by comparing learners trained with +62 classes with learners trained with only a subset (on which they +are then tested). +The conclusion discusses +the more general question of why deep learners may benefit so much from +the self-taught learning framework. +%\vspace*{-3mm} +\newpage \section{Perturbation and Transformation of Character Images} +\label{s:perturbations} +%\vspace*{-2mm} -This section describes the different transformations we used to generate data, in their order. +\begin{wrapfigure}[8]{l}{0.15\textwidth} +%\begin{minipage}[b]{0.14\linewidth} +%\vspace*{-5mm} +\begin{center} +\includegraphics[scale=.4]{images/Original.png}\\ +{\bf Original} +\end{center} +\end{wrapfigure} +%%\vspace{0.7cm} +%\end{minipage}% +%\hspace{0.3cm}\begin{minipage}[b]{0.86\linewidth} +This section describes the different transformations we used to stochastically +transform $32 \times 32$ source images (such as the one on the left) +in order to obtain data from a larger distribution which +covers a domain substantially larger than the clean characters distribution from +which we start. +Although character transformations have been used before to +improve character recognizers, this effort is on a large scale both +in number of classes and in the complexity of the transformations, hence +in the complexity of the learning task. +More details can +be found in this technical report~\citep{ift6266-tr-anonymous}. 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} +amount of deformation or noise introduced. +There are two main parts in the pipeline. The first one, +from slant to pinch below, performs transformations. The second +part, from blur to contrast, adds different kinds of noise. +%\end{minipage} -We mimic slant by shifting each row of the image -proportionally to its height: $shift = round(slant \times height)$. -The $slant$ coefficient can be negative or positive with equal probability -and its value is randomly sampled according to the complexity level: -$slant \sim U[0,complexity]$, so the -maximum displacement for the lowest or highest pixel line is of -$round(complexity \times 32)$. +%\vspace*{1mm} +\subsection{Transformations} +%{\large\bf 2.1 Transformations} +%\vspace*{1mm} + +\subsubsection*{Thickness} ---- - -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)$. - - -\subsection{Thickness} - -Morphological operators of dilation and erosion~\citep{Haralick87,Serra82} +%\begin{wrapfigure}[7]{l}{0.15\textwidth} +\begin{minipage}[b]{0.14\linewidth} +%\centering +\begin{center} +\vspace*{-5mm} +\includegraphics[scale=.4]{images/Thick_only.png}\\ +%{\bf Thickness} +\end{center} +\vspace{.6cm} +\end{minipage}% +\hspace{0.3cm}\begin{minipage}[b]{0.86\linewidth} +%\end{wrapfigure} +To change character {\bf thickness}, morphological operators of dilation and erosion~\citep{Haralick87,Serra82} are applied. The neighborhood of each pixel is multiplied element-wise with a {\em structuring element} matrix. The pixel value is replaced by the maximum or the minimum of the resulting matrix, respectively for dilation or erosion. Ten different structural elements with increasing dimensions (largest is $5\times5$) were used. For each image, randomly 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, and if it is -chosen no transformation is applied. Erosion allows only the six -smallest structural elements because when the character is too thin it may -be completely erased. +element from a subset of the $n=round(m \times complexity)$ smallest structuring elements +where $m=10$ for dilation and $m=6$ for erosion (to avoid completely erasing thin characters). +A neutral element (no transformation) +is always present in the set. +%%\vspace{.4cm} +\end{minipage} ---- +\vspace{2mm} -To change the thickness of the characters we used morpholigical operators: -dilation and erosion~\cite{Haralick87,Serra82}. +\subsubsection*{Slant} +\vspace*{2mm} -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} +\begin{minipage}[b]{0.14\linewidth} +\centering +\includegraphics[scale=.4]{images/Slant_only.png}\\ +%{\bf Slant} +\end{minipage}% +\hspace{0.3cm} +\begin{minipage}[b]{0.83\linewidth} +%\centering +To produce {\bf slant}, each row of the image is shifted +proportionally to its height: $shift = round(slant \times height)$. +$slant \sim U[-complexity,complexity]$. +The shift is randomly chosen to be either to the left or to the right. +\vspace{5mm} +\end{minipage} +%\vspace*{-4mm} -A $2 \times 3$ affine transform matrix (with -6 parameters $(a,b,c,d,e,f)$) is sampled according to the $complexity$ level. -Each pixel $(x,y)$ of the output image takes the value of the pixel -nearest to $(ax+by+c,dx+ey+f)$ in the input image. This -produces scaling, translation, rotation and shearing. -The marginal distributions of $(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: $a$ and $d$ $\sim U[1-3 \times -complexity,1+3 \times complexity]$, $b$ and $e$ $\sim[-3 \times complexity,3 -\times complexity]$ and $c$ and $f$ $\sim U[-4 \times complexity, 4 \times -complexity]$. +%\newpage ----- +\subsubsection*{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. - -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} +\begin{minipage}[b]{0.14\linewidth} +%\centering +%\begin{wrapfigure}[8]{l}{0.15\textwidth} +\begin{center} +\includegraphics[scale=.4]{images/Affine_only.png} +\vspace*{6mm} +%{\small {\bf Affine \mbox{Transformation}}} +\end{center} +%\end{wrapfigure} +\end{minipage}% +\hspace{0.3cm}\begin{minipage}[b]{0.86\linewidth} +\noindent A $2 \times 3$ {\bf affine transform} matrix (with +parameters $(a,b,c,d,e,f)$) is sampled according to the $complexity$. +Output pixel $(x,y)$ takes the value of input pixel +nearest to $(ax+by+c,dx+ey+f)$, +producing scaling, translation, rotation and shearing. +Marginal distributions of $(a,b,c,d,e,f)$ have been tuned to +forbid large rotations (to avoid confusing classes) but to give good +variability of the transformation: $a$ and $d$ $\sim U[1-3 +complexity,1+3\,complexity]$, $b$ and $e$ $\sim U[-3 \,complexity,3\, +complexity]$, and $c$ and $f \sim U[-4 \,complexity, 4 \, +complexity]$.\\ +\end{minipage} -This filter induces a ``wiggly'' effect in the image, following~\citet{SimardSP03-short}, -which provides more details. -Two ``displacements'' fields are generated and applied, for horizontal -and vertical displacements of pixels. -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, are -multiplied by a constant $\alpha$ which controls the intensity of the -displacements (larger $\alpha$ translates into larger wiggles). -Each field is convolved with a Gaussian 2D kernel of -standard deviation $\sigma$. Visually, this results in a blur. -$\alpha = \sqrt[3]{complexity} \times 10.0$ and $\sigma = 10 - 7 \times -\sqrt[3]{complexity}$. +%\vspace*{-4.5mm} +\subsubsection*{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}. - -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. +%\begin{minipage}[t]{\linewidth} +%\begin{wrapfigure}[7]{l}{0.15\textwidth} +%\hspace*{-8mm} +\begin{minipage}[b]{0.14\linewidth} +%\centering +\begin{center} +\vspace*{5mm} +\includegraphics[scale=.4]{images/Localelasticdistorsions_only.png} +%{\bf Local Elastic Deformation} +\end{center} +%\end{wrapfigure} +\end{minipage}% +\hspace{3mm} +\begin{minipage}[b]{0.85\linewidth} +%%\vspace*{-20mm} +The {\bf local elastic deformation} +module induces a ``wiggly'' effect in the image, following~\citet{SimardSP03-short}, +which provides more details. +The intensity of the displacement fields is given by +$\alpha = \sqrt[3]{complexity} \times 10.0$, which are +convolved with a Gaussian 2D kernel (resulting in a blur) of +standard deviation $\sigma = 10 - 7 \times\sqrt[3]{complexity}$. +\vspace{2mm} +\end{minipage} -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). +\vspace*{4mm} -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. - -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. +\subsubsection*{Pinch} -$\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 a GIMP filter called ``Whirl and -pinch'', but whirl was set to 0. A pinch is ``similar to projecting the image onto an elastic +\begin{minipage}[b]{0.14\linewidth} +%\centering +%\begin{wrapfigure}[7]{l}{0.15\textwidth} +%\vspace*{-5mm} +\begin{center} +\includegraphics[scale=.4]{images/Pinch_only.png}\\ +\vspace*{15mm} +%{\bf Pinch} +\end{center} +%\end{wrapfigure} +%%\vspace{.6cm} +\end{minipage}% +\hspace{0.3cm}\begin{minipage}[b]{0.86\linewidth} +The {\bf pinch} module applies the ``Whirl and pinch'' GIMP filter with whirl set to 0. +A pinch is ``similar to projecting the image onto an elastic surface and pressing or pulling on the center of the surface'' (GIMP documentation manual). -For a square input image, this is akin to 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 that 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. +For a square input image, draw a radius-$r$ disk +around its center $C$. Any pixel $P$ belonging to +that disk has its value replaced by +the value of a ``source'' pixel in the original image, +on the line that goes through $C$ and $P$, but +at some other distance $d_2$. Define $d_1=distance(P,C)$ +and $d_2 = sin(\frac{\pi{}d_1}{2r})^{-pinch} \times +d_1$, where $pinch$ is a parameter of the filter. The actual value is given by bilinear interpolation considering the pixels around the (non-integer) source position thus found. Here $pinch \sim U[-complexity, 0.7 \times complexity]$. - ---- +%%\vspace{1.5cm} +\end{minipage} -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". +%\vspace{1mm} -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. +%{\large\bf 2.2 Injecting Noise} +\subsection{Injecting Noise} +%\vspace{2mm} -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 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]$. +\subsubsection*{Motion Blur} -\subsection{Motion Blur} - -This is a ``linear motion blur'' in GIMP -terminology, with two parameters, $length$ and $angle$. The value of -a pixel in the final image is approximately the mean value of the $length$ first pixels -found by moving in the $angle$ direction. -Here $angle \sim U[0,360]$ degrees, and $length \sim {\rm Normal}(0,(3 \times complexity)^2)$. - ----- - -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. +%%\vspace*{-.2cm} +\begin{minipage}[t]{0.14\linewidth} +\centering +\vspace*{0mm} +\includegraphics[scale=.4]{images/Motionblur_only.png} +%{\bf Motion Blur} +\end{minipage}% +\hspace{0.3cm}\begin{minipage}[t]{0.83\linewidth} +%%\vspace*{.5mm} +\vspace*{2mm} +The {\bf motion blur} module is GIMP's ``linear motion blur'', which +has parameters $length$ and $angle$. The value of +a pixel in the final image is approximately the mean of the first $length$ pixels +found by moving in the $angle$ direction, +$angle \sim U[0,360]$ degrees, and $length \sim {\rm Normal}(0,(3 \times complexity)^2)$. +%\vspace{5mm} +\end{minipage} -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. +%\vspace*{1mm} + +\subsubsection*{Occlusion} -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} - -Selects a random rectangle from an {\em occluder} character -images and places it over the original {\em occluded} character -image. Pixels are combined by taking the max(occluder,occluded), -closer to black. The rectangle corners +\begin{minipage}[t]{0.14\linewidth} +\centering +\vspace*{3mm} +\includegraphics[scale=.4]{images/occlusion_only.png}\\ +%{\bf Occlusion} +%%\vspace{.5cm} +\end{minipage}% +\hspace{0.3cm}\begin{minipage}[t]{0.83\linewidth} +%\vspace*{-18mm} +The {\bf occlusion} module selects a random rectangle from an {\em occluder} character +image and places it over the original {\em occluded} +image. Pixels are combined by taking the max(occluder, occluded), +i.e. keeping the lighter ones. +The rectangle corners are sampled so that larger complexity gives larger rectangles. The destination position in the occluded image are also sampled -according to a normal distribution (see more details in~\citet{ift6266-tr-anonymous}). -This filter has a probability of 60\% of not being applied. - ---- - -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. - -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. +according to a normal distribution (more details in~\citet{ift6266-tr-anonymous}). +This module is skipped with probability 60\%. +%%\vspace{7mm} +\end{minipage} -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} - -This filter permutes neighbouring pixels. It selects first -$\frac{complexity}{3}$ pixels randomly in the image. Each of them are then -sequentially exchanged with one other pixel in its $V4$ neighbourhood. The number -of exchanges to the left, right, top, bottom is equal or does not differ -from more than 1 if the number of selected pixels is not a multiple of 4. -% TODO: The previous sentence is hard to parse -This filter has a probability of 80\% of not being applied. - ---- - -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{Gaussian Noise} +%\vspace*{1mm} +\subsubsection*{Gaussian Smoothing} -This filter simply adds, to each pixel of the image independently, a -noise $\sim Normal(0(\frac{complexity}{10})^2)$. -It has a probability of 70\% of not being applied. - ---- - -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} - -Following~\citet{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 a 32$\times$32 sub-region -of that image is chosen as the background image (by sampling position -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 \sim U[complexity, 1]$. -Each background pixel value is multiplied by $\frac{max(maximage - - contrast, 0)}{maxbg}$ (higher contrast yield darker -background). The output image pixels are max(background,original). - ---- - -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). - -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]$. - -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 $\sim U[0,1]$ to random subsets of pixels. -The number of selected pixels is $0.2 \times complexity$. -This filter has a probability of not being applied at all of 75\%. - ---- - -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} - -Different regions of the image are spatially smoothed. -The image is convolved with a symmetric Gaussian kernel of +%\begin{wrapfigure}[8]{l}{0.15\textwidth} +%\vspace*{-6mm} +\begin{minipage}[t]{0.14\linewidth} +\begin{center} +%\centering +\vspace*{6mm} +\includegraphics[scale=.4]{images/Bruitgauss_only.png} +%{\bf Gaussian Smoothing} +\end{center} +%\end{wrapfigure} +%%\vspace{.5cm} +\end{minipage}% +\hspace{0.3cm}\begin{minipage}[t]{0.86\linewidth} +With the {\bf Gaussian smoothing} module, +different regions of the image are spatially smoothed. +This is achieved by first convolving +the image with an isotropic Gaussian kernel of size and variance chosen 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 +complexity]$ and $[2,2 + 6 \times complexity]$. This filtered image is normalized +between $0$ and $1$. We also create an isotropic weighted 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\%. +we add to the mask the averaging window centered on it. The final image is +computed from the following element-wise operation: $\frac{image + filtered\_image +\times mask}{mask+1}$. +This module is skipped with probability 75\%. +\end{minipage} + +%\newpage + +%\vspace*{-9mm} +\subsubsection*{Permute Pixels} ----- +%\hspace*{-3mm}\begin{minipage}[t]{0.18\linewidth} +%\centering +\begin{minipage}[t]{0.14\textwidth} +%\begin{wrapfigure}[7]{l}{ +%\vspace*{-5mm} +\begin{center} +\vspace*{1mm} +\includegraphics[scale=.4]{images/Permutpixel_only.png} +%{\small\bf Permute Pixels} +\end{center} +%\end{wrapfigure} +\end{minipage}% +\hspace{3mm}\begin{minipage}[t]{0.86\linewidth} +\vspace*{1mm} +%%\vspace*{-20mm} +This module {\bf permutes neighbouring pixels}. It first selects a +fraction $\frac{complexity}{3}$ of pixels randomly in the image. Each +of these pixels is then sequentially exchanged with a random pixel +among its four nearest neighbors (on its left, right, top or bottom). +This module is skipped with probability 80\%.\\ +%\vspace*{1mm} +\end{minipage} + +%\vspace{-3mm} + +\subsubsection*{Gaussian Noise} + +\begin{minipage}[t]{0.14\textwidth} +%\begin{wrapfigure}[7]{l}{ +%%\vspace*{-3mm} +\begin{center} +%\hspace*{-3mm}\begin{minipage}[t]{0.18\linewidth} +%\centering +\vspace*{0mm} +\includegraphics[scale=.4]{images/Distorsiongauss_only.png} +%{\small \bf Gauss. Noise} +\end{center} +%\end{wrapfigure} +\end{minipage}% +\hspace{0.3cm}\begin{minipage}[t]{0.86\linewidth} +\vspace*{1mm} +%\vspace*{12mm} +The {\bf Gaussian noise} module simply adds, to each pixel of the image independently, a +noise $\sim Normal(0,(\frac{complexity}{10})^2)$. +This module is skipped with probability 70\%. +%%\vspace{1.1cm} +\end{minipage} -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}$. +%\vspace*{1.2cm} + +\subsubsection*{Background Image Addition} + +\begin{minipage}[t]{\linewidth} +\begin{minipage}[t]{0.14\linewidth} +\centering +\vspace*{0mm} +\includegraphics[scale=.4]{images/background_other_only.png} +%{\small \bf Bg Image} +\end{minipage}% +\hspace{0.3cm}\begin{minipage}[t]{0.83\linewidth} +\vspace*{1mm} +Following~\citet{Larochelle-jmlr-2009}, the {\bf background image} module adds a random +background image behind the letter, from a randomly chosen natural image, +with contrast adjustments depending on $complexity$, to preserve +more or less of the original character image. +%%\vspace{.8cm} +\end{minipage} +\end{minipage} +%%\vspace{-.7cm} + +\subsubsection*{Salt and Pepper Noise} -This filter has a probability of not being applied, at all, of 75\%. +\begin{minipage}[t]{0.14\linewidth} +\centering +\vspace*{0mm} +\includegraphics[scale=.4]{images/Poivresel_only.png} +%{\small \bf Salt \& Pepper} +\end{minipage}% +\hspace{0.3cm}\begin{minipage}[t]{0.83\linewidth} +\vspace*{1mm} +The {\bf salt and pepper noise} module adds noise $\sim U[0,1]$ to random subsets of pixels. +The number of selected pixels is $0.2 \times complexity$. +This module is skipped with probability 75\%. +%%\vspace{.9cm} +\end{minipage} +%%\vspace{-.7cm} -\subsection{Scratches} +%\vspace{1mm} +\subsubsection*{Scratches} -The scratches module places line-like white patches on the image. The +\begin{minipage}[t]{0.14\textwidth} +%\begin{wrapfigure}[7]{l}{ +%\begin{minipage}[t]{0.14\linewidth} +%\centering +\begin{center} +\vspace*{4mm} +%\hspace*{-1mm} +\includegraphics[scale=.4]{images/Rature_only.png}\\ +%{\bf Scratches} +\end{center} +\end{minipage}% +%\end{wrapfigure} +\hspace{0.3cm}\begin{minipage}[t]{0.86\linewidth} +%%\vspace{.4cm} +The {\bf scratches} module places line-like white patches on the image. The lines are heavily transformed images of the digit ``1'' (one), chosen -at random among five thousands such 1 images. The 1 image is +at random among 500 such 1 images, randomly cropped and rotated by an angle $\sim Normal(0,(100 \times -complexity)^2$, using bi-cubic interpolation, +complexity)^2$ (in degrees), using bi-cubic interpolation. Two passes of a grey-scale morphological erosion filter are applied, reducing the width of the line by an amount controlled by $complexity$. -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. - ---- - -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. +This module is skipped with probability 85\%. The probabilities +of applying 1, 2, or 3 patches are (50\%,30\%,20\%). +\end{minipage} -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. +%\vspace*{1mm} -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$. - -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. +\subsubsection*{Grey Level and Contrast Changes} -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. - -\subsection{Grey Level and Contrast Changes} - -This filter changes the contrast 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. -Contrast $\sim U[1-0.85 \times complexity,1]$ (so contrast $\geq 0.15$). -The image is normalized into $[\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{minipage}[t]{0.15\linewidth} +\centering +\vspace*{0mm} +\includegraphics[scale=.4]{images/Contrast_only.png} +%{\bf Grey Level \& Contrast} +\end{minipage}% +\hspace{3mm}\begin{minipage}[t]{0.85\linewidth} +\vspace*{1mm} +The {\bf grey level and contrast} module changes the contrast by changing grey levels, and may invert the image polarity (white +to black and black to white). The contrast is $C \sim U[1-0.85 \times complexity,1]$ +so the image is normalized into $[\frac{1-C}{2},1-\frac{1-C}{2}]$. The +polarity is inverted with probability 50\%. +%%\vspace{.7cm} +\end{minipage} +%\vspace{2mm} -\begin{figure}[h] -\resizebox{.99\textwidth}{!}{\includegraphics{images/example_t.png}}\\ +\iffalse +\begin{figure}[ht] +\centerline{\resizebox{.9\textwidth}{!}{\includegraphics{images/example_t.png}}}\\ \caption{Illustration of the pipeline of stochastic -transformations applied to the image of a lower-case t +transformations applied to the image of a lower-case \emph{t} (the upper left image). Each image in the pipeline (going from left to right, first top line, then bottom line) shows the result of applying one of the modules in the pipeline. The last image (bottom right) is used as training example.} \label{fig:pipeline} \end{figure} +\fi + +%\vspace*{-3mm} +\section{Experimental Setup} +%\vspace*{-1mm} + +Much previous work on deep learning had been performed on +the MNIST digits task~\citep{Hinton06,ranzato-07-small,Bengio-nips-2006,Salakhutdinov+Hinton-2009}, +with 60~000 examples, and variants involving 10~000 +examples~\citep{Larochelle-jmlr-toappear-2008,VincentPLarochelleH2008}. +The focus here is on much larger training sets, from 10 times to +to 1000 times larger, and 62 classes. + +The first step in constructing the larger datasets (called NISTP and P07) is to sample from +a {\em data source}: {\bf NIST} (NIST database 19), {\bf Fonts}, {\bf Captchas}, +and {\bf OCR data} (scanned machine printed characters). Once a character +is sampled from one of these sources (chosen randomly), the second step is to +apply a pipeline of transformations and/or noise processes described in section \ref{s:perturbations}. + +To provide a baseline of error rate comparison we also estimate human performance +on both the 62-class task and the 10-class digits task. +We compare the best Multi-Layer Perceptrons (MLP) against +the best Stacked Denoising Auto-encoders (SDA), when +both models' hyper-parameters are selected to minimize the validation set error. +We also provide a comparison against a precise estimate +of human performance obtained via Amazon's Mechanical Turk (AMT) +service (http://mturk.com). +AMT users are paid small amounts +of money to perform tasks for which human intelligence is required. +Mechanical Turk has been used extensively in natural language processing and vision. +%processing \citep{SnowEtAl2008} and vision +%\citep{SorokinAndForsyth2008,whitehill09}. +AMT users were presented +with 10 character images (from a test set) and asked to choose 10 corresponding ASCII +characters. They were forced to choose a single character class (either among the +62 or 10 character classes) for each image. +80 subjects classified 2500 images per (dataset,task) pair, +with the guarantee that 3 different subjects classified each image, allowing +us to estimate inter-human variability (e.g a standard error of 0.1\% +on the average 18.2\% error done by humans on the 62-class task NIST test set). + +%\vspace*{-3mm} +\subsection{Data Sources} +%\vspace*{-2mm} + +%\begin{itemize} +%\item +{\bf NIST.} +Our main source of characters is the NIST Special Database 19~\citep{Grother-1995}, +widely used for training and testing character +recognition systems~\citep{Granger+al-2007,Cortes+al-2000,Oliveira+al-2002-short,Milgram+al-2005}. +The dataset is composed of 814255 digits and characters (upper and lower cases), with hand checked classifications, +extracted from handwritten sample forms of 3600 writers. The characters are labelled by one of the 62 classes +corresponding to ``0''-``9'',``A''-``Z'' and ``a''-``z''. The dataset contains 8 parts (partitions) of varying complexity. +The fourth partition (called $hsf_4$, 82587 examples), +experimentally recognized to be the most difficult one, is the one recommended +by NIST as a testing set and is used in our work as well as some previous work~\citep{Granger+al-2007,Cortes+al-2000,Oliveira+al-2002-short,Milgram+al-2005} +for that purpose. We randomly split the remainder (731668 examples) into a training set and a validation set for +model selection. +The performances reported by previous work on that dataset mostly use only the digits. +Here we use all the classes both in the training and testing phase. This is especially +useful to estimate the effect of a multi-task setting. +The distribution of the classes in the NIST training and test sets differs +substantially, with relatively many more digits in the test set, and a more uniform distribution +of letters in the test set (whereas in the training set they are distributed +more like in natural text). +%\vspace*{-1mm} + +%\item +{\bf Fonts.} +In order to have a good variety of sources we downloaded an important number of free fonts from: +{\tt http://cg.scs.carleton.ca/\textasciitilde luc/freefonts.html}. +% TODO: pointless to anonymize, it's not pointing to our work +Including the operating system's (Windows 7) fonts, there is a total of $9817$ different fonts that we can choose uniformly from. +The chosen {\tt ttf} file is either used as input of the Captcha generator (see next item) or, by producing a corresponding image, +directly as input to our models. +%\vspace*{-1mm} + +%\item +{\bf Captchas.} +The Captcha data source is an adaptation of the \emph{pycaptcha} library (a python based captcha generator library) for +generating characters of the same format as the NIST dataset. This software is based on +a random character class generator and various kinds of transformations similar to those described in the previous sections. +In order to increase the variability of the data generated, many different fonts are used for generating the characters. +Transformations (slant, distortions, rotation, translation) are applied to each randomly generated character with a complexity +depending on the value of the complexity parameter provided by the user of the data source. +%Two levels of complexity are allowed and can be controlled via an easy to use facade class. %TODO: what's a facade class? +%\vspace*{-1mm} + +%\item +{\bf OCR data.} +A large set (2 million) of scanned, OCRed and manually verified machine-printed +characters where included as an +additional source. This set is part of a larger corpus being collected by the Image Understanding +Pattern Recognition Research group led by Thomas Breuel at University of Kaiserslautern +({\tt http://www.iupr.com}), and which will be publicly released. +%TODO: let's hope that Thomas is not a reviewer! :) Seriously though, maybe we should anonymize this +%\end{itemize} + +%\vspace*{-3mm} +\subsection{Data Sets} +%\vspace*{-2mm} + +All data sets contain 32$\times$32 grey-level images (values in $[0,1]$) associated with a label +from one of the 62 character classes. +%\begin{itemize} +%\vspace*{-1mm} + +%\item +{\bf NIST.} This is the raw NIST special database 19~\citep{Grother-1995}. It has +\{651668 / 80000 / 82587\} \{training / validation / test\} examples. +%\vspace*{-1mm} + +%\item +{\bf P07.} This dataset is obtained by taking raw characters from all four of the above sources +and sending them through the transformation pipeline described in section \ref{s:perturbations}. +For each new example to generate, a data source is selected with probability $10\%$ from the fonts, +$25\%$ from the captchas, $25\%$ from the OCR data and $40\%$ from NIST. We apply all the transformations in the +order given above, and for each of them we sample uniformly a \emph{complexity} in the range $[0,0.7]$. +It has \{81920000 / 80000 / 20000\} \{training / validation / test\} examples. +%\vspace*{-1mm} + +%\item +{\bf NISTP.} This one is equivalent to P07 (complexity parameter of $0.7$ with the same proportions of data sources) + except that we only apply + transformations from slant to pinch. Therefore, the character is + transformed but no additional noise is added to the image, giving images + closer to the NIST dataset. +It has \{81920000 / 80000 / 20000\} \{training / validation / test\} examples. +%\end{itemize} + +%\vspace*{-3mm} +\subsection{Models and their Hyperparameters} +%\vspace*{-2mm} + +The experiments are performed using MLPs (with a single +hidden layer) and SDAs. +\emph{Hyper-parameters are selected based on the {\bf NISTP} validation set error.} + +{\bf Multi-Layer Perceptrons (MLP).} +Whereas previous work had compared deep architectures to both shallow MLPs and +SVMs, we only compared to MLPs here because of the very large datasets used +(making the use of SVMs computationally challenging because of their quadratic +scaling behavior). +The MLP has a single hidden layer with $\tanh$ activation functions, and softmax (normalized +exponentials) on the output layer for estimating $P(class | image)$. +The number of hidden units is taken in $\{300,500,800,1000,1500\}$. +Training examples are presented in minibatches of size 20. A constant learning +rate was chosen among $\{0.001, 0.01, 0.025, 0.075, 0.1, 0.5\}$. +%through preliminary experiments (measuring performance on a validation set), +%and $0.1$ (which was found to work best) was then selected for optimizing on +%the whole training sets. +%\vspace*{-1mm} -\begin{figure}[h] -\resizebox{.99\textwidth}{!}{\includegraphics{images/transfo.png}}\\ -\caption{Illustration of each transformation applied to the same image -of the upper-case h (upper-left image). first row (from left to rigth) : original image, slant, -thickness, affine transformation, local elastic deformation; second row (from left to rigth) : -pinch, motion blur, occlusion, pixel permutation, gaussian noise; third row (from left to rigth) : -background image, salt and pepper noise, spatially gaussian noise, scratches, -grey level and contrast changes.} -\label{fig:transfo} +{\bf Stacked Denoising Auto-Encoders (SDA).} +Various auto-encoder variants and Restricted Boltzmann Machines (RBMs) +can be used to initialize the weights of each layer of a deep MLP (with many hidden +layers)~\citep{Hinton06,ranzato-07-small,Bengio-nips-2006}, +apparently setting parameters in the +basin of attraction of supervised gradient descent yielding better +generalization~\citep{Erhan+al-2010}. It is hypothesized that the +advantage brought by this procedure stems from a better prior, +on the one hand taking advantage of the link between the input +distribution $P(x)$ and the conditional distribution of interest +$P(y|x)$ (like in semi-supervised learning), and on the other hand +taking advantage of the expressive power and bias implicit in the +deep architecture (whereby complex concepts are expressed as +compositions of simpler ones through a deep hierarchy). + +\begin{figure}[ht] +%\vspace*{-2mm} +\centerline{\resizebox{0.8\textwidth}{!}{\includegraphics{images/denoising_autoencoder_small.pdf}}} +%\vspace*{-2mm} +\caption{Illustration of the computations and training criterion for the denoising +auto-encoder used to pre-train each layer of the deep architecture. Input $x$ of +the layer (i.e. raw input or output of previous layer) +s corrupted into $\tilde{x}$ and encoded into code $y$ by the encoder $f_\theta(\cdot)$. +The decoder $g_{\theta'}(\cdot)$ maps $y$ to reconstruction $z$, which +is compared to the uncorrupted input $x$ through the loss function +$L_H(x,z)$, whose expected value is approximately minimized during training +by tuning $\theta$ and $\theta'$.} +\label{fig:da} +%\vspace*{-2mm} +\end{figure} + +Here we chose to use the Denoising +Auto-encoder~\citep{VincentPLarochelleH2008} as the building block for +these deep hierarchies of features, as it is simple to train and +explain (see Figure~\ref{fig:da}, as well as +tutorial and code there: {\tt http://deeplearning.net/tutorial}), +provides efficient inference, and yielded results +comparable or better than RBMs in series of experiments +\citep{VincentPLarochelleH2008}. During training, a Denoising +Auto-encoder is presented with a stochastically corrupted version +of the input and trained to reconstruct the uncorrupted input, +forcing the hidden units to represent the leading regularities in +the data. Here we use the random binary masking corruption +(which sets to 0 a random subset of the inputs). + Once it is trained, in a purely unsupervised way, +its hidden units' activations can +be used as inputs for training a second one, etc. +After this unsupervised pre-training stage, the parameters +are used to initialize a deep MLP, which is fine-tuned by +the same standard procedure used to train them (see previous section). +The SDA hyper-parameters are the same as for the MLP, with the addition of the +amount of corruption noise (we used the masking noise process, whereby a +fixed proportion of the input values, randomly selected, are zeroed), and a +separate learning rate for the unsupervised pre-training stage (selected +from the same above set). The fraction of inputs corrupted was selected +among $\{10\%, 20\%, 50\%\}$. Another hyper-parameter is the number +of hidden layers but it was fixed to 3 based on previous work with +SDAs on MNIST~\citep{VincentPLarochelleH2008}. + +%\vspace*{-1mm} + +\begin{figure}[ht] +%\vspace*{-2mm} +\centerline{\resizebox{.99\textwidth}{!}{\includegraphics{images/error_rates_charts.pdf}}} +%\vspace*{-3mm} +\caption{SDAx are the {\bf deep} models. Error bars indicate a 95\% confidence interval. 0 indicates that the model was trained +on NIST, 1 on NISTP, and 2 on P07. Left: overall results +of all models, on NIST and NISTP test sets. +Right: error rates on NIST test digits only, along with the previous results from +literature~\citep{Granger+al-2007,Cortes+al-2000,Oliveira+al-2002-short,Milgram+al-2005} +respectively based on ART, nearest neighbors, MLPs, and SVMs.} +\label{fig:error-rates-charts} +%\vspace*{-2mm} \end{figure} -\section{Experimental Setup} - -\subsection{Training Datasets} - -\subsubsection{Data Sources} - -\begin{itemize} -\item {\bf NIST} -The NIST Special Database 19 (NIST19) is a very widely used dataset for training and testing OCR systems. -The dataset is composed with over 800 000 digits and characters (upper and lower cases), with hand checked classifications, -extracted from handwritten sample forms of 3600 writers. The characters are labelled by one of the 62 classes -corresponding to "0"-"9","A"-"Z" and "a"-"z". The dataset contains 8 series of different complexity. -The fourth series, $hsf_4$, experimentally recognized to be the most difficult one for classification task is recommended -by NIST as testing set and is used in our work for that purpose. -The performances reported by previous work on that dataset mostly use only the digits. -Here we use the whole classes both in the training and testing phase. - - -\item {\bf Fonts} -In order to have a good variety of sources we downloaded an important number of free fonts from: {\tt http://anonymous.url.net} -%real adress {\tt http://cg.scs.carleton.ca/~luc/freefonts.html} -in addition to Windows 7's, this adds up to a total of $9817$ different fonts that we can choose uniformly. -The ttf file is either used as input of the Captcha generator (see next item) or, by producing a corresponding image, -directly as input to our models. -%Guillaume are there other details I forgot on the font selection? - -\item {\bf Captchas} -The Captcha data source is an adaptation of the \emph{pycaptcha} library (a python based captcha generator library) for -generating characters of the same format as the NIST dataset. The core of this data source is composed with a random character -generator and various kinds of tranformations similar to those described in the previous sections. -In order to increase the variability of the data generated, different fonts are used for generating the characters. -Transformations (slant, distorsions, rotation, translation) are applied to each randomly generated character with a complexity -depending on the value of the complexity parameter provided by the user of the data source. Two levels of complexity are -allowed and can be controlled via an easy to use facade class. -\item {\bf OCR data} -\end{itemize} - -\subsubsection{Data Sets} -\begin{itemize} -\item {\bf P07} -The dataset P07 is sampled with our transformation pipeline with a complexity parameter of $0.7$. -For each new exemple to generate, we choose one source with the following probability: $0.1$ for the fonts, -$0.25$ for the captchas, $0.25$ for OCR data and $0.4$ for NIST. We apply all the transformations in their order -and for each of them we sample uniformly a complexity in the range $[0,0.7]$. -\item {\bf NISTP} {\em ne pas utiliser PNIST mais NISTP, pour rester politically correct...} -NISTP is equivalent to P07 (complexity parameter of $0.7$ with the same sources proportion) except that we only apply transformations from slant to pinch. Therefore, the character is transformed -but no additionnal noise is added to the image, this gives images closer to the NIST dataset. -\end{itemize} - -We noticed that the distribution of the training sets and the test sets differ. -Since our validation sets are sampled from the training set, they have approximately the same distribution, but the test set has a completely different distribution as illustrated in figure \ref {setsdata}. - -\begin{figure} -\subfigure[NIST training]{\includegraphics[width=0.5\textwidth]{images/nisttrainstats}} -\subfigure[NIST validation]{\includegraphics[width=0.5\textwidth]{images/nistvalidstats}} -\subfigure[NIST test]{\includegraphics[width=0.5\textwidth]{images/nistteststats}} -\subfigure[NISTP validation]{\includegraphics[width=0.5\textwidth]{images/nistpvalidstats}} -\caption{Proportion of each class in some of the data sets} -\label{setsdata} +\begin{figure}[ht] +%\vspace*{-3mm} +\centerline{\resizebox{.99\textwidth}{!}{\includegraphics{images/improvements_charts.pdf}}} +%\vspace*{-3mm} +\caption{Relative improvement in error rate due to self-taught learning. +Left: Improvement (or loss, when negative) +induced by out-of-distribution examples (perturbed data). +Right: Improvement (or loss, when negative) induced by multi-task +learning (training on all classes and testing only on either digits, +upper case, or lower-case). The deep learner (SDA) benefits more from +both self-taught learning scenarios, compared to the shallow MLP.} +\label{fig:improvements-charts} +%\vspace*{-2mm} \end{figure} -\subsection{Models and their Hyperparameters} - -\subsubsection{Multi-Layer Perceptrons (MLP)} - -An MLP is a family of functions that are described by stacking layers of of a function similar to -$$g(x) = \tanh(b+Wx)$$ -The input, $x$, is a $d$-dimension vector. -The output, $g(x)$, is a $m$-dimension vector. -The parameter $W$ is a $m\times d$ matrix and is called the weight matrix. -The parameter $b$ is a $m$-vector and is called the bias vector. -The non-linearity (here $\tanh$) is applied element-wise to the output vector. -Usually the input is referred to a input layer and similarly for the output. -You can of course chain several such functions to obtain a more complex one. -Here is a common example -$$f(x) = c + V\tanh(b+Wx)$$ -In this case the intermediate layer corresponding to $\tanh(b+Wx)$ is called a hidden layer. -Here the output layer does not have the same non-linearity as the hidden layer. -This is a common case where some specialized non-linearity is applied to the output layer only depending on the task at hand. - -If you put 3 or more hidden layers in such a network you obtain what is called a deep MLP. -The parameters to adapt are the weight matrix and the bias vector for each layer. - -\subsubsection{Stacked Denoising Auto-Encoders (SDAE)} -\label{SdA} +\section{Experimental Results} +%\vspace*{-2mm} -Auto-encoders are essentially a way to initialize the weights of the network to enable better generalization. -This is essentially unsupervised training where the layer is made to reconstruct its input through and encoding and decoding phase. -Denoising auto-encoders are a variant where the input is corrupted with random noise but the target is the uncorrupted input. -The principle behind these initialization methods is that the network will learn the inherent relation between portions of the data and be able to represent them thus helping with whatever task we want to perform. - -An auto-encoder unit is formed of two MLP layers with the bottom one called the encoding layer and the top one the decoding layer. -Usually the top and bottom weight matrices are the transpose of each other and are fixed this way. -The network is trained as such and, when sufficiently trained, the MLP layer is initialized with the parameters of the encoding layer. -The other parameters are discarded. - -The stacked version is an adaptation to deep MLPs where you initialize each layer with a denoising auto-encoder starting from the bottom. -During the initialization, which is usually called pre-training, the bottom layer is treated as if it were an isolated auto-encoder. -The second and following layers receive the same treatment except that they take as input the encoded version of the data that has gone through the layers before it. -For additional details see \cite{vincent:icml08}. - -\section{Experimental Results} - -\subsection{SDA vs MLP vs Humans} - -We compare here the best MLP (according to validation set error) that we found against -the best SDA (again according to validation set error), along with a precise estimate -of human performance obtained via Amazon's Mechanical Turk (AMT) -service\footnote{http://mturk.com}. AMT users are paid small amounts -of money to perform tasks for which human intelligence is required. -Mechanical Turk has been used extensively in natural language -processing \cite{SnowEtAl2008} and vision -\cite{SorokinAndForsyth2008,whitehill09}. AMT users where presented -with 10 character images and asked to type 10 corresponding ascii -characters. Hence they were forced to make a hard choice among the -62 character classes. Three users classified each image, allowing -to estimate inter-human variability (shown as +/- in parenthesis below). +%%\vspace*{-1mm} +%\subsection{SDA vs MLP vs Humans} +%%\vspace*{-1mm} +The models are either trained on NIST (MLP0 and SDA0), +NISTP (MLP1 and SDA1), or P07 (MLP2 and SDA2), and tested +on either NIST, NISTP or P07, either on the 62-class task +or on the 10-digits task. Training (including about half +for unsupervised pre-training, for DAs) on the larger +datasets takes around one day on a GPU-285. +Figure~\ref{fig:error-rates-charts} summarizes the results obtained, +comparing humans, the three MLPs (MLP0, MLP1, MLP2) and the three SDAs (SDA0, SDA1, +SDA2), along with the previous results on the digits NIST special database +19 test set from the literature, respectively based on ARTMAP neural +networks ~\citep{Granger+al-2007}, fast nearest-neighbor search +~\citep{Cortes+al-2000}, MLPs ~\citep{Oliveira+al-2002-short}, and SVMs +~\citep{Milgram+al-2005}. More detailed and complete numerical results +(figures and tables, including standard errors on the error rates) can be +found in Appendix I of the supplementary material. +The deep learner not only outperformed the shallow ones and +previously published performance (in a statistically and qualitatively +significant way) but when trained with perturbed data +reaches human performance on both the 62-class task +and the 10-class (digits) task. +17\% error (SDA1) or 18\% error (humans) may seem large but a large +majority of the errors from humans and from SDA1 are from out-of-context +confusions (e.g. a vertical bar can be a ``1'', an ``l'' or an ``L'', and a +``c'' and a ``C'' are often indistinguishible). -\begin{table} -\caption{Overall comparison of error rates ($\pm$ std.err.) on 62 character classes (10 digits + -26 lower + 26 upper), except for last columns -- digits only, between deep architecture with pre-training -(SDA=Stacked Denoising Autoencoder) and ordinary shallow architecture -(MLP=Multi-Layer Perceptron). The models shown are all trained using perturbed data (NISTP or P07) -and using a validation set to select hyper-parameters and other training choices. -\{SDA,MLP\}0 are trained on NIST, -\{SDA,MLP\}1 are trained on NISTP, and \{SDA,MLP\}2 are trained on P07. -The human error rate on digits is a lower bound because it does not count digits that were -recognized as letters. For comparison, the results found in the literature -on NIST digits classification using the same test set are included.} -\label{tab:sda-vs-mlp-vs-humans} -\begin{center} -\begin{tabular}{|l|r|r|r|r|} \hline - & NIST test & NISTP test & P07 test & NIST test digits \\ \hline -Humans& 18.2\% $\pm$.1\% & 39.4\%$\pm$.1\% & 46.9\%$\pm$.1\% & $>1.1\%$ \\ \hline -SDA0 & 23.7\% $\pm$.14\% & 65.2\%$\pm$.34\% & 97.45\%$\pm$.06\% & 2.7\% $\pm$.14\%\\ \hline -SDA1 & 17.1\% $\pm$.13\% & 29.7\%$\pm$.3\% & 29.7\%$\pm$.3\% & 1.4\% $\pm$.1\%\\ \hline -SDA2 & 18.7\% $\pm$.13\% & 33.6\%$\pm$.3\% & 39.9\%$\pm$.17\% & 1.7\% $\pm$.1\%\\ \hline -MLP0 & 24.2\% $\pm$.15\% & 68.8\%$\pm$.33\% & 78.70\%$\pm$.14\% & 3.45\% $\pm$.15\% \\ \hline -MLP1 & 23.0\% $\pm$.15\% & 41.8\%$\pm$.35\% & 90.4\%$\pm$.1\% & 3.85\% $\pm$.16\% \\ \hline -MLP2 & 24.3\% $\pm$.15\% & 46.0\%$\pm$.35\% & 54.7\%$\pm$.17\% & 4.85\% $\pm$.18\% \\ \hline -[5] & & & & 4.95\% $\pm$.18\% \\ \hline -[2] & & & & 3.71\% $\pm$.16\% \\ \hline -[3] & & & & 2.4\% $\pm$.13\% \\ \hline -[4] & & & & 2.1\% $\pm$.12\% \\ \hline -\end{tabular} -\end{center} -\end{table} +In addition, as shown in the left of +Figure~\ref{fig:improvements-charts}, the relative improvement in error +rate brought by self-taught learning is greater for the SDA, and these +differences with the MLP are statistically and qualitatively +significant. +The left side of the figure shows the improvement to the clean +NIST test set error brought by the use of out-of-distribution examples +(i.e. the perturbed examples examples from NISTP or P07). +Relative percent change is measured by taking +$100 \% \times$ (original model's error / perturbed-data model's error - 1). +The right side of +Figure~\ref{fig:improvements-charts} shows the relative improvement +brought by the use of a multi-task setting, in which the same model is +trained for more classes than the target classes of interest (i.e. training +with all 62 classes when the target classes are respectively the digits, +lower-case, or upper-case characters). Again, whereas the gain from the +multi-task setting is marginal or negative for the MLP, it is substantial +for the SDA. Note that to simplify these multi-task experiments, only the original +NIST dataset is used. For example, the MLP-digits bar shows the relative +percent improvement in MLP error rate on the NIST digits test set +is $100\% \times$ (single-task +model's error / multi-task model's error - 1). The single-task model is +trained with only 10 outputs (one per digit), seeing only digit examples, +whereas the multi-task model is trained with 62 outputs, with all 62 +character classes as examples. Hence the hidden units are shared across +all tasks. For the multi-task model, the digit error rate is measured by +comparing the correct digit class with the output class associated with the +maximum conditional probability among only the digit classes outputs. The +setting is similar for the other two target classes (lower case characters +and upper case characters). +%%\vspace*{-1mm} +%\subsection{Perturbed Training Data More Helpful for SDA} +%%\vspace*{-1mm} -\subsection{Perturbed Training Data More Helpful for SDAE} +%%\vspace*{-1mm} +%\subsection{Multi-Task Learning Effects} +%%\vspace*{-1mm} -\begin{table} -\caption{Relative change in error rates due to the use of perturbed training data, -either using NISTP, for the MLP1/SDA1 models, or using P07, for the MLP2/SDA2 models. -A positive value indicates that training on the perturbed data helped for the -given test set (the first 3 columns on the 62-class tasks and the last one is -on the clean 10-class digits). Clearly, the deep learning models did benefit more -from perturbed training data, even when testing on clean data, whereas the MLP -trained on perturbed data performed worse on the clean digits and about the same -on the clean characters. } -\label{tab:sda-vs-mlp-vs-humans} -\begin{center} -\begin{tabular}{|l|r|r|r|r|} \hline - & NIST test & NISTP test & P07 test & NIST test digits \\ \hline -SDA0/SDA1-1 & 38\% & 84\% & 228\% & 93\% \\ \hline -SDA0/SDA2-1 & 27\% & 94\% & 144\% & 59\% \\ \hline -MLP0/MLP1-1 & 5.2\% & 65\% & -13\% & -10\% \\ \hline -MLP0/MLP2-1 & -0.4\% & 49\% & 44\% & -29\% \\ \hline -\end{tabular} -\end{center} -\end{table} - - -\subsection{Multi-Task Learning Effects} - +\iffalse As previously seen, the SDA is better able to benefit from the transformations applied to the data than the MLP. In this experiment we define three tasks: recognizing digits (knowing that the input is a digit), @@ -783,35 +925,99 @@ Our results show that the MLP benefits marginally from the multi-task setting in the case of digits (5\% relative improvement) but is actually hurt in the case of characters (respectively 3\% and 4\% worse for lower and upper class characters). -On the other hand the SDA benefitted from the multi-task setting, with relative +On the other hand the SDA benefited from the multi-task setting, with relative error rate improvements of 27\%, 15\% and 13\% respectively for digits, lower and upper case characters, as shown in Table~\ref{tab:multi-task}. +\fi -\begin{table} -\caption{Test error rates and relative change in error rates due to the use of -a multi-task setting, i.e., training on each task in isolation vs training -for all three tasks together, for MLPs vs SDAs. The SDA benefits much -more from the multi-task setting. All experiments on only on the -unperturbed NIST data, using validation error for model selection. -Relative improvement is 1 - single-task error / multi-task error.} -\label{tab:multi-task} -\begin{center} -\begin{tabular}{|l|r|r|r|} \hline - & single-task & multi-task & relative \\ - & setting & setting & improvement \\ \hline -MLP-digits & 3.77\% & 3.99\% & 5.6\% \\ \hline -MLP-lower & 17.4\% & 16.8\% & -4.1\% \\ \hline -MLP-upper & 7.84\% & 7.54\% & -3.6\% \\ \hline -SDA-digits & 2.6\% & 3.56\% & 27\% \\ \hline -SDA-lower & 12.3\% & 14.4\% & 15\% \\ \hline -SDA-upper & 5.93\% & 6.78\% & 13\% \\ \hline -\end{tabular} -\end{center} -\end{table} + +%\vspace*{-2mm} +\section{Conclusions and Discussion} +%\vspace*{-2mm} + +We have found that the self-taught learning framework is more beneficial +to a deep learner than to a traditional shallow and purely +supervised learner. More precisely, +the answers are positive for all the questions asked in the introduction. +%\begin{itemize} + +$\bullet$ %\item +{\bf Do the good results previously obtained with deep architectures on the +MNIST digits generalize to a much larger and richer (but similar) +dataset, the NIST special database 19, with 62 classes and around 800k examples}? +Yes, the SDA {\em systematically outperformed the MLP and all the previously +published results on this dataset} (the ones that we are aware of), {\em in fact reaching human-level +performance} at around 17\% error on the 62-class task and 1.4\% on the digits. + +$\bullet$ %\item +{\bf To what extent do self-taught learning scenarios help deep learners, +and do they help them more than shallow supervised ones}? +We found that distorted training examples not only made the resulting +classifier better on similarly perturbed images but also on +the {\em original clean examples}, and more importantly and more novel, +that deep architectures benefit more from such {\em out-of-distribution} +examples. MLPs were helped by perturbed training examples when tested on perturbed input +images (65\% relative improvement on NISTP) +but only marginally helped (5\% relative improvement on all classes) +or even hurt (10\% relative loss on digits) +with respect to clean examples . On the other hand, the deep SDAs +were significantly boosted by these out-of-distribution examples. +Similarly, whereas the improvement due to the multi-task setting was marginal or +negative for the MLP (from +5.6\% to -3.6\% relative change), +it was quite significant for the SDA (from +13\% to +27\% relative change), +which may be explained by the arguments below. +%\end{itemize} -\section{Conclusions} +In the original self-taught learning framework~\citep{RainaR2007}, the +out-of-sample examples were used as a source of unsupervised data, and +experiments showed its positive effects in a \emph{limited labeled data} +scenario. However, many of the results by \citet{RainaR2007} (who used a +shallow, sparse coding approach) suggest that the {\em relative gain of self-taught +learning vs ordinary supervised learning} diminishes as the number of labeled examples increases. +We note instead that, for deep +architectures, our experiments show that such a positive effect is accomplished +even in a scenario with a \emph{large number of labeled examples}, +i.e., here, the relative gain of self-taught learning is probably preserved +in the asymptotic regime. -\bibliography{strings,ml,aigaion,specials} -\bibliographystyle{mlapa} +{\bf Why would deep learners benefit more from the self-taught learning framework}? +The key idea is that the lower layers of the predictor compute a hierarchy +of features that can be shared across tasks or across variants of the +input distribution. Intermediate features that can be used in different +contexts can be estimated in a way that allows to share statistical +strength. Features extracted through many levels are more likely to +be more abstract (as the experiments in~\citet{Goodfellow2009} suggest), +increasing the likelihood that they would be useful for a larger array +of tasks and input conditions. +Therefore, we hypothesize that both depth and unsupervised +pre-training play a part in explaining the advantages observed here, and future +experiments could attempt at teasing apart these factors. +And why would deep learners benefit from the self-taught learning +scenarios even when the number of labeled examples is very large? +We hypothesize that this is related to the hypotheses studied +in~\citet{Erhan+al-2010}. Whereas in~\citet{Erhan+al-2010} +it was found that online learning on a huge dataset did not make the +advantage of the deep learning bias vanish, a similar phenomenon +may be happening here. We hypothesize that unsupervised pre-training +of a deep hierarchy with self-taught learning initializes the +model in the basin of attraction of supervised gradient descent +that corresponds to better generalization. Furthermore, such good +basins of attraction are not discovered by pure supervised learning +(with or without self-taught settings), and more labeled examples +does not allow the model to go from the poorer basins of attraction discovered +by the purely supervised shallow models to the kind of better basins associated +with deep learning and self-taught learning. + +A Flash demo of the recognizer (where both the MLP and the SDA can be compared) +can be executed on-line at {\tt http://deep.host22.com}. + +\newpage +{ +\bibliography{strings,strings-short,strings-shorter,ift6266_ml,aigaion-shorter,specials} +%\bibliographystyle{plainnat} +\bibliographystyle{unsrtnat} +%\bibliographystyle{apalike} +} + \end{document}