Package: plenoptic
plenopticplenopticis a python library for model-based stimulus synthesis. It
provides tools to help researchers understand their model by
synthesizing novel informative stimuli, which help build intuition for
what features the model ignores and what it is sensitive to. These
synthetic images can then be used in future perceptual or neural
experiments for further investigation.Getting startedIf you are unfamiliar with stimulus synthesis, see theconceptual
introductionfor an in-depth introduction.If you understand the basics of synthesis and want to get started
usingplenopticquickly, see theQuickstarttutorial.InstallationThe best way to installplenopticis viapip.$pipinstallplenopticSee theinstallation
pagefor more details,
including how to set up a virtual environment and jupyter.ffmpeg and videosSeveral methods in this package generate videos. There are several backends
possible for saving the animations to file, seematplotlib
documentationfor more details. In order convert them to HTML5 for viewing (and thus, to view
in a jupyter notebook), you'll needffmpeginstalled and on your path as well. Depending on your system, this might already
be installed, but if not, the easiest way is probably through [conda]
(https://anaconda.org/conda-forge/ffmpeg):conda install -c conda-forge ffmpeg.To change the backend, runmatplotlib.rcParams['animation.writer'] = writerbefore calling any of the animate functions. If you try to set thatrcParamwith a random string,matplotlibwill tell you the available choices.ContentsSynthesis methodsMetamers: given a model and a
reference image, stochastically generate a new image whose model
representation is identical to that of the reference image. This
method investigates what image features the model disregards
entirely.Eigendistortions: given a
model and a reference image, compute the image perturbation that
produces the smallest and largest changes in the model response
space. This method investigates the image features the model
considers the least and most important.Maximal differentiation (MAD)
competition: given two metrics
that measure distance between images and a reference image, generate
pairs of images that optimally differentiate the models.
Specifically, synthesize a pair of images that the first model says
are equi-distant from the reference while the second model says they
are maximally/minimally distant from the reference. Then synthesize
a second pair with the roles of the two models reversed. This method
allows for efficient comparison of two metrics, highlighting the
aspects in which their sensitivities differ.Geodesics: given a model and two
images, synthesize a sequence of images that lie on the shortest
("geodesic") path in the model's representation space. This
method investigates how a model represents motion and what changes
to an image it consider reasonable.Models, Metrics, and Model ComponentsPortilla-Simoncelli texture model, which measures the statistical properties
of visual textures, here defined as "repeating visual patterns."Steerable pyramid, a multi-scale oriented image decomposition. The basis are
oriented (steerable) filters, localized in space and frequency. Among other
uses, the steerable pyramid serves as a good representation from which to
build a primary visual cortex model. See thepyrtools
documentationfor
more details on image pyramids in general and the steerable pyramid in
particular.Structural Similarity Index (SSIM), is a perceptual similarity metric,
returning a number between -1 (totally different) and 1 (identical)
reflecting how similar two images are. This is based on the images'
luminance, contrast, and structure, which are computed convolutionally
across the images.Multiscale Structrual Similarity Index (MS-SSIM), is a perceptual similarity
metric similar to SSIM, except it operates at multiple scales (i.e.,
spatial frequencies).Normalized Laplacian distance, is a perceptual distance metric based on
transformations associated with the early visual system: local luminance
subtraction and local contrast gain control, at six scales.Getting helpWe communicate via several channels on Github:Discussionsis the place to ask usage questions, discuss issues too broad for a
single issue, or show off what you've made with plenoptic.If you've come across a bug, open anissue.If you have an idea for an extension or enhancement, please post in theideas
sectionof discussions first. We'll discuss it there and, if we decide to pursue it,
open an issue to track progress.See thecontributing guidefor how to get involved.In all cases, please follow ourcode of conduct.Citing usIf you useplenopticin a published academic article or presentation, please
cite us! See thecitation
guidefor more
details.SupportThis package is supported by the Simons Foundation Flatiron Institute's Center
for Computational Neuroscience.