Sunday 9 November 2014

Full Stack STEM

Working on lesson plans for the 'Scientific tool chain' . https://github.com/alistairwalsh/neuralcode/wiki

A dialog about neurology

On July 2nd 2014, Rohan posted on the BCI2000 mailing list. Since then we've been corresponding about BCI and EEG. I've posted the conversation here and I hope this will help out those who are new to EEG and prompt discussion. Please post comments if anything isn't clear or you disagree with any of my answers.

Hi everyone, 

 I am a 15 year old boy very passionate in the field of artificial intelligence and brain computer interface. I want to design a setup whereby I can detect brain waves with eeg and use them to control devices on the basis of amplitude. How should I go about it.

Thank You.

Regards,

Rohan

Hi Rohan,

You'll need access to an EEG amplifier and electrode cap. OpenBCI are almost ready with their project and I think that will be the cheapest way to buy your own. The other option is belong to a university that has this equipment.
Problem with the university is they may make you do years of study before they let you play with an EEG setup. I was in 4th year before I was allowed access to an EEG setup on a regular basis to work out BCI. The good side is they will teach you the theory about electrical brain activity and how EEG works, as well as the theory behind the relationship between this activity and what we call thought and behavior.

After you have the hardware, there is a choice of software. BCI2000 is great. After trying out a few others I stuck with BCI2000 to build a BCI based on the Mu rhythm.  If you know C++ or can learn it, it will help when you want to do things with BCI2000. There is also the option of using the BCPY2000 project which uses Python.
I'd suggest learning Python through the many excellent online courses (Codeacademy's python classes and Coursera's "Programming for Everyone"). Python is a great language to start with, you may stick with it as you learn BCI or you may move on to C like languages once you understand programming concepts. It also gives you an alternative to MATLAB when you want to analyse EEG data. MATLAB is expensive and that's fine if the university you belong to buys a license that everyone can use, otherwise open source is the way to go.

Using amplitude is a great way to drive a BCI, I'd suggest you add these details to your technique.

"Amplitude, in a particular location (i.e. over the motor cortex, electrode locations C3 and C4) and in a particular frequency band (i.e. reduction in the Alpha band and increase in the Beta band)". 

This activity is produced in most people when they move their right hand (C3) or their left hand (C4) or even when they think about moving them. So it's great for moving a cursor left and right across a screen.

Knowing the terminology like 'motor cortex' and the names of the electrode locations 'C3 and C4' as well as the names for the different frequency bands is important because that's one way you can convince others you know what you are talking about. Think of it like a secret language you must learn to be granted access to the magical cave of the EEG amplifier! Just a different version of "Open Sesame!". You'll find lots of the information on Wikipedia.

BCI2000 has a great tutorial on exactly how to do Mu rhythm BCI (I think this is what you want to do) so maybe you can start there.

Good Luck!

Hello sir, 

I had a question related to arduino and atmega ...... If an arduino gets an input of frequencies below 20 hz can it be programmed that if there is an input of frequencies then a light or led will turn on and if not the led will remain off???

Regards

Rohan

Dear Rohan

Two ways to do this as I see it. The first would require FFT calculations (if I am understanding your question correctly) and the humble ATmega328 is not really powerful enough to do this in real-time. The teensie 3.0 https://www.pjrc.com/store/teensy31.html with a 32 bit ARM processor is though. It can be programmed using the Arduino IDE. https://learn.adafruit.com/fft-fun-with-fourier-transforms/hardware has a tutorial for doing FFT on a signal with the teensie. It uses the  CMSIS DSP math library for the teensie. This tutorial also happens to have LEDs lighting up at different frequencies, I hope this helps.
The other way would be to create a low pass, or band pass filter in hardware, and detect a certain amplitude of signal after the filter.
Inline image 1
This is a basic Butterworth filter from http://www.corollarytheorems.com/Design/filter.htm. The choice of resistor and capacitor values will result in different cutoff frequencies.  

I believe it is possible to use the simulink package for MATLAB to design a filter in software and transfer it to the Arduino but I have no experience doing this.

Cheers

Hello sir, 

I am currently using a 9-12 hz band pass filter to allow only this specific range of frequency to pass through.I have attached a schematic picture of the circuit can you help me identify that whether the circuit is correct . I Have also used an instrumentation amplifier ad620 to amplify the brain waves. Can You please help me??

Thank you.

 

Displaying 20140718_100144.jpg


hello sir, 

 I wanted to develop an EEG circuit , could you please help me or get me in contact with some expert who could help me...

Thank you..

 

hello Ma'am

There is a great news, I have completed the project and I am able to control a led using brain waves. This wouldn't have been possible without your help, I am certainly grateful to you. Thank you once again. I hope you don't mind if I remain in touch with you and if I have further questions in the near future....

Thank you.

Excellent news Rohan,
Please keep in touch and I hope I can be of assistance in the future.

Hello sir ,

 I came across this article on PubMed relating brain interfacing and they stated that they could control a rats tail and even humans by brain to brain interaction. It is not explained deeply in the article. Could you please enlighten me on how exactly are the brain waves of humans and rats interacted.

thank you.

Rohan 


Hi Rohan,
I can't see an article. It may not have been attached or the mailing list might have removed it. If you can give me the reference it I could look it up.

sir ,

 here are the links

 I am unclear with the concept that they have used to transmit signals, could you please help me out.

thank you.

The recording is being done with EEG and the triggering of the second persons reaction is being done with Trans-cranial Magnetic Stimulation (TMS). TMS creates a magnetic pulse which causes the neurons within its magnetic field to fire. You can see in the first article, the man wearing the purple cap, has the TMS 'coil' over his left motor cortex. The left motor cortex controls the right side of the body. When the TMS pulses (when it receives the signal from the EEG connected to the other participant) it briefly creates a strong field over the motor cortex and causes the neurons to fire, which causes movement of his hand.  

The second article talks about using ultrasound which I haven't come across before. The principle is the same, it is a method of causing the neurons in the motor cortex that are in control of the tail to fire.

Sir,

 

 generally there are four different kind of brain waves - alpha, beta, delta and theta all varying from 0-30 Hz. But now it seems that more importance is being laid to the High Gamma waves having a frequency from 70-200 Hz. Why is it so? Why are gamma waves of importance in The research of Fmri and Electrocorticography and EEG?

Gamma is thought to have the role of collecting or combining the information from the various specialised parts of the brain. It is also extremely difficult to record and is usually contaminated by muscle activity ( as measured by an EMG). The sheets of muscle that lie on the skull, produce high frequency noise even when a participant is completely still. This was examined by a group of researchers who recorded EEG while under general anesthetic. Their findings suggest that a lot of the Gamma that is recorded by EEG is actually tonic muscle activity rather than brain activity. That is not to say gamma EEG doesn't exist, it just points out how hard it is to record without resorting to intra-cranial recording. Gamma is very interesting because of its connection with higher thought ( for want of a better word) but as always, the brain acts as a unified whole ( like an orchestra ) . It is interesting to look at individual elements but the meaning is in how it relates to the whole.
Good question! Thanks.

Sir,
Usually BCI work on the principle of brain waves say for example the alpha waves or the MU rythm for controlling devices based on these waves. But is there actually a way of differentiating between thoughts and putting them into actions? The BCI i have made is an eeg based Bci working on the principle of alpha waves measures over the occipital lobe but can i actually differentiate between thoughts. 

Hello sir, 

  I had made an EEG based Bci working on the principle of the alpha waves measured over the regions of o1 and o2 . I could switch on and off a led using the alpha waves whose amplitude is controlled by eye blink which is measured over the occipital lobe. How do I make further advancements and something more complicated, efficient. or something based on p300 erp.

Thank you

Rohan

 Dear Rohan,

My apologies for taking so long to reply. Your question is a good one and I've been thinking a lot about how to answer. Your question about identifying individual thoughts is something that many people in neuroscience are trying to answer. While it is true to say that there is a connection between brain activity and thought, they do not seem to be the same thing. There are also different types of thoughts from direct action based thoughts about the physical world like thinking about clenching my hand to abstract thoughts about constructs that don't really exist like how I feel about the Wizard of Oz story.

There are also different ways to measure and relate brain activity. From location to frequency and time relationships. The areas of the brain that are associated with hand movements are located in a well defined area of the cortex. Sensors over that area will show activity when the area is activated and no activity otherwise. 
Thinking about a movie or reflecting on my feelings about it wouldn't be so neatly confined to a small area. It would involve many areas of the brain interacting, including brain regions deeper than the cortex  when I involve memory and emotion.

The event related potentials are distinctive brain activity in response to a particular stimuli. The P300 is a distinctive positive going wave at approximately 300ms after identifying and storing in memory an distinctive event. The 'oddball' paradigm is something that reliably produces this response and consists of a high tone (the oddball) amongst more common low tones. The low tones are more common, so the high tone is unusual when it occurs. If the participant is asked to count the number of oddballs, the P300 is produced as the identify and update their memory. So this is one way to identify a particular thought type. 

The Alpha wave can be thought of as a carrier wave. When the brain is doing active processing, the alpha wave decreases and the other frequencies are higher in amplitude. When that task is done and the participant relaxes and does no processing, the Alpha wave will return again. Over the occipital cortex (O1 and O2) the Alpha wave is quite prominent when the participant closes their eyes. The theory is that the occipital lobe has no input from the eyes and therefore has little to do so the Alpha wave dominates.
So a BCI based on Alpha over the occipital cortex is differentiating activity from no activity.
How is your BCI setup? What determines if the LED is lit or not? 
Sincerely,
Alistair