CNV: Perceptual Learning project option for assignment 2

This page describes one of the possible project options for assignment 2; please read the general project description first before looking at this specific project option.

Perceptual Learning (PL; see Fahle 2004) is any change in perception that occurs as a result of sensory experience and can drive rapid improvements in a subject's performance in perceptual tasks. Hyperacuity and improvements in orientation discrimination are the most commonly studied phenomena in the perceptual learning literature. Options to simulate these phenomena with LISSOM/GCAL are described in CMVC section 17.2.7. There has been much controversy about whether changes at the V1 map level can be responsible for all or even any of the improvements in performance after training, as opposed to changes at a later stage of visual processing, so it is in no way guaranteed that you will find results compatible with experimental data in this assignment. Before starting on this project, it's useful to read the 2004 review paper, and some of the work that led up to it or that has been done since (which is listed at the bottom of this page). Once you have a good idea about the basic phenomenon and the theories about its neural substrate, you can think about what aspect you'd like to investigate and/or replicate.

Once you're ready, you can follow these steps to get started. For this assignment you should again use the copy of Topographica installed in /group/teaching/cnv/topographica. This version is currently identical to the 0.9.8 released version.

  1. First, save a copy of the asst2.ty example file into one of your own directories, e.g. ~/topographica/asst2.ty, and launch it:

      cd ~/topographica
      /group/teaching/cnv/topographica/topographica -g asst2.ty
    

    The asst2.ty file is a slightly modified copy of examples/gcal.ty, changed as described in the comments at the top of the file. See the EDI-INF-RR-1404 report for a detailed description of GCAL. Compared to that description, the main changes are to speed it up to make it more practical and to use a larger area, longer input patterns, and longer lateral inhibitory connections, so that long-range interactions between simultaneous patterns can be investigated. For simplicity, natural image training pattern support has been removed from the file, but it can be restored if desired by copying the relevant code from gcal.ty. The precise changes are listed at the top of the asst2.ty file, and can be seen by comparing asst2.ty and gcal.ty using diff.

  2. You should run the network for a few iterations in the GUI and look at the various plots to see what it does, how it compares to GCAL from the first assignment, and generally make sure that it seems to be working ok.

  3. You can just keep running it for a few more thousand iterations in the GUI until it self-organizes, if you like, but it's usually easier to run asst2.ty in batch mode instead. Sample batch mode command for running to simulation time 10,000 (which is usually sufficient to see how it will organize) and analysing the map at times 100, 1000 and 10,000:

      /group/teaching/cnv/topographica/topographica -a -c "run_batch('asst2.ty',times=[100,1000,10000])" -c "save_snapshot()"
    

    This command takes 12 minutes on my Core i3 machine, but could be more if your machine is slower or heavily loaded.

    The output from the simulation will be in ~/topographica/Output/201303011200_asst2, where 201303011200 is the year, month, day, hour, and minute when the command was started (to provide a unique tag to keep track of results). When it's done, be sure to examine the .out file in that directory, so that you can detect any warnings that might be important (such as parameters that you thought you changed but the code warns you were not actually changed due to typos). You can use your favourite image viewer to see the .png images, such as orientation maps and weight plots.

    For instance, if you're using gthumb, you can do gthumb *.png. For gthumb, it works better if you go to the Preferences and set the Viewer options to have a Zoom quality of Low (to avoid smoothing) and After loading an image to Fit image to window (so that it's large enough to see).

    The main results can be compared with those in the GCAL paper; they should be broadly similar but with a larger area, lower density, and probably not as smooth because we increased the learning rates to get results quicker.

  4. If the images make it look like this might be a useful network, then you can then load the saved snapshot to explore what it does:

      /group/teaching/cnv/topographica/topographica -g -c "load_snapshot('$HOME/topographica/Output/201303011200_asst2/201303011200_asst2_010000.00.typ')"
    
    (using the appropriate path to your copy of the simulation output).
  5. A good first step is to test how well you can decode the position of an input from the V1 response. E.g. this code should print positions (along the X-axis) and their decoded value:

    from numpy import linspace
    from topo import pattern
    from topo.command import pattern_present
    from topo.command.analysis import decode_feature
    from topo.command.pylabplot import measure_position_pref
    from topo.misc.distribution import DSF_WeightedAverage
    
    unit_size = 1.0/topo.sim.Retina.xdensity
    
    measure_position_pref(display=True,divisions=48,preference_fn=DSF_WeightedAverage(selectivity_scale=(0.0,2.0)),
                          scale=1.0,size=unit_size*2,x_range=(-1.0,1.0),y_range=(-1.0,1.0))
    
    for t in linspace(-0.5,0.5,11,endpoint=False):
       pattern_present(inputs=pattern.Gaussian(x=t,y=0,orientation=pi/2.0,size=0.088388,aspect_ratio=15),duration=1.0,
                       plastic=False,overwrite_previous=False,apply_output_fns=True)
       d=decode_feature(topo.sim.V1,preference_map="XPreference",cyclic=False,axis_bounds=(-1.0,1.0))
       print "X-coordinate of presentation:", t, "Decoded X-coordinate:", d
    

    This code starts out by measuring the position preference of all the neurons in the visual field at a fairly fine scale (you may want to investigate what effect the coarsness of the measurement has on your results). Only on the basis of this measurement can we decode the position of the stimulus, and remember that it is an estimate, so don't simply trust it to be accurate! If the input and decoded values are reasonably close to each other (try graphing them!), this network is successfully representing the position of an input line.

  6. If you find that position decoding works well, you can move on to use the Vernier stimulus that has been defined in the .ty file. It generates two line stimuli with a defined offset, allowing you to test the network's ability to extract position differences, as in experimental tests of Vernier acuity.

    r,c = topo.sim.V1.activity.shape
    tophalf  = lambda(x): x[0:c/2,:]
    bottomhalf = lambda(x): x[c/2:,:]
    
    for t in linspace(-5.0,5.0,11):
       pattern_present(inputs=Vernier(vernier_offset=t),duration=1.0,plastic=False,overwrite_previous=False,apply_output_fns=True)
       top_xcoord = decode_feature(topo.sim["V1"], cropfn=tophalf, preference_map = "XPreference",cyclic=False,axis_bounds=(-1.0,1.0))
       bottom_xcoord = decode_feature(topo.sim["V1"], cropfn=bottomhalf, preference_map = "XPreference",cyclic=False,axis_bounds=(-1.0,1.0))
       decoded_offset = bottom_xcoord-top_xcoord
       print "Presented vernier offset:", t*unit_size, "Decoded vernier offset:", decoded_offset
    

    This code sets up two temporary functions that crop the top and bottom half of V1, respectively, allowing you to call decode_feature for each half separately. Before the decoding occurs, it presents the Vernier pattern on the retina to compute a baseline. The default parameters used for the Vernier pattern are based on findings that peak visual acuity in humans is around 30 sec arc (Zhang et al. 2005), along with an assumption that a reasonable proxy for visual acuity in the model is the photoreceptor spacing, and thus that each photoreceptor unit covers 15 sec arc of visual space. (You may wish to perform a more accurate calibration of visual acuity following the methods in an experimental paper, but this rough guide at least gives a starting point.) To make it simpler to relate sizes to acuity, the dimensions and positional offsets of the line segments in the Vernier stimulus are defined in terms of photoreceptor units, rather than the Sheet coordinates used elsewhere in Topographica. Finally, the code decodes the x-coordinate of the stimulus and prints the actual and the estimated positional offsets.

  7. If the results are in general agreement with the human data, you can then try to replicate the procedure used with humans more closely, making the model be a more realistic or more appropriate model of some particular PL study. You can also start to collect some other data associated with PL (testing other experimental conditions, effects on other perceptual learning tasks, etc.), test using a model trained on natural images, investigate the effect of noise on the neural behaviour and/or the measurement, try different decoding techniques, try different patterns other than Vernier (e.g. orientation discrimination), etc. -- whatever you think is scientifically interesting, has some associated experimental results, and is feasible.

  8. Whether the results were as expected or not, you should think about your network, observe the patterns of activity and connectivity, and decide if you believe it is an appropriate model for this phenomenon. Basically, you're trying to (a) build a good model that includes the mechanisms that at least might result in PL, (b) determine whether it does so, and (c) analyse what those results depend on -- why they occur. You may even want to test how PL transfers between different tasks and in what other ways the network is altered after PL.

  9. Whatever you end up investigating, in your report, you'll need to make it clear what question(s) you were addressing, demonstrate that the model was a reasonable approach to investigating those questions, explain how the model's mechanisms relate to processes in human or animal V1, show how well the results match the human perceptual learning data (or whatever data you're comparing against), and explain why the results you observe (whether they match previous data or not) occur. Once you're ready, you can report and submit your results as described in the general project description.

Further reading:

  1. Fahle, M. (2004). Perceptual learning: A case for early selection. Journal of Vision, 4, 879-890.

  2. Sotiropoulos, G., Seitz, A. R., & Seriés, P. (2011). Perceptual learning in visual hyperacuity: A reweighting model. Vision research, 51(6), 585-599.

  3. Fahle, M., Edelman, S., & Poggio, T. (1995). Fast perceptual learning in hyperacuity. Vision research, 35(21), 3003-3013.

  4. Zhang, Y., & Reid, R. C. (2005). Single-neuron responses and neuronal decisions in a vernier task. Proceedings of the National Academy of Sciences of the United States of America, 102(9), 3507-3512.

Last update: assignment2pl.html,v 1.7 2013/08/27 13:01:09 jbednar Exp


Home : Teaching : Courses : Cnv : 2012-2013 : Coursework 

Informatics Forum, 10 Crichton Street, Edinburgh, EH8 9AB, Scotland, UK
Tel: +44 131 651 5661, Fax: +44 131 651 1426, E-mail: school-office@inf.ed.ac.uk
Please contact our webadmin with any comments or corrections. Logging and Cookies
Unless explicitly stated otherwise, all material is copyright © The University of Edinburgh