- Airplanes
- Automobiles
- Birds
- Cats
- Deer
- Dogs
- Frogs
- Horses
- Ships
- Trucks
Convolutional networks are similar, but function for three-dimensional inputs. Images are two-dimensional along height and width. They form a third, depth-wise dimension with RGB color channels. This particular network can examine images, find recurrent patterns, then classify based on what it learned. For example, after looking at hundreds of horses, it will eventually discover the common features — ears, noses, hoofs, etc.
TLDR: Neural networks make informed classifications between input and ouput after training on example data. Basic neural networks are one-dimensional, convolutional neural networks are three-dimensional and more complex.
NumPy: a math library written in Python. You can install it via command-line if necessary:
$ pip install numpy
More information about setting up NumPy here.
Clone the repository and you're set.$ git clone https://github.com/ZachEddy/ImageClassifier
Note: this includes the CIFAR-10, a compressed set of 50,000 32x32 images. Cloning could take 3-5 minutes.
Run python __main__.py
at the top-level directory. I have the network defaulted to load a pre-trained network and classify ten images from a testing set. The default network trained overnight with 40,000 total images.
You can easily train, save, and load your own network. Inside net_initialize.py
, you can create networks with different layer patterns. Each layer has a few user-defined parameters. For example, you can change the number of filters in a convolution layer with the following:
{'type':'conv', 'field_size':5, 'filter_count':10, 'stride':1, 'padding':2, 'name':"conv_one"}
{'type':'conv', 'field_size':5, 'filter_count':15, 'stride':1, 'padding':2, 'name':"conv_one"}
Changing the layer pattern and/or their associated layer parameters will impact:
- network accuracy - how consistently the network classifies correctly.
- training time - how long it takes the network to learn.
Lastly, this line of code inside net_initialize
creates a new network based on the layer structure provided by the user:
return net_network(layer_structure,"network_name")
After training completes, the weights, biases, and layer structure get saved as network_name
in the saved_networks
directory.
Alternatively, you can load a network to classify something after the training process finishes.
return net_network(None,"pretrained_network_name")
None
informs the network that no layer structure has been provided by the user. It will search for pretrained_network
inside the saved_networks
directory instead.
Take a look at the net_initialize.py
code; I think this will make it much more conceptually concrete. Also, having a basic understanding of Convolutional Neural Networks will really help. I recommend this detailed explanation from a Stanford course on ConvNets.
- Learning Multiple Layers of Features from Tiny Images, Alex Krizhevsky, 2009.