# Macular: a multi-scale simulation platform for the retina and the primary visual system

Bruno Cessac, Erwan Demairy, Jérôme Emonet, Evgenia Kartsaki, Thibaud

Kloczko, Côme Le Breton, Nicolas Niclausse, Selma Souihel, Jean-Luc

Szpyrka, Julien Wintz

► To cite this version:

Bruno Cessac, Erwan Demairy, Jérôme Emonet, Evgenia Kartsaki, Thibaud Kloczko, et al. *Macular: a multi-scale simulation platform for the retina and the primary visual system*. Frontiers in Computational Neuroscience, In press. *hal-05312447v2*

HAL Id: hal-05312447

https://inria.hal.science/hal-05312447v2

Submitted on 19 Oct 2025

**HAL** is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Macular: a multi-scale simulation platform for the retina
and the primary visual system

Bruno Cessac¹, Erwan Demairy², Jérôme Emonet¹, Evgenia Kartsaki¹,², Thibaud Kloczko², Côme Le Breton², Nicolas Niclausse², Selma Souihel¹,⁴, Jean-Luc Szpyrka², and Julien Wintz²

¹Université Côte d'Azur, Inria, Biovision team and Neuromod Institute, Sophia Antipolis, France

²Service d'expérimentation et développement - SED-Inria, Sophia Antipolis, France

³P16 - Programme IA, Inria Rocquencourt, Domaine de Voluceau, 78150 Le Chesnay-Rocquencourt, France,

December 9, 2025

Abstract

We developed Macular, a simulation platform with a graphical interface, designed to produce *in silico* experiment scenarios for the retina and the primary visual system. A scenario consists of generating a three-dimensional structure with interconnected layers, each layer corresponding to a type of “cell” in the retina or visual cortex. The cells can correspond to neurons or more complex structures (such as cortical columns). The inputs are arbitrary videos. The user can use the cells and synapses provided with the software, or create their own using a graphical interface where they enter the constituent equations in text format (e.g., LaTeX). They also create the three-dimensional structure via the graphical interface. Macular then *automatically* generates and compiles the C++ code and generates the simulation interface. This allows the user to view the input video and the three-dimensional structure in layers. It also allows the user to select cells and synapses in each layer and view the activity of their state variables. Finally, the user can adjust the phenomenological parameters of the cells or synapses via the interface. We provide several example scenarios, corresponding to published articles, including an example of a retino-cortical model. Macular was designed for neurobiologists and modelers, specialists in the primary visual system, who want to test hypotheses *in silico* without the need for programming. By design, this tool allows natural or altered conditions (pharmacology, pathology, development) to be simulated.
# 1 Introduction

Our visual system has an extraordinary capacity. It is capable of converting the flow of photons emanating from our environment into a flow of electrical impulses that can be interpreted by our brain and our consciousness. This allows us to react quickly and effectively to the movements and changes that are constantly occurring around us. The process starts in the retina. This organ owes its efficiency, on the one hand, to its layered structure, composed of different types of neural layers—from photoreceptors to ganglion cells—connected by specific synapses to form neural circuits that respond to local visual characteristics. On the other hand, the retina is a fundamentally dynamic object. Just as much as its structure, the variety of time scales involved in neural and synaptic processes are essential for enabling the retina to encode visual information efficiently, taking into account the fact that our environment is constantly in motion.

Our knowledge of the retina is essentially based on experimentation. For over a century, this has enabled us to characterise its structure and the way in which a multitude of specific circuits work together to generate a reliable representation of visual scenes. However, given such a high level of complexity, involving a wide range of time scales, experimentation alone cannot provide a holistic description. Furthermore, experiments are costly in terms of resources, time and energy. In this context, numerical simulation combined with modelling are valuable assets. Even though no simulation is currently capable of reproducing the behaviour of a complete retina, they can reproduce the behaviour of a particular circuit or combination of circuits, explore hypotheses and vary physiological parameters that are difficult to access experimentally. It is therefore natural that numerous retinal simulation platforms have been developed (see section 7 for a non exhaustive list).

While the simulation platform we are presenting here, Macular, fits into this perspective, it nevertheless differs significantly from existing platforms. Furthermore, although it includes the VirtualRetina simulator developed by members or former members of our group [32], it differs from it in several ways. Macular was actually designed with several requirements in mind. First, it is intended for experimenters or modellers, with no programming knowledge, who would like to be able to simulate situations that interest them. Macular offers an interface that allows them to enter equations (e.g. in LaTeX) characterising the dynamics of specific neurons or synapses, and then organise these neurons/synapses into a multi-layered hierarchical structure mimicking the organisation of the retina. Without using a programming language, they can then generate a simulation of this structure. Furthermore, the parameters of these equations, corresponding for example to physiological parameters, can be modulated via an interface. This makes it possible to vary "manually" e.g. the conductance of an ion channel or the intensity of a synaptic connection. Thanks to this flexibility, Macular is not limited to modelling the retina alone, but also allows thalamic or cortical extensions to be added. An example of a cortical extension is provided in
section 6.2. Finally, with Macular, we wanted to be able to study the response to realistic visual stimuli, such as those used in experiments. Thus, Macular accepts films as "visual" input (this feature is inherited from Virtual Retina). However, the retina does not always receive visual input. During development, before birth when the photoreceptors are inactive, there is nevertheless electrical activity (retinal waves) that we wanted to be able to simulate. Another situation concerns retinal prostheses, where the "input" is an electrical stimulation that is also possible with our simulator.

Macular runs on the three main operating systems: Linux, Mac and Windows. The aim of this article is to provide a brief overview of this platform, bearing in mind that more comprehensive online documentation is available in the online documentation page . The article is structured as follows. In section 2 we provide a general presentation of Macular, its spirit and structure. In section 3 we present the GUI and its main features. In section 4 we expose how to create cells or synapses of new type using the Macular Template Engine. Macular also has a batch version presented in section 5. Section 6 provides then a few examples of use case including the simulation of retinal waves based on a model published in [8, 22] and retino cortical model published in [14, 16]. Section 7 shortly presents existing simulators in the spirit of Macular and compares them to our platform.

2 General Presentation

2.1 Installation

Macular is a free software (GPL), written in C++, with the licence number
IDDN.FR.001.020016.001.S.P.2022.000.31235. It can be freely downloaded at this url by following
the instructions given at this page. A git repository is avalaible here.

## 2.2 Overview

The entire structure and conception of Macular relies on the following observation. The bio-
physics of the retina and of the visual system can be modelled, with a very good accuracy, by
(partial or ordinary) differential equations. These equations are, in general, complex, non linear,
with many degrees of freedom, multiple space and time scales, and have non stationary (visual)
inputs. Still, it is possible to simulate them using adapted numerical schemes and structures.

Macular is organised into a layered structure that mimics the multi-layer organisation of the visual system (Fig. 1). It is fed by visual inputs (movies) then processed by this multi-layer structure. At the heart of Macular are objects called "Cells", inspired by biological neurons, but more general. A "Cell" can also be a group of neurons of the same type, a neural field generated by a large number of neurons (for example a cortical column), or even an electrode in a retinal prosthesis.
To differentiate biological cells from Macular Cells we will use a capital in this latter case. More generally, Macular objects like Synapses, Currents will be designed with a capital. A Cell is defined by internal variables (evolving over time), internal parameters (adjusted by cursors), a dynamic evolution (described by a set of differential equations) and inputs. Inputs can come from an external visual scene or from other synaptically connected cells. Synapses are also Macular objects defined by specific variables, parameters, and equations. Cells of the same type are connected in layers according to a graph with a specific type of Synapses (intra-Layer connectivity). Cells of a different type can also be connected via Synapses (inter-Layer connectivity).

All the information concerning the types of Cells, their Inputs, their Synapses and the organiza-
tion of the Layers are stored in a file of type .mac (for "macular") defining what we call a "scenario".
Different types of scenarios are offered to the user, which they can load and play, while modifying
the parameters and viewing the variables. More generally, Macular is built around a central idea:
its use and its graphical interface can evolve according to the user's objectives, so, the user can
design their own scenarios, i.e. define their own Cells, Synapses, Layers, using a specific template,
the Macular Template Engine. This template, and more generally, Macular, has been designed so
that the user does not need to use computer programming to run their simulations.

Although Macular targets simulations of the retina, it is not limited to it. It is designed to propose and test models of the visual system, where, for example, Cells represent cortical columns in a mean-field model. However, Macular is, by no way, intended to simulate the retina or the early visual system as a whole. Instead, it is designed to check hypotheses on specific aspects of the visual system, try and reproduce specific experiments in silico. It is a tool for modellers and experimentalists. Especially, one can play the same stimuli as experimentalists and then record the response of Cells and Synapses of the model Layers. This is why the notion of scenario built by the user is central. From this perspective, note that generating a model or a scenario requires to have a clear idea of the equations to use, their parameters, and last but not the least, a coherent set of physical units. Thus, proposing a realistic scenario requires an important phase of design.

2.3 Units

Macular uses a set of physical units listed in table 1. There is a default system of units, shown in the second column of the Table. Macular converts the units of the user's model to the default units for computations and then reconvert it in the user's units for plots. Note that space scales have 3 possible "modalities": distance, angle or pixels (see the online documentation page for more detail). We note however that Macular does not check that the user's units are coherent, in contrast e.g. to BRIAN [18].
<figure><img src="image_2.png" /><figcaption>Figure 1: **The multi-layer structure of Macular.** Here, we show a scenario involving three retinal layers and two cortical layers further described in section 6.2. This scenario has been used in the papers [14, 16].</figcaption></figure>

<table><caption>Table 1: Physical units used in Macular. The first column displays the name of the main physical quantities used in models, with the letter that usually identifies them (in parentheses). In the second column, we show the default unit of these quantities in Macular. The third column presents the other units available in Macular. In the Macular interface (GUI) "micro" is denoted u instead of μ.</caption><thead><tr><td>Physical quantity</td><td>Default Macular Units</td><td>Other Possible Units</td></tr></thead><tbody><tr><td>Time (τ)</td><td>second (s)</td><td>milli-second (ms)</td></tr><tr><td>Voltage (V, E)</td><td>milli-volts (mV)</td><td>volts (V)</td></tr><tr><td>Electric current (I)</td><td>pico-ampère (pA)</td><td>nano-ampère (nA), micro ampère per cm² (μ/cm²)</td></tr><tr><td>Electric conductance (g)</td><td>nano-siemens (nS)</td><td>pico-siemens (pS), milli-siemens per cm² (mS/cm²)</td></tr><tr><td>Distance (σ)</td><td>millimeters (mm), degrees (°), pixels (px)</td><td>micro-meters (μm)</td></tr><tr><td>Capacitance (C)</td><td>nano-farad (nF)</td><td>pico-farad (pF), micro-farad per cm² (μF/cm²)</td></tr><tr><td>Frequency (ν, f)</td><td>hertz (Hz)</td><td>kilo hertz (kHz)</td></tr><tr><td>Molarity (M)</td><td>nano-mol per liter (nM)</td><td>milli-mol per liter (mM), micro-mol per liter (μM)</td></tr></tbody></table>

## 2.4 Core Architecture

We assume here that the reader knows the retina structure (for a very didactic introduction see e.g. the web vision page by Helga Kolb). In the next lines, for simplicity with respect to the biological reality, we call *OPL* (Outer Plexiform Layer) the retina region that contains photo-
receptors (rods and cones) and Horizontal cells (HCs), and *IPL* (Inner Plexiform Layer) the region which contains Bipolar cells (BCs), Amacrine cells (ACs) and Retinal Ganglion cells (RGCs). More generally, we extend the notion of Layers to models containing cortical populations, each population corresponding to a Layer.

### 2.4.1 Visual flow

In Macular, the OPL is essentially represented by BCs receptive field (RF). Biologically, the RF of a BC is a region of the visual field (the physical space) in which stimulation alters its voltage (evokes a response of the Cell). This definition actually generalises to other retinal cells type like ACs or RGCs but we stick to BCs here. In Macular we model the receptive field of a BC *i* of type *T*, $T_i$, as a spatio-temporal kernel $K_{T_i}(x, y, t)$, i.e. a function of space and time with a specific structure. This receptive field features the lateral inhibition coming from horizontal cells in the form of a difference of Gaussians.

The linear response of the RF to a visual stimulus is then given by a space-time convolution (see e.g this web page).

In Macular, convolutions are computed using a fast method called Deriche filters [11] and are handled by the Virtual Retina simulator, developed by Wohrer and Kornprobst [32], integrated in Macular. As a consequence, filters have a spherical symmetry. This limitation is further discussed in the conclusion section. Stimuli are considered as levels of gray between [1, 255]. We do not handle color in Macular. A detailed description of the Virtual Retina implementation in Macular can be found here.

### 2.4.2 Cells

We now define more specifically what Macular Cells are. A Cell is denoted $T_i$ where *T* is called the "Cell type" and *i* is the index labelling Cells of type *T*. A Cell type can refer either to the cell's biological terminology (e.g. bipolar or amacrine retina cell layers), to subtypes within these general cell layers (e.g. starburst amacrine cell), or to its functionality (e.g ON cells). But, as already mentioned, a Macular Cell does not necessarily correspond to a biological cell. It can be, for example, a region in the cortical space (e.g. a cortical column) corresponding to a mean-field average over thousands of neurons (see section 6.2). A glossary of (default) Cell types existing in Macular is given in table 2.

The Cell $T_i$ is identified by:

* An Input, $\vec{I}^{(T_i)}(t)$. The Cell receives an entry which can be:

1. An external Input $\vec{I}_{ext}^{(T_i)}$. For example, an entry corresponding to the input from OPL (visual flow, i.e. the convolution of a movie with the OPL receptive field) to bipolar cell
$\vec{\mathcal{I}}_{OPL}^{(T_i)}$ (defined in section 2.4.1), or the electric current provided by an electrode $\vec{\mathcal{I}}_{stim}^{(T_i)}$ (defined in section 2.4.8).

2. A synaptic input $\mathcal{I}_{syn}^{(T_i)}(t)$ corresponding to Synaptic connections with other Cells and defined in section 2.4.5. In general, this contribution sums up the connection with several pre-synaptic cells.

The input $\vec{\mathcal{I}}^{(T_i)}(t)$ is in general the sum of several contributions (e.g. OPL current and synaptic input).

* **A State.** This is an array $\vec{\mathcal{X}}^{(T_i)}$ of variables evolving in time and characterizing the Cell's dynamical evolution. For example, State variables can be a membrane potential, activity - probability that an ion channel of a given type is open, concentration of neurotransmitter of a given type released by the cell, etc.

* **A set of Parameters.** These are quantities that do not evolve in time but are nevertheless necessary to constrain the Cell evolution. They can, for example, correspond to conductances, reversal potentials, membrane capacitance, etc. They can be modified by the user, with sliders or by typing the value in a field. We denote by $\vec{\mu}^{(T_i)}$ the array of these parameters.

* **A function,** called Vector Field $\vec{\mathcal{F}}^{(T_i)}$, controlling the time evolution of Cells. Mathematically, $\vec{\mathcal{F}}^{(T_i)}$ is the vector field of the differential equation:

$$ \frac{d\vec{\mathcal{X}}^{(T_i)}}{dt} = \vec{\mathcal{F}}^{(T_i)}(\vec{\mathcal{X}}^{(T_i)}, \vec{\mu}^{(T_i)}, \vec{I}^{(i)}(t)), \quad (1) $$

and $\vec{\mathcal{F}}^{(T_i)}$ has the same dimension as $\vec{\mathcal{X}}^{(T_i)}$, the State vector.

### 2.4.3 Pre-defined cell types

There is a set of pre-defined Cells defined in Macular listed in Table 2. The user can create new Cells using the MacularTemplateEngine presented in section 4. Most of the predefined Cells in Macular (except the so called "CorticalCells" which actually physically correspond to cortical columns) are based on the generic equation for voltage:

$$ C \frac{dV}{dt} = -g_L (V - E_L) - \sum_X g_X (V - E_X) + I_{syn} + I_{ext} \quad (2) $$

where $g_L$ and $E_L$ respectively refer to leak conductance and leak reversal potential, $g_X$ and $E_X$ correspond to ionic current contributions, $I_{syn}$ is the synaptic current discussed in section 2.4.5 and
<table><caption>Table 2: Cell types pre-defined in Macular, listed in alphabetic order. New Cell types can be created using the Macular Template Engine (section 4). Once a variable has been introduced in the table, we do not repeat its definition. More detail can be found by clicking on the variable name in the Macular GUI</caption><thead><tr><th>Cell name in Macular</th><th>Equation</th><th>Comment</th></tr></thead><tbody><tr><td>macularCellAmacrine, macularCellBipolar</td><td><sup>dV</sup>&frasl;<sub>dt</sub> = -<sup>V-E<sub>L</sub></sup>&frasl;<sub>&tau;</sub> + V<sub>syn</sub></td><td>Linear cell with synaptic input (V<sub>syn</sub>) and characteristic time &tau;. E<sub>L</sub> is the leak reversal potential.</td></tr><tr><td>macularCellAmacrineLinearPharma, macularCellBipolarLinearPharma, macularCellGanglionLinearPharma</td><td><sup>dV</sup>&frasl;<sub>dt</sub> = -<sup>g<sub>L</sub>+g<sub>P</sub></sup>&frasl;<sub>C</sub> V + <sup>I<sub>syn</sub></sup>&frasl;<sub>C</sub> + <sup>g<sub>L</sub>E<sub>L</sub>+g<sub>P</sub>E<sub>P</sub></sup>&frasl;<sub>C</sub></td><td>Linear cell with membrane capacitance C and a tunable ion contribution e.g. corresponding to an injected drug where g<sub>P</sub>: conductance; E<sub>P</sub>: Nernst potential, of the ionic channels sensitive to that drug (see [21])</td></tr><tr><td>macularCellAmacrineGABA, macularCellAmacrineAMPA</td><td><sup>dT</sup>&frasl;<sub>dt</sub> = -k<sub>d</sub> T + <sup>k<sub>p</sub></sup>&frasl;<sub>1+e<sup>-(V-E<sub>N</sub>)/&kappa;<sub>N</sub></sup></sub><br><sup>dV</sup>&frasl;<sub>dt</sub> = -<sup>V</sup>&frasl;<sub>&tau;<sub>A</sub></sub> + <sup>I<sub>syn</sub></sup>&frasl;<sub>C<sub>A</sub></sub><br><sup>dn</sup>&frasl;<sub>dt</sub> = -&beta;<sub>n</sub>n + &alpha;<sub>n</sub> T (1 - n)</td><td>Linear Amacrine cell producing GABA (resp. AMPA) with a quasi static production of neurotransmitter T and an activation variable n. From [12]</td></tr><tr><td>macularCellBipolarGainControl</td><td><sup>dA<sub>B</sub></sup>&frasl;<sub>dt</sub> = -A<sub>B</sub>/&tau;<sub>A</sub> + h<sub>B</sub>N<sub>B</sub>(V)<br><sup>dV</sup>&frasl;<sub>dt</sub> = -(V - E<sub>L</sub>)/&tau;<sub>B</sub> + V<sub>ext</sub>/&tau;<sub>ext</sub> + V<sub>syn</sub></td><td>Bipolar Cell with a gain control controlled by a non linear function N<sub>B</sub> of the voltage V and of an activity variable A<sub>B</sub> (from [5, 9, 29]).</td></tr><tr><td>macularCellCorticalExcitatory, macularCellCorticalInhibitory</td><td>The equations are too long to be written in this table. For further detail see [33, 15]</td><td>Respectively excitatory and inhibitory populations of a cortical column. Excitatory populations come from regular spiking cells (RS) and inhibitory populations from fast spiking cells (FS).</td></tr><tr><td>macularCellElectrode</td><td><sup>dV</sup>&frasl;<sub>dt</sub> = -<sup>V</sup>&frasl;<sub>&tau;</sub> + <sup>I<sub>ext</sub></sup>&frasl;<sub>C</sub></td><td>Passive (low pass) electrode receiving an input, I<sub>ext</sub>, corresponding to a local pixel average (see section 2.4.8).</td></tr><tr><td>macularCellGanglionGainControl</td><td><sup>dV</sup>&frasl;<sub>dt</sub> = -<sup>1</sup>&frasl;<sub>&tau;<sub>L</sub></sub>(V - V<sub>L</sub>) + V<sub>syn</sub> - <sup>g<sub>T</sub></sup>&frasl;<sub>C<sub>G</sub></sub>(V - V<sub>T</sub>);<br><sup>dA<sub>G</sub></sup>&frasl;<sub>dt</sub> = -<sup>1</sup>&frasl;<sub>&tau;<sub>G</sub></sub>(H<sub>G</sub>N<sub>G</sub>(V))</td><td>Ganglion cells with gain control (from [5, 9]) and a tunable ion contribution e.g. corresponding to an injected drug. Firing rate is controlled by a non linear function N<sub>G</sub> of the voltage V and of an activity variable A<sub>G</sub>.</td></tr><tr><td>macularCellHodgkinHuxleyCurrent, macularCellHodgkinHuxleyVoltage</td><td>From [19].</td><td>Hodgkin-Huxley neuron with the classical form (2) or with a voltage form (3).</td></tr><tr><td>macularCellMorrisLecar</td><td>From [25].</td><td>Morris-Lecar neuron.</td></tr><tr><td>macularCellMorrisLecarAch</td><td>Used to feature Starburst Amacrine Cells. Parameters have been tuned according to the paper [8]</td><td>Morris-Lecar neuron producing Acetylcholine.</td></tr><tr><td>macularCellSAC</td><td>Used to feature Starburst Amacrine Cells during development. Parameters have been tuned according to the paper [8]</td><td>Morris-Lecar neuron producing Acetylcholine with a potassium slow After Hyperpolarization current.</td></tr></tbody></table>

$I_{ext}$ is the input Current. Another form, also used in Macular, is:

$$ \frac{dV}{dt} = - \frac{V - E_L}{\tau_L} - \sum_X \frac{V - E_X}{\tau_X} + V_{syn} + V_{ext}. \quad (3) $$

It corresponds to (2) setting $\tau_L = \frac{C}{g_L}$, $\tau_X = \frac{C}{g_X}$. The term $V_{syn}$ appearing in (3) corresponds to the synaptic input, explained in section 2.4.5. Note that it does not have the dimension of a voltage. Its dimension is $mV s^{-1}$ and would correspond, from (2), to $\frac{I_{syn}}{C}$. We adopted the letter V for simplicity. The same remark holds for the physical dimension of $V_{ext}$. $I_{ext}$ and $V_{ext}$ correspond to different stages of integration in the OPL.

We distinguish 3 main Cells subtypes, based on the mathematical implementation of the conductances $g_X$:

* **Linear cells.** The conductances $g_X$ are constant, i.e. they do not depend on any variable.
* **Rectified cells.** The conductances depend on voltage only, and take the form $g_X(V) = \lambda \mathcal{N}_X(V)$ where $\lambda$ is a constant and:

$$ \mathcal{N}_X(V) = \begin{cases} V - \theta_X, & \text{if } V > \theta_X; \\ 0, & \text{otherwise} \end{cases}, \qquad (4) $$

is a piecewise linear rectifier, $\theta_X$ being a voltage threshold.

* **Non-Linear cells.** The conductances depends non linearly on voltage and on potential additional variables like activation or inactivation variables. This is the case e.g. for cells inspired from Morris-Lecar [25] or Hodgkin-Huxley model [19].

In addition, some Cell types have activation variables used for synaptic computation (see section 2.4.5). Note that there is no constraint for the user to stick to Cells of the form (2) or (3). They are free to develop their own using the Macular Template Engine (section 4).

### 2.4.4 Cell Layers

Macular is organised in Layers. A Cell layer is a set of Cells of the same type $T$, where "same type" means that the Inputs, State vector, Parameters vector and Vector Field have the same mathematical expression. In this respect, Macular Layers are different from biological "layers" which can contain different cell types. Note that Cells in the same Layer share the same set of parameters. The State values can differ, depending on the initial conditions and on the Input. In Macular, Cells are considered as points i.e. soma, axons, synapses of neurons are located at the same point. They are identified by an index (ID). Cells within a given Layer are organized in a two dimensional grid, and different Cell Layers are located on a 3-dimensional space with coordinates $(x, y, z)$. All Cells of type $T$ have the same $z$ coordinate. Thus, the Cell $T_i$ has coordinates $(x_i, y_i, z_i)$ where the vertical coordinate $z_T$ parametrizes the Cell's type and the coordinates $(x_i, y_i)$ the position of Cell $i$ in the Layer $T$. All Layers have a common frame, with parallel axes in the $x, y$ directions and a common origin. Layers are represented as rectangles. The number of Cells in the horizontal and vertical direction might not be the same and each Layer may contain a different number of Cells.

### 2.4.5 Synapses

Biological cells can be connected either by chemical synapses or by electric synapses (gap junctions). The synaptic contact between two cells involves complex dynamical processes such as calcium influx, release, diffusion and capture of neurotransmitter, opening or closing of ion channels resulting in electric currents modifying the membrane voltage of the post synaptic neuron. As well as in neuron modelling, these mechanisms are modelled by equations capturing different aspects of synapse dynamics. In Macular, the objects called Synapses implements these aspects.
A Synapse is noted $S_k$ where S is called the "Synapse type" and k is the index labelling Synapses of type S. The "type" of the Synapse refers here to a model, a set of equations, corresponding to a biological synapse, for example, a cholinergic synapse between two amacrine cells. The Synapse connects a pre-synaptic Cell $T_i$ to a post-synaptic Cell $T'_j$.

A Synapse is identified by:

* **A set of Parameters.** These are quantities that do not evolve in time but constrain the connectivity function of the Synapse. These can be conductance, connectivity weights, reversal potentials ... They can be modified by the user by sliders or by typing the value in a field.

* **A function,** the mathematical representation of the synaptic connection. It could compute either a synaptic current ($I_{syn}^{(T_i \to T'_j)}$), a voltage ($V_{syn}^{(T_i \to T'_j)}$) (i.e. a Post Synaptic Potential) or a firing rate ($FR_{syn}^{(T_i \to T'_j)}$). These quantities depend in general on the State vector of pre- and post-synaptic Cells.

The predefined types of Macular synapses are listed in table 3.

In the Macular Graph Generator (see section 3.2.2), the user specifies the Cell's type in each Layer and select the Synapses' type inside a Layer (intra-Layer Synapses) or between Layers (inter-Layers Synapses). There can be several types of intra- or inter-Layers Synapses in the simulation.

A post-synaptic Cell receives in general many Inputs from different Cells of different types. So, the general form of the Synaptic Current $I_{syn}^{(T_i)}(t)$ introduced in section 2.4.2, eq. (2), is:

$$I_{syn} \equiv \mathcal{I}_{syn}^{(T_i)}(t) = \sum_{T'} \sum_{j \in T'} I_{syn}^{(T_i \to T'_j)}(t), \quad (5)$$

where the first summation holds on the Cells j of type T pre-synaptic to Cell i and the second summation holds on Cells Layers. The same formulation holds in the case of the voltage representation, introduced in section 2.4.2, eq. (3):

$$V_{syn} \equiv V_{syn}^{(T_i)}(t) = \sum_{T'} \sum_{j \in T'} V_{syn}^{(T_i \to T'_j)}(t), \quad (6)$$

or a firing rate input used e.g. for retino-cortical Synapses:

$$FR_{syn}^{(T_i)}(t) = \sum_{T'} \sum_{j \in T'} FR_{syn}^{(T_i \to T'_j)}(t). \quad (7)$$

By default, synapses in Macular are instantaneous, i.e. there is no delay between the emission of a signal at the pre-synaptic neuron and its arrival at the post-synaptic one. It is nevertheless possible to add a delay to a Synapse type. For this, the user has to create a speed parameter called
<table><caption>Table 3: Synapses type pre-defined in Macular. New Synapses type can be created using the Macular Template Engine (section 4).</caption><thead><tr><th>Synapse name</th><th>Definition</th><th>Comment</th></tr></thead><tbody><tr><td>macularSynapseAcetylcholine</td><td>I<sub>syn</sub>(T<sub>pre</sub>→T'<sub>post</sub>)(t) = -gA(A<sub>pre</sub><sup>2</sup>/γ<sub>A</sub> + A<sub>pre</sub><sup>2</sup>)(V<sub>post</sub> - V<sub>A</sub>)</td><td>Model of Ach conductance for nicotinic receptors (from [22]). A<sub>pre</sub>, is the Ach concentration emitted by the pre-synaptic cell (so the Cell type must contain this variable, for example a macularCellSAC defined in table 2); V<sub>post</sub>, voltage of the post-synaptic cell; g<sub>A</sub>, Max Ach conductance; γ<sub>A</sub>, half-activation constant; V<sub>A</sub>, reversal potential for Ach.</td></tr><tr><td>macularSynapseAmacrineToBipolar, macularSynapseAmacrineToGanglion, macularSynapseBipolarToAmacrine, macularSynapseBipolarToGanglion, macularSynapseLinearRectified</td><td>V<sub>syn</sub>(T<sub>pre</sub>→T'<sub>post</sub>)(t) = w<sub>post</sub><sup>pre</sup>N<sub>pre</sub>(V<sub>pre</sub> - θ<sub>pre</sub>)</td><td>Rectified synapse (in mV/s). w<sub>post</sub><sup>pre</sup>, synaptic weight from pre-synaptic to post-synaptic Cells; N<sub>pre</sub>, linear rectifier; θ<sub>pre</sub>, rectifying threshold (mV).</td></tr><tr><td>macularSynapseAmacrineToBipolar, macularSynapseBipolarToAmacrine</td><td>V<sub>syn</sub>(T<sub>pre</sub>→T'<sub>post</sub>)(t) = w<sub>post</sub><sup>pre</sup>V<sub>pre</sub></td><td>Linear synapse (in mV/s).</td></tr><tr><td>macularSynapseBipolarGainControlToAmacrine, macularSynapseBipolarToAmacrine, macularSynapseBipolarPooling</td><td>V<sub>syn</sub>(T<sub>pre</sub>→T'<sub>post</sub>)(t) = w<sub>post</sub><sup>pre</sup> preBipolarResponse</td><td>The post synaptic voltage is proportional to the pre-synaptic voltage via a synaptic weight w<sub>post</sub><sup>pre</sup>. The term "preBipolarResponse" depends on the Macular Cell type.</td></tr><tr><td>macularSynapseGapJunctionVoltage</td><td>V<sub>syn</sub>(T<sub>pre</sub>→T'<sub>post</sub>)(t) = -w<sub>gap</sub>(V<sub>post</sub> - V<sub>pre</sub>)</td><td>Passive gap junctions where w<sub>gap</sub> is expressed in nS/nF = Hz.</td></tr><tr><td>macularSynapseCorticalExc_to_CorticalExc, macularSynapseCorticalExc_to_CorticalInh, macularSynapseCorticalInh_to_CorticalExc, macularSynapseCorticalInh_to_CorticalInh</td><td>ν<sub>post</sub> = w<sub>post</sub><sup>pre</sup>ν<sub>pre</sub></td><td>From [33], where ν<sub>pre</sub>, ν<sub>post</sub> are the firing rates of the pre/post-synaptic Cell (corresponding here to a cortical column) and w<sub>post</sub><sup>pre</sup> the gaussian weigth between pre/post-synaptic Cell.</td></tr><tr><td>macularSynapseGABA_A, macularSynapseAMPA</td><td>V<sub>syn</sub>(T<sub>pre</sub>→T'<sub>post</sub>)(t) = -g n (V<sub>pre</sub> - E)</td><td>Here n is an activation variable as produced by the Cells macularCellAmacrine-GABA, macu-larCellAmacrineAMPA.</td></tr><tr><td>macularSynapseRetinoCortical</td><td>F<sub>syn</sub>(T<sub>pre</sub>→T'<sub>post</sub>)(t) = weight.<sub>densityRetine</sub>.<sub>preFiringRate</sub><sub>densityCortex</sub></td><td>Synapse connecting the retina to the cortex [28] where preFiringRate is the output firing rate of ganglion cells. It is multiplied by a factor corresponding to the ratio between the retinal density and the cortical density. Respectively 400 mm<sup>-2</sup> and 4000 mm<sup>-2</sup> in the model [15].</td></tr></tbody></table>

"conductionVelocity" in the Synapse type. Macular compute the synaptic delay based on the equation:

$$delay_{syn} = \frac{d_{syn}}{v_{C}}, \qquad (8)$$

where $d_{syn}$ is the distance between the two neurons (e.g. the length of the axons), and $v_C$ the conduction velocity.

### 2.4.6 Graph

Synapses define a natural notion of intra- and inter-layer connectivity. If the Cell $T_i$ is pre-synaptic to Cell $T'_j$, with a Synapse of type $S$, we note $T_i \xrightarrow{S} T'_j$ the oriented edge featuring this connection. The set of edges of type $S$ defines a directed graph $G(T_S \xrightarrow{S} T')$. This graph features the set of synaptic connections of type $S$, from Layer $T$ to Layer $T'$. If $T = T'$ we speak of "intra-Layer connectivity" of type $S$, and "inter-Layer" if $T \neq T'$. Between two Layers there may exist several
type of synaptic connections and a Cell can be a source or a target to different types of Synapses (e.g. an AC can connect a BC through a glycinergic synapse and a gap junction).

In this frame, Cell *i* has coordinates $x_i, y_i$ in its Layer, while Cell *j* has coordinates $x_j, y_j$ in its Layer. The distance between these two cells is $d(i, j) = \sqrt{(x_i - x_j)^2 + (y_i - y_j)^2}$, the two dimensional Euclidean distance. That is, we do not consider the vertical distance between different Layers. Two Cells are nearest neighbours if their distance is the smallest strictly positive distance.

In Macular, there are 6 types of connectivity that a graph can implement between two Layers:

* **One-to-one (Inter-Layers).** A Cell is connected to the Cell at zero distance in another Layer. This type of connectivity requires that these Layers have the same number of Cells.

* **Nearest neighbours (Inter- and Intra-Layers).** A Cell is connected to its 4 nearest neighbours.

* **Neighbour 4 + 1 (Inter-Layers).** A Cell is connected to 4 nearest neighbours and to the Cell at distance zero.

* **Radius neighbours (Inter- and Intra-Layers).** A Cell is connected to neighbours Cells within a certain radius (excluding Cell at distance zero). The synaptic weights are constant within this radius.

* **Gaussian (Inter- and Intra-Layers).** The synaptic weight between the pre-synaptic and the post-synaptic Cell depends on their distance $d(i, j)$, via a Gaussian profile:

$$W_{post}^{pre} = \frac{e^{-\frac{d(i,j)^2}{2\sigma_p^2}}}{2\pi\sigma_p^2} \qquad (9)$$

In this case, we have connectivity to the Cell at distance 0.

* **Fully Connected (Inter-Layers).** A Cell is connected to all Cells with constant synaptic weights.

Among all of these connectivity types, Gaussian and Nearest Neighbours are currently the only ones used to connect Cells from the same Layer.

### 2.4.7 ODE solver

Macular integrates ordinary differential equations (ODE) using the General Scientific Library (GSL) (See the GSL online documentation). The library provides a variety of low-level methods, such as Runge-Kutta and Bulirsch-Stoer routines, and higher-level components for adaptive step-size control. By default the method used in Macular is Runge Kutta of order 4 (RK4). Note therefore that the current implementation of Macular is not adapted to simulate evolution with noise (which
would require specific stochastic integrators). The Macular GUI menu allows the selection of different integration methods: RK2, RK4, RK45, RK8, RKCK, RK1imp, RK2imp, RK4imp, BSIMP, ADAMS, BDF. See the online documentation of the GSL for detail on these methods.

### 2.4.8 Electrodes stimulation.

Retinal implants are electronic devices surgically attached to the retina. They substitute to defective cells in order to partially restore vision. Images acquired by a "camera + processor" system are encoded and sent as pulses to a matrix of electrodes. It then stimulates the still functional cells of the retina in order to reproduce a luminous impression.

We have implemented in Macular a simplified version of this process. Electrodes are considered as "Cells" (type macularCellElectrode). They are quite simplified with respect to real electrodes as they are just low pass filters, but the user can extend their definition using more complex equations and the MacularTemplateEngine facilities (section 4). A retinal prosthesis is a matrix of electrodes which becomes, in Macular, a matrix of "macularCellElectrode".

The "camera + processor" processing is featured by averaging the pixels around the location of a given macularCellElectrode in a region whose size is the image size in pixels divided by the number of electrodes. This averaging provides the macularCellElectrode input. This functionality is obtained by selecting "Prosthesis" in the "WorkerSetting" (see section 3.2).

## 3 The Macular GUI

Macular has a Graphical User Interface (GUI) with a large panel of possibilities such as the visualisation of the Cells Layers in 2D or 3D, the monitoring of specific Cells' State variable.... The majority of the elements in the Macular GUI have a small embedded documentation appearing when pointing the mouse on it.

### 3.1 Views

When opening Macular a panel appear showing up 4 buttons corresponding to different views.

* **3D view** creates "canvas" object that provide a layered, customizable, view of the simulation.

* **Layered view** provides a set of 2D views "Views2D", one for each Layer, and is customizable.

* **Plot views** allows to generate a Plot2D object to monitor the time evolution of specific Cells variables.

* **Stimulus**. When an image or a video is played this option allows to see the stimulus.

Several views can be simultaneously open.
## 3.2 The Simulator

### 3.2.1 The Configuration panel

On the left of the GUI a list of icons are visible. This is the configuration panel, respectively corresponding to the following functions.

* **Selection.** The user can select which output they want to record in their simulation.

* **Video Input.** The command **Browse Stimulus** loads a visual stimulus in the form of a movie in the formats `.mp4`, `.mkv`, `.avi`. This stimulus will be played when running the simulation.

* **Graph Input.** The command **Browse Graph** loads a `.mac` (mac, for "Macular") file containing a Macular graph (see section 3.2.2 for a description of the `.mac` files).

* **Worker settings.** **Input** selects a Worker, namely a setting of functionalities to run the simulation according to the type of visual input. The options are:

1. "Visual Flow". The menu essentially contains Parameters shaping the Receptive Field filter (see section 2.4.1).

2. "Prosthesis". Here one parametrizes the setting for retinal prostheses.

3. "None". Here, there is no input.

* **Simulation parameters.** This menu allows to further parametrize the simulation.

* **Controls** allows to run, save, and reset the simulation.

* **Parameters of Cells and Synapses.** Here, one can select a predefined Cell or Synapse type.

* **Configuration** allows the user to select the appearance of the GUI (colors of the background, fonts) and to toggle advanced parameters selected in the parameters visibility view.

### 3.2.2 The graph Generator

The Graph Generator allows the user to create layers of Cells, with a given connectivity using the existing Cell/Synapse types (for the creation of new Cell types see section 4). An example of Graph creation is provided here. As exposed in section 2.4.6 a Graph is a mathematical structure made up of vertices (Cells), connected by intra- and inter-layer edges (Synapses). In Macular, a graph is implemented as a C++ object. The data necessary to run the simulation are saved in two files. The first one, with the extension `.mac` (mac, for Macular) contains the number of Cells, the number of Synapses the type of each Cell with its coordinates, the type of each Synapse and the Cells it connects to, and, finally the initial value of each variable. The second one, with an extension `.json`, contains the information about model parameters. More details can be found in the online documentation page.
# 4 The Macular Template Engine

The Macular Template Engine (MTE) allows the user to manage existing Cells and Synapses types, to create new Cells and Synapses types, or to suppress them. Then, MTE generates automatically (i.e. without need of writing code) a set of C++ files. After any change in MTE, the user has to press the "Write C++ files" and re-compile Macular using the "Build" button.

**Important notice.** Modifying existing Cells or Synapses will replace the user existing files, except for protected Cell and Synapse types. Indeed, some Macular Cell or Synapse type are protected: they contain a ".lock" extension at the end of its json file name. They can not be modified by the MTE. Currently, only two macular Cells are protected (macularCellCorticalExcitatory and macularCellCorticalInhibitory).

In more detail, the main features of the MTE are:

* **Loading** the Cells and Synapses types already existing in the directory share/macular/app/macularTemplateEngine/json/ (on Windows, the share directory is a subdirectory of the Library directory).

* **Creating and editing new Types.** This allows the user to create new Cells/Synapses types or to edit unprotected Cell/Synapses types with specific parameters, auxiliary functions and vector field equations.

* **Deleting existing Types.** This allows the user to suppress any unprotected Cell and Synapse type. The corresponding .json file (inside share/macular/app/macularTemplateEngine/json/ subfolder) is suppressed.

* **Write C++ Files:** With this functionality, once the new Cells/Synapses types are saved in .json Files, the MTE will generate new C++/CMake files with the parameters, functions and equations specified in the .json files. For this purpose, Macular uses Python scripts to generate the files based on C++ templates. This script fills in the required data in the C++ templates from the .json files, for each Cell and Synapse. The user can finally re-compile Macular in order to add these new Cells/Synapses types to the Simulator and the Graph Generator. Note that this operation is done by simply pressing the button "Build". The source files for the generated Cells and Synapses are located in /macular/share/macular/src/macularCore/, assuming that macular is installed in /macular.

The MTE is run by typing the shell command `bin/macularTemplateEngine &` in the main directory (Linux) (on MacOS, one runs the file `macular.app` in bin, and on Windows the binary should be available on your desktop after installation). An example of usage can be found here.
# 5 Macular Batch

All the features available in the Macular GUI can be used in the batch version of Macular. This version is run from the main directory by typing the command `./bin/macular-batch -f path_-session_file.json` in a shell/terminal (on Windows, it's Library/bin/macular-batch). The -f or -file argument is the only one mandatory. It requires the path to a Macular session json file. There are other options described in the online documentation page.

# 6 Examples

Here, we provide a few examples of simulations with scenarios included in the Macular release. For more detail see the online documentation page.

## 6.1 Retinal Waves

This scenario, available in the directory `macular/examples/Scenario1_RetinalWaves` (on windows, it is located in `examples`, at the top of the macular installation directory) provides a simulation of retinal waves occurring during the development of the visual system. It involves Starburst Amacrine Cells (SAC) which are sporadically synchronizing producing waves of bursting activity (see [22, 8] for more detail on the model and references therein about developmental retinal waves).

On this page we detail how to create the graph and how to run the simulation and visualise the results. A view of this simulation is shown in Fig. 2.

## 6.2 A retino-cortical model

In this second example, we consider a model of the retino-cortical associations featuring the joint evolution of the retina and V1 under visual stimuli. A view of the corresponding Macular simulation is shown in Fig. 1 and Fig. 3.

The retina model is composed of 3 layers: Bipolar cells with gain control (BCs) receiving an input from the OPL, Amacrine cells (ACs) providing lateral inhibition and retinal Ganglion cells (RGCs) receiving excitation from BCs and inhibition from ACs [30, 7, 21, 16]. Moreover, BCs and ACs are mutually connected. BCs excite ACs, ACs inhibit BCs. It is possible to enable or disable the various features of the model (lateral connectivity and gain control) by adjusting its parameters. The cortical model of V1 features the joint evolution of two populations of cortical column, one excitatory, the other inhibitory, coupled via delayed lateral connectivity depending on a conduction velocity, and evolving via dynamic mean field equations with an input coming from the retina/thalamus. This model has been proposed in [13, 3, 4, 33]. We refer to these papers for the detail. This model
<figure><img src="image_3.png" /><figcaption>**Figure 2: The retinal waves scenario.** **Top left.** Visualisation of the lattice evolution for the voltage of Starburst Amacrine Cells (SACs). **Top right.** Visualisation of the lattice evolution for the acetylcholine concentration produced by SACs. **Bottom left.** Time evolution for the voltage of a few SACs selected by the user. **Bottom right.** Time evolution for the acetylcholine production of a few SACs.</figcaption></figure>
<figure><img src="image_4.png" /><figcaption>Figure 3: **The retino-cortical scenario.** The upper left panel shows the heatmap of the 5 cell types. Bipolar cells with gain control appear in blue, amacrine in magenta, ganglion cells with gain control in yellow, excitatory population of cortical columns in green and inhibitory population of cortical columns in red. On the panel below, left, one sees the video of the stimulus, a white bar moving. Right panels are plots of Cells activity. The upper one displays retinal outputs : bipolar voltage (red), amacrine voltage (yellow) and ganglion cells firing rate (pink). The bottom panel displays cortical output : excitatory (blue) and inhibitory (orange) mean voltage.</figcaption></figure>

and this Macular scenario have been used in the papers [14, 16]. The firing rate of RGCs constitute the inputs of the cortical model. Thus, there is no thalamus in this example.

How to create the corresponding Graph and generate the simulation is described in detail there.
Here, we just show the result of a simulation obtained by loading a scenario available with the
Macular release. In this scenario illustrated by Figure 3, the only feature activated is the lateral
connectivity between bipolar and amacrine cells. The corresponding Macular session and graph
have been placed in the "macular/examples" repository : "Scenario2_RetinoCortical.json" for the
graph and "Scenario2_RetinoCortical_layout.json" for the session.
## 6.3 Creating a new model

Here, we give an example of new Cell type and Synapses created with the MTE. The detailed procedure can be found here. This example corresponds to the Amari-Wilson-Cowan model [1, 31] whose equations reads:

$$ \frac{dV_i}{dt} = -\frac{V_i}{\tau} + \sum_{j=1}^{N} J_{ij}f(V_j) + H_{ext_i}(t), \quad j = 1...N, \qquad (10) $$

where $V_i$ is the voltage of Cell i in mV, $\tau$ a characteristic integration time, $J_{ij}$ a synaptic weight (in mV/s), $H_{ext_i}(t)$ the OPL input (it has the dimension $mV s^{-1}$). The function $f$ is a sigmoid function of the form:

$$ f(x) = \frac{1}{2} \left[ 1 + erf \left( \frac{gx}{\sqrt{2}} \right) \right], \qquad (11) $$

$g$ being a positive parameter called "sigmoid gain" (in $mV^{-1}$). This model has been widely studied in the literature, especially in the case where the $J_{ij}$ are random independent variables, with no external current. In this case, dynamics is chaotic for a sufficiently high gain $g$ [27, 6]. Here, we consider the case where the $J_{ij}$'s corresponds to Gaussian pooling (see section 2.4.6, eq. (9)) with excitatory and inhibitory synapses and with an OPL input. This does not really correspond to a realistic situation as (10) would correspond to ganglion cells, the only spiking retinal cells, that would receive a direct OPL input. This does not hold in the real retina.

## 7 Comparison to other simulation software

Table 4 shows a comparison between different retina simulation software. We have been focusing here on software specialized to the retina. Thus, we didn't include more generalist software such as COMSOL (which also has a graphical interface), MATLAB, or NEURON.
<table><caption>Table 4: Comparison between a selection of existing software and Macular. Abbreviations for software names have been chosen for the presentation. Following software is discussed: **CR**: COREM [23], **RS**: "RETINA SIMULATOR" [2], **RT**: RETSIM. **CN**: CONVIS [20], **IS**: ISETBIO [10], **P2P**: PULSE2PERCEPT [24], **RSt**: RETINA STUDIO, **VR**: VIRTUAL RETINA [32], and **MA**: MACULAR. Note that features selected in this table have essentially been chosen according to what Macular does. It is not an exhaustive list and information applies to the time of writing. Software we mention can have additional features not commented herein. "All" in the row "OS (operating system)" means Linux, Mac and Windows. Other abbreviations used in this table are: D.E. Differential Equations. P.K.R: Programming Knowledge Required. I.W.O.L: Interface With Other Languages. S.P.U: Select Physical Units. C.I.M: Choice of Integration Methods. S.T.K. Spatio-temporal Kernels. N.T. Nonlinear Transformations. A ● means "yes". A white cell means "no". A x in a column means that we haven't been able to find the information. "Extended cells", signifies the Cell concept of Macular. * means that the referred Git page is not accessible.</caption><thead><tr><th></th><th>CR</th><th>RS</th><th>RT</th><th>CN</th><th>IS</th><th>P2P</th><th>RSt</th><th>VR</th><th>MA</th></tr></thead><tbody><tr><td>OS</td><td>Linux</td><td>All</td><td>Linux-Mac</td><td>Linux</td><td>All</td><td>All</td><td>x</td><td>All</td><td>All</td></tr><tr><td>Version</td><td>x</td><td>x</td><td>1.7.57</td><td>0.6.4</td><td>x</td><td>0.10.0</td><td>x</td><td>2.2.3</td><td>1.5.2</td></tr><tr><td>Language</td><td>C++</td><td>Matlab</td><td>C++</td><td>Python</td><td>Matlab</td><td>Python</td><td>Flowlang</td><td>C++</td><td>C++</td></tr><tr><td>Type</td><td>library</td><td>toolbox</td><td>library</td><td>toolbox</td><td>toolbox</td><td>library</td><td>library</td><td>standalone</td><td>standalone</td></tr><tr><td>Dependences</td><td></td><td>Matlab</td><td></td><td>PyTorch</td><td>Matlab</td><td></td><td>x</td><td></td><td></td></tr><tr><td>Open source</td><td>●</td><td>*</td><td>●</td><td>●</td><td>●</td><td>●</td><td>●</td><td>●</td><td>●</td></tr><tr><td>P.K.R.</td><td>●</td><td></td><td>●</td><td>●</td><td></td><td>●</td><td>●</td><td>●</td><td></td></tr><tr><td>GUI</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>●</td></tr><tr><td>Videos as inputs</td><td>●</td><td></td><td></td><td>●</td><td>●</td><td>●</td><td>●</td><td>●</td><td>●</td></tr><tr><td>OPL modelling</td><td>S.T.K.</td><td>D.E.</td><td>x</td><td>S.T.K.</td><td>N.T.</td><td>S.T.K.</td><td>S.T.K.</td><td>S.T.K.</td><td>S.T.K.</td></tr><tr><td>Shape of RF</td><td>x</td><td>x</td><td>x</td><td>Any</td><td>x</td><td>N.A.</td><td>x</td><td>circular</td><td>circular</td></tr><tr><td>3D visualisation</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>●</td></tr><tr><td>Scripting Interface</td><td></td><td></td><td></td><td></td><td></td><td></td><td>●</td><td></td><td>●</td></tr><tr><td>Parameters tuning</td><td></td><td>File</td><td>File</td><td>Automatic</td><td>File</td><td>File</td><td>x</td><td>File</td><td>Sliders</td></tr><tr><td>Extended cells</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>●</td></tr><tr><td>Thalamus, Cortex</td><td></td><td></td><td></td><td>●</td><td>●</td><td></td><td></td><td></td><td>●</td></tr><tr><td>Cells recording</td><td>●</td><td>●</td><td>●</td><td>●</td><td>●</td><td></td><td></td><td>●</td><td>●</td></tr><tr><td>I.W.O.L.</td><td>NEST</td><td>Matlab</td><td></td><td></td><td>Matlab</td><td></td><td></td><td></td><td></td></tr><tr><td>S.P.U.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>●</td></tr><tr><td>Prostheses</td><td></td><td></td><td></td><td></td><td></td><td>●</td><td>●</td><td></td><td>●</td></tr><tr><td>C.I.M.</td><td></td><td>●</td><td></td><td></td><td></td><td></td><td></td><td></td><td>●</td></tr></tbody></table>

## 8 Discussion

Macular was designed with the idea of maximising its accessibility, usability and development. That is why it is distributed as free software. It is also why we have designed an interface that allows non-programmers to use it, enabling them not only to simulate existing scenarios, but also to design new ones by creating new types of cells and synapses.

We would now like Macular to evolve freely, according to the communities that might use it. With this in mind, there could be several useful developments:
* **Multiple cell classes.** Macular allows to simulate different cell classes simultaneously (e.g. BCs, ACs, RGCs) and different types within each class. So we can simulate ON and OFF BCs at the same time. However, the input to BCs comes from VR that emulates the OPL and that response can be either ON or OFF. We are currently working on an extended worker allowing to feature ON and OFF OPL responses simultaneously.

* **Point neurons.** In the current release multi-compartment models of neurons are not allowed. It is however possible to upgrade Macular to have spatially extended neurons, although this is not planned by our group.

* **Interfaces with other simulators.** As we have shown, Macular can be used to produce a model of the V1 cortex receiving realistic retinal input (see [16]). To our knowledge, this is the only example of its kind. It would be interesting to extend the integration to other cortical areas by interfacing Macular with other simulators such as TheVirtualBrain [26] or NEST [17].

* **Optimisation of computation time.** It would be beneficial to port Macular to parallel architectures or GPUs, which would allow for larger-scale or real-time simulations (in the spirit of [2]).

* **Generalised receptive fields.** The method we use to calculate the convolution of receptive fields with stimuli, imported from VirtualRetina, does not allow for asymmetric kernels, for example sensitive to direction or orientation, unlike simulators such as Convis [20]. It would be useful to extend the kernels of the receptive fields to a more general form, at the cost of slower calculations [20].

We hope that Macular and its extensions will enable a new type of simulation in neuroscience, allowing for integrated models of the visual system with realistic sensory inputs, i.e. dynamic and multi-scale in space and time, e.g. films presenting visual scenes from the external world.

## Conflict of Interest Statement

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

## Author Contributions

B.C. has supervised the Macular project, participated to its elaboration, tests, and design, contributed to the use cases, and to the online documentation. He wrote the paper. T.K., C.L.B., J.L.S, and J.W. contributed to Macular design and conception as well as software development.
E.D., N.N. contributed to Macular design and conception, software development and to the online documentation. J.E., E.K. and S.S. contributed to Macular design and conception, to the software development and tests, and to the use cases.

## Funding

This work was funded by the Inria AMDT. It was supported by the Leverhulme Trust (RPG-2016-315) funding Evgenia Kartsaki's PhD, the National Research Agency (ANR), in the project "Trajectory", https://anr.fr/Project-ANR-15-CE37-0011, funding Selma Souihel's PhD; the ANR too in the project "Shooting Star-15755" https://anr.fr/Projet-ANR-20-CE37-0018, funding Jérôme Emonet's PhD, and finally by the interdisciplinary Institute for Modelling in Neuroscience and Cognition (NeuroMod http://univ-cotedazur.fr/en/idex/projet-structurant/neuromod) of the Université Côte d'Azur.

## Acknowledgments

We thank Téva Andreoletti, Ghada Balhoul, Eléonore Birgy, Tristan Cabel, Simone Ebert, Pierre Fernique, Sebastián Gallardo, Jonathan Levy, Andres Navarro, Alex Ye, Carlos Zubiaga, for their help in developing or testing Macular.

## Data Availability Statement

The source code of this software can be found in the Git repository https://gitlab.inria.fr/macular/macular.

## References

[1] S. Amari. Characteristics of randomly connected threshold element networks and neural systems. Proc. IEEE, 59:35–47, 1971.

[2] S. Baek, J. K. Eshraghian, W. Thio, Y. Sandamirskaya, H. H. C. Iu, and W. D. Lu. A real-time retinomorphic simulator using a conductance-based discrete neuronal network. In 2020 2nd IEEE International Conference on Artificial Intelligence Circuits and Systems (AICAS), pages 79–83, 2020.
[3] G. Benvenuti, S. Chemla, A. Boonman, G. Masson, and F. Chavane. Anticipation of an approaching bar by neuronal populations in awake monkey v1. Journal of Vision, 15(479), 2015.

[4] G. Benvenuti, S. Chemla, A. Boonman, L. Perrinet, G. S. Masson, and F. Chavane. Anticipatory responses along motion trajectories in awake monkey area v1. bioRxiv, 2020.

[5] M. Berry, I. Brivanlou, T. Jordan, and M. Meister. Anticipation of moving stimuli by the retina. Nature, 398(6725):334–338, 1999.

[6] B. Cessac. Linear response in neuronal networks: From neurons dynamics to collective response. Chaos: An Interdisciplinary Journal of Nonlinear Science, 29(10):103105, 2019.

[7] B. Cessac. Retinal processing: Insights from mathematical modelling. Journal of Imaging, 8(1), 2022.

[8] B. Cessac and D. Matzakou-Karvouniari. The non linear dynamics of retinal waves. Physica D: Nonlinear Phenomena, 439:133436, Nov. 2022.

[9] E. Y. Chen, O. Marre, C. Fisher, G. Schwartz, J. Levy, R. A. da Silviera, and M. Berry. Alert response to motion onset in the retina. Journal of Neuroscience, 33(1):120–132, 2013.

[10] N. P. Cottaris, H. Jiang, X. Ding, B. A. Wandell, and D. H. Brainard. A computational-observer model of spatial contrast sensitivity: Effects of wave-front-based optics, cone-mosaic structure, and inference engine. Journal of Vision, 19(4):8–8, 2019.

[11] R. Deriche. Using Canny's criteria to derive a recursively implemented optimal edge detector. International Journal of Computer Vision, 1(2):167–187, May 1987.

[12] A. Destexhe, Z. F. Mainen, and T. J. Sejnowski. Methods in Neuronal Modeling, chapter Kinetic models of synaptic transmission, pages 1–25. The MIT Press, 1998.

[13] S. ElBoustani and A. Destexhe. A master equation formalism for macroscopic modeling of asynchronous irregular activity states. Neural computation, 21(1):46–100, 2009.

[14] J. Emonet and B. Cessac. The refresh rate of overhead projectors may affect the perception of fast moving objects: a modelling study. working paper or preprint, Apr. 2025.

[15] J. Emonet, S. Souihel, M. Di Volo, A. Destexhe, F. Chavane, and B. Cessac. A chimera model for motion anticipation in the retina and the primary visual cortex. working paper or preprint, Sept. 2024.

[16] J. Emonet, S. Souihel, M. Di Volo, A. Destexhe, F. Chavane, and B. Cessac. A chimera model for motion anticipation in the retina and the primary visual cortex. Neural Computation, 2025.
[17] M.-O. Gewaltig, M. Diesmann, and A. Aertsen. Propagation of cortical synfire activity: survival probability in single trials and stability in the mean. Neural Networks, 14(6):657-673, 2001.

[18] D. Goodman and R. Brette. Brian: a simulator for spiking neural networks in Python. Front. Neuroinform., 5(2), 2008.

[19] A. Hodgkin and A. Huxley. A quantitative description of membrane current and its application to conduction and excitation in nerve. Journal of Physiology, 117:500-544, 1952.

[20] J. Huth, T. Masquelier, and A. Arleo. Convis: A toolbox to fit and simulate filter-based models of early visual processing. Frontiers in Neuroinformatics, 12:9, 2018.

[21] E. Kartsaki, G. Hilgen, E. Sernagor, and B. Cessac. How does the inner retinal network shape the ganglion cells receptive field : a computational study. Neural Computation, 36(6):1041-1083, June 2024.

[22] D. Karvouniari, L. Gil, O. Marre, S. Picaud, and B. Cessac. A biophysical model explains the oscillatory behaviour of immature starburst amacrine cells. Scientific Reports, 9:1859, 2019.

[23] P. Martínez-Cañada, C. Morillas, B. Pino, E. Ros, and F. Pelayo. A computational framework for realistic retina modeling. International Journal of Neural Systems, 26(07), 2016.

[24] Michael Beyeler, Geoffrey M. Boynton, Ione Fine, and Ariel Rokem. pulse2percept: A Python-based simulation framework for bionic vision. In Katy Huff, David Lippa, Dillon Niederhut, and M. Pacer, editors, Proceedings of the 16th Python in Science Conference, pages 81 – 88, 2017.

[25] C. Morris and H. Lecar. Voltage oscillations in the barnacle giant muscle fiber. Biophys J, 35(1):193-213, 1981.

[26] P. Sanz Leon, S. A. Knock, M. M. Woodman, L. Domide, J. Mersmann, A. R. McIntosh, and V. Jirsa. The Virtual Brain: a simulator of primate brain network dynamics. Frontiers in Neuroinformatics, 7, 2013.

[27] H. Sompolinsky, A. Crisanti, and H. Sommers. Chaos in Random Neural Networks. Physical Review Letters, 61(3):259-262, 1988.

[28] S. Souihel. Generic and specific computational principles for visual anticipation of motion trajectories. Phd thesis, Université Nice Côte d'Azur ; EDSTIC, Dec. 2019.

[29] S. Souihel and B. Cessac. Anticipation in the retina and the primary visual cortex : towards an integrated retino-cortical model for motion processing. In ICMNS 2019 - The 5th International Conference on Mathematical NeuroScience, Copenhagen, Denmark, June 2019.
[30] S. Souihel and B. Cessac. On the potential role of lateral connectivity in retinal anticipation. J. Math. Neurosc., 11(3), 2021.

[31] H. Wilson and J. Cowan. A mathematical theory of the functional dynamics of cortical and thalamic nervous tissue. Biological Cybernetics, 13(2):55-80, Sept. 1973.

[32] A. Wohrer, P. Kornprobst, and M. Antonini. Retinal filtering and image reconstruction. Technical Report 6960, INRIA, June 2009.

[33] Y. Zerlaut, S. Chemla, F. Chavane, and A. Destexhe. Modeling mesoscopic cortical dynamics using a mean-field model of conductance-based networks of adaptive exponential integrate-and-fire neurons. Journal of Computational Neuroscience, 2018.

## 8.1 Tables