Are we ready to start? How's everyone feeling tonight? Awesome. Couple, last couple people coming in through the door. Alright, we'll just get started. So, hi everyone. My name is Sidney. I'm from Montreal, Canada. I'm one of the co-founders of NeurotechX. I have a Bachelor's in Psychology and Computer Science. My name is Steve. I'm the founder of PuzzleBox. We make brain-controlled toys and games for consumers that are all completely open source. And I'm Melanie. I'm also one of the co-founders of NeurotechX, and I'm doing a PhD in Cognitive Neuroscience. So, this is me and Mel's first DEF CON experience, so cheers. And the last person who... who contributed to help for the slides in this project is Hector. He's originally from Mexico, and he has a background in computer engineering. Also, special thanks to some of the members of NeurotechX that helped out, Enzo and Nicolas in Montreal, and John, who's right in the front over here. So, a little bit about us. We're a non-for-profit organization, which is essentially trying to build a network of enthusiasts around the realm of neurotechnology. So, for us, you know, we really want to be able to help. We want to be able to bring people together. You know, similar to how there's communities in Python and other programming languages, we want to be able to bring people together who are passionate about working with technology and the brain. So, we provide opportunities for people that, you know, are maybe a little bit newer to the field, that would like to learn a little bit more, and also have opportunities to learn things that are a little bit more advanced as well. We also try to work on a bunch of projects as much as we can together, and hopefully we can help to push the field forward in the realm of neurotechnology. We have a network that's been growing in the past year to quite a big scale. These numbers are a little bit out of date, but we're around 16 chapters right now, with about 4,500 members as part of our meetup. So, just to give you a quick idea of the schedule, first we're just going to talk a little bit about brain biometrics, and then Melanie over here will be talking about brain stimulation. Okay. All right, uh-oh, ball of death. Ball of death. All right, so I know what the next slide says anyways. Oh, okay, so we passed one. So, when I say the term biometric, raise of hands, who knows what I mean by that? Okay, so the majority of you, so I'll quickly kind of go through this part. It's still loading. All right, so essentially, yeah, so for those who are not really familiar with the term, essentially what it means, it's using some form of biological trait to be able to identify you. There are certain advantages of using something like this versus passwords or RFID cards, obviously because there's something that's a little bit more unique about it and much more reliable. Obviously, there's issues in terms of privacy and people gain access to your bio data that you may not necessarily want to have access to, and the potential increase in assault if someone has to try and get into a system. There is two categories that it falls under, physical, which is essentially things like measuring the veins in your palm, in your hand, facial features and probably the most well-known one, your fingerprint, and more behavioral ones as well, too, such as gait, which is kind of like the way that you walk, and even things like the way that you type, which is in fact what Coursera uses to be able to validate you when you're doing a quiz to make sure that you are the appropriate user or the appropriate person doing the quiz. There are seven factors that you should be considering. One, choosing a biometric for your own work or house. Number one, universality. Does every person identified for a system have this trait? Number two, uniqueness. It should be something that's sufficiently different from relevant populations to be distinguished. Number three, permanence. How permanent is the trait? Is it something that can change with age or the time of day? Number four, measurability. How easy is it to measure the biometric? Number five, performance. How accurate is the bio signal? How quickly can it be acquired? Is the tech robust? Number six, acceptability. How willing is the target population to use the biometric? And obviously maybe the one that's most interesting for the crowd here, circumvention. How easy is it to simulate or fake the signal? So I bring it back to brains and the biometrics or using your brain as a biometric. It's something that's really getting a lot of popularity in the past five or six years with a shit ton of articles being written in 2014, 2015 especially, and over the past five years, 100 publications. One notable one, which some of you might be familiar with once this slide actually loads, is an fMRI study which was done as part of the Human Connectome Project, which is essentially a project to be able to connect and figure all the connections within the brain. So it was something that was able to accurately predict if an individual was, if you were looking at the right individual 98% of the time, so you'd have two different sessions and you'd be able to kind of connect the two sessions together, specifically looking at a resting state when you're doing activities that involve the resting state, which I'll explain a little bit afterwards. However, it is not something that's necessarily, that you need to do with something that's a very expensive machine, which is, you know, an fMRI. You can in fact do it with technology that is a little bit more accessible. So Steve over here will explain a little bit more about that. All right, again, we're just working out our slides here. We're going to talk a little bit about brain-computer interfaces in general. So any sort of system like this that's going to use the brain for biometric, in fact, any kind of system that's going to use the brain as part of its feedback loop is considered a brain-computer interface. And just to give you sort of a quick overview, when you think and move and act, there's messages that get passed back and forth between the neurons in your brain through chemical and electrical processes. So when a cluster of, when a neuron, when the synapse in the neuron fires, there's a small amount of electrical energy that is released. It's on the microvolt scale, so we're talking millionths of a volt, but you can pick this up at the scalp level using an EEG. An EEG is just a very sensitive voltmeter. So what we will do is put electrodes around different structures of the brain on the scalp that we care about, depends on what we're trying to accomplish, and we will read the electrical signals that are firing underneath. We get a nice little squiggly line coming out of that. The second step is you have to understand that we might care about a cluster of neurons that are, say, the size of a neuron. That's the needle point. But once that signal hits the skull, it expands to the size of a dime. And once it gets to the scalp and the skin, it's now the size of a quarter. And that quarter is overlapping with all the other clusters of neurons in that region that we don't care about. So we need to do lots of analysis to pull the signal out that we care about from all of that relative noise. There's a couple ways we do that. One of them is, say, frequency analysis. If we are, say, we want to know how focused a person is. We will look at the spikes in their brain wave, and we will look to see if there is a consistent firing within a certain frequency range. So just imagine that EEG is a microphone over a drum. And when a message passes underneath, it's like someone beating on the drum. If we hear a steady drum beat within a certain range, that's associated with focus from the neuroscience. So in this case, we would do a bit of processing to try to eliminate some of the noise, and we are trying to pull out that feature, which in this case would be focus. Once we have that feature, we want to translate that into some sort of metric we can use. Say, put it on a scale from 0 to 100%. How focused is the person? Once we have that measurement, we can play that back to the user. We can do it visually. We can do it physically. We can do it through any other method, which will then be perceived by the brain, and the loop continues again and again. That is a BCI. So Steve here is going to do a bit of a demo for us. So he's going to get set up in a little bit. So essentially, just from here, we're going to explain a little bit about what type of brain activity we're looking for and how we acquire the signal. So there's two main types of brain activity that we're trying to acquire. One is called neural oscillations, and the other one is called event-related potentials, or ERP. Essentially, what a neural oscillation is, it's just a rhythmic pattern of activity in the brain. So if you were all to close your eyes right now, you would start to create a certain wave of pattern that would be capturable with one of the devices, which is specifically, you would see a change in the amplitude of the alpha range. So these are kind of like the standard neural oscillations that most people are familiar with. You've probably heard of the alpha brain wave or the beta brain wave, but these kind of correspond to different types of mental states, with the lower kind of frequencies, such as delta and theta, being more kind of like an REM kind of sleep meditative state, and beta being much more you're in a focused state. So this is kind of how we build some of the applications. The other thing is event-related potentials. Okay, so just taking a step back, another example of how we might use an ERP and a BCI, there is a signal known as the P300. And the easiest way to understand this is, imagine you lost a car in a parking lot, and you are walking up and down rows of cars, and those cars, think of that as a random sequence. You're walking up and down the cars, and there is a whole cluster of neurons in the parietal region of the brain, that's just in the back here, that's the region responsible for pattern matching. And there's a recognition going on, that's a car, that's a car, that's a car, that's a car, there's my car. And the moment where it clicks for the brain, and it sees something with personal meaning in that random sequence, there is a spike in electrical potential, usually approximately 300 seconds later, hence the P300. Now the way this has been used in practice, is say you have someone who is physically paralyzed, say with ALS. They can't move, they can't communicate. What you might do is take a grid of characters up on the screen, say they want to spell the word dog. Every once in a while, all the different characters are going to light up randomly, and every once in a while, the D is going to light up. And when it does, that's the thing that has personal meaning in that random sequence to the person. So every time the D lights up, there's a P300 signal. So after a couple blinks, the system is able to recognize O, every time D blinks, that's what they're trying to spell, D goes up, they move to the letter O. And in this way, people are able to communicate, even without physical interaction. So just a little bit more explanation on the graph on the right there. This is essentially kind of how we map out the ERP responses. So first thing before kind of going into more detail, what you should take a notice of is everything that's below the x-axis there is positive, and everything above it is negative. This is just kind of the standard that's done in ERP research, so it's nothing beyond that. It's just the kind of way that they like to work with it. The other thing that you should take, so going a little bit more into the signal here, you'll notice everything that's in the positive range for the most part is P, which essentially stands for positive. So that is occurring x amount of time after the onset. And everything above the x-axis is negative, so n. So when we're saying, you know, P100, we're saying a positive response. And the number that's afterwards, the letter corresponds where you actually see the signal. So say we provide the stimulus at point zero, and if you see a peak at 100 milliseconds, then that will be the P100. Or in the case for what we explore a lot, the P300, it's around 300 milliseconds. But it's a range usually between 250 to about 400, 500 milliseconds depending on the individual. So now that you kind of understand a little bit about the brain activity and what we kind of look at, you have to think about how do we acquire that signal. So the signal acquisition for a very long time was done primarily in research with kind of massive electrodes or massive configuration of electrodes. So this is what most people think about when you're thinking about EEGs. So, you know, a lot of them in kind of a really dense area. The types of electrodes that you're in fact using, you can get different types depending what your use case is. So you can either have wet or dry electrodes, and you can either have passive or active electrodes. Wet electrodes are essentially what I have here in my hand. It requires a conductive paste to be between the skin and the electrode itself. So you'll get something like 1020, which you can get a pack of I think about four or five for about 50 bucks on Amazon. It's actually even cheaper here in the US, so maybe a little bit less. So you essentially, the reason why you would want to work with a wet electrode is because you get a much better quality signal. The thing is with skin is that it generates a lot of resistance, and so therefore if you have any form of conductive material it makes it a lot easier to get the signal. Obviously the downside of it is that you're going to have paste in your hair. So if this is something that you need to do every day with the same participant, they may not necessarily want to do it after the third trial or the third day. So on the other side of things, you have dry electrodes. Dry electrodes are essentially something that don't require the paste. They actually have these pins on them that makes it a little bit easier to acquire the signal from the scalp. But the obvious downside is that you're getting a much worse quality signal. But if you do need something that you want to do every day, dry electrodes might be a better option. But it really depends on what you want to do. You also have the option to be either passive or active. Passive electrodes are just essentially the conductive material that runs through the wire that will then connect to the board. So a board like... So a board like this. Working with passive electrodes is much more beneficial if you want to use multiple of them because they're actually cheaper per electrode. But obviously you have to be very careful in terms of not touching the wire too much as you're doing an experiment. You don't want the wires to be too long. You want them to be properly shielded. Active electrodes essentially have the amplifier and potentially the pre-processing done right at the study of the electrode. So it's much easier to get a good quality signal. But the obvious downside is that you may have to work with less of them and they're much more expensive per electrode. So now you understand how we actually acquire the signal. You have to actually know how to place them properly. There are certain consumer EEG devices out there that take care of that for you. But if you want to work with something more like this, one standard that you can work with is the 1020 international system. So if you kind of look from the picture here, every placement on the left side is odd numbered and everything on the right side is even numbered. And the letter that corresponds to it is just essentially the part of the brain that it's over. So O for example stands for occipital. The reason why it's called 1020 is because essentially what you're doing essentially what you're doing here is you're measuring from the front right over here to the inion in the back right over here. I don't know how well people can see that. But you're measuring that distance there and then you're either doing 20% of a distance from there to the first electrode then 10%. But it really depends on the amount of electrodes that you're working with. So now Steve is going to demo a feedback device or like the full BCI system. Alright guys, so you won't be able to see this too well in the back, but you're welcome to check this out later up close. But effectively what I have here is a standard consumer-grade EEG, just one electrode over the prefrontal cortex. And I have an interface here. There's a bit of a squiggly line. And if you can see it, if I blink a few times in a row you'll see giant changes in that signal. Those giant changes are actually EMG. Those are muscle noise. So EMG is an order of magnitude 10 times larger than the brain waves. But if you notice even within that, the very very small points, those are actual clusters of neurons that are firing generated by this voltmeter. And so what this application does, which is again all open source, there is a red bar that you can see that is a measurement of how focused I am. It is based on a rolling 5 second average. And it is what percentage of the time did my brain, or at least my brain wave from the sensor, spend in the region associated with concentration. And the way this algorithm breaks down is between 40 and 60 percent is average, 60 to 80 is focused, 80 to 100 is very focused and so on. So what we do with this is we tend to look at where a person's current range happens to be and we use a little slider on the app to set a target. And I am going to put mine right about there. And if I stop talking for a second, we will look to see if I can get my focus above that target and that is going to send a signal to fly the helicopter. So let's give this a go. . As you can see as your focus gets distracted the average starts to drop back down and the helicopter stops. What a show off. So now that you kind of understand how the full system kind of comes together we can talk a little bit about EEG biometrics. So there is a couple different approaches that have been done in the literature from what we have discovered. One of them being with a visual stimuli causing a visual evoked potential which is essentially like an ERP but with an external stimuli. So a couple of notable research articles that have been done that could essentially be replicated is number one there was one person who did something in 2009 where they worked with one electrode right at the CZ location which is right about here so where they flashed an image after an image after an image with a delay of about 500 milliseconds between each image and they asked for a person to look for a target image. So in this particular case they were working with nine images and they asked for the person to look for image number two. So with this in mind they took that analysis along with the analysis of the non-target pictures that they were looking at and they were able to use this to get a person to be identified at a 97.6% accuracy. The highest percentage that I did in fact find was at around 99.15% which was with about 61 electrodes and 20 subjects and 40 trials and it was kind of like the same type of task as the first one. The other type of approach that is done is with resting state. So this is a little bit easier potentially well the signal processing and the classification is a little bit more complicated but essentially what it is is that you would ask a person to sit in a room dimly light, very very romantic environment minimal noise and just ask them to close their eyes for about a minute and capture that activity. So it's at about a sampling rate of about 200 hertz so you'd be doing 200 hertz 200 times 60 to get the total amount of samples. So in the experiment they worked with 56 electrodes and they were able and with 45 subjects they were able to get an identification accuracy of about 98.73% and the potential reason why this is is because of the fact that at least for the alpha and beta rhythms those neural oscillations I was talking about earlier carry individual specific traits which can be which are being claimed to be genetically induced so there's a potential genetic element within the neural oscillations. They also did some research actually before I jump into the next part they actually found that if they worked with a configuration of three electrodes that's what gave the best results so they only needed to work with three in the O1 POZ area in O2 which is essentially kind of like back here where this part is. So the other thing that they also explored is if you can actually do a session wait three weeks and then try it again and see if you can still keep that accuracy and they in fact did. So you might be asking yourself at this point should I use this, should I build my own system to be able to protect stuff at home or at work? The short answer is no. The long answer is no. But no. The reality is it depends. It's something that is really dependent on the type of activity that you want to acquire and the type of system that you want to put in place. So if we go back to the seven factors that we were talking about earlier number one if we look at universality e.g. biometrics it really depends on the type of brain activity. If for some reason you were wanting to do something with motor imagery which is the idea of imagining for example yourself closing your right fist I think 30% of the population can't in fact do that type of task. So not everyone would be able to do it. Uniqueness, I would say it really depends on the type of brain activity. For me I'm not too familiar what would be better in terms of something that's a little bit more unique but I feel like there should be more studies that are done. Permanence, this is where e.g. kind of loses its value because of the fact that it is something that can change quite easily from different factors such as if you're being if you're tired for example, if you're stressed the time of day can change your brain activity if you were to get a concussion that can have some fuck up major shit but it can be pretty bad. Measurability, it really depends on the headset if you're working with something that's research grade you'll get a much better result obviously and also the environment where it's being recorded so you have to consider that. Performance, once again it really varies on what you're looking at the hardware and so on and so forth and acceptability, for me I think it would have to have the appropriate form factor and design depending really on where it's going to be used. But for circumvention this is where I think e.g. biometric really shines because of the fact that it is a dynamic biosignal essentially meaning that you can get brain activity in different ways by doing different types of tasks it means that say for example one system were to get compromised essentially all you would have to do is change the type of protocol and acquire a different type of brain activity and essentially you could still use the brain as a biometric so this kind of makes it very powerful for that reason. The other thing too is that if you wanted to test if it's a live signal you could use something like an SSVP which Steve will explain a little bit more. So just very quickly if you had a light flashing very fast let's say 15 times a second if you look at it, part of the way your vision works is a cluster of neurons at the back of your head in the occipital lobe will harmonize to that so if you have electrodes back here and you're looking at a light flashing 15 times a second you'll pick up a 15 hertz signal and if you were to redirect your attention to a light flashing 20 times a second, within a second you would see a 20 hertz signal this is almost completely unconscious all you have to do is direct your gaze so if you're running through one of these tests to have the person unlock and then all of a sudden a portion is flashing, you can detect to see if you're looking at a live brain. Exactly. So other things that you should consider as well. Don't use EEG biometrics leverage potentially other biometrics to go along with it so don't just use EEG to be able to authenticate an individual but do use the benefit that it does provide in terms of circumvention. The other thing you have to think about is that there's a lot of field testing that has to be done in this. It's being done in really controlled environments so there are designs that have been done before with consumer EEGs which in fact were able to pair to a smartphone and you could essentially use something like that and just walk around and see what type of results you get in different environments. The other thing too is it's not going to work with non-compliant participants so if you ask a prisoner the most notorious one being Charlie Brown if you ask him to sit in a room in a dimly lit room and ask him to close his eyes for a minute I really don't think you're going to get the results that you're looking for. So take that into consideration. However, if you want to make your own just for the fun of it or to contribute it is something that is in fact very possible simply because of the fact that the signal acquisition devices that are out there right now and the ways to acquire it via different types of software is all available for free. So Steve will talk a little bit more about the hardware. So just a couple quick examples this is the NeuroSky MindWave Mobile this is what I just used for the helicopter this costs about $100 it gets you access to the raw EEG but it's just one electrode. It goes over the ear. Another example that came out about 2009 the Emotive Epoch, now this has 14 channels this allows you to get more filtering for different areas, remember we talked about the dime and the quarter, the ranges and so on. The only issue here, well the couple issues here first of all it's $700 but also the placement of the electrodes is fixed and they're not necessarily ideal for what we are trying to do or some of the other popular BCI paradigms. On top of that the licensing model for access to raw EEG is a little strange. They do have a cheaper version, it's about just half the size of the head for 5 channels for about $300 stepping down again you have the Muse from Interaxon up in Toronto this is for 5 channels, again across the prefrontal cortex so you're not really getting anything different as far as region that you would get out of the NeuroSky but you're going to get higher fidelity. But our favorite is actually the OpenBCI so that's what we have over here and effectively a group over in Brooklyn took TI's ADS 1299 EEG chip and they made a breakout board with Bluetooth, a bunch of other smarts to it and the really nice thing is that they publish absolutely everything about their product from top to bottom, schematics firmware, software, everything is open source and they've even chosen a license that would allow you to take their designs and commercialize them yourself without conflicting with them. So just looking at cost, if you wanted to use an OpenBCI today the 8 channel board is $500 but if you wait a month they have a 4 channel version coming out next month so you can buy one of those for $100 Once you have the board, you're still going to need the electrodes and maybe an apparatus to set them up. You can find lots of guides online. We're using a construction headband, costs $6 off Amazon. You could build this whole system for about $150, so very friendly to the DIY hacker. So before moving forward and buying the hardware and establishing your own system, make sure you do have a solid protocol. Essentially what I mean make sure that you acquire the signal and you have a good system of acquiring it. If you ever do need help with it, reach out to your friendly neighborhood neuroscientists. A lot of them are very, very nice individuals and will be willing to help you. But take into consideration to build a system it may take you about 6 to 12 months. And just to kind of explain how the importance of protocol is, when we were trying to build something to be able to demo for you guys we were working with an N-400 response which was essentially looking at your reaction to acronyms that you do know versus acronyms that you don't know. So essentially what we learned from this is that we did everything to the book, except we were not acquiring enough data. And this is essentially where we failed. So make sure, I think we were recording 3 minutes of data when we needed to record 45. But there are ERPs out there that have been used with the OpenBCI which you can in fact leverage. And because there's research that have worked with that paradigm, you can in fact now build your own to create your own secure system. So if this is something that's interesting for you whether you want to try or build your own, have an open discussion about the domain or integrate potentially other biometric standards or frameworks. To get started, number one you can go to our GitHub and you can go to either BrainLock which has some of the scripts there and a little bit more explanations. Or if you're a beginner to all of this, you can go to AwesomeBCI which has a bunch of references there. You can also go to John's GitHub as well. He has a bunch of really cool projects over there. And Steve's as well if you want to check out his projects. Otherwise if you want to learn more about us, you can always go to our website at neurotechx.com. At the bottom of it, there is a link to join our Slack and we have a public channel now to discuss EEG biometrics. So thank you very much. And we have a couple minutes for questions if you guys are keen. Anyone have any questions? Yeah? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .