 Welcome to this first lecture of this year's under course. The structure is such that, and that more or less repeats for the coming days, I'll give an introductory lecture actually today. It's sort of three parts of a lecture. And then in the later afternoon and tomorrow morning, you will work on exercises and data. And today I will also introduce you to that data set that you're going to work on first. And it has something to do with the larger data set that you're going to be working on next week in free projects. So some of the stuff you're going to hear during week one, you can directly apply it, let's say, to your research question in the coming week. So today I have, let's say, three lectures because I'm the first one. I will first remind you on what are spike trains, where do they come from. Some of you know that very well because you do recordings. Others have no experience with experimental data or spiking data yet. So that's why I introduced this first. The second part is on how to estimate firing rates, a very basic analysis of spike twin data in single neurons and also how you can compute or decode information. In our case, it will be directional information from monkey motor cortex data. And then we have a coffee break. And after that will be rather early coffee break. And then after the coffee break, there's a longer lecture on cortical variability. So the variability of neural activity. And this is what you actually, so that is the main task for this afternoon and tomorrow to analyze variability in various ways. All right. So first part, experimental spike trains. And I introduce me and myself very briefly. You have met me during lunch and dinner and beer, but what are we doing? So my group is Computational Science Group. We have people from different fields. I actually made the effort and went through the different graduations that students in recent years had in my lab. And basically we tried to bring together biology and theoreticians in the group. And actually our aim is eventually to come up with good models. And I will also show you some example today on how we model based on data. Let's call it data-driven modeling. So we try to understand how sensory processing and behavioral control interacts. And that means we need functional models. And we also look in memory formation in our group and a little bit of decision making. Nevertheless, this is the aim, but let's say 75% of the work we are doing is data analysis. It's much harder to get information out of the data such that you can use it for a good modeling approach. And that's some of the topics we are working on, or maybe that's probably all topics. And today we will particularly look into encoding of movement parameters in a monkey motor cortex recordings and premotor cortex recordings. And we look into variability both in monkey data and in models, but also in other animal systems. Okay, so if you want to understand the brain, we have different techniques of measuring data from the brain. You probably know most of all of them. I keep updating this slide. For example, functional ultrasound imaging is pretty young and new. And this border is important here because on this side, these are non-invasive methods. On this side, these are invasive methods. And there are two axes, the spatial resolution. So to the right, you have a higher spatial resolution. To the left, the spatial resolution is worse. Of course, we like to have high spatial resolution covering all the brain, ideally, so to say. Then we have time scales. So bottom here is fast time scales. So we actually look at fast signals, and that means time scales that are used by the brain to compute information. And then we have slower time scales. I mean classical PET, for example. PET imaging is, of course, horribly slow. And of course, whenever you want to be fast, have high temporal resolution and a high spatial resolution, you will have to use invasive methods. Something I want to point out, and I usually point out to undergrad students, but I still point it out here. The brain does not compute with any of these signals. These are only signals that we see. That's mass or population signals that are accessible for us. But there's no fMRI scanner in the brain. There's no EEG recorder in the brain. So the brain works with action potentials. It generates intercell signals and intercell voltages. We have all the conductance changes, currents, and so on. And that is the signals that are really used in a neural network. So if we really want to understand, let's say, on a deep functional level how neural networks work, we actually have to be at this precise scale. And to do today, we are concerned with exocellular spike recordings. So I show you here a figure that is a picture cultured in vitro cells. This is a pipette, a sharp glass electrode. It's exocellular, but of course you can approach individual neurons. And that works nice, but that's not reality. You can do exocellular recordings with metal electrodes, silicon electrodes, silicon probes, and of course glass pipettes. And this is the reality of the cortex. This is from a famous book from Valentino Breidenberg and Almut Schütz. So they did a lot of anatomical statistics in cortex, in particular in mice. This is a staining in a mouse. The scale here is, if I recall correctly, 200 micrometers. And what you see here is a staining of fibers. So there's lots and lots of fibers in a small slice, 400 micro thick of mouse cortex, neocortex. What are the white blobs here? So this is staining fibers. So what is the white blobs? They can be cell bodies. Exactly. These are typically the cell bodies, densely packed, potentially also astrocytes, maybe some cut blast vessels. But mainly cell bodies from neurons. So this is densely packed. And I think these numbers, I still hardly believe them after 20 years. But if you look at this, for example, this is per cubic millimeter of mouse neocortex, you have 90,000 neurons in one cubic millimeter. But that is really breaking the record here. Four kilometers of cable in one cubic millimeter. Four kilometers, okay? Every engineer would be proud of that. So that's something we have to just remember if we work on data. In particular, if you're a theoretician and you have not much experience with data, data is not as clean or as easy to obtain as in a simulation. So reality is we don't stick in an electrode like that in such a brain but something like that or bigger. Okay? It's like... Okay? This is, you know, maybe this would now be 50, 60 micron. This is already a thin wire, if you wish. Depends on what type of electrodes you use. But anyhow, you damage some sort of the brain. But what is interesting for us today is you will pick up... So this is the tip of the electrode. The rest might be isolated and it might have different shapes. But in any case, you will record from a lot of neurons around and axons, not to forget. So if we pick up spikes, okay? And of course the local field potential will also integrate over many dozens or hundreds of cells around the electrode. So we call this mixed signal on the one hand. So if we want to have individual neurons, difficult. And of course we under-sample in the sense that we still only record from 100 neurons out of a billion or so. Yeah? Okay. This is state-of-the-art. And I hope, yeah, you have seen this type of experiment. So this is the state-of-the-art deuter array, 100 electrodes to record from rats, monkeys, rodents. Okay? And here comes an example. So I want to demonstrate you now what is the difficulty to extract spiking data from a recording. That's an example that Klayman's book sign did, you know, a long while ago. And this is, so he used to be in the University of Freiburg and we worked together. And this is a rat rat hat. And he did simultaneous intercellular and extracellular recordings. So 9, what, 6, 7, or sometimes more extracellular electrodes and one intercellular electrode. You hear, you see the intercellular recording. This is now under deep anesthesia, ketaminexilocene. That's why you have this pronounced down and up states. In a wakeful state, it looks pretty different. And this is an extracellular recording. Okay? And this is already high-pass filtered. So high-frequency components are the components we use to extract spiking activity. The lower-frequency components we use to extract local field potential. So how fast is a spike? What is the single-action potential? How long is it? And what do you think? Twenty milliseconds. Twenty milliseconds? Okay, that's a cold brain, but can be. How about this rat here? Seconds. Yeah, two milliseconds. It, of course, also depends on what you actually measure. Okay? Let's say the up-stoke peak is of an action potential. If you measure an intercellular, it's maybe two, three milliseconds, but then you have after hyperpolarization. The whole thing scales a little bit with, in particular with temperature. So it depends on what type of animal you work on, whether it's warm-blooded or not. So if you want to have a one millisecond duration, what type of sample frequency do you need to properly actually estimate this? Between 10 and 20 kilohertz. So, exactly. So 10, 20,000. So one millisecond would be, you know, one millisecond would be a thousand hertz equivalent, let's say. So you need to 10 or 20 times higher sampling frequency to properly see the form, the exocellular form of a wave form of a spike train of individual spikes. So this here is recorded with 25 kilohertz in any case. This is now a raw recording, and you see lots of these little thingies here, and these we call spikes, okay? These are the spikes. So how do we get from spikes to spike trains or from this recording? So this is a recording with a rather good signal-to-noise ratio. So what is the amplitude of an action potential if you measure it intercellularly? I mean, probably everybody knows, but just one answer. So if you measure intercellular from a neuron, what is the typical action potential size, at least in vertebrates? 50. What? 50 inverts. Well, from bottom to peak it's... 100. It's maybe 100 even. So let's say from minus 60, minus 50, minus 70 to plus 20, but yes, in the range 50 to 100 millivolts exocellular here, we have maybe 50 to 200 microvolts, okay? This is a thousand times smaller signal, okay? That's already a problem. And this is actually a particularly good example. And now the next step is you have this what we call grassy. That's why we like to make it green, this grassy signal. And you can already see here the up and down states if you wish. Anyhow, then you start with the threshold. So what most people do, 99%, is you threshold the data and everything that causes a threshold, you call it a spike, okay? Now depending on where I put the threshold here, I have quite different numbers of spikes, okay? The load threshold blue here gives me many spikes. The highest threshold obviously gives me fewer spikes because not everything is causing this threshold. So how do we get here? How do we get from here to a fine rate? So another example here and you now clearly see the different thresholds give you different numbers of spikes, yeah? And if you don't try to extract single units, and I will talk about this in a second, then you can say, okay, we use multi-unit activity. So that just means we take whatever comes across my threshold, every spike, and I think that I call this a spike from multiple neurons, okay? It's some sort of population signal of close by neurons. And actually there's nothing wrong with using this. If you do decoding, for example, it has a lot of information. There are interesting papers out there where they show you that with single units you usually have less information. It depends again whether you want to understand what single neurons do, okay? Then this does not suffice. Okay, this is maybe a bit bad quality, but this is just a blow up here. So this is a typical spike wave form. It's typically triphasic why it's the temporal derivative first approximation of the intercellar signal, okay? So whenever the upstoke of an intercellar action potential when it's fastest, this is the peak here, okay? In this case, the negative peak. And this is sort of the after hyperbolicization peak or the down stroke. So typically you have triphasic signals. This is if you average across all of these five, so all of these magenta ones here, then this is your average spike of a multi-unit spike twin. And then we have this what we call a spike twin. And the spike twin, obviously you know that we are not interested in the amplitude. The amplitude has no information for us. We assume that action potential, generation, and transmission is a unitary process. It's sort of an event in time and only the event, the timing is relevant, not the amplitude in first approximation. Question, yes? So the question is whether it conveys information about the stability of recording. I would say no. Ideally you have the same amplitude for the spikes from the very same neuron. That would be stable. But the size depends on how far your electrode is or how much of the signal you pick up. Yes, if you have electrode drift, the amplitude changes over time, but that's not about the amplitude per se. So if it changes over time, and yes, you're right, this is already addressing a big problem that is often sort of under the carpet, electrode drift and non-stable recordings. So anyhow, so this is a multi-unit spike twin. You will be working on single-unit spike twins today. Single-unit means they have been sorted. The data you will work on is actually a bit older already and it has been sorted in online fashion. So people actually followed shape waveforms on monitors and try sort of, yeah, we do it on the fly during the experiment. You do the sorting, it's not necessarily so bad. This here is an example for the convenience of Ben here from a honey bee recording, extra cellular recording from this case mushroom body output neurons from the mushroom body of a honey bee and you can see rather strong single-unit, potentially single-unit that has really high amplitudes. That's an ideal case of course and then there's a smaller one and you can identify them for example by finding templates and do template matching. The spike sorter here is a spike sorter from Software Spike 2 that comes from CED. It's not necessarily a very good one because it's pretty much subjective. On the other hand, it's widely used. If you don't have 100 electrodes but only 10 channels or so, it's widely used in many labs. Basically you generate templates and then you sort different spikes in by the shape. If you look at principle components, you already see that there's of course an overlap or in other words it's really hard to do proper or good spike sorting. Many people try it with different methods. I don't think there's anything perfect out there and this is two papers that I like to cite that have really tried to look into how good is our spike sorting. This publication here is from the Hagai Bergmann's lab and they are really, let's say, very good experts on monkey physiology and they have used in this paper, they said we use by our criteria best data set and we try in a holistic manner, try to estimate what are the errors we make. Here Christoph Poussard and colleagues, they used I think in this case, they had ground truth from an interstellar recording and what they find in these two publications is you have about 10% error. 10% error for its positive means from a single unit spike train there are 10% of the spikes should not be there and another 10% that should be there are missing. That's bad news because this is typically best data set and these are really experts so if you or I do that, we can also have 100 or 200 or 300% errors in theory, the scale is open and that's problematic. I remember a long time ago, Sonja Grün and I set in front of data that was online sorted from the same experiment and offline sorted and we tried to bring the things together, there was no way. It was completely as if it had been different monkeys. Anyhow, so single unit activity is not single unit activity so whenever you read papers, be careful about the interpretations. For interpretation of the shape of X-cellar spike waveform let me try to do this in one second. Can you see that? Yeah. Okay, let's assume an interstellar recording. Okay, let's say in an active brain maybe minus 60, minus 55 millivolts and then you have an action potential. It's not a particularly nice drawing but okay, this is my action potential. So channels open, so you have voltage gated channels and they self excite and whatever you can read about this and you have this upstoke very fast then it goes down and this would be the first derivative. Now if you do an X-cellar recording, you always do it via an electronics that involves capacitors so you don't measure the DC part of the signal but only AC part, mainly to avoid drifts in the electronics and to not measure drifts in static electric fields. So this is a timescale here so this would be maybe one millisecond, zero, two and so on. Milliseconds let's say. And if you look at this signal exo-cellarly if you can still see this down here then basically this is the steepest, the fastest wise time and this will be your peak here in the exo-cellar signal and then this will be zero. So basically what happens is something like this. So this will be zero, okay, suck. Then this is the fastest, this will be the peak, this peak, okay and then this will be zero again, so this is zero, okay and then this comes back and this is your last peak, okay. You have one, two, three peaks, exo-cellar that corresponds to one, two, three fastest components in your action potential. Be careful not to be in front of the camera maybe. Okay. So this is, and as I said so if you have a capacitor in between so again simplifying things a little bit you will not measure the absolute, I mean the DC part and in the first approximation you have something like a first derivative, okay the signal that your electronics usually picks up. I mean this is, but this is not a problem just because it looks different than the inter-cellar shape, yeah and I just want to say we have, now we arrive at the spike train and I just want to say that in statistical physics we would call this a discrete time series and spikes are there called event, events, okay so there's a lot of body of literature in statistics how to treat these types of spike trains and there's also literature in Storastic theory how to treat point processes to model such event series and for our purpose if you just keep the spike times you have very lightweight data it's just a list of spike times, okay but for some reasons for some methods and also for example for the firing rate estimate we have to translate it into binary representation and then basically we have many of zeroes and only sort of ones where ever a spike occurs and we have to think about a good temporal resolution or a good temporal resolution of our binary representation what would be a good resolution if you want to go from a, you know here it says 3.56788799 seconds five seconds or something so it has a microsecond resolution but you don't want to have a microsecond resolution for your binary data because then your hard disk is full in a minute so what is a good resolution if you go from here to here for analysis purposes let's say maybe, I mean what would you do if I give you a list of data of spike times so what is a good resolution but a thousand hertz isn't necessary because we only have, you know how wide is a spike again a spike is at one to two milliseconds so that's why we usually like to just go down to, usually and you will have data with one millisecond resolution so once we have the spike we assume that from the same single unit there cannot be another second spike it's anyhow hard to deconvolve spikes that sit on each other, let's say so that's why we usually use one millisecond but yes, you might want to have a higher resolution if you really look into very high synchronization of activity sometimes, but these would be rare cases