view writeup/nips2010_submission.tex @ 530:8fe77eac344f

Clarifying the experimental setup, typos here and there
author Dumitru Erhan <dumitru.erhan@gmail.com>
date Tue, 01 Jun 2010 18:18:01 -0700
parents 07bc0ca8d246
children 85f2337d47d2
line wrap: on
line source

\documentclass{article} % For LaTeX2e
\usepackage{nips10submit_e,times}

\usepackage{amsthm,amsmath,bbm} 
\usepackage[psamsfonts]{amssymb}
\usepackage{algorithm,algorithmic}
\usepackage[utf8]{inputenc}
\usepackage{graphicx,subfigure}
\usepackage[numbers]{natbib}

%\setlength\parindent{0mm}

\title{Deep Self-Taught Learning for Handwritten Character Recognition}
\author{The IFT6266 Gang}

\begin{document}

%\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. 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} and show that {\em deep learners benefit more from them than a
  corresponding shallow learner}, 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.  For this purpose we
  developed a powerful generator of stochastic variations and noise
  processes 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 pixel and
  spatially correlated noise. The out-of-distribution examples are 
  obtained by training with these highly distorted images or
  by including object classes different from those in the target test set.
\end{abstract}
\vspace*{-2mm}

\section{Introduction}
\vspace*{-1mm}

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, 
which consists of a chain of processing elements, each of which is associated with a
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)~\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
feature representation can lead to higher-level (more abstract, more
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.  All are based on unsupervised
learning, often in an greedy layer-wise ``unsupervised pre-training''
stage~\citep{Bengio-2009}.  One of these layer initialization techniques,
applied here, is the Denoising
Auto-Encoder~(DEA)~\citep{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 its input (the output of the previous
layer) and to reconstruct it from a corrupted version. After this
unsupervised initialization, the stack of denoising auto-encoders can be
converted into a deep supervised feedforward neural network and fine-tuned by
stochastic gradient descent.

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/or come from a distribution different from the target
distribution, e.g., from other classes that those of interest. Whereas
it has already been shown that deep learners can clearly take advantage of
unsupervised learning and unlabeled examples~\citep{Bengio-2009,WestonJ2008-small}
and multi-task learning, not much has been done yet to explore the impact
of {\em out-of-distribution} examples and of the multi-task setting
(but see~\citep{CollobertR2008}). In particular the {\em relative
advantage} of deep learning for this settings has not been evaluated.
The hypothesis explored here 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,
as discussed in the conclusion.

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}?

$\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?

$\bullet$ %\item 
Similarly, does the feature learning step in deep learning algorithms benefit more 
training with similar but different classes (i.e. a multi-task learning scenario) than
a corresponding shallow and purely supervised architecture?
%\end{enumerate}

Our experimental results provide positive evidence towards all of these questions.

\vspace*{-1mm}
\section{Perturbation and Transformation of Character Images}
\label{s:perturbations}
\vspace*{-1mm}

This section describes the different transformations we used to stochastically
transform source images in order to obtain data. 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. 

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.

\begin{figure}[ht]
\centerline{\resizebox{.9\textwidth}{!}{\includegraphics{images/transfo.png}}}
% TODO: METTRE LE NOM DE LA TRANSFO A COTE DE CHAQUE IMAGE
\caption{Illustration of each transformation applied alone to the same image
of an upper-case h (top left). First row (from left to right) : original image, slant,
thickness, affine transformation (translation, rotation, shear), 
local elastic deformation; second row (from left to right) :
pinch, motion blur, occlusion, pixel permutation, Gaussian noise; third row (from left to right) :
background image, salt and pepper noise, spatially Gaussian noise, scratches,
grey level and contrast changes.}
\label{fig:transfo}
\end{figure}

{\large\bf Transformations}

\vspace*{2mm}

{\bf Slant.} 
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*{0mm}

{\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.
\vspace*{0mm}

{\bf Affine Transformations.}
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]$.
\vspace*{0mm}

{\bf Local Elastic Deformations.}
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 convoluted 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*{0mm}

{\bf 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
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.
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*{1mm}

{\large\bf Injecting Noise}

\vspace*{1mm}

{\bf 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)$.
\vspace*{0mm}

{\bf 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
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.
\vspace*{0mm}

{\bf 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.
\vspace*{0mm}

{\bf Gaussian Noise.}
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.
\vspace*{0mm}

{\bf 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).
\vspace*{0mm}

{\bf 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\%.
\vspace*{0mm}

{\bf Spatially Gaussian Noise.}
Different regions of the image are spatially smoothed.
The image is convolved with a symmetric 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
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\%.
\vspace*{0mm}

{\bf Scratches.}
The 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
randomly cropped and rotated by an angle $\sim Normal(0,(100 \times
complexity)^2$, 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.
\vspace*{0mm}

{\bf 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.

\iffalse
\begin{figure}[ht]
\centerline{\resizebox{.99\textwidth}{!}{\includegraphics{images/example_t.png}}}\\
\caption{Illustration of the pipeline of stochastic 
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*{-1mm}
\section{Experimental Setup}
\vspace*{-1mm}

Whereas much previous work on deep learning algorithms had been performed on
the MNIST digits classification 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}, we want
to focus here on the case of much larger training sets, from 10 times to 
to 1000 times larger.  

The first step in constructing the larger datasets 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 pipeline of
the transformations and/or noise processes described in section \ref{s:perturbations}
is applied to the image.

We compare the best MLP against
the best SDA (both models' hyper-parameters are selected to minimize the validation set error), 
along with 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 and asked to choose 10 corresponding ASCII
characters. They were forced to make a hard choice among the
62 or 10 character classes (all classes or digits only). 
Three users classified each image, allowing
to estimate inter-human variability. A total 2500 images/dataset were classified.

\vspace*{-1mm}
\subsection{Data Sources}
\vspace*{-1mm}

%\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$), 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 into a training set and a validation set for
model selection. The sizes of these data sets are: 651668 for training, 80000 for validation, 
and 82587 for testing.
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.
Note that the distribution of the classes in the NIST training and test sets differs
substantially, with relatively many more digits in the test set, and more uniform distribution
of letters in the test set, compared to the training set (in the latter, the letters are distributed
more like the natural distribution of letters in text).

%\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.

%\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?

%\item 
{\bf OCR data.}
A large set (2 million) of scanned, OCRed and manually verified machine-printed 
characters (from various documents and books) where included as an
additional source. This set is part of a larger corpus being collected by the Image Understanding
Pattern Recognition Research group lead 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*{-1mm}
\subsection{Data Sets}
\vspace*{-1mm}

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}

%\item 
{\bf NIST.} This is the raw NIST special database 19~\citep{Grother-1995}.

%\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]$.

%\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.
%\end{itemize}

\vspace*{-1mm}
\subsection{Models and their Hyperparameters}
\vspace*{-1mm}

The experiments are performed with Multi-Layer Perceptrons (MLP) with a single
hidden layer and with Stacked Denoising Auto-Encoders (SDA).
\emph{Note that all hyper-parameters are selected based on performance on the {\bf NISTP} validation set.}

{\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$ was then selected for optimizing on the whole training sets.

\begin{figure}[ht]
\centerline{\resizebox{0.8\textwidth}{!}{\includegraphics{images/denoising_autoencoder_small.pdf}}}
\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)
is 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}
\end{figure}

{\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).

Here we chose to use the Denoising
Auto-Encoder~\citep{VincentPLarochelleH2008} as the building block for
these deep hierarchies of features, as it is very simple to train and
teach (see Figure~\ref{fig:da}, as well as 
tutorial and code at {\tt http://deeplearning.net/tutorial}), 
provides immediate and 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. Once it is trained, 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
stacked denoising auto-encoders on MNIST~\citep{VincentPLarochelleH2008}.

\vspace*{-1mm}

\begin{figure}[ht]
\centerline{\resizebox{.99\textwidth}{!}{\includegraphics{images/error_rates_charts.pdf}}}
\caption{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 3 different test sets (NIST, NISTP, P07).
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*{-1mm}
\end{figure}


\section{Experimental Results}

%\vspace*{-1mm}
%\subsection{SDA vs MLP vs Humans}
%\vspace*{-1mm}

Figure~\ref{fig:error-rates-charts} summarizes the results obtained,
comparing Humans, three MLPs (MLP0, MLP1, MLP2) and 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 3 kinds of model differ in the
training sets used: NIST only (MLP0,SDA0), NISTP (MLP1, SDA1), or P07
(MLP2, SDA2). The deep learner not only outperformed the shallow ones and
previously published performance (in a statistically and qualitatively
significant way) but reaches human performance on both the 62-class task
and the 10-class (digits) task. 

\begin{figure}[ht]
\vspace*{-2mm}
\centerline{\resizebox{.99\textwidth}{!}{\includegraphics{images/improvements_charts.pdf}}}
\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}

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 change is measured by taking
(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 for these multi-task experiment, only the original
NIST dataset is used. For example, the MLP-digits bar shows the relative
improvement in MLP error rate on the NIST digits test set (1 - single-task
model's error / multi-task model's error).  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}

%\vspace*{-1mm}
%\subsection{Multi-Task Learning Effects}
%\vspace*{-1mm}

\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),
recognizing upper case characters (knowing that the input is one), and
recognizing lower case characters (knowing that the input is one).  We
consider the digit classification task as the target task and we want to
evaluate whether training with the other tasks can help or hurt, and
whether the effect is different for MLPs versus SDAs.  The goal is to find
out if deep learning can benefit more (or less) from multiple related tasks
(i.e. the multi-task setting) compared to a corresponding purely supervised
shallow learner.

We use a single hidden layer MLP with 1000 hidden units, and a SDA
with 3 hidden layers (1000 hidden units per layer), pre-trained and
fine-tuned on NIST.

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 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


\vspace*{-1mm}
\section{Conclusions}
\vspace*{-1mm}

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 
Do the good results previously obtained with deep architectures on the
MNIST digits 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?
Yes, the SDA {\bf systematically outperformed the MLP and all the previously
published results on this dataset (the one that we are aware of), in fact reaching human-level
performance} at round 17\% error on the 62-class task and 1.4\% on the digits.

$\bullet$ %\item 
To what extent does the perturbation of input images (e.g. adding
noise, affine transformations, background images) make the resulting
classifier better not only on similarly perturbed images but also on
the {\em original clean examples}? Do deep architectures benefit more from such {\em out-of-distribution}
examples, i.e. do they benefit more from the self-taught learning~\citep{RainaR2007} framework?
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 very significantly boosted by these out-of-distribution examples.

$\bullet$ %\item 
Similarly, does the feature learning step in deep learning algorithms benefit more 
training with similar but different classes (i.e. a multi-task learning scenario) than
a corresponding shallow and purely supervised architecture?
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 very significant for the SDA (from +13\% to +27\% relative change).
%\end{itemize}

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 relative gain of self-taught
learning diminishes as the number of labeled examples increases (essentially,
a ``diminishing returns'' scenario occurs).  We note that, for deep
architectures, our experiments show that such a positive effect is accomplished
even in a scenario with a \emph{very large number of labeled examples}.

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.

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}