CS 5043: HW8: Explainable Deep Learning
Assignment notes:
- Deadline:
- Expected completion: Friday, May 7th @11:59pm.
- Hand-in procedure: submit a pdf to Gradescope
- This work is to be done on your own. While general discussion
about Python, Keras and Tensorflow is encouraged, sharing
solution-specific code is inappropriate. Likewise, downloading
solution-specific code is not allowed.
- Do not submit MSWord documents.
Objective
Deep learning tools provide a great opportunity to create
sophisticated models for making predictions across a wide range of
domains. Their power comes, in part, from their large number of
degrees-of-freedom (parameters). But, this property can also mean
that the resulting models make incorrect decisions, or make correct
decisions, but for the wrong reasons. As practitioners, it is
important for us to always look carefully at how our models perform,
not only in the aggregate, but also on a case-by-case basis.
Our objective for this homework is to use explainable deep
learning techniques to analyze a couple of image classification
models that we train using the Chesapeake Watershed data set. Our goal
is to better understand how these models make their decisions and to
evaluate the appropriateness of the learned models.
Data Set
We will use F0 of the Chesapeake Watershed data set. The loader code
from HW 7 has been augmented with an additional function:
[new_outs, labels] = pixel_class_to_image_class(outs)
where:
Models
Create and train two CNN-based classification models:
- Single output: has road or not
- Five outputs (yes, all of them)
Notes:
- Use a sigmoid as the output of the last layer (don't use
softmax, as that implies exclusivity across the outputs)
- Use binary_crossentropy for loss
- Use binary_accuracy for your primary metric
- You will need more training examples than for HW 7 (at least
1000)
- Expect training to be a lot faster than with HW 7
- It is important that your validation performance be higher than
the background accuracy (accuracy of making the best possible
constant output)
Visualization
We will be using the
tf-keras-vis
package to visualize the behavior of your network under various
conditions. The package has useful documentation, including example
code.
Pick a set of 5-6 representative images from the validation data set
that we will use to analyze the models. These images should have
examples of each of the five classes.
For each of the models, do the following:
- Use one of the saliency techniques to examine the pixel-level
saliency for each of the classes and example images. If there
are 6 images, then you will have a grid of 5 x 6 saliency
images. Include in the title of each image the predicted
probability for that class in that image and the true label for
that class in that image
- Do the same with one of the GradCAM methods
- Use either a dense layer or convolutional layer tool to
visualize what a set of 5 neurons / filters encode for the same
set of images.
- Note: always use 'clone=True' so you can re-use your learned
models
What to Hand In
Hand in a PDF file that contains:
- Code for generating and training the network. Some useful UNIX
command line programs:
- enscript: translate code (e.g., py files) into postscript files
- ps2pdf: translate postscript files into pdf files
- pdfunite: merge several pdf files together
- The above figures
- A reflection on what you learned about the different methods
and what they told you about your models.
Grades
- 30 pts: Model generation / visualization code. Is it correct?
clean? documented?
- 40 pts: Visualization results
- 30 pts: Reflection
andrewhfagg -- gmail.com
Last modified: Mon May 3 18:10:57 2021