CSci 4511 - Homework 6
Homework 6 -- due Thursday May 3
This homework will be graded out of 100 points. It is completely extra credit
and can add as much as 2.5% of the grade.
Coding portion
- [20 points] Put together an image set.
Get at least 3 different kinds of images to classify. You cannot use
mine for your first three datasets; if you're interested in classifying 4 or more
categories, go ahead and use one mine as your fourth / fifth / Nth database.
Try to get several hundred
of each datatype; 300 could work, but 1000 is better.
Report on the contents and size of your dataset; for each image type, report
- what the image type is (e.g. dinosaurs)
- how many images you attempted
to download (e.g. the number of lines in the URL text file),
- how many 'clean' images you ultimately saved as
potentially useful for training,
- how many 'noisy' images you deemed too
messy or off-topic for training.
See directions here.
Note that the items you choose will impact your network's ability
to differentiate; I would expect it to take more images to
correctly classify puppies versus full grown dogs versus wolves,
and fewer images to correctly classify dogs versus
trucks versus couches.
Use appropriate images. You'll be submitting some
of them in your homework.
Within that guideline, pick whatever you want.
- [60 points] Train your network and report on it!
I recommend at least 20-30 epochs. I also
recommend using roughly equal sizes of each category (e.g. training sample
sizes of 490, 500, and 510 will perform better than
sample sizes of 490, 1000, and 5000).
-
A network you can download as-is that should work:
network itself,
a script to build and train it,
and a script to use the weights you just found
to predict things.
For your very first time running through the network, you can use the dataset
I used at Dropbox.
- Generate and train different networks by changing at least 5 parameters, at least one thing each time;
the point of this exercise is to see how changes to the network change the performance.
Explain your parameter changes
(from what, to what) before you report on the following items.
- Record the loss and accuracy graphs for each change (this graph is generated
for you by the script). Your report should contain at least 5 graphs.
- Along with the graphs, answer if each change required more, fewer, or about
the same number of epochs to reach the same accuracy as other network variations?
You could also report these numbers in a table, but I still want to see graphs
of accuracy and loss, and your understanding of if your change made your network better, worse, or had no impact.
- Changes you might want to experiment with:
- Varying the sizes of the train and test sets (e.g. from 80% training,
20% testing, to 50% training, 50% testing, or some such new split).
- Image size (default is 96x96). Smaller images will train faster;
larger images are more informative. You may run out of memory if you use large
images. Remember to change the image size requested in the train AND predict files. I would stick
with even numbers; some nice multiple of 16 or 32 is usually good.
- Number of epochs. Is 1000 much better than 50?
- Number of images in each category. Are they roughly equal?
Does one image type have far fewer or far more images?
- The data augmentation you use. The default adds rotation, shifts up and down, zoom, shearing,
and horizontal flips. You can remove some of these, or alter them (e.g. from rotation_range 25, to 45).
- Number of classes. Is training on 5 image types much different than training on 3 image types?
- The filter size in each convolutional layer. The default is 3. How does 4x4 perform? 2x2?
(Look for the line ""Conv2D(64, (3, 3), padding="same", input_shape=inputShape>"" in smallervggnet.py)
- Use an activation function other than ReLU, like "tanh" or "signmoid". See possible
functions here - https://keras.io/activations/
- The network layers themselves! Snip some layers, or add new ones. What if
you take out an entire Convolution / Relu / Pooling sequence?
- [20] Run the "noisy" images you saved when putting together your image set,
and report on some of them. Show at least three images; aim for a mix of easy, hard, and nonsense images:
- easy - does your network work on a good clean image it's never seen?
- hard - is there a noisy image or an image your network got wrong, but was easily identified by you?
- nonsense - an image without any of the objects you trained on. Is the network still confident about the image label?
Show the image, and
- list the machine's classification of it (for any of
the network variations above, but I would probably
pick the answer from the best-performing network)
- what you consider the correct classification
- if the image was classified properly, why do you
think the image was classified properly?
- if it was not classified properly, why do
you think it was not?
Copyright: © 2018 by the Regents of the University
of Minnesota
Department of Computer Science and
Engineering. All rights reserved.
Comments to: Marie Manner
Changes and corrections are in red.