User:Wfwhitney/sandbox

In computer science, a convolutional neural network is a type of feed-forward artificial neural network where the individual neurons (or &quot;nodes&quot;) share weights with one another and are tiled in such a way that they respond to overlapping regions in the visual field. Convolutional networks were inspired by biological processes and are variations of multilayer perceptrons which are designed to reduce the number of free parameters in the model and provide robustness to local translations. They are widely used models for image recognition.

Typically a convolutional network will have a layer of convolution followed by a layer of subsampling, or pooling. In the convolution layer, each node first computes a weighted sum of the inputs in its field of view. Afterward it applies a pointwise nonlinearity to that sum, which allows the network to model arbitrary functions. Then, in the pooling layer, each node takes as its own value the maximum of its inputs. Effectively the network applies several filters to get feature maps, then at each point uses the feature map with the strongest response to the input.



Overview
The core idea behind neural networks is pattern recognition. As the network learns, each node will learn a function of its inputs that is useful for the later layers. Then the output layer learns a function which minimizes the error. These functions are templates which serve to detect a pattern in the input to each node. In the specific case of convolutional neural networks, the underlying assumption is that those &quot;templates&quot; should be independent of the pixel location in the image at which they occur. That is, the identity of patterns in an image should be location invariant.

The key distinguishing features of convolutional neural networks are

Together, these properties allow convolutional neural networks to very rapidly converge to good representations of the input at each layer, then combine those representations into larger ones. Weight sharing also helps by reducing the required memory size to run the network.
 * 1) Local connectivity: Each node in the network is connected to a relatively small number of the nodes in the layer below it which are &quot;close&quot; to it in the network connectivity graph. Typically this results in a pyramidal shape to the network, with nodes at the bottom having a very small &quot;field of view&quot; on the input, or &quot;receptive field&quot;, while nodes higher up, aggregating the outputs of several nodes below them, receive information from much more of the input data. This allows the network to first create good representations of a small part of the input (e.g.a few pixels), then assemble representations of larger areas of input (e.g. objects) from those low-level representations.
 * 2) Shared weights: Also known as &quot;tied weights&quot;. Instead of having a node with unique weights at each location within a layer, this technique essentially places a copy of the same node, with the same weights, at each location in the layer. When the network is run, it thus computes the same function at every point in the input, and so will, for example, detect a face in an image regardless of where in the image the face occurs. Because of this, they are able to tolerate translation of the input image.

Along with these signature convolutional layers, convolutional neural networks may include fully-connected layers and local or global pooling layers, which combine the outputs of neuron clusters for dimensionality reduction.

History
Convolutional neural networks were originally inspired by the work of Hubel and Wiesel, who proposed a model of vision based on their work in the cat and monkey visual cortices. In their model, there are two kinds of cells in the visual cortex, simple and complex. Each simple cell responds to a particular template in a very small section of the visual field, while each complex cell combines the responses of several simple cells over a larger field, producing a response that is locally invariant to translations.

Convolutional neural networks were introduced in a 1980 paper by Kunihiko Fukushima in a model he named Neocognitron. However, they did not see widespread application until Yann LeCun's system for handwritten digit recognition, LeNet. Their design was later improved in 1998 by Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner, generalized in 2003 by Sven Behnke, and simplified by Patrice Simard, David Steinkraus, and John C. Platt in the same year. In 1999 Riesenhuber and Poggio published a model called HMAX, a hierarchical max-pooling model of primate vision which led to the widespread using of pooling in convolutional nets. In 2006 several publications described new ways to train convolutional neural networks more efficiently that allowed for networks with more layers to be trained.

In 2011, they were refined by Dan Ciresan et al. and were implemented on a GPU with impressive performance results. Fast GPU-based convolutional network implementations opened the door to record-breaking results on many benchmarks. In 2012, Dan Ciresan et al. significantly improved upon the best performance in the literature for multiple image databases, including the MNIST database, the NORB database, the HWDB1.0 dataset (Chinese characters), and the CIFAR10 dataset (dataset of 60000 32x32 labeled RGB images). That same year, Alex Krizhevsky et al. won the ImageNet Large Scale Visual Recognition Challenge by a wide margin, with 11% fewer errors than the second-best entry; convolutional network implementations have dominated the contest since.

Performance
Convolutional neural networks are often used in image recognition systems. They have achieved an error rate of 0.23 percent on the MNIST database, which as of February 2012 is the lowest achieved on the database. Another paper on using convolutional neural networks for image classification reported that the learning process of convolutional neural networks was &quot;surprisingly fast&quot;; in the same paper, the best published results at the time were achieved in the MNIST database and the NORB database.

When applied to facial recognition, they were able to contribute to a large decrease in error rate. In another paper, they were able to achieve a 97.6 percent recognition rate on &quot;5,600 still images of more than 10 subjects&quot;. Convolutional neural networks have been used to assess video quality in an objective way after being manually trained; the resulting system had a very low root mean square error.

The ImageNet Large Scale Visual Recognition Challenge (ILSVRC) is a benchmark in object classification and detection, with millions of images and hundreds of object classes. In 2012 convolutional neural networks beat out other techniques, with a top-5 classification error rate of 15.3%, versus 26.2% achieved by the runner up. Performance of convolutional neural networks on the ImageNet tests is now close to that of humans, with the GoogLeNet submission achieving a top-5 classification error rate of 6.7% in 2014.

The best algorithms still struggle with objects that are small or thin, such as a small ant on a stem of a flower or a person holding a quill in their hand.They also have trouble with images that have been distorted with filters, an increasingly common phenomenon with modern digital cameras. By contrast, those kinds of images rarely trouble humans. Humans, however, tend to have trouble with other issues. For example, they are not good at classifying objects into fine-grained categories such as the particular breed of dog or species of bird, whereas convolutional neural networks handle this with ease.

Advantages
The design of convolutional neural networks has three major advantages over other forms of feedforward neural networks, namely faster training, reduced memory requirements, and reduced overfitting (or &quot;regularization&quot;).

Training Speed
By sharing weights across many nodes within a layer, convolutional neural networks are in effect employing transfer learning across the spacially-distributed nodes of the network. The error signal from a particular patch of the training data, which would otherwise only allow learning in the nodes in that location in the network, transfers to every tied node in the layer. Accordingly, if the items of interest are uniformly distributed in image location throughout the entire training set, there will be a speedup in training proportional to the degree of convolution (i.e. the number of nodes which share each weight).

Memory Requirements
The sharing of weights across nodes in each layer translates to very sparse weight networks which must be maintained in memory; since only one weight vector is required for each filter in a layer, the memory required to store it is decreased by a factor of the number of nodes per filter.

A modern deep convolutional neural network, such as the Krizhevsky ImageNet network, may have more than half a million neurons and a total of 60 million parameters. Without shared weights, the number of parameters (and accordingly, the memory required to store them) would be drastically higher.Memory requirements are a major bottleneck and often restrict the size of network which can be trained on given hardware. As such decreasing the memory footprint of a network allows the training of larger, more powerful networks.

Limitations
Convolutional neural networks have been criticized for their location invariance. Because pooling is designed to discard positional data about the input, it loses information about spatial relationships that is important to certain kinds of tasks, such as face detection.

Convolutional networks share the limitations of other kinds of feedforward neural networks, including the inability to handle arbitrarily-sized inputs (e.g. for language models), use additional processing time to refine their predictions without additional data, or provide insight into their intermediate representations (that is, explaining the inner workings of large neural networks can be very difficult).

Convolutional networks take a great deal of labeled inputs to learn (hence benchmarks like the million-image ImageNet), and are unable to generalize from small numbers of labeled data.

Network Design
When sharing weights between subsets of nodes within a layer, each set of nodes with shared weights can be viewed as a distinct &quot;filter&quot; over the input data. As such, most successful convolutional neural network designs, for example LeNet, use several filters in each layer, each of which has its own set of weights and in effect performs a different transformation of the input data. The idea is that, given $$k$$ filters in a layer, with training they will approximate the maximally-informative (with respect to the error function) set of $$k$$ uniformly-applied transformations of the input.

In convolutional neural networks for image recognition tasks, the most common design (used in such networks as LeNet and the Krizhevsky ImageNet network ) is roughly as follows. The first $$n$$ layers of the network (realistically, as many as can be computationally afforded) are alternating layers of convolution and max-pooling; followed by one or more dense (fully-connected) layers, the last layer of which has the same dimensionality as the number of classes; and finally a classifier, which may be linear regression, softmax, or something else.

The pooling layers serve to reduce the dimensionality of the data, extracting the single highest response from any of the nodes in a region and using it to represent the entire region. The fully-connected layers allow the network to aggregate data globally from all regions of the image, which lower layers could not do. The classifier layer turns the response from the top layer into the actual classification of the image.

Using a softmax activation function as the classifier layer of the network allows the outputs to be interpreted as posterior probabilities. This then gives a certainty measure on classification which is useful for analysis.

Some time-delay neural networks also use a very similar architecture to convolutional neural networks, especially those for image recognition and/or classification tasks, since the "tiling" of the neuron outputs can easily be carried out in timed stages in a manner useful for analysis of images.

Dropout
One common form of regularization used with convolutional neural networks is dropout, which &quot;consists of setting to zero the output of each hidden neuron with probability 0.5&quot;. That is, for any given execution of the network, a random set of half the nodes will not participate in either forward prediction or backpropagation. As a result, each training example will be run on a random network architecture, but all of those architectures share weights. This technique seems to reduce the complex, tightly-fitted interactions between nodes, leading them to learn more robust features which better generalize to new data. Dropout has been shown to improve the performance of neural networks on tasks in vision, speech recognition, document classification, and computational biology.

Artificial data
Since the degree of overfitting of a model is determined by both its power and the amount of training it receives, providing a convolutional network with extra training examples can reduce overfitting. Since these networks are usually already trained with all available data, one approach is to either generate new examples from scratch (if possible) or perturb the existing training samples to create new ones. For example, input images could be asymmetrically cropped by a few percent to create new examples with the same label as the original.

Network size
The simplest way to prevent overfitting of a network is simply to limit the number of hidden units and free parameters (connections) in the network. This restricts the predictive power of the network directly, reducing the complexity of the function that it can perform on the data, and thus limits the amount of overfitting. This is equivalent to a "zero norm".

Weight decay
A simple form of added regularizer is weight decay, which simply adds an additional error, proportional to the sum of weights (L1 norm) or squared magnitude (L2 norm) of the weight vector, to the error at each node. This is equivalent to a zero-mean Gaussian prior over the weight vector. The level of acceptable model complexity can be reduced by increasing the proportionality constant, thus increasing the penalty for large weight vectors.

Industry Use
The first widespread use of convolutional neural networks in industry was a handwriting recognition system developed by Yann LeCun which was brought to market in several forms, including a bank check optical character recognition system.

In recent years there have been several deployments of convolutional network-based technologies, primarily in speech recognition and vision tasks.

Speech
As of 2012, the voice recognition features included in Google's Android mobile operating system are powered by a convolutional neural network, and in the same year Microsoft deployed a new version of their Microsoft Audio Video Indexing Service based on convolutional neural networks.

Vision
Google has used convolutional neural networks for image recognition in several of their products. Google Street View uses them both for privacy protection, detecting faces, license plates, and other identifying information in order to obscure them; and for house number identification, to better align imagery with street addresses. In 2013 Google released a photo search feature in Google+ Photos which used convolutional neural networks to index photos by their contents.

Other
Spotify has tested a music recommendation service using convolutional neural networks to learn from snippets of songs and provide recommendations based on which songs the network judges to be similar to those the user likes.

Complete systems

 * Torch7, a Lua library used by Facebook AI, Deep Mind, and Google Brain
 * Caffe, a fast GPU-based implementation with Python bindings
 * Pylearn2, a comprehensive Python machine learning library

Component libraries

 * cuda-convnet and its successor, cuda-convnet2: Alex Krizhevsky's GPU-based CNN library
 * cudamat, a Python library for GPU-based matrix computations.
 * cuDNN, a library provided by NVidia for running CNNs on their GPUs
 * MatConvNet, a Matlab toolbox for building CNNs
 * DeepLearnToolbox, a Matlab toolbox with several flavors of deep networks