Skip to main content

Dynamical Vision Modeling

Project description

DynVision: A Modeling Toolbox for Biologically Plausible Recurrent Visual Networks

Python 3.11+ PyTorch PyPI CI License: MIT Preprint

Docs

DynVision is a modular toolbox for constructing and evaluating recurrent convolutional neural networks (RCNNs) with biologically inspired dynamics. It provides a flexible framework for exploring how recurrent connections and temporal dynamics shape visual processing in artificial neural networks and how these networks can be aligned with properties of biological visual systems.

DynVision Overview

Key Features

  • Biologically Plausible Dynamics: Implement neural dynamics governed by continuous differential equations with realistic time constants and delays
  • Diverse Recurrent Architectures: Explore various recurrent connection types (self, full, depthwise, pointwise, local topographic)
  • Minimal Coding Requirements: Customization of models, training hyperparameters, testing scenarios, data selection, parameter sweeps, visualizations can be achieved by editing by human-readable config files. For more elaborate extensions there are template files and guides.
  • Modular Components: Easily combine and reconfigure biologically-inspired features:
    • Recurrent processing within and across areas
    • Skip and feedback connections
    • Retinal preprocessing
    • Supralinear activation
    • Adaptive input gain
  • Modular Operation Order: Easily rearrange the execution order of layer operations like convolution, adding recurrence, applying delays, nonlinearity, pooling, recording activity, etc.
  • Efficient Workflow Management: Leverages Snakemake for reproducible experiments and parameter sweeps
  • PyTorch Lightning Integration: Standardized training with minimal boilerplate
  • Optimized Performance: Fast data loading with FFCV, GPU acceleration, mixed precision
  • Pre-built Model Zoo: Access pre-implemented architectures like AlexNet, CorNetRT, ResNet variants, CordsNet, and DyRCNNx4/8

Installation

Python requirement: Python 3.11+ (3.12 support pending FFCV compatibility testing — see Python 3.12 Compatibility).

# Clone repository
git clone https://github.com/Lindsay-Lab/dynvision.git
cd dynvision

# Create conda environment (recommended)
conda create -n dynvision python=3.11
conda activate dynvision

# Install PyTorch with CUDA (adjust as needed)
conda install pytorch torchvision pytorch-cuda=11.8 -c pytorch -c nvidia

# Install DynVision in editable mode
pip install -e .

For more detailed installation instructions, see the Installation Guide.

Quick Start

import torch
from dynvision.models import DyRCNNx4

# Create a 4-layer RCNN with recurrent connections
model = DyRCNNx4(
    n_classes=10,
    input_dims=(20, 3, 224, 224),  # (timesteps, channels, height, width)
    recurrence_type="full",        # Full recurrent connectivity
    dt=2,                          # Integration time step (ms)
    tau=5,                         # Neural time constant (ms)
    tff=8,                         # feedforward delay (ms)
    trc=4,                         # recurrence delay (ms)
)

# Forward pass with a batch of inputs
batch = torch.randn(1, 20, 3, 224, 224)  # (batch, timesteps, channels, height, width)
outputs = model(batch)

For a step-by-step tutorial, see the Getting Started guide.

Example Experiments

DynVision includes pre-configured experiments to explore temporal response properties of different recurrent architectures:

# Train and run contrast response experiment with on multiple models
snakemake --config experiment=contrast model_name=['AlexNet', 'ResNet18', 'CorNetRT'] data_name=cifar100

# Evaluate stimulus duration effects with different recurrence types
snakemake -j4 --config experiment=duration model_name=DyRCNNx4 model_args="{rctype: [full, self, pointdepthwise]}"

Temporal Dynamics Example

Documentation

For Claude Code Users: The comprehensive developer guide (formerly CLAUDE.md in project root) is now at docs/development/guides/claude-guide.md.

Citation

If you use DynVision in your research, please cite both the software and the preprint:

@software{Gutzen_DynVision,
  author       = {Gutzen, Robin and Lindsay, Grace W.},
  title        = {DynVision: A Modeling Toolbox for Biologically Plausible
                   Recurrent Visual Networks},
  year         = 2026,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.XXXXXXXX},
  url          = {https://github.com/Lindsay-Lab/DynVision},
  note         = {Replace XXXXXXXX with DOI from https://zenodo.org after first release}
}

@article{Gutzen2025_2025.08.11.669756,
  title        = {DynVision: A Toolbox for Biologically Plausible Recurrent
                   Convolutional Networks},
  shorttitle   = {{{DynVision}}},
  author       = {Gutzen, Robin and Lindsay, Grace W.},
  year         = 2025,
  pages        = {2025.08.11.669756},
  publisher    = {bioRxiv},
  doi          = {10.1101/2025.08.11.669756},
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynvision-0.1.0.tar.gz (7.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dynvision-0.1.0-py2.py3-none-any.whl (414.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dynvision-0.1.0.tar.gz.

File metadata

  • Download URL: dynvision-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dynvision-0.1.0.tar.gz
Algorithm Hash digest
SHA256 65d911c9c8fa3619115c17a188c63c03a020a60f845de59f7854e007f36b0775
MD5 9ff288b5ae39fb2c785f1338c630be35
BLAKE2b-256 d5c50d287183a38b4c771d7d70658cb9852eda6f3123507fa1d0026c23021453

See more details on using hashes here.

Provenance

The following attestation bundles were made for dynvision-0.1.0.tar.gz:

Publisher: publish.yml on Lindsay-Lab/DynVision

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dynvision-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: dynvision-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 414.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dynvision-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cddd4be5e87abfe2c78c9f0e02420b1da9ffe576a05d75c38e8d11473178149f
MD5 384e66ecab5c80563c3339542aefd2a2
BLAKE2b-256 21da8edf38fa21608f6a81a8412c6671c78ab60e8a75849d3ea91add32b835dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for dynvision-0.1.0-py2.py3-none-any.whl:

Publisher: publish.yml on Lindsay-Lab/DynVision

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page