Detecting single spikes from calcium imaging

There are two mutually exclusive holy grails of calcium imaging: First, recording from the highest number of neurons simultaneously. Second, detecting spike patterns with single-spike precision. This blog post focuses on the latter.

Many studies have claimed to demonstrate single-spike detection, but often only under specific conditions or for a subset of neurons. At the same time, nearly as many other studies have demonstrated that such single-spike detection is not possible under their respective conditions.

In our recent preprint, we’ve added systematic analyses based on ground truth recordings as our contributions to this debate. Specifically, we analyzed how single-spike detection depends on calcium indicators (GCaMP8s, GCaMP8m, GCaMP8f; GCaMP6f, GCaMP6m; XCaMP-Gf) and on the noise levels of the recordings.

What I particularly like about our approach is that it does not rely on arbitrary thresholds for false-positive vs. false-negative detections of action potentials. Instead, we trained a deep network (CASCADE) to predict spiking activity in general – optimizing for mean squared error loss when compared to ground truth spike rates.We then applied this network to individual single spike-related calcium transients, allowing us to quantify single-spike detection across calcium indicators and noise levels.

Fraction of correctly detected single, isolated action potentials. From Rupprecht et al, 2025, under CC BY 4.0 license (Figure 4e).

Without giving away all the details, I’ll say that I was pleasantly surprised by the performance of GCaMP8s and GCaMP8m! For the full analyses and more context, check out our preprint: Spike inference from calcium imaging data acquired with GCaMP8 indicators.

Posted in Calcium Imaging, Data analysis, electrophysiology, Imaging, machine learning, neuroscience | Tagged , , , , | Leave a comment

Protocols to check the performance of your multiphoton microscope

In an exceptionally useful paper, Lees et al. provide a set of protocols for checking the performance of your multiphoton microscope: Standardized measurements for monitoring and comparing multiphoton microscope systems (link to preprint).

The paper covers the following procedures:

  • Measuring laser power at the sample
  • Measuring FOV size
  • Assessing FOV homogeneity
  • Measuring spatial resolution
  • Optimizing group delay dispersion
  • Measuring PMT performance
  • Estimating absolute magnitudes of fluorescence signals

Check it out – it is definitely one of those reference papers that are great to have around in the lab space!

Posted in Calcium Imaging, Microscopy, Reviews | Tagged , , | 2 Comments

Non-linearity of calcium indicators: history-dependence of spike reporting

Calcium indicators are used to report the calcium concentration inside single cells. In neurons, calcium imaging can be used as a readout of neuronal activity (action potentials). However, some calcium indicators like GCaMP transform the calcium concentration of a cell into a fluorescence trace in a non-linear manner, following a sigmoidal curve:

Nonlinear relationship between the calcium concentration and the fluorescence of the calcium indicator. From Rupprecht et al, 2025, under CC BY 4.0 license (Figure 3a). Scheme loosely inspired by Rose et al. (2014).

This means that a small change in calcium concentration (ΔC1) may increase the fluorescence (ΔF1) only slightly, while the same change at a higher starting calcium concentration (ΔC2) leads to a much more prominent increase (ΔF2).

What many people do not consider is that this property has an effect on complex events with multiple bursts or action potentials in a sequence. The first spikes may only elicit small fluorescence changes, while the later spikes – with a large fraction of calcium ions still bound to the calcium indicators – result in much higher fluorescence changes. As a consequence, this results in a history-dependent bias that underestimates the early and overestimates the late phases of neuronal activity, as demonstrated with these simulated data:


Simulated fluorescence traces for non-linear sigmoidal (top, gray) and linear (bottom, black) transfer curves. From Rupprecht et al, 2025, under CC BY 4.0 license (Figure 3d).

It is striking to see that for the non-linear calcium indicator, the first spike is barely visible, while the later ones are disproportionally amplified compared to the linear fluorescence trace.

Such history-dependent effects are also important to keep in mind when comparing the neuronal activity dynamics across calcium indicators. GCaMP6f, for example, is highly non-linear, showing a strong history-dependent effect. GCaMP8m, on the other hand, seems to behave more linearly in cortical pyramidal neurons. Therefore, dynamics of complex events cannot be compared across these calcium indicators without taking these effects into account. And spike inference (e.g., using CASCADE) must also take these history-dependent effects into account!

Read more about this (and several other related analyses!) in Figure 3 of our new preprint: Spike inference from calcium imaging data acquired with GCaMP8 indicators.

Posted in Calcium Imaging, Data analysis, Imaging, machine learning, Microscopy, neuroscience | Tagged , , , , , , | Leave a comment

How to use Google Scholar as a neuroscientist

Google Scholar is a search engine for scientific publications. There are alternatives like PubMed (not a search engine but a database, often used in the medical field), Semantic Scholar (also a database, but with richer annotations), Citation Gecko (to discover networks of forward- and backward-citations, which is handy to check for missed papers), all of which I’m using from time to time. Or new tools based on large language models like perplexity.ai or litmaps, which still have to show their value in the long run. Personally, I prefer Google Scholar. It casts the widest net among all these tools, covering not only journal publications but also conference preceedings, thesis publications, patents. This strategy also indexes crap from predatory journals, which is usually easy to spot for a scientist, but also some hidden gems that you would otherwise miss.

Google Scholar can be used not only as a search engine but is at the same time a tool to assemble the publications associated with a single researcher in a Google Scholar profile. Here are my pieces of advice on how to make the best use of your Google Scholar profile as a researcher in neuroscience (and related disciplines). Let me know if I missed something important!

1. Create a public Google Scholar profile

Once you have a Google account, it is pretty straightforward to create a Google Scholar profile. As soon as you have own publications associated with this profile, it also makes sense to make the profile public – this renders you searchable via Google scholar as a person with an ID. Since most people in the neurosciences are using Google Scholar (with a larger minority of medically-oriented or traditional researchers still preferring PubMed), this small step makes you more visible as a identifiable researcher, without having to go back to OrcID or other identifiers.

2. Curate your publications

From time to time, you will be informed by Google Scholar about new publications that are associated with your name. You can tell the algorithm to automatically update new publications (I’d choose this option only if you are very busy) or to decide by yourself each time (recommended). In the latter case, don’t forget to forward updates from Google Scholar in case you are not using the associated gmail account for your daily business.

Such a manual curation is a good use of your time to make your Google Scholar page useful to others and more readable. To do so, delete publications that are erroneously associated with your account. If publications that are listed separately are versions of the same study, merge them as shown below:

Sometimes, Google Scholar decides to include non-peer-reviewed scientific work in its search results, for example your thesis. I noticed that Google Scholar also includes posts of this blog post if they are structured like a scientific article and include a list of references. For example, the following email showed up when I posted a blog post reviewing papers on astrocytic physiology:

I believe it is nice that Google Scholar also picks up these instances of scientific output in its results, but I don’t include them on my Scholar profile in order not to confuse the profile’s typical human viewer.

In theory, it is possible to add your own items to Google Scholar, based on Github repositories or other scientific output that is not found by Google Scholar. However, I would not recommend it since it may appear as if you were trying to artifically inflate the number of publications in your profile.

3. Annotate shared first authorships

As most tools for literature search, Google Scholar normally does not display “equally contributing” first authors. For many projects in experimental neuroscience, however, two or more authors are “equally contributing”, without being reflected by Google Scholar’s author list. To fix this issue and to make your Google Scholar profile a more accurate reflection of your contributions to publications, you can click on an article, hit the “Edit” button and add asterisks (*) to the equally contributing first authors. Note that this procedure will update the author list in your Google Scholar profile but not in the Google Scholar search results. For example, an item may then appear like this:

4. Set up personalized alerts to stay up to date

Apart from being a useful web display of your publications, Google Scholar can also be used to keep you updated about current research related to your own publications. To do so, go to your Google Scholar profile page and click on the “Follow” button in the top right corner. This window will pop up:

Hit the checkbox “New articles related to my research”, and you will be informed via email about publications related to your own (published) research. From my experience, >90% of these “related publications” are irrelevant and can be ignored, while the remaining <10% are useful. It’s certainly better than relying on bluesky or other social media or going through table of contents of journals. The updates are quite independent of journal names and not biased by the usage of social media by a specific researcher. Therefore, it is also possible to spot relevant and well-done research published in smaller journals or by less prominent researchers, without losing track of “high profile” studies.

Of course, if you don’t have yet any publications, it does not make so much sense to receive alerts about publications related to your work. In this case, go to the Google Scholar profile page of your supervisor, scientific hero, postdoc colleague or anybody who in your opinion does great research. Then, hit the “Follow” button on his/her Google Scholar profile page and select “New articles related to this author’s research”, and you will be updated about research close to your interests.

Of course, getting updates about new research can be quite stressing sometimes, and it is impossible to fully stay up to date with the literature. If you have the feeling that you cannot keep up with the “related” literature anymore, that’s okay. Just cancel your Google Scholar alerts, do some real science and come back to literature search at a later timepoint. Of course, you may miss some of the hottest developments. But following all the newest trends and hot topics can also be stressful, and we all should do our very best to purge any sources of unnecessary stress and distraction from our work life as researchers.

5. Conclusion

I’m a big fan of Google Scholar. But it is always imporant not to get sidetracked by pure citation counts. Don’t judge a person based on their profile with its citation counts per year and numbers of publications. Always pick one or two first-author publications that you can judge scientifically, and check out what is behind the title, in the abstract, the figures, the methods sections, or the acknowledgements. Citation metrics can be manipulated and gamed, and nothing replaces the deep dive into real science.

Google Scholar also comes with quite a good documentation. Check it out! For further information about the background of Google Scholar, check out this article on Wikipedia.

Posted in neuroscience, Review, Reviews, writing | Tagged , , | Leave a comment

Annual report of my intuition about the brain (2024)

How does the brain work and how can we understand it? To view this big question from a broad perspective, I’m reporting some ideas about the brain that marked me most during the past twelve months and that, on the other hand, do not overlap with my own research focus. Enjoy the read! And check out previous year-end write-ups: 20182019202020212022, 2023.

If you want to understand the brain, should you work as a neuroscientist in the lab? Or teach the subject for students? Or simply read textbooks and papers while having a normal job? In this blog post, I will share some thoughts onthis topic.

1. Why do I do research?

There are three reasons why I’m doing research in neuroscience:

First, I like this job and what it entails: working with technology, building microscopes, working with animals, coding, analyzing data, and exploring new things every week. If you are familiar with this blog, you probably know how much I like these aspects of my work.

Second, with my research I want to contribute to the basic knowledge about the brain within the science community. I believe that this deepened basic understanding of the brain will ultimately have positive impact on our society, how we see ourselves and how we treat our own and other minds during health and disease. In this line of thought, I see myself as a servant to the public.

Third, and this is the focus of today’s blog post, doing research in neuroscience also enables me to increase and improve my own understanding of the cellular events in the brain, of thought processes, and of life in general. This is what drew me to science in the beginning.

In contrast to this last point, the work as a researcher embedded into the science machinery of the 21st century tends to be focused on something else, and for understandable reasons. Most of the daily work of scientists is focused on making discoveries, on having impact, and on being seen as successful. It almost seems a natural idea to believe that making discoveries is the same as better understanding the brain. And although discoveries might be the best way to increase the overall insight into the brain for humanity, it might not be the best way to increase your own understanding of the brain.

2. Understanding by reading from others (“passive” research)

One of the tasks that kept me most busy in early 2024 was the final preparations for our publication on centripetal propagation of calcium signals in astrocytes. I still believe that this is my most important contribution to science so far, and I do think that I learnt much during this research project. However, the final steps of publication consisted of rather tedious interactions with copy editors, formatting of figures and file types, preparing journal cover suggestions, as well as advertisement of the work through discussions, talks or public announcements. All of this may be helpful for my career and useful for the potential audience, and can be fun as well, but certainly does not advance my own understanding of the brain. I felt as though I was treading water – being very busy and working hard, yet at the same time, I got the impression that I had temporarily lost touch with the heart of research.

At the same time, I had to step in on short notice to give a lecture to medical students about the motor system, covering cortex, basal ganglia, cerebellum and brainstem. Since I didn’t find the existing lecture materials fully satisfying, I began researching the topic myself. Coming from physics and having been interested in the principles of neuroscience like the dynamics of recurrent networks or principles of dendritic integration rather than in the anatomical details, I had never fully had a firm grasp of the motor system. Now, I was forced to understand the connections between the motor cortex, cerebellum, and basal ganglia, and their effect on brainstem and spinal cord, in just a few days. What role do the “indirect” and “direct” pathway play in the striatum, and how are they influenced by dopamine? What is the opinion of current research about these established ideas? What role does the cerebellum play? How should we treat David Marr’s idea of the cerebellum? What is currently known about the plasticity of Purkinje cells in the cerebellum? My understanding of these topics had been superficial at best. The challenge of delivering a two-hour lecture on this topic – and being able to answer any question from students – forced me to seriously think about these topics.

After an intense weekend that had been full of struggles, textbooks and review papers, not only had I prepared an acceptable lecture, but I had also made real progress in my personal understanding of how the brain works. It wasn’t directly relevant to my own research, but over the following months, I noticed that far more studies from the field of motor systems suddenly caught my attention – because now I understood better what they were about. Retrospectively, I could now also better understand the work on the brain stem done in the neighboring lab of Silvia Arber during my PhD.

Therefore, the most important progress in my understanding of the brain during this time in early 2024 didn’t come from my own active research or from a conference where I could catch up on the latest developments. Instead, it came from a weekend when I was forced to dive into a topic slightly outside of my comfort zone. Let’s call this “passive” research, as it did not involve my own lab activities but ‘only’ researching the conclusion from other scientists.

If I wanted to really understand the brain, wouldn’t it make sense to work this way more often? That is, instead of spending five years applying my time and expertise on a narrowly defined scientific question, shouldn’t I first aim to better comprehend the available knowledge?

3. The limitations of a “passive” research to understanding the brain

A few years ago (around 2007-2009), I had already tried to understand the brain in such a “passive” way: by systematically absorbing and mapping out the existing knowledge, while being myself not yet an active researcher. At the time, I was in the middle of my physics studies. Physics itself wasn’t my main interest but rather a means to learn the methods and ways of thinking that are necessary to penetrate neuroscience and ultimately understand the brain. At the same time, however, I realized that I lacked some basic knowledge in neuroscience. For example, I had some notions about the different brain regions, but these notions were very vague and consisted of not much more than names.

To change this lack of knowledge, I started a project that I called “The brain on A4” (A4 is a paper page format similar to the US letter). The idea was to search the literature for a given brain region, summarize the findings, and condense them onto a single A4 page. My vision was to eventually wallpaper my room with these 100 A4 pages so that the summarized facts and essential insights about all relevant brain regions would always be present as anchor points for my thought processes. This way, they would gradually sink into my mind and provide the foundation for a deeper understanding through reflection and the integration of new thoughts.

For illustration, here are two pages of the “Brain on A4” project, written in German (with a few French textbook excerpts included since I was studying also at a French university then).

In short, the idea didn’t work. Using this approach, I covered some brain regions, and when I read through these A4 drafts today, they don’t seem completely off base. But the concepts that are now familiar to me and connected to other topics had only vague meanings back then when I copied them from Wikipedia, Scholarpedia or review articles that took me several days to go through. I could recall the keywords and talk about them, but I couldn’t truly grasp them when I put myself to the test.

Why? Because knowledge must grow organically. It needs both contextual embedding and emotional anchorage. This embedding can be a discussion partner, or a project where this knowledge is applied or tested, or, at the minimum, it can be the exam at the end of the semester where the knowledge is finally “applied”.

In addition, I was also lacking the toolset to probe the knowledge. Different from maths, physics or foreign languages, the knowledge about the brain comes in vague and confusing sentences that are difficult to evaluate. That is, for most of the statements of the brain, it is difficult to say whether it is indeed true or what it means. The equation for potential energy E = m·g·h can fully understood by derivations or examples. On the other hand, the statement “The major input to the hippocampus is through the entorhinal cortex” (source) only makes sense (if at all) when the entorhinal cortex is well-understood (which is not the case). In addition, neuroscientific publications are full of wrong conclusions and overinterpretations. For example, if I randomly take the latest article about neuroscience published in Nature, I get this News article of a research article by Chang et al. . The main finding of the study is indeed interesting and worthwhile reporting: recent memories are replayed and therefore consolidated during special sleep phases of mice where the pupil is particularly small. The News article, however, stresses that this segregation of recent memories into distinct phases may prevent an effect called catastrophic forgetting, when existing memories are overwritten because they use the same synapses. This interpretation, however, is quite misleading. Catastrophic forgetting and the finding of this study are vaguely connected but not closely linked, which becomes quite clear after reading the wikipedia page on catastrophic forgetting. As a lay person, it is almost impossible to understand that this tiny part of the discussion, which prominently featured in the subheadings of the News article, is only a vague connection that does not really reflect the core experimental findings of the study.

Similarly, when I made the A4-summaries, I meticulously listed the inputs and outputs of brain regions. But what could I make out of the fact that the basal ganglia receives input from cortex, substantia nigra, raphe and formatio reticularis (as in my notes above), if all of those brain areas were similarly defined as receivers of input from many other areas? Back then in 2008, I wrote about the cortico-thalamic-basal ganglia loops and how they enable gating (see screenshot above), but only when I worked through the details again with a broader knowledge base 16 years later, I managed to see the context where I could embed the facts and make them stick in my memory. And it took me this many years working in neuroscience to slowly grow this context.

4. The limitation of a systematic approach to understanding the brain

A second reason why this approach for mapping the brain to A4 pages didn’t work may have been its systematic nature. A systematic approach is often useful, especially when coordinating with collaborators, or when orchestrating a larger project. However, I’ve come to believe that a more organic – or even chaotic – approach can be  more effective, especially when it comes to understanding something. A systematic approach assumes that you can determine in advance what needs to be done, in order to faithfully follow this structure afterwards. For the A4 project, the systematic structure was the division into “brain regions.” Of course, the brain can not be understood by just listing the properties of brain regions; many important concepts take place on a different level, between brain regions, or on the cellular level. I noticed the limitations of my approach myself soon enough and added A4 pages on other topics that I deemed relevant like “energy supply to the brain” and “comparison with information processing in computers.” The project lost its structure, for good reason. And soon after, before the structure became completely chaotic, I abandoned the project entirely.

One thing that I learnt from this failure is how a systematic approach can sometimes hinder understanding. In formal education, this truth is often hidden because curricula and instructors provide the structuring of knowledge already. But when it comes to acquiring new knowledge and insight, rather than merely processing and assembling pre-existing knowledge, this systematic approach must be continuously interrupted and re-invented to enable real progress. When I first heard about the hermeneutic circle, invented by hermeneutics (the science of understanding a text), I had the impression that this concept was an accurate description of the process of understanding. Following the hermeneutic circle, deeper understanding is approached not on a direct path but iteratively, by drawing circles around the object of understanding, maybe constructing a web of context and possibly an eventual path towards the goal. In this picture, the process of understanding is diffuse and unguided, and is corrected only occasionally by counscious deliberation and a more systematic mind. As a consequence, the object of interest can only be treated and laid down systematically once its understanding has been reached, but not on the way to this point.

5. The limitation of a non-systemic approach to understanding the brain

However, the unsystematic approach to understanding the brain has a major drawback: you lose the sense of your own progress, and you lose the overview of the whole. Often, progress is incremental and, over years, so slow that you hardly notice you’ve learned something new – leading to a lack of satisfaction. And, even more importantly, you lose the big picture.

This may also be one of the greatest barriers to understanding the brain: the possible inability of our minds to comprehend the big picture of such a complex system where different scales are so intricately intertwined. A few years ago, I wrote a blog post about this topic (“Entanglement of temporal and spatial scales in the brain, but not in the mind”), which I still find relevant today. Can we, as humans with limited information-processing capacity and working memory, understand a complex system? Or more precisely: what level of understanding is possible with our own working tool – the brain -, and what kind of understanding lies beyond our reach?

Recently, Mark Humphries wrote a blog post to address a similar question. He speculated that the synthesis and understanding of scientific findings may, in the future, no longer be carried out by humans but by machines – for example, by a large language model or a machine agent tasked with understanding the brain. Personally, I find this scenario plausible but not desirable. An understanding of the brain by an artificial agent that is beyond my own ability may be practically useful, but it doesn’t satisfy my scientific curiosity. Therefore, I believe that we should focus on how to support our own understanding in its chaotic nature and, perhaps retrospectively, wrest structure and meaning from this chaos. How? By writing for yourself.

6. The importance of writing things up for yourself

As I mentioned earlier, I believe that understanding the brain is a chaotic and iterative process that does not proceed systematically or in a predictable trajectory. Instead, it involves trying out different approaches and constantly adopting new perspectives. For me, these approaches include reading textbooks and preparing lectures; reading and summarizing current papers; and conducting my own “active” research in the lab and in silico.

During this process, I found that shifting one’s perspective can be particularly helpful in gaining a better understanding. To gain such new perspectives, I regularly read open reviews, which often present a picture different from the scientific articles themselves. Or, I like to explore new, ambitious formats that shake off the dust of the traditional publication system and attempt to take a more naive view of specific research topics. A venue that is still fresh in spirit and that I can recommend for this purpose is thetransmitter.org.

However, the best method to adopt knowledge and integrate it into one’s own world model is by processing the knowledge in an active manner. The two methods I find most useful are mind maps and writing. Usually, I use mind maps when I’m completely confused, either about the direction of a project, or about my approach to neuroscience in general. Usually, I just start with a single word in the center of a paper within a circle and then add thoughts in an associative manner for 20-30 minutes. The result of this process is not necessarily useful for others. However, seeing the keywords laid out before me, I can often see the missing links or identify things that should be grouped together, or grouped differently.

Below is an example of a such mind-map. I drew this map in 2016 a bit more than two years into my PhD, at a stage where I was quite struggling to shape my PhD project. Unlike most of my mind maps which are hand-drawn and therefore almost illegible to others, this one was drawn on a computer (in adobe illustrator, to play around with the program). I was brain-storming about the role of oscillations in the olfactory bulb of zebrafish (check out this paper if you’re interested). Although I did not follow up on this project, some of the ideas are clearly predecessors of analyses in my main PhD paper on the olfactory cortex homolog in zebrafish. The mind-map is basically a loosely connected assembly of concepts and ideas that had been living in my thoughts, often inspired by some reading of computational neuroscience papers or by discussions with Rainer Friedrich, my PhD supervisor. I used this map to visualize, re-group and connect these ideas:

The second method is writing, and I believe that it is the only true method to really understand something. In contrast to reading, writing is an active process, and so much more powerful in embedding and anchoring knowledge in your own mind. You may have heard of the illusion of explanatory depth, the tendency of our brain to trick us into thinking we understand something simply because we’ve heard about it or can name it. Only when we attempt to explain or describe a concept, we realize how superficial our thoughts were and how shaky our mental models really are. Writing is a method for systematically destroying these ill-founded mental structures. (Expressing an idea in mathematical or algorithmic terms is even more precise and therefore even better for this purpose!) When we have destroyed such an idea, we shouldn’t mourn the loss of a seemingly brilliant concept but instead celebrate the progress we’ve made in refining our understanding.

In addition, writing has always been a form of storytelling. By putting our understanding of the brain into words – even if those words are initially fragmented, scattered, and contradictory – writing seeks to find meaning, identify patterns, and embed details into a larger whole. With a bit of practice, writing does all of this for you.

Importantly, I’m not talking about writing papers or grant proposals here. In those cases, you have a clear audience in mind (editors or reviewers) and eventually tailor your writing to meet their expectations. And you will be happy and satisfied when you produce something that meets the standards for publication. Instead, I’m talking about writing for oneself. This mode of writing confronts your own critical voice and follows ideas without regard for how the text would look like. And I believe that this way of writing, which is not directly rewarded by supervisors or reviewers, is the most useful in the long run.

I believe that many researchers in neuroscience (and maybe you as a reader) initially started to work as neuroscientists not because they wanted to be famous or successful or well-known but because they wanted to understand how the brain works. So if you want to take this seriously, write for yourself.

Posted in Data analysis, Neuronal activity, neuroscience, Reviews | Tagged , , , , , | 6 Comments

A resource paper for building two-photon microscopes

Building microscopes in the lab is a skill that is rarely taught at university. It is no coincidence that most people who have learnt to build microscopes have done so in the lab from other researchers or engineers. Usually, one needs to be lucky to find pieces of knowledge in random papers, in discussions with experts, or when browsing blogs like the one you’re currently reading. A part of the problem is that most papers that describe the novel design and construction of microscopes are often challenging to translate into practice even for experts because they describe the ideas and concepts and do rarely provide precise assembly instructions together with the rationale behind.

In their manuscript on An open-source two-photon microscope for teaching and research by Schottdorf et al., the authors go a different route. Instead of presenting a novel microscope design that shall be used for future experiments, they describe the rationale and principles behind a microscope design that was already used, tested and refined over many years in a very successful systems neuroscience lab.

Assembly of lens groups for tube lens and scan lens. From (Schottdorf et al, 2024), under CC BY 4.0 license (Supplementary Material, Figure 8).

The paper includes many interesting and useful pieces of knowledge. Among those, I would like to highlight only a few:

  • The assembly instructions and rationale for a custom scan lens and tube lens based on off-the-shelf components (see the Results section, but also the Discussion with comments on ideas from astronomy and photography).
  • A similar design suggestion and analysis for the detection path.
  • A discussion why an axial FWHM of 5 μm is, in the view of the authors, a pragmatic compromise for in vivo-imaging with movement artifacts.
  • The interesting side-note that ±28 V instead of ±24 power supply specifications are advantageous for galvo scanner performance.
  • The measurement of the dispersion for this specific two-photon system, which can be considered typical for two-photon microscopes (approx. -20000 fs2).

In addition, the manuscript comes with a very nice documentation on Github that includes a detailed assembly protocol, a list of parts including prices of laser, objective, shutter, power meter, PMTs, etc.

Altogether, a great resource that is definitely worth a look.

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

Spike inference with GCaMP8: new pretrained models available

Calcium imaging is only an indirect readout of neuronal activity via fluorescence signals. To estimate the true underlying firing rates of these neurons, methods for “spike inference” have been developed. They are useful to denoise calcium imaging data and make them more interpretable. A few years ago, I developed CASCADE, a supervised method for spike inference based on deep networks. I have been been updating and maintaining CASCADE ever since, and this maintenance work has been a starting point for several collaborations and friendly interactions during the last years (for example, check out this recent preprint on spike inference from spinal cord neurons).

Originally, the CASCADE algorithm was trained on a ground truth database that consisted primarily of recordings with GCaMP6. However, how will the algorithm perform on new indicators like GCaMP8, with its much faster rise times? To address this question, I now trained CASCADE models on GCaMP8 ground truth and evaluated whether these models performed better than previous models. The short answer is – the retrained models performed clearly better:

I’m currently in the process of dissecting this improvement: Is it due to differences in rise times, different non-linearities or other differing properties of the two indicator families? The results of these analyses turned out to be more fascinating than I expected and therefore take more time to understand and analyze, but I’m planning to have this analysis written up within the next 3-6 months.

In the meantime, however, feel already free to use the new CASCADE models specifically trained with and for GCaMP8 – they really make predictions better! (And please only apply these models to GCaMP8 data; the previous models are still better for anything with GCaMP6!)

You will find the new models for CASCADE as usual in the list of available pretrained models. For example, instead of the GCaMP6-trained model Global_EXC_30Hz_smoothing25ms, indicate the GCaMP8-trained model GC8_EXC_30Hz_smoothing25ms_high_noise to infer spike rates with the predict() function of CASCADE.

A technical note: These models are pretrained on all available GCaMP8-ground truth, mixing together GCaMP8f, GCaMP8m and GCaMP8s. This procedure results in more robust models due to the larger ground truth database, but absolute inferred spike rates are slightly biased due to the different spike-event fluorescence amplitudes for the three indicators (-30% underestimate for GCaMP8f and GCaMP8m, +60% overestimate for GCaMP8s). In the near future, CASCADE will also include models specific for each of those indicators. These models will probably be slightly less robust but will provide less biased spike rates. However, if you are not specifically interested in very precise absolute spike rates, I would for now recommend the general GCaMP8 models that are already available. They are not only robust and very powerful but also provide a good rough estimate of absolute spike rates.

Update 2024-09-19: Models pretrained with specific indicators (e.g., GC8s_EXC_30Hz_smoothing25ms_high_noise for GCaMP8s) are now available online. Check out the full list of models via the Cascade code or via this continuously updated list on Github.

Update 2025-03-11: A preprint describing the analyses, the pretrained models and their applications to GCaMP8 is now on bioRixv: https://www.biorxiv.org/content/10.1101/2025.03.03.641129.

If you have questions, please reach out via comments on the blog, issues on Github or via email!

Posted in Calcium Imaging, Data analysis, Imaging, machine learning, Network analysis, Neuronal activity | Tagged , , , , | 4 Comments

How to do science according to Ardem Patapoutian

Ardem Patapoutian is a neuroscientist who works on the molecular basis of sensation via mechanosensitive ion channels. In 2021, he was one of the recipients of the Nobel prize, at a relatively young age. He has since used his influence among scientists to speak out for improving academia for both research and the humans who do the research.

In a post on Twitter, he compiled a list of 13 rules on how to do science. I strongly agreed with some aspects, disagreed with others (after all, Ardem is a scientist in a slightly different field), and felt inspired to share some thoughts about his list. I’m writing these comments also because I’m curious what I will think about my current ideas in 10 or 20 years from now. Here’s the list:

I’d subscribe to this statement 100%.

As a PhD student, I had only few fixed responsibilities. Every couple of months, I started a new side-project, learned a completely new experimental technique, a new programming language, read about a new field of computational neuroscience, etc. 7 years ago, I gave an interview about this creative process for my science. I believe that these deep dives into unknown territory are necessary for creativity. Creativity is often a combination of two influences from two different fields; in the simplest case, it’s just the application of a certain domain to another – let’s say, the use of a fancy cooking technique for the improvement of an immunohistochemistry method. Such a knowledge transfer requires not only focused work on the target method (immunohistochemistry), but also a deep knowledge about the other field (fancy cooking), which requires time, an exploratory spirit – and an appreciation for the fact that time spent understanding one domian can always be beneficial for another domain.

I noticed for myself that the available time that I have for such digressions became less once I became a PI, and it will become worse over time in the future. But I hope to maintain conditions in the future that won’t prevent me from staying creative!

That’s a very commonly given advice, but few people seem to follow it. “Saying no” is not only about focusing on one’s own projects and tasks, but also about saying no to the inner voices and the peer pressure. You need to publish in Nature. No, you don’t; don’t lose yourself while trying. You need to finish your PhD with 30. No, everybody at their own pace! You need to have >3 PhD students. No, one may be just enough for some situations. You need to become a professor within 5 years. No, you don’t. Life outside academia has many things to offer.

For some people, learning “no” only seems applicable to requests from other people. But learning to say “no” to the internal voices – which are often only the internalized voices of other people, be it peers, parents or professors – can be even more important to free the mental resources for doing creative work and for doing real science.

I don’t fully agree with that one for my field of science. In basic systems neuroscience, the relevant question is “how does the brain work”, and it cannot be approached within 5-10 years. In the meantime, from my own perspective, it seems to make more sense to find small islands of mechnistic understanding and curious observations (for example, I could pick behavioral timescale synaptic plasticity in hippocampal neurons or centripetal integration in astrocytes as starting point phenomena) and continue to work from there bit by bit, even though it’s not yet clear how these questions can be answered within 10 years.

That’s good advice! I should do that more often.

Very good advice again.

I think it is very beneficial to invest a lot of energy trying to kill a project as early as possible. For example, trying to find a critical flaw in a conceptual idea before implementing it in a tedious series of experiments, and then realizing that the data cannot be analyzed properly.

For example, a typical situation at the beginning of an experimental systems neuroscience project is the design of a behavioral task for an animal. Will it be possible to extract the desired mental states from the acquired data, or will these states be confounded by movement or arousal of the animal? These are questions that need to be considered before, not after the experiment.

It happened to me already 3 times that I stopped my main scientific project (1x during my PhD, 1x during my postdoc, 1x as junior PI) because I convinced myself by theoretical arguments or by some analyses that it would not work out. And it happens much more often for smaller project.

I’m very skeptical about this piece of advice. Maybe I’ll think differently in 20 years. But at the moment, I have the impression that those who stay in a field and try to figure out the little details are my real scientific heros. If you’ve found a real effect, you should go for it fully and not drop it for the newest hot stuff. Otherwise, one risks joining a new field where the open questions only seem interesting from outside, the typical “hype train”.

As somebody who built several microscopes and data analysis pipelines from scratch, I can agree only very reluctantly. I learnt so much from reinventing these wheels! And I would be a much worse scientist without.

I still remember my first year of physics studies, when I did not know of any sort of theoretical neuroscience. Back then, I tried to develop a weird form of math that can deal with neuronal connectivity and dynamics. Only a year later or two, I stumbled across Dayan & Abbott’s famous Theoretical Neuroscience and learned that matrix algebra is a great and existing tool for that. But I still wonder what kind of math I would have come up with if I’d been more gifted for it and if I’d had more time without Dayan & Abbott.

However, I also noticed that several extremely skilled scientist-tinkerers like Jakob Voigt and Spencer Smith (I was unable to find his blog post on this topic) turned into advocates of professional infrastructures later during their careers, advocating against the repeated reinvention wheels.

I still cannot decide whether the established black box button-press infractructure are more error-prone, or the code written from scratch by a very smart PhD student. From the perspective of a PhD student, it is probably better to write and build everything from scratch, because you learn more and know what is going on. From the perspective of the PhD student’s supervisor, however, it is better if an existing and tested infrastructure is used, because otherwise there is no efficient way to make sure that the results obtained by the PhD student are valid. Maybe these two different perspective are also the reason why some people change their mind once they are professors.

No strong opinion on that.

Agree. Even more important: As a PhD student, join a lab with a smart, efficient and kind PI (don’t forget about “kind”).

Agree.

I have a hard time agreeing with this rule. My best collaborations have been with people who were technically stronger than me. Collaborations with people who have only limited understanding and, in particular, limited appreciation for the skills that I bring into a collaboration, can be quite painful. But maybe I will judge collaborations from an entirely new angle in 10 years.

I noticed that senior PIs often do not have anybody (not a single person!) who tells them with all honesty when they are wrong. If such a condition is combined with a narcisstic personality of the senior PI, things can become really bad and embarrasing. I do not yet know how exactly to prevent this from happening, because it seems to happen to the best scientists, and it seems particulary common for men (less so for women according to my observations).

I also think that reduction of anxiety is indeed important (related to #1 and #2). But I don’t have a recipe on how to reach such a state. From my own and very limited experience as an observer, the level of anxiety seems to be relatively stable for a given person within academia, independent of the position. I happen to be one of those persons who are not very anxious in general. The reason for this lack of anxiety is maybe that I’m not afraid of leaving academia, because I’m sure I would find another interesting job as well, and because my family does not have any ties with academia. But first of all, it’s probably a personality trait which I owe primarily to my genes and to my parents – and I’m grateful for that!

Posted in neuroscience, Uncategorized | Leave a comment

On the night train to FENS in Vienna

The FENS is the biggest neuroscientific conference in Europe. It is 5 days long and is attended by 5’000-10’000 participants. This year, the conference took place in Austria’s capital, Vienna, roughly 600 km from my current workplace in Zürich. Of course, there are regular and cheap flight between the two cities; however, there are good reasons why to use other means of transportation instead (check out Anne Urai‘s work): busses, regular trains, and night trains. In this blog post, I will share my impression what it is like to take a night train in Europe and why it is a great option for some (but not for everybody).

What’s special about night trains?

Night trains (also called sleeper cars) typically cover longer distances than regular trains. Traditionally, they tried to offer more comfort for an over-night stay, like comfortable beds, additional cars with proper restaurants and bars, or at least a breakfast served at your seat. Especially in times when trains were slower and airplanes not available, night trains were one of the more comfortable options to make a long trip enjoyable. I was surprised to find out that some of the earliest night trains were actually operated in the USA! However, the probably most famous examples of night trains traverse the Eurasian continent. For example, the Transiberian Railway, which extends from the Western to the Eastern Border of Russia; or the Orient Express, which passes through a large part of Europe from Paris to Istanbul.

Seating carriages, sleeper’s carriages and things between

In most night trains that I know, there are three different carriages. First, the cheaper carriages where you stay on a seat over night. Sometimes, these seats can be pulled out and converted into an improvised bed. Second, the couchette, which offers bunk beds, usually with 4 or 6 beds within one compartment, with 2 or 3 stories on the left and the right. And finally, a more spacious and more private sleeper compartment, with typically 1 to 3 beds. It is also possible, for an additional fee, to reserve a sleeper compartment for oneself, for a couple or a family. The prices are moderate when booked much in advance; for example, I paid <150 Euros for the round trip from Zürich to Vienna. However, one must also state that (and wonder why) a cheap flight is not much more expensive than that.

The current state of night trains in Europe

Unfortunately, night trains have been on the decline for several decades in Western Europe. With more and more cheap flights or good high-speed train connections between many European cities, the operation of the slower night trains became less interesting for railway companies, and investments stalled. Around 2020, some governments in central Europe tried to countersteer this decline by pushing for a stronger network of night trains. But it will still take several years until these efforts will show some effect, and the success is not a given.

The re-growing interest for night trains didn’t come out of nowhere. With the public opinion looking more skeptically at short-distance intracontinental airplane flights, night trains in Europe became increasingly popular, in particular after the pandemic, as a CO2-friendly option for long distance-traveling. However, the infrastructure could not really hold up to the increasing interest. Most importantly, the fleet of trains was both too old and too small for the rising demand. The companies responded by using their trains at maximum capacity; therefore, if a carriage broke down (which was not unlikely due to their old age and the scarcity of spare parts), often there was no replacement carriage, and the passengers who were supposed to calmly sleep in a reserved bed were regrouped into an overcrowded seating carriage. Addtionally, the infrastructure inside of the carriages, like toilets, bed lights, etc. is often rather old and not always in a good state – far from the luxury atmosphere associated with, e.g., the Orient Express! Moreover, night trains are often delayed by one or several hours, especially on high-demand routes such as Zürich-Amsterdam.

In summary, one needs to face the fact that night trains are currently not as reliable and not as comfortable as they should be in order to make this mode of traveling attractive for a broader audience. It is likely that the situation will improve during the next years, with more modern cars being produced, replacing and supporting the existing fleets, and making night trains in Europe again more reliable and also luxurious. I have the impression that the companies have already taken some good first steps towards such an improved scenario, because when I took the night train to Vienna, the train was purposefully underbooked, most likely to prevent major problems in case a carriage would break down. But let’s see what the next years and decades will bring.

My own experience has so far been limited to night trains operated by the German-speaking railway companies, with the Austrian railway company ÖBB being at the heart of it. However, there are other night trains as well. For example, it’s possible to go from Milano in Northern Italy to Sicily within a long night, passing not only the largest part of Italy, but also the Mediterranean Sea with a train ferry (!). So if you’re planning your next series of Summer conferences to attend across Europe, maybe you can connect the conferences with an adventurous night train trip?

Screenshot from https://back-on-track.eu/night-train-map/, CC-BY-NC Juri Maier / Back-on-Track.eu .

Traveling from Zürich to Vienna with the night train

The conference in Vienna started on Tuesday, June 25th, with a workshop on closed-loop neuroscience that I wanted to attend (and I was particularly impressed by the cool work from Valerie Ego-Stengel’s lab). I worked normally in Zurich on Monday and went directly from work to the main train station, where the night train departed at 8.40 pm. With me, the luggage for a Summer’s week and a big poster roll.

My train was, to be fair, quite old. I had booked a sleeper’s bunk bed in a 6-person compartment but the middle beds on each side were not used, as you can see below. You can also guess from the first picture and see from the second picture that there was not a lot of space between my bunk bed and the ceiling. It was enough to sit on the bed and work, but barely.

When I entered the compartment, I realized that I would share it with an elderly Indian couple, who were, while the train was still waiting in the station, accompanied by several family members. The couple was from Vienna and had attended a wedding in Switzerland. As most people in night trains, they had little experience with the night train experience. What are the rules? What bed should you take? When will the lights be turned off? Where are the electric plugs? Is there wifi? (Usually, there is none.) Will I be woken up in the morning? I could see the anxiety and the adventure in their eyes, and they were grateful that I could help out with some of their simplest questions.

We had a pleasant discussion about their lifes in Vienna, but after a short time, we decided to go to bed. I went up to my bed and spent an hour or two going through the scientific abstracts of the conference to figure out the best trajectory for the next days. Around midnight, I went to sleep. It turned out that this particular car and this particular bed was not perfect for me – the bed measured almost exactly 180 cm, which is a few cm too short for my height. I noticed that the lower beds were slightly longer, from which I benefitted gladly when I took the train back a few days later.

Usually, I can sleep pretty well in night trains. I like the rhythmic rattling of the train wheels, it even helps me fall asleep (to the extent that I find it difficult to sleep when the train is not rolling but standing still in the middle of the night for an hour!). It’s a pleasant feeling to know that the goal is coming closer by itself while I do nothing but sleep.

This time, however, I was a bit unlucky. My two cabin mates were very friendly when awake, but rather annoying during sleep. The woman was snoring in an irregular way that I found difficult to deal with, while her husband was occasionally speaking or shouting in his sleep with an agitated voice. Not my best night train night so far! I heard later that a colleague of mine who also took the night train to FENS was much luckier, sharing the cabin with other attendants of the FENS conference and having a good time during the evening and night.

In any case, the train arrived at 6.34 am in Vienna, perfectly on time. The breakfast in the train had not been exceptional (which is unfortunately the rule rather than the exception according to my experience). Therefore, I benefitted from the great Viennese baking culture and got a very decent breakfast at a price that seemed so much more affordable as I was directly coming from Switzerland…

After the 5-day conference, which was a pleasant mix of meeting old friends and meeting people for the first time I knew from Twitter, from collaborations or from eMail exchanges, interspersed with some interesting pieces of neuroscience, I spent another day with a good old friend of mine who happens to live in Vienna, before I took the train back to Zürich. My plan was to take the night train on Sunday just after 11 pm, to arrive on Monday morning in Zürich and go directly to work. Maybe an ambitious plan, but it worked out well. During the last hour before my train departed, I waited at the train station in Vienna, with the vibrant atmosphere of Summer still around me. Due to the European soccer championship, one of the games was publicly displayed on a huge screen just in front of the station, and a Spanish crowd cheered every time their team scored a goal.

Back on the train, I entered the compartment that was already occupied by one woman, sleeping in one of the beds, hidden below the blanket. I tried to do my best not to wake her up and took over the bed on the left.

I wrote a few notes on my laptop to record the recently passed very eventful and inspiring days, and then fell asleep.

I woke up in the early morning around 6.30 am. With joy, I noticed that we were passing by Lake Walenstadt, a beautiful lake in the East of Switzerland, and already quite close to Zürich. Through their diffuse reflection, the grey and white clouds created a beautiful metallic shimmer in the water, and I sat there, looking out of the window, being happy.

Soon after, we passed by Lake Zürich, and when I arrived at Zürich main station, I had my breakfast with delicious Viennese pastries before I went to work. A very efficient way of traveling!

Why you should (not) take the night train

It should have become clear now that night trains in their current state are not for everybody. The comfort is too low and the prices are a bit too high, and delays too frequent. But still … I would recommend this experience to anybody who is not afraid of it and can manage to sleep in such a context. It’s not only about avoiding airplanes, but also about embracing the adventure that is much more palpable for the night train experience compared to airplane flights. The sense of adventure not only makes the travel special but also bonds the travellers within one compartment to each other more easily. A great opportunity to meet with people from outside your social circles!

The probably most famous night train, the Orient Express, has long been associated with an atmosphere of both luxury and adventure. And both aspects are reflected by its prominent occurrence in works of fiction, ranging from Agatha Christie’s famous novel The murder on the Orient Express to the most recent Mission Impossible movie. Nowadays, it is mostly the atmosphere of adventure which still remains part of the night train experience. Almost 20 years ago, I was deeply fascinated by the novel Night Train to Lisbon. In this book, the daily life of a high school teacher transitions to a philosophical and linguistic adventure within a single night: in the night train from Bern to Lisbon. I still believe that this is the essence that is the most attractive aspect of night trains: the vague promise of adventure, a memorable night and a new world that opens up to the awakening senses on the morning of the next day.

Posted in Uncategorized | Leave a comment

A collaborative review on error signals in predictive processing

Predictive processing is one of the most influential ideas from computational neuroscience for the experimental neurosciences. However, definitions of predictive processing vary broadly, to the extent that “predictive coding” is used sometimes in a very narrow sense (there are specific cell types for negative or positive expectation errors) or in a very broad sense (anything related to error signals or expectation mismatch is predictive processing).

Jerome Lecoq now started the great initiative to write a review about error signals for predictive processing, but in a very collaborative manner. He invited anybody interested to join the writing of the review.

I think that this way of writing a collaborative and open review is a great idea, even though it might be difficult to reconcile all the different opinions! This link will lead you to the Google document with the main text and with the instructions on how to contribute. And if you don’t feel like you want to contribute, it is at least a useful opportunity to learn about the current opinions in the field and how people agree or disagree about the interpretation of predictive coding, error signals and the literature that covers both. Take a look!

Posted in Calcium Imaging, Data analysis, machine learning, Neuronal activity, neuroscience, Uncategorized | Tagged , , , | Leave a comment