Please see LICENSE.

Accompanying software for Whitehill and Movellan, "Discriminately
Decreasing Discriminability with Learned Image Filters", CVPR 2012.

Copyright (C) 2012 Jacob Whitehill.
Machine Perception Laboratory
University of California San Diego
jake@mplab.ucsd.edu

This software requires Rasmussen's "minimize" routine:

  http://www.gaussianprocess.org/gpml/code/matlab/util/minimize.m

Demo 1 -- Convolution -- Horizonal and Vertical Lines
-----------------------------------------------------
First, make sure to run the "startup" script. Then,
to see a demo of DDD as applied to the vertical-and-horizontal lines
task, run "demo". This demo learns a 5x5 convolution kernel.
The program opens and updates two figures: in each figure, the top
row displays 20 *filtered* patches (16x16) concatenated column-wise,
and the middle row displays 20 *unfiltered* patches concatenated
column-wise. The third row of both figures displays the learned filter.
Figure 1 corresponds to Task A (distractor) and Figure 2 corresponds to
Task B (target). The left-most 10 patches in the figures correspond to
positive examples and the right-most 20 patches in the figures
correspond to negative examples. Note that "negative" and "positive"
depends on the particular task (A or B).

As the demo program executes, the learned filter should cause the filtered
patches (top row of both figures) to eradicate from human perception the
image components that reveal information about Task A.

Demo 2 -- Location -- Smile and Gender
--------------------------------------
Cropped face patches are stored in SmileGenderData as X1a, X0a, X1b, and X0b
matrices. To show a patch, you can run "imshow(reshape(X1a(:,i), [16 16 ]), []);"
in Matlab, where i is the index of the patch (1 <= i <= 870).

First, make sure to run the "startup" script. Then,
to see a demo of DDD as applied to the smile- and gender-labeled face images,
run "demo". In this script, you can either suppress gender and
preserve expression, or vice versa -- simply uncomment the appropriate line.

This demo learns a 16x16 location (pixel-wise mask) filter.
The program opens and updates two figures: in each figure, the top
row displays 20 *filtered* patches (16x16) concatenated column-wise;
the second row displays 20 *unfiltered* patches concatenated
column-wise; the third row of both figures displays the learned filter;
and the fourth row displays the "reconstructed" images (see Section
3.4 of the paper). Figure 1 corresponds to Task A (distractor) and
Figure 2 corresponds to Task B (target). The left-most 10 patches in the
figures correspond to positive examples and the right-most 20 patches in
the figures correspond to negative examples. Note that "negative" and
"positive" depends on the particular task (A or B).

As the demo program executes, the learned filter should cause the filtered
patches (top row of both figures) to eradicate the image components that
reveal information about Task A, but preserve information about Task B.

On our machine (2 quad-core 2.26GHz Mac Pro), the algorithm takes a few
hours to complete.
