Matlab magic spells

Most neuroscientists who analyze their data themselves use either Matlab or Python or both – the use of R is much less common than in other fields of biology. I’ve been working with Matlab on a daily basis for >10 years, and I have started using Python regularly, although less frequently, about 5 years ago. I’d like to encourage everybody to learn Python, because the language is much more flexible, more beautiful and more powerful. But still I use Matlab often to get a first impression of data, because it is simply perfect for browsing intermediately sized (MB to GB) datasets and for doing simple things in general, also due to the plotting interfaces which I find are easier to use for data exploration than matplotlib/seaborn in Python.

Here, I would like to share a collection of useful Matlab commands which are not complicated or fancy but still nice to know. Don’t expect too much, and don’t read this if you have spent a couple of years with Matlab already. To be entirely honest, I’m writing this also for my own reference, because I keep forgetting the exact wording of some of the commands, and it’s nice to have everything in a single place. Without further ado, here is my list of favorite Matlab spells:

1. Leading zeros with sprintf()
2. Automatization with dir()
3. Exclude file patterns based on regular expressions
4. Callback functions to speed up image inspection
5. Regionprops for image segmentation
6. The curve fitting toolbox
7. Manually modifying colormap
8. Turning the background of a figure white
9. Make ticks point outwards instead of inwards
10. Rotate x-tick labels
11. Reverse y-axis direction
12. Save large figures to vectorized format (eps)
13. Get raw data from figures
14. Position the figure window at a given screen location
15. Profiling code with tic/toc

Continue reading

Posted in Data analysis | Tagged , , | Leave a comment

Annual report of my intuition about the brain (2019)

How does the brain work and how can we understand it? I want to make it a habit to report some of the thoughts about the brain that marked me most during the past twelve month at the end of each year – with the hope to advance and structure the progress in the part of my understanding of the brain that is not immediately reflected in journal publications. Enjoy the read! And check out previous year-end write-ups: 2018, 2019, 2020.

The purpose of neuronal spikes is not to represent …

It is a common goal of many neuroscientists to “decode” the activity patterns of the brain. But can the brain be simply understood by finding observables like visual objects or hand movements that are correlated with these activity patterns? Nobody would deny that neuronal activity is correlated with sensory inputs, motor outputs or internal states. But what does it help to look at these correlations? In other words, are these representations of sensory, motor or inner world key to understanding the brain? In the following, I will argue against this “representational” view of the brain.

First, what do I mean with “representational”? In the following, a neuron represents e.g. an external stimulus if its activity pattern is correlated with the occurrence of this external stimulus (for a stricter definition, see below). For example, a neuron in visual cortex fires when a drifting grating of a 55° orientation is presented to the animal. One could say that “the neuron codes for 55° drifting gratings” or “the activity of the neuron represents 55° drifting gratings”.

To give another example, a neuron in hippocampal CA1 fires reliably when the animal is at a certain location (“the neuron codes for this and that place” or “the neuron represents this and that place”). This representational view is probably the most intuitive approach when it comes to characterizing the activity of the brain. However, simply representing the internal or external world is not enough. What else does a brain do?

Before trying to answer this question, let’s speculate why the “representational” view is so deeply engrained in systems neuroscience. First, many thinkers and also neuroscientists have been biased towards a view of the brain as a passive receiving device because they have been sitting passively at a desk in front of an empty sheet of paper while shaping their thoughts. Second, the representational view is also very intuitive: finding something that can be observed, like a visual stimulus, to be reflected directly in neuronal activity seems to explain why this neuronal activity happened. Animals or humans subject to brain experiments are often told to hold still while waiting for a stimulus or cue. It is clear from this typical experimental design that it would be more likely to see “receptive fields”, which is a classic finding of representations in the brain, because the experimental design biased the experience of the subject towards passive receiving. Torsten Wiesel and David Hubel, who have pursued this line of thinking in the most compelling way in the early era of neuroscience, are probably the best examples for this approach:

Apart from that, artificial neuronal networks like the attractor networks put forward by John Hopfield and, more recently, deep convolutional networks, are typically based on classification tasks, e.g. to identify written numbers on an envelope, or to correctly categorize the object seen in an image.

For a device that is supposed to perform such a task, it is clearly sufficient to represent the inputs and the possible outputs. But this is not the main task of a brain.

… but to act upon something

The brain, unlike a pattern classifier, is in a closed loop with its environment, being moved by it and acting upon it at the same time. It is not a passive observer, but an involved device, an organism. The brain is not designed to represent its environment. Instead, it has evolved to act upon its environment.

How could a model of the brain account for this fact? An approach to circumvent the limitation of the “representational” view of the brain is to focus on its generative abilities. The brain is clearly capable of forming mental models of the external world, of other minds, of physical laws, and also of abstract concepts. “Predictive processing” is a term covering a variety of models also applied to the level of single neurons. In these models, predictions and prediction errors are not purely representational, but process information as a bi-directional interaction between sensory (bottom-up) and generative (top-down) content. However, these models consists of hierarchical networks that, again, perform classification tasks or other well-known toy problems from the machine learning community. Therefore, these models often appear to be representational models in disguise, rather than something completely different.

A researcher that inspired me to think into a slightly different direction is Romain Brette, who published an opinion article in 2018 called “Is coding a relevant metaphor for the brain?” (In this article, Brette also defines more precisely the meaning of “representations” and its relationship to “coding” and “causality”; but since I do not think there is a semantic agreement among neuroscientists, I decided not to use this more precise terminology here.) Brette’s article is first and foremost an article against the idea of “coding” and “representations” as useful concepts for understanding the brain. Naturally, it is a bit less clear what alternative he is actually suggesting and how this alternative could be implemented or understood. (In a comment to the opinion piece by Brette, Baltieri and Buckley convincingly argue that a set of predictive processing models that use active inference is an interesting alternative to the representative view and is close to the “subjective physics suggested by Brette.) Although some concepts in the opinion article remain a bit vague, Brette also touches upon the idea of understanding neurons not by analyzing their representational properties, but by analyzing their actions, i.e., their spikes:

“[C]oding variables are observables tied to the temporality of experiments, whereas spikes are timed actions that mediate coupling in a distributed dynamical system.” (Romain Brette)

From this paper and from posts on his blog, it seems to me that he is trying to circumvent the natural and historical representational bias of systems neuroscience by investigating systems which are simple and peripheric enough to be amenable to descriptions that are not based on representations, but actions/reactions. One area of his research, which I find particularly interesting, is the study of single-cellular organisms.

The basic unit of life is the single cell

During my PhD, I gradually went from large-scale calcium imaging to single-cell whole-cell recordings. I was fascinated by the complexity of active conductances and the variability between neurons, and as I mentioned in last year’s write-up, I also got interested in complex signal processing in a single neuron.

Therefore, investigating unicellular organisms in order to understand neurons and ultimately the brain was not so far from my intuition anyway. And although neurons do not move their processes a lot and seem to be rather immobile and static at first glance, there are many examples of single-cell organisms that exhibit quite intriguing behaviors and remind us of what single cells are capable of. Just watch this movie of this tear drop-shaped ciliate that uses a single long process to search for food:

And it’s just a single cell! Interestingly, these ciliates not only have an elaborate behavioral repertoire, but also use spikes to trigger these behaviors. (Check out this short review on “Cell Learning” to get an idea about what single-cell organisms are able to learn.)

At least in the beginning of life, the single cell was the basic unit of life, receiving information about the external world, using its own memory and acting upon the world. Of course, many cell types in humans are far more specialized and cannot really be considered a basic unit of life, since they serve a very specific task like forming a part of a muscle or sitting in the germline. However, information-processing cells like cells in the immune system or neurons in the brain, which live at the interface between inputs and outputs of an organism, are much more likely to be similar to these unicellular forms of life. They make most of their decisions on their own, based on local signals, without asking a higher entity what to do.

If we look at life with human eyes, the mind and the human body tell us to search for an understanding of neurons from the perspective of the whole brain (or the whole body). However, if we look at life from a greater distance, life shows its highest richness at the level of single cells, and it would therefore make sense to search for an understanding of neurons from the perspective of a single neuron.

The objective function of a single cell

What does it mean to understand a single cell? A very biologist way would be to make an as complete as possible list of all its behaviors and states when exposed to certain conditions. For example, a hypothetical cell senses a higher concentration of nutrients at one of its distal processes and will therefore move into this direction. Conversely, if it senses a lower concentration in this direction, it will move into the opposite direction. If the nutrient level is overall high, it will not move at all. If it is overall low, it will try to move away in a random direction. This is a biologist’s list of behaviors.

A more compressed and therefore better understanding would be in my opinion to write down the “goals” of this single cell. Or, to abuse an expression by mathematicians and machine learning people, to write down the objective function (or loss function) of the single cell. For the above-mentioned hypothetical cell, this would be simply: move to places with high nutrient concentrations.

If we shift back from ciliates in a pond to neurons in the brain, this leads to a very obvious, but also surprisingly difficult-to-answer question: what is the objective function of a single neuron?

Of course it is not clear whether it is reasonable to assume that the objective function or optimization goal is set on the single-cell level. But given that cognition is most likely a self-organized mess that is only coarsely orchestrated by reward and other feedback mechanisms, I would tend to say: no, it’s not unreasonable. (But check out below for more detailed criticism.)  Therefore, the question is, what are the goals of a single neuron? What does it want?

Let’s assume that this question is a good one. How can it be answered? I see three possible approaches:

  1. To investigate the evolution of self-sustaining cells into neurons of the central nervous system. Since objective functions of uni-cellular organisms seem to be rather accessible and objective functions of neurons seem to be difficult to guess, one could investigate intermediate stages and try to understand the evolutionary development.
  2. To understand the development of the brain and the rules that govern migration and initial wiring of a single neuron. This would possibly allow to make a list of development behaviors for a certain neuronal type and from that extract an objective function. This would be an objective function not of regular operation, but of development. That’s exactly what developmental neurobiology is actually doing.
  3. To observe the full local environment of a neuron (for example, its electrical inputs) and to try to extract rules that govern changes in its behavior (for example, synaptic strength or output spikes)

The third approach is probably the most difficult one because it is currently technically impossible to observe a significant fraction of the inputs of a neuron together with its internal dynamics. There have been many studies on the plasticity of very few synapses in artificial conditions in slices using paired recordings, but it is currently impossible to perform these paired recordings in a behaving animal. Even in slices, these experiments are daunting given the myriad of different neuronal cell types and the expected variability in these experiments. Effects like long-term potentiation, long-term depression, short-term facilitation, short-term depression, spike-timing dependent plasticity, immediate early genes, receptor trafficking and neuromodulatory effects are just some of many processes that are essential to understand what is happening to a single cell.

A different approach that, however, still resonates with the idea of single cells as actors has been put forward by Lansdell and Kording in 2018. Their idea, as I understand it, is that a neuron could try to estimate its own causal effect, that is, the effect of its actions. This is possible because its actions are a discontinuous function of their state, the membrane potential. If external conditions are almost identical in two situations but the neuron fires a spike only in one of the two situations, the neuron could extract from the received input the effect of this single spike. Therefore, the neuron would measure the causal impact of its actions on itself. This idea is very close to that of a unicellular organism that immediately feels the effects of its own actions.

But what could be the objective function of such a neuron? – For example, the goal of a neuron that receives recurrent feedback could be to find a regime of a certain level of recurrent excitation. Recurrence could be measured by estimating the effect of the spikes of the neuron on the received feedback, possibly also in a dendrite-specific manner. I could imagine that objective functions almost simple as that could make a neuronal net work, once it is embedded in a closed-loop environment with sensory input and motor output. Also, I think that this way of thinking could be close to ideas put forward by e.g. Sophie Denève about predictive processing in spike-based balanced recurrent networks (for example, check out this proposal), which heavily relies on the self-organizing properties of adaptive recurrent circuits with a couple of plasticity rules.

An additional strength of the idea to use spikes to measure a neuron’s causal impact is that it could explain why neurons fire stochastically: this way, they acquire information about their causal impact that is hidden in a regime of deterministic firing.


Clearly, these ideas need more refinement and restructuring, and it is obvious that some of the feasible experiments (spike-timing dependent plasticity, behavioral time scale plasticity) have been done already. But I still like the idea of reframing these experiments by analyzing a potential objective function of a single neuron.

Beyong that, it would be interesting to try to understand self-organized systems of artificial neurons that are not governed by global loss functions, but by neuron-intrinsic and possibly evolving objective functions. I’m really looking forward to seeing theoretical work and simulations that do not focus on the behavior and objectives of the whole network, but on the behavior and objectives of single units, of single cells.


Unicellular organisms and neurons are both single cells. Left: Unicellular ciliate lacrymaria olor, adapted from Wikicommons (CC 2.0). Right: Two-photon image of hippocampal pyramidal neurons in mice.

Appendix: the devil’s advocate

Criticism 1: Representations and coding seem to be still the best way to think about neuronal activity

Although I find the ideas above appealing conceptually, it is clear from past research that most of our understanding of the brain comes from correlating the observed brain activity with sensory or motor information, because it allows to conclude when certain brain areas or neuronal types are active and what happens if they fail. This functional anatomy of the brain might not reveal all the design principles of the brain, but it could be necessary to make an educated guess about those principles.

In addition, our human languages are based on concepts (“you”, “house”, “hope”, “cold”) rather than on dynamical processes. For example, the science of language, linguistics, has coined the term ‘signified’ which describes the content of such a concept as a central element of language. From this converging view from both naive usage and scientific study of languages, it seems to me likely that high- and low-level representations indeed exist and are accessible in the human mind – probably as an evolutionary byproduct of mental processes that were more directly connected to actions or sensation. – It is still interesting that some sensory modalities are more vaguely represented in thought and language (olfaction) than others (vision).

Criticism 2: It is so far technically impossible to record the perspective of a single neuron

It seems to be relatively easy, although not trivial, to monitor a unicellular ciliate and its environment. However, the environment of a neuron consists of all of its synaptic partners, which can be in the range of thousands, and any other source of electrical or chemical neuromodulation. A single neuron itself is widespread over such a large volume that is very far from being amenable to any electrophysiological or imaging technique that provides sufficient resolution in time and space.

The best candidate technique, voltage imaging of both soma and dendrites, cannot be used over periods longer than minutes due to bleaching, suffers from low signal-to-noise as well as difficult calibration and requires imaging speeds and photon yields that are impossible to achieve with any imaging technique and fluorescence sensor that I know of.

But researchers have proved before that imperfect methods can be used successfully. I’m curious about all technical developments and what they will bring.

Criticism 3: Regarding neurons as actors is a case of anthropomorphism and ignores the interactions in complex systems that can lead to emergence

If I scrutinize my own ideas, I realize that one reason why I like the idea of neurons as actors is that this idea is simple and connects to the human desire to have an intuitive, empathic understanding of things. For example, we tend to personify even the smallest animals like ants, bees or ciliates in movies, children books or youtube videos. We tend to personify items of our personal households like a cup, a table, or an old house; or our plants in the garden; or the ocean, the wind, a dead tree. On the other hand, I feel that we are largely unable to feel the same empathy with distributed systems like the mycelium of a mushroom that spreads over kilometers in a forest, or the distributed power supply grid, or a large fish swarm, or a deep artificial neuronal network. We can feel amazement, but no empathy. I can imagine to be single water molecule that vibrates, rotates and is tossed around by the Brownian motion of the environment and by the convection of the ocean, but I cannot imagine to be the emergent phenomenon of water waves breaking at the shoreline which are the complex environment of this single water particle.

I think that there is a tendency in human thinking to avoid complexity and to impose a simple human-like personality onto all actors. Therefore, we should observe ourselves and try to avoid our tendency to personify parts of complex systems when they actually cannot be disentangled from their environment. It is easy to tell a story about specific neurons as important actors and what they want to do and how they feel immediate feedback of their actions like we do when seizing an apple, but it is difficult to tell a story about complexity, which is over the top of our heads. But maybe this, which we can hardly understand, is the truth, and this is good to keep in mind.

Posted in Calcium Imaging, Data analysis, electrophysiology, machine learning, Network analysis, Neuronal activity, Review | Tagged , , , , , , , | 8 Comments

A practical guide for adaptive optics

There is no standard curriculum to learn practical procedures about microscopy: how to align a setup, how to identify misalignments, how to identify broken parts, where to buy components, how to check their performance, and much more. How to learn all of this?

Often, research papers contain close to zero information about these topics, and even if they do, the information is scattered in the methods sections or supplementary information. This is not a surprise since papers are mostly expected to be “research” and not engineering manuals or step-by-step protocols. This makes some papers quite impressive, but close to useless from a practical perspective.

Therefore, the most useful practical information about microscope construction and maintenance can be found in sources other than papers. Some examples:

  • On labrigger and other blogs (including my blog), useful but sometimes a bit anecdotal information is distributed over many pages, making it available via search machines.
  • A nice tutorial on alignment by Rainer Heintzmann can be found in the web – it’s an appendix to a book, but clearly more widely shared than the book itself.
  • Some projects, like the mesoSPIM project (by my labmate Fabian Voigt), provide a lot of useful practical information via dedicated websites or Github repositories.
  • Andrew York took advantage of his independence to provide less formal work-in-progress publications via Github, which allowed to focus more on practical and useful information, instead of trying to prove novelty and impact with beautiful figures.

These webpages are more flexible than PDF papers, can be easily updated and enhanced and allow for simple integration of animations or interactive elements. Since the webpage does not need to convince editors and reviewers with polished writing and impressive claims, it allows for more practical information to slip in.

Recently, I discovered another project that goes into a similar direction, initiated by the lab of Martin Booth, on the topic of adaptive optics. As the authors describe it themselves:

“The documents posted here will include tutorials, experimental protocols, and software. This will range from simple hints and tips through to extensive documentation of procedures. We intend to post material whenever it is ready, and documents will be updated with newer versions when we have them. We chose to set up the site in this way, to be free from the constraints of the traditional publishing process, which is ill-suited to the dissemination of this type of material, particularly when content could be frequently updated as our own approaches develop.” –

I really enjoyed the protocols uploaded so far. For example, despite quite some experience with microscopes, I have never aligned a confocal pinhole so far, and I found it interesting to read the instructions on how to do this, even though it’s a very simple procedure. I’m really looking forward to seeing this form of resource becoming more frequently used and also appreciated not only by other researchers, but also by funding sources.

Of course, all of this does not replace the best source for practical training in microscopy: doing it yourself, spending a lot of time solving problems – and having somebody in the lab who knows everything.

Posted in Imaging, Microscopy | Tagged , , | 1 Comment

Review: An artificial ground truth for calcium imaging

Selected paper: Charles, Song, Tank et al., Neural Anatomy and Optical Microscopy Simulation (NAOMi) for evaluating calcium imaging methods, bioRxiv (2019).

What is the paper about? Calcium imaging is a central method to observe neuronal activity in the brain of animal models. Many labs use rather complicated algorithms to extract meaningful information from these imaging data, but the results of those algorithms are often hard to judge: is this an artifact of the algorithm or the imaging method, or is it a biologically meaningful signal of a single neuron? The paper by Charles et al. addresses this question by simulating both neuronal activity in anatomically realistic neurons and the imaging process that makes these activity patterns visible. By knowing both the true simulated biological signals and the simulated imaging data, the procedure can benchmark analysis algorithms against a known ground truth. In addition, the method can be used to evaluate imaging modalities and their impact on resolution, movement artifacts and other factors for a specific use case.

More details: Neurons are simulated as realistic 3D structures with dendrites and axons, based on 3D EM and light microscopy data of neuronal tissue. Their activity is simulated as spikes. The spikes are transformed into slower calcium events, which in turn are transformed by the binding kinetics of the calcium indicator. Binding to the calcium indicator gives rise to a change in fluorescence, based on the Hill model of cooperative binding. Then, things are brought together by simulating the excitation laser beam and the light emitted by the fluorescent calcium sensors, assuming a typical signal to noise level and shot noise induced by the limited number of photons seen by the microscope. Altogether, this is a quite impressive simulation pipeline, covering anatomy, calcium sensors and binding kinetics as well as light simulation and relevant noise induced by instruments and other variables (for example, residual artifacts induced by the motion of the animal).

Evaluating demixing algorithms: In my opinion, the most interesting part of the paper is section 2.3 (“Evaluation of automated segmentation”). Here, the authors use their simulations to benchmark three commonly used algorithms for automated source extraction. These algorithms are used to automatically extract regions of interest (ROIs) from an imaging dataset, and are often used as a repeatable and hopefully more objective and more reliable replacement of the manual drawing of ROIs by a human being. Unfortunately, the authors do not benchmark those methods also against a human expert who manually selects ROIs.
Anyway, with respect to the three state-of-the-art algorithms, the evaluation using the calcium imaging simulations reveals a rather limited precision of all investigated methods. First, the different algorithms find rather different sets of neuronal activity units with relatively little overlap between the units found by each algorithm. In addition, also the absolute number of units found by each algorithm is quite variable (for a specific simulation of L2/3 imaging in visual cortex, the number of found components varies between 265 and 1091 for the different algorithms). More details can be found in the relevant section in the paper.
These are interesting findings. They do not disqualify demixing algorithms, but they should lower our trust that the large majority of the extracted components is based on activity signals of single neurons.

The devil’s advocate: The strength of the simulation in this paper (its realism) is also its weakness. The authors themselves state:

“Simulation-based approaches, however, often suffer from being either too simple or too complex.”

How can we be sure that they have found exactly the right level of detail? We can’t, or not very easily. There is an endless list of possible details which could have been omitted: For example, the calcium indicator concentration was set to 10 μM for the simulations, but these values might differ between neuronal types and depend on other factors as well. To give another example, the simulation assumes that the calcium concentration is constant across the dendritic tree, therefore omitting the known effect of localized calcium dynamics in dendritic spines.
And there are many more approximations (optics, physiology, anatomy) made by the authors that are difficult to judge. For example, I would have been glad to see a simulated excitation PSF at a certain tissue depth alongside with a measured PSF at the same depth (e.g., using beads injected into cortex), to make sure that the scattering simulation, which is too complex to be judged without investing a lot of time, is realistic or not. – However, these are details, and for most of the analyses performed by the paper (like the discussion of demixing algorithms), this level of detail of the simulation is probably not important – and I’m looking really forward to having this simulation tool publicly available. If it is user-friendly and easy to adapt, it could become a standard tool to check in silico what to expect for in vivo experiments.

Conclusion: Very interesting and possibly useful work, although it is difficult to understand the limitations and details of the simulation.

Further reading: A paper from he same lab on a related topic: Gauthier, J. L., Tank, D. W., Pillow, J. W. & Charles, A. S. Detecting and Correcting False Transients in Calcium Time-trace Inference.

Other paper reviews on this blog: on precise balance in the hippocampus [1]; on L5 apical dendrites [2].

Posted in Calcium Imaging, Data analysis, Imaging, Microscopy, Neuronal activity, Reviews | Tagged , , , , | 2 Comments

The cell-attached soundtrack of calcium imaging

Old-school electrophysiologists like to listen to the ephys signals during experiments. For example, this allows to precisely hear when the patch pipette approaches a target neuron. The technique is discussed in the Axon Guide: “Audio Monitor: Friend or Foe?”.

The following is something very similar: Calcium imaging of neuronal activity (GCaMP6f), and an audio track that is derived from a simultaneously performed cell-attached recording of the same neuron (detected action potentials are convolved with a particular sound event, like two metals hitting each other, the sound of an anvil, and the sound of gunshots – the “firing” neuron).

Three times the same calcium recording, but with different soundtracks:

CC-BY 3.0,

CC-BY 3.0,

CC-BY 3.0,

Posted in Calcium Imaging, electrophysiology, Imaging, Neuronal activity, zebrafish | Tagged , , , | Leave a comment

Post-publication review: Somato-dendritic coupling of L5 neurons in V1

It requires more than a quick look at the abstract and the figures to fully understand a research paper and its limitations. One way to get there is to write a summary or critical review of a paper. In a contribution to (informal) post-publication review, I will select neuroscience papers that are, in my opinion, worth the time needed to write up a review. other reviews: On precise balance in the hippocampus [1]; on simulations of calcium imaging datasets [3].

Selected papers:

1. Beaulieu-Laroche, Harnett et al., Widespread and Highly Correlated Somato-dendriticActivity in Cortical Layer 5 Neurons, Neuron (2019)

2. Francioni and Rochefort, High somato-dendritic coupling ofV1layer 5 neurons independent of behavioural state and visual stimulation, bioRxiv (2019)

L5 neuron

Simplified scheme of a L5 pyramidal neuron. From Wikipedia, used under CC BY 4.0 license (modified).

What are the papers about? The mammalian cortex is a layered structure that harbors different neuronal types in different layers. One of the most prevalent and most fascinating neuronal types is the layer 5 (L5) pyramidal neuron (schematic drawing above). While the cell body resides deep in layer 5, several hundred micrometers below the surface, it sends a so-called ‘apical trunk’ dendrite up to superficial layers, where it branches into a so-called ‘apical tuft’. The apical tuft receives input which is fundamentally different from input received at the soma. This, together with the long distance between apical tuft and soma, poses a simple, but difficult-to-answer question: how tightly are electrical activity at the soma, the apical trunk and the apical tuft coupled, and how do the electrical compartments interact? The two papers address exactly this question. – Their main finding is that calcium activity at the soma and the apical dendrite are very tightly coupled, no matter what happens to the mouse.

Why this question is important: Six months ago, I wrote a blog post which explained why it would be so interesting to see uncoupled activity of soma and the apical dendrite. Several studies reported – using indirect methods – that there was strong uncoupling happening during sleep or motor learning, but the few studies working on this topic that used direct methods have rather shown tight coupling between apical and somatic activity (Helmchen et al., 1999; Kerlin et al., 2018), with only few outlier events.

These two papers try to address this question again, in a different brain region, in various behavioral conditions, and probably more systematically and in a more targeted way than previous studies.

The method: Both teams performed simultaneous calcium imaging in two optical layers from L5 neurons in the primary visual cortex (V1) of transgenic GCaMP6 mice. The two layers covered either soma and apical trunk, or apical trunk and apical tuft.

Calcium does only partially reflect the electric events that happen in the respective location. Calcium events are an imperfect, non-linear and supra-threshold mirror of electrical activity, and, in addition, there are calcium events independent of electrical activity. Still, calcium imaging is the best available method to investigate somato-dendritic coupling, since theoretically better-suited methods (dendritic patching, voltage imaging) do not work reliably in awake animals for now.

I also would like to highlight the section “Limitations of the use of calcium imaging to assess dendritic activity in awake behaving mice” from the Francioni and Rochefort paper, which discusses in a bit more detail the challenges for dendritic calcium imaging. I think it is a very good idea to include this part in the main paper and not in the methods section, because this is an experiment that requires careful analysis due to motion artifacts, unwanted signal from spines or axonal boutons, imperfect calcium indicators and other problems.

Paper 1 (Harnett lab): The main result of the Beaulieu-Laroche et al. paper is that somatic activity and activity measured in the distal apical trunk (distance between dendritic and somatic regions: ca. 350 μm) are strongly correlated in V1. One would expect that this tight coupling becomes loose when the dendritic tree is bombarded by more input. Surprisingly, however, they find that this tight coupling is independent of visual stimulation or whether the mouse is running or sitting still.

I haven’t talked to the authors, but from this exploratory study design, which tested different conditions (visual input vs. no black screen, running vs. pausing), I would guess that they were hoping to see a behavioral regime where the tight somato-dendritic coupling breaks down, due to strong excitatory apical inputs, due to a modulation of the leakiness of the apical trunk, due to shunting inhibition or another weird phenomenon on the molecular level. The fact that nothing of this happens seems a bit disappointing from the perspective of the study director.

To better understand these calcium imaging measurements, the authors performed calibration experiments in vitro (slices), where they measured both calcium signals in somata and dendrites and patched the respective locations with micropipettes to record the electrical signals. Somehow, the whole-cell recordings did not wash out the GCaMP from the neurons (Fig. S3), which was a bit surprising to me. Using these slice experiments, they conclude that the high somato-dendritic correlations are either due to burst-firing somata that trigger (active) dendritic electrogenesis, or due to dendritic spikes that elicit somatic firing. The authors are unfortunately unable to discern these two possibilities.

To make things a bit more complex, a side-figure shows that single L5 spikes are not seen using the GCaMP6f reporter (but are seen using an OGB-1 calcium dye, see Fig. S3G,H). The authors find that single somatic L5 spikes also do not trigger dendritic electrogenesis, which seems to explain that the calcium signal is correlated also in this regime of single spikes. Indirectly, this suggests that there is no tight coupling of calcium activity between soma and apical dendrite if there is only one somatic spike.

Paper 2 (Rochefort lab): Francioni and Rochefort perform similar calcium imaging experiments. Due to technical reasons (using a piezo instead of a tunable lens), their two imaging planes are closer to each other (<200 μm). As a main result, the authors come to the conclusion that calcium activity is highly correlated not only between soma and (proximal) apical trunk, but also between the proximal and distal trunk and between distal trunk and the apical tuft; and also between processes within a single apical tuft. Including not only the apical trunk but also the apical tuft is an important extension compared to the paper from the Harnett lab. As another difference, they use for some of their experiments GCaMP6s instead of GCaMP6f to have a more sensitive readout of somatic activity.

Very similar to Beaulieu-Laroche et al., Francioni and Rochefort report that this tight somato-dendritic coupling is not affected by visual stimulation or by locomotion, also for the apical tuft. Actually, they report that “less than 3% of the total number of transients” were branch-specific, and that those few events were mostly low-amplitude signals.

The authors then analyze the data more carefully and find that quite some calcium events that can be seen in the soma do not propagate into the apical trunk, and many events in the apical trunk do not propagate into the apical tuft. They quantify the overall loss from somatic activity to the dendritic tuft to ca. 40%. In my opinion, this suggests that most of the calcium activity is generated first in the soma and then propagates into the apical compartment, where it is (according to Beaulieu-Laroche et al.) amplified by active conductances, but not always (as seen by Francioni and Rochefort). One remaining question is why the attenuation from soma to apical trunk has not also been observed by Beaulieu-Laroche et al., but this is probably due to technical reasons, for example the calcium indicator.

Consequences for understanding the role of apical dendrites: During the last 20 years, many people, in particular neuroscientists coming from slice physiology or from theory, have speculated about active roles of dendrites and the computational independence of dendritic segments. Although these two studies (hopefully) are only the beginning of more detailed research covering other brain regions and other behavioral conditions with similar methodological approaches, the findings seem to dampen the enthusiasm about dendritic processing a bit.

Francioni and Rochefort make it very clear, that “this result is consistent with two possible mechanisms: either (1) global apical tuft activation systematically triggers somatic action potentials, or (2) global tuft calcium transients are triggered by back-propagating action potentials alone or in conjunction with tuft synaptic inputs.”

Both options would be possible. In my opinion, however, their paper points rather towards the second option. First, they see that 40% of somatic events do not make it to the apical tuft; these are very likely back-propagating action potentials that get stuck in the middle of their journey in the apical dendrite. Second, given that they do not see the other phenomenon prominently (dendritic events that do not make it to the soma, <3% of events), it seems very likely that a very large fraction of all dendritic events are evoked by back-propagating action potentials.

This suggests a (to-be-confirmed) picture of L5 pyramidal neurons that are driven by basal instead of apical inputs. This is consistent with recent experiments that micro-dissected the dendritic tree, although of L2/3 neurons (Park, Papoutsi et al., bioRxiv, 2019). Somatic spikes would then propagate into the apical tree and, if elicited at high-enough frequency, recruit active dendritic sodium and calcium channels. The activation of the dendritic conductances could in addition depend on local apical input and play several roles, for example: 1) enhancement of the somatic spikes (bursting), 2) triggering of synaptic weight changes in the apical dendrite, 3) triggering of transmitter release to signal from apical locations to their respective pre-synapse. However, it would be unlikely that apical input by itself generates a calcium spike that activates the soma.

Conclusion: The studies by Francioni and Rochefort and Beaulieu-Laroche et al. contribute a lot to a better understanding of the function of apical dendrites of L5 pyramidal neurons. Even though the main result might seem like a partial disappointment at first glance, this kind of systematic study (instead of a study strongly driven by an hypothesis) seems to be the right thing to me. And more of the same, with different behavioral conditions, other cortical regions and possibly a more detailed analysis of the rare dendritic events seems to be the way to go. These two very interesting studies provide important information about somato-dendritic coupling, but the apical dendrite of L5 neurons still largely remains mysterious.

Posted in Calcium Imaging, electrophysiology, Microscopy, Reviews | Tagged , , , | 3 Comments

Post-publication review: “Precise excitation-inhibition balance controls gain and timing in the hippocampus”

It requires more than a quick look at the abstract and the figures to fully understand a research paper and its limitations. One way to go there is to write a summary or critical review of a paper. In a contribution to (informal) post-publication review, I will select neuroscience papers that are, in my opinion, worth the time needed to write up a review. On L5 apical dendrites [2]; on simulations of calcium imaging datasets [3].

Title: Bhatia et al., Precise excitation-inhibition balance controls gain and timing in the hippocampus, eLife (2019).

Target audience: Theoretical neuroscientists working on balanced networks and the role of inhibition; people working on the CA3 to CA1 feedforward circuit in hippocampus; people working on rules governing the connectivity of inhibitory interneurons; people interested in codes dependent on precise spike timing.

Why I chose this paper: I have worked on a similar topic at the interface of theoretical and experimental neuroscience, the so-called ‘precise balance of excitation and inhibition’ (Rupprecht and Friedrich, Neuron (2018)). Of course I’m interested what other experimental studies have found out about this important, although not very easily accessible concept.


From Bhatia et al., eLife (2019), used under CC BY 4.0 license (modified from Fig. 1).

Summary: The authors use a slice preparation to dissect the feedforward circuit from CA3 to CA1 in the mouse hippocampus (figure above; left part).

Two main findings.

The first finding (‘detailed balance’): They stimulate CA3 that expresses channelrhodopsin with an artificial set of patterned light stimuli (figure above; lower left and right parts). Then, they use whole-cell recordings to measure inhibitory and excitatory currents in single neurons in CA1. They find that even for very weak stimuli that presumably elicit few or even single action potentials only in CA3, an inhibitory current is evoked in CA1. Moreover, and even more interesting, the size of this inhibitory current matches the excitatory current not only on average, but also for individual stimuli. This feature has been termed ‘detailed balance’ by theoretical neuroscientists.


From Bhatia et al., eLife (2019), used under CC BY 4.0 license (modified from Fig. 2).

The second main finding: The balanced inputs as recorded with voltage-clamp end up, however, in a non-linear integration as observed with current-clamp recordings. In particular, the authors observe a supra-linear relationship which they describe as ‘subthreshold divisive normalization’. In addition, they notice that inhibition kicks in faster in the CA3 neuron when the excitatory (and inhibitory) inputs to the CA3 neuron are stronger. They use this finding and simulations to support the idea that the reduction of inhibitory delays is the underlying cause of the observed divisive normalization.

In the following, I will only discuss the first finding. The second finding is already broadly discussed in the paper and also by the reviews (which are partly accessible, thanks to eLife!). In general, I find the first finding (detailed balance) much more interesting, whereas the main focus of the paper is on the second finding.

Consequences of a detailed balance: A detailed balance in this feedforward path from CA3 to CA1 is something unexpected, because it would require very specific feedforward connectivity of interneurons matching the feedforward connectivity of excitatory connections. Importantly, the authors put this in the context of previous work on CA1, which found that almost any CA1 cell can be converted into a place cell for any spatial location:

“Precisely balanced networks, with all input subsets balanced, are well suited for input gating (Barron et al., 2017; Hennequin et al., 2017). The finding that most silent CA1 cells can be converted to place cells for arbitrary locations predicts the existence of an input gating mechanism (Lee et al., 2012), but the nature of this mechanism remains unknown. One prediction of precise balance is that inputs for multiple potential place fields may be balanced, and hence place field activity is gated ‘off’. Evoked depolarizations (Lee et al., 2012) or dendritic plateau potentials (Bittner et al., 2015; Bittner et al., 2017), which potentiate the subset of active synapses, that is, change the I/E ratio (Grienberger et al., 2017), can flip the gate ‘on’, thereby converting a silent cell to a place cell for that specific place field”, write Bhatia et al., eLife (2019).

The devil’s advocate: Detailed balanced means, as mentioned before, that the size of an inhibitory current matches the excitatory current not only on average, but for individual stimuli. It is important, as I have described in my own experimental work (Rupprecht et al., Neuron (2018)), that this statement of a detailed balance can only be made if the different individual stimuli are equally strong.

It is therefore not a good idea to assess detailed balance by pooling over all stimuli with 1, 3, 5, 7 and 9 squares of optogenetic activation. Instead, one should compare within a set of stimuli with e.g. 1 square. This is done, as far as I understand it, only in Fig. 2h (example shown for a single neuron) and, based on a current-clamp dataset, in Fig. 2/Supplement 2e-f. It would have been interesting to analyze this aspect in more depth.

More importantly, even when analyzing e.g. only stimuli that all of them correspond to the stimulation of one “square” with photoactivation, this does not mean that all those stimuli are equally strong – which seems to be asssumed in the modeling part (Fig. 2/Supplement 2i,k). As I understand it, the most parsimonious explanation of the data would not be a detailed balance of excitatory and inhibitory inputs in this feedforward circuit, but a distribution of activation strengths for each stimulus set.

For example, stimulation of grid position 3 may overall result in 17 action potentials in CA3, whereas stimulation of grid position 7 may result in 55 action potentials and grid position 9 in zero action potentials. Feedforward inhibition could then simply integrate all action potentials in CA3 and send out a global signal proportional to this number. Indeed, even a single interneuron could, in theory, do this job. Therefore, it seems that the results can be explained by simple and plausible assumptions that do not require detailed balance. Altogether, I think that the paper provides some evidence for a detailed balance in the CA3 to CA1 feedforward circuit, but given the unexpectedness of this result, the evidence is a bit too weak to make me believe the conclusion entirely.

To fully test for a detailed balance, one could try to further analyze the existing data. However, a more direct way to test it would be much more convincing. This could be done by stimulation of CA3 and recording currents in CA1 as before, but at the same time recording the precise number of action potentials elicited in CA3 neurons. The best and maybe only reliable way to do so would be to perform paired recordings, with one (or more) neuron(s) patched in CA3 that are triggered to fire a given number of action potentials, while recording from one (or more) neuron(s) in CA1 in voltage-clamp. This would require considerably more work and result in much lower throughput than the opto-activation experiments, but would allow to address the question of a detailed balance directly and with higher precision.

Conclusion: Overall, I liked the study because it uses experiments to address an important question from theoretical neuroscience. The finding of a balance of excitation and inhibition in CA1 even for (presumably) very few spikes elicited in CA3 is an interesting and unexpected finding which is clearly supported by the data. I’m a bit less convinced about the evidence that this balance is also detailed. However, this does not affect anything of the remaining paper (which constitutes its main part). This main part investigates the supra-linear summation of inputs and the information contained in the timing of inputs (which I do not want to discuss here in any detail).

More context: What is detailed and precise balance? Hennequin et al., Annual Review of Neuroscience (2017). – A broadly accessible explanation of the supra-linear summation presented in the paper: NCBS News.

Posted in electrophysiology, Neuronal activity, Reviews | Tagged , , , | 2 Comments

Photon yield and pulse dispersion

This blog post serves as a link to a case report about the debugging of a two-photon microscope which showed a too low fluorescence yield. With the help of the internet, I singled down the cause of the problem to the dispersion of the femtosecond pulses by dielectric mirrors in the microscope. The lessons learned from that have been summarized before on Labrigger’s blog (also check out the comments!).

However, I think it makes sense to report this debugging attempt in a bit more detail, and probably there are two-photon microscope users who are keen on understanding more about the technical details and could profit from such a technical report. It includes not only nice pictures, but also several useful lessons that can be learned from that, some obvious or well-known, others not so much.


I used this occasion to try out a Github-based publication template provided by Andrew York. This template is written in a publication-like style, but in HTML, which allows to take advantage of some degree of interactivity and the embedding of web-links. The advantages compared to purely pdf-based publications are obvious; platforms like show, although limited to the field of machine learning, how the future of publishing could look like: interactive, open, possibly based on web interfaces instead of a focus on print.

For me, using this template was an attempt to familiarize myself with this sort of publishing, and to test how difficult is to use such a template. I hope you enjoy the read:

Pulse dispersion, dielectric mirrors and fluorescence yield: A case report of a two-photon microscope.

Posted in Calcium Imaging, Imaging, Microscopy | Tagged , , , | 3 Comments

The power of correlation functions

During my physics studies, I got to know several mathematical tools that turned out to be extremely useful to describe the world and to analyze data, for example vector calculus, fourier analysis or differential equations. Another tool that I find particularly useful for my current work as a neuroscientist and which is, however, rarely mentioned explicitly are correlation functions. In the following, I will try to give an intuition of the power of correlation functions using a couple of examples.

.What are correlation functions?

To put it in very simple terms, a correlation coefficient measures how similar two signals (A and B) are after being normalized. Different from correlation coefficients, correlation functions are not single values, but functions of two input signals A and B. This can be a correlation function C_{AB} of a time lag, C_{AB}(\tau), or of a distance in space, C_{AB}(\Delta x) . The correlation function at a time lag or distance of zero, recovers the correlation coefficient, C_{AB}(0), except for a normalizing factor.

The value of a correlation function at a given value of \tau or \Delta x indicates how similar the two input signals A and B are when one of the signals is shifted in time by \tau or in space by \Delta x.

To make the result of this operation more clear, here are two simple examples, with signals A(t) (black) and B(t) (gray) as noisy sine waves that are in phase (left) or out of phase (right):


While the cross-correlation function peaks at a time lag of \tau = 0 for the synchronous case, the peak is shifted to \tau \neq 0 for the out-of-phase case. The value at a time lag of 0 is proportional to the correlation coefficient: a high value for the left side, a value close to zero for the right hand side. Also note that the correlation function used averaging over the full signal duration to get rid of the noise.

Computing the correlation function C_{AB} in Matlab or Python

Computing the correlation function is actually straightforward in Matlab or Python.


A = rand(1000,1);
B = rand(1000,1);
C = xcorr(A,B,'unbiased');


import numpy as np
A = np.random.norm(0,1,1000)
B = np.random.norm(0,1,1000)
C = np.correlate(A,B,'full')


import scipy.signal as signal
C = signal.correlate(A,B)

It is a good but a bit tedious exercise to write one’s own cross correlation function in a basic programming language. Usually the normalization at some point can cause headaches.

1. Spatial correlation functions for image registration

In microscopy, there’s often the problem to map two images onto each other. The following examples are two average images of the same brain region, recorded at different time points and therefore shifted meanwhile due to drift. I included a horizontal line for orientation:


To find out the drift, we can use correlation functions, measuring the similarity of the two images for all possible shifts, with the result that the shift in x-direction is 0 pixels, whereas the shift in y-direction is 4 pixels (here in Matlab):

movie_AVG1; % average image 1
movie_AVG2; % average image 2
result_conv = fftshift(real(ifft2(conj(fft2(movie_AVG1)).*fft2(movie_AVG2))));
[y,x] = find(result_conv == max(result_conv(:)));
shift_y = y - ( size(movie_AVG1,1)/2 + 1 )
shift_x = x - ( size(movie_AVG2,2)/2 + 1 )

Here, I calculated the correlation function using fast fourier transforms, taking advantage of a simple mathematical property of correlation functions. I could also have done the same computation with the built-in function xcorr2(movie_AVG1,movieAVG2) in Matlab, which is however much slower and requires subtraction of the respective mean from the images.

Similar algorithms are used for most image registration functions in ImageJ, Python or Matlab.

2. Local spatial correlation functions for particle image velocimetry

To go one step further, one can also compute a local instead of a global shift, for example if there are any deformations of the images that result in local deformation fields.

A more interesting application of the same principle of local deformations is a method referred to as particle image velocimetry (PIV), which has been developed in the field of experimental fluid mechanics. Using a sequence of images, correlation functions are used to extract local flow fields, as well as sinks and sources of the observed transport phenomenon. Here is, from work for my Diploma thesis, an example movie of a one-cell C. elegans embryo just before the first cell division, observed using DIC microscopy. I used the granular stuff in the cytoplasm to track the cytosolic flow patterns using PIV (with the toolbox PIVlab). The overlaid yellow arrows indicate the (wildly changing) direction of the local cytosolic flow field:


3. Temporal cross-correlation functions

One of most fascinating usages of cross-correlation functions for analysis of experimental data is for fluorescence cross-correlation spectroscopy (FCCS), or its more commonly used simpler version, fluorescence correlation spectroscopy (FCS), the latter of which is based on auto-correlation instead of cross-correlation functions.

Peri-stimulus time histograms (PSTHs) are a much more basic analysis tool that is commonly used by electrophysiologists to quantify the occurrence of a quantity triggered by certain events. Sometimes, events as ill-defined as the crests of an oscillatory signal are used as a trigger for a PSTH. Using correlation functions gets rid of this mess by measuring how much a quantity is affected depending on the quantitative history of the trigger signal.

In electrophysiologal work published in 2018, I used correlation functions to measure the phase relationship between an oscillatory local field potential (LFP) signal and an oscillatory component in a simultaneous whole-cell recording (for details, check out a part of figure 7 in the paper):


4. Autocorrelation functions for time series analysis

Auto-correlation functions are not only a tool for non-intuitive experimental methods like FCS, but also perfect to quantify periodicities in a time series. For example, if there is an oscillatory behavior in a swim pattern of a fish, in the firing of a neuron or in the spatial density of clouds, autocorrelations can easily quantify this periodicity.

Here is an example, again from an LFP recording. On the left, the signal seems clearly oscillatory, but how can we properly quantify the oscillatory period? We use an auto-correlation function, and the peak at around 40 ms in the plot on the right clearly indicates the oscillatory period (black arrow):


Correlation functions in physics

If you find the above examples interesting and want to understand what correlation functions can be used for, it could be a good idea to dive into physics, where correlation functions are all over the place:

In addition, the mathematical aspects of correlation functions are quite rewarding to explore, for example the intimate relationship between auto-correlation functions and power spectra.

As another interesting use of auto-correlation functions, the fluctuation-dissipation theorem gives an idea how spontaneous fluctuations of a system close to thermodynamical equilibrium can predict the linear response of the system towards external perturbations. It’s a bit discouraging for biologists to understand that this theorem can hardly be applied to biological systems, which live far from thermodynamic equilibrium and which show responses that are rarely linear.

Still, it is amazing to see what physics can do with correlation functions and how powerful correlation functions are at extracting precise measurements from sometimes very noisy data.

Posted in Calcium Imaging, Data analysis, electrophysiology | Tagged , , , , | 4 Comments

Annual report of my intuition about the brain

There are not many incentives for young neuroscientists to think aloud about big questions. Due to lack both of knowledge and authority, discussing very broad questions like how the brain works risks to be embarrassing at best. Still, I feel that not doing so is even more detrimental since it restrains the potential for internal development: Exposing one’s thoughts comes with the potential to refine them and to dissociate from them, thereby bringing down or advancing ideas that might have got stuck.
I want to make it a habit to report some of the thoughts about the brain that marked me most during the past twelve month at the end of each year, with the hope to advance and structure the progress in the part of my understanding of the brain which is not immediately reflected in journal publications. Other year-end write-ups: 2018, 2019, 2020.

How I got interested in dendrites

The lines of thought described in the following actually go back as far as to 2015. I was planning to switch from calcium imaging to whole-cell recordings as my main laboratory technique and started understanding the power of studies relying on this technique. In summer 2015, I came across a paper by Katie Bittner in Jeff Magee’s lab [1] (followed up by another paper [2]). Those papers showed that electrical “plateau potentials” can drive the formation of a place cell within a single trial. The authors established in vivo whole-cell recordings deep in the CA1 region of the hippocampus. Using this technique, they could generate plateau potentials by somatic current injection and thereby trigger the generation of a place field. As probably many others, I was immediately struck by this single-shot learning behavior, but, also due to lack of background knowledge, I was not yet able to see it in a larger context.

Later, when I was searching for potential postdoc positions in 2018, I first fully encountered the mystery of the apical dendrites of pyramidal neurons. Pyramidal neurons in layer 5 of the mammalian cortex grow from their soma a “basal” dendritic tree that remains rather local in layer 5, and in addition a thick “apical” trunk that goes up to layer 1, where it branches into many small apical dendritic processes (the apical “tuft”).

I was particularly intrigued by a review by Matthew Larkum from 2013 suggesting a specific function for the apical tuft of L5 neurons. This suggested function would be to detect almost coincident somatic activity and strong input to apical dendrites, resulting in a calcium spike in the apical trunk and leading to somatic bursting [3].

Problem 1: Top-down input to the apical dendrites of pyramidal neurons

Apical dendrites of L5 neurons are thought to receive mainly top-down input, whereas the basal dendrites are predominantly contacted by bottom-up input. For example, basal dendrites of the primary visual cortex would be expected to receive more sensory input from the primary thalamic region, whereas apical dendritic processes would receive rather context-related input from brain regions higher in the sensory hierarchy. I do not know how well this separation of top-down and bottom-up inputs for apical and basal dendrites holds true – in an earlier blog post I have described why I am generally not a fan of hierarchies like this top-down/bottom-up connectivity scheme, although I still find it a fascinating idea.

Since I’m currently working next door to the lab of Georg Keller, who is interested in predictive processing in visual cortex (check out his 2018 review [4]), I could not prevent myself from wondering whether this top-down contextual input to the apical dendrites could simply be predictions. This possibility is also mentioned in the Larkum review [3]. However, in the theory of predictive processing, predictions (here: apical input) should be subtracted from the sensory input (here: basal input), or the sensory input should be subtracted from the predictions. As mentioned above in the review by Matthew Larkum, however, the apical trunk seems to compute the coincidence of those inputs rather than the difference. Therefore, this somehow does not seem to make sense.

There are ideas how to implement predictive processing using L5 pyramidal cells nevertheless. For example, there is an interesting computational model that is pretty detailed (described by Sacramento et al. [5]). The idea here is that the apical compartment does not simply signal top-down input, but encodes an error signal between local inhibitory signals and top-down excitatory input. Some assumptions of this model seem to be unrealistic and many aspects of the model are simply unconstrained by experiments, but it is an interesting starting point nethertheless.

Problem 2: Coupling between apical dendrites and the soma

Overall, this leaves me with the impression that the apical compartment might be something crucial to understand. The separation of processing in apical and somatic compartments is an assumption that seems legit given the large electrotonic distance between soma and the apical dendrite. In addition, this assumption is supported by experimental data (e.g., Cichon & Gan, 2015 [6]; Seibt et al., 2017 [7]; and some other studies). However, for all of those studies, no direct evidence for the decoupling of somatic and apical activity was available. Direct evidence would mean simultaneous recording of somatic and dendritic activity, which is challenging even for an indirect method as calcium imaging due to the large spatial separation of soma and distal apical dendrite. Probing of calcium dynamics in a direct way so far has not shown strong decoupling of somatic and dendritic activity (e.g., Helmchen et al., 1997 [8]; or more recently Kerlin et al., 2018 [9]). To be more precise, these studies showed that almost all calcium events in the apical dendrites – with very few exceptions – were temporally coupled to backpropagating action potentials. This seems to be somehow at odds with the idea of separate processing in somatic and apical compartments.

Of course, this is only about dendritic calcium signals, not about the voltage. Recording of the voltages over multiple locations of a dendritic tree, for which there is currently no reliable method, could potentially result in a different picture. Plus, the brain areas and behavioral contexts are not immediately comparable between the behavioral tasks in these experiments. For example, Helmchen et al. [8] used anesthetized rats; Kerlin et al. [9] trained their mice extensively before experiments; Cichon et al. [6] recorded dendritic activity during a weird learning paradigm that might have resulted in a lot of confusion in the mice; and Seibt et al. [7] focused on dendritic activity in mice and rats during sleep.

As a result of these (seemingly) contradictory results, I’m intrigued by the  unresolved question how tightly the activities of soma and apical dendrites of L5 neurons are indeed coupled. Or rather, under which circumstances both compartments become uncoupled. The answer to this question is completely unclear to me.

Problem 3: What do bursts of pyramidal neurons signal?

It is however clear that somatic action potentials to some extent invade the apical dendritic tree. This does not seem to be a random side effect, since it was reinforced by evolution by the insertion of active conductances into the dendritic tree. One possible purpose of this backpropagating action potential could be to activate the inputs of the apical dendrite, resulting in non-linear amplification in the distal dendrites or in the apical trunk (as described by the Larkum review [3]) and thereafter in somatic burst firing. What is the purpose of these bursts? I can come up with two possible explanations:

(1) As suggested by the experiments in the Magee lab ([1][2]), the bursts could be a strong intracellular signal to reinforce recently activated context synapses. – If so, in which synapses would plasticity occur, in basal or rather apical dendrites? In the studies from the Magee lab in the hippocampus plasticity in synapses of the stratum radiatum of CA1 was observed [2]; those synapses are thought to provide spatial context. How would this translate to cortex?

(2) A second possible function of bursts could be to signal not inside of a neuron, but between neurons. Regular spiking is ideally suited to drive postsynaptic neurons with depressing synapses, i.e., only the first spike of a rapid sequence of spikes would trigger substantial synaptic release of neurotransmitters. Bursting, however, is ideally suited to drive postsynaptic neurons that are connected via facilitating synapses. The bursts would therefore be a very sparse code that could signal a coincidence of somatic spiking and apical input to the downstream neuron. In a theoretical study, Naud & Sprekeler [10] investigated the potential of such multiplexing through simple spikes and bursts for separate processing of top-down and bottom-up input in a hierarchical network. And Blake Richards mentioned (in a talk that I’ve watched on youtube, start at min 22:14), while not going into the details, the possibility to use this multiplexing for helping to solve the “credit assignment problem”.

Brief digression: The credit assignment problem is about the question how a neuron somewhere in the brain network can learn to weigh the incoming information in order to become better at a given task. This problem is also addressed by the previously mentioned paper by Sacramento et al. [5], and there is a paper by Guerguiev et al. [11] that goes into a similar direction but is a bit chaotic. Lillicrap and Richards just published a review on how the credit assignment could be solved using (apical) dendrites [12]. It is important to note that both Sacramento et al. and Guerguiev et al. suggest solutions that are approximations of “backpropagation” of errors, the solution to the credit assignment problem that has been fameously found for artificial neural networks. Backpropagation, however, follows a linearized gradient in error space and therefore only allows for small synaptic changes – and thus does not really allow for the single-shot learning behavior that has been observed in animals ([1][2]). Therefore I’m not sure whether it is good idea to search for an implementation of an algorithm similar to backpropagation in the brain.

Problem 4: It’s getting ever more complex

In addition to the open questions mentioned above, some other points related to the function of apical dendrites are also not clear.

For example, what role do inhibitory neurons play that specifically target the apical dendrite? With a disinhibtory circuit motif, interneurons could specifically gate plasticity by blocking inhibition of an apical dendrite (check this review by Letzkus et al. [13]). Following this line of thought, it is, however, not clear to me whether disinhibition is (branch- or neuron-) specific or rather a broad, global gating mechanism of plasticity that allows for specific plasticity by other means.

As another example, it is to some extent clear how the membrane potential behaves in vivo in the soma – but less so in the dendrites of the very same neurons. Dendrites might integrate much fewer inputs than a soma and thereby exhibit much stronger voltage fluctuations – unless there is a precise local balance of excitatory and inhibitory inputs to a single dendrite (this question is based on work I did in zebrafish). A recent study addressed this question of balancedness partially by mapping the co-localization of excitatory and inhibitory neurons on a full tree of L2/3 pyramidal neurons [14].

In the context of balanced networks, I’m also wondering whether apical dendrites in living, unanesthetized brains operate in a high-conductance state as a result of strong excitatory and inhibitory inputs, which has been suggested for balanced networks. If so, I would be interested to know how the mass of open input channels in vivo would affect the coupling between dendritic segments compared to ex vivo slice studies. For this particular question, I’m not sure whether I’m just ignoring existing literature on the subject or whether these questions have simply not yet been addressed experimentally.


What happens in apical dendrites of L5 pyramidal neurons remains mysterious to me, in particular if the neuron is integrated in the cortex of a behaving animal or human being. I do not know which kind of events trigger activity of the apical dendrite, and I do not know under which circumstances and how the apical compartment communicates with the soma. I wonder how well the compartments are connected electrically in vivo. And it is an open question how both synaptic plasticity and non-plastic information processing are affected by activation of the apical trunk or the more distal apical tuft. Despite this lack of knowledge, I would guess that understanding apical dendrites is not sufficient, but probably necessary to understand what a cortical region does as a whole.

Maybe I’m wrong about some of my interpretations; probably I’m overlooking some import studies. If something is wrong in my guesses and interpretations, or if I am missing an important piece of experimental or theoretical evidence, please let me know. I do not have an agenda that I want to defend but instead would like to understand. Therefore, critical comments are even more welcome than positive feedback!



[1] Bittner KC, Grienberger C, Vaidya SP, Milstein AD, Macklin JJ, Suh J, Tonegawa S & Magee JC. Conjunctive input processing drives feature selectivity in hippocampal CA1 neurons. Nature Neuroscience (2015).

[2] Bittner KC, Milstein AD, Grienberger C, Romani S, & Magee JC. Behavioral time scale synaptic plasticity underlies CA1 place fields. Science (2017).

[3] Larkum ME. A cellular mechanism for cortical associations: an organizing principle for the cerebral cortex. Trends in Neurosciences (2013).

[4] Keller GB, & Mrsic-Flogel TD. Predictive Processing: A Canonical Cortical Computation. Neuron (2018).

[5] Sacramento J, Costa RP, Bengio Y, & Senn W. Dendritic cortical microcircuits approximate the backpropagation algorithm. Advances in Neural Information Processing Systems (2018).

[6] Cichon J, & Gan WB. Branch-specific dendritic Ca2+ spikes cause persistent synaptic plasticity. Nature (2015).

[7] Seibt J, Richard CJ, Sigl-Glöckner J, Takahashi N, Kaplan DI, Doron G, Limoges D, Bocklisch C, & Larkum ME. Cortical dendritic activity correlates with spindle-rich oscillations during sleep in rodents. Nature Communications (2017).

[8] Helmchen F, Svoboda K, Denk W, & Tank DW. In vivo dendritic calcium dynamics in deep-layer cortical pyramidal neurons. Nature Neuroscience (1999).

[9] Kerlin A, Mohar B, Flickinger D, MacLennan BJ, Davis C, Spruston N & Svoboda K. Functional clustering of dendritic activity during decision-making. bioRxiv (2018).

[10] Naud R, & Sprekeler H. Sparse bursts optimize information transmission in a multiplexed neural code. PNAS (2018).

[11] Guerguiev J, Lillicrap TP, & Richards, BA. Towards deep learning with segregated dendrites. eLife (2017).

[12] Richards BA, & Lillicrap TP. Dendritic solutions to the credit assignment problem. Current Opinion in Neurobiology (2019).

[13] Letzkus JJ, Wolff SB, & Lüthi A. Disinhibition, a circuit mechanism for associative learning and memory. Neuron (2015).

[14] Iascone DM, Li Y, Sumbul U, Doron M, Chen H, Andreu V, Goudy F, Segev I, Peng H, & Polleux F. Whole-neuron synaptic mapping reveals local balance between excitatory and inhibitory synapse organization. bioRxiv (2018).

Posted in Calcium Imaging, electrophysiology, machine learning, Neuronal activity | Tagged , , , , | 4 Comments